2018-10-22         Roderick

Why do I have problems running script/x tasks after installing rails 3 beta?

I installed rails 3 beta in my OSX Leopard. After that, I've created a rails project to test it. From inside its folder, I just can't do script/generate, or even script/server.It returns '-bash: script/server: No such file or directory'. How could I resolve this issue? Rails 3 has done away with script/*. Use rails server, rails generate, etc. while in your app's directory.Run rails --help to get the full list. [XXX]In Rails 3, instead of using script/*, use rails. So instead of writing script/generate use rails g (alias of generate) and instead of script/server use ...

 ruby-on-rails                     2 answers                     100 view
 2018-10-22         Roderick

How to declare the welcome file (e.g. index.html) in app.yaml

In Java, the web.xml might contain some <welcome-file> elements. I am trying to do something equivalent in python with no luck. application: wkversion: 1runtime: pythonapi_version: 1handlers:- url: / static_dir: docswelcome_files:- index.htmlAny thoughts? I get an error that "welcome_files" is not understood. One possibility:application: wkversion: 1runtime: pythonapi_version: 1handlers:- url: / static_files: static/index.html upload: static/index.html- url: /.* static_files: static upload: static [XXX]Robert's answer does not work any more. You have to do...

 python                     3 answers                     56 view
 2018-10-22         Roderick

Windows 10: How do I fix a mouse stuck scrolling horizontally?

I had a mouse that was stuck scrolling horizontally.It was constantly mimicking the behavior when a user holds down shift and scrolls the mouse wheel. This made using the start menu, and other native Windows Store apps (e.g. GroupMe), very difficult. It also caused many applications (e.g. Firefox) to change zoom levels when the control key was pressed.I tried unplugging the mouse and using Mouse Keys to move the cursor. The application under the cursor still horizontally scrolled. I tried unplugging/replugging my keyboard if the shift key was stuck. I looked at the Win...

 windows                     1 answers                     11 view
 2018-10-22         Roderick

How to check if a user has provided an argument discord.py

I have just started trying to learn how to code in discord.py. However, I'm not sure how to check if a user has provided an arguement after the command. For example, if the user types !kick, wihout tagging a user after it, it should give them an error message saying something like "Please tag a user". So my question is, How do I check if the user has tagged another user when using a command, and if not, give them an error message.Here is my code:#PyBot by RYAN#2302import discordfrom discord.ext import commandsfrom discord.ext.commands import Botimport asyncioimport chalkbot...

 python                     1 answers                     8 view
 2018-10-22         Roderick

Galera Cluster Database Sync, But not Table Data Problem

I've got a (2) node galera setup and I'm having this weird issue where creating databases/tables works and replicates across the nodes, mean that if you create a database or a table under a database on one node 1, it will appear on node 2. But when data is inserted into database.table on node 1, it does not appear on node 2.What could be the issue? I figured out the problem. I was trying to load MYISAM dumps without converting them to INNODB. Problem Solved and here is the quick conversion for anybody else impacted:sed -i.bak 's#MyISAM#innodb#g' MIGRATION_DATA.sql [...

 mariadb                     1 answers                     50 view
 2018-10-22         Roderick

Read in lines from text line as separate arrays

I have a text file containing lines of strings that resemble an array format. I initially had a list of numpy arrays, and read them into the file like this, where each array is about 5 floats:import numpy as npparameters = [np.array(...), np.array(...), ...]with open('params.txt', 'w') as f: for param in parameters: f.write(str(param)+'\n')Now I'd like to read them back out, as a list of separate arrays. I'm having issues with this however -- below is what I'm trying to do:parameters = []with open('params.txt', 'r') as f: for line in f: parameters.append(n...

 python                     2 answers                     92 view
 2018-10-22         Roderick

Reading path in templates

This question already has an answer here: How to get the current URL within a Django template? 7 answers If you add django.core.context_processors.request to your TEMPLATE_CONTEXT_PROCESSORS setting, it will add the request variable to every template-rendering that uses a RequestContext (which is most of the built-in ones). This is the HTTPRequest object for the current request, the path attribute of which is the requested path. More information can be found in the docs. [XXX]I ended...

 python                     3 answers                     82 view
 2018-10-22         Roderick

Refreshing listview in tab activity from main activity

I have a main activity with an options menu which contains a check-able item. I also have three tabs with an activity, containing a listview each.What I'm trying to do is refresh the selected tab's listview when I change the check-able item menu option in main activity.Any idea about how can I achieve this? Usually when you have tabs, you're using a view pager so each fragment should be able to specify it's own option menu thus keeping the scope to the currently selected list. [XXX]call notifyDataSetChanged() on your adapter in onResume() on the Fragment which has lis...

 android                     3 answers                     50 view
 2018-10-22         Roderick

Able to get image to move in Pygame; but I have to keep on pressing the button to make it move

So, I've used another answer to help me figure out an easy way into moving my player sprite in pygame. The only issue is that the buttons for movement have to be spammed in order for the sprite to move more than the five pixels specified every time the button is pressed.Here's the code in full. The areas in question are the Player() class and the " player." areas in the loop:import pygameplayer_path = "downChara.png" #specifies image pathclass Player(object): #representitive of the player's overworld sprite def __init__(self): self.image = pygame.image.loa...

 python                     1 answers                     84 view
 2018-10-22         Roderick

newbie BigQuery, SQL how to count the number of groups that contain special rows

I am a newbieI using firebase events to track what my user are doing on my website. As a simple example my "happy" use case is a user completes steps A, B, C. I want to count the number of user that have are Happy or not Happy. Not happy is defined as their session does not contain all three eventsHere is my sample SQL with some simple data. I am able to to count the number of "C" events in the happy sessions. I can not figure out how to identify sessions that are not HappyWITH testData AS ( SELECT "id1" as idd, "A" as name UNION ALL SELECT "id1" , "B" UNION ALL SELECT ...

 sql                     4 answers                     65 view
 2018-10-22         Roderick

MS Access SQL IN Clause cannot write to database

I have recently re-written the VBA code in an inherited database, to include the IN statement to connect to the database, rather than have linked tables constantly connected (close to 400 users will have the front-end open at any one time, so it makes attempting to access the database to make design changes near on impossible).However, reading from the database using the IN clause works just fine, but using them on a write statement seems to execute in VBA just fine, but not actually make any changes to the database.The statement not writing is here:CurrentDb.Execute " UPDA...

 sql                     1 answers                     8 view
 2018-10-22         Roderick

MS Access Linked Tables to SQL Server

I have looked into "How to get MS Access Linked Tables to SQL Server", however, I didn't find any results that applied to my situation.I am upgrading a database(db1) from MS Access to SQL Server. I'm needing to get the linked tables from db1 into SQL Server(2016). Is there somehow a way to move the linked table connection to my SQL Server? The linked tables I currently have are from one Access database to another Access database.Note: The linked tables in db1 are to another MS Access (2007) database. Access "links" SQL Server tables by opening a connection to SQL Server ...

 sql-server                     2 answers                     29 view
 2018-10-22         Roderick

Symfony | Forms | Self-referencing CollectionType field - ERROR: out of memory

First of all we are using Symfony 3.4.We have a self-referencing field children on an Entity Category. So a category can have category-children and those category-children can have category-children and so on...class Category{ /** * @ORM\Column(type="string") */ private $title; /** * @ORM\OneToMany(targetEntity="AcmeBundle\Entity\Category", mappedBy="parent") */ private $children; /** * @ORM\ManyToOne(targetEntity="AcmeBundle\Entity\Category", inversedBy="children") */ private $parent;}Now we created an API and use the form function...

 symfony                     1 answers                     27 view
 2018-10-22         Roderick

