text
stringlengths
74
309k
{"title":"Update timestamp when row is updated in PostgreSQL","tags":["postgresql","timestamp"],"question_text":"In MySQL, we can execute this where it updates the column\n`changetimestamp`\nevery time the row is changed:\n`create table ab (\n id int, \n changetimestamp timestamp \n NOT NULL \n default CURRENT_TIMESTAM...
{"title":"Does performance differs between Python or C++ coding of OpenCV?","tags":["c++","python","performance","opencv"],"question_text":"I aim to start opencv little by little but first I need to decide which API of OpenCV is more useful. I predict that Python implementation is shorter but running time will be more ...
{"title":"Dictionary enumeration in C#","tags":["c#",".net","dictionary","enumeration"],"question_text":"How do I enumerate a dictionary?\nSuppose I use\n`foreach()`\nfor dictionay enumeration. I can't update a key\/value pair inside\n`foreach()`\n. So I want some other method.","answer_text":"To enumerate a dictionary...
{"title":"How to add class to an image_tag rails helper","tags":["ruby-on-rails","image","helper","lccs"],"question_text":"I have the following code:\n`<%= image_tag iterator.image.url(:small), :class => \"img_preview\" %>`\nBut the rendered HTML shows:\n`<img src=\"\/actives\/hotels\/13\/small\/clean_wave.jpg?13176754...
{"title":"How to wipe Heroku Redis?","tags":["heroku","redis"],"question_text":"I have some information stored in my RedisToGo instance in Heroku and I want to wipe it so the Redis store is clean. Any idea how to do this?","answer_text":"You can do this with\nredis-cli\n.\nRedisToGo gives you a url in the form:\n`redis...
{"title":"zip lists in python","tags":["python","python-2.7"],"question_text":"I am a python newbie and I am trying to learn how to \"zip\" lists. To this end, I have a program, where at a particular point, I do the following:\n`x1, x2, x3 = stuff.calculations(withdataa)`\nThis gives me three lists,\n`x1`\n,\n`x2`\n, a...
{"title":"what does android getIntrinsicHeight and getIntrinsicWidth mean?","tags":["android","drawable"],"question_text":"Hi I am confused by the two methods from Android Drawable class\n`getIntrinsicHeight()\ngetIntrinsicWidth()`\napi definition says\nhttp:\/\/developer.android.com\/reference\/android\/graphics\/draw...
{"title":"How can I correctly format currency using jquery?","tags":["jquery","currency","formatter"],"question_text":"I do not need a mask, but I need something that will format currency(in all browsers) and not allow for any letters or special char's to be typed. Thanks for the help\nExample:\nValid: $50.00\n$1,000.5...
{"title":"Can I have H2 autocreate a schema in an in-memory database?","tags":["java","sql","database","h2"],"question_text":"(I've already seen the\nH2 database In memory - Init schema via Spring\/Hibernate\nquestion; it is not applicable here.)\nI'd like to know if there's a setting in H2 that will allow me to auto-c...
{"title":"CakePHP 3.0 installation: intl extension missing from system","tags":["cakephp","composer-php","cakephp-3.0"],"question_text":"Using the CakePHP docs, I am trying to install 3.0-beta2 using composer but I got this error:\n`cakephp\/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is m...
{"title":"Get installed applications in a system","tags":["c#",".net","installer","installation"],"question_text":"How to get the applications installed in the system using c# code?","answer_text":"Iterating through the registry key \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\" seems to give a comprehensi...
{"title":"\"text-align: justify;\" inline-block elements properly?","tags":["css","text-align","justify"],"question_text":"A few other questions have already addressed how best to apply\n`text-align: justify`\nto get inline-block elements to spread out evenly\u00e2\u0080\u00a6 for example,\nHow do I *really* justify a ...
{"title":"Ubuntu - change tmux 1.8 to tmux-next 1.9","tags":["tmux"],"question_text":"After I tried install few plugins for tmux I found that my tmux version is 1.8.\nFollowing steps from this answer I install tmux 2.1:\nUgrade tmux from 1.8 to 1.9 on Ubuntu 14.04\n(I didn't found tmux=1.9a-1~ppa1~t and instead install...
{"title":"Check if current directory is a Git repository","tags":["git","zsh"],"question_text":"I am writing a series of scripts for Git management in zsh.\nHow do I check if the current directory is a Git repository? (When I'm not in a Git repo, I don't want to execute a bunch of commands and get a bunch of\n`fatal: N...
{"title":"Converting bytes to megabytes","tags":["math","memory","terminology","units-of-measurement"],"question_text":"I've seen three ways of doing conversion from bytes to megabytes:\nmegabytes=bytes\/1000000\nmegabytes=bytes\/1024\/1024\nmegabytes=bytes\/1024\/1000\nOk, I think #3 is totally wrong but I have seen i...
{"title":"varchar Migration question for Ruby on Rails","tags":["ruby-on-rails","activerecord","migration","rails-migrations"],"question_text":"I have created a new table including a column \"note\". The default is varchar(255) I believe but I wish to have this column be a text area vs. a field and to allow more data. ...
{"title":"Apple Mach-O Linker Errors (20) - Undefined symbols for architecture armv7","tags":["iphone","ios","xcode","architecture","arm7"],"question_text":"I received these errors after I added \" -all_load \" in the \"Other Linker Flags\" build setting once I added \"libPusher-combined.a\" and its header files. I fol...
{"title":"jQuery: Uncheck other checkbox on one checked","tags":["jquery","checkbox"],"question_text":"I am having total 6 checkbox ( may be add more in future ) and I want to allow only select one so when user checked any of them other should unchecked.\nI tried with this code and works fine if I defined ID but now ju...
{"title":"URL to compose a message in Gmail (with full Gmail interface and specified to, bcc, subject, etc.)","tags":["gmail","hyperlink","google-apps","compose"],"question_text":"I found a\npost\nthat provides an example for a link which opens just a compose message window. However, I would like it to open a window wi...
{"title":"Why do we have map, fmap and liftM?","tags":["list","haskell","monads","redundancy","functor"],"question_text":"`map :: (a -> b) -> [a] -> [b]\nfmap :: Functor f => (a -> b) -> f a -> f b\nliftM :: Monad m => (a -> b) -> m a -> m b`\nWhy do we have three different functions that do essentially the same thing?...
{"title":"Learning Web Development : Django vs Node vs Rails vs Others","tags":["java","ruby-on-rails","django","node.js"],"question_text":"I know Java and Python(with some Django) and little bit of Ruby(no Rails) and no Node.js and probably there are more that I am not aware of.\nI am planing to start learning web dev...
{"title":"Set visibility of progress bar gone on completion of image loading using Glide library","tags":["android","imageview","android-glide"],"question_text":"Hi I want to have a progress bar for image which will shown while image loading but when image loading will be completed I want to set it to gone. Earlier I w...
{"title":"Post build event execute powershell","tags":["c#","powershell","msbuild"],"question_text":"Is it possible to set up a .net project with a post build event to execute a powershell script? I am using this script to generate some files. Also can I pass whether it's a debug or release build to script. An example ...
{"title":"How to set Spinner Default by its Value instead of Postion?","tags":["android","spinner","simplecursoradapter","android-spinner"],"question_text":"I have 1-50 records in the database. I am fetching those data using cursor and set those values to Spinner using Simple Cursor Adapter. Now what i need is i want t...
{"title":"How to require login for django generic views?","tags":["python","django"],"question_text":"I want to restrict access to urls serves by django generic views. For my views i know that login_required decorator does the job. Also Create\/update\/delete generic views takes login_requied argument but I couldn't fi...
{"title":"Android: how to hide ActionBar on certain activities","tags":["java","android","android-actionbar"],"question_text":"I've developed a simple demo application with a splash screen a map and some regular screens.\nI have an action bar at the top that contains a logo. It all looks fine on my phone (Galaxy s1 I90...
{"title":"No == operator found while comparing structs in C++","tags":["c++","struct","comparison-operators"],"question_text":"Comparing two instances of the following struct, I receive an error:\n`struct MyStruct1 {\n Position(const MyStruct2 &_my_struct_2, const int _an_int = -1) :\n my_struct_2(_my_struct_2),\n an_i...
{"title":"How do remove the border around a core-plot graph","tags":["iphone","core-plot"],"question_text":"I am trying to remove the border around a core plot graph on the iPhone - but seem to be struggling on what should be simple in my mind.\nPointers please!","answer_text":"You should be able to nil out the borderL...
{"title":"Symfony2: get list of all routes of a controller","tags":["symfony2","controller","indexing","routes"],"question_text":"I have a controller which implements all routes\/urls that are used for showing the help-pages.\nThe routes are defined by annotiations.\nI had the idea to offer a generic index over all hel...
{"title":"How to disable the collapsing of an ExpandableListView?","tags":["android","expandablelistview"],"question_text":"I would like to implement a\n`ExpandableListView`\nwhich should be expandable only after all the values have been set up within the adapter. Also I would like to be able to disable the collapsing ...
{"title":"What are the differences between GPL v2 and GPL v3 licenses?","tags":["licensing"],"question_text":"In simple terms, what are the reasons for, and what are the differences between the GPL v2 and GPL v3 open source licenses? Explanations and references to legal terms and further descriptions would be appreciat...
{"title":"In Scala, what exactly does 'val a: A = _' (underscore) mean?","tags":["scala","initialization"],"question_text":"What exactly does\n`val a: A = _`\ninitialize a value to? Is this a typed null? Thanks.","answer_text":"`val a: A = _`\nis a compile error. For example:\n`scala> val a: String = _\n<console>:1: er...
{"title":"Delete all entries in a Redis list","tags":["redis"],"question_text":"Suppose you have a LIST datatype in Redis. How do you delete all its entries? I've tried this already:\n`LTRIM key 0 0\nLTRIM key -1 0`\nBoth of those leave the first element. This will leave all the elements:\n`LTRIM key 0 -1`\nI don't see...
{"title":"How can I add items to a spinner in Android?","tags":["android","spinner"],"question_text":"How can I add items to a spinner?","answer_text":"XML file:\n`<Spinner android:id=\"@+id\/Spinner01\"\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\" \/>`\nJava file:\n`public class Spinn...
{"title":"Access denied for user 'root'@'localhost' with PHPMyAdmin","tags":["php","mysql","phpmyadmin","wampserver"],"question_text":"When I set the root password in PHPMyAdmin, I get this error:\n`#1045 - Access denied for user 'root'@'localhost' (using password: NO)`\nI can't open the PHPMyAdmin panel. What am I doi...
{"title":"change xcrun developer path for Android Studio","tags":["android","git","osx-elcapitan"],"question_text":"I'm using\nGIT\nand am trying to push my code and getting the following error when using the\nTerminal\n. I don't use\nXCode\n, Im using\nAndroid Studio\n.\nThe command I tried using was:\ngit branch Netw...
{"title":"Android: Mediaplayer: How to use SurfaceView or mediaplayer to play video in correct size","tags":["android","media-player"],"question_text":"I am playing local video file using MediaPlayer and SurfaceView. SurfaceView is the only control in activity, while my video files are QVGA or other. Problem is that vi...
{"title":"Auto-layout: What creates constraints named UIView-Encapsulated-Layout-Width & Height?","tags":["ios","autolayout"],"question_text":"My layout constraints are fine in Interface Builder but an exception occurs at runtime thanks to some part of the framework applying fixed height and width constraints that I re...
{"title":"Converting an empty string into nil in Ruby","tags":["ruby","boolean","string"],"question_text":"I have a string called\n`word`\nand a function called\n`infinitive`\nsuch that\n`word.infinitive`\nwould return another string on some occasions and an empty string otherwise\nI am trying to find an elegant ruby o...
{"title":"Deleting a badly named git branch","tags":["git","git-branch"],"question_text":"I know this isn't strictly a programming question, but it is related to git. I accidentally have created a branch in git called\n`--track`\n(I got the order of options wrong when merging a remote branch)\nThe regular command doesn...
{"title":"Is it possible in SASS to inherit from a class in another file?","tags":["css","inheritance","stylesheet","sass"],"question_text":"The question pretty much says it all.\nFor instance, if I were using, say,\nTwitter Bootstrap\n, could I define classes in my own SASS stylesheet that inherit from Bootstrap's CSS...
{"title":"C# Clear Session","tags":["c#",".net","asp.net","session","page-lifecycle"],"question_text":"Question #1\nI want to know when am I supposed to use:\nSession.Abandon()\n\/\/ When I use this during tracing and after calling it- I find the session still has a value.\nAnd when am I supposed to use :\nSession.Clea...
{"title":"Schema for a multilanguage database","tags":["database-design","localization","multilingual"],"question_text":"I'm developing a multilanguage software. As far as the application code goes, localizability is not an issue. We can use language specific resources and have all kinds of tools that work well with th...
{"title":"Spring MVC - Checking if User is already logged in via Spring Security?","tags":["java","spring","security","spring-mvc","spring-security"],"question_text":"I have a Spring MVC application.\nIt uses its own custom Login page\n. Upon successful login, a 'LOGGED_IN_USER' object is placed in the HTTPSession.\nI ...
{"title":"Do you use the get\/set pattern (in Python)?","tags":["python","getter-setter"],"question_text":"Using get\/set seems to be a common practice in Java (for various reasons), but I hardly see Python code that uses this.\nWhy do you use or avoid get\/set methods in Python?","answer_text":"In python, you can just...
{"title":"jquery flot pie slice color","tags":["jquery","flot"],"question_text":"I can't figure out how to get flot.pie to change the pie slice color, just the series color. Is this possible?","answer_text":"You need to specify the color as part of the data array.\nSo instead of\n`[1, 2, 3]`\nyou do\n`[\n {data: 1, col...
{"title":"Check for multiple items in array using .include? -- Ruby Beginner","tags":["ruby-on-rails","ruby"],"question_text":"Is there a better way to write this:\n`if myarray.include? 'val1' ||\n myarray.include? 'val2' ||\n myarray.include? 'val3' ||\n myarray.include? 'val4'`","answer_text":"Using set intersections...
{"title":"404 error for Google Tag Manager","tags":["get","google-tag-manager"],"question_text":"Google Tag Manager told me to put this underneath the opening\n`body`\ntag.\n`<!-- Google Tag Manager -->\n<noscript><iframe src=\"\/\/www.googletagmanager.com\/ns.html?id=GTM-PLF4CZ\"\nheight=\"0\" width=\"0\" style=\"disp...
{"title":"Why we can't do List<Parent> mylist = ArrayList<child>();","tags":["java","generics","inheritance","collections"],"question_text":"Why we can't do\n`List<Parent> mylist = ArrayList<child>();`","answer_text":"Suppose we could. Then this program would have to be fine:\n`ArrayList<Banana> bananas = new ArrayList...
{"title":"Make MSDeploy (Visual Studio) not delete App_Data folder but delete everything else","tags":["asp.net","iis","deployment","msdeploy"],"question_text":"I'm using Visual Studio's\n`Publish`\nbutton to deploy my website, and want a different App_Data folder on the server. There's a checkbox for\n`Leave extra fil...
{"title":"How to configure NDK with Android Gradle plugin 0.7","tags":["android-ndk","android-studio","android-gradle"],"question_text":"The new Android gradle plugin (0.7) seems to include new support for the NDK, but in the documentation there is little to no mention of it (the only reference I found is a test called...
{"title":"Is it possible to roll back CREATE TABLE and ALTER TABLE statements in major SQL databases?","tags":["sql","transactions","ddl","create-table"],"question_text":"I am working on a program that issues DDL. I would like to know whether\n`CREATE TABLE`\nand similar DDL can be rolled back in\nPostgres\nMySQL\nSQLi...
{"title":"Inheritance and recursion","tags":["java","inheritance","recursion"],"question_text":"Suppose we have the following classes:\n`class A {\n void recursive(int i) {\n System.out.println(\"A.recursive(\" + i + \")\");\n if (i > 0) {\n recursive(i - 1);\n }\n }\n}\nclass B extends A {\n void recursive(int i) {\n ...
{"title":"Common elements in two lists","tags":["java","arraylist","elements"],"question_text":"I have two arrayLists with 3 integer. I want to find a way to return the common elements of the two lists. Has anynody idea, how can I achieve this?","answer_text":"Use\n`Collection#retainAll()`\n.\n`listA.retainAll(listB);\...
{"title":"Set div to remaining height using CSS with unknown height divs above and below","tags":["html","css","height","scrollable"],"question_text":"Is it possible to make the wrapper fill the window height (no scrolling) and the center div scrollable without messing around with pixels and javascript?\n`<div id=\"wra...
{"title":"OWIN: unauthorised webapi call returning login page rather than 401","tags":["c#","asp.net-web-api","asp.net-mvc-5","asp.net-identity","owin"],"question_text":"How do I configure my mvc\/webapi project so that a webapi method called from a razor view doesn't return the loginpage when its unauthorised?\nIts a ...
{"title":"Capistrano deploy ** Host key verification failed","tags":["ruby-on-rails","capistrano"],"question_text":"I've followed several suggestions from other sites but to no avail. When I try\n`cap deploy:cold`\nI consistently get \"Host key verification failed.\"\nI've tried everything. I've ssh'd from my computer ...
{"title":"URI::InvalidURIError (bad URI(is not URI?): ):","tags":["ruby-on-rails-3","oauth"],"question_text":"I am trying to implement an OAuth provider in rails 3. When I try to authorize a client app I get this error. I am using the restful auth plugin and pelles oauth-plugin. When I was testing via the rails console...
{"title":"\"Variable\" variables in Javascript?","tags":["javascript","variables","variable-variables"],"question_text":"I know it's possible in PHP to have \"variable\" variables. For example\n`$x = \"variable\";\n$$x = \"hello, world!\";\necho $variable; \/\/ displays \"hello, world!\"`\nIs this possible in javascrip...
{"title":"How to change the Font size in UIPickerView?","tags":["iphone","uipickerview","font-size"],"question_text":"I have one UIPickerView. This is having nearly 200 items, each items has long texts, so, i want to resize the UIPickerView's font size. How can i change it? It is possible?\nCan any one help me? Thanks ...
{"title":"How to profile memory usage & performance with Instruments?","tags":["xcode","performance","profiling","instruments","allocation"],"question_text":"Of all the Instruments Trace Templates, I love using:\nZombies to detect where an object is getting over-released, great for debugging\n`EXEC_BAD_ACCESS`\nerrors....
{"title":"How to alias a table in Laravel Eloquent queries (or using Query Builder)?","tags":["php","laravel","laravel-4","eloquent"],"question_text":"Lets say we are using Laravel's query builder:\n`$users = DB::table('really_long_table_name')\n ->select('really_long_table_name.id')\n ->get();`\nI'm looking for an equ...
{"title":"undefined method `stringify_keys'","tags":["ruby-on-rails-3","file-upload","paperclip"],"question_text":"When I try to upload image using Paperclip gem I got this error:\nNoMethodError (undefined method `stringify_keys' for <ActionDispatch::Http::UploadedFile:0x000000025387f0>)\n`class MenuItem < ActiveRecord...
{"title":"Accessing a class constant using a simple variable which contains the name of the constant","tags":["php","class","variables","constants"],"question_text":"I'm trying to access a class constant in one of my classes:\n`const MY_CONST = \"value\";`\nIf I have a variable which holds the name of this constant lik...
{"title":"Plugin throwing TypeError after Wordpress 4.5 update","tags":["javascript","jquery","html","wordpress","wordpress-plugin"],"question_text":"I'm debugging a visual composer plugin that broke after I updated Wordpress to 4.5 and I can't figure out why it is throwing a TypeError.\nThe error message in the consol...
{"title":"How to add custom image in navigation bar button item?","tags":["objective-c","xcode","ios4","iphone"],"question_text":"`UIBarButtonItem *doneitem=[[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donePressed:)]autorelease];\n self.navigationItem.right...
{"title":"How to merge multiple assemblies into one?","tags":["c#","assemblies","exe","ilmerge","servicestack"],"question_text":"I consuming my service stack using EXE project (startup task for azure application) in that I have copied following service stack's DLL & some Azure's DLLs in to EXE project.\nWhen I build th...
{"title":"#include in .h or .c \/ .cpp?","tags":["c++","c"],"question_text":"When coding in either C or C++, where should I have the\n`#include`\n's?\ncallback.h:\n`#ifndef _CALLBACK_H_\n#define _CALLBACK_H_\n#include <sndfile.h>\n#include \"main.h\"\nvoid on_button_apply_clicked(GtkButton* button, struct user_data_s* ...
{"title":"Getting the \"diff\" between two arrays in C#?","tags":["c#","arrays"],"question_text":"Let's say I have these two arrays:\n`var array1 = new[] {\"A\", \"B\", \"C\"};\nvar array2 = new[] {\"A\", \"C\", \"D\"};`\nI would like to get the differences between the two. I know I could write this in just a few lines...
{"title":"Your favorite Visual Basic 6.0 tools and tips","tags":["vb6"],"question_text":"This is somewhat related to a similar\npost\n, but that post was Visual Studio 6 in general and a lot of the suggestions didn't apply to Visual Basic 6.0.\nSuggest or vote for tools\/tips. Please one tool\/tip per post so that ever...
{"title":"How are firstprivate and lastprivate different than private clauses in OpenMP?","tags":["openmp"],"question_text":"I've looked at the official definitions, but I'm still quite confused.\n`firstprivate`\n: Specifies that each thread should have its own instance of a variable, and that the variable should be in...
{"title":"Set Imageview to show image in sdcard?","tags":["android","android-layout","android-imageview","android-image"],"question_text":"I have a image stored in SD card of my phone. I want to show it in a image view. I know the location of the file. On the oncreate of the activity is there a simple way to say someth...
{"title":"What is a good desktop programming language to learn for a web developer?","tags":["c#","c++","c","programming-languages"],"question_text":"I'm want to learn a desktop programming language, preferably C, C++ or C#. I'm a PHP\/HTML\/CSS programmer and I would like to get into desktop applications. I need somet...
{"title":"How do I check if the request is made via AJAX in CodeIgniter?","tags":["php","ajax","codeigniter"],"question_text":"How do I check if the request is an AJAX? I am using CodeIgniter. I have a link that when it clicked, it'll open the pop-up dialog window this is done through ajax it requests to a controller n...
{"title":"How to make layout with View fill the remaining space?","tags":["android","layout","android-layout"],"question_text":"I'm designing my application UI. I need a layout looks like this:\n(< and > are Buttons). The problem is, I don't know how to make sure the TextView will fill the remaining space, with two but...
{"title":"How to make Rails 3.1 use SASS (Over SCSS) as the default?","tags":["ruby-on-rails","ruby","sass","ruby-on-rails-3.1"],"question_text":"Having a hard time figuring out how to make SASS, not SCSS, as the default for stylesheets.\nI've tried making a\n`sass_config.rb`\nfile with this:\n`Sass::Plugin.options[:sy...
{"title":"How do I iterate through a string in Python?","tags":["python"],"question_text":"As an example, lets say I wanted to list the frequency of each letter of the alphabet in a string. What would be the easiest way to do it?\nThis is an example of what I'm thinking of... the question is how to make allTheLetters e...
{"title":"How to list all tags pointing to a specific commit in git","tags":["git","tags"],"question_text":"I have seen the commands\n`git describe`\nand\n`git-name-rev`\nbut I have not managed to get them to list more than one tag.\nExample: I have the sha1 48eb354 and I know the tags A and B point to it. So I want a ...
{"title":"jQuery Button.click() event is triggered twice","tags":["jquery","function","button","click"],"question_text":"I have the following problem with this code:\n`<button id=\"delete\">Remove items<\/button>\n$(\"#delete\").button({\n icons: {\n primary: 'ui-icon-trash'\n }\n}).click(function() {\n alert(\"Clicked...
{"title":"bool operator ++ and --","tags":["c++","boolean","history"],"question_text":"Today while writing some Visual C++ code I have come across something which has surprised me. It seems C++ supports ++ (increment) for bool, but not -- (decrement). It this just a random decision, or there is some reason behind this?...
{"title":"Devise for Twitter, Cookie Overflow error?","tags":["ruby-on-rails","twitter","devise"],"question_text":"I am trying to integrate twitter into devise using this\nguide\n. I basically take all occurence of facebook and substitue it with twitter. However, when I sign in with twitter, I am getting the following ...
{"title":"jQuery disable scroll when mouse over an absolute div","tags":["jquery","scroll","mouseover"],"question_text":"I'm trying to disable the window mouse scroll functionality when the mouse is hovering over the div - so that only div scrolling is enabled - and when mouse moves away from the div - scrolling to the...
{"title":"OAuth's tokens and sessions in REST","tags":["session","rest","oauth","stateless"],"question_text":"The other minute I read an article on OAuth. It described especially the tokens being exchanged between client and service provider during a series of requests.\nThe article also mentioned that OAuth gains sign...
{"title":"Navigation Drawer Below Toolbar","tags":["android","navigation-drawer","android-toolbar"],"question_text":"I am trying to get the navigation drawer to open below the toolbar.\n`<android.support.v4.widget.DrawerLayout\nxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\nxmlns:tools=\"http:\/\/sc...
{"title":"How to use parameters with HttpPost","tags":["java","android","json","web-services","http-post"],"question_text":"I am using a RESTfull webservice with this methode:\n`@POST\n@Consumes({\"application\/json\"})\n@Path(\"create\/\")\npublic void create(String str1, String str2){\nSystem.out.println(\"value 1 = ...
{"title":"UICollectionView assertion error on stale data","tags":["uicollectionview","ios7"],"question_text":"In the course of trying to unload one batch of images from my collection view and then replace them with another batch, I run into an error where, depending on whether the original or subsequent group of images...
{"title":"How do I delete all data in a Cassandra column family?","tags":["cassandra"],"question_text":"I'm looking for a way to delete all of the rows from a given column family in cassandra.\nThis is the equivalent of\n`TRUNCATE TABLE`\nin SQL.","answer_text":"You can use the\n`truncate`\nthrift call, or the\n`TRUNCA...
{"title":"Do uninitialized primitive instance variables use memory?","tags":["java","memory-management","initialization","primitive"],"question_text":"In Java, does it cost memory to declare a class level instance variable without initializing it?\nFor example: Does\n`int i;`\nuse any memory if I don't initialize it wi...
{"title":"SQL Server: SELECT only the rows with MAX(DATE)","tags":["sql-server"],"question_text":"I have a table of data (the db is MSSQL):\n`ID OrderNO PartCode Quantity DateEntered\n 417 2144 44917 100 18-08-11\n 418 7235 11762 5 18-08-11\n 419 9999 60657 100 18-08-11\n 420 9999 60657 90 19-08-11`\nI would like to ma...
{"title":"How to perform a for each file loop by using find in shell\/bash?","tags":["linux","bash","shell"],"question_text":"How to\n`ls -l`\neach\n`.txt`\nfile in bash\/shell?\n`for line in $(find . -iname '*.txt'); do \n echo $line\n ls -l $line; \ndone`","answer_text":"Here is a better way to loop over files as it ...
{"title":"Eclipse Google Plug-In doesn't start server for web application","tags":["java","eclipse","google-app-engine"],"question_text":"I want to try the Google Eclipse plug-in for the Google App Engine, but I get stuck in the tutorial...\nI want to start the web application from the Google tutorial, but when I click...
{"title":"Ampersand (&) character inside a value of jQuery AJAX request data option","tags":["jquery"],"question_text":"I am performing asynchronous HTTP (Ajax) requests via jQuery with the basic $.ajax(). The code looks like the following:\n`$(\"textarea\").blur(function(){\n var thisId = $(this).attr(\"id\");\n var t...
{"title":"what does a php function return by default?","tags":["php","function","variables","language-design"],"question_text":"If I return nothing explicitly, what does a php function exactly return?\n`function foo() {}`\nWhat type is it?\nWhat value is it?\nHow do I test for it exactly with === ?\nDid this change fro...
{"title":"Permanently Set Postgresql Schema Path","tags":["sql","postgresql"],"question_text":"I need to set schema path in Postgres so that I don't every time specify schema dot table e.g.\n`schema2.table`\n. \nSet schema path:\n`SET SCHEMA PATH a,b,c`\nonly seems to work for one query session on mac, after I close qu...
{"title":"Too Few Arguments","tags":["ruby-on-rails","ruby-on-rails-3","ruby-on-rails-3.2","controllers"],"question_text":"I am trying to get some Javascript working in my Rails app.\nI want to have my index page allow me to edit individual items on the index page, and then reload the index page upon edit.\nMy index.ht...
{"title":"Just what is 'A big database'?","tags":["database"],"question_text":"Ok, dumb question I know but I see the nebulous comment 'a large database' as well as small and medium and I wonder just what that means. Can someone define what a small, medium and large database is for us SQL neophytes?","answer_text":"The...
{"title":"What is the best way to get the minimum or maximum value from an Array of numbers?","tags":["algorithm","actionscript-3","flex","actionscript","complexity-theory"],"question_text":"Let's say I have an Array of numbers:\n`[2,3,3,4,2,2,5,6,7,2]`\nWhat is the best way to find the minimum or maximum value in that...
{"title":"jQuery UI 1.10: dialog and zIndex option","tags":["javascript","jquery","html","css","jquery-ui"],"question_text":"I have to make an dialog to apear when an image onclick. The problem is that I have some realy big z-index there (500 for example) and the ui dialog is on the back of that elements.\nHere is the ...
{"title":"Java generics - get class?","tags":["java","generics"],"question_text":"I got a list, programmed like this:\n`public class MyList<T>`\n. Is there any way to use the T variable to get the name of class (so I can, from within\n`MyList`\n, know if T is String, Socket, etc.)?\nEDIT: Nevermind, found the answer\nh...
{"title":"How to introduce multi-column constraint with JPA annotations?","tags":["java","jpa","mapping"],"question_text":"I am trying to introduce a multi-key constraint on a JPA-mapped entity:\n`public class InventoryItem {\n @Id\n private Long id;\n @Version \n private Long version;\n @ManyToOne\n @JoinColumn(\"prod...