text
stringlengths
74
309k
{"title":"How to Extract Default Control Template In Visual Studio?","tags":["wpf","visual-studio","xaml"],"question_text":"I'm wondering how I can extract (get a copy) of the Default Template of a given control using Visual Studio. I know this can be done with Expression Blend (right click a control, \"Edit Template\"...
{"title":"How to download jars from Maven Central without writing any pom.xml","tags":["maven-2","java"],"question_text":"I would like something like the following.\nI want just an utility that is able to download jars and their dependencies from the Maven Repository without imposing no constraints on how my project sh...
{"title":"Does Python have anonymous classes?","tags":["python"],"question_text":"I'm wondering if Python has anything like the C# anonymous classes feature. To clarify, here's a sample C# snippet:\n`var foo = new { x = 1, y = 2 };\nvar bar = new { y = 2, x = 1 };\nfoo.Equals(bar); \/\/ \"true\"`\nIn Python, I would im...
{"title":"C#-How to use empty List<string> as optional parameter","tags":["c#","c#-4.0"],"question_text":"Can somebody provide a example of this?\nI have tried\n`null`\n,\n`string.Empty`\nand object initialization but they don't work since default value has to be constant at compile time","answer_text":"Just use the nu...
{"title":"push creates new remote heads! (did you forget to merge? use push -f to force)","tags":["mercurial"],"question_text":"Ok I've had a little google and can't find a solution as i've stumbled across the same message but different ways in which people have got it. I'm new to mecurial and want to make sure i'm doi...
{"title":"Select Direct Child of $(this) in Jquery","tags":["jquery"],"question_text":"I know that I can use $('img', this) to select all img elements in $(this).\nIn my current case I am trying to manipulate only DIRECT child images of $(this).\nIs there a selector for that??","answer_text":"`$(this).find('> img')`\nR...
{"title":"Xcode not recognizing CGFloat \/ UIFont \/ CGSize while using Objective-C with Swift","tags":["objective-c","xcode","swift"],"question_text":"I created a new Swift project and tried to import my existing Objective C code into the Swift project. Everything is going fine except, Xcode 6 Beta 5 is complaining ab...
{"title":"Stringification - how does it work?","tags":["c++","c","c-preprocessor"],"question_text":"I know that:\n`#define foo 4 \n#define str(s) #s`\nwith\n`str(foo)`\nwrites out:\n`\"foo\"`\n, because stringify is executed first of text expansion, but this:\n`#define xstr(s) str(s)\n #define str(s) #s\n #define foo 4...
{"title":"jQuery - script tags in the HTML are parsed out by jQuery and not executed","tags":["javascript","jquery"],"question_text":"I have an HTML page like so:\n`<html>\n<body>\n<div id='something'>\n ...\n <script>\n var x = 'hello world';\n <\/script>\n ...\n<\/div>\n<\/body>\n<\/html>`\nOn another page, I am doin...
{"title":"How can I create a PFX file from a Java Keystore?","tags":["java",".net","certificate","pfx","jks"],"question_text":"I have a Java keystore (.jks file) holding a single certificate. How can I create a .pfx file from this keystore?","answer_text":"From Java 6 onwards,\n`keytool`\nhas an\n`-importkeystore`\nopt...
{"title":"Is Chrome's JavaScript console lazy about evaluating arrays?","tags":["javascript","arrays","logging","google-chrome","console"],"question_text":"I'll start with the code:\n`var s = [\"hi\"];\nconsole.log(s);\ns[0] = \"bye\";\nconsole.log(s);`\nSimple, right? In response to this, Firebug says:\n`[\"hi\"]\n[\"...
{"title":"Batch Update in NHibernate","tags":["nhibernate"],"question_text":"Does batch update command exist in NHibernate? As far as I am aware it doesn't. So what's the best way to handle this situation? I would like to do the following:\nFetch a list of objects ( let's call them a list of users,\n`List<User>`\n) fro...
{"title":"Android update TextView in Thread and Runnable","tags":["android","multithreading","textview","runnable"],"question_text":"I want to make a simple timer in Android that updates a TextView every second. It simply counts seconds like in Minesweeper.\nThe problem is when i ignore the tvTime.setText(...) (make it...
{"title":"What language to learn for microcontroller programming?","tags":["c","embedded","microcontroller"],"question_text":"I'm getting into microcontroller programming and have been hearing contrasting views. What language is most used in the industry for microcontroller programming? Is this what you use in your own...
{"title":"Access GET directly from JavaScript?","tags":["php","javascript","get"],"question_text":"I suppose I could use PHP to access\n`$_GET`\nvariables from JavaScript:\n`<script>\nvar to = $_GET['to'];\nvar from = $_GET['from'];\n<\/script>\n<script src=\"realScript\" type=\"text\/javascript\"><\/script>`\nBut perh...
{"title":"Scala pattern matching on sequences other than Lists","tags":["scala","collections","pattern-matching"],"question_text":"I have the following code which recursively operates on each element within a List\n`def doMatch(list: List[Int]): Unit = list match {\n case last :: Nil => println(\"Final element.\")\n ca...
{"title":"CSS opacity and child elements","tags":["css","background","transparency","alpha-transparency"],"question_text":"`<style type=\"text\/css\">\ndiv#foo {\n background: #0000ff;\n width: 200px;\n height: 200px;\n opacity: 0.30;\n filter: alpha(opacity = 30);\n}\ndiv#foo>div {\n color: black;\n opacity:1;\n filte...
{"title":"Detecting the platform (Window or Linux) by groovy\/grails","tags":["grails","groovy","platform-detection"],"question_text":"Is there a way to detect the platform (Window \/ Linux) in which the website is running by Groovy \/ Grails?","answer_text":"`System.properties['os.name']`\nwill return the name of the ...
{"title":"Stop Devise from clearing session","tags":["ruby-on-rails","ruby","ruby-on-rails-3","devise"],"question_text":"It seems when a user logs out via standard Devise controllers, Devise destroys the entire session store, not just its own data. Is there any way to avoid this behavior? I have other irrelevant data t...
{"title":"Express sendfile() vs render()","tags":["node.js","express"],"question_text":"I tried both res.render('index.html') and res.sendfile('index.html') and they both seem to be doing the same thing. I don't find the Express documentation very helpful. What's the difference between the two?","answer_text":"The rend...
{"title":"git diff - show me line ending changes?","tags":["git","line-endings","git-diff"],"question_text":"My editor is changing the line endings of my source files. When I do\n`git diff`\n, I see the same line twice -- once with\n`-`\nand once with\n`+`\n-- with no visible difference.\nHow do I get\n`git diff`\nto s...
{"title":"Heroku Rails 4 could not connect to server: connection refused","tags":["ruby","postgresql","heroku","ruby-on-rails-4"],"question_text":"Using postgres.\nHaven't been able to push.\nTried this without any luck:\n`config.assets.initialize_on_precompile = false`\n-----> Preparing app for Rails asset pipeline\n`...
{"title":"How to match a single quote in sed","tags":["bash","shell","escaping"],"question_text":"How to match a single quote in sed if the expression is enclosed in single quotes:\n`sed -e '...'`\nFor example need to match this text:\n`'foo'`","answer_text":"You can either use:\n`\"texta'textb\" (APOSTROPHE inside QUO...
{"title":"Get file's size from bytes array (without saving to disc)","tags":["c#",".net","arrays"],"question_text":"I have a byte's array and I want to calculate what would be the file size if I'll write these bytes to file. Is it possible without writing the file to disc?","answer_text":"What about\n`array.Length`\n? ...
{"title":"Adding a field specific error from the controller in symfony2","tags":["php","symfony2","symfony-forms"],"question_text":"I have some complex validation going on with my symfony form, and I need to be able to assign an error to a specific field from my controller. Right now, I have global errors working like ...
{"title":"Purely functional concurrent skip list","tags":["scala","haskell","f#","clojure","purely-functional"],"question_text":"Skip lists\n(Pugh, 1990) provide sorted dictionaries with logarithmic-time operations like search trees but\nskip lists are much more amenable to concurrent updates\n.\nIs it possible to crea...
{"title":"AdaptiveTrigger and DataTemplate","tags":["c#","windows-runtime","windows-10","windows-universal","uwp"],"question_text":"Will AdaptiveTrigger work in a DataTemplate?\nThat's my code i'm using to customize my ShellNavigation, it is working fine except the visual states. They will not trigger anything.\n`<shel...
{"title":"android - calling ui thread from worker thread","tags":["android","android-activity","toast","ui-thread"],"question_text":"Hi I want to make\n`Toast`\navailable to me no-matter-what and available from any thread whenever I like within my application. So to do this I extended the\n`Activity`\nclass:\n`import a...
{"title":"How can I find all matches to a regular expression in Perl?","tags":["regex","perl"],"question_text":"I have text in the form:\n`Name=Value1\nName=Value2\nName=Value3`\nUsing Perl, I would like to match\n`\/Name=(.+?)\/`\nevery time it appears and extract the (.+?) and push it onto an array. I know I can use\...
{"title":"Compojure development without web server restarts","tags":["clojure","compojure"],"question_text":"I've written a small Swing App before in Clojure and now I'd like to create an Ajax-style Web-App. Compojure looks like the best choice right now, so that's what I'm going to try out.\nI'd like to have a real ti...
{"title":"How to clear MemoryCache?","tags":["c#","caching","memory",".net-4.0","memorycache"],"question_text":"I have created a cache using the MemoryCache class. I add some items to it but when I need to reload the cache I want to clear it first. What is the quickest way to do this? Should I loop through all the item...
{"title":"jQuery, image changing on hover","tags":["javascript","jquery","html","css"],"question_text":"Okay, so I have dynamically generated images via PHP, so not necessarily the same images result. And I've spent the last four hours scanning the internet and trying countless things with jQuery and\/or CSS, and I've ...
{"title":"How to create a branch of an old revision with TortoiseSVN?","tags":["svn","tortoisesvn"],"question_text":"I have a repository where in revision 1 the folders trunk, branches and tags were added.\nThe source was kept in trunk. Revision 7 happened, and development continued up to revision 16.\nNow I have to co...
{"title":"Dynamic Paths in Helper","tags":["ruby-on-rails","dynamic","path","helpers"],"question_text":"I'm trying to create a helper method for my admin links. In quite a few\nviews I have the code\n`<% if current_user %>\n<%= link_to \"Edit\", edit_model_path(model) %>\n<%= link_to \"New\", new_model_path %>\n<%= lin...
{"title":"How do I run Rake tasks within a Ruby script?","tags":["ruby","rake","command-line-interface"],"question_text":"I have a\n`Rakefile`\nwith a Rake task that I would normally call from the command line:\n`rake blog:post Title`\nI'd like to write a Ruby script that calls that Rake task multiple times, but the on...
{"title":"build error while add revmob ad in iOS app","tags":["ios","xcode","revmob"],"question_text":"I want to add RevMob add in my app but there are some errors\n`Undefined symbols for architecture i386:\n\"_OBJC_CLASS_$_SKStoreProductViewController\", referenced from:\n objc-class-ref in RevMobAds(RevMobStoreContro...
{"title":"Accessing Rails RESTful routes in the model","tags":["ruby-on-rails"],"question_text":"To clean up my code I would like access to the RESTful helpers in my Rails model. Something like:\n`users_path`\netc.\nThanks.","answer_text":"Just to re-open this: For all rails 3+ users including UrlWriter won't work as i...
{"title":"Using interfaces on abstract classes in C#","tags":["c#","inheritance","interface","abstract-class"],"question_text":"I'm learning C# coming from C++ and have run into a wall.\nI have an abstract class AbstractWidget, an interface IDoesCoolThings, and a class which derives from AbstractWidget called RealWidge...
{"title":"How to find out a specific character is present in a NSString or not?","tags":["ios","xcode","nsstring"],"question_text":"I have two NSStrings named country and searchtext. I need to check whether the country contains the searchtext.\nEg: country = Iceland and searchtext = c, here the word iceland contains th...
{"title":"How to go back and forth in visual studio 2010","tags":["visual-studio","visual-studio-2010"],"question_text":"In xcode and in eclipse there is a version where we can go back and forth to our last cursor location.\nFor example, say I am editing one function. Then I go to the definition of that function. Then ...
{"title":"How to install nano on boot2docker","tags":["docker","boot2docker","nano"],"question_text":"I'm running the boot2docker VM in windows and need to modify the init scripts within the VM. Currently my only option is VI, and it's a pain. I'd just like to use nano, but it's not available.\nIt's running:\n`docker@b...
{"title":"Programatic Accent Reduction in JavaScript (aka text normalization or unaccenting)","tags":["javascript","unicode","normalization","accent-insensitive","text-normalization"],"question_text":"I need to compare 2 strings as equal such as these:\nLubeck == L\u00c3\u00bcbeck\nIn JavaScript.\nWhy? Well, I have an ...
{"title":"Make a phone call in Windows Phone 8.1","tags":["c#","windows-phone-8.1","win-universal-app"],"question_text":"I'm writing a Universal App for Windows 8.1 \/ Windows Phone 8.1 that at some point displays a list of phone numbers. What I would like to do is allow the user to press one of these numbers and have ...
{"title":"C# ASP.NET Single Sign-On Implementation","tags":["c#","asp.net","single-sign-on"],"question_text":"I am tasked with implementing single sign-on for our customer's as part of our next release. The flow exists as follows:\nUser logs into their school's main portal system using a student id\/password provided t...
{"title":"Django, ImportError: cannot import name Celery, possible circular import?","tags":["python","django","celery","importerror"],"question_text":"I went through this example here:\nhttp:\/\/docs.celeryproject.org\/en\/latest\/django\/first-steps-with-django.html\nAll my tasks are in files called tasks.py.\nAfter ...
{"title":"Rendering a Rails view to string for email","tags":["ruby-on-rails"],"question_text":"I'd like to send emails from a table every night at midnight, so I've created a model to track all communications to be sent. This\n`Communication`\nmodel stores who the letter is to, from, and the contents of the letter to ...
{"title":"Where can i find the yii version of my yii app?","tags":["php","yii"],"question_text":"I recently started to work with yii, where can i find the yii version of my yii app?","answer_text":"You can use\n`getVersion()`\nof YiiBase\n`Yii::getVersion();`","question_code":[],"answer_code":["Yii::getVersion();\n"],"...
{"title":"Rails 3 rake task can't find model in production","tags":["ruby-on-rails","ruby-on-rails-3","rake"],"question_text":"My simple rake task, stored in\n`lib\/tasks\/items_spider.rake`\nruns just fine in development. All it does is call\n`spider!`\non the\n`Item`\nmodel.\n`namespace :items do\n desc \"Spider the ...
{"title":"I'm storing click coordinates in my db and then reloading them later and showing them on the site where the click happened, how do I make sure it loads in the same place?","tags":["javascript"],"question_text":"That's it basically. Storing the click coordinates is obviously the simple step, but once I have th...
{"title":"Is there a set of \"Lorem ipsums\" files for testing character encoding issues?","tags":["java","unit-testing","character-encoding","junit"],"question_text":"For layouting we have our famous \"Lorem ipsum\" text to test how it looks like.\nWhat I am looking for is a set of files containing Text encoded with s...
{"title":"Recover sa password","tags":["sql","sql-server-2008-r2"],"question_text":"I have a computer which was used by another employee.\nSQL Server 2008 R2 was installed but I don't know the 'sa' password.\nWhen I try to alter the login, it gives below error.\nCannot alter the login 'sa', because it does not exist or...
{"title":"Converting latitude\/longitude into city name? (reverse geolocating)","tags":["php","jquery","google-maps","geolocation","geocoding"],"question_text":"I'm working on a job board in Codeigniter PHP + jQuery where employers enter their location and we use Google Maps API to plot it. While this has had awesome u...
{"title":"how to extract last value in the URL using JQuery","tags":["jquery"],"question_text":"how to extract the last value that is 1 from the following Url using jQuery...\nUrl : \/FormBuilder\/index.php\/reports\/export\/1","answer_text":"You can use\nsubstring\nand\nlastIndexOf\n:\n`var value = url.substring(url.l...
{"title":"How to get screen resolution of visitor in javascript and\/or php?","tags":["php","javascript","jquery"],"question_text":"I would like to know the screen resolution of a visitor visiting my page so I can properly make a jquery thickbox cover about 75% of their screen.\nSolutions to the question or helping me ...
{"title":"How does a service layer fit into my repository implementation?","tags":["c#","asp.net","domain-driven-design","repository","repository-pattern"],"question_text":"I have created a POCO model class and a repository class which handles persistence. Since the POCO cannot access the repository, there are lots of ...
{"title":"Make a simple fade in animation in Swift?","tags":["ios","swift"],"question_text":"I am trying to make a simple animation in Swift. It is a fade in.\nI attempted:\n`self.myFirstLabel.alpha = 0\nself.myFirstButton.alpha = 0\nself.mySecondButton.alpha = 0`\nThen, I have:\n`self.view.addSubview(myFirstLabel)\nse...
{"title":"Is there javascript to convert HTML to markdown?","tags":["javascript","html","markdown"],"question_text":"There is showdown.js to convert markdown to HTML, and\nPHP Markdown\nto convert markdown to and from HTML. My question is, is there javascript library to convert HTML to markdown?","answer_text":"I've st...
{"title":"Escape single quote","tags":["sed"],"question_text":"The following is working as expected. I want to replace the word \"me\" with \\'\n`echo \"test ' this\" | sed 's\/'\"'\"'\/me\/g'\ntest me this`\nExpected result:\n`test \\' this`\nIs it possible to escape double quotes as well in the same command?","answer...
{"title":"Add line breaks or spaces between elements when using jQuery .append()","tags":["jquery","append","line-breaks","dom-manipulation","css"],"question_text":"I have a jQuery set of elements that I get from my DOM by calling:\n`$(\".some-selector\");`\nAll my elements are DIVs each in its own line. My DIVs are se...
{"title":"How do you use https \/ SSL on localhost?","tags":["asp.net","iis","ssl","localhost"],"question_text":"I would like to know how to setup SSL on my web application on the localhost.\nI have no background in doing this, would appreaciate guidance. I already finished implementing my web application and i need it...
{"title":"Cannot app.use(multer). \"requires middleware function\" error","tags":["node.js","multer"],"question_text":"I'm just starting learning NodeJS and I am stuck with a problem. I would like to upload files to my server. To do so I searched and found out this module\nmulter\n. Doing as the example on GitHub works...
{"title":"Change font size and style in Visual Studio 2008","tags":["visual-studio-2008"],"question_text":"Where is the setting to change the font size and font type in Visual Studio 2008?","answer_text":"Use menu\nTools\n->\nOptions\n-> Inside\nEnvironment\n->\nFonts and Colors\n:","question_code":[],"answer_code":[],...
{"title":"How to center div vertically inside of absolutely positioned parent div","tags":["html","css","vertical-alignment","absolute"],"question_text":"I am trying to get blue container in the middle of pink one, however seems\n`vertical-align: middle;`\ndoesn't do the job in that case.\n`<div style=\"display: block;...
{"title":"Ruby: Boolean attribute naming convention and use","tags":["ruby","attributes","conventions","boolean-expression"],"question_text":"Learning ruby. I'm under the impression that boolean attributes should be named as follows:\n`my_boolean_attribute?`\nHowever, I get syntax errors when attempting to do the follo...
{"title":"How to update two columns in a MySQL database?","tags":["mysql","sql-update"],"question_text":"This doesn't work:\n`UPDATE customers SET firstname=\"John\" AND lastname=\"Smith\" WHERE id=1;`","answer_text":"Separate values with commas.\n`AND`\nis an logical operator, its place is in\n`WHERE`\nand\n`ON`\nclau...
{"title":"UIWebView loadHTMLString shows blank screen","tags":["iphone","ios4","uiwebview"],"question_text":"I have a strange problem with UIWebView's loadHTMLString, where it would only display a blank view when I called loadHTMLString with my content HTML string. It does not matter what the content of the htmlstring ...
{"title":"Random element of List<T> from LINQ SQL","tags":["c#",".net","linq","linq-to-sql","random"],"question_text":"in c#.net 3.5 I get by Linq all my users from my user-table.\nNow I will return a random user from this list, how to do?","answer_text":"Like this:\n`var rand = new Random();\nvar user = users[rand.Nex...
{"title":"Connection refused on nginx docker container","tags":["osx","nginx","docker"],"question_text":"I've installed\nDocker Toolbox\nin OSX and I'm following Docker's simple tutorial on\ndeploying Nginx\n.\nI've executed docker run and confirmed that my container has been created:\n`docker run --name mynginx1 -P -d...
{"title":"how do I print an unsigned char as hex in c++ using ostream?","tags":["c++","formatting","ostream"],"question_text":"I want to work with unsigned 8-bit variables in C++. Either\n`unsigned char`\nor\n`uint8_t`\ndo the trick as far as the arithmetic is concerned (which is expected, since AFAIK\n`uint8_t`\nis ju...
{"title":"What does <T> denote in C#","tags":["c#",".net","generics"],"question_text":"I'm new to C# and directly diving into modifying some code for a project I received. However, I keep seeing code like this :\n`class SampleCollection<T>`\nand I cannot make sense of what the\n`<T>`\nmeans nor what it is called.\nIf a...
{"title":"ASP.Net cannot create\/shadow copy","tags":["asp.net","assemblies","web-config"],"question_text":"I get this error repeatedly when developing ASP.Net applications:\n`Cannot create\/shadow copy 'XXXXX' when that file already exists`\nWhere XXXXX is a random DLL. Typically the DLL is one of the DLLs from Micros...
{"title":"Does using $this instead of $(this) provide a performance enhancement?","tags":["javascript","jquery","caching","this"],"question_text":"Assume I have the following example:\nExample One\n`$('.my_Selector_Selected_More_Than_One_Element').each(function() {\n $(this).stuff();\n $(this).moreStuff();\n $(this).ot...
{"title":"How to check if an element is overlapping other elements?","tags":["javascript","boundary"],"question_text":"I have two div elements. Each of them have 450px width and height. How do I check if the first div is overlapping the second div?\nI've tried to use javascript hittest, but it's a little bit complicate...
{"title":"Transparent background in grouped UITableView - iPhone","tags":["iphone","uitableview","background","transparency"],"question_text":"I want to make the grouped UITableView transparent. I partially succeded with the following code:\n`UIColor *bgColor = [[UIColor alloc] initWithWhite:1 alpha:0.0];\nhistoryTable...
{"title":"ServletContextListener execution order","tags":["java","servlets","servletcontextlistener"],"question_text":"How to define order of ServletContextListener's execution due application initialization, if i have multiple ServletContextListener's and some of them declared in deployment descriptor and other with a...
{"title":"How to set the name of a form without a class?","tags":["symfony2"],"question_text":"Here is written how to set the name of a form with a class:\nhttp:\/\/symfony.com\/doc\/2.0\/book\/forms.html#creating-form-classes\nbut how to set the name of this form?\n`$form = $this->createFormBuilder($defaultData)\n ->a...
{"title":"Error in resource configuration. Expected response to contain an object but got an array","tags":["javascript","angularjs","ngresource"],"question_text":"I have an angular response that expects an array and the service call passes an array(can see it in network tab of chrome dev tools).\nbut I'm getting the f...
{"title":"How to convert java.sql.timestamp to LocalDate (java8) java.time?","tags":["java","timestamp","java-8","localtime","java-time"],"question_text":"In Java 8, how can I convert a\n`Timestamp`\n(in\n`java.sql`\n) to a\n`LocalDate`\n(in\n`java.time`\n)?","answer_text":"You can do:\n`timeStamp.toLocalDateTime().toL...
{"title":"Add element to a list In Scala","tags":["list","scala"],"question_text":"I'm running Scala 2.10.2. I want to create a list, then add some elements to the list and expect to see all the elements in the lists when I call the list's name. But I observed something quite weird (At least weird for me since I'm a ne...
{"title":"How do I create an android Intent that carries data?","tags":["android","android-intent"],"question_text":"I might have misunderstood how intents are supposed to be used, so I might be asking the wrong thing here. If that's the case, please help me get on the right track with this anyway...\nI've just started...
{"title":"URL Encoding\u00e2\u0080\u0094Ampersand Problem","tags":["urlencode","modx"],"question_text":"I'm having some trouble with some character encoding causing some problems with a search form on my website. One of the possible field values has an ampersand in it. When this is selected and a search is submitted th...
{"title":"Dynamically creating a proxy class","tags":["c#",".net","reflection","proxy"],"question_text":"I am trying to create a proxy class dynamically. I know there are some very good frameworks out there to do this but this is purely a pet project as a learning exercise so would like to do it myself.\nIf, for exampl...
{"title":"Git pulling changes between two local repositories","tags":["git","git-pull"],"question_text":"I have two clones of same remote repository.I have made some changes to one local repository, how can I pull this changes to other local repository without pushing it to remote.","answer_text":"You can treat the sec...
{"title":"Java InputStream blocking read","tags":["java","blocking","inputstream","rxtx","java-io"],"question_text":"According to the java api, the\n`InputStream.read()`\nis described as:\nIf no byte is available because the\n end of the stream has been reached,\n the value -1 is returned. This method\n blocks until in...
{"title":"How can I edit Font Awesome (or include my own icons)?","tags":["svg","fonts","font-awesome"],"question_text":"Font Awesome\nis fully open source, so how can I tweak some icons as I wish, or add new icons? Let's say my primary vector tool is Inkscape (open source GPL).\nThe fontawesome package comes with file...
{"title":"SHA1 certificate fingerprint","tags":["android","api","google-maps","sha1","google-cloud-messaging"],"question_text":"I am trying to make an app that can communicate with Google Cloud Messaging. \n I have looked at some tutorials and read a lot of stuff, but it all skips one point. When configuring an Android...
{"title":"Finding current page number in jqGrid","tags":["jquery","jqgrid"],"question_text":"How can I find the current page number in jqGrid (using jQuery of course). Also how do I know how many pages are there in total.","answer_text":"This should do it:\n`$(\"#sp_1\").text(); \/\/ total pages\n$(\".ui-pg-input\").va...
{"title":"One-liner to take some properties from object in ES 6","tags":["javascript","ecmascript-6","ecmascript-harmony","destructuring","ecmascript-next"],"question_text":"How one can write a function, which takes only few attributes in most-compact way in ES6?\nI've came up with solution using destructuring + simpli...
{"title":"Android Unable to remove the color at the top and bottom","tags":["android","scroll","scrollview","tablet","shadow"],"question_text":"I have added a scrollView and if deploy on the android tablet,it has some problems. But it works fine on cellphone.\nWhen users move to the top or bottom of the whole page,it w...
{"title":"Iterating over a vector in reverse direction","tags":["c++","stl","iteration"],"question_text":"I need to iterate over a vector from the end to the beginnig. The \"correct\" way is\n`for(std::vector<SomeT>::reverse_iterator rit = v.rbegin(); rit != v.rend(); ++rit)\n{\n \/\/do Something\n}`\nWhen doSomething ...
{"title":"angulajs angularjs $timeout without delay parameters reason","tags":["angularjs"],"question_text":"In a few script I can find for instance\n`$timeout(function () {\n $scope.my = 1; \n});`\ninstead of simply\n`$scope.my = 1;`\nWhat's the purpose to call $timeout without delay ?","answer_text":"This is a hack. ...
{"title":"When I delete my iOS application push notification state remains","tags":["iphone","ios","xcode","api","uninstall"],"question_text":"When I install my iOS application using Xcode for the first time, my iPhone asks whether I want to enable push notifications.\nI am able to send a notification, and the badge sh...
{"title":"Multi-line config variables in Heroku","tags":["configuration","heroku"],"question_text":"I've have a Rails app that loads a number of RSA certificates before a transaction is made with Paypal. On my development machine, these certificates are read from files in the file system but because Heroku (which I'm u...
{"title":"How to use a package constant in SQL SELECT statement?","tags":["sql","oracle","packages"],"question_text":"How can I use a package variable in a simple SELECT query statement in Oracle?\nSomething like\n`SELECT * FROM MyTable WHERE TypeId = MyPackage.MY_TYPE`\nIs it possible at all or only when using PL\/SQL...
{"title":"What is a reasonable order of Java modifiers (abstract, final, public, static, etc.)?","tags":["java"],"question_text":"What is a reasonable order of Java modifiers?\nabstract\nfinal\nnative\nprivate\nprotected\npublic\nstatic\nstrictfp\nsynchronized\ntransient\nvolatile\nUpdate\nI have changed the wording fr...
{"title":"Angular-ui modal, sending data into modal controller from $http","tags":["angularjs","angular-ui"],"question_text":"I'm using the angular-ui modal directive\nhttp:\/\/angular-ui.github.io\/bootstrap\/\n.\nI have followed the example from the link above.\nThis is my data I want to send from my controller:\n`Pr...
{"title":"Multivariate spline interpolation in python\/scipy?","tags":["python","numpy","scipy","interpolation"],"question_text":"Is there a library module or other straightforward way to implement multivariate spline interpolation in python?\nSpecifically, I have a set of scalar data on a regularly-spaced three-dimens...
{"title":"jQuery UI autocomplete shows value instead of label in the input field","tags":["jquery-ui-autocomplete"],"question_text":"A potentially simple issue with jQuery UI autocomplete is stumping me. My source is\n`var ac = [\n {\n label: \"One Thing\",\n value: \"One-Thing\"\n },\n {\n label: \"Two Thing\",\n valu...
{"title":"Best practices for sharing ansible playbooks in a private team?","tags":["configuration-management","ansible","ansible-playbook"],"question_text":"I'm investigating migrating our current chef based configuration management to ansible.\nWe build a lot of rails apps that have similar dependencies (ruby, unicorn...
{"title":"How to programmatically set the ForeColor of a label to its default?","tags":["c#","asp.net"],"question_text":"I'm using VS2010 C# ASP.NET\nTo programmatically change the ForeColor of an asp:Label named\n`lblExample`\nto 'Red', I write this:\n`lblExample.ForeColor = System.Drawing.Color.Red;`\nAfter changing ...