text
stringlengths
74
309k
{"title":"How do I remove extra space above and below imageView?","tags":["android","imageview"],"question_text":"I have a really simple image within a RelativeLayout and for some reason I am getting extra spacing on the top and bottom which I can't remove.\nAny ideas - how to clear it out\nHere is what it looks like:\...
{"title":"Sql Server string to date conversion","tags":["sql","sql-server","sql-server-2005","tsql","string-to-datetime"],"question_text":"I want to convert a string like this:\n`'10\/15\/2008 10:06:32 PM'`\ninto the equivalent DATETIME value in Sql Server.\nIn Oracle, I would say this:\n`TO_DATE('10\/15\/2008 10:06:32...
{"title":"mongorestore command -error dont know what to do with the dump file","tags":["mongodb","mongo-shell"],"question_text":"I have mongo DB installed in the following path c:\/mongodb\/bin.I have configured my environment variable PATH in advanced settings.I also have mongod running .When I run the following comma...
{"title":"NSData and UIImage","tags":["ios","iphone","cocoa-touch","uiimage","nsdata"],"question_text":"I am trying to load\n`UIImage`\nobject from\n`NSData`\n, and the sample code was to\n`NSImage`\n, I guess they should be the same. But just now loading the image, I am wondering what's the best to troubleshoot the\n`...
{"title":"GCD to perform task in main thread","tags":["objective-c","grand-central-dispatch"],"question_text":"I have a callback which might come from any thread. When I get this callback, then I would like to perform a certain task on the main thread.\nDo I need to check whether I already am on the main thread - or is...
{"title":"Jackson: how to prevent field serialization","tags":["java","json","jackson"],"question_text":"I have an entity class with a password field:\n`class User {\n private String password;\n \/\/setter, getter..\n}`\nI want this field to be skipped during serialization. But it should still be able to DEserialize. T...
{"title":"Change text color of one word in a TextView","tags":["android","string","colors","textview","android-textview"],"question_text":"I am looking for a way to change the color of a text of a single word in a\n`TextView`\nfrom within an\n`Activity`\n.\nFor example, with this:\n`String first = \"This word is \";\nS...
{"title":"How to return more than one value from a function in Python?","tags":["python","function","multiple-variable-return"],"question_text":"How to return more than one variable from a function in Python?","answer_text":"You separate the values you want to return by commas:\n`def get_name():\n # you code\n return f...
{"title":"webxml attribute is required with Servlet 3.0","tags":["maven","maven-plugin","vaadin","vaadin7"],"question_text":"I get this error when trying to compile a Vaadin WAR:\n`Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project testvaadin-web: Error assembling WAR: w...
{"title":"GitHub Windows client behind proxy","tags":["github","proxy","github-for-windows"],"question_text":"I'm trying to get the GitHub client for Windows working. I am on a corporate Win 7 x64 computer behind a corporate proxy and firewall. Following various other posts and experimenting with multiple combinations ...
{"title":"Slide a div offscreen using jQuery","tags":["javascript","jquery","html","css"],"question_text":"This is a bit of a challenge. Here's what I'm looking for:\n3 divs on screen\nDiv 1 resides in the middle of the page (centered)\nDiv 2 resides just off the screen on the far left\nDiv 3 resides just off the scree...
{"title":"Difference between numpy.array shape (R, 1) and (R,)","tags":["python","numpy","matrix","multidimensional-array"],"question_text":"In\n`numpy`\n, some of the operations return in shape\n`(R, 1)`\nbut some return\n`(R,)`\n. This will make matrix multiplication more tedious since explicit\n`reshape`\nis require...
{"title":"What is the easiest way to encrypt a password when I save it to the registry?","tags":["c#","encryption","passwords"],"question_text":"Currently I'm writing it in clear text\noops!\n, it's an in house program so it's not that bad but I'd like to do it right. How should I go about encrypting this when writing ...
{"title":"Twitter Bootstrap: Center Text on Progress Bar","tags":["css","twitter-bootstrap","progress-bar","centering"],"question_text":"I've been using Twitter's bootstrap and I would like the text on the progress bar to be centered on the on bar regardless of value.\nThe below link is what I have now. I would like al...
{"title":"Dropdownlist width in IE","tags":["javascript","html","internet-explorer","drop-down-menu"],"question_text":"In IE, the dropdown-list takes the same width as the dropbox (I hope I am making sense) whereas in Firefox the dropdown-list's width varies according to the content.\nThis basically means that I have t...
{"title":"Can i sort the NSDictionary on basis of key in Objective-C?","tags":["objective-c","sorting","key","nsdictionary"],"question_text":"Can I sort the\n`NSDictionary`\non basis of key?","answer_text":"You can sort the keys and then create an\n`NSMutableArray`\nby iterating over them.\n`NSArray *sortedKeys = [[dic...
{"title":"Combine --user with --prefix error with setup.py install","tags":["python","installation","distutils"],"question_text":"I was trying to install Python packages a system I recently gained access to. I was trying to take advantage of Python's relatively new\nper user site-packages directory\n, and the new optio...
{"title":"How to get a complete list of object's methods and attributes?","tags":["python"],"question_text":"`dir(re.compile(pattern))`\ndoes not return pattern as one of the lists's elements. Namely it returns:\n`['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn']`...
{"title":"Best way to format if statement with multiple conditions","tags":["language-agnostic","if-statement"],"question_text":"If you want to some code to execute based on two or more conditions which is the best way to format that if statement ?\nfirst example:-\n`if(ConditionOne && ConditionTwo && ConditionThree)\n...
{"title":"Multi-line comments in Xcode","tags":["xcode"],"question_text":"Is there a way to comment various lines at the same time in Xcode IDE? Selecting which lines to comment, then clicking somewhere et voil\u00c3\u00a1.. the \/* ... *\/ characters wrapping the code.\nThank you.","answer_text":"Command\n+\nShift\n+\...
{"title":"The request was aborted: Could not create SSL\/TLS secure channel","tags":["c#","asp.net","windows-8","windows-7","httpwebrequest"],"question_text":"We are unable to connect to an HTTPS server using\n`WebRequest`\nbecause of this error message:\n`The request was aborted: Could not create SSL\/TLS secure chann...
{"title":"Favorite (Clever) Defensive Programming Best Practices","tags":["language-agnostic"],"question_text":"If you had to choose your\nFavorite\n(clever) techniques for defensive coding, what would they be? Although my current languages are Java and Objective-C (with a background in C++), feel free to answer in any...
{"title":"Python: Is there a way to determine the encoding of text file?","tags":["python","encoding","text-files"],"question_text":"I know there is something buried in\nhere\n. But I was just wondering if there is an actual way built into Python to determine text file encoding?\nThanks for your help :)\nEdit: As a sid...
{"title":"Are there static analysis tools for Python?","tags":["python","static-analysis","pylint","pyflakes"],"question_text":"I am starting to use Python (specifically because of Django) and I would like to remove the burden for exhaustive testing by performing some static analysis. What tools\/parameters\/etc. exist...
{"title":"Linux - Install redis-cli only","tags":["linux","redis"],"question_text":"I have a Linux server with Redis installed and I want to connect to it via command line from my local Linux machine.\nIs it possible to install\n`redis-cli`\nonly (without\n`redis-server`\nand other tools)?\nIf I just copy\n`redis-cli`\...
{"title":"In Jinja2, how do you test if a variable is undefined?","tags":["django","jinja2"],"question_text":"Converting from Django, I'm used to doing something like this:\n`{% if not var1 %} {% endif %}`\nand having it work if I didn't put var1 into the context. Jinja2 gives me an undefined error. Is there an easy wa...
{"title":"set height of imageview as matchparent programatically","tags":["android","height","imageview"],"question_text":"I need to set the height of an\nimageview\nas\nmatchparent\nprogramatically.if it is a fixed height i know how to set.\nbut how can i set it as matchparent?\nEDIT:\nactually height of the parent la...
{"title":"Can I change the fill color of an svg path with CSS?","tags":["javascript","jquery","html","css","svg"],"question_text":"I have the following code:\n`<span>\n <svg height=\"32\" version=\"1.1\" width=\"32\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"overflow: hidden; position: relative; left: -0.0166626...
{"title":"Does Android keep the .apk files? if so where?","tags":["android","packages","apk","installer"],"question_text":"After android installs an application from the Marketplace, does it keep the .apk file?\nIs there a standard location where Android would keep such files?","answer_text":"Preinstalled applications ...
{"title":"How to tell which unix shell I am using?","tags":["linux","shell","unix"],"question_text":"Is there an easy way by which I can tell which type of unix shell I am in i.e. whether I am in a\n`bash \/ csh \/ ksh \/ tcsh`\n?","answer_text":"Try:\n`echo $0`\nThis often works across a range of shells.","question_co...
{"title":"AJAX: Check if a string is JSON?","tags":["javascript","ajax","json","validation"],"question_text":"My JavaScript sometimes crashes on this line:\n`var json = eval('(' + this.responseText + ')');`\nCrashes are caused when the argument of\n`eval()`\nis not JSON. Is there any way to check if the string is JSON ...
{"title":"ruby-debug with Ruby 1.9.3?","tags":["ruby-on-rails","ruby","ruby-1.9.3","ruby-debug"],"question_text":"I just updated to Ruby 1.9.3p0 and Rails 3.1.1. Now when I try to launch the server, it complains that I should install\n`ruby-debug`\n, even though it's already installed.\n`% rails server --environment=de...
{"title":"Where is Vagrant saving changes to the VM?","tags":["vagrant"],"question_text":"I am just starting with Vagrant and I am having a little trouble understanding a few details. I have read through the docs but still am missing a basic concept. When I want to start a Vagrant box I run:\n`vagrant up`\nThis will \"...
{"title":"Export query result to .csv file in SQL Server 2008","tags":["sql-server-2008"],"question_text":"How can I export a query result to a .csv file in SQL Server 2008?","answer_text":"Open SQL Server Management Studio\nGo to Tools > Options > Query\nResults > SQL Server > Results To Text\nOn the far right, there ...
{"title":"How to do copy\/paste function programmatically in iphone?","tags":["iphone"],"question_text":"I have a text-view with some text and a copy button in that view,\nwhen the user enter some text and press the copy button it needs to copy that text and paste that text wherever he wants.\nI know there is a default...
{"title":"Server certificate verification failed: issuer is not trusted","tags":["svn","ant"],"question_text":"I am getting below error when running a target of ANT script. Error message saying that \"server certificate verification is failed\". Please help how to remove this problem. I am working in Windows XP.\n`C:\\...
{"title":"How to set a particular font for a button text in android?","tags":["android","button","text","fonts"],"question_text":"I want my button text to be in the\nCopperplate Gothic Light\nfont and I yet have not come across a simple clean code for a simple function as this. Help!\nPS: Since android comes with ariel...
{"title":"HTML if image is not found","tags":["html"],"question_text":"I have an image in a HTML page:\nIf the image is not found on the server it shows an ugly blank square.\nI want to make it so that if an image is not found it will display nothing or some other default image that I know is definitely on the server.\...
{"title":"Changing cursor to waiting in javascript\/jquery","tags":["javascript","jquery","html"],"question_text":"How would i get my cursor to change to this loading icon when a function is called and how would i change it back to a normal cursor in javascript\/jquery","answer_text":"In your jQuery use:\n`$(\"body\")....
{"title":"Disable gesture recognizer","tags":["objective-c","xcode","uigesturerecognizer","swipe"],"question_text":"I have two types of recognizer, one for tap and one for swipe\n`UIGestureRecognizer *recognizer;\n\/\/TAP\nrecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap1:)];\n[(...
{"title":"WatiN or Selenium?","tags":["asp.net","selenium","automated-tests","watin"],"question_text":"I'm going to start building some automated tests of our presentation soon. It seems that everyone recommends\nWatiN\nand\nSelenium\n. Which do you prefer for automated testing of ASP.NET web forms? Why did that produc...
{"title":"How to select multiple rows filled with constants?","tags":["sql","select","constants"],"question_text":"Selecting constants without referring to a table is perfectly legal in an SQL statement:\n`SELECT 1, 2, 3`\nThe result set that the latter returns is a single row containing the values. I was wondering if ...
{"title":"How to get a pixel's x,y coordinate color from an image?","tags":["javascript","html5","image-processing"],"question_text":"Is there any way to check if a selected(x,y) point of a PNG image is transparent?","answer_text":"Building on Jeff's answer, your first step would be to create a canvas representation of...
{"title":"Format price in the current locale and currency","tags":["php","magento"],"question_text":"I use :\n`$product->getPrice();`\nto get the unformatted price that I can calculate \"quantity X price\" with ajax.\nI want to reformat the total in the current locale and currency. How can I do that?","answer_text":"I ...
{"title":"Python: Difference between class and instance attributes","tags":["python","attributes"],"question_text":"Is there any meaningful distinction between:\n`class A(object):\n foo = 5 # some default value`\nvs.\n`class B(object):\n def __init__(self, foo=5):\n self.foo = foo`\nIf you're creating a lot of instance...
{"title":"How do I reliably split a string in Python?","tags":["python","string","python-3.x","split"],"question_text":"In Perl I can do:\n`my ($x, $y) = split \/:\/, $str;`\nAnd it will work whether or not the string contains the pattern.\nIn Python, however this won't work:\n`a, b = \"foo\".split(\":\") # ValueError:...
{"title":"Golang - Getting a slice of keys from a map","tags":["go"],"question_text":"Is there any simpler\/nicer way of getting a slice of keys from a map in Go?\nCurrently I am iterating over the map and copying the keys to a slice:\n`i := 0\nkeys := make([]int, len(mymap))\nfor k := range mymap {\n keys[i] = k\n i++...
{"title":"What's the main difference between Java SE and Java EE?","tags":["java","java-ee"],"question_text":"What's the main difference between Java SE and Java EE?","answer_text":"Java SE\n(formerly J2SE) is the basic Java environment. In Java SE, you make all the \"standards\" programs with Java, using the API\ndesc...
{"title":"What's the deal with a leading underscore in PHP class methods?","tags":["php","coding-style"],"question_text":"While looking over various PHP libraries I've noticed that a lot of people choose to prefix some class methods with a single underscore, such as\n`public function _foo()`\n...instead of...\n`public ...
{"title":"List directory in Go","tags":["go"],"question_text":"I've been trying to figure out how to simply list the files and folders in a single directory in Go.\nI've found\n`filepath.Walk`\n, but it goes into sub-directories automatically, which I don't want. All of my other searches haven't turned anything better ...
{"title":"Scroll View not functioning IOS 7","tags":["iphone","uiscrollview","ios7"],"question_text":"I have a scrollview inside which i have 20 UItextviews. The scrollview is not working. I have set the following in viewdidload.\n`self.MainScroll.contentSize = CGSizeMake(320, 1800);`\nStill it doesn't scroll. However,...
{"title":"Testing for empty or nil-value string","tags":["ruby-on-rails","ruby"],"question_text":"I'm trying to set a variable conditionally in Ruby. I need to set it if the variable is nil or empty (0 length string). I've come up with the following:\n`variable = id if variable.nil? || (!variable.nil? && variable.empty...
{"title":"Nodejs - Redirect url","tags":["node.js","redirect"],"question_text":"How do I get a node.js server to redirect users to a 404.html page when they enter an invalid url?\nI did some searching, and it looks like most results are for Express, but I want to write my server in pure node.js.","answer_text":"The log...
{"title":"Javascript regular expression: remove first and last slash","tags":["javascript","regex"],"question_text":"I have these strings in javascript:\n`\/banking\/bonifici\/italia\n\/banking\/bonifici\/italia\/`\nand I would like to remove the first and last slash if it's exists.\nI tried\n`^\\\/(.+)\\\/?$`\nbut it ...
{"title":"Update built-in vim on Mac OS X","tags":["osx","vim"],"question_text":"I know this might be more appropriate at Ask Different, but as I tried adding tags there, there was no\n`vim`\ntag, only\n`macvim`\n. So I figured I might get a better audience here.\nIn the Terminal, I do the following\n`$ vim --version\n...
{"title":"formatting code within notepad++?","tags":["html","notepad++","code-formatting"],"question_text":"Is there a keyboard shortcut to format code within Notepad++ ?\nI'm mainly working with HTML, CSS and Python code.\nFor example:\n`<title>{% block title %} {% endblock %}<\/title> \n <link rel=\"stylesheet\" href...
{"title":"Update MySQL version from 5.1 to 5.5 in CentOS 6.2","tags":["mysql","database","centos"],"question_text":"I tried to update MySQL from 5.1 to 5.5 in CentOS 6.2. The following is the process I did:\n`1. rpm -Uvh http:\/\/repo.webtatic.com\/yum\/centos\/5\/latest.rpm\n2. yum install libmysqlclient15 --enablerep...
{"title":"Python, why elif keyword?","tags":["python","keyword"],"question_text":"I just started Python programming, and I'm wondering about the\n`elif`\nkeyword.\nOther programming languages I've used before use\n`else if`\n. Does anyone have an idea why the Python developers added the additional\n`elif`\nkeyword?\nWh...
{"title":"PHP: Split string into array, like explode with no delimiter","tags":["php","string","arrays","split","explode"],"question_text":"I have a string such as:\n\"0123456789\"\nand need to split EACH character into an array.\nI for the hell of it tried:\n`explode('', '123545789');`\nBut it gave me the obvious:\nWa...
{"title":"How to check if a number is included in a range (in one statement)?","tags":["ruby-on-rails","ruby","ruby-on-rails-3","numbers","range"],"question_text":"I am using Ruby on Rails 3.0.9 and I would like to check if a number is included in a range. That is, if I have a variable\n`number = 5`\nI would like to ch...
{"title":"Export from sqlite to csv using shell script","tags":["sqlite","shell","csv"],"question_text":"I'm making a shell script to export a sqlite query to a csv file, just like this:\n`#!\/bin\/bash\n.\/bin\/sqlite3 .\/sys\/xserve_sqlite.db \".headers on\"\n.\/bin\/sqlite3 .\/sys\/xserve_sqlite.db \".mode csv\"\n.\...
{"title":"Why is access to the path denied?","tags":["c#","asp.net","io","unauthorizedaccessexcepti"],"question_text":"I am having a problem where I am trying to delete my file but I get an exception.\n`if (result == \"Success\")\n{\n if (FileUpload.HasFile)\n {\n try\n {\n File.Delete(Request.PhysicalApplicationPath +...
{"title":"bash filepath to parent directory of file","tags":["bash","string"],"question_text":"I need to do some batch extracting, and in my script I need the\ndirectory\nof the file I am working with. For example, the\nfile\n=\n\"stuff\/backup\/file.zip\"\n; I need a way to get the string \"\nstuff\/backup\/\n\" from ...
{"title":"What is special about structs?","tags":["c","arrays","struct","return","return-value"],"question_text":"I know that in C we cannot return an array from a function, but a pointer to an array. But I want to know what is the special thing about\n`structs`\nthat makes them return-able by functions even though the...
{"title":"How to break outer cycle in Ruby?","tags":["ruby","loops","cycle"],"question_text":"In Perl, there is an ability to break an outer cycle like this:\n`AAA: for my $stuff (@otherstuff) {\n for my $foo (@bar) {\n last AAA if (somethingbad());\n }\n }`\n(syntax may be wrong), which uses a loop label to break the ...
{"title":"Change a django form field to a hidden field","tags":["python","html","django","django-forms"],"question_text":"I have a django form with a\n`RegexField`\n(which is very similar to a normal text input field). In my view, under certain conditions I want to hide this from the user, and trying to keep the form a...
{"title":"How to Correctly Use Lists in R?","tags":["r","data-structures","language-design","language-features","abstract-data-type"],"question_text":"Brief background: Many (most?) contemporary programming languages in widespread use have at least a handful of ADTs [abstract data types] in common, in particular,\nstri...
{"title":"How to produce range with step n in bash? (generate a sequence of numbers with increments)","tags":["bash","range"],"question_text":"The way to iterate over a range in bash is\n`for i in {0..10}; do echo $i; done`\nWhat would be the syntax for iterating over the sequence with a step? Say, I would like to get ...
{"title":"Difference between String#equals and String#contentEquals methods","tags":["java","string","equality"],"question_text":"What is the difference between the\n`String#equals`\nmethod and the\n`String#contentEquals`\nmethod?","answer_text":"The\n`String#equals()`\nnot only compares the String's contents, but also...
{"title":"how to put UISlider vertical?","tags":["iphone","uislider"],"question_text":"I want to put uislider in verticaly.i have no idea about this.so please help me for this.","answer_text":"You have to do this programaticaly. Assuming your UISlider is bound to a variable called\n`slider`\n, add this code in your vie...
{"title":"Tiled Background Image: Can I do that easily with UIImageView?","tags":["iphone","uiimageview"],"question_text":"I have a fullscreen background image that is tiled, i.e. it has to be reproduced a few times horizontally and vertically in order to make a big one. Like in the browsers on ugly home pages ;)\nIs U...
{"title":"firebug: how to cd to an iframe","tags":["facebook","iframe","firebug"],"question_text":"I have a facebook canvas application that runs in an iframe. I would like to debug my page in firebug but can not get the javascript to scope to the iframe that is running my app.\nthe iframe:\n`<iframe frameborder=\"0\" ...
{"title":"Reactjs - Rerender on browser resize","tags":["javascript","reactjs"],"question_text":"How can I get React to re-render the view when the browser window is resized?\nBackground\nI have some blocks that I want to layout individually on the page, however I also want them to update when the browser window change...
{"title":"How do I make my string comparison case insensitive?","tags":["java","string","comparison","case-insensitive"],"question_text":"I created one Java program to compare two strings:\n`String s1 = \"Hello\";\nString s2 = \"hello\";\nif (s1.equals(s2)) {\n System.out.println(\"hai\");\n} else {\n System.out.printl...
{"title":"Apache httpd setup and installation","tags":["apache","apr"],"question_text":"This is my first time I am trying to install Apache HTTP server locally in my box as a regular user (non-root).\nI have downloaded Apache 2.4.1 version of Apache HTTP server [http:\/\/httpd.apache.org\/download.cgi]. However when I ...
{"title":"Move textfield when keyboard appears swift","tags":["ios","swift","cocoa-touch","keyboard","uitextfield"],"question_text":"I'm using swift for program with IOS and i use this code for move the textfield, but does not work, I call correctly the function keyboardWillShow but the textfield doesn't move.. i'm usi...
{"title":"RequireJS: How to define modules that contain a single \"class\"?","tags":["javascript","commonjs","requirejs"],"question_text":"I have a number of JavaScript \"classes\" each implemented in its own JavaScript file. For development those files are loaded individually, and for production they are concatenated,...
{"title":"How to send a simple string between two programs using pipes?","tags":["c","unix","pipe"],"question_text":"I tried searching on the net, but there are hardly any resources. A small example would suffice.\nEDIT\nI mean, two different C programs communicating with each other. One program should send \"Hi\" and ...
{"title":"MySQL - How to ORDER BY RELEVANCE? INNODB Table","tags":["mysql","search","order","innodb","relevance"],"question_text":"I've got about 20,000 rows in an INNODB table called 'cards', so FULLTEXT is not an option.\nPlease consider this table:\n`id | name | description\n-----------------------------------------...
{"title":"Set multiple variables to the same value in Javascript","tags":["javascript"],"question_text":"I have initialized several variables in the global scope in a Javascript file:\n`var moveUp, moveDown, moveLeft, moveRight;\nvar mouseDown, touchDown;`\nI need to set all of these variables to false, this is the cod...
{"title":"How can I reorder a list in python?","tags":["python"],"question_text":"If I have a list\n`[a,b,c,d,e]`\nhow can I reorder the items in an arbitrary manner like\n`[d,c,a,b,e]`\n?\nEdit: I don't want to shuffle them. I want to re-order them in a predefined manner. (for example, I know that the 3rd element in t...
{"title":"How to add a new audio (not mixing) into a video using ffmpeg?","tags":["audio","video","ffmpeg"],"question_text":"I used a command like:\n`ffmpeg -i video.avi -i audio.mp3 -vcodec codec -acodec codec output_video.avi -newaudio`\nin latest version for adding new audio track to video (not mix).\nBut I updated ...
{"title":"Looking for suggestions for building a secure REST API within Ruby on Rails","tags":["ruby-on-rails","ruby","security","rest","web-api"],"question_text":"I'm getting started on building a REST API for a project I'm working on, and it led me to do a little research as to the best way to build an API using RoR....
{"title":"Detect URLs in text with JavaScript","tags":["javascript","regex","url"],"question_text":"Does anyone have suggestions for detecting URLs in a set of strings?\n`arrayOfStrings.forEach(function(string){\n \/\/ detect URLs in strings and do something swell,\n \/\/ like creating elements with links.\n});`\nUpdat...
{"title":"ASP.NET MVC: Custom Validation by DataAnnotation","tags":["c#",".net","asp.net-mvc","asp.net-mvc-3","data-annotations"],"question_text":"I have a Model with 4 properties which are of type string. I know you can validate the length of a single property by using the StringLength annotation. However I want to va...
{"title":"How to cast int to enum in C++?","tags":["c++","casting","enums"],"question_text":"Possible Duplicate:\nGeneric way to cast int to enum in C++\nHow do I cast an int to an enum in C++?\nFor example:\n`enum Test\n{\n A, B\n};\nint a = 1;`\nHow do I convert\n`a`\nto type Test::A?","answer_text":"`int i = 1;\nTes...
{"title":"Hiding the presentation controls in LaTeX beamer presentation","tags":["latex","presentation","beamer"],"question_text":"I am currently building a presentation using LaTeX beamer. Is there a way to hide the presentation controls on the bottom of the slides? I don't use those controls, and they sometimes colli...
{"title":"Android L - Material design on SwipeRefreshLayout color scheme","tags":["colors","android-5.0-lollipop","material-design"],"question_text":"I\u00c2\u00b4m starting to implement the Material Theme on my newest project, preparing it for the launch of the new L version.\nI\u00c2\u00b4ve been reading the Material...
{"title":"Why use JUnit for testing?","tags":["java","unit-testing","junit","tdd"],"question_text":"Maybe my question is a newbie one, but I can not really understand the circumstances under which I would use\njunit\n?\nWhether I write simple applications or larger ones I test them with the\n`System.out`\nstatements an...
{"title":"Ajax, back button and DOM updates","tags":["javascript","ajax","firefox"],"question_text":"If javascript modifies DOM in page A, user navigates to page B and then hits back button to get back to the page A. All modifications to DOM of page A are lost and user is presented with version that was originally retr...
{"title":"int to hex string","tags":["c#"],"question_text":"I need to convert and int to hex string.\nwhen converting\n`1400 => 578`\nusing\n`ToString(\"X\")`\nor\n`ToString(\"X2\")`\nbut I need it like\n`0578`\n.\nCan anyone provide me the IFormatter to ensure that the string has 4 chars long?","answer_text":"Use\n`To...
{"title":"Pass a String from one Activity to another Activity in Android","tags":["android"],"question_text":"This is my string:\n`private final String easyPuzzle =\"630208010200050089109060030\"+\n \"008006050000187000060500900\"+\n \"09007010681002000502003097\";`\nI want to show this string on the another activity a...
{"title":"Elegantly determine if more than one boolean is \"true\"","tags":["c#","hammingweight"],"question_text":"I have a set of five boolean values. If more than one of these are true I want to excecute a particular function. What is the most elegant way you can think of that would allow me to check this condition i...
{"title":"Unknown encoder 'libx264'","tags":["ubuntu","ffmpeg","x264","avconv"],"question_text":"I installed ffmpeg 0.8.9 on ubuntu11 by\n.\/configure --enable-gpl --enable-nonfree --enable-pthreads\n --enable-libfaac --enable-libmp3lame --enable-libx264\nWhen I run it\n`ffmpeg -y -i test.mp4 -f mpegts -acodec libmp3la...
{"title":"First letter in UiTextField lowercase","tags":["iphone","objective-c","uitextfield"],"question_text":"How do you make it so that when you start typing on the keyboard after youve clicked on a UITextfield the first letter isn't a capital automatically?","answer_text":"`textField.autocapitalizationType = UIText...
{"title":"Linux memory: buffer vs cache","tags":["linux","caching","memory","buffer"],"question_text":"To me it's not clear what's the difference between the two Linux memory concept :\n`buffer`\nand\n`cache`\n. I've read through\nthis post\nand it seems to me that the difference between them is the expiration policy:\...
{"title":"Read file-contents into a string in C++","tags":["c++","string","file-io"],"question_text":"Possible Duplicate:\nWhat is the best way to slurp a file into a std::string in c++?\nIn scripting languages like Perl, it is possible to read a file into a variable in one shot.\n`open(FILEHANDLE,$file);\n $content=<F...
{"title":"Are search engines going to see my dynamically created content in Bootstrap tabs?","tags":["javascript","twitter-bootstrap","tabs","seo","search-engine"],"question_text":"I have a page\n`index.php`\nwith 3 Bootstrap tabs in it, and for each tab I am generating its content after user clicks on it.\nFor example...
{"title":"Google app engine or amazon web services","tags":["google-app-engine","amazon-web-services"],"question_text":"I am a newbie to us cloud hosting. I want to know which is better to start with, either Google app engine or Amazon web service.\nMy questions are:\nMy application is based on java, Database is MySQL....
{"title":"SQL Server Insert if not exist","tags":["sql","sql-server","stored-procedures","sql-insert"],"question_text":"I want to insert data in my table, but insert only that doesn't exist in my DB!\nhere is my code:\n`ALTER PROCEDURE [dbo].[EmailsRecebidosInsert]\n (@_DE nvarchar(50),\n @_ASSUNTO nvarchar(50),\n @_DA...