Questions

How to use BufferedReader in Java

Sorry if this is an obvious question, but I can't seem to get it. I'm working on an assignment for a Data Structures course. It involves pulling data from a simple .dat file. We had never used any of ...

9 May at 12:33

How do you hide the Address bar in Google Chrome for Chrome Apps?

I want to increase the screen real estate for my Chrome app. The Address Bar is useless in a Chrome App and I was wondering if there was a way to disable it.

20 Apr at 20:30

jQuery get the location of an element relative to window

Given an HTML DOM ID, how to get an element's position relative to the window in JavaScript/JQuery? This is not the same as relative to the document nor offset parent since the element may be inside ...

19 Apr at 11:40

Is there a good Valgrind substitute for Windows?

I was looking into Valgrind to help improve my C coding/debugging when I discovered it is only for Linux - I have no other need or interest in moving my OS to Linux so I was wondering if there is a eq...

$(window).scrollTop() vs. $(document).scrollTop()

What's the difference between: ``` $(window).scrollTop() ``` and ``` $(document).scrollTop() ``` Thanks.

Hide keyboard in react-native

If I tap onto a textinput, I want to be able to tap somewhere else in order to dismiss the keyboard again (not the return key though). I haven't found the slightest piece of information concerning thi...

12 Oct at 10:33

PHP mkdir: Permission denied problem

I am trying to create a directory with PHP mkdir function but I get an error as follows: `Warning: mkdir() [function.mkdir]: Permission denied in ...`. How to settle down the problem?

9 Mar at 12:57

What is a unix command for deleting the first N characters of a line?

For example, I might want to: ``` tail -f logfile | grep org.springframework | <command to remove first N characters> ``` I was thinking that `tr` might have the ability to do this but I'm not sure...

18 Aug at 07:21

How to create composite primary key in SQL Server 2008

I want to create tables in SQL Server 2008, but I don't know how to create composite primary key. How can I achieve this?

30 Jun at 18:24

Looping through array and removing items, without breaking for loop

I have the following for loop, and when I use `splice()` to remove an item, I then get that 'seconds' is undefined. I could check if it's undefined, but I feel there's probably a more elegant way to ...

19 Sep at 19:8

How do you delete an ActiveRecord object?

How do you delete an ActiveRecord object? I looked at [Active Record Querying](http://guides.rubyonrails.org/active_record_querying.html) and it does not have anything on deleting that I can see. 1...

28 Aug at 06:14

When is del useful in Python?

I can't really think of any reason why Python needs the `del` keyword (and most languages seem to not have a similar keyword). For instance, rather than deleting a variable, one could just assign `Non...

How do you run a command as an administrator from the Windows command line?

I have a small script that performs the build and install process on Windows for a [Bazaar](http://en.wikipedia.org/wiki/Bazaar_%28software%29) repository I'm managing. I'm trying to run the script wi...

11 Dec at 18:11

Make Https call using HttpClient

I have been using `HttpClient` for making WebApi calls using C#. Seems neat & fast way compared to `WebClient`. However I am stuck up while making `Https` calls. How can I make below code to make `Ht...

21 Apr at 18:22

Checking odd/even numbers and changing outputs on number size

I have a couple of problems to solve for an assignment, and am a bit stuck. The question is to write a program that gets the user to input an odd number (check it's odd), then print an upside down pyr...

20 Aug at 21:58

How to pass the password to su/sudo/ssh without overriding the TTY?

I'm writing a C Shell program that will be doing `su` or `sudo` or `ssh`. They all want their passwords in console input (the TTY) rather than stdin or the command line. Does anybody know a solution?...

17 Aug at 17:12

How to run a python script from IDLE interactive shell?

How do I run a python script from within the IDLE interactive shell? The following throws an error: ``` >>> python helloworld.py SyntaxError: invalid syntax ```

16 Feb at 16:46

How to print in C

Very much a beginner to C, in fact this is my first tester program. I can't actually figure out how to print this number out to the terminal. ``` #include <stdio.h> int addNumbers(int a, int b) { ...

6 Nov at 14:48

error: Your local changes to the following files would be overwritten by checkout

[this one](https://stackoverflow.com/questions/14318234/how-to-ignore-error-on-git-pull-about-my-local-changes-would-be-overwritten-by-m) I have a project with two branches: `staging` and `beta`. I de...

29 Aug at 15:41

What is the (best) way to manage permissions for Docker shared volumes?

I've been playing around with Docker for a while and keep on finding the same issue when dealing with persistent data. I create my `Dockerfile` and [expose a volume](http://docs.docker.io/reference/b...

25 Jul at 04:55

Adding placeholder text to textbox

I am looking for a way to add placeholder text to a textbox like you can with a textbox in html5. I.e. if the textbox has no text, then it adds the text `Enter some text here`, when the user clicks ...

8 Aug at 22:3

How to initialize const member variable in a class?

``` #include <iostream> using namespace std; class T1 { const int t = 100; public: T1() { cout << "T1 constructor: " << t << endl; } }; ``` When I am trying to initialize the const ...

12 Jun at 16:25

How to select label for="XYZ" in CSS?

``` label { display: block; width: 156px; cursor: pointer; padding-right: 6px; padding-bottom: 1px; } ``` ``` <label for="email">{t _your_email}:</label> ``` I wish to select the label bas...

21 Apr at 11:0

How to generate and validate a software license key?

I'm currently involved in developing a product (developed in C#) that'll be available for downloading and installing for free but in a very limited version. To get access to all the features the user ...

10 Oct at 09:7

Psql could not connect to server: No such file or directory, 5432 error?

I'm trying to run `psql` on my Vagrant machine, but I get this error: ``` psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Uni...

4 Jan at 22:32