text stringlengths 74 309k |
|---|
{"title":"Android studio - deploy the release apk instead of debug","tags":["android","android-studio"],"question_text":"The run configurations in Android Studio only let you deploy the default (debugging) APK, but I have built a release APK by running gradle assembleDebug from within Android Studio (as an external too... |
{"title":"Dynamic routes with Rails 3","tags":["ruby-on-rails","ruby","ruby-on-rails-3","url-routing"],"question_text":"I have a task to develop a rails application following the model for routing.\nI need to have\n`PageController`\nand\n`Page`\nmodel. Page urls must be like\n`\/contacts, \/shipping, \/some_page`\n.\nA... |
{"title":"Codeigniter URL Redirect WITHOUT adding index.php","tags":["apache","codeigniter","redirect"],"question_text":"I'm working on a site with a few controllers, and have configured my server to redirect requests for\n`http:\/\/www.host.com\/controller\/function\/params`\nto\n`http:\/\/www.host.com\/index.php\/con... |
{"title":"how to call service method from ng-change of select in angularjs?","tags":["angularjs","angularjs-directive","angularjs-service","angularjs-factory","angularjs-ng-change"],"question_text":"I am new to angular js. I am trying to call factory service method 'getScoreData' from ng-change of select, but not able ... |
{"title":"Using PHP, MySQLi and Prepared Statement, how I return the id of the inserted row?","tags":["php","mysql","mysqli","prepared-statement"],"question_text":"I want retrieve the id of a inserted row in the database, but I don't know how to do this.\nI tried to return using the SQL clause\n`RETURNING id`\n, but no... |
{"title":"What's with 181783497276652981 and 8682522807148012 in Random (Java 7)?","tags":["java","random"],"question_text":"Why were\n`181783497276652981`\nand\n`8682522807148012`\nchosen in\n`Random.java`\n?\nHere's the relevant source code from Java SE JDK 1.7:\n`\/**\n * Creates a new random number generator. This ... |
{"title":"GNU GCC (g++): Why does it generate multiple dtors?","tags":["c++","g++","destructor"],"question_text":"Developing environment: GNU GCC (g++) 4.1.2\nWhile I'm trying to investigate how to increase 'code coverage - particularly function coverage' in unit testing, I've found that some of class dtor seems to be ... |
{"title":"Is there a way to rewrite the HTML to use gulp-minified CSS","tags":["concatenation","minify","gulp","gulp-less"],"question_text":"I'm struggling with the following:\nMy gulpfile.js compiles all .less, minifies it and concattenates all CSS into .\/dist\/all.min.css\nIs there a way I can rewrite the HTML file,... |
{"title":"Get Cell Value from a DataTable in C#","tags":["c#",".net","datatable"],"question_text":"Here is a\nDataTable dt\n, which has lots of data.\nI want to get the specific\nCell Value\nfrom the DataTable, say\nCell[i,j]\n. Where, \ni -> Rows and j -> Columns. I will iterate i,j's value with two\n`forloops`\n.\nBu... |
{"title":"Check if OneToOneField is None in Django","tags":["python","django-models","one-to-one"],"question_text":"I have two models like this:\n`class Type1Profile(models.Model):\n user = models.OneToOneField(User, unique=True)\n ...\nclass Type2Profile(models.Model):\n user = models.OneToOneField(User, unique=True)\... |
{"title":"print call stack in C or C++","tags":["c++","c","linux","callstack"],"question_text":"Is there any way to dump the call stack in a running process in C or C++ every time a certain function is called? What I have in mind is something like this:\n`void foo()\n{\n print_stack_trace();\n \/\/ foo's body\n return\... |
{"title":"Check if an object is NSInteger","tags":["iphone","objective-c","cocoa-touch","cocoa"],"question_text":"I hope to check the type of an object, for NSString:\n`[theObject isKindOfClass:[NSString class]]`\nit works, but for NSInteger\n`[theObject isKindOfClass:[NSInteger class]]`\nwill report error\nWelcome any... |
{"title":"How to Ignore \"Duplicate Key\" error in T-SQL (SQL Server)","tags":["sql","sql-server"],"question_text":"I have a transaction that contains multiple SQL Statements (INSERT, UPDATE and\/or DELETES). When executing, I want to ignore Duplicate Error statements and continue onto the next statement. What's the be... |
{"title":"How to force line wrapping in listings package?","tags":["latex"],"question_text":"I have a problem concerning the listings package in latex. I need to embed a source code of the following XML document\nhttp:\/\/www.sparxsystems.com.au\/downloads\/profiles\/EP_Extensions.xml\nin my master thesis' appendix. Th... |
{"title":"C++ templates specialization syntax","tags":["c++","template-specialization"],"question_text":"In C++ Primer Plus (2001, Czech Translation) I have found these different template specialization syntax:\nfunction template\n`template <typename T> void foo(T);`\nspecialization syntax\n`void foo(int param); \/\/ 1... |
{"title":"CSS transition auto height not working","tags":["css","animation","transactions","css-transitions"],"question_text":"I have a website, and I decided to replace the jquery based toggle boxes with pure CSS snippets. When I use fixed height value for the transition (last lines of the CSS), it works well, but wit... |
{"title":"checking if the Google Analytics _gaq object is loaded and available","tags":["javascript","jquery","google-analytics","typeof","web-analytics"],"question_text":"I have some Google Analytics Tracking Code (GATC) on my site which triggers calls to the\n`_gaq.push`\nmethod in Google's code.\nIn the scenario tha... |
{"title":"How do you add a WordPress admin page without adding it to the menu?","tags":["wordpress","wordpress-plugin"],"question_text":"I'm building a WordPress plugin and I'd like to have an edit-item page that can't be reached via the submenu (because then the item wouldn't be specified).\nThis resource (http:\/\/co... |
{"title":"How can I determine property types using reflection?","tags":["c#",".net","reflection"],"question_text":"How would I test a property of a type to see if it is a specified type?\nEDIT: My goal is to examine an assembly to see if any of the types in that assembly contain properties that are MyType (or inherited... |
{"title":"CGPoint relative to view","tags":["iphone","ios","uiview","cgpoint"],"question_text":"Consider a screen point (CGPoint) and a view (UIView), which is somewhere inside the view hierarchy (it can be a subview of other views).\nHow can you convert the point to a point relative to the view's coordinates?","answer... |
{"title":"rails 3,Kaminari pagination for an simple Array","tags":["ruby-on-rails","kaminari"],"question_text":"For paginating a common array I got this solution,\n@arr_name =\n Kaminari.paginate_array(@arr_name).page(params[:page]).per(PER_PAGE_RECORDS)\n`PER_PAGE_RECORDS`\nis a variable with value as per needed for p... |
{"title":"What is the meaning of SO_REUSEADDR (setsockopt option) - Linux?","tags":["linux","sockets","port","ip-address","setsockopt"],"question_text":"From the man page:\nSO_REUSEADDR Specifies that the rules\n used in validating addresses supplied\n to bind() should allow reuse of local\n addresses, if this is suppo... |
{"title":"Purpose of ClientSettingsProvider.ServiceUri in app.config","tags":[".net","wcf"],"question_text":"What does\n`<appSettings>\n <add key=\"ClientSettingsProvider.ServiceUri\" value=\"\"\/>\n<\/appSettings>`\ndo?\nSince the value is empty string, can I remove the element?","answer_text":"This has to do with ASP... |
{"title":"Bracket Highlighting in Textmate (javascript)","tags":["javascript","textmate"],"question_text":"I have some gnarly functions in javascript that I am using Textmate to edit. I see an extremely short flash of the matching bracket, but it is almost imperceptible if you don't arrow over the bracket repeatedly. I... |
{"title":"jQuery UI autocomplete with item and id","tags":["javascript","jquery","arrays","jquery-ui","jquery-ui-autocomplete"],"question_text":"I have the following script which works with a 1 dimensional array. Is it possible to get this to work with a 2 dimensional array? Then whichever item is selected, by clicking... |
{"title":"What is null key encryption?","tags":["encryption"],"question_text":"In the movie Dark Knight, the batman builds some ultra powerful sonar monitoring system and encrypts it will Null Key Encryption.\nI was reading this\nRFC\nbut couldn't comprehend it. It says something like this\nHowever there are cases when... |
{"title":"What are the efficiencies afforded by Emacs or Vim vs Eclipse?","tags":["eclipse","vim","emacs"],"question_text":"I started coding around 5 years ago. I was introduced through Java and Eclipse which both have substantial stigma attached in the programming community. A number of people at the company I current... |
{"title":"How was the first C compiler written?","tags":["c","assembly","compiler-construction"],"question_text":"Is it true that the first C compiler was written in C itself? Then, how was it executed and compiled? Or, was this compiler written in assembly language?","answer_text":"It is described pretty well in\nDenn... |
{"title":"How to change name of project in Android Studio","tags":["android","android-studio","ide","projects-and-solutions"],"question_text":"Imported an eclipse project into Android Studio and saved it in a new folder. Changed the package name and everything to new names but the Project's name is still the one from t... |
{"title":"C# difference between casting and as?","tags":["c#","casting"],"question_text":"Possible Duplicate:\nWhat is the difference between the following casts in c#?\nIn C#, is a there difference between casting an object or using the\n`as`\nkeyword? Hopefully this code will illustrate what I mean...\n`String text =... |
{"title":"How to set size for local image using knitr for markdown?","tags":["image","r","markdown","knitr","pandoc"],"question_text":"I have a local image that I would like to include in an\n`.Rmd`\nfile which I will then\n`knit`\nand convert to HTML slides with\n`Pandoc`\n. Per\nthis post\n, this will insert the loca... |
{"title":"How to name factory like methods?","tags":["coding-style","naming-conventions","methods","factory"],"question_text":"I guess that most factory like methods start with\n`create`\n. But why are they called \"\ncreate\n\"? Why not \"\nmake\n\", \"\nproduce\n\", \"\nbuild\n\", \"\ngenerate\n\" or something else? ... |
{"title":"Is there a way to initialize an object through a hash?","tags":["ruby","hash","constructor","initialization"],"question_text":"If I have this class:\n`class A\n attr_accessor :b,:c,:d\nend`\nand this code:\n`a = A.new\nh = {\"b\"=>10,\"c\"=>20,\"d\"=>30}`\nis it possible to initialize the object directly from... |
{"title":"Javascript, What does the ^ (caret) operator do?","tags":["javascript","math","operators"],"question_text":"I have some javascript code:\n`<script type=\"text\/javascript\">\n$(document).ready(function(){\n $('#calcular').click(function() {\n var altura2 = ((($('#ddl_altura').attr(\"value\"))\/100)^2);\n var ... |
{"title":"overide default pluralize for model-name in rails3","tags":["ruby-on-rails","localization","pluralize"],"question_text":"my locale is :de and I like to get this:\n`Sheet.model_name.human.pluralize # => Belegs`\nto add me a trailing \"e\" instead of \"s\"\n`Sheet.model_name.human.pluralize # => Belege`\njust f... |
{"title":"What exactly is a canvas path, and what is the use of ctx.closePath()?","tags":["javascript","html5","canvas","drawing","jcanvas"],"question_text":"I'm working on an HTML5 game. I need to draw tail lines in the canvas and check for intersections in the game, which is a Tron-style game.\nI'm actually using\nth... |
{"title":"Best JavaScript solution for client-side form validation and interaction?","tags":["javascript","jquery","html","validation","forms"],"question_text":"Our web forms are really complex. What's a great solution for extensible form validation, preferably one that works with jQuery?\nBackground:\nOur site has a b... |
{"title":"Redefinition allowed in C but not in C++?","tags":["c++","c","declaration"],"question_text":"Why does this code work in C but not in C++?\n`int i = 5;\nint i; \/\/ but if I write int i = 5; again I get error in C also\nint main(){\n \/\/ using i\n}`","answer_text":"Tentative definition is allowed in C but not... |
{"title":"Replace substring of NSAttributedString with another NSAttributedString","tags":["iphone","ios","string","replace","nsattributedstring"],"question_text":"I want to replace a substring (e.g.\n`@\"replace\"`\n) of an\n`NSAttributedString`\nwith another\n`NSAttributedString`\n.\nI am looking for an equivalent me... |
{"title":"DateTime.DayOfWeek micro optimization","tags":["c#","performance","datetime","micro-optimization","dayofweek"],"question_text":"First of all:\nI'm asking this question just for fun and eager to learn. I have to admit I love to mess around with micro-optimizations (Although they have never led to any significa... |
{"title":"Is there an HTML safe truncate method in Rails?","tags":["html","ruby-on-rails","ruby","string"],"question_text":"I have a string of HTML in Rails. I'd like to truncate the string after a certain number of characters not including the HTML markup. Also, if the split happens to fall in the middle of an opening... |
{"title":"how to use DEXtoJar","tags":["decompiler"],"question_text":"I find the solution to decompile a file dex to jar from this link\nhttp:\/\/code.google.com\/p\/dex2jar\/downloads\/list\nbut i don't understand how to use it.","answer_text":"Follow the below steps to do so_\nRename your APK file(e.g.,\nrename your ... |
{"title":"Eclipse Blue, Maven: Project configuration is not up-to-date with pom.xml","tags":["eclipse","maven","ear"],"question_text":"I am using Eclipse Blue 10 & Maven 3 in my development environment.\nI generally import maven projects from SVN by following below path:\n`File > Import> SVN > Checkout Projects from SV... |
{"title":"Why are assignment operators (=) invalid in a foreach loop?","tags":["c#","foreach","variable-assignment"],"question_text":"Why are assignment operators (=) invalid in a\n`foreach`\nloop? I'm using C#, but I would assume that the argument is the same for other languages that support\n`foreach`\n(e.g. PHP). Fo... |
{"title":"Mediaplayer error (-19,0) after repeated plays","tags":["android","android-mediaplayer"],"question_text":"I have a game in which a sound plays when a level is completed. Everything works fine to start with but after repeating a level 10 or 20 times the logcat suddenly reports:\n\"MediaPlayer error (-19,0)\" a... |
{"title":"Find lines from a file which are not present in another file","tags":["unix","text-files"],"question_text":"I have two files (let's say\n`a.txt`\nand\n`b.txt`\n), both of which has a list of names. I have already run\n`sort`\non both the files.\nNow I want to find lines from\n`a.txt`\nwhich are not present in... |
{"title":"reconstruct\/get code of php function","tags":["php","reflection"],"question_text":"Can I programmatically get a code of function by it's name?\nLike:\n`function blah($a, $b) { return $a*$b; }\necho getFunctionCode(\"blah\");`\nis it possible?\nAre there any php self-descriptive functions to reconstruct funct... |
{"title":"Generic Interface","tags":["java","design","interface"],"question_text":"Let's say I wanted to define an interface which represents a call to a remote service. Now, the call to the remote service generally returns something, but might also include input parameters. Suppose that an implementing class will typi... |
{"title":"Zend Framework 2 for a Zend Framework Newbie","tags":["zend-framework","zend-framework2"],"question_text":"I'd like to use ZF2 for an upcoming project. However, I find it really hard to understand the few tutorials that I've found out there. Most of them just tell you to put stuff in files without really expl... |
{"title":"MySQL Illegal mix of collations","tags":["mysql","symfony2","collation","symfony-2.1","fosuserbundle"],"question_text":"After viewing my prod logs, I have some error mentionning :\n`[2012-08-31 15:56:43] request.CRITICAL: Doctrine\\DBAL\\DBALException: \nAn exception occurred while executing 'SELECT t0.userna... |
{"title":"hashCode in case classes in Scala","tags":["scala","hashcode","case-class"],"question_text":"I've read that Scala'a\n`case class`\nconstruct automatically generates a fitting\n`equals`\nand\n`hashCode`\nimplementation. What does exactly the generated code look like?","answer_text":"As my professor used to say... |
{"title":"What's the advantage of a Java enum versus a class with public static final fields?","tags":["java","enums"],"question_text":"I am very familiar with C# but starting to work more in Java. I expected to learn that enums in Java were basically equivalent to those in C# but apparently this is not the case. Initi... |
{"title":"UITextField format in xx-xx-xxx","tags":["iphone","objective-c","ios","uitextfield"],"question_text":"I am using UITextField and i want that should take character in the format of xx-xx-xxx only numbers.\nany help ?","answer_text":"Had a need to do this nicely for a phone numbers with a variable format, here'... |
{"title":"Remove tab bar item text, show only image","tags":["ios","swift","uitabbaritem"],"question_text":"Simple question, how can I remove the tab bar item text and show only the image?\nI want the bar items to like in the instagram app:\nIn the inspector in xcode 6 I remove the title and choose a @2x (50px) and a @... |
{"title":"Getting only ID from entity relations without fetching whole object in Doctrine","tags":["symfony2","doctrine2"],"question_text":"Assume I've an entity, which references itself to map parent-child-relations\n`class Food\n{\n \/**\n * @ORM\\Id\n * @ORM\\Column(type=\"integer\")\n * @ORM\\GeneratedValue(strateg... |
{"title":"What's the best way to tell if a Python program has anything to read from stdin?","tags":["python"],"question_text":"I want a program to do one thing if executed like this:\n`cat something | my_program.py`\nand do another thing if run like this\n`my_program.py`\nBut if I read from stdin, then it will wait for... |
{"title":"Can I Install Laravel without using Composer?","tags":["php","laravel","composer-php","laravel-4"],"question_text":"I'd like to know if I can install or use the\nLaravel\nPHP framework on any webserver without using\nComposer\n(PHP package\/dependency manager) every time?\nI am learning PHP and frameworks and... |
{"title":"Static Binding and Dynamic Binding","tags":["java","oop","polymorphism","dynamic-binding"],"question_text":"I am really confused about dynamic binding,static binding. I have read that determining the type of object at compile time is called static binding and determining at runtime is called dynamic binding\n... |
{"title":"Read from initial stdin in GO?","tags":["go"],"question_text":"I would like to read from the original stdin of a go program. For example, if I did\n`echo test stdin | go run test.go`\n, I would want to have access to \"test stdin\". I've tried reading from\n`os.Stdin`\n, but if there's nothing in it, then it ... |
{"title":"Performance comparison of Thrift, Protocol Buffers, JSON, EJB, other?","tags":["java","python","performance","protocol-buffers","thrift"],"question_text":"We're looking into transport\/protocol solutions and were about to do various performance tests, so I thought I'd check with the community if they've alrea... |
{"title":"Class App\/Http\/Controllers\/View Not Found error","tags":["laravel-5"],"question_text":"I am new to laravel 5 and currently stumped by this error:\n`FatalErrorException in TicketController.php line 18: Class 'App\\Http\\Controllers\\View' not found`\nWeird thing is the view does in fact exist, i checked to ... |
{"title":"Ember.js: how to save a model","tags":["model","save","ember.js","ember-data"],"question_text":"From the ember docs its clear you should be able to save a dirty model\n`var m = App.MyModel.find(10) ;\n...\nm.set(\"firstName\", \"John\") ;\nm.get(\"isDirty\") ; \/\/ --> true`\nNow, I don't know how to save, th... |
{"title":"MySQL JOIN the most recent row only?","tags":["sql","mysql"],"question_text":"I have a table customer that stores a customer_id, email and reference. There is an additional table customer_data that stores a historical record of the changes made to the customer, i.e. when there's a change made a new row is ins... |
{"title":"Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...?","tags":["php","fatal-error","classnotfoundexception"],"question_text":"Why I'm getting this PHP error?\n`Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...`","answer_text":"The\nPHPUnit documentation\nsays\nused to say to in... |
{"title":"Completely remove a file from whole git repository","tags":["git","github","git-commit"],"question_text":"Using git for a project, I accidentally added to a commit a big\n`.zip`\nfile. I didn't notice until I started uploading it to github. When I noticed, I hit\n`ctrl-c`\n,\n`git remove`\n,\n`git commit`\nan... |
{"title":"Generating an action URL in JavaScript for ASP.NET MVC","tags":["asp.net","javascript","asp.net-mvc"],"question_text":"I'm trying to redirect to another page by calling an action in controller with a specific parameter. I'm trying to use this line:\n`window.open('<%= Url.Action(\"Report\", \"Survey\",\n new {... |
{"title":"How to modify STYLE attribute of element with known ID using JQuery","tags":["jquery","html","css"],"question_text":"I got 3 buttons-links triggering some javascript code, with indication if certain button is selected, selected button got style attribute set to\n\"btn brown selected\"\nwhile other buttons got... |
{"title":"What does it mean to do\/determine something \"programmatically\"?","tags":["computer-science","terminology"],"question_text":"Programmatically. (alt. programmically)\nI've never used it, but I see it in questions a lot, i.e. \"How to programmatically determine [insert task here]\". Firefox immediately tells ... |
{"title":"How can I iterate over ManyToManyField?","tags":["python","database","django","orm","model"],"question_text":"A simple question and yet I can't find an answer for it.\nI have a model with a ManyToMany field:\n`class Stuff(models.Model):\n things = models.ManyToManyField(Thing)`\nthen in a different function I... |
{"title":"(PartialView) The model item passed into the dictionary is of type 'Customer', but this dictionary requires a model item of type 'UserProfile'","tags":["c#","asp.net-mvc","razor","partial-views","helper"],"question_text":"`@model Customer\n@Html.Partial(\"_UserProfile\", (UserProfile)Model.UserProfile)`\nWhen... |
{"title":"Evaluate a string with a switch in C++","tags":["c++"],"question_text":"I want to evaluate a string with a switch but when I read the string entered by the user throws me the following error.\n`#include<iostream>\nusing namespace std;\n int main() {\n string a;\n cin>>a;\n switch (string(a)) {\n case \"Option... |
{"title":"Empty directory (delete all files)","tags":["ruby"],"question_text":"What would be a safe and efficient way to delete all files in a directory in pure Ruby? I wrote\n`Dir.foreach(dir_path) {|f| File.delete(f) if f != '.' && f != '..'}`\nbut it gives me a\n`No such file or directory`\nerror.\nThank you.","answ... |
{"title":"Parse Date string in Ruby","tags":["ruby","ruby-1.8"],"question_text":"I have a String\n`20120119`\nwhich represents a date in the format\n`'YYYYMMDD'`\n.\nI want to parse this string into a Ruby object that represents a Date so that I can do some basic date calculation, such as diff against today's date.\nI ... |
{"title":"How do you drop a default value or similar constraint in T-SQL?","tags":["sql","tsql","constraints","default"],"question_text":"I know the syntax:\n`ALTER TABLE [TheTable] DROP CONSTRAINT [TheDefaultConstraint]`\nbut how to I drop the default constraint when I don't know its name? (That is, it was autogenerat... |
{"title":"Service provider responded in error: 301 (Moved Permanently) - Twitter API 1.1","tags":["twitter","twitter4j"],"question_text":"I get this error when trying to connect to Twitter? Why?\n`02-18 16:40:33.270: W\/System.err(7167): oauth.signpost.exception.OAuthCommunicationException: Communication with the servi... |
{"title":"jenkins GIT Plugin detached HEAD","tags":["git","jenkins"],"question_text":"I am new on GIT and well also on Jenkins. My problem is to bring the jenkins Maven release plugin to work.\nWhen i build a common Maven build with jenkins, it works well, but when i try to perform a release with the Maven release Plug... |
{"title":"Is there any advantage to using pow(x,2) instead of x*x, with x double?","tags":["c++","math","floating-point"],"question_text":"is there any advantage to using this code\n`double x;\ndouble square = pow(x,2);`\ninstead of this?\n`double x;\ndouble square = x*x;`\nI prefer x*x and looking at my implementation... |
{"title":"How do I download a file using Perl?","tags":["perl","download"],"question_text":"I'm running perl on windows XP and I need to download a file from the following URL.\nhttp:\/\/marinetraffic2.aegean.gr\/ais\/getkml.aspx\nAny ideas on how I should do this? I have attempted using WWW::Mechanize but I can't get ... |
{"title":"SwipeRefreshLayout behind ActionBar","tags":["android","swiperefreshlayout"],"question_text":"When using a SwipeRefreshLayout in combination with a overlay mode ActionBar, the loading animation will be displayed behind the actionbar, making it almost invisible.\nIs there anything I can do to show it on top of... |
{"title":"File IO inside CasperJS","tags":["javascript","node.js","casperjs"],"question_text":"Is it possible do read\/write files inside a CasperJS Script ?\n`var fs = require('fs');\nvar data = fs.readFileSync('testdata.data', 'utf-8');\nconsole.log(data);`\nCalling\n`casperjs fileio.js`\nreturns:\n`'undefined' is no... |
{"title":"How to split CSV files as per number of rows specified?","tags":["linux","unix","csv","split"],"question_text":"I've CSV file (around 10,000 rows ; each row having 300 columns) stored on LINUX server. \nI want to break this CSV file into 500 CSV files of 20 records each. (Each having same CSV header as presen... |
{"title":"How to declare a two dimensional array most easily in PHP?","tags":["php","arrays"],"question_text":"Like :\n`declare int d[0..m, 0..n]`","answer_text":"The following are equivalent and result in a two dimensional array:\n`$array = array(\n array(0, 1, 2),\n array(3, 4, 5),\n);`\nor\n`$array = array();\n$arra... |
{"title":"In Objective-C why should I check if self = [super init] is not nil?","tags":["objective-c",null,"init"],"question_text":"I have a general question about writing init methods in Objective-C.\nI see it everywhere (Apple's code, books, open source code, etc.) that an init method should check if self = [super in... |
{"title":"Environment Variable with Maven","tags":["java","maven","environment-variables"],"question_text":"I've ported a project from Eclipse to Maven and I need to set an environment variable to make my project work.\nIn Eclipse, I go to \"Run -> Run configurations\" and, under the tab \"environment\", I set \"WSNSHE... |
{"title":"Are Spring objects thread safe?","tags":["spring"],"question_text":"Are Spring objects thread safe and how do make them thread safe?","answer_text":"These are two unrelated questions:\nAre Spring Beans Thread Safe?\nNo.\nSpring has different bean\nscopes\n(e.g. Prototype, Singleton, etc.) but all these scopes... |
{"title":"How can I set my Cygwin PATH to find javac?","tags":["java","path","cygwin","javac"],"question_text":"I have a Windows 7 system on which I have installed the latest Java compiler. I also have the latest Cygwin. I want to use the Java compiler from Cygwin's shell. I edited the PATH variable in Cygwin as follow... |
{"title":"Proper way to declare multiple vars in PHP","tags":["php","variables"],"question_text":"I've been coding personal scripts for years in PHP and get used to turn off Error display. I'm about to release some of these scripts and would like to do it the proper way.\nThe only reason why I turn off error display is... |
{"title":"unable to call bootstrap modal window using javascript in chrome (works in firefox)","tags":["jquery","twitter-bootstrap","modal-dialog"],"question_text":"I have included the sample code from twitter-bootstrap for a modal window. If I click on the button it opens up the modal window. However if I try to show ... |
{"title":"SharedPreferences file","tags":["android"],"question_text":"Does somebody knows where the file with the actual stored SharedPreferences is located?","answer_text":"Yes I know.\n`\/data\/data\/com.your.package\/shared_prefs\/com.your.package_preferences.xml`\nSo you get there by running in console:\n`# adb she... |
{"title":"Get the class name of ES6 class instance","tags":["javascript","ecmascript-6","traceur"],"question_text":"Are there any 'harmonious' ways to get the class name from ES6 class instance? Other than\n`someClassInstance.constructor.name`\nCurrently I'm counting on Traceur implementation. And it seems that Babel h... |
{"title":"findFragmentByTag() returns null after perform a FragmentTransaction using replace() method","tags":["android","android-fragments","fragmenttransaction"],"question_text":"My Android app consists three\nfragments: A, B and C\n. They're loaded in the two containers defined in the\n`MainActivity`\nlayout.\nWhen ... |
{"title":"Cannot use string offset as an array in php","tags":["php"],"question_text":"I'm trying to simulate this error with a sample php code but haven't been successful. Any help would be great.\n\"Cannot use string offset as an array\"","answer_text":"For PHP4\n...this reproduced the error:\n`$foo = 'bar';\n$foo[0]... |
{"title":"In Scala, how to get a slice of a list from nth element to the end of the list without knowing the length?","tags":["scala"],"question_text":"I'm looking for an elegant way to get a slice of a list from element n onwards without having to specify the length of the list. Lets say we have a multiline string whi... |
{"title":"Sysinternals' Portmon: Error 2","tags":["serial-port"],"question_text":"When I try to connect to local ports,\nComputer -> Connect local\n, using\nPortmon\nv. 3.02, I'm getting an error message,\nError 2\n, in a small error dialog box:\nI run the tool as an administrator (if not, I get error 6).\nBy the way t... |
{"title":"Video\/audio streaming does not stop even if UIWebView is closed - iPad","tags":["uiwebview","video-streaming","ipad"],"question_text":"I see this issue only on the iPad. The same things works as expected on the iPhone.\nI am opening the URL from my application in a UIWebView. If the URL is a normal web page,... |
{"title":"MVC Razor String Concat","tags":["asp.net-mvc","string","razor"],"question_text":"I am using Razor to generate a form. I want to create HTML elements based on some value from it's model property.\nfor example, if a model contains Id property, and I want to generate html tags as follows\n`<input type=\"hidden\... |
{"title":"Format a date using the new date time API","tags":["java","datetime","java-8","java-time"],"question_text":"I was playing with the new date time API but when running this:\n`public class Test { \n public static void main(String[] args){\n String dateFormatted = LocalDate.now()\n .format(DateTimeFormatter\n .o... |
{"title":"Mapping a range of values to another","tags":["python","algorithm"],"question_text":"I am looking for ideas on how to translate one range values to another in Python. I am working on hardware project and am reading data from a sensor that can return a range of values, I am then using that data to drive an act... |
{"title":"get the value of DisplayName attribute","tags":["c#"],"question_text":"`public class Class1\n{\n [DisplayName(\"Something To Name\")]\n public virtual string Name { get; set; }\n}`\nHow to get the value of DisplayName attribute in C# ?","answer_text":"Try these utility methods of mine:\n`using System.Componen... |
{"title":"Python lookup hostname from IP with 1 second timeout","tags":["python","dns","hostname","nameservers"],"question_text":"How can I look up a hostname given an IP address? Furthermore, how can I specify a timeout in case no such reverse DNS entry exists? Trying to keep things as fast as possible. Or is there a ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.