text
stringlengths
74
309k
{"title":"Redirecting to SSL using nginx","tags":["nginx"],"question_text":"I have http:\/\/ and https:\/\/ on the same host like the following:\n`server {\n listen 80;\n listen 443 ssl;\n ...\n ...\n}`\nWhat I need to do is redirecting users who access my shop to https:\/\/. The problem is I have many languages:\nhttp...
{"title":"How to load a .NET assembly for reflection operations and subsequently unload it?","tags":[".net","assemblies","appdomain","assembly-attributes"],"question_text":"I'm writing a tool to report information about .NET applications deployed across environments and regions within my client's systems.\nI'd like to ...
{"title":"Scaffolding ActiveRecord: two columns of the same data type","tags":["ruby-on-rails","ruby","activerecord","scaffolding"],"question_text":"Another basic Rails question:\nI have a database table that needs to contain references to exactly two different records of a specific data type.\nHypothetical example: I'...
{"title":"Git in Visual Studio. Conflict prevents checkout","tags":["git","visual-studio","visual-studio-2013","conflict"],"question_text":"I am using git in Visual studio. When I am trying to synchronize, the following message appears.\nAn error occured. Detailed message: An error was raised by libgit2. Cetegory = che...
{"title":"How to modify capistrano deploy to automatically run migrations in Rails 3.0","tags":["ruby-on-rails","ruby-on-rails-3","deployment","capistrano"],"question_text":"Right now, I have to run cap deploy and cap deploy:migrations if there are migrations to be run.\nhow I modify the cap deploy task to run migratio...
{"title":"Begin Rescue not catching error","tags":["ruby-on-rails","ruby","error-handling","rescue"],"question_text":"I'm using some ruby code wrapped in a begin - rescue block but somehow it manages to still crash.\nthe block of code looks like this:\n`# Retrieve messages from server\ndef get_messages\n @connection.se...
{"title":"Get value from text area","tags":["javascript","html","textarea"],"question_text":"How to get value from the textarea field when it's not equal \"\".\nI tried this code, but when I enter text into textarea the alert() isn't works.\nHow to fix it?\n`<textarea name=\"textarea\" placeholder=\"Enter the text...\"...
{"title":"How do I reset the postgresql 9.2 default user (usually 'postgres') password on mac os x 10.8.2?","tags":["osx","postgresql"],"question_text":"I just installed\n`PostgreSQL 9.2`\nfrom\nenterprisedb\nonto\n`Mac OS X 10.8.2`\n. I mistyped my\n`postgres`\nuser password, so I can't connect. How do I reset the pas...
{"title":"How to check if the USER is already created in the database or not in SQL?","tags":["sql","tsql"],"question_text":"Is there is a way that from it I can know if the user(\nnot\nthe login) is already created in the database? I mean the user not the login, since, I know how to check for the login. I need to chec...
{"title":"Using a class name in jQuery's .closest()","tags":["jquery","class","math","closest"],"question_text":"I'm attempting to do some calculations for a \"running total\", this is my code:\n`$('.quantity_input').live('change',function(){ \n var ValOne = parseFloat($(this).val());\n var ValTwo = parseFloat($(\".pri...
{"title":"WPF combobox SelectedValue binding to string","tags":["wpf"],"question_text":"I've bound my\n`ComboBox`\n`SelectedValue`\nto a\n`string`\nin my codebehind, but when the value is set, the string becomes a\n`ComboBoxItem`\n. How do I just bind the selected value as a string?","answer_text":"This is probably bec...
{"title":"int() argument must be a string or a number, not 'SimpleLazyObject'","tags":["django","django-views"],"question_text":"I got, following Error messages,\nTypeError at \/save\/ int() argument must be a string or a number, not\n 'SimpleLazyObject'\nWhile executing following form.\nviews.py\n`def bookmark_save_pa...
{"title":"SlickGrid and Text Selection","tags":["slickgrid"],"question_text":"In the\ndemos\nI have seen and in my own code, SlickGrid cells do not allow their text to be selected. Is it possible to allow the user to select text from cells. If so, how?","answer_text":"Set the\n`enableTextSelectionOnCells`\noption to tr...
{"title":"execute a string of PHP code on the command line","tags":["command-line","php"],"question_text":"I'd like to be able to run a line of PHP code on the command line similar to how the following options work:\n`:~> perl -e \"print 'hi';\"\n:~> python -c \"print 'hi'\"\n:~> ruby -e \"puts 'hi'\"`\nI'd like to be ...
{"title":"Converting java.util.Properties To HashMap<string,string>","tags":["java"],"question_text":"`Properties properties = new Properties();\nMap<String, String> map = new HashMap<String, String>(properties);\/\/ why wrong?`\njava.util.Properties is a implement of Map, And HashMap constructor receive a Map type par...
{"title":"Multidimensional arrays in Swift","tags":["arrays","swift"],"question_text":"Edit: As Adam Washington points out, as from Beta 6, this code works as is, so the question is no longer relevant.\nI am trying to create and iterate through a two dimensional array:\n`var array = Array(count:NumColumns, repeatedValu...
{"title":"How can I access a private constructor of a class?","tags":["java","oop","constructor","instance"],"question_text":"I am a Java developer. In an interview I was asked a question about private constructors:\nCan you access a private constructor of a class and instantiate it?\nI answered 'No' but was wrong.\nCa...
{"title":"Why doesn't floor return an integer?","tags":["c++","c"],"question_text":"Just now I stumbled upon the fact, that the C++ function\n`floor`\nreturns the same type you pass to it, be it\n`float`\n,\n`double`\nor such.\nAccording to\nthis reference\n, the function returns a down rounded integral value. Why isn'...
{"title":"IIS Express is automatically disabling anonymous authentication for my project, why?","tags":["asp.net-mvc","visual-studio","web-config","iis-express"],"question_text":"When I switch my ASP.NET MVC project from Cassini web server to IIS Express, this is added to my\n`applicationhost.config`\nfile:\n`<location...
{"title":"jQuery slideUp to show the element and not hide","tags":["javascript","jquery"],"question_text":"jQuery's slideUp effect hides the element by sliding it up, while slideDown shows the element. I want to show my div using slideUp. can anyone guide me ? thanks","answer_text":"`$(\"div\").click(function () {\n $(...
{"title":"Sending commands and strings to Terminal.app with Applescript","tags":["osx","terminal","applescript"],"question_text":"I want to do something like this:\n`tell application \"Terminal\"\n activate\n do script \"ssh user@server.com\"\n -- \/\/ write user's password\n -- \/\/ write some linux commands to remote...
{"title":"How to calculate the bounding box for a given lat\/lng location?","tags":["geocoding","panoramio"],"question_text":"I have given a location defined by latitude and longitude.\nNow i want to calculate a bounding box within e.g. 10 kilometers of that point.\nThe bounding box should be defined as latmin, lngmin ...
{"title":"iOS JSON NSString Parse","tags":["ios","json"],"question_text":"I have a JSON string as an NSString object in iOS. I want to parse this and pull out the given parameters in the JSON string. Is there a efficient way to parse this or is the only way to search for substrings etc.?","answer_text":"The way to do i...
{"title":"NSInvalidArgumentException - receiver has no segue with identifier","tags":["objective-c","uiviewcontroller","segue","identifier","uistoryboardsegue"],"question_text":"I have been trying everything for hours, and nothing's worked. I am trying to segue between two view controllers, from one tableViewController...
{"title":"ExitFailure 9 when trying to install ghc-mod using Cabal","tags":["haskell","cabal"],"question_text":"When I try to install it with cabal, I get\n`~$ cabal install ghc-mod\nResolving dependencies...\n[1 of 1] Compiling Main ( \/tmp\/haskell-src-exts-1.13.5-21238\/haskell-src-exts-1.13.5\/Setup.hs, \/tmp\/hask...
{"title":"Output values found in cursor to logcat? - Android","tags":["android","database","cursor"],"question_text":"I'm trying to debug an issue myself. May post it later if I fail ;-)\nMy logcat log states\n`\"android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 2\"`\nI would like to ...
{"title":"Perform insert for each row taken from a select?","tags":["sql","sql-server-2008","tsql","insert"],"question_text":"I have a number of records that I need to insert into multiple tables. Every other column will be a constant.\nPoor pseudo code below - this is what I want to do:\n`create table #temp_buildings\...
{"title":"jQuery - Fancybox: But I don't want scrollbars!","tags":["jquery","fancybox"],"question_text":"I am using jQuery Fancybox for a popup registration form\nhere\nI would like the form to come up at the size of 450px by 700px but no matter what I set the height and width at I get scrollbars:\n`<script type=\"text...
{"title":"fetching objects from core data not in a set","tags":["iphone","objective-c","core-data","nspredicate"],"question_text":"I'm trying to fetch objects from core data that are not in a given set, but I haven't been able to get it to work.\nFor instance, suppose that we have a core data entity named User, which h...
{"title":"reactjs giving error Uncaught TypeError: Super expression must either be null or a function, not undefined","tags":["reactjs","ecmascript-6"],"question_text":"I am using reactjs.\nWhen I run the code below the browser says:\nUncaught TypeError: Super expression must either be null or a function, not undefined...
{"title":"How to split string into a dictionary","tags":["c#","c#-3.0"],"question_text":"I have this string\n`string sx=\"(colorIndex=3)(font.family=Helvetica)(font.bold=1)\";`\nand am splitting it with\n`string [] ss=sx.Split(new char[] { '(', ')' },\n StringSplitOptions.RemoveEmptyEntries);`\nInstead of that, how cou...
{"title":"Why do constructors in java not have a return type?","tags":["java","constructor","return-type"],"question_text":"Possible Duplicate:\nWhy constructor not returns value\nWhy don't constructors have a return type, not even void? What's the reason for that?","answer_text":"Constructor is internally a\nnonstatic...
{"title":"Is there a way to uninstall dev dependencies with composer?","tags":["php","composer-php"],"question_text":"I want to uninstall (and not remove from my composer.json) dev dependencies on a project.\nIs there a simple way to do this ?","answer_text":"You can use following command after removing the dependencie...
{"title":"Cucumber - Capybara search for text within table row","tags":["ruby","ruby-on-rails-3","table","cucumber","capybara"],"question_text":"I'm trying to search within a single table row for my cucumber test.\nI have each row formatted like this:\n`%tr\n %td= title\n %td= complete\n %td= goal`\nAnd I am looking to...
{"title":"Bootstrap 3: How to set default grid to 960px width?","tags":["less","twitter-bootstrap-3"],"question_text":"I'm working with Bootstrap 3 and the client wants the website container width to be set to 960px. Do I directly edit the CSS file or what is the best way to do this? I heard something about \"Less\". D...
{"title":"Android ImageView ScaleType and item height","tags":["android","imageview","scale"],"question_text":"Things looked quite simple first but in the end the result is not good.\nI have an image which has a width larger than screen's width. So I need to scale it down in my imageview. I looked over the ScaleType op...
{"title":"How to compare nullable types?","tags":["c#","extension-methods","nullable"],"question_text":"I have a few places where I need to compare 2 (nullable) values, to see if they're the same.\nI think there should be something in the framework to support this, but can't find anything, so instead have the following...
{"title":"Get data from php array - AJAX - jQuery","tags":["javascript","json","jquery"],"question_text":"I have a page as below;\n`<head>\n<script type=\"text\/javascript\" src=\"jquery-1.6.1.js\"><\/script>\n<script type=\"text\/javascript\">\n$(document).ready( function() {\n$('#prev').click(function() {\n $.ajax({\...
{"title":"execute a main class from a jar","tags":["java","jar"],"question_text":"I have a jar which contain two main class Class A and Class B. In the manifest i have mentioned Class A . Now i have to execute classB from the same jar . what should be the command.\nI dont prefer to make two separate jars.\nThanks","ans...
{"title":"How to assign pointer address manually in C programming language?","tags":["c","memory","pointers"],"question_text":"How to assign pointer address manually in C programming language?\nfor example memory address is 0x28ff44","answer_text":"Like this:\n`void * p = (void *)0x28ff44;`\nOr if you want it as a\n`ch...
{"title":"How do negative margins in CSS work and why is (margin-top:-5 != margin-bottom:5)?","tags":["css","margin"],"question_text":"A common trick for vertical positioning elements is to use the following CSS:\n`.item {\n position:absolute;\n top:50%;\n margin-top:-8px; \/* half of height *\/\n height: 16px;\n}`\nWh...
{"title":"iOS 4: wireless app distribution for in-house applications ","tags":["iphone","ios4","wireless","software-distribution"],"question_text":"According to the apple website\niOS 4\nshould support wireless app distribution. I have been unable to find any documentation at all on how to host your applications for us...
{"title":"Why doesn't document.addEventListener('load', function) work in a greasemonkey script?","tags":["javascript","greasemonkey","addeventlistener"],"question_text":"It doesn't give an error, and I put a console.log('loaded userscript wifi-autologin'), the console.log works, but the intended effect of the document...
{"title":"How do I expand a tuple into variadic template function's arguments?","tags":["c++","c++11","arguments","tuples"],"question_text":"Consider the case of a templated function with variadic template arguments:\n`template<typename Tret, typename... T> Tret func(const T&... t);`\nNow, I have a tuple\n`t`\nof value...
{"title":"How to get value after decimal point from a double value in C#?","tags":[".net","double"],"question_text":"I would like to get the decimal value from a double value.\nFor example:\n`23.456 -> 0.456\n11.23 -> 0.23`\nCould anyone let me know how to do this in C#??\nThanks,\nMahesh","answer_text":"There is no Me...
{"title":"How can I change a .properties file in maven depending on my profile?","tags":["maven-2","properties"],"question_text":"How can I change a .properties file in maven depending on my profile? Depending on whether the application is built to run on a workstation or the datacenter parts of the file my_config.prop...
{"title":"Ruby - Digest::Digest is deprecated; Use Digest","tags":["ruby","warnings","ruby-2.1"],"question_text":"I've been getting this warning whenever I run my tests or start rails server.\nWhen I run grep from .rvm folder I see the following:\n`grep -R 'Digest::Digest' .\n.\/rubies\/ruby-2.1.0\/lib\/ruby\/2.1.0\/op...
{"title":"How to reset sequence in postgres and fill id column with new data?","tags":["postgresql","sequence"],"question_text":"I have a table with over million rows. I need to reset sequence and reassign id column with new values (1, 2, 3, 4... etc...). Is any easy way to do that?","answer_text":"If you don't want to...
{"title":"JQuery error option in $.ajax utility","tags":["jquery","ajax"],"question_text":"The documentation indicates that the error: option function will make available: XHR instance, a status message string (in this case always error) and an optional exception object returned from the XHR instance (Book: JQuery in A...
{"title":"How do I get my page title to have an icon?","tags":["html","icons"],"question_text":"I would like to have my site\u00e2\u0080\u0099s logo shown in the icon area of the title rather than the default white document. Exactly as Stack Overflow has it.","answer_text":"`<link rel=\"shortcut icon\" type=\"image\/x-...
{"title":"Using the Javascript slice() method with no arguments","tags":["javascript","jquery"],"question_text":"I'm currently reading through this\njquery masking plugin\nto try and understand how it works, and in numerous places the author calls the\n`slice()`\nfunction passing no arguments to it. For instance here t...
{"title":"Python: How to read a (static) file from inside a package?","tags":["python","file","package"],"question_text":"Could you tell me how can I read a file that is inside my python package?\nI have a following situation:\na package that I load has a number of templates (text files used as strings) that I want to ...
{"title":"How does str(list) work?","tags":["python","string","list","eval","python-internals"],"question_text":"Why does\n`str(list)`\nreturns how we see list on the console? How does\n`str(list)`\nwork? (any reference to the CPython code for\n`str(list)`\n)?\n`>>> x = ['abc', 'def', 'ghi']\n>>> str(x)\n\"['abc', 'def...
{"title":"How do I find the current machine's full hostname in C (hostname and domain information)?","tags":["c","sockets","posix","environment"],"question_text":"In a C project (POSIX), how do I get the fully qualified name for the current system?\nFor example, I can get just the hostname of my machine by doing\n`geth...
{"title":"Python lambda's binding to local values","tags":["python","closures","lambda"],"question_text":"The following code spits out\n`1`\ntwice, I expect to see\n`0`\nand then\n`1`\n`def pv(v) :\n print v\ndef test() :\n value = []\n value.append(0)\n value.append(1)\n x=[]\n for v in value :\n x.append(lambda : pv(...
{"title":"Do Chrome extensions have access to local storage?","tags":["google-chrome","google-chrome-extension","local-storage"],"question_text":"Is it possible to store data in a way that will be accessible after a browser restart in the context of a chrome extension?","answer_text":"even simpler than that:\nto read:\...
{"title":"Can I incorporate both SignalR and a RESTful API?","tags":["asp.net","rest","web-applications","asp.net-web-api","signalr"],"question_text":"I have a single page web app developed using ASP.NET. I recently converted many of the web methods to be push based, using the\nSignalR\nlibrary. This really sped up the...
{"title":"How to put the UIPageControl element on top of the sliding pages within a UIPageViewController?","tags":["ios","storyboard","uipageviewcontroller","uipagecontrol"],"question_text":"Regarding to this\ntutorial by AppCoda about how to implement a app with UIPageViewController\nI'd like to use a custom page cont...
{"title":"UnicodeEncodeError: 'ascii' codec can't encode character u'\\xe9' in position 7: ordinal not in range(128)","tags":["python","xml","unicode","python-unicode"],"question_text":"I have this code:\n`printinfo = title + \"\\t\" + old_vendor_id + \"\\t\" + apple_id + '\\n'\n # Write file\n f.write (printinfo + '\\...
{"title":"sorting and paging with gridview asp.net","tags":["asp.net","gridview","sorting","paging"],"question_text":"I'm trying to get a gridview to sort and page manually with no success.\nThe problem is that when a user clicks the column they want to sort, it sorts that page, but doesn't sort the datasource (datavie...
{"title":"can't click UIButton when it's added to UIImageView","tags":["iphone","uiimageview","uibutton"],"question_text":"guys, i want to click my uiButton after it's added to UIImageVIew, but it doesn't work.\nthis is my code :\n`UIButton *btnDetail = [[UIButton buttonWithType:UIButtonTypeDetailDisclosure]retain];\nb...
{"title":"IOS 6 force device orientation to landscape","tags":["iphone","objective-c","orientation","ios6"],"question_text":"I gave an app with say 10 view controllers. I use navigation controller to load\/unload them.\nAll but one are in portrait mode. Suppose the 7th VC is in landscape. I need it to be presented in l...
{"title":"Adjusting navigationItem.titleView's frame?","tags":["iphone","uinavigationitem"],"question_text":"I noticed that the titleView's position depends on the rightbarbutton title. How can I set the frame of the titleView to be in the center instead?\nI've tried setting titleView.frame, but to no avail.\nHere's th...
{"title":"How to set std::tuple element by index?","tags":["c++","templates","indexing","tuples"],"question_text":"One can get an element from\n`std::tuple`\nby index using\n`std::get`\n.\nAnalogically, how to\nset\ntuple's element by index?","answer_text":"`std::get`\nreturns a reference to the value. So you set the v...
{"title":"How can you sort an array without mutating the original array?","tags":["javascript"],"question_text":"Let's suppose I wanted a sort function that returns a sorted copy of the inputted array. I naively tried this\n`function sort(arr) {\n return arr.sort();\n}`\nand I tested it with this, which shows that my\n...
{"title":"Why do all backgrounds disappear on UITableViewCell select?","tags":["objective-c","cocoa-touch","uitableview","subclassing"],"question_text":"My current project's UITableViewCell behavior is baffling me. I have a fairly straightforward subclass of UITableViewCell. It adds a few extra elements to the base vie...
{"title":"android 9-patch graphic doesn't scale in image view","tags":["android","imageview","nine-patch"],"question_text":"I have\n`<LinearLayout android:id=\"@+id\/LinearLayout01\"\n android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\">\n <ImageView android...
{"title":"android activity has leaked window com.android.internal.policy.impl.phonewindow$decorview Issue","tags":["android","android-layout","memory-leaks","android-alertdialog"],"question_text":"I am working with Android application to show network error.\nNetErrorPage.java\n`package exp.app;\nimport android.app.Acti...
{"title":"jQuery: Handle fallback for failed AJAX Request","tags":["jquery","ajax","json","callback","wait"],"question_text":"Can jQuery provide a fallback for failed AJAX calls? This is my try:\n`function update() {\n var requestOK = false;\n $.getJSON(url, function(){\n alert('request successful');\n requestOK = true...
{"title":"How do you force mysql LIKE to be case sensitive?","tags":["mysql","sql","case-sensitive","sql-like"],"question_text":"Possible Duplicate:\nMysql Like Case Sensitive\nMysql ignores case for its LIKE comparisons.\nHow can you force it to perform case-sensitive LIKE comparisons?","answer_text":"Use\n`LIKE BINAR...
{"title":"what's the difference between \"hadoop fs\" shell commands and \"hdfs dfs\" shell commands?","tags":["hadoop","hdfs"],"question_text":"Are they supposed to be equal?\nbut, why the \"\n`hadoop fs`\n\" commands show the\n`hdfs files`\nwhile the \"\n`hdfs dfs`\n\" commands show the local files?\nhere is the hado...
{"title":"Why does this work: returning C string literal from std::string function and calling c_str()","tags":["c++"],"question_text":"We recently had a lecture in college where our professor told us about different things to be careful about when programming in different languages.\nThe following is an example in C++...
{"title":"Font weight turns lighter on Mac\/Safari","tags":["css","fonts","safari","font-smoothing"],"question_text":"On my last website, the text is perfect naturally on chrome and firefox without touching font-smoothing or anything else.\nBut on Mac \/ Safari 7 the text appears well then turns immediately thinner (to...
{"title":"Why do we use WebDriver instead of Selenium IDE?","tags":["selenium","webdriver","selenium-webdriver","selenium-ide"],"question_text":"Why can't we just record all of our test cases in\nSelenium IDE\n, export it to\nJava\/WebDriver\nand run it in WebDriver with Eclipse?\nI need a clear explanation as I am ver...
{"title":"How to test a WPF user interface?","tags":[".net","wpf","testing"],"question_text":"Using win forms with an\nMVC\n\/\nMVP\narchitecture, I would normally use a class to wrap a view to test the UI while using mocks for the model and controller\/presenter. The wrapper class would make most everything in the UI ...
{"title":"Why can't I map integers to strings when streaming from an array?","tags":["java","functional-programming","java-8","java-stream"],"question_text":"This code works (taken in the Javadoc):\n`List<Integer> numbers = Arrays.asList(1, 2, 3, 4);\nString commaSeparatedNumbers = numbers.stream()\n .map(i -> i.toStri...
{"title":"How to create a self signed certificate with the private key inside in a file in one simple step?","tags":["security","certificate"],"question_text":"I'd like to generate a certificate for development purposes, but I don't want to install the certificate in the store.\n`makecert`\nwith the switch\n`-pe`\ndoes...
{"title":"Probability in Java","tags":["java","implementation","probability"],"question_text":"I was curious to know, how do I implement probability in Java? For example, if the chances of a variable showing is 1\/25, then how would I implement that? Or any other probability? Please point me in the general direction.",...
{"title":"What is the best way to check IQueryable result set is null","tags":["c#","asp.net","linq"],"question_text":"I just want to know what is the best way to check if an\n`IQueryable`\nresult has no values.\neg. if we have a method like\n`public static IQueryable<Table> DisplayAll()\n{\n var db = new DataContext()...
{"title":"Dockerfile copy keep subdirectory structure","tags":["copy","docker","dockerfile"],"question_text":"I'm trying to copy a number of files and folders to a docker image build from my localhost.\nThe files are like this:\n`folder1\n file1\n file2\nfolder2\n file1\n file2`\nI'm trying to make the copy like this:\...
{"title":"Add custom headers to WebView resource requests - android","tags":["java","android","webkit","android-webview"],"question_text":"I need to add custom headers to EVERY request coming from the WebView. I know\n`loadURL`\nhas the parameter for\n`extraHeaders`\n, but those are only applied to the initial request....
{"title":"Is there a SELECT ... INTO OUTFILE equivalent in SQL Server Management Studio?","tags":["sql","sql-server","sql-server-2008"],"question_text":"MySQL had a nifty command\n`SELECT ... INTO OUTFILE`\nthat could write the result set into a file (CSV format or some other optional format).\nI am currently using SQL...
{"title":"Zero an array in C code","tags":["c","arrays"],"question_text":"Possible Duplicates:\nHow to initialize an array to something in C without a loop?\nHow to initialize an array in C\nHow can I zero a known size of an array without using a for or any other loop ?\nFor example:\n`arr[20] = 0,0,0,0,0,0,0,0,0,0,0,0...
{"title":"Is it possible to set an animated gif file as live wallpaper in android?","tags":["android"],"question_text":"I'm new to Android platform. I wish to develop a\nlive wallpaper\napplication. When i was searched regarding this in search Engine's, many of them created a live wallpaper as their\ncode (using\n`Surf...
{"title":"How to write Javadoc of properties?","tags":["java","javadoc"],"question_text":"I often find myself with a dilemma when writing javadoc for properties\/members of a \"simple\" POJO class holding only properties and getters and setters (DTO-style)....\n1) Write javadoc for the property\nor...\n2) Write javadoc...
{"title":"Secret copy to clipboard JavaScript function in Chrome and Firefox?","tags":["javascript","firefox","google-chrome","copy","clipboard"],"question_text":"Update\nLooks like\nbrowsers are starting to support copy natively in JS\nIn the console windows of both Chrome and Firefox on Mac I can execute\n`copy(\"par...
{"title":"JavaScript - How to set selectedIndex of select element using display text?","tags":["javascript","selectedindex"],"question_text":"How to set selectedIndex of select element using display text as reference?\nExample:\n`<input id=\"AnimalToFind\" type=\"text\" \/>\n<select id=\"Animals\">\n <option value=\"0\...
{"title":"python generator \"send\" function purpose?","tags":["python"],"question_text":"Can someone give me an example of why the \"send\" function associated with Python generator function exists? I fully understand the yield function. However, the send function is confusing to me. The documentation on this method i...
{"title":"Thymeleaf - Best practice for checking for NULL when formating (ie. dates)","tags":["thymeleaf"],"question_text":"I'm new to thymeleaf and I have the following template code to format a date. There are times when that date will be null in the returned object. What is the best way to check for null in thymelea...
{"title":"Getting first day of the week in MySql using Week No","tags":["mysql","sql"],"question_text":"How do I get the first day of a given week whose week number is available?\nFor example as I write this post we are at\nWEEK 29\n.I would like to write a MySQL query that will return\nSunday 18 July\nusing this\nWEEK...
{"title":"Dropping and recreating databases in Microsoft SQL Server","tags":["sql-server","sql-server-2008"],"question_text":"I am experimenting and learning with Microsoft SQL Server 2008 R2 SP1.\nI have a database where I made many experiments. Now I would like to drop and recreate it.\nSo I extract the creation scri...
{"title":"How to include BIT type column in SELECT part with out including it on the GROUP BY in T-SQL?","tags":["sql","tsql","group-by","aggregate"],"question_text":"Here is my T-SQL query\n`SELECT \n ProductID,\n VendorID,\n ProductName= MAX(ProductName),\n VendorName = MAX(VendorName),\n IsActive = MAX(IsActive) # T...
{"title":"Why is \"defau4t\" legal in a switch statement?","tags":["c++","c","switch-statement","default"],"question_text":"I came up with this program in some other site and thought of trying it, here's the program:\n`#include <stdio.h>\nint main()\n{\n int a=10;\n switch(a)\n {\n case '1': printf(\"one\");\n break;\n...
{"title":"Can modules have properties the same way that objects can?","tags":["python","properties","python-module"],"question_text":"With python properties, I can make it such that\n`obj.y`\ncalls a function rather than just returning a value.\nIs there a way to do this with modules? I have a case where I want\n`modul...
{"title":"How to put my javascript in the footer","tags":["javascript","wordpress","plugins"],"question_text":"I just want to ask on how to print script 'javascript' at the footer using simple plugin. I'm using WordPress 3.0 any ideas?","answer_text":"Use a functions.php file inside your theme template add this :\n`<?p...
{"title":"Chained IF structure","tags":["c#","java"],"question_text":"Imagine this case where I have an object that I need to check a property.\nHowever, the object can currently have a null value.\nHow can I check these two conditions in a single \"if\" condition?\nCurrently, I have to do something like this:\n`if (my...
{"title":"Add item to array in VBScript","tags":["arrays","vbscript"],"question_text":"How do you add an item to an existing array in VBScript?\nIs there a VBScript equivalent to the push function in Javascript?\ni.e.\nmyArray has three items, \"Apples\", \"Oranges\", and \"Bananas\" and I want to add \"Watermelons\" t...
{"title":"iphone - reading from Localizable.strings file as a key-value in a dictionary","tags":["iphone","file","text","localizable.strings"],"question_text":"I want to read the text from the localizable.strings file. I am collecting the strings for translation from several directories and file in one .strings file. B...
{"title":"Practical example for each type of database (real cases)","tags":["database","nosql","relational-database"],"question_text":"There are several types of database for different purposes, however normally MySQL is used to everything, because is the most well know Database. Just to give an example in my company a...
{"title":"Android, How to read QR code in my application?","tags":["android","android-intent","qr-code","implicit"],"question_text":"In my application I need to read Qr code. I searched the net and found Zing codes however lots of developers had problem with using it and it seems it is buggy!\nIf i assume that my custo...