How to get input field value using PHP
I have a input field as follows: ``` <input type="text" name="subject" id="subject" value="Car Loan"> ``` I would like to get the input fields value `Car Loan` and assign it to a session. How do I ...
- Modified
- 2 Apr at 18:59
SELECT DISTINCT on one column
Using SQL Server, I have... ``` ID SKU PRODUCT ======================= 1 FOO-23 Orange 2 BAR-23 Orange 3 FOO-24 Apple 4 FOO-25 Orange ``` I want ``` 1 FOO-23 Orange 3 FOO-24...
- Modified
- 1 Apr at 17:53
Use LINQ to get items in one List<>, that are not in another List<>
I would assume there's a simple LINQ query to do this, I'm just not exactly sure how. Given this piece of code: ``` class Program { static void Main(string[] args) { List<Person> peo...
How to get the first five character of a String
I have read this [question to get first char](https://stackoverflow.com/q/3878820/1716774) of the string. Is there a way to get the first n number of characters from a string in C#?
Encrypt and decrypt using PyCrypto AES-256
I'm trying to build two functions using PyCrypto that accept two parameters: the message and the key, and then encrypt/decrypt the message. I found several links on the web to help me out, but each on...
- Modified
- 8 Dec at 03:55
How can I properly compare two Integers in Java?
I know that if you compare a boxed primitive Integer with a constant such as: ``` Integer a = 4; if (a < 5) ``` `a` will automatically be unboxed and the comparison will work. However, what happens w...
- Modified
- 10 Sep at 12:55
How to get element by class name?
Using JavaScript, we can get element by id using following syntax: ``` var x=document.getElementById("by_id"); ``` I tried following to get element by class: ``` var y=document.getElementByClass("...
- Modified
- 31 Jul at 09:4
Insert Update trigger how to determine if insert or update
I need to write an Insert, Update Trigger on table A which will delete all rows from table B whose one column (say Desc) has values like the value inserted/updated in the table A's column (say Col1). ...
- Modified
- 12 Apr at 08:9
How to add target="_blank" to JavaScript window.location?
The following sets the target to `_blank`: ``` if (key == "smk") { window.location = "http://www.smkproduction.eu5.org"; target = "_blank"; done = 1; } ``` But this doesn't seem to work...
- Modified
- 13 Feb at 10:25
How to loop backwards in python?
I'm talking about doing something like: ``` for(i=n; i>=1; --i) { //do something with i } ``` I can think of some ways to do so in python (creating a list of `range(1,n+1)` and reverse it, using...
Can you get the number of lines of code from a GitHub repository?
In a GitHub repository you can see “language statistics”, which displays the of the project that’s written in a language. It doesn’t, however, display how many lines of code the project consists of. ...
- Modified
- 10 Nov at 13:54
How do I rename a column in a database table using SQL?
If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that? Or is it not possible? This is for any database claiming to su...
Get a list of distinct values in List
In C#, say I have a class called `Note` with three string member variables. ``` public class Note { public string Title; public string Author; public string Text; } ``` And I have a list ...
Getting Keyboard Input
How do I get simple keyboard input (an integer) from the user in the console in Java? I accomplished this using the `java.io.*` stuff, but it says it is deprecated. How should I do it now?
Mark error in form using Bootstrap
I've started using Bootstrap in order to achieve a nice page design without resorting to GWT (the backend is made in java) For my login screen I copied this [example](http://twitter.github.com/bootst...
- Modified
- 16 Jan at 15:10
What is the most effective way for float and double comparison?
What would be the most efficient way to compare two `double` or two `float` values? Simply doing this is not correct: ``` bool CompareDoubles1 (double A, double B) { return A == B; } ``` But so...
- Modified
- 21 Dec at 03:17
Change project name on Android Studio
I want to change the name of my project and module. But if I try to rename them Android Studio notify me some errors... e.g. I want to change the name from "MyApplication" to "AndroidApp" as shown in ...
- Modified
- 2 Dec at 05:11
How do I replace text inside a div element?
I need to set the text within a DIV element dynamically. What is the best, browser safe approach? I have prototypejs and scriptaculous available. ``` <div id="panel"> <div id="field_name">TEXT GOES...
- Modified
- 5 May at 23:28
"date(): It is not safe to rely on the system's timezone settings..."
I got this error when I requested to update the [PHP](http://en.wikipedia.org/wiki/PHP) version from 5.2.17 to PHP 5.3.21 on the server. ``` <div style="border:1px solid #990000;padding-left:20px;mar...
A Java collection of value pairs? (tuples?)
I like how Java has a Map where you can define the types of each entry in the map, for example `<String, Integer>`. What I'm looking for is a type of collection where each element in the collection ...
- Modified
- 6 Feb at 17:18
How to set timer in android?
Can someone give a simple example of updating a textfield every second or so? I want to make a flying ball and need to calculate/update the ball coordinates every second, that's why I need some sort ...
Error in if/while (condition) {: missing Value where TRUE/FALSE needed
I received this error message: ``` Error in if (condition) { : missing value where TRUE/FALSE needed ``` or ``` Error in while (condition) { : missing value where TRUE/FALSE needed ``` What does...
String concatenation in Ruby
I am looking for a more elegant way of concatenating strings in Ruby. I have the following line: ``` source = "#{ROOT_DIR}/" << project << "/App.config" ``` Is there a nicer way of doing this? An...
- Modified
- 2 May at 18:24
What's the difference between a proxy server and a reverse proxy server?
What is the difference between a proxy server and a reverse proxy server?
- Modified
- 17 Sep at 13:47
When & why to use delegates?
I'm relatively new in C#, & I'm wondering . they are widely used in events declaration, but when should I use them in my own code and I'm also wondering . Thank you for the help! EDIT: I think I'...