text stringlengths 74 309k |
|---|
{"title":"Is there a list of Brew's installable packages?","tags":["osx","list","install","packages","homebrew"],"question_text":"Recently I installed\nBrew\n. I was wondering if there is a way to search for packages or view a list of available packages somewhere in the web.","answer_text":"`brew help`\nwill show you t... |
{"title":"How to get the ActionBar height?","tags":["android","android-actionbar"],"question_text":"I am trying to get the height of the\n`ActionBar`\n(using Sherlock) every time an activity is created (specially to handle configuration changes on rotation where the ActionBar height might change).\nFor this I use the m... |
{"title":"Adding an identity to an existing column","tags":["sql","sql-server","alter-table","identity-column"],"question_text":"I need to change the primary key of a table to an identity column, and there's already a number of rows in table.\nI've got a script to clean up the IDs to ensure they're sequential starting ... |
{"title":"How do you install ssh-copy-id on a Mac?","tags":["osx","ssh","homebrew","ssh-keys"],"question_text":"I am having trouble trying to install ssh-copy-id on my Mac. I have tried to follow\nhttps:\/\/github.com\/beautifulcode\/ssh-copy-id-for-OSX\nbut every time I run ssh-copy-id it gives me errors. Any ideas on... |
{"title":"Setting Corner Radius on UIImageView not working","tags":["iphone","ios","uiimageview","rounded-corners"],"question_text":"I'm at a bit of a loss. I've used the layer property of UIView to round the corners of multiple elements in my app. However, this one UIImageView is simply not complying. Not sure what I ... |
{"title":"Android: How do I prevent the soft keyboard from pushing my view up?","tags":["android","layout","keyboard","view"],"question_text":"I have a vertical sliding drawer at the bottom of my app. When the soft keyboard opens, it pushes the tab for the drawer up, so it sits atop the keyboard. I actually want it to ... |
{"title":"Pad a string with leading zeros so it's 3 characters long in SQL Server 2008","tags":["sql","sql-server","tsql"],"question_text":"I have a string that is up to 3 characters long when it's first created in SQL Server 2008 R2.\nI would like to pad it with leading zeros, so if its original value was '1' then the... |
{"title":"Problem with converting int to string in Linq to entities","tags":["c#","asp.net","linq-to-entities","tostring"],"question_text":"`var items = from c in contacts\n select new ListItem\n {\n Value = c.ContactId, \/\/Cannot implicitly convert type 'int' (ContactId) to 'string' (Value).\n Text = c.Name\n };\nvar... |
{"title":"ASP.NET MVC 3 - Partial vs Display Template vs Editor Template","tags":["asp.net-mvc","asp.net-mvc-3","razor","asp.net-mvc-partialview","editortemplates"],"question_text":"So, the title should speak for itself.\nTo create re-usable components in ASP.NET MVC, we have 3 options (could be others i haven't mentio... |
{"title":"Responsive website zoomed out to full width on mobile","tags":["twitter-bootstrap","twitter-bootstrap-3","responsive-design"],"question_text":"I am testing out Bootstrap 3 responsiveness navbar and I have a\ndemo\nwebsite. When I resize the browser on a desktop, it all works fine including the nav bar which b... |
{"title":"PHP Fatal error: Cannot redeclare class","tags":["php"],"question_text":"Does anyone know what can cause this problem?\n`PHP Fatal error: Cannot redeclare class`","answer_text":"You have a class of the same name declared more than once. Maybe via multiple includes. When including other files you need to use s... |
{"title":"How to get a user's client IP address in ASP.NET?","tags":["c#","asp.net","client","ip-address"],"question_text":"We have\n`Request.UserHostAddress`\nto get the IP address in ASP.NET, but this is usually the user's ISP's IP address, not exactly the user's machine IP address who for example clicked a link. How... |
{"title":"What does the ^ operator do in Java?","tags":["java","operators","exponentiation"],"question_text":"What function does the\n`^`\n(caret) operator serve in Java?\nWhen I try this:\n`int a = 5^n;`\n...it gives me:\nfor n = 5, returns 0\nfor n = 4, returns 1\nfor n = 6, returns 3\n...so I guess it doesn't perfor... |
{"title":"Twitter bootstrap modal-backdrop doesn't disappear","tags":["twitter-bootstrap","modal-dialog"],"question_text":"I am using the Twitter bootstrap Modal dialog. When I click on the submit button of the bootstrap modal dialog, it sends an AJAX request. My problem is that the modal-backdrop doesn't disappear. Th... |
{"title":"How to echo \"2\" (no quotes) to a file, from a batch script?","tags":["windows","batch-file"],"question_text":"How do I echo the number\n2\ninto a file, from a batch script?\nThis doesn't work:\n`Echo 2>> file.txt`\nbecause\n`2>>`\nis a special command. :(","answer_text":"Little-known feature: The redirectio... |
{"title":"Spring 3.0 - Unable to locate Spring NamespaceHandler for XML schema namespace [http:\/\/www.springframework.org\/schema\/security]","tags":["java","spring","maven-2","spring-security"],"question_text":"Any ideas what could be the cause of this?\nUnable to locate Spring\n NamespaceHandler for XML schema\n nam... |
{"title":"What are good grep tools for Windows?","tags":["windows","grep"],"question_text":"Any recommendations on\ngrep\ntools for Windows? Ideally ones that could leverage 64-bit OS.\nI'm aware of\nCygwin\n, of course, and have also found\nPowerGREP\n, but I'm wondering if there are any hidden gems out there?","answe... |
{"title":"java : convert float to String and String to float","tags":["java","string","types","number-formatting","data-type-conversion"],"question_text":"How could I convert from float to string or string to float?\nIn my case I need to make the assertion between 2 values string (value that I have got from table) and ... |
{"title":"Android studio Gradle icon error, Manifest Merger","tags":["android","gradle","android-studio"],"question_text":"I keep seeing this message and not sure how to solve it for good.\n`Error:(43, 9) Attribute application@icon value=(@drawable\/new_app_icon) from AndroidManifest.xml:43:9\n is also present at com.g... |
{"title":"CSS file not opening in Visual Studio 2010 SP1?","tags":["visual-studio-2010","visual-studio","visual-studio-2010-sp1"],"question_text":"I am unable to open CSS files in Visual Studio 2010 after adding to a project.\nIt shows the following error:\nThe operation could not be completed.Unspecified error.\nEven ... |
{"title":"How to use MySQL DECIMAL?","tags":["mysql"],"question_text":"I can't quite get a grasp of MySQL's DECIMAL. I need the row to be able to contain a number anywhere from 00.0001 to 99.9999. How would I structure it to work like so?","answer_text":"DOUBLE columns are\nnot\nthe same as DECIMAL columns, and you\nwi... |
{"title":".NET - Get protocol, host, and port","tags":[".net","asp.net","url","uri","authority"],"question_text":"Is there a simple way in\n.NET\nto quickly get the current protocol, host, and port? For example, if I'm on the following URL:\n`http:\/\/www.mywebsite.com:80\/pages\/page1.aspx`\nI need to return:\n`http:\... |
{"title":"How to create a Custom Dialog box in android?","tags":["android","android-dialogfragment","android-dialog"],"question_text":"I want to create a custom dialog box like below\nI have tried the following things.\nI created a subclass of\nAlertDialog.Builder\nand used a custom Title and Custom Content View and us... |
{"title":"Email Address Validation in Android on EditText","tags":["android","android-edittext","email-validation"],"question_text":"How can we perform\n`Email Validation`\non\n`edittext`\nin\n`android`\n? I have gone through google & SO but I didn't find out a simple way to validate it.","answer_text":"`public final s... |
{"title":"Guid is all 0's (zeros)?","tags":["c#",".net","wcf","web-services","guid"],"question_text":"I'm testing out some WCF services that send objects with Guids back and forth. In my web app test code, I'm doing the following:\n`var responseObject = proxy.CallService(new RequestObject\n{\n Data = \"misc. data\",\n ... |
{"title":"MySQL: selecting rows where a column is null","tags":["mysql",null],"question_text":"I'm having a problem where when I try to select the rows that have a NULL for a certain column, it returns an empty set. However, when I look at the table in phpMyAdmin, it says null for most of the rows.\nMy query looks some... |
{"title":"'Operation is not valid due to the current state of the object' error during postback","tags":["asp.net"],"question_text":"I had an aspx page which was working well, but suddenly I am getting the error \"Operation is not valid due to the current state of the object.\" whenever a postback is done.\nThe stack t... |
{"title":"NSInvocation for Dummies?","tags":["objective-c","cocoa","undo-redo"],"question_text":"How exactly does\n`NSInvocation`\nwork? Is there a good introduction?\nI\u00e2\u0080\u0099m specifically having issues understanding how the following code (from\nCocoa Programming for Mac OS X, 3rd Edition\n) works, but th... |
{"title":"Nexus 7 not visible over USB via \"adb devices\" from Windows 7 x64","tags":["android","sideloading"],"question_text":"I have done the obvious -- the USB driver was installed from the latest Android SDK, and USB debugging was turned on in the tablet.\nWhen the\nNexus\u00a07\nis connected, the device shows up ... |
{"title":"How to set the java.library.path from Eclipse","tags":["java","eclipse","configuration","buildpath"],"question_text":"How can I set the java.library.path for a whole Eclipse Project? I'm using a Java library that relies on OS specific files and need to find a .dll\/.so\/.jnilib. But the Application always exi... |
{"title":"Find all occurrences of a substring in Python","tags":["python","regex","string"],"question_text":"Python has\n`string.find()`\nand\n`string.rfind()`\nto get the index of a substring in string.\nI wonder, maybe there is something like\n`string.find_all()`\nwhich can return all founded indexes (not only first ... |
{"title":"Javascript by reference vs. by value","tags":["javascript","reference","pass-by-reference","pass-by-value"],"question_text":"I'm looking for some good comprehensive reading material on when Javascript passes something by value and when by reference and when modifying a passed item affects the value outside a ... |
{"title":"Why does the MongoDB Java driver use a random number generator in a conditional?","tags":["java","mongodb","obfuscation"],"question_text":"I saw the following code in\nthis commit\nfor\nMongoDB's Java Connection driver\n, and it appears at first to be a joke of some sort. What does the following code do?\n`if... |
{"title":"How can I find the method that called the current method?","tags":["c#",".net","reflection","logging","stack-trace"],"question_text":"When logging in C#, how can I learn the name of the method that called the current method? I know all about\n`System.Reflection.MethodBase.GetCurrentMethod()`\n, but I want to ... |
{"title":"How to set the JDK Netbeans runs on?","tags":["java","netbeans"],"question_text":"I have older NB6.7, NB6.9, NB7.0, which used to run on jdk1.6.0_21 and jdk1.6.0_25. Now I've removed those JDKs and only have jdk1.6.0_26 and jdk1.7.0 left, but I still want to keep the older NBs, but now when I run them, I get ... |
{"title":"Unusual shape of a textarea?","tags":["javascript","jquery","html","css"],"question_text":"Usually textareas are rectangular or square, like this:\nBut I want a custom-shaped textarea, like this, for example:\nHow is this possible?","answer_text":"Introduction\nFirst, there are many solutions, proposed in oth... |
{"title":"How can I split a comma delimited string into an array in PHP?","tags":["php","arrays","string"],"question_text":"I need to split my string input into an array at the commas.\nHow can I go about accomplishing this?\nInput:\n`9,admin@example.com,8`","answer_text":"Try\nexplode\n:\n`$myString = \"9,admin@exampl... |
{"title":"my eclipse ADB server didn't ACK, failed to start daemon","tags":["android","eclipse","adb"],"question_text":"After updating the SDK, my eclipse shows this error:\nADB server didn't ACK, failed to start daemon.\nWhen I run an android application, it gives me the following:\nPlease ensure that adb is correctly... |
{"title":"How to make an image center (vertically & horizontally) inside a bigger div","tags":["html","css"],"question_text":"I have a div 200 x 200 px. I want to place a 50 x 50 px image right in the middle of the div.\nHow can it be done?\nI am able to get it centered horizontally by using\n`text-align: center`\nfor ... |
{"title":"How to speed up insertion performance in PostgreSQL","tags":["sql","postgresql","bulkinsert","sql-insert"],"question_text":"I am testing Postgres insertion performance. I have a table with one column with number as its data type. There is an index on it as well. I filled the database up using this query:\n`in... |
{"title":"Embedding Base64 Images","tags":["html","base64","browser"],"question_text":"Purely out of curiosity, what browsers does Base64 image embedding work in? What I'm referring to is\nthis\n.\nI realize it's not usually a good solution for most things, as it increases the page size quite a bit - I'm just curious.\... |
{"title":"Rounding Number to 2 Decimal Places in C","tags":["c","floating-point","decimal"],"question_text":"How can I round a float (such as 37.777779) to two decimal places (37.78) in C?","answer_text":"If you just want to round the number for output purposes, then the\n`\"%.2f\"`\nformat string is indeed the correct... |
{"title":"Restoring Nuget References?","tags":["visual-studio-2012","nuget"],"question_text":"I have solution & project in Visual Studio 2012.\nThe project has a file\n`packages.config`\nin the root of the project.\nFor the purposes of this question, lets assume I accidentally removed these libraries from the\n`Referen... |
{"title":"Getting activity from context in android","tags":["android","android-layout","android-activity","view","hierarchy"],"question_text":"This one has me stumped.\nI need to call an activity method from within a custom layout class. The problem with this is that I don't know how to access the activity from within ... |
{"title":"Tracking the script execution time in PHP","tags":["php","performance"],"question_text":"PHP must track the amount of CPU time a particular script has used in order to enforce the max_execution_time limit.\nIs there a way to get access to this inside of the script? I'd like to include some logging with my tes... |
{"title":"Convert char to int in C and C++","tags":["c++","c","gcc"],"question_text":"How do I convert a\n`char`\nto an\n`int`\nin C and C++?","answer_text":"Depends on what you want to do:\nto read the value as an ascii code, you can write\n`char a = 'a';\nint ia = (int)a; \n\/* note that the int cast is not necessary... |
{"title":"Eclipse menus don't show up after upgrading to Ubuntu 13.10","tags":["eclipse","ubuntu"],"question_text":"After upgrading to Ubuntu 13.10, when I click on any menus in Eclipse (Help, Window, Run) they don\u00e2\u0080\u0099t show up. Only menu stubs and selection are visible.\nI tried installing fresh 4.3 and ... |
{"title":"Service Reference Error: Failed to generate code for the service reference","tags":["c#",".net","visual-studio-2010","web-services","service-reference"],"question_text":"I have a Windows Service Solution and am trying to add a service reference to a Hermes(Opensource ebms message server) Web Service in VS2010... |
{"title":"Nullable types and the ternary operator: why is `? 10 : null` forbidden?","tags":["c#",".net","nullable","conditional-operator"],"question_text":"I just came across a weird error:\n`private bool GetBoolValue()\n{\n \/\/Do some logic and return true or false\n}`\nThen, in another method, something like this:\n... |
{"title":"When should I use nil and NULL in Objective-C?","tags":["objective-c",null,"nsnull"],"question_text":"This is sample code:\n`NSDictionary *myDictionary = [NSDictionary dictionary];\nNSNumber *myNumber = [myDictionary valueForKey: @\"MyNumber\"];\nNSLog(@\"myNumber = %@\", myNumber); \/\/ output myNumber = (nu... |
{"title":"passport.js RESTful auth","tags":["node.js","rest","authentication","restify","passport.js"],"question_text":"How does one handle authentication (local and Facebook, for example) using passport.js, through a RESTful API instead of through a web interface?\nSpecific concerns are handling the passing of data fr... |
{"title":"Is there a way to use PhantomJS in Python?","tags":["python","phantomjs"],"question_text":"I want to use\nPhantomJS\nin\nPython\n. I googled this problem but couldn't find proper solutions.\nI find\n`os.popen()`\nmay be a good choice. But I couldn't pass some arguments to it.\nUsing\n`subprocess.Popen()`\nmay... |
{"title":"How can I undo a `git commit` locally and on a remote after `git push`","tags":["git","git-push","git-commit"],"question_text":"I have performed\n`git commit`\nfollowed by a\n`git push`\n. How can I revert that change on both local and remote repositories?\n`$ git log\ncommit 364705c23011b0fc6a7ca2d80c86cef4a... |
{"title":"jQuery Uncaught TypeError: Property '$' of object [object Window] is not a function","tags":["jquery"],"question_text":"All,\nI downloaded a prebundled JS\/CSS form application and I'm trying to use it in Wordpress. I've got the following code:\n`$(document).ready(function () {\n\/*---------------------------... |
{"title":"Logging with Retrofit 2","tags":["java","retrofit","retrofit2","okhttp3"],"question_text":"I'm trying to get the exact JSON that is being sent in the request. Here is my code:\n`OkHttpClient client = new OkHttpClient();\nclient.interceptors().add(new Interceptor(){\n @Override public com.squareup.okhttp.Respo... |
{"title":"What is the difference between == and Equals() for primitives in C#?","tags":["c#","compare"],"question_text":"Consider this code:\n`int age = 25;\nshort newAge = 25;\nConsole.WriteLine(age == newAge);\u00c2\u00a0\u00c2\u00a0\/\/true\nConsole.WriteLine(newAge.Equals(age));\u00c2\u00a0\/\/false\nConsole.ReadLi... |
{"title":"What is the best method to merge two PHP objects?","tags":["php","oop","object"],"question_text":"We have two PHP5 objects and would like to merge the content of one into the second. There are no notion of subclasses between them so the solutions described in the following topic cannot apply.\nHow do you copy... |
{"title":"How to enter a multi-line command?","tags":["powershell","multiline"],"question_text":"Is it possible to split a Powershell command line over multiple lines?\nIn Visual Basic I can use the underscore (\n`_`\n) to continue the command in the next line.","answer_text":"You can use the grave accent (or backtick)... |
{"title":"Read only file system on Android","tags":["android"],"question_text":"I recently rooted my Droid X and everything seems to be working perfectly. I made some changes to\n`build.prop`\nand when I do\n`adb push build.prop \/system\/`\nI get the following error:\n`failed to copy 'c:\\build.prop' to '\/system\/\/b... |
{"title":"C# getting file names without extensions","tags":["c#"],"question_text":"When getting file names in a certain folder:\n`DirectoryInfo di = new DirectoryInfo(currentDirName);\nFileInfo[] smFiles = di.GetFiles(\"*.txt\");\n foreach (FileInfo fi in smFiles)\n {\n builder.Append(fi.Name);\n builder.Append(\", \")... |
{"title":"How to handle checkboxes in ASP.NET MVC forms?","tags":["asp.net-mvc","forms","checkbox"],"question_text":"Caution: This question is over five years old!\nYour best option is to search for newer questions, or to search the answers below looking for your specific version of MVC, as many answers here are obsole... |
{"title":"What does the Visual Studio \"Any CPU\" target mean?","tags":[".net","visual-studio-2008","build","64bit"],"question_text":"I have some confusion related to the .NET platform build options in Visual Studio 2008.\nWhat is the \"Any CPU\" compilation target, and what sort of files does it generate? I examined t... |
{"title":"Spring Boot - how to configure port","tags":["spring","tomcat","configuration","port","spring-boot"],"question_text":"Looking for way how to configure port in Spring boot app:\n`@Controller\n@EnableAutoConfiguration\npublic class SampleController {\n @RequestMapping(\"\/\")\n @ResponseBody\n String home() {\n... |
{"title":"select2 - hiding the search box","tags":["jquery","jquery-select2"],"question_text":"For my more significant selects, the search box in Select2 is wonderful. However, in one instance, I have a simple select of 4 hard-coded choices. In this case, the search box is superfluous and looks a little silly being pre... |
{"title":"How to get IP address of the device?","tags":["android","ip-address"],"question_text":"Is it possible to get the IP address of the device using some code?","answer_text":"This is my helper util to read IP and MAC addresses. Implementation is pure-java, but I have a comment block in\n`getMACAddress()`\nwhich c... |
{"title":"How to generate all permutations of a list in Python","tags":["python","algorithm","permutation","combinatorics","python-2.5"],"question_text":"How do you generate all the permutations of a list in Python, independently of the type of elements in that list?\nFor example:\n`permutations([])\n[]\npermutations([... |
{"title":"What is a CSRF token ? What is its importance and how does it work?","tags":["django","csrf"],"question_text":"Okay guys, I am writing a Django application and I just want an idea of what actually a csrf token is and how it protects the data. Is the post data not safe if you do not use csrf tokens?\nI know ho... |
{"title":"Type List vs type ArrayList in Java","tags":["java","list","interface"],"question_text":"`(1) List<?> myList = new ArrayList<?>();\n(2) ArrayList<?> myList = new ArrayList<?>();`\nI understand that with (1), implementations of the List interface can be swapped. It seems that (1) is typically used in an applic... |
{"title":"How to prevent text in a table cell from wrapping","tags":["html","css"],"question_text":"Does anyone know how I can prevent the text in a table cell from wrapping? This is for the header of a table, and the heading is a lot longer than the data under it, but I need it to display on only one line. It is okay ... |
{"title":"Why is VS 2013 very slow?","tags":["visual-studio","visual-studio-2013"],"question_text":"I'm running Visual Studio 2013 Pro (RTM version) on my formated PC (Windows 8.1 fresh install).\nI don't know why but Visual Studio 2013 Pro is very very slow! Slow for building, debugging, navigating in the IDE... my HD... |
{"title":"How to clear the Cache in NetBeans","tags":["netbeans","ide","netbeans-7","netbeans-8"],"question_text":"I created a project in Netbeans and I would like to clear the netbeans Cache.\nI'm running\n`NetBeans 7.0.1`\non a\n`Windows 7`\nmachine.\nHow do I do this?","answer_text":"For NetBeans 7.2 and newer the c... |
{"title":"Difference between div id versus div class","tags":["css","class","html"],"question_text":"What's the difference between\n`<div class=\"\">`\nand\n`<div id=\"\">`\nwhen it comes to CSS? Is it right to use\n`<div id=\"\">`\n?\nI see different developers doing this in both ways, and since I'm self taught, I've ... |
{"title":"How do I change the text of a span element in JavaScript","tags":["javascript","html"],"question_text":"If I have a span, say:\n`<span id=\"myspan\"> hereismytext <\/span>`\nHow do I use JavaScript to change \"hereismytext\" to \"newtext\"?","answer_text":"`document.getElementById(\"myspan\").innerHTML=\"newt... |
{"title":"check if a std::vector contains a certain object?","tags":["c++","vector"],"question_text":"Possible Duplicate:\nHow to find an item in a std::vector?\nIs there something in algorithm.h which allows you to check if a std:: container contains something? Or a way to make one ex:\n`if(a.x == b.x && a.y == b.y)\n... |
{"title":"Check for column name in a SqlDataReader object","tags":["c#",".net","sqldatareader"],"question_text":"How do I check to see if a column exists in a\n`SqlDataReader`\nobject? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored pro... |
{"title":"Can an Android Toast be longer than Toast.LENGTH_LONG?","tags":["android","android-toast"],"question_text":"When using setDuration() for a Toast, is it possible to set a custom length or at least something longer than\n`Toast.LENGTH_LONG`\n?","answer_text":"If you dig deeper in android code, you can find the ... |
{"title":"How to wait in bash for several subprocesses to finish and return exit code !=0 when any subprocess ends with code !=0?","tags":["bash","wait"],"question_text":"How to wait in a bash script for several subprocesses spawned from that script to finish and return exit code !=0 when any of the subprocesses ends w... |
{"title":"Want to find records with no associated records in Rails 3","tags":["ruby-on-rails","arel","meta-where"],"question_text":"Consider a simple association...\n`class Person\n has_many :friends\nend\nclass Friend\n belongs_to :person\nend`\nWhat is the cleanest way to get all persons that have NO friends in ARel ... |
{"title":"Decode HTML entities in Python string?","tags":["python","html","html-entities"],"question_text":"I'm parsing some HTML with Beautiful Soup 3, but it contains HTML entities which Beautiful Soup 3 doesn't automatically decode for me:\n`>>> from BeautifulSoup import BeautifulSoup\n>>> soup = BeautifulSoup(\"<p>... |
{"title":"Standard concise way to copy a file in Java?","tags":["java","file","copy"],"question_text":"It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam. The web is littered with... |
{"title":"jQuery Tips and Tricks","tags":["javascript","jquery","tips-and-tricks","hints-and-tips"],"question_text":"Syntax\nShorthand for the ready-event\nby roosteronacid\nLine breaks and chainability\nby roosteronacid\nNesting filters\nby Nathan Long\nCache a collection and execute commands on the same line\nby roos... |
{"title":"How do I find the width & height of a terminal window?","tags":["terminal"],"question_text":"As a simple example, I want to write a CLI script which can print '=' across the entire width of the terminal window.\n`#!\/usr\/bin\/env php\n<?php\necho str_repeat('=', ???);`\nor\n`#!\/usr\/bin\/env python\nprint '... |
{"title":"Difference between \"@id\/\" and \"@+id\/\" in Android","tags":["android","android-xml"],"question_text":"What is the diffirence between the\n`@id\/`\nand\n`@+id\/`\n?\nIn\n`@+id\/`\nthe plus symbol + instructs to create a new resource name and add in to the\n`R.java`\nfile but what about\n`@id\/`\n? From the... |
{"title":"Keyboard shortcut to comment lines in Sublime Text 2","tags":["sublimetext2"],"question_text":"In\nSublime Text\n2\n, how do I enclose a selection in a\ncomment\n?\nIs there a keyboard shortcut for this action?","answer_text":"By default on Linux\/Windows for an English keyboard the shortcut is\nCtrl\n+\nShif... |
{"title":"How can I get a resource content from a static context?","tags":["java","android","static","const","android-resources"],"question_text":"I want to read strings from an\n`xml`\nfile before I do much of anything else like\n`setText`\non widgets, so how can I do that without an activity object to call\n`getResou... |
{"title":"How to align 3 divs (left\/center\/right) inside another div?","tags":["html","css","alignment"],"question_text":"I want to have 3 divs aligned inside a container div, something like this:\n`[[LEFT] [CENTER] [RIGHT]]`\nContainer div is 100% wide (no set width), and center div should remain in center after res... |
{"title":"Is there a way to make AngularJS load partials in the beginning and not at when needed?","tags":["angularjs"],"question_text":"I have a route setup like this:\n`var myApp = angular.module('myApp', []).\n config(['$routeProvider', function ($routeProvider) {\n $routeProvider.\n when('\/landing', {\n templateUr... |
{"title":"How to get share counts using graph API","tags":["facebook","facebook-graph-api","facebook-like"],"question_text":"I can get the share count of an URL using PHP SDK and using the deprecated rest API, but didn't find a way to get the share counts of an URL using graph API.\nIs there any way to find out?","answ... |
{"title":"How to get the request parameters in symfony2","tags":["php","symfony2","symfony-forms"],"question_text":"I am very new to symfony. In other languages like java and others I can use\n`request.getParameter('parmeter name')`\nto get the value.\nIs there anything similar that we can do with symfony2.\nI have see... |
{"title":"Remove all whitespaces from NSString","tags":["objective-c","string","cocoa","nsstring"],"question_text":"I've been trying to get rid of the white spaces in an\n`NSString`\n, but none of the methods I've tried worked.\nI have\n`\"this is a test\"`\nand I want to get\n`\"thisisatest\"`\n.\nI've used\n`whitespa... |
{"title":"How to disable text selection using jQuery?","tags":["javascript","jquery","jquery-ui"],"question_text":"Does jQuery or jQuery-UI have any functionality to disable text selection for given document elements?","answer_text":"In jQuery 1.8, this can be done as follows:\n`(function($){\n $.fn.disableSelection = ... |
{"title":"How to exclude file only from root folder in Git","tags":["git","gitignore"],"question_text":"I am aware of using\n`.gitignore`\nfile to exclude some files being added, but I have several\n`config.php`\nfiles in source tree and I need to exclude only one, located in the root while other keep under revision co... |
{"title":"const int vs. int const as function parameter in C++ and C","tags":["c++","c","const"],"question_text":"Quick question:\n`int testfunc1 (const int a)\n{\n return a;\n}\nint testfunc2 (int const a)\n{\n return a;\n}`\nAre these two functions the same in every aspect or is there a difference? I'm interested in ... |
{"title":"Eclipse debugger always blocks on ThreadPoolExecutor without any obvious exception, why?","tags":["java","eclipse","debugging","tomcat"],"question_text":"I'm working on my usual projects on Eclipse, it's a J2EE application, made with Spring, Hibernate and so on. I'm using Tomcat 7 for this (no particular reas... |
{"title":"Ruby\/Rails: converting a Date to a UNIX timestamp","tags":["ruby-on-rails","ruby","date","timestamp"],"question_text":"How would I get a UNIX timestamp (number of seconds since 1970 GMT) from a Date object in a Rails app?\nI know\n`Time#to_i`\nreturns a timestamp, but doing\n`Date#to_time`\nand then getting ... |
{"title":"How to set an iframe src attribute from a variable in AngularJS","tags":["javascript","html","angularjs","iframe","angularjs-directive"],"question_text":"I'm trying to set the\n`src`\nattribute of an iframe from a variable and I can't get it to work...\nThe markup:\n`<div class=\"col-xs-12\" ng-controller=\"A... |
{"title":"How can a string be initialized using \" \"?","tags":["java","string"],"question_text":"If String is a class just like any other, how can it be initialized using double quotes?","answer_text":"Java String is Special\nThe designers of Java decided to retain primitive types in an object-oriented language, inste... |
{"title":"Maximum call stack size exceeded error","tags":["javascript","html","webkit","callstack","dwr"],"question_text":"I am using a Direct Web Remoting (DWR) JavaScript library file and am getting an error only in Safari (desktop and iPad)\nIt says \"Maximum call stack size exceeded.\"\nWhat exactly does this error... |
{"title":"Can I stop 100% Width Text Boxes from extending beyond their containers?","tags":["html","css"],"question_text":"Lets say I have a text box that I want to fill a whole line. I would give it a style like this:\n`input.wide {display:block; width: 100%}`\nThis causes problems because the width is based on the co... |
{"title":"Combine paths in Java","tags":["java","path"],"question_text":"Is there a Java equivalent for\n`System.IO.Path.Combine()`\nin C#\/.NET? Or any code to accomplish this?\nThis static method combines one or more strings into a path.","answer_text":"Rather than keeping everything string-based, you should use a cl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.