ADB Shell Input Events
What is the basic difference between `adb shell input keyevent` and `adb shell sendevent`? Which one should I use for inputting a character? Are the keycodes the same that we pass to both the commands...
Serializing a list to JSON
I have an object model that looks like this: ``` public MyObjectInJson { public long ObjectID {get;set;} public string ObjectInJson {get;set;} } ``` The property `ObjectInJson` is an already se...
Fit cell width to content
Given the following markup, how could I use CSS to force one cell (all cells in column) to fit to the width of the content within it rather than stretch (which is the default behaviour)? ``` td.block ...
- Modified
- 28 Jun at 14:55
Return value in a Bash function
I am working with a bash script and I want to execute a function to print a return value: ``` function fun1(){ return 34 } function fun2(){ local res=$(fun1) echo $res } ``` When I execute `f...
- Modified
- 11 Apr at 21:45
How to convert JSON string to array
What I want to do is the following: 1. taking JSON as input from text area in php 2. use this input and convert it to JSON and pass it to php curl to send request. this m getting at php from get ...
Logical operator in a handlebars.js {{#if}} conditional
Is there a way in handlebars JS to incorporate logical operators into the standard handlebars.js conditional operator? Something like this: ``` {{#if section1 || section2}} .. content {{/if}} ``` I...
- Modified
- 13 Jan at 15:59
Enumerations on PHP
I know that PHP doesn't yet have native Enumerations. But I have become accustomed to them from the Java world. I would love to use enums as a way to give predefined values which IDEs' auto-completion...
- Modified
- 16 Feb at 07:17
How do I specify unique constraint for multiple columns in MySQL?
I have a table: ``` table votes ( id, user, email, address, primary key(id), ); ``` Now I want to make the columns unique (together). How do I do this in MySql? Of course the...
- Modified
- 17 Feb at 19:15
Unrecognized SSL message, plaintext connection? Exception
I have a java complied package to speak with the https server on net. Running the compilation gives the following exception: ``` javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connec...
Converting String To Float in C#
I am converting a string like "41.00027357629127", and I am using; ``` Convert.ToSingle("41.00027357629127"); ``` or ``` float.Parse("41.00027357629127"); ``` These methods return . When I conv...
- Modified
- 9 Aug at 23:18
How to center buttons in Twitter Bootstrap 3?
I am building a form in Twitter Bootstrap but I'm having issues with centering the button below the input in the form. I have already tried applying the `center-block` class to the button but that did...
- Modified
- 11 Oct at 17:50
How do I push a local Git branch to master branch in the remote?
I have a branch called develop in my local repo, and I want to make sure that when I push it to origin it's merged with the origin/master. Currently, when I push it's added to a remote develop branch....
- Modified
- 26 Feb at 12:53
.htaccess redirect all pages to new domain
Which redirect rule would I use to redirect all pages under `olddomain.example` to be redirected to `newdomain.example`? The site has a totally different structure, so I want under the old domain to...
- Modified
- 20 Dec at 13:31
Copy data into another table
How to copy/append data from one table into another table with same schema in SQL Server? let's say there is a query ``` select * into table1 from table2 where 1=1 ``` which creates `table1`...
- Modified
- 21 Apr at 12:25
How do I download a file with Angular2 or greater
I have a WebApi / MVC app for which I am developing an angular2 client (to replace MVC). I am having some troubles understanding how Angular saves a file. The request is ok (works fine with MVC, and ...
- Modified
- 5 Jul at 10:34
'too many values to unpack', iterating over a dict. key=>string, value=>list
I am getting the `too many values to unpack` error. Any idea how I can fix this? ``` first_names = ['foo', 'bar'] last_names = ['gravy', 'snowman'] fields = { 'first_names': first_names, 'las...
- Modified
- 11 Mar at 03:2
Remove all special characters except space from a string using JavaScript
I want to remove all special characters except space from a string using JavaScript. For example, `abc's test#s` should output as `abcs tests`.
- Modified
- 9 Dec at 16:33
How can I make a UITextField move up when the keyboard is present - on starting to edit?
With the iOS SDK: I have a `UIView` with `UITextField`s that bring up a keyboard. I need it to be able to: 1. Allow scrolling of the contents of the UIScrollView to see the other text fields once the...
- Modified
- 31 Aug at 09:51
Which characters make a URL invalid?
Which characters make a URL invalid? Are these valid URLs? - `example.com/file[/].html`- `http://example.com/file[/].html`
- Modified
- 4 Apr at 19:25
Extending from two classes
How can I do this: ``` public class Main extends ListActivity , ControlMenu ``` Also, I would like to know that is this approach is okay that I have made the menus in class which is ControlMenu and...
"Active Directory Users and Computers" MMC snap-in for Windows 7?
Is there an equivalent tool available for use in Windows 7? I just need to browse the membership of some small Active Directory groups that are deep within a huge hierarchy, so I can eventually write...
- Modified
- 12 Jun at 16:22
How to implement onBackPressed() in Fragments?
Is there a way in which we can implement `onBackPressed()` in Android Fragment similar to the way in which we implement in Android Activity? As the Fragment lifecycle do not have `onBackPressed()`. I...
- Modified
- 9 Aug at 13:33
Can I use a :before or :after pseudo-element on an input field?
I am trying to use the `:after` CSS pseudo-element on an `input` field, but it does not work. If I use it with a `span`, it works OK. ``` <style type="text/css"> .mystyle:after {content:url(smiley.g...
- Modified
- 14 Nov at 04:16
What is the best regular expression to check if a string is a valid URL?
How can I check if a given string is a valid URL address? My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the...
- Modified
- 29 Dec at 17:3