Remove the first character of a string
I would like to remove the first character of a string. For example, my string starts with a `:` and I want to remove that only. There are several occurrences of `:` in the string that shouldn't be r...
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
I tried the following code different ways, like by taking out the while or the if, but when I put both together (if and while), I always get the error at the end... ``` undefine numero set serveroutp...
- Modified
- 25 Mar at 11:44
How can I get multiple counts with one SQL query?
I am wondering how to write this query. I know this actual syntax is bogus, but it will help you understand what I want. I need it in this format, because it is part of a much bigger query. ``` SELECT...
- Modified
- 7 Feb at 03:38
How to iterate through a DataTable
I need to iterate through a `DataTable`. I have an column there named `ImagePath`. When I am using `DataReader` I do it this way: ``` SqlDataReader dr = null; dr = cmd.ExecuteReader(); while (dr.Re...
How to do a regular expression replace in MySQL?
I have a table with ~500k rows; varchar(255) UTF8 column `filename` contains a file name; I'm trying to strip out various strange characters out of the filename - thought I'd use a character class: `...
How to define type for a function callback (as any function type, not universal any) used in a method parameter
Currently I have type definition as: ``` interface Param { title: string; callback: any; } ``` I need something like: ``` interface Param { title: string; callback: function; } ```...
- Modified
- 11 Jun at 14:20
What is "406-Not Acceptable Response" in HTTP?
In my Ruby on Rails application I tried to upload an image through the POSTMAN [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer) client in [Base64](http://en.wikipedia.org/wiki/Base...
- Modified
- 9 May at 04:9
Why is Dictionary preferred over Hashtable in C#?
In most programming languages, dictionaries are preferred over hashtables. What are the reasons behind that?
- Modified
- 6 Mar at 00:56
How to elegantly check if a number is within a range?
How can I do this elegantly with C#? For example, a number can be between 1 and 100. I know a simple `if (x >= 1 && x <= 100)` would suffice; but with a lot of syntax sugar and new features constantly...
How to print the value of a Tensor object in TensorFlow?
I have been using the introductory example of matrix multiplication in TensorFlow. ``` matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2) ``` ...
- Modified
- 21 May at 12:2
Is there a way to make npm install (the command) to work behind proxy?
Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing.
How to store decimal values in SQL Server?
I'm trying to figure out decimal data type of a column in the SQL Server. I need to be able to store values like 15.5, 26.9, 24.7, 9.8, etc I assigned `decimal(18, 0)` to the column data type but thi...
- Modified
- 11 Sep at 08:31
Why do I get an UnsupportedOperationException when trying to remove an element from a List?
I have this code: ``` public static String SelectRandomFromTemplate(String template,int count) { String[] split = template.split("|"); List<String> list=Arrays.asList(split); Random r = new ...
Cannot download Docker images behind a proxy
I installed Docker on my Ubuntu 13.10 (Saucy Salamander) and when I type in my console: ``` sudo docker pull busybox ``` I get the following error: ``` Pulling repository busybox 2014/04/16 09:37:...
JPA JoinColumn vs mappedBy
What is the difference between: ``` @Entity public class Company { @OneToMany(cascade = CascadeType.ALL , fetch = FetchType.LAZY) @JoinColumn(name = "companyIdRef", referencedColumnName = "co...
Best way to create enum of strings?
What is the best way to have a `enum` type represent a set of strings? I tried this: ``` enum Strings{ STRING_ONE("ONE"), STRING_TWO("TWO") } ``` How can I then use them as `Strings`?
What is the difference between g++ and gcc?
What is the difference between g++ and gcc? Which one of them should be used for general c++ development?
Percentage width in a RelativeLayout
I am working on a form layout for a Login `Activity` in my Android App. The image below is how I want it to look like: ![enter image description here](https://i.stack.imgur.com/5mrcx.png) I was able...
- Modified
- 12 Sep at 17:3
How can I list ALL DNS records?
Is there any way I can list ALL DNS records for a domain? I know about such things as dig and nslookup but they only go so far. For example, if I've got a subdomain A record as ``` test A somedomain...
- Modified
- 11 Oct at 16:28
How does a ArrayList's contains() method evaluate objects?
Say I create one object and add it to my `ArrayList`. If I then create another object with exactly the same constructor input, will the `contains()` method evaluate the two objects to be the same? Ass...
- Modified
- 24 Apr at 08:17
How to return the current timestamp with Moment.js?
Folks, I am trying to understand the MomentJS API. What is the appropriate way to get the current time on the machine? ``` var CurrentDate = moment(); ``` vs ``` var CurrentDate = moment().forma...
- Modified
- 7 Aug at 17:44
How to find if div with specific id exists in jQuery?
I’ve got a function that appends a `<div>` to an element on click. The function gets the text of the clicked element and assigns it to a variable called `name`. That variable is then used as the `<div...
- Modified
- 5 Sep at 13:8
Do while loop in SQL Server 2008
Is there any method for implement `do while` loop in SQL server 2008?
- Modified
- 8 Aug at 03:38
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Eclipse
What is wrong with the code there are lots of error while debugging. I am writing a code for a singleton class to connect with the database mysql. Here is my code ``` package com.glomindz.mercuri.ut...
- Modified
- 11 Mar at 13:46
How to run Python script on terminal?
I want to run a Python script in Terminal, but I don't know how? I already have a saved file called gameover.py in the directory "/User/luca/Documents/python".