text
stringlengths
74
309k
{"title":"Extra leading zeros when printing float using printf?","tags":["c++","c","floating-point","formatting","printf"],"question_text":"I'd like to be able to write a time string that looks like this:\n`1:04:02.1 hours`\nusing printf.\nWhen I try to write something like this:\n`printf(\"%d:%02d:%02.1f hours\\n\", 1...
{"title":"Check if file exists on SD card on Android","tags":["android"],"question_text":"I want to check if a text file exists on the SD card. The file name is mytextfile.txt. Below is the code:\n`FileOutputStream fos = openFileOutput(\"sdcard\/mytextfile.txt\", MODE_WORLD_WRITEABLE);`\nHow can I check whether this fi...
{"title":"change focus into particular div","tags":["jquery"],"question_text":"how can i change focus into particular div after any event via jquery?","answer_text":"To make a div focusable, it needs to have a\n`tabindex`\nattribute.\n`<div id='test' tabindex='1'><\/div>`\nThen, you can focus with e.g.\n`$('#something'...
{"title":"Setting Up Annotation Driven Transactions in Spring in @Configuration Class","tags":["java","spring","configuration","transactions","spring-transactions"],"question_text":"So in the latest version of Spring we are able to use the\n`@Configuration`\nannotation to setup our configurations for Spring. Now in Jav...
{"title":"Return generated pdf using spring MVC","tags":["java","spring","spring-mvc","response","itextpdf"],"question_text":"I am using Spring MVC .I have to write a service that would take input from the request body, add the data to the pdf and returns the pdf file to the browser. The pdf document is generated using...
{"title":"how to get the selected index of a drop down","tags":["javascript","jquery"],"question_text":"I have a normal dropdown which I want to get the currently selected index and put that in a variable. Jquery or javascript. Jquery perfered.\n`<select name=\"CCards\">\n<option value=\"0\">Select Saved Payment Method...
{"title":"Can I re-style google map's infowindows to look less crappy?","tags":["html","google-maps","google-maps-api-3"],"question_text":"The chunky speech bubble things look pretty crap in my opinion, i'd like something much tidier and more minimal.\nAre there any native ways to change the info box style without manu...
{"title":"A super strange bug of os.path.abspath","tags":["python","windows","filesystems"],"question_text":"On My Python 2.6 ( 64bit, win7, ActivePython ),\nwhen i call:\n`os.path.abspath('D:\/PROJECTS\/SuiShouBei\/www\/ssb\/static\/voices\/en\/mp3\/con.mp3')`\nIt returns:\n`'\\\\\\\\.\\\\con'`\nI have no problem with...
{"title":"How do you change the reset password URL in meteor?","tags":["javascript","meteor"],"question_text":"I am using\nmeteor\nalong with the\naccounts-password\npackage. I'm rolling my own login and password changing\/resetting UI and want to know...\nHow can I customize the password reset link in the reset passwo...
{"title":"Using the Nexus rest API to get latest artifact version for given groupid\/artifactId","tags":["maven-2","maven","nexus"],"question_text":"I am trying to use the nexus REST api to get the latest version of a maven artifact. I am able to browse to the specific version I am looking for using\n`http:\/\/repo.loc...
{"title":"Android layout equivalent of HTML HR tag?","tags":["android","android-layout"],"question_text":"Is there any Android layout equivalent for HTML\n`<HR \/>`\ntag?","answer_text":"You can use next trick:\n`<View \n android:layout_width=\"fill_parent\"\n android:layout_height=\"2dp\" \n android:background=\"#ffff...
{"title":"How can I set the value of auto property backing fields in a struct constructor?","tags":["c#","constructor","struct","backing-field"],"question_text":"Given a struct like this:\n`public struct SomeStruct\n{\n public SomeStruct(String stringProperty, Int32 intProperty)\n {\n this.StringProperty = stringProper...
{"title":"UIButton with IB_DESIGNABLE throws runtime attribute warning and does not render in Interface Builder","tags":["ios","objective-c","uibutton","interface-builder","xcode6"],"question_text":"I'm running Xcode 6.1 and I have been using IB_DESIGNABLE with IBInspectable for quite a few projects already but all of ...
{"title":"how to add data into ManyToManyField?","tags":["django","django-models"],"question_text":"I can't find it anywhere, so your help will be nice for me :) Here is that field:\n`categories = models.ManyToManyField(fragmentCategory)`\nFragmentCategory:\n`class fragmentCategory(models.Model):\n CATEGORY_CHOICES = (...
{"title":"Javascript interface not working with android 4.2","tags":["javascript","android","css","webview"],"question_text":"I am facing a serious bug of android OS Jelly Bean 4.2, here in my program I am using JavaScript to get the height of webpage and it is perfectly working from android 2.2 to 4.1 but when I tried...
{"title":"Script parameters in Bash","tags":["linux","bash","shell"],"question_text":"I'm trying to make a shell script which should be used like this:\n`ocrscript.sh -from \/home\/kristoffer\/test.png -to \/home\/kristoffer\/test.txt`\nThe script will then ocr convert the image file to a text file. Here is what I have...
{"title":"Genymotion will not load a virtual device","tags":["android","virtualbox","genymotion"],"question_text":"I have been using Genymotion for about 4months now and all was well until I updated Virtual box to 4.3 . I did not like it because I didnt know how to run 64 bit OSs on it,so i downgraded to 4.2 . Now geny...
{"title":"Inherit interfaces which share a method name","tags":["c++","visual-c++","gcc","multiple-inheritance"],"question_text":"There are two base classes have same function name. I want to inherit both of them, and over ride each method differently. How can I do that with separate declaration and definition (instead...
{"title":"Float in Database to ? in .NET","tags":[".net","sql-server","types","floating-point","double"],"question_text":"If you have a float in MSSQLServer, to what do you map this in .NET?\nCan you convert it to Double or will you lose numbers?","answer_text":"SQLServer\n`float`\nand C#\/VB\n`double`\nhave the same r...
{"title":"Is there a way to preload templates when using AngularJS routing?","tags":["angularjs","offline","angularjs-routing"],"question_text":"After the Angular app is loaded I need some of the templates to be available offline.\nSomething like this would be ideal:\n`$routeProvider\n .when('\/p1', {\n controller: con...
{"title":"What is the purpose of the extension method CreatePerOwinContext in OWIN implementation by Microsoft","tags":["asp.net","owin","katana"],"question_text":"I am a newbie in ASP.NET, and currently learning ASP.NET Identity. I know it's built on top of OWIN implementation by Microsoft, and I am also still learnin...
{"title":"Json and Circular Reference Exception","tags":["asp.net-mvc","json","serialization","circular-reference"],"question_text":"I have an object which has a circular reference to another object. Given the relationship between these objects this is the right design.\nTo Illustrate\n`Machine => Customer => Machine`\...
{"title":"Naming convention for a C# Dictionary","tags":["c#","naming-conventions"],"question_text":"How do we name a dictionary variable?\nSay in my method I have\n`Dictionary<string, List<string>> dictionary;`\n, where the keys of the\n`dictionary`\nare country names and the values are lists of province\/state names....
{"title":"<iostream> vs. <iostream.h> vs. \"iostream.h\"","tags":["c++","iostream"],"question_text":"When including a header file in C++, what's the difference between...\n1) including the .h versus not including the .h when wrapping it in < > signs?\n`#include <iostream> vs. #include <iostream.h>`\n2) wrapping the hea...
{"title":"create my own programming language","tags":["c++","compiler-construction","programming-languages","interpreter"],"question_text":"Possible Duplicates:\nReferences Needed for Implementing an Interpreter in C\/C++\nBooks On Creating Interpreted Languages\nHow to create a language these days?\nLearning to write ...
{"title":"How can I add an image file into json object?","tags":["android","json"],"question_text":"I want to add an image file into json object . Is it possible to add image file into json object?\nI tried below code but its not working ? Because i want to send that json object to the server then server will read my i...
{"title":"Running Git through Cygwin from Windows","tags":["git","cygwin"],"question_text":"I have started using Cygwin recently for other purposes and already have Git installed on my PC. I understand I can run the executable and install Git into Cygwin, but since I already have it installed\nI would like Cygwin to ju...
{"title":"Sending variables to the layout in Zend Framework","tags":["zend-framework","layout","zend-view"],"question_text":"In my project I have a number of dynamic elements that are consistently on every page. I have put these in my layout.phtml\nMy question is: How can I send variables into my layout from my control...
{"title":"Why is Perl used so extensively in biology research?","tags":["perl","bioinformatics","biometrics"],"question_text":"I work as support staff in a biology research institute as a student, and Perl seems to be used everywhere. Not for every single project, but it seems that more than half the people here have a...
{"title":"Write variable to a file in Ansible","tags":["file","ansible-playbook"],"question_text":"I am pulling JSON via the URI module and want to write the received content out to a file. I am able to get the content and output it to the debugger so I know the content has been received, but I do not know the best pra...
{"title":"Why can't R's ifelse statements return vectors?","tags":["r","if-statement"],"question_text":"I've found R's ifelse statements to be pretty handy from time to time. For example:\n`ifelse(TRUE,1,2)\n# [1] 1\nifelse(FALSE,1,2)\n# [1] 2`\nBut I'm somewhat confused by the following behavior.\n`ifelse(TRUE,c(1,2),...
{"title":"How to make a Rails 3 Dynamic Scope Conditional?","tags":["ruby-on-rails-3"],"question_text":"I'd like to make a dynamic named scope in rails 3 conditional on the arguments passed in. For example:\n`class Message < AR::Base\n scope :by_users, lambda {|user_ids| where(:user_id => user_ids) }\nend\nMessage.by_u...
{"title":"Applying a background color to an entire Grid row in XAML Silverlight","tags":["silverlight","xaml","background","gradient"],"question_text":"I'm trying to apply a gradient background to just one row in a XAML Silverlight grid that I've created.\nI can do something like this without any trouble:\n`<Grid>\n <G...
{"title":"How to send data from DialogFragment to a Fragment?","tags":["java","android","android-fragments"],"question_text":"I have a fragment that opens a dialogfragment to get user input (a string, and an integer). How do I send these two things back to the fragment?\nHere is my DialogFragment:\n`public class DatePi...
{"title":"String.Format: Input string was not in a correct format","tags":["c#",".net","exception-handling","string.format"],"question_text":"The following code keep giving me error saying Input string was not in a correct format, but I am pretty sure it is right, isn't it?\n`int id = 112;\nString[] newData = { \"1\", ...
{"title":"iPad - How to get crash report","tags":["ipad","crash","report"],"question_text":"My app on the iPad (physical device) is crashing and I get this:\nMon Nov 22 14:08:42 ianvinkipad ReportCrash[521] : Saved crashreport to \/var\/mobile\/Library\/Logs\/CrashReporter\/InterfaithExplorer_2010-11-22-140841_ianvinki...
{"title":"Making a div that covers the entire page","tags":["html","css"],"question_text":"I would like to make a div that covers the entire page. I put a css style with height:100% but this covers only the viewable area. I want it to also cover the area when I scroll down.","answer_text":"Use\n`position:fixed`\nthis w...
{"title":"What's the meaning of \"()\" in a function call?","tags":["javascript"],"question_text":"Now, I usually call a function (that requires no arguments) with\n`()`\nlike this:\n`myFunction(); \/\/there's empty parens`\nExcept in jQuery calls where I can get away with:\n`$('#foo').bind('click', myFunction); \/\/no...
{"title":"How to ignore case in String.replace","tags":["c#","string","replace","ignore-case"],"question_text":"`string sentence = \"We know it contains 'camel' word.\";\n\/\/ Camel can be in different cases:\nstring s1 = \"CAMEL\";\nstring s2 = \"CaMEL\";\nstring s3 = \"CAMeL\";\n\/\/ ...\nstring s4 = \"Camel\";\n\/\/...
{"title":"using html to do a skype call","tags":["html","skype"],"question_text":"I tried to insert the following snippet in my script. By clicking the link it should do a call to a skype account. I've been looking for hours now, but can't figure out why it doesnt work.\n`<a href=\"callTo:\/\/USERNAME\"><img src=\"http...
{"title":"redis attempting to connect to local host in Heroku - WHY?","tags":["ruby-on-rails","mongodb","heroku","redis","sidekiq"],"question_text":"I have been using sidekiq\/redis for quite some time with no issues to date.\nFor some reason, today I am getting this error:\n`Redis::CannotConnectError - Error connectin...
{"title":"How to JUnit test that two List<E> contain the same elements in the same order?","tags":["java","junit","guava"],"question_text":"Context\nI am writing a simple\nJUnit\ntest for the\n`MyObject`\nclass.\nA\n`MyObject`\ncan be created from a static factory method that takes a varargs of\nString\n.\n`MyObject.of...
{"title":"Difference between long and int data types","tags":["c++","types","integer","size"],"question_text":"Considering that the following statements return\n`4`\n, what is the difference between the\n`int`\nand\n`long`\ntypes in C++?\n`sizeof(int)\nsizeof(long)`","answer_text":"From\nthis\nreference:\nAn int was or...
{"title":"Convert wstring to string encoded in UTF-8","tags":["c++","string","utf-8","wstring"],"question_text":"I need to convert between wstring and string. I figured out, that using codecvt facet should do the trick, but it doesn't seem to work for utf-8 locale.\nMy idea is, that when I read utf-8 encoded file to ch...
{"title":"403 error on Apache for a laravel project, after upgrade to Ubuntu 13.10","tags":["apache","ubuntu","laravel"],"question_text":"I upgraded to Ubuntu 13.10. At first when running apache after the update, there were missing\/broken files, so I simply re-installed apache. I backed up the vhost file.\nWhen trying...
{"title":"How to force layoutSubviews of UIView.","tags":["ios","iphone","uiview","uiviewcontroller","layoutsubviews"],"question_text":"I have a custom UIView which has a dedicated, manually set frame for portrait and landscape orientation because autoresizingMasks just don't work in my case.\nI set this frame in:\n`- ...
{"title":"javascript submit() is not a function?","tags":["javascript","jquery","forms","function","submit"],"question_text":"Possible Duplicate:\nsubmit is not a function in javascript\nWhy is the following basic javascript function giving me an error\n`document.getElementById(\"form\").submit is not a function`\n.\nT...
{"title":"Is it possible to unpack a tuple in Python without creating unwanted variables?","tags":["python","tuples","iterable-unpacking"],"question_text":"Is there a way to write the following function so that my IDE doesn't complain that\ncolumn\nis an unused variable?\n`def get_selected_index(self):\n (path, column)...
{"title":"add a temporary column with a value","tags":["sql","mysql"],"question_text":"I have a select statement like this\n`select field1, field2 \n from table1`\nWhat I want is to have a newfield with only value \"example\".\n`newfield`\ndoes not exist in the table, but when I run this query it kinda makes a virtual ...
{"title":"jquery detecting div of certain class has been added to DOM","tags":["jquery"],"question_text":"I'm using\n`.on()`\nto bind events of divs that get created after the page loads. It works fine for click, mouseenter... but I need to know when a new div of class MyClass has been added. I'm looking for this:\n`$(...
{"title":"CSS how to target 2 attributes?","tags":["css","css-selectors"],"question_text":"OK if I want to target an\n`<input>`\ntag with\n`type=\"submit\"`\nI can do so like:\n`input[type=submit]`\nAlso if I want to target an\n`<input>`\ntag with\n`value=\"Delete\"`\nI can do so like:\n`input[value=Delete]`\nBut How c...
{"title":"node.js: cannot find module 'request'","tags":["linux","node.js","terminal","npm"],"question_text":"I installed\nrequest module\n, and getting the error:\n`module.js:340\n throw err;\n ^\nError: Cannot find module 'request'`\ni've read all the posts about this error, and understand that this is because module...
{"title":"iPhone - having a Ripple effect on a UIImageView","tags":["iphone","uiimageview","image-manipulation","ripple"],"question_text":"Hey guys, \nI am attempting to create a ripple like effect on an imageView when it is touched down on, however I do not understand how to implement OpenGL for windows and porting it...
{"title":"PostgreSQL gui tool\/client for mac os x","tags":["postgresql"],"question_text":"I am planning to move from using MySQL to PostgreSQL for a web app and I am looking for a gui tool\/client for Mac OSX that is comparable to WorkBench or Microsoft SQL Server Management Studio. I have looked at some existing post...
{"title":"HDFS free space available command","tags":["hadoop","hdfs"],"question_text":"Is there a hdfs command to see available free space in hdfs. We can see that through browser at master:hdfsport in browser , but for some reason I can't access this and I need some command.\nI can see my disk usage through command .\...
{"title":"sorting arraylist of string in android","tags":["java","android"],"question_text":"i am having a string arraylist 'names'.which contains names of people.i want to sort the arraylist in alphabetical order.plz help me","answer_text":"This will solve your problem...\n`ArrayList arrayList = new ArrayList();\n\/\/...
{"title":"What is Haskell's Data.Typeable?","tags":["haskell","typeclass","generic-programming","scrap-your-boilerplate"],"question_text":"I've come across references to Haskell's\n`Data.Typeable`\n, but it's not clear to me why I would want to use it in my code.\nWhat problem does it solve, and how?","answer_text":"`D...
{"title":"Killing a process using Java","tags":["java","process"],"question_text":"I would like to know how to \"kill\" a process that has started up. I am aware of the Process API, but I am not sure, If I can use that to \"kill\" an already running process, such as firefox.exe etc. If the Process API can be used, can ...
{"title":"How can I create a friendly URL in ASP.NET MVC?","tags":["c#","asp.net-mvc","asp.net-mvc-routing","friendly-url","slug"],"question_text":"How do I generate friendly URLs within the ASP.NET MVC Framework? For example, we've got a URL that looks like this:\nhttp:\/\/site\/catalogue\/BrowseByStyleLevel\/1\nThe 1...
{"title":"Facebook SDK - iOS - Fail to share URL (Error 102)","tags":["ios","facebook"],"question_text":"I am trying to integrate a simple URL Share on my App, following the dedicated Facebook tutorial (\nlink\n)\nOn my app, I simply click on a button, which displays a dialog where I can type in a comment.\nThis part w...
{"title":"Understand WPF Binding CommandParameter=\"{Binding}\"","tags":["wpf","binding"],"question_text":"Maybe this is a dumb question, but I can't find the answer: in the following xaml what does\n`CommandParameter`\nbinding to? Or in general, what does\n`\"{Binding}\"`\nmean?\n`<Button Command=\"{Binding DataContex...
{"title":"JS function to calculate complementary colour?","tags":["javascript","colors","rgb","palette"],"question_text":"Does anybody know, off the top of your heads, a Javascript solution for calculating the complementary colour of a hex value?\nThere is a number of colour picking suites and palette generators on the...
{"title":"Leaking views when changing rootViewController inside transitionWithView","tags":["ios","cocoa-touch","uiviewcontroller","core-animation"],"question_text":"While investigating a memory leak I discovered a problem related to the technique of calling\n`setRootViewController:`\ninside a transition animation bloc...
{"title":"Why does Ruby seem to hoist variable declarations from inside a case statement even if that code path is not executed?","tags":["ruby"],"question_text":"We define a function foo:\n`def foo(s)\n case s\n when'foo'\n x = 3\n puts x.inspect\n when 'bar'\n y = 4\n puts y.inspect\n end\n puts x.inspect\n puts y.in...
{"title":"Get database path","tags":["android","database"],"question_text":"Im new to android and I want to create kind of CRUD with SQLite.\nI have a\n`public class DataBaseHelper`\nwhich have a constructor:\n`public DataBaseHelper(Context context)\n{\n this.context = context;\n}`\nand a getter for datebase:\n`public ...
{"title":"Android Holo loading spinner in CSS","tags":["css"],"question_text":"I need to know how can I make the Android Holo loading spinner in CSS without images. I've tried, but I don't know how can I do it. This is what I need (animated, like in Android):\nHow can I do it in CSS without images?","answer_text":"I ca...
{"title":"Installing WindowBuilder on Eclipse 4.2","tags":["java","eclipse","plugins","install","windowbuilder"],"question_text":"I'm using Eclipse Juno 4.2, downloaded from\nhere\n.\nOn previous installs, I've been using 3.7, and I've been using WindowBuilder, which I find very useful. I noticed it wasn't included thi...
{"title":"Controlling execution order of unit tests in Visual Studio","tags":["c#","unit-testing","visual-studio-2012"],"question_text":"Okay, I'm done searching for good information on this.\nI have a series of Unit Tests that call a static class which, once initialized, sets properties that cannot (or I don't wish to...
{"title":"UI Test deleting text in text field","tags":["swift","uitextfield","xcode7","uikeyboard","xcode-ui-testing"],"question_text":"In my test I have a text field with a pre-existing text. I want to delete the content and type a new string.\n`let textField = app.textFields\ntextField.tap()\n\/\/ delete \"Old value\...
{"title":"WebForm_PostBackOptions documentation","tags":["asp.net","documentation"],"question_text":"Is there any documentation on the parameters to WebForm_PostBackOptions? I can't find anything by Googling.","answer_text":"There is no official documentation on this. However if you look at the javascript source code y...
{"title":"PhpStorm how to refresh folder content or whole project tree","tags":["php","phpstorm"],"question_text":"This may be a dumb question, but I can not find an option to refresh folder content in project tree (PhpStorm IDE).\nIs this (really basic) feature missing?\nI know, that content is refreshed automatically...
{"title":"Sonar Setup Undefined Mandatory Properties","tags":["batch-file","sonarqube"],"question_text":"Learning how to use SonarQube and was doing a quick install from\nhere\nGot all the way down to step 5. My build fails when I execute:\n C:\\sonar-runner\\bin\\sonar-runner.bat\nI get the following error:\n`INFO: --...
{"title":"Access VBA | How to replace parts of a string with another string","tags":["ms-access","vba"],"question_text":"I am trying to create a piece of code that replaces one word with another.\nExample: Replace Avenue with Ave and North with N.\nI am using MS Access, I could use SQL REPLACE Function but I want to do...
{"title":"Sort List in reverse order","tags":["java","list","order","guava"],"question_text":"I have List list1 in direct order.\n`List<String> list = Ordering.natural().sortedCopy(asu2);`\nHow to change order. And i don't know how to rewrite methods from extends class, please write with examples or speak clearly. Than...
{"title":"XDocument containing namespaces","tags":["c#","xml","linq","linq-to-xml","xml-namespaces"],"question_text":"I have the following XML which I am trying to query with XDocument:\n`<E2ETraceEvent xmlns=\"http:\/\/schemas.microsoft.com\/2004\/06\/E2ETraceEvent\">\n <System xmlns=\"http:\/\/schemas.microsoft.com\/...
{"title":"Why use a perfectly forwarded value (a functor)?","tags":["c++","c++11","perfect-forwarding","c++14"],"question_text":"C++11 (and C++14) introduces additional language constructs and improvements that target generic programming. These include features such as;\nR-value references\nReference collapsing\nPerfec...
{"title":"Android Checkbox preference","tags":["android","preference"],"question_text":"I cannot find any tutorials on checkbox preference. I can use a listpreference, but I can't use checkbox preference. For now, I want that if user sets on the checbox, a toast msg says \"true\" and if he sets it off, the toast msg sa...
{"title":"How can I disable a browser or element scrollbar, but still allow scrolling with wheel or arrow keys?","tags":["javascript","jquery","css","browser","scrollbar"],"question_text":"I want to hide any scrollbars from my\n`div`\nelements and my whole\n`body`\n, but still let the user scroll with the mouse wheel o...
{"title":"How to achieve Base64 URL safe encoding in C#?","tags":["c#","encoding","base64"],"question_text":"I want to achieve Base64 URL safe encoding in C#. In Java, we have the common\n`Codec`\nlibrary which gives me an URL safe encoded string. How can I achieve the same using C#?\n`byte[] toEncodeAsBytes = System.T...
{"title":"Merge two json objects with jquery","tags":["jquery","ajax","json","object","merge"],"question_text":"I have two json objects:\nhttp:\/\/example.com\/search.json?section=saloon\nand\nhttp:\/\/example.com\/search.json?section=coupe\nI have been looking for a way to combine these two objects into one object.\nT...
{"title":"define a string in spring context","tags":["spring"],"question_text":"I have three (A,B,C) spring context.xml, A is for the basic configuration, B and C import the A.\nIn a bean on A I have:\n<bean class=\"com.example.Ex\">\n <property name=\"aString\" value=\"${myString}\" \/>\n<\/bean>\nnow I want to define...
{"title":"How to update not every fields of an object using Entity Framework and EntityState.Modified","tags":["entity-framework","entity-framework-4.1"],"question_text":"I need to update all fields except property1 and property2 for the given entity object.\nHaving this code:\n`[HttpPost]\n public ActionResult Add(obj...
{"title":"What's the Best Way to Catch the Return Key in a PasswordBox? (WPF\/XAML)","tags":["wpf","xaml",".net-3.5","return","passwordbox"],"question_text":"What's the best way to catch the return key in a PasswordBox? (WPF\/XAML)\nI have a TextBox field and a PasswordBox field on my login form (for username and passw...
{"title":"java how expensive is a method call","tags":["java","performance","methods","call"],"question_text":"I'm a beginner and I've always read that it's bad to repeat code. However, it seems that in order to not do so, you would have to have extra method calls usually. Let's say I have the following class\n`public ...
{"title":"angular directive encapsulating a delay for ng-change","tags":["angularjs","angularjs-directive"],"question_text":"I have a search input field with a requery function bound to the ng-change.\n`<input ng-model=\"search\" ng-change=\"updateSearch()\">`\nHowever this fires too quickly on every character. So I en...
{"title":"Asp.Net Forms Authentication when using iPhone UIWebView","tags":["asp.net","asp.net-mvc","authentication","cookies","uiwebview"],"question_text":"I am writing a Asp.net MVC 2 application that uses Forms Authentication and currently I am having a problem with our iPhone application in regards to the authentic...
{"title":"ARC __bridge modifiers demystified","tags":["objective-c","automatic-ref-counting"],"question_text":"I was asked recently by one of my friends about the new bridge modifiers that became active under ARC. He asked me if I knew which ones to use in specific times and what the difference between the different __...
{"title":"Which one is better Node.js CMS for blog?","tags":["node.js","content-management-system"],"question_text":"In current project I am planning to use nodejs CMS as a blog, please let me know which one is better nodejs CMS for blog.","answer_text":"While this is very subjective, I'd recommend you check out\nGhost...
{"title":"Sprockets encoding error on js file: invalid UTF-8 byte sequence","tags":["ruby-on-rails-3.1","sprockets"],"question_text":"A Sprockets::EncodingError exception is thrown when I include a file with characters that are valid utf-8.\nThe line in question is:\n`* Copyright (c) 2010 - 2011 Johan S\u00c3\u00a4ll L...
{"title":"Comparing strings with tolerance","tags":["c#",".net","string-comparison","similarity"],"question_text":"I'm looking for a way to compare a string with an array of strings. Doing an exact search is quite easy of course, but I want my program to tolerate spelling mistakes, missing parts of the string and so on...
{"title":"How to relate to type from outer context","tags":["haskell","types","functional-programming","ghc","type-declaration"],"question_text":"Let us consider the following code snippet:\n`blah :: a -> b -> a\nblah x y = ble x where\n ble :: b -> b\n ble x = x`\nThis compiles fine under GHC, which essentially means ...
{"title":"Cannot set property InnerHTML of null","tags":["javascript","html"],"question_text":"I've a simple html page with no code in the body tag.\nI want to insert the html in the body tag through javascript.\nMy javascript file looks like this.\n`var Global={\n UserWall:function(){\n return \"a very long html code\...
{"title":"Unity Register two interfaces as one singleton","tags":["unity-container"],"question_text":"how do I register two different interfaces in Unity with the same instance...\nCurrently I am using\n`_container.RegisterType<EventService, EventService>(new ContainerControlledLifetimeManager());\n _container.Register...
{"title":"Using Composer's Autoload","tags":["php","autoload","composer-php"],"question_text":"I have been looking around the net with no luck on this issue. I am using composer's autoload with this code in my\n`composer.json`\n:\n`\"autoload\": {\n \"psr-0\": {\"AppName\": \"src\/\"}\n}`\nBut I need to autoload at a h...
{"title":"Set default value on Datetime field in symfony2 form","tags":["php","symfony2"],"question_text":"I have a form containing several fields. One of them is a Datetime field. How to define a default value for that field?\nI've tried setting a value on the related entity, in controller, in constructor and __constr...
{"title":"Difference between try-catch and throw in java","tags":["java"],"question_text":"What is the difference between try-catch and throw clause. When to use these?\nPlease let me know .","answer_text":"The\n`try`\nblock will execute a sensitive code which can throw exceptions\nThe\n`catch`\nblock will be used when...
{"title":"How can I turn off \"scrolling the history\" in iTerm2","tags":["terminal","iterm2"],"question_text":"I have installed the new iTerm 2.\nIt asked me in a yellow bar at the top if I'd like to enable a mouse feature. Unfortunately I don't remember the exact sentense anymore.\nBy accident I approved. Now when I ...
{"title":"Is C# code faster than Visual Basic.NET code?","tags":["c#","vb.net"],"question_text":"Is C# code faster than Visual Basic.NET code, or that is a myth?","answer_text":"That is a myth. They compile down to the same CLR. However the compiler for the same routine may come out slightly differently in the CLR. So ...
{"title":"How to render a View using AJAX in Spring MVC","tags":["jquery","ajax","spring-mvc"],"question_text":"I'm using Spring MVC and I need to make an asynchronous call to the server and refresh only a piece of the page.\nWhat I actually have is a Controller that returns a String. I call the Controller using JQuery...
{"title":"Can bindings create memory leaks in WPF?","tags":["c#","wpf","xaml","memory-leaks"],"question_text":"Do I need to unbind items as the item disappears in order to prevent memory leaks? I guess I'm just a little worried that if I reload and a new template is applied to a control, and in that template there exis...