text
stringlengths
74
309k
{"title":"Nuget - Don't see allow nuget to download missing packages during build","tags":["visual-studio-2010","visual-studio","nuget"],"question_text":"I get a message saying the following:\nError 1 Package restore is disabled by default. To give consent, open\n the Visual Studio Options dialog, click on Package Mana...
{"title":"How do I activate word wrapping in text editor in Aptana Studio?","tags":["eclipse","word-wrap","aptana"],"question_text":"How do I activate line wrapping in text editor in Aptana Studio?\nI'm interested about wrapping in view mode (in order to not have to do horizontal scrolling).","answer_text":"Tried right...
{"title":"Populating a database in a Laravel migration file","tags":["php","laravel","migration","mysql-error-1146"],"question_text":"I'm just learning Laravel, and have a working migration file creating a users table. I am trying to populate a user record as part of the migration:\n`public function up()\n{\n Schema::c...
{"title":"How should I copy Strings in Java?","tags":["java"],"question_text":"`String s = \"hello\";\n String backup_of_s = s;\n s = \"bye\";`\nAt this point, the backup variable still contains the original value \"hello\" (this is because of String's immutability right?).\nBut is it really\nsafe\nto copy Strings with...
{"title":"Replace only first match using preg_replace","tags":["php","regex","preg-replace"],"question_text":"I have a string with structure similar to:\n`'aba aaa cba sbd dga gad aaa cbz'`\n. The string can be a bit different each time as it's from an external source.\nI would like to replace only first occurrence of\...
{"title":"(1,eval)('this') vs eval('this') in JavaScript?","tags":["javascript","eval"],"question_text":"I start to read\nJavaScript Pattern\n, some\ncodes\nconfused me.\n`var global = (function () {\n return this || (1, eval)('this');\n}());`\nHere are my questions:\nQ1:\n(1, eval) === eval?\nWhy it works? How?\nQ2: W...
{"title":"Oracle: What exactly do quotation marks around the table name do?","tags":["oracle"],"question_text":"I thought that the quotation mark (\") was simply a type of grouping marker but I'm debugging some NHibernate code and notice that while\n`SELECT * FROM site WHERE site_id = 3;`\nWorks fine\n`SELECT * FROM \"...
{"title":"Foreign Key to multiple tables","tags":["sql-server","relational-database"],"question_text":"I've got 3 relevant tables in my database.\n`CREATE TABLE dbo.Group\n(\n ID int NOT NULL,\n Name varchar(50) NOT NULL\n) \nCREATE TABLE dbo.User\n(\n ID int NOT NULL,\n Name varchar(50) NOT NULL\n)\nCREATE TABLE dbo.T...
{"title":"Android: How to find the position clicked from the context menu","tags":["android","android-emulator"],"question_text":"I have a list view filled with data. I set up a context menu for the listview using the following code:\n`list.setOnCreateContextMenuListener\n(\n new View.OnCreateContextMenuListener() \n {...
{"title":"Is there a Twig shorthand syntax for outputting conditional text","tags":["php","twig"],"question_text":"Is there a shorter syntax in Twig to output a conditional string of text?\n`<h1>{% if not info.id %}create{% else %}edit{% endif %}<\/h1>`\nTraditional php is even easier than this:\n`<h1><?php info['id']?...
{"title":"What are the actual differences between Scheme and Common Lisp? (Or any other two dialects of Lisp)","tags":["lisp","scheme","common-lisp","racket","sicp"],"question_text":"Note: I am not asking which to learn, which is better, or anything like that.\nI picked up the free version of SICP because I felt it wou...
{"title":"Relationship between catalog, schema, user, and database instance","tags":["mysql","sql-server","oracle","postgresql","db2"],"question_text":"To compare databases of different vendors (Oracle, SQL Server, DB2, MySQL, and PostgreSQL) how can I identify any object uniquely and do I need a catalog? For instance,...
{"title":"Creating a favicon","tags":["html","favicon"],"question_text":"How can I create a favicon for my website?","answer_text":"Searching about favicons, I discovered I needed more than 10 kinds of files to work in all browsers and devices :(\nI got pissed and created my own favicon generator, that creates all thes...
{"title":"NLog time formatting","tags":["nlog"],"question_text":"How do I write a layout for NLog that outputs time with milliseconds like this\n`11:32:08:123`\n?\nI use\n`${date:format=yyyy-MM-dd HH\\:mm\\:ss}`\nbut I need more time precision in my logs.","answer_text":"`${date:format=yyyy-MM-dd HH\\:mm\\:ss.fff}`\nAc...
{"title":"numpy replace negative values in array","tags":["python","numpy"],"question_text":"Can anyone advise a simple way of replacing all negative values in an array with 0?\nI'm having a complete block on how to do it using a numpy array\ne.g.\n`a = array([1, 2, 3, -4, 5])`\ni need to return\n`[1, 2, 3, 0, 5]`\n`a ...
{"title":"NSNull handling for NSManagedObject properties values","tags":["objective-c","json","parsing","nsmanagedobject","nsnull"],"question_text":"I'm setting values for properties of my\n`NSManagedObject`\n, these values are coming from a\n`NSDictionary`\nproperly serialized from a JSON file. My problem is, that, wh...
{"title":"Android activity image background size","tags":["android","image","background","size","screen"],"question_text":"I am a bit confused on creating an image which will be acting as a background for my activities. So, in short, my aim is that my application should be able to fit the different screen sizes. Theref...
{"title":"Guid == null should not be allowed by the compiler","tags":["c#",".net",".net-3.5","guid"],"question_text":"Possible Duplicate:\nC# okay with comparing value types to null\nThe behaviour described below is specific to .net-3.5 only\nHello,\nI just ran across the most astonishing behavior in the C# compiler;\n...
{"title":"Elegant way to pass multiple arguments to a function","tags":["c++","function","argument-passing"],"question_text":"I've got a function which looks like this:\n`bool generate_script (bool net, bool tv, bool phone,\n std::string clientsID,\n std::string password,\n int index, std::string number, \n std::string...
{"title":"How to get response as String using retrofit without using GSON or any other library in android","tags":["android","json","parsing","retrofit"],"question_text":"I am trying to get response from the following Api :\nhttps:\/\/api.github.com\/users\/username\nBut I don't know how to get response as\n`String`\ns...
{"title":"Grand Central Dispatch (GCD) vs. performSelector - need a better explanation","tags":["iphone","objective-c","multithreading","ios","grand-central-dispatch"],"question_text":"I've used both GCD and performSelectorOnMainThread:waitUntilDone in my apps, and tend to think of them as interchangeable--that is, per...
{"title":"xcode 6 beta 2 issue with exporting ipa \"Your account already has a valid iOS distribution certificate\"","tags":["ios","iphone","xcode6"],"question_text":"I'm having trouble exporting an app for Ad Hoc Distribution on Xcode 6 beta 2..\nWhen exporting my project for ad hoc development on xcode 6, I receive t...
{"title":"Is it possible to catch out of memory exception in java?","tags":["java","exception","out-of-memory"],"question_text":"I'm developing a program that would require huge amount of memory, and I want to catch when out-of-memory exception happens. I had heard this is not possible to do, but curious if there is an...
{"title":"What are the differences between LLVM and java bytecode?","tags":["java","comparison","jvm","llvm"],"question_text":"I dont understand the difference between LLVM and the java (bytecode), what are they?\n-edit- by 'what are they' i mean the differences between LLVM and java (bytecode) not what are LLVM and ja...
{"title":"Laravel 5 package development","tags":["php","laravel","laravel-5"],"question_text":"I am having trouble to create package in Laravel 5 as\n`workbench`\nhas been removed.\nAs in this thread (\nHow create package in Laravel 5?\n), Goldorak suggest that we have to create our own package structure ourselves.\nSo...
{"title":"How do I load an url in iframe with Jquery","tags":["jquery","iframe","load"],"question_text":"I want to load an iframe on click, this is what I have so far:\n`$(\"#frame\").click(function () { \n $('this').load(\"http:\/\/www.google.com\/\");\n });`\nIt doesn't work. This is the complete code:\nJS Bin","answ...
{"title":"PHP Implode But Wrap Each Element In Quotes","tags":["php","implode"],"question_text":"Assume I have an array:\n`$elements = array('foo', 'bar', 'tar', 'dar');`\nThen I want to build up a\n`DELETE IN`\nSQL query:\n`$SQL = \"DELETE FROM elements\n WHERE id IN ('\" . implode(',', $elements) . \"')\";`\nThe prob...
{"title":"Google Geocoding API - REQUEST_DENIED","tags":["google-app-engine","google-maps-api-3"],"question_text":"Apparently I do not need a 'Maps API key' to use the 'Google Geocoding API' according to:\nhttp:\/\/code.google.com\/apis\/maps\/documentation\/geocoding\/index.html\nHowever, I obtain this:\n`{\n \"status...
{"title":"What is the difference between \"++\" and \"+= 1 \" operators?","tags":["c++","loops","integer","auto-increment","increment"],"question_text":"In a loop in C++, I usually encounter situations to use\n`++`\nor\n`+=1`\n, but I can't tell their difference. For instance, if I have an integer\n`int num = 0;`\nand ...
{"title":"jQuery change method on input type=\"file\"","tags":["jquery","file-upload","input","event-handling","onchange"],"question_text":"I'm trying to embrace jQuery 100% with it's simple and elegant API but I've run into an inconsistency between the API and straight-up HTML that I can't quite figure out.\nI have an...
{"title":"How to use AutoMapper .ForMember?","tags":[".net","automapper"],"question_text":"I am trying to set up AutoMapper to convert from Entity to DTO. I know I'm supposed to be using\n`.ForMember()`\nafter\n`Mapper.CreateMap<Entity, DTO>()`\nto set up custom mappings, but this doesn't seem to be an available method...
{"title":"Printing hexadecimal characters in C","tags":["c","hex","printf"],"question_text":"I'm trying to read in a line of characters, then print out the hexadecimal equivalent of the characters.\nFor example, if I have a string that is\n`\"0xc0 0xc0 abc123\"`\n, where the first 2 characters are\n`c0`\nin hex and the...
{"title":"Easy_install and pip broke: pkg_resources.DistributionNotFound: distribute==0.6.36","tags":["python","pip","distribute"],"question_text":"I was tried to upgrade pip with\n`pip install --upgrade pip`\non OSX and pip and easy_install both dont work.\nWhen running pip\n`Traceback (most recent call last):\n File ...
{"title":"How to convert a datetime to string in T-SQL","tags":["sql-server","tsql"],"question_text":"I'm surprised not to be able to find this question here already.\nI have a date time var and I want to convert it to a string so that I can append it to another string. I want it in a format that can be converted easil...
{"title":"Connecting to Azure website via FTP","tags":["azure","ftp","azure-web-sites"],"question_text":"What login credentials do I use to connect to the FTP site that is listed on the dashboard of my Azure? I tried using the same credentials I use to log into Azure but this is failing. TIA.","answer_text":"In the\ncu...
{"title":"Can you assign multiple variables at once in PHP like you can with Java?","tags":["php","variables"],"question_text":"I want to create 5 variables of type array all at once. Is this possible? In Java I know you can, but can't find anything about PHP. I'd like to do something like this:\n`$var1, $var2, $var3, ...
{"title":"Why can't I inherit from int in C++?","tags":["c++","inheritance","integer","language-design","strong-typing"],"question_text":"I'd love to be able to do this:\n`class myInt : public int\n{\n};`\nWhy can't I?\nWhy would I want to? Stronger typing. For example, I could define two classes\n`intA`\nand\n`intB`\n...
{"title":"Can we have multiline comments in a java properties file?","tags":["java","properties","comments"],"question_text":"In a java\n`.properties`\nfile we can do single line comments with\n`#`\n.\nIs there any way by which we can do multi-line comments?","answer_text":"Unfortunately not! Java properties file only ...
{"title":"Turning off the WebFormViewEngine when using razor?","tags":["asp.net-mvc","configuration","webforms","razor"],"question_text":"I downloaded\nGlimpse\nthis morning to try it out and noticed this when I click on the views tab:\nIt checks all of the loaded view engines. I found where the\n`RazorViewEngine`\nis ...
{"title":"How to check if two words are anagrams","tags":["java","string","algorithm","anagram"],"question_text":"I have a program that shows you whether two words are anagrams of one another. There are a few examples that will not work properly and I would appreciate any help, although if it were not advanced that wou...
{"title":"NSString question - rangeOfString method","tags":["iphone","nsstring"],"question_text":"I am having an issue that I can't figure out.\nI'm trying to run the rangeOfString method on a string, and I'm not sure how to determine if the string was not found. For example:\n`NSRange range = [@\"abc\" rangeOfString:@...
{"title":"Convert Double to Int, rounded down","tags":["java","type-conversion","rounding"],"question_text":"How to convert a\n`double`\nvalue to\n`int`\ndoing the following:\n`Double If x = 4.97542. Convert to int x = 4.\nDouble If x = 4.23544. Convert to int x = 4.`\nThat is, the answer is always rounding down.","ans...
{"title":"How can I retrieve the UDID on iOS?","tags":["ios","cocoa-touch","udid"],"question_text":"I was wondering if it was possible to find out the UDID of the user's iPhone. Can someone shed some light?","answer_text":"Note:\nApple will no longer accept apps that access the UDID of a device starting May 1, 2013\n.\...
{"title":"MySQL String Last Index Of","tags":["mysql","string","indexof"],"question_text":"I am able to use\n`LOCATE`\nto get the index of a character such as a\n`.`\nin\n`www.google.com`\n. Thus I can use substring to strip out everything before the first\n`.`\n.\nIs there a way I can look for the\nlast\n`\/`\n?\nSo I...
{"title":"How do you merge in GIT on Windows?","tags":["java","windows","eclipse","git"],"question_text":"I tried to use GIT however for me the biggest problem with it is that there is no tool for merge'ing. At least the msysgit does not give me anything. How can I merge in GIT? Are there any great tools for it or do I...
{"title":"Why do I need vim in binary mode for 'noeol' to work?","tags":["vim","newline"],"question_text":"This question is a follow up to the\nWork Around\nI use for \"saving files in vim without having the newline at end of file forcibly added\" annoyance.\nBasically I can't use\n`set noeol`\nin my\n`.vimrc`\nbecause...
{"title":"How do you authenticate a server to Firebase?","tags":["node.js","firebase","server"],"question_text":"I have an app written on Firebase. Security rules and client side code aren't quite enough to make my app work. I need to connect a server to do a few tasks:\nCleaning up denormalized data that's challenging...
{"title":"MVVM Routed and Relay Command","tags":["mvvm","command","relaycommand","routedcommand"],"question_text":"What is the Difference between the\nRoutedCommand\nand\nRelayCommand\n?\n When to use RoutedCommand and when to use RelayCommand in MVVM pattern ?","answer_text":"RoutedCommand\nis part of WPF, while\nRela...
{"title":"define function within another function in javascript","tags":["javascript"],"question_text":"`function foo(a) {\n if (\/*some condition*\/) {\n \/\/ perform task 1\n \/\/ perform task 3\n }\n else {\n \/\/ perform task 2\n \/\/ perform task 3\n }\n}`\nI have a function whose structure is similar to the above...
{"title":"Publish website without roslyn","tags":["visual-studio","visual-studio-2015","roslyn"],"question_text":"I am trying to create web application using Visual Studio 2015 and .NET 4.5.1.\nWhen I publish the website, visual studio create folder named\n`roslyn`\n.\nI know it's used to compile code on the fly, but u...
{"title":"How to justify a single flexbox item (override justify-content)","tags":["css","flexbox"],"question_text":"You can override\n`align-items`\nwith\n`align-self`\nfor a flex item.\nI am looking for a way to override\n`justify-content`\nfor a flex item.\nIf you had a flexbox container with\n`justify-content:flex-...
{"title":"What is the key sequence for closing the current buffer in Emacs?","tags":["emacs"],"question_text":"If I click on File -> Close, it closes the buffer like I want, but doesn't list a key mapping. What is the key mapping?","answer_text":"You can use\n`C-x k`\nto kill current buffer. See\nEmacs Manual\n.","ques...
{"title":"Visual studio forgets window settings and makes a mess","tags":["windows","visual-studio","dock"],"question_text":"I have this problem where I open Visual Studio and the internal windows are scattered all over the place. None of them are docked; some that should be visible have become invisible and vice versa...
{"title":"Elastic search- search_analyzer vs index_analyzer","tags":["search","elasticsearch","analyzer"],"question_text":"I was looking at\nhttp:\/\/euphonious-intuition.com\/2012\/08\/more-complicated-mapping-in-elasticsearch\/\nwhich explains ElasticSearch analyzers.\nI did not understand the part about having diffe...
{"title":"Install Mono on Centos 5.5 using YUM","tags":["mono","install","centos"],"question_text":"How do I install the\nMono\n2.6.7 runtime on\nCentOS\n5.5 using\nYUM\n?\nI know how to build Mono from the source. However, according to the page\nGetting Started With Mono Tools\nit is possible to install the binaries d...
{"title":"Merge Cell values with PHPExcel - PHP","tags":["php","phpexcel"],"question_text":"I have a simple table like:\n`- id \n- first_name\n- last_name\n- email\n- phone`\nI'm using\nPHPExcel\nto export my data in XLS format\n`$rowNumber = 1;\n while ($row = mysql_fetch_row($result)) {\n $col = 'A';\n foreach($row a...
{"title":"URL for sending a user to the app review page on device's app store","tags":["iphone","ipad","app-store"],"question_text":"What's the URL to launch in order to bring the iTunes App Store to the front, and open it to show the Reviews page of an app?\nI want to send my users to the \"Write a Review\" page.\nSom...
{"title":"Garbage Collection in C++ -- why?","tags":["c++","garbage-collection","c++11"],"question_text":"I keep hearing people complaining that C++ doesn't have garbage collection. I also hear that the C++ Standards Committee is looking at adding it to the language. I'm afraid I just don't see the point to it... using...
{"title":"Principal component analysis in Python","tags":["python","numpy","scipy","pca"],"question_text":"I'd like to use principal component analysis (PCA) for dimensionality reduction. Does numpy or scipy already have it, or do I have to roll my own using\n`numpy.linalg.eigh`\n?\nI don't just want to use singular va...
{"title":"Does const-correctness give the compiler more room for optimization?","tags":["c++","c","pointers","const","const-correctness"],"question_text":"I know that it improves readability and makes the program less error-prone, but how much does it improve the performance?\nAnd on a side note, what's the major diffe...
{"title":"jQuery dynamic canvas creation, $ctx.getContext is not a function","tags":["jquery","html5","canvas"],"question_text":"When I try to execute this in jQuery I get\n`$ctx.getContext is not a function`\nin firebug.\n`var $ctx = $( '<canvas \/>', {width:'100', height:'100'} )\n$widget.append($ctx) \n$ctx.getConte...
{"title":"How to code tables with multi-line cells","tags":["latex","tabular"],"question_text":"I am trying to write a short paper with LaTeX and need to add a table with 3 columns.\n`+-------------+-----------------+--------------------------------------+\n| AAAAAAAAAA | BBBBBBBBBBBBBBB | Betty Botter Bought a Bit of ...
{"title":"Linux: Remove path from $PATH variable","tags":["linux","bash","path","environment-variables","sh"],"question_text":"I'm not too familiar with Linux and have defined the same path in the $PATH variable 6 times. I wasn't logging out to check whether it worked.\nHow can I remove the duplicates?\nThe $PATH varia...
{"title":"Facebook offline access step-by-step","tags":["java","facebook","offline"],"question_text":"UPDATE\n: Facebook\n`offline_access`\npermission is being deprecated. Please refer to the\nofficial documentation\nfor more information.\nYou'll have till\nMay 1, 2012\n, at which date this setting will be\n disabled. ...
{"title":"Initialize\/reset struct to zero\/null","tags":["c","struct","initialization"],"question_text":"`struct x {\n char a[10];\n char b[20];\n int i;\n char *c;\n char *d[10];\n};`\nI am filling this struct and then using the values. On the next iteration, I want to reset all the fields to\n`0`\nor\n`null`\nbefore...
{"title":"Why does csvwriter.writerow() put a comma after each character?","tags":["python","csv"],"question_text":"This code opens the url and appends the\n`\/names`\nat the end and opens the page and prints the string to\n`test1.csv`\n:\n`import urllib2\nimport re\nimport csv\nurl = (\"http:\/\/www.example.com\")\nbi...
{"title":"Get application path without using httpcontext. (asp.net)","tags":["asp.net","http","iis","httpcontext"],"question_text":"How to do it?\nI don't want to use this:\n`HttpContext.Current.Server.MapPath`\nIs there a similar function that I can call without requiring a httpcontext?\nFor example if a start a threa...
{"title":"Gradle version 1.10 is required. Current version is 2.0","tags":["android","maven","gradle","build.gradle","gradle-plugin"],"question_text":"I am trying to use latest Gradle version (2.0), however I keep getting this message when hitting\ngradle build\nin terminal. Why is it asking for 1.10 version? I am new ...
{"title":"C# create simple xml file","tags":["c#","xml"],"question_text":"How can I create a simple xml file and store it in my system?","answer_text":"You could use\nXDocument\n:\n`new XDocument(\n new XElement(\"root\", \n new XElement(\"someNode\", \"someValue\") \n )\n)\n.Save(\"foo.xml\");`\nIf the file you want t...
{"title":"iPhone - How do you color an image?","tags":["iphone","image","colors"],"question_text":"I would love to know how to color an image (make a white .png red, for example). I have seen various suggestions but never any confirmation that this is actually possible. I have tried this:\n`-(UIImage *)colorizeImage:(U...
{"title":"Easiest way to check if a string is palindrome","tags":["java","string"],"question_text":"I want to check if a string is a palindrome or not. I would like to learn an easy method to check the same using least possible string manipulations","answer_text":"Using\n`reverse`\nis overkill because you don't need to...
{"title":"git log the difference between 1 branch from another","tags":["git","git-merge","git-log"],"question_text":"I have 2 branches A and B.\nWhenever I run a build, Branch A gets merged into Branch B. I want to be able to email out all the updates made in A, since the last time the build was ran. How can I use\n`g...
{"title":"How to support both IPv4 and IPv6 connections","tags":["c++","winsock","ipv6","sockets","ipv4"],"question_text":"I'm currently working on a UDP socket application and I need to build in support so that IPV4 and IPV6 connections can send packets to a server.\nI was hoping that someone could help me out and poi...
{"title":"How to check if Twitter bootstrap is loaded?","tags":["javascript","twitter-bootstrap"],"question_text":"How can I check whether there is a bootstrap.js loaded on page (a file bootstrap.js may be compiled into another big JS file)?","answer_text":"All you need to do is simply check if a Bootstrap-specific met...
{"title":"What is the __dict__.__dict__ attribute of a Python class?","tags":["python","class","metaprogramming","magic-methods"],"question_text":"`>>> class A(object): pass\n... \n>>> A.__dict__\n<dictproxy object at 0x173ef30>\n>>> A.__dict__.__dict__\nTraceback (most recent call last):\n File \"<string>\", line 1, i...
{"title":"How to check if a date is greater than other in Java?","tags":["java","date"],"question_text":"I am working on a Java application which generates a report for a duration entered by a user in the command line.\nThe user needs to enter the dates in the following format: dd-MM-yyyy\n`> java report startDate endD...
{"title":"Parallel.For(): Update variable outside of loop","tags":["c#",".net",".net-4.0","parallel-processing"],"question_text":"I'm just looking in to the new .NET 4.0 features. With that, I'm attempting a simple calculation using\n`Parallel.For`\nand a normal\n`for(x;x;x)`\nloop.\nHowever, I'm getting different resu...
{"title":"Simplest way to do a recursive self-join in SQL Server?","tags":["sql","sql-server","join","recursion","hierarchical-data"],"question_text":"What is the simplest way of doing a recursive self-join in SQL Server? I have a table like this:\n`PersonID | Initials | ParentID\n1 CJ NULL\n2 EB 1\n3 MB 1\n4 SW 2\n5 Y...
{"title":"mysql SQL: specific item to be first and then to sort the rest of the items","tags":["mysql","sql"],"question_text":"Lets say I have the table below.\nI want to get all the friends, but I want the id 5 to be the first item in the list. I don't care about the order that I receive the rest of the items.\nThe de...
{"title":"How do I append a newline character for all lines except the last one?","tags":["java","foreach","newline"],"question_text":"I'm iterating through a HashMap (see\nmy earlier question\nfor more detail) and building a string consisting of the data contained in the Map. For each item, I will have a new line, but...
{"title":"Phone number validation Android","tags":["android","validation"],"question_text":"How do I check if a phone number is valid or not? It is up to length 13 (including character\n`+`\nin front).\nHow do I do that?\nI tried this:\n`String regexStr = \"^[0-9]$\";\nString number=entered_number.getText().toString();...
{"title":"Detect \"overall average\" color of the picture","tags":["php","javascript","python","image-processing"],"question_text":"I have a jpg image.\nI need to know \"overall average\" the color of the image. At first glance there can use the histogram of the image (channel RGB).\nAt work I use mostly JavaScript and...
{"title":"In Laravel, the best way to pass different types of flash messages in the session","tags":["session","laravel","laravel-4"],"question_text":"I'm making my first app in Laravel and am trying to get my head around the session flash messages. As far as I'm aware in my controller action I can set a flash message ...
{"title":"overflow:hidden + display:inline-block moves text upwards","tags":["html","css"],"question_text":"I have following HTML:\n`<div>\n a<span style=\"overflow: hidden; display: inline-block;\">b<\/span>c\n<\/div>`\nWhat I expect to see:\n`abc`\n.\nWhat I see (in Chrome, Safari, Firefox):\n`b`\nis higher than\n`a`...
{"title":"symfony vs cakephp","tags":["cakephp","symfony1","php"],"question_text":"What is conceptually the difference between symfony and cakephp?","answer_text":"Just to balance out this thread, this is why I like symfony:\nuses PHP5\nit runs some really big sites like\nYahoo! Answers, delicious, and Daily Motion\n.\...
{"title":"Is it worth hashing passwords on the client side","tags":["passwords","client-side","hash"],"question_text":"When I want to put a login system in place, I always compare the MD5 of the given password with its value in the users table on the server side.\nHowever, a friend of mine told me that a \"clear\" pass...
{"title":"How to solve SQL Server Error 1222 i.e Unlock a SQL Server table","tags":["sql-server","database","sql-server-2008-r2","locking","deadlock"],"question_text":"I am working in a database where I load data in a raw table by a data loader. But today the data loader got stuck for unknown reasons. Then I stopped th...
{"title":"Why is \"!!\" considered bad form in Perl?","tags":["perl","boolean","type-conversion"],"question_text":"During a recent job interview process, I submitted some sample Perl code which used the so-called \"secret\"\n`!!`\noperator\n. Later, when discussing the code, one of the interviewers asked me why I chose...
{"title":"Symfony - generate url with parameter in controller","tags":["symfony2","symfony-routing"],"question_text":"I want to generate a Url directly in my controller. I want to user a url defined in my routing.yml file that needs a parameter.\nI've found that code in the Cookbook (Routage section) :\n`$params = $rou...
{"title":"When should I compare an optional value to nil?","tags":["ios","swift","optional","swift2"],"question_text":"Quite often, you need to write code such as the following:\n`if someOptional != nil {\n \/\/ do something with the unwrapped someOptional e.g. \n someFunction(someOptional!)\n}`\nThis seems a bit verbo...
{"title":"Loading initial data with Django 1.7 and data migrations","tags":["python","json","django","migration","data-migration"],"question_text":"I recently switched from Django 1.6 to 1.7, and I began using migrations (I never used South).\nBefore 1.7, I used to load initial data with a\n`fixture\/initial_data.json`...
{"title":"importing ant build.xml in eclipse","tags":["java","android","eclipse","ant"],"question_text":"I have an android project that uses ant to build, is it possible to import this ant project in eclipse IDE?\nupdate : There is an option to create project using ant\n`build.xml`\nin eclipse File->New->Project->Java-...
{"title":"In C is it faster to use the standard library or write your own function?","tags":["c","optimization","performance"],"question_text":"For example, in\n`<ctype.h>`\nthere are functions like\n`isalpha()`\n.\nI want to know if writing an\n`isalpha`\nfunction on my own is faster than calling\n`isalpha`\n?\nThanks...
{"title":"How to get dividers in NavigationView menu without titles?","tags":["android","android-menu","divider","navigationview"],"question_text":"I am using the new\n`NavigationView`\nto create my navigation drawer menu from XML. I need to place a divider between the section menu items, which switch between the secti...
{"title":"Remove Rows From Data Frame where a Row match a String","tags":["r","dataframe"],"question_text":"I do I remove all rows in a dataframe where a certain row meets a string match criteria?\nFor example:\n`A,B,C\n4,3,Foo\n2,3,Bar\n7,5,Zap`\nHow would I return a dataframe that excludes all rows where C = Foo:\n`A...
{"title":"GridView auto fit images","tags":["android","gridview"],"question_text":"im trying to get images displayed in a GridView and get the columns automatically set, so far I've had to manually set the number of columns which is not what i want to do as this will affect how big the images are on different sized scr...
{"title":"Is it possible to read the value of a annotation in java?","tags":["java","annotations","getter-setter","java-6"],"question_text":"this is my code:\n`@Column(columnName=\"firstname\")\nprivate String firstName;\n @Column(columnName=\"lastname\")\n private String lastName;\n public String getFirstName() {\n re...
{"title":"NoSuchMethodError in javax.persistence.Table.indexes()[Ljavax\/persistence\/Index","tags":["java","hibernate","jpa","playframework-2.0"],"question_text":"I have a Play Framework application and I\nwas\nusing Hibernate 4.2.5.Final (which is retrieved via the Maven dependency manager). I decided to upgrade to H...
{"title":"How to spin an android icon on its center point?","tags":["android","animation","rotation"],"question_text":"I have written the following to spin my icon on the center of the screen and instead it rotates around the upper-left corner (i.e., origin x=0, y=0 of the ImageView). It should be simple to set some at...
{"title":"Default parameters with C++ constructors","tags":["c++","constructor","coding-style","overloading"],"question_text":"Is it good practice to have a class constructor that uses default parameters, or should I use separate overloaded constructors? For example:\n`\/\/ Use this...\nclass foo \n{\nprivate:\n std::s...