Questions

PowerShell equivalent to grep -f

I'm looking for the PowerShell equivalent to `grep --file=filename`. If you don't know `grep`, filename is a text file where each line has a regular expression pattern you want to match. Maybe I'm mi...

8 Sep at 20:13

Best way to get the max value in a Spark dataframe column

I'm trying to figure out the best way to get the largest value in a Spark dataframe column. Consider the following example: ``` df = spark.createDataFrame([(1., 4.), (2., 5.), (3., 6.)], ["A", "B"])...

What's the @ in front of a string in C#?

This is a .NET question for C# (or possibly VB.net), but I am trying to figure out what's the difference between the following declarations: ``` string hello = "hello"; ``` vs. ``` string hello_a...

27 May at 11:11

How to pass prepareForSegue: an object

I have many annotations in a mapview (with `rightCalloutAccessory` buttons). The button will perform a segue from this `mapview` to a `tableview`. I want to pass the `tableview` a different object (t...

How can I loop through all rows of a table? (MySQL)

I have a table A and there is one primary key ID. Now I want to go through all rows in A. I found something like 'for each record in A', but this seems to be not how you do it in MySQL. Thing is fo...

28 Apr at 11:19

PHP 7 RC3: How to install missing MySQL PDO

I am trying to setup webserver with `PHP 7 RC3` + `Nginx` on `Ubuntu 14.04` (for test purposes). I installed Ubuntu in Vagrant using `ubuntu/trusty64` and PHP 7 RC 3 from Ondřej Surý ([https://launch...

23 Sep at 00:3

How to get the current URL within a Django template?

I was wondering how to get the current URL within a template. Say my current URL is: ``` .../user/profile/ ``` How do I return this to the template?

5 Apr at 19:13

Python "SyntaxError: Non-ASCII character '\xe2' in file"

I am writing some python code and I am receiving the error message as in the title, from searching this has to do with the character set. Here is the line that causes the error ``` hc = HealthCheck...

7 Feb at 23:2

Changing :hover to touch/click for mobile devices

I've had a look around but can't quite find what i'm looking for. I currently have a css animation on my page which is triggered by :hover. I would like this to change to 'click' or 'touch' when the ...

31 Dec at 06:19

IF Statement multiple conditions, same statement

Hey all, looking to reduce the code on my c# if statements as there are several repeating factors and was wondering if a trimmer solution is possible. I currently have 2 if statements that need to ca...

27 Aug at 14:35

Listen for key press in .NET console app

How can I continue to run my console application until a key press (like is pressed?) I'm assuming its wrapped around a while loop. I don't like `ReadKey` as it blocks operation and asks for a key, ...

2 Feb at 15:49

Spring cron expression for every after 30 minutes

I have following Spring job to run after every 30 minutes. Please check my cron expression, is that correct? ``` 0 0 0 * * 30 ``` Here is a full cron job definition from the related Spring file: ```...

4 Jun at 12:50

Converting an int to std::string

What is the shortest way, preferably inline-able, to convert an int to a string? Answers using stl and boost will be welcomed.

12 Jan at 12:26

Java: Multiple class declarations in one file

In Java, you can define multiple top level classes in a single file, providing that at most one of these is public (see [JLS §7.6](http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.6))...

3 Aug at 10:56

How to resize images proportionally / keeping the aspect ratio?

I have images that will be quite big in dimension and I want to shrink them down with jQuery while keeping the proportions constrained, i.e. the same aspect ratio. Can someone point me to some code, ...

13 Jun at 23:31

XPath find if node exists

Using a XPath query how do you find if a node (tag) exists at all? For example if I needed to make sure a website page has the correct basic structure like `/html/body` and `/html/head/title`.

1 Apr at 19:42

How to add a new project to Github using VS Code

All the tutorials i've seen till now shows to first create a repository on github, copy the link go to vscode and `git clone` it and from that on, you can do commits and pushes. Is that the right way ...

25 Oct at 22:24

How to get anchor text/href on click using jQuery?

Consider I have an anchor which looks like this ``` <div class="res"> <a href="~/Resumes/Resumes1271354404687.docx"> ~/Resumes/Resumes1271354404687.docx </a> </div> ``` There w...

17 Dec at 15:32

'System.OutOfMemoryException' was thrown when there is still plenty of memory free

This is my code: ``` int size = 100000000; double sizeInMegabytes = (size * 8.0) / 1024.0 / 1024.0; //762 mb double[] randomNumbers = new double[size]; ``` Exception: Exception of type 'System.OutO...

24 Dec at 23:30

How to redirect 404 errors to a page in ExpressJS?

I don't know a function for doing this, does anyone know of one?

29 May at 03:14

How to add and get Header values in WebApi

I need to create a POST method in WebApi so I can send data from application to WebApi method. I'm not able to get header value. Here I have added header values in the application: ``` using (var clie...

How to convert a currency string to a double with Javascript?

I have a text box that will have a string in it that I then need to convert that string to a double to perform some operations on it. `"$1,100.00"` → `1100.00` This needs to occur all client side....

5 Dec at 20:13

Entity Framework - "An error occurred while updating the entries. See the inner exception for details"

I have problem, I have just started learning EF Model First and Im staying in one point for some time. I got such error : "An error occurred while updating the entries. See the inner exception for de...

13 Jun at 22:59

bootstrap datepicker today as default

I am using this [bootstrap-datepicker](http://www.eyecon.ro/bootstrap-datepicker/) for my datepicker. I'd like the datepicker to choose "today" for start day or default day. I cannot figure out how t...

How do you debug PHP scripts?

How do you debug scripts? I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in is also quite useful. What is the (in terms of fast and easy) way to debug i...

4 Jun at 10:18