Questions

How to pass in password to pg_dump?

I'm trying to create a cronjob to back up my database every night before something catastrophic happens. It looks like this command should meet my needs: ``` 0 3 * * * pg_dump dbname | gzip > ~/backu...

24 May at 17:10

Resize image in PHP

I want to write some PHP code that automatically resizes any image uploaded via a form to 147x147px, but I have no idea how to go about it (I'm a relative PHP novice). So far, I've got images uploadin...

Calling a function within a Class method?

I have been trying to figure out how to go about doing this but I am not quite sure how. Here is an example of what I am trying to do: ``` class test { public newTest(){ function bigT...

4 Mar at 20:53

Git index.lock File exists when I try to commit, but I cannot delete the file

When I do 'git commit', I'm getting the following: `fatal: Unable to create 'project_path/.git/index.lock': File exists.` However, when I do `ls project_path/.git/index.lock` it's saying the file does...

16 Feb at 05:26

Scroll to a specific Element Using html

Is there a method in html which makes the webpage scroll to a specific Element using HTML !?

14 Jul at 14:41

How can I find the product GUID of an installed MSI setup?

I need to find the for an in order to perform maintenance such as `patching`, `uninstall` ([how-to uninstall](https://stackoverflow.com/questions/450027/uninstalling-an-msi-file-from-the-command-lin...

How do I get cURL to not show the progress bar?

I'm trying to use cURL in a script and get it to show the progress bar. I've tried the `-s`, `-silent`, `-S`, and `-quiet` options, but none of them work. Here's a typical command I've tried: ```...

22 Dec at 03:50

How to pause JavaScript code execution for 2 seconds

I want to stop execution for 2 seconds. ``` <html> <head> <title> HW 10.12 </title> <script type="text/javascript"> for (var i = 1; i <= 5; i++) { document.write(i...

18 Oct at 21:42

What does axis in pandas mean?

Here is my code to generate a dataframe: ``` import pandas as pd import numpy as np dff = pd.DataFrame(np.random.randn(1,2),columns=list('AB')) ``` then I got the dataframe: ``` +------------+---...

20 Oct at 13:18

go get results in 'terminal prompts disabled' error for github private repo

I created the private repo examplesite/myprivaterepo using the Github UI from my browser. Then I went to my go directory (on the desktop) and cloned it: ``` $ cd $GOPATH $ go get github.com/examples...

7 Jan at 04:32

Why do I have to run "composer dump-autoload" command to make migrations work in laravel?

I have built some migration classes in my application to create the tables I need, but I keep getting errors. I need to run this command: `composer dump-autoload` Only then it works again as expect...

19 Feb at 17:12

Understanding events and event handlers in C#

I understand the purpose of events, especially within the context of creating user interfaces. I think this is the prototype for creating an event: ``` public void EventName(object sender, EventArgs ...

29 Jul at 22:59

Iterating over a 2 dimensional python list

I have created a 2 dimension array like: ``` rows =3 columns= 2 mylist = [[0 for x in range(columns)] for x in range(rows)] for i in range(rows): for j in range(columns): mylist[i][j] = '...

18 Jun at 17:3

Double vs. BigDecimal?

I have to calculate some floating point variables and my colleague suggest me to use `BigDecimal` instead of `double` since it will be more precise. But I want to know what it is and how to make most ...

jQuery/Javascript function to clear all the fields of a form

I am looking for a jQuery function that will clear all the fields of a form after having submitted the form. I do not have any HTML code to show, I need something generic. Can you help? Thanks!

26 Jul at 20:11

Appending values to dictionary in Python

I have a dictionary to which I want to append to each drug, a list of numbers. Like this: ``` append(0), append(1234), append(123), etc. def make_drug_dictionary(data): drug_dictionary={'MORPHIN...

2 Jun at 13:43

How to increase Heap size of JVM

I am getting the following error: ``` Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at SQLite.Vm.step(Native Method) at SQLite.Database.get_table(Database.jav...

31 Jan at 07:15

How do I get the index of an iterator of an std::vector?

I'm iterating over a vector and need the index the iterator is currently pointing at. What are the pros and cons of the following methods? - `it - vec.begin()`- `std::distance(vec.begin(), it)`

17 Jul at 09:39

How to turn off word wrapping in HTML?

I feel silly for not being able to figure this out, but how do I turn off wordwrap? the css `word-wrap` property can be forced on with `break-word`, but cannot be forced (only can be left alone with ...

10 Jan at 23:39

How to append <script></script> in JavaScript?

I need to use `appendChild()` or jQuey's `append()` to append some `<script>` tag stuff into the document. From what I can tell, this is getting stripped out. Anyone know how to do it?

16 Mar at 19:6

What is the largest TCP/IP network port number allowable for IPv4?

What is the highest port number one can use?

17 May at 18:3

PHP - Check if two arrays are equal

I'd like to check if two arrays are equal. I mean: same size, same index, same values. How can I do that? Using `!==` as suggested by a user, I expect that the following would print if at least one ...

18 Jul at 22:39

Using Intent in an Android application to show another activity

In my Android application, I have two activity classes. I have a button on the first one and I want to show the second when it is clicked, but I get an error. Here are the classes: ``` public class...

How do I open a second window from the first window in WPF?

I am new to WPF. I have two windows, such as window1 and window2. I have one button in window1. If I click that button, the window2 has to open. What should I do for that? Here is the code I tried: ...

18 May at 16:0

Access item in a list of lists

If I have a list of lists and just want to manipulate an individual item in that list, how would I go about doing that? For example: ``` List1 = [[10,13,17],[3,5,1],[13,11,12]] ``` What if I want...

19 Jul at 03:8