rails decimal precision and scale

I have about 30 tables in a rails app and there are about 6 tables for which I would like to change the precision and scale of some of the decimal columns. How do you go about doing that for already existing columns? Do you need to do eac

Android Studio ActionBar width / icon locations

I have a problem with my ActionBar that results in my menu icon being pressed up against the edge of the screen!Below is a few code snippets of the styles I've tweaked and the declarations:HomeActivity.xmlprivate TextView tvViewAll;DrawerLa

Facebook Login Button crashing app without error message

This issue suddenly popped up this morning after working great for weeks. @Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FacebookSdk.sdkInitialize(getApplicationContext()); setCont

Ho do I capture ctrl + click on MacOS with d3js

I got a report that my script which should trigger on ctrl + click does not work on Mac.Like shown in Determine if Shift key is pressed during mousedown event we can determine if modifier keys are pressed during a mouse click testing d3.eve

Imperavi Redactor content not being copied over to hidden textarea

I'm trying to use the Imperavi Redactor control for my rich text editing here:div class=control-group %= f.label :description % div class=controls %= f.text_area :description, :class = richtext % /div/div$(document).ready

Is it possible to have a global launch.json file?

I am using Don Jayamanne's Python extension and it is working well. The only issue I have is for every project I work on, I have to copy the \.vscode\launch.json file. I was wondering if there is a way to place that file somewhere globally

CSS border-image: Only the corners filled with the specified background-image. Why?

I would like to use the CSS property border-image: https://developer.mozilla.org/de/docs/Web/CSS/border-imageBut for some reason it fills only the four corners of the element:My code: .wrap { width: 400px; height: 300px; margin: 50px aut

Issue with java Scanner not taking nextLine on new instance

package sandbox2;import java.util.Scanner;public class Sandbox2{ public static void main(String[] args) { for (int i = 0; i 5; i++) { String s = askForProperty(Enter value for + i + : ); System.o

Java AWT application window padding

I'm trying to build a simple AWT application in Java. I want all of the containers in the main window to be separated by bit. I can accomplish this by setting the Hgap and Vgap in the BorderLayout constructor (see below.)However, I can't fi

Possible memory leak with malloc, struct, std::string, and free

I've a situation like the following, and I'm not sure whether or not the std::string elements of the struct leak memory or if this is ok. Is the memory allocated by those two std::strings deleted when free(v) is called?struct MyData{ std

Why the id of an object would change depending on the line in the python shell

This questions is just out of curiosity.While I was reading the python's object model documentation, I decided to experiment a little with the id of a class method and found this behavior: Python 3.2.2 (default, Sep 4 2011, 09:07:29) [MSC

Jetty - How to make a camel application log events to the hawtio Logs tab

I have a simple camel application logging events on a timer. The logs currently go to a ConsoleAppender. route from uri=timer://hello?period=5000/ to uri=log:loggingstuff?showAll=true/ /routeI have attempted t

subsetting data tables by dynamic column names

I'm trying to subset a table using dynamic column names, but cannot get the following statement to workmm2myModuleByYear[grep(i,colnames(mm2myModuleByYear),value=TRUE)==mId,authId]Using the sample data belowi-1997mId-37mm2myModuleByYear-

Connection string between IIS and SQL server

I'm confused by the connection string in the Web.config file of project with Entity Framework Web API. There are a lot of variants I tried, but none of them was helping me out. Currently the connection string is connectionStrings

SQL multiple joins and sums on same table

I'm learning SQL on the fly as I work on a project and would appreciate some help with the following. I'm also fairly new to stackoverflow so I apologize if my formatting is off:I have a table with columns Date, Group, Person, Amount. For

How to select the first preceding-sibling which has a particular node as child?

I have been trying to write a XPath statement which will select the first preceding-sibling of a node. That sibling should have a particular node as its child.For example:a c/c .... b/b/aa/a........a/aa b

Get a marquee to begin repeating as soon as space is available

Here is a pen for what I have so far. I've been using CSS3 however I'm open to using other methods if it will work better:.userAttributes .attributeGroup .favoriteArtistsAttr { max-width: 74%; animation: marquee 10s linear infinite;}@

UITableView scroll to specific section using UIPIckerView?

I have a UITableView that has a fixed number of sections, however the number of rows in each section can vary depending on server results. I would like to implement a picker wheel to jump to each section. Here are my UIPickerView delegate m

How to play a video on a translucent QWidget?

I want to play a movie on a QWidget that has Qt::FramelessWindowHint flag and Qt::WA_TranslucentBackground attirbute using QVideoWidget or QGraphicsVideoItem. But the video is not visible. I hear only sound. What is the problem?Edit:#includ

Avoid looping xml in jstl

I would like to do something like this:x:out select=$productXML/product/sizes/size[c:out value='${param.sizeIndex}'/] escapeXml=false/but I think the only way to do it is like this:x:forEach var=size begin=${param.sizeIndex} end=${para

Recursively (?) compose LINQ predicates into a single predicate

(EDIT: I have asked the wrong question. The real problem I'm having is over at Compose LINQ-to-SQL predicates into a single predicate - but this one got some good answers so I've left it up!)Given the following search text:keyword1 keyword2

Is the asp.net mvc 5 sample project with 2 factor authentication a sample or production ready?

It seems like the only way I can currently get 2 factor authentication from identity 2 is if I create an empty MVC 5 app then install the Identity samples Pre release with the package manager like so:Install-Package -Prerelease Microsoft.As

Powershell - Replace first occurences of String

Iv'e searched for a fair amount for the answer but all I get is how I do it with multiple Strings. Im pretty new to PowerShell but want to know how I can manage to do it. I simply want to remplace the first occurence of 1 with 2 ... I only

C++ Hexadecimal Calculator Multiplication

I'm having issues where my multiplication method is only handling one row, it's currently not advancing to the next row. The add function is working properly, and I'm able to update the current hex number, but for some reason I can only get

Postgres 9.3 JSON Output multi-dimensional object

Given this query:-SELECT id as id, attributes-'name' as file_name, status from workflow.events where schema='customer' and type='FILE_UPLOAD'id,file_name, status1,name,status2,name2,status2I want to output this structure:-{