Questions

How to add/update child entities when updating a parent entity in EF

The two entities are one-to-many relationship (built by code first fluent api). ``` public class Parent { public Parent() { this.Children = new List<Child>(); } public int Id...

Write to Windows Application Event Log without event source registration

Is there a way to write to this event log: ![enter image description here](https://i.stack.imgur.com/lhenO.png) Or at least, some other Windows default log, ?

8 Jun at 16:22

In Swift how to call method with parameters on GCD main thread?

In my app I have a function that makes an NSRURLSession and sends out an NSURLRequest using ``` sesh.dataTaskWithRequest(req, completionHandler: {(data, response, error) ``` In the completion block...

How do you manually execute SQL commands in Ruby On Rails using NuoDB

I'm trying to manually execute SQL commands so I can access procedures in NuoDB. I'm using Ruby on Rails and I'm using the following command: ``` ActiveRecord::Base.connection.execute("SQL query") ```...

15 May at 20:11

$(window).width() not the same as media query

I am using Twitter Bootstrap on a project. As well as the default bootstrap styles I have also added some of my own ``` //My styles @media (max-width: 767px) { //CSS here } ``` I am also using...

Get controller and action name from within controller?

For our web application I need to save the order of the fetched and displayed items depending on the view - or to be precise - the controller and action that generated the view (and the user id of cou...

31 Aug at 09:14

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

I have installed Oracle 11g Express Edition Release 2 in my windows 7 64 bit OS and tried to execute JDBC program, then I got the following error: ``` java.sql.SQLException: Listener refused the conn...

23 May at 07:6

Best way to structure a tkinter application?

The following is the overall structure of my typical python tkinter program. ``` def funA(): def funA1(): def funA12(): # stuff def funA2(): # stuff def funB(): ...

27 Dec at 01:13

How to read a .xlsx file using the pandas Library in iPython?

I want to read a .xlsx file using the Pandas Library of python and port the data to a postgreSQL table. All I could do up until now is: ``` import pandas as pd data = pd.ExcelFile("*File Name*") ``...

What is the difference between synchronous and asynchronous programming (in node.js)

I've been reading [nodebeginner](http://www.nodebeginner.org/) And I came across the following two pieces of code. The first one: ``` var result = database.query("SELECT * FROM hugetable"); cons...

Resize svg when window is resized in d3.js

I'm drawing a scatterplot with d3.js. With the help of this question : [Get the size of the screen, current web page and browser window](https://stackoverflow.com/questions/3437786/how-to-get-web-page...

23 May at 12:34

How to change border color of textarea on :focus

I want to change border color of TEXTAREA on focus. But my code doesn't seem to working properly. The code is on [fiddle](http://fiddle.jshell.net/ffS4S/). ``` <form name = "myform" method = "post" ac...

21 Apr at 08:38

Which datatype should be used for currency?

Seems like `Money` type is discouraged as described [here](https://groups.google.com/forum/?fromgroups=#!topic/sqlalchemy/USD3cdng9-s). My application needs to store currency, which datatype shall I b...

20 Sep at 00:31

Aligning rotated xticklabels with their respective xticks

Check the x axis of the figure below. How can I move the labels a bit to the left so that they align with their respective ticks? I'm rotating the labels using: ``` ax.set_xticks(xlabels_positions) ...

12 Feb at 06:0

How to access pandas groupby dataframe by key

How do I access the corresponding groupby dataframe in a groupby object by the key? With the following groupby: ``` rand = np.random.RandomState(1) df = pd.DataFrame({'A': ['foo', 'bar'] * 3, ...

Where does Chrome store extensions?

I looked in: ``` C:\Documents and Settings\username\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions ``` for unpacked extensions, but that folder is empty for me. For new...

How to pass data from 2nd activity to 1st activity when pressed back? - android

I've 2 activities, and . In `Activity1` I've a and . When the button is clicked is started. In `Activity2` I've an . I want to display the data retrieved from in in the in when back is press...

inline conditionals in angular.js

I was wondering if there is a way in angular to conditionally display content other than using ng-show etc. For example in backbone.js I could do something with inline content in a template like: ```...

Copy data into another table

How to copy/append data from one table into another table with same schema in SQL Server? let's say there is a query ``` select * into table1 from table2 where 1=1 ``` which creates `table1`...

21 Apr at 12:25

Returning an array using C

I am relatively new to C and I need some help with methods dealing with arrays. Coming from Java programming, I am used to being able to say `int [] method()` in order to return an array. However, I h...

3 Nov at 19:35

How to get current foreground activity context in android?

Whenever my broadcast is executed I want to show alert to foreground activity.

17 Jan at 15:34

Get current URL in Twig template?

I looked around for the code to get the current path in a Twig template (and not the full URL), i.e. I don't want `http://www.sitename.com/page`, I only need `/page`.

2 Apr at 06:27

How to split() a delimited string to a List<String>

I had this code: ``` String[] lineElements; . . . try { using (StreamReader sr = new StreamReader("TestFile.txt")) { String line; while ((li...

13 Feb at 16:3

How to add two strings as if they were numbers?

I have two strings which contain only numbers: ``` var num1 = '20', num2 = '30.5'; ``` I would have expected that I could add them together, but they are being concatenated instead: ``` num1 +...

8 Mar at 18:6

how to break the _.each function in underscore.js

I'm looking for a way to stop iterations of underscore.js `_.each()` method, but can't find the solution. jQuery `.each()` can break if you do `return false`. Is there a way to stop underscore each()...

5 Feb at 10:48