Questions

How to check the maximum number of allowed connections to an Oracle database?

What's the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of sessions and the total number ...

2 Oct at 13:27

How to sum data.frame column values?

I have a data frame with several columns; some numeric and some character. I’ve googled for this and I see numerous functions (`sum`, `cumsum`, `rowsum`, `rowSums`, `colSums`, `aggregate`, `apply`) b...

20 Sep at 11:24

javascript check for not null

Below is a code snippet, where we retrieve a form value. Before further processing check if the value is not null.. ``` var val = document.FileList.hiddenInfo.value; alert("val is " + val); // this ...

16 Jun at 14:5

PostgreSQL: Give all permissions to a user on a PostgreSQL database

I would like to give a user all the permissions on a database without making it an admin. The reason why I want to do that is that at the moment DEV and PROD are different DBs on the same cluster so I...

How to pretty print nested dictionaries?

How can I pretty print a dictionary with depth of ~4 in Python? I tried pretty printing with `pprint()`, but it did not work: ``` import pprint pp = pprint.PrettyPrinter(indent=4) pp.pprint(mydict) ...

18 Oct at 23:31

git: Your branch is ahead by X commits

How does this actually come about? I am working in one repo by myself at the moment, so this is my workflow: 1. Change files 2. Commit 3. Repeat 1-2 until satisfied 4. Push to master Then when I...

29 Sep at 13:30

Not equal <> != operator on NULL

Could someone please explain the following behavior in SQL? ``` SELECT * FROM MyTable WHERE MyColumn != NULL (0 Results) SELECT * FROM MyTable WHERE MyColumn <> NULL (0 Results) SELECT * FROM MyTable...

9 Oct at 12:24

PHP & MySQL: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given

I'm trying to Integrate HTML Purifier [http://htmlpurifier.org/](http://htmlpurifier.org/) to filter my user submitted data but I get the following error below. And I was wondering how can I fix this ...

30 Mar at 15:18

How can I display full (non-truncated) dataframe information in HTML when converting from Pandas dataframe to HTML?

I converted a Pandas dataframe to an HTML output using the `DataFrame.to_html` function. When I save this to a separate HTML file, the file shows truncated output. For example, in my TEXT column, `df....

24 May at 21:2

android.view.InflateException: Binary XML file: Error inflating class fragment

I have a very frustrating error that I cannot explain. I created an Android application that uses `Android AppCompat` to make it compatible with older versions. Here is my main activity layout file: ...

12 Mar at 05:11

Display current time in 12 hour format with AM/PM

Currently the time displayed as However The current code is as below ``` private static final int FOR_HOURS = 3600000; private static final int FOR_MIN = 60000; public String getTime(final Model...

5 Mar at 05:17

Testing Private method using mockito

``` public class A { public void method(boolean b){ if (b == true) method1(); else method2(); } private void method1() {} private vo...

31 Aug at 14:4

Using CSS to insert text

I'm relatively new to CSS, and have used it to change the style and formatting of text. I would now like to use it to insert text as shown below: ``` <span class="OwnerJoe">reconcile all entries</sp...

29 Apr at 23:14

Adding options to select with javascript

I want this javascript to create options from 12 to 100 in a select with id="mainSelect", because I do not want to create all of the option tags manually. Can you give me some pointers? Thanks ``` fu...

2 Dec at 17:20

MetadataException: Unable to load the specified metadata resource

All of a sudden I keep getting a `MetadataException` on instantiating my generated `ObjectContext` class. The connection string in App.Config looks correct - hasn't changed since last it worked - and ...

17 Feb at 08:50

Truncate all tables in a MySQL database in one command?

Is there a query (command) to truncate all the tables in a database in one operation? I want to know if I can do this with one single query.

16 Dec at 07:31

Linux: copy and create destination dir if it does not exist

I want a command (or probably an option to cp) that creates the destination directory if it does not exist. Example: ``` cp -? file /path/to/copy/file/to/is/very/deep/there ```

15 Sep at 23:13

jQuery same click event for multiple elements

Is there any way to execute same code for different elements on the page? ``` $('.class1').click(function() { some_function(); }); $('.class2').click(function() { some_function(); }); ``` in...

11 Dec at 20:31

How do I migrate an SVN repository with history to a new Git repository?

I read the Git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like: SVN repository in: `svn://myserver/path/to/svn/repos` ...

7 Dec at 14:40

How to set a selected option of a dropdown list control using angular JS

I am using Angular JS and I need to set a selected option of a dropdown list control using angular JS. Forgive me if this is ridiculous but I am new with Angular JS Here is the dropdown list control...

How can I save application settings in a Windows Forms application?

What I want to achieve is very simple: I have a Windows Forms (.NET 3.5) application that uses a path for reading information. This path can be modified by the user, by using the options form I provid...

Is there a function to make a copy of a PHP array to another?

Is there a function to make a copy of a PHP array to another? I have been burned a few times trying to copy PHP arrays. I want to copy an array defined inside an object to a global outside it.

21 Jul at 01:23

How to check if a string contains an element from a list in Python

I have something like this: ``` extensionsToCheck = ['.pdf', '.doc', '.xls'] for extension in extensionsToCheck: if extension in url_string: print(url_string) ``` I am wondering what w...

16 Jun at 09:53

How can I rollback a git repository to a specific commit?

My repo has 100 commits in it right now. I need to rollback the repository to commit 80, and remove all the subsequent ones. Why? This repo is supposed to be for merging from miscellaneous users. A bu...

9 Jan at 22:1

Remove everything after a certain character

Is there a way to remove everything after a certain character or just choose everything up to that character? I'm getting the value from an href and up to the "?", and it's always going to be a diffe...

11 Jan at 09:19