Windows Services -- High availability scenarios and design approach

Let's say I have a standalone windows service running in a windows server machine. How to make sure it is highly available? 1). What are all the design level guidelines that you can propose?2). How to make it highly available like primary/secondary, eg., the clustering solutions currently available in the market3). How to deal with cross-cutting concerns in case any fail-over scenariosIf any other you can think of please add it here .. Note:The question is only related to windows and windows services, please try to obey this rule :) To keep the service at least running y...

 design                     3 answers                     47 view
 2018-10-22         Roderick

Invalid operation: syntax error at or near "Delta"

I have redshift scriptHere is code of part of script SELECT cog.organizationid, cog.clientid, t.MonthBilled, t.Month, t.Year, u.ClientCharges, cp.supervisorcontactid AS Principal, cc.fullname AS CSL, LAG(u.ClientCharges,1,0) OVER (PARTITION BY cog.clientid ORDER BY cog.clientid,t.Year,t.Month) AS PreviosMonthCharges, CASE WHEN u.ClientCharges IS NULL THEN 0 ELSE u.ClientCharges END - CASE WHEN LAG(u.ClientCharges,1,0) OVER (PARTITION BY cog.clientid ORDER BY cog.clientid,t.Yea...

 sql                     1 answers                     29 view
 2018-10-22         Roderick

Cant upload multiple files from array with Alamofire

Im trying to upload multiple image and video from library to url. evertying works fine except , response turns only one file. I choose two different image for experiment but response is only for last image in array. here is my upload func.. func upload() { var mediaData = Data() var fname = "" var mimetype = "" let url = URL(string: "https://myurl.com/api/attachment/upload") let headers: HTTPHeaders = [ "Authorization": "my Authorization Token", "Content-type": "multipart/form-data" ] Alamofire.upload(multipartFormData:...

 ios                     2 answers                     77 view

Page 1 of 143  |  Show More Pages:  Top Prev Next Last