I would like to print out the number of votes that each choice got. I have this code in a template:
{% for choice in choices %}
{{choice.choice}} - {{votes[choice.id]}} <br />
{% endfor %}..
What is the purpose of using IBOutlets and IBActions in Xcode and Interface Builder?
Does it make any difference if I don't use IBOutlets and IBActions?
Swift:
@IBOutlet weak var textField: UITex..
I am kind of new to mac as well as mongodb.
I have a weird doubt, accessing the database created using mongodb on mac?
I know, in windows there is a folder called c:\data\db, where my database files..
I'm designing my application UI. I need a layout looks like this:
(< and > are Buttons). The problem is, I don't know how to make sure the TextView will fill the remaining space, with two button..
I have created custom exception class
public class Web2PDFException : Exception
{
public Web2PDFException(string message, Exception innerException)
: base(message, innerException) { ... }..
I am working on integrating an ad provider into my app currently. I wish to place a fading message in front of the ad when the ad displays but have been completely unsuccessful.
I made a function whi..
This would be question from c# beginner.
When I create console application I get Main method with parameter args as array string.
I do not understand how this method is called by system and how args ..
How do I achieve the dynamic equivalent of this static array initialisation:
char c[2] = {}; // Sets all members to '\0';
In other words, create a dynamic array with all values initialised to the ..
I'm after a table sorting solution (in JavaScript) but I can't seem to find a suitable one yet. I just need it to sort each column alphabetically. It doesn't need to ignore any code or any numbers or ..
I'm trying to create a report page that shows reports from a specific date to a specific date. Here's my current code:
$now = date('Y-m-d');
$reservations = Reservation::where('reservation_from', $no..
I'm trying to find a reference for the default visibility of various aspects of C#. Class types, fields, methods, enums, etc.
Can someone provide a list of these along with their default visibility (..
After the installation of my ant in my windows 7 . In cmd i typed ant -v it's given the ant version but it says the following also.
Buildfile: build.xml does not exist!
Build failed
What's the pro..
I have a form with multiple checkboxes and I want to use JavaScript to make sure at least one is checked. This is what I have right now but no matter what is chosen an alert pops up.
JS (wrong)
..
I was going through a site I have just completed, and fixing up some accessibility issues.
I had a form:
<input type="hidden" name="redirect" value="thank-you.php" />
<p>Enter your Email..
I am new with unix and I am writing a shell script.
When I run this line on the command prompt, it prints the total count of the number of processes which matches:
ps -ef | awk '/siebsvc –s siebs..
For example, can I take this script (from mozilla tutorial):
<html>
<head>
<script type="application/javascript">
function draw() {
var canvas = document.getElementById..
I selected this emulator from the newest version of Android Studio AVD.
I have selected the latest version of android API 23. Because it says "with Google APIs", I thought that it would actually in..
I am trying to keep a temporary container of a class that contains member :
HashMap<Integer,myObject> myobjectHashMap
A class called myobjectsList
Then I do
myobjectsListA = new myobjectsList()..
First of all, I know that using regex for email is not recommended but I gotta test this out.
I have this regex:
\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
In Java, I did this:
Pattern p = Pattern..
What is the difference between the following two HTML meta tags, for specifying spanish web page content:
<meta name="language" content="Spanish">
and
<meta http-equiv="content-language" ..
How to delete all changes from working directory including new untracked files. I know that git checkout -f does that, but it doesn't delete new untracked files created since last commit.
Does anybod..
Using base graphics in R, how can I add superscripts to axis labels, as one might want to when plotting latitude and longitude axes on a map.
Consider this example:
plot(-100:-50, 50:100, type="n", ..
I'm having some trouble understanding the difference between caller and callee saved registers and when to use what.
I am using the MSP430
:
procedure:
mov.w #0,R7
mov.w #0,R6
add.w R6,R7
inc.w..
I'm using Eclipse, and at random times, it will just freeze up and stop responding. Does this happen to anyone else? It usually happens when I click on a line of code, whether it be Java or XML. Any i..
It's a simple question,
I have a simple HashMap of which i want to reverse the keys and values.
HashMap<Character, String> myHashMap = new HashMap<Character, String>();
myHashMap.put('a',..
Quick question regarding CSS and the browser. I tried searching SO and found some similar posts, but nothing definitive.
I use one or two CSS files in my web projects. These are referenced in the HEA..
I'm wondering if it's possible to detect whether a browser is running on iOS, similar to how you can feature detect with Modernizr (although this is obviously device detection rather than feature dete..
I'm super new to React and I'm trying to get it set up for Meteor and piecing stuff together from other sources too. One of these other sources set up console logging for the app, but I'm going the ES..
I have a problem, I have a string array, and I want to explode in different delimiter. For Example
$example = 'Appel @ Ratte';
$example2 = 'apple vs ratte'
and I need an array which is explode in @..
I am using Python 2.5. And using the standard classes from Python, I want to determine the image size of a file.
I've heard PIL (Python Image Library), but it requires installation to work.
How migh..
I am a beginner to Java. I am making a simple text editor in netbeans 7(.3) IDE, using its GUI editor. The main problem I face in it is that I can't make it to save/open the file. I have created the "..
Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service's session when the service is started? Logging in as..
I have a Users model which needs an :email column (I forgot to add that column during the initial scaffold).
I opened the migration file and added t.string :email, did rake db:migrate, and got a No..
Just wondering in php, if it was possible to convert a string to a double. I am using a financial web service which provides a price as a string. I really need to process this as a double and was wond..
I am displaying 5 userImage on one screen.I want to display userID and email on mouseover on those userImage.I used alt property of image control but that not working in mozila,chrome and some versio..
I have a Java project in Eclipse with ~10 packages and ~10 class files per package. Is there a way to determine total lines of code for the whole project from within Eclipse? I am familiar with othe..
Many times I'm using the string match function to know if a string matches a regular expression.
if(str.match(/{regex}/))
Is there any difference between this:
if (/{regex}/.test(str))
They se..
I am developing a Ping application for Android 2.2.
I try my code and it works, but only in local IPs, that's my problem I want to do ping to external servers too.
Here is my code:
private OnClic..
So I was wondering if it would be possible to store data coming in from a form as a session variable.
Heres what I have so far, but I don't know what to put for the Form Action.
Thanks for looking!..
Is there a way I can see the changes that were made to a file after I have done git add file?
That is, when I do:
git add file
git diff file
no diff is shown. I guess there's a way to see the dif..
I built my project using the new Android App Bundle format. With APK files, I can download the APK to my device, open it, and immediately install the app. I downloaded my app as a bundle (.aab format)..
Is there a way in jasmine.js to check if two arrays are equal, for example:
arr = [1, 2, 3]
expect(arr).toBe([1, 2, 3])
expect(arr).toEqual([1, 2, 3])
Neither seems to work...
I am creating a form to lookup the details of a support request in our call logging system.
Call references are assigned a number like F0123456 which is what the user would enter, but the record in th..
I made a simple validation form using jQuery. It's working alright. The thing is I'm not satisfied with my code. Is there another way around to write my code with the same output result?
$(document)...
For Django 1.1.
I have this in my models.py:
class User(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
When updating a row ..
What's the correct way to change an image on mouseover and back on mouseout (with/without jQuery)?
<a href="#" id="name">
<img title="Hello" src="/ico/view.png" onmouseover="$(this).attr..
jQuery 1.5 brings the new Deferred object and the attached methods .when, .Deferred and ._Deferred.
For those who haven't used .Deferred before, I've annotated the source for it.
What are the possib..
I have big amount of data that I collected from different files. In this main workbook, I have different types of formulas for every cells. In range A to F is where the data from other files are colle..
I need to find content of forms from HTML source file, I did some searching and found very good method to do that, but the problem is that it prints out only first found, how can I loop through it and..
I'm getting the following error:
ld: library not found for -lGoogleAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invokation)
I've spent some time googling but c..
I have a small problem. After requesting a data from a service I got an iframe code in response.
<iframe src="https://www.example.com/show?data..." width="540" height="450"></iframe>
I ..
I know there is a ton of these threads but all of them are for very simple cases like 3x3 matrices and things of that sort and the solutions do not even begin to apply to my situation. So I'm trying ..
String lower = Name.toLowerCase();
int a = Name.indexOf(" ",0);
String first = lower.substring(0, a);
String last = lower.substring(a+1);
char f = first.charAt(0);
char l = last.charAt(0);
System.out...
Is there any way how to invoke a PHP page / function when a record is inserted to a MySQL database table? We don't have control over the record insertion procedure. Is there a trigger mechanism which ..
AngularJS Developer Guide - Forms tell there are many styles and directives regarding forms and fields. For each one, a CSS class:
ng-valid
ng-invalid
ng-pristine
ng-dirty
ng-touched
ng-untouched
W..
Last night I had dream that the following was impossible. But in the same dream, someone from SO told me otherwise. Hence I would like to know if it it possible to convert System.Array to List
Array..
Is there any linux command that I can call from a Bash script that will print the directory structure in the form of a tree, e.g.,
folder1
a.txt
b.txt
folder2
folder3
..
I want to make sure apache2 service is stopped.
1. I need to verify if apache2 is installed or not.
when I type:
sudo /etc/init.d/apache2 stop
I got:
sudo: /etc/init.d/apache2: command not fou..
When trying to run my app with eclipse/linux on tomcat
I got the following info message:
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments w..
I was trying to change my default/main/startup (whatever you call it) activity by editing the androidmanifest.xml file. All i did was change the android:name property. however, this completely broke t..
The projects page seems to be disappeared from Xcode 8. I used this page for deleting the derived data.
Any idea how can I delete derived data from within Xcode 8?..
I would like to create a query where I select all records which contain characters that are not a-z or A-Z
so something like this
SELECT * FROM mytable WHERE REGEXP_LIKE(column_1, '![A-Z] [a-z]')..
I am using .htpasswd to password protect certain directory on my server. However, I noticed that everytime I do this sudo htpasswd -c /etc/apache2/.htpasswd newuser my current contents of .htpasswd wi..
Well, first I should probably ask if this is browser dependent.
I've read that if an invalid token is found, but the section of code is valid until that invalid token, a semicolon is inserted before ..
Is there a way to create a list of primitive int or any primitives in java like following?
List<int> myList = new ArrayList<int>();
It seems I can do List myList = new ArrayList();
an..
I have the need to set a binding in code.
I can't seem to get it right tho.
This is what i have tried:
XAML:
<TextBox Name="txtText"></TextBox>
Code behind:
Binding myBinding = new ..
I have a jquery slider that I have built, basically just three pannels that slide by applying negative left CSS values. Works great, but I have a youtube video in one slide that wont stop when I slide..
The scenario:
I make some changes in a single file locally and run git add, git commit and git push
The file is pushed to the remote origin master repository
I have another local repository that is ..
i am using Django to create a user and an object when the user is created. But there is an error
__init__() got an unexpected keyword argument 'user'
when calling the register() function in view.py...
Alright, so I've been doing some poking around, and I realize my problem, but I don't know how to fix it. I have made a custom class to hold some data. I make objects for this class, and I need to t..
I have Tortoise svn installed on my desktop. I want to perform some tasks using commandline svn.exe? But I am not able to find svn.exe on my machine.
Do we have to install something else to get the s..
I'm trying to remove everything from a string but just numbers (0-9).
I thought this would work..
echo preg_replace("[^0-9]","",'604-619-5135');
But it echos "604-619-5135". What am I missing??? ..
According to this artcle, onComplete and onError function of the subscribe are mutually exclusive.
Meaning either onError or onComplete events will fire up in my subscribe.
I have a logic block whi..
What would be a good way to attempt to load the hosted jQuery at Google (or other Google hosted libs), but load my copy of jQuery if the Google attempt fails?
I'm not saying Google is flaky. There ar..
I'm using Ubuntu Gnome 14.04, and I have Java 8 installed (both the JDK and the JRE).
When I was installing Android Studio everything worked, but a message appeared saying:
Unable to run mksdcard..
I don't know what I've done incorrectly, but I can't include JSTL. I have jstl-1.2.jar, but unfortunately I get exception:
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/js..
What is the right way to initialize char** ?
I get coverity error - Uninitialized pointer read (UNINIT) when trying:
char **values = NULL;
or
char **values = { NULL };
..
This works, but i would like to remove the redundancy.
Is there a way to merge the update with a single select statement so i don't have to use vars?
DECLARE
@OrgAddress1 varchar,
..
I am using Tomcat 8. In one case I need to handle external request coming from external source where the request has a parameters where it is separated by |.
Request is looks like this:
http://local..
I need a method for adding "business days" in PHP. For example, Friday 12/5 + 3 business days = Wednesday 12/10.
At a minimum I need the code to understand weekends, but ideally it should account for..
Is it possible in pure css, that is without adding additional html tags, to make a line break like <br>? I want the line break after the <h4> element, but not before:
HTML
<li>
T..
I want to preface this with the fact that I am very very new to JavaScript. I appreciate your patience with me.
I'm trying to create a script that allows a user to input a name into a text-area, pres..
In python, I want a class to have some "constants" (practically, variables) which will be common in all subclasses. Is there a way to do it with friendly syntax?
Right now I use:
class Anima..
I've installed the mongodb 2.0.3, using the mongodb-10gen debian package. Everything went well, except the service which is installed by default is not starting up when computer starts. The mongod is ..
How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find ..
How can I change eclipse's Internal Browser from IE to Firefox on Windows XP?
To be more specific I need to change the Internal Browser instead of adding the External Browser through Preferences -> G..
The singleton pattern is a fully paid up member of the GoF's patterns book, but it lately seems rather orphaned by the developer world. I still use quite a lot of singletons, especially for factory cl..
UPDATE FIXED 1/18/15
After we recently updated to MySQL 5.6.27 (from the Ubuntu repo), this option now works. So this appears to have been a problem with the previous version of MySQL.
ORIGINAL QUES..
I couldn't find a straight answer to my question and need to know it from the real experts.
I had a website which urls were generated by Joomla. I believe that tons of urls are around in the search e..
What is the purpose of a command that does nothing, being little more than a comment leader, but is actually a shell builtin in and of itself?
It's slower than inserting a comment into your scripts b..
This is intended to be a general reference question and answer covering many of the never-ending "How do I access data in my JSON?" questions. It is here to handle the broad basics of decoding JSON..
Let's say I am doing a MySQL INSERT into one of my tables and the table has the column item_id which is set to autoincrement and primary key.
How do I get the query to output the value of the newly ge..
Can someone tell me the code to convert image into byte array and that byte array into base64 string.
i write the below code not getting proper result .
String filepath = "/sdcard/Image/ic_launcher..
The code below is trying to paste the selected range (passed as rng) to the end of the worksheet.
It works if there are two rows already present (A1, A2).
Sub copyRow(rng As Range, ws As Worksheet)
..
I have a scenario where I need to convert columns of table to rows
eg -
table - stocks:
ScripName ScripCode Price
-----------------------------------------
20 MICRONS 533022 ..
What are some ways to write object-oriented code in C? Especially with regard to polymorphism.
See also this Stack Overflow question Object-orientation in C...
This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer.
but my android studio version is 3.2.1 and there is no new update from Google..
For some reason my production DB decided to spew out this message. All application calls fail to the DB with the error:
PreparedStatementCallback; SQL [ /*long sql statement here*/ ];
Can't create/w..
I have installed MS SQL Server 2008 R2 and when I try to update model from database under EDMX file I am facing that error.
Could not load file or assembly Microsoft.SqlServer.management.sdk.sfc
..
In my application, I have an EditText whose default input type is set to android:inputType="textPassword" by default. It has a CheckBox to its right, which is when checked, changes the input..
Hope someone can help. I want to send email from my Azure account. My domain name is configured to work with Azure.
I could not find easily on the web how to send an email from an Azure account. The..
I have a file with three columns. I would like to delete the 3rd column(in-place editing). How can I do this with awk or sed?
123 abc 22.3
453 abg 56.7
1236 hjg 2.3
Desired output
123 abc..
I have a following class :
[DataContract]
public class Pair<TKey, TValue> : INotifyPropertyChanged, IDisposable
{
public Pair(TKey key, TValue value)
{
Key = key;
Value ..
Possible Duplicate:
I need to securely store a username and password in Python, what are my options?
I am looking for a way to securely store passwords which I intend to use in some Python ..
IDEA has a great built-in feature - decompiler. It works great.I can copy source code, but I cannot find option to extract all decompiled java classes to java files.
This project has a lot of java cla..
I need to upload an image to NodeJS server to some directory. I am using connect-busboy node module for that.
I had the dataURL of the image that I converted to blob using the following code:
dataUR..
I've got fresh install of Apache 2.2 on my Vista machine, everything works fine, except mod rewrite.
I've uncommented
LoadModule rewrite_module modules/mod_rewrite.s
but none of my rewrite rules ..
I get this Tomcat Error:
Sep 09, 2012 4:16:54 PM org.apache.catalina.core.AprLifecycleListener init
Information: The APR based Apache Tomcat Native library which allows optimal performance in product..
Webpack docs state that output.publicPath is:
The output.path from the view of the JavaScript.
Could you please elaborate on what this actually means?
I use output.path and output.filename to s..
Is there any alternative for PHP_excel which can "Export to XLSX/XLS" file in a customized format?
This is a General Reference question for the php tag
..
The JSON object I'm receiving looks like this:
[{"foo1":"bar1", "foo2":"bar2", "problemkey": "problemvalue"}]
What I'm trying to test for is the existence of problemvalue. If problemvalue returns a..
My friends and I are trying to setup Git for Windows using the tutorial Git Server: Gitosis and Cygwin on Windows, but we just keep running into problems.
What would a "Setup Git Server" guide for W..
Since I'm using react-router to handle my routes in a react app, I'm curious if there is a way to redirect to an external resource.
Say someone hits:
example.com/privacy-policy
I would like it to r..
I have a control flow where I create a temp database and table in a with a T-SQL Command. When I add a dataflow I would like to query the table but I can't because the table doesn't exist to grab info..
I'm having some problems defining some operator overloads for template classes. Let's take this hypothetical class for example.
template <class T>
class MyClass {
// ...
};
operator+=
// ..
I'm trying to access a script as JSON via AJAX, which works fine on Safari and other browsers but unfortunately will not execute in Chrome. It's coming with the following error:
Refused to execute..
here is my button object
let loginRegisterButton:UIButton = {
let button = UIButton(type: .system)
button.backgroundColor = UIColor(r: 50 , g: 80, b: 130)
button.setTitle("Register",..
Right now I have a central module in a framework that spawns multiple processes using the Python 2.6 multiprocessing module. Because it uses multiprocessing, there is module-level multiprocessing-awar..
In my AppDelegate there is a problem I do not understand. RootViewController initially called ViewController and I changed it name. The application is formed by many ViewController then I have introdu..
Is it possible to import a class in Java which is in the default package? If so, what is the syntax? For example, if you have
package foo.bar;
public class SomeClass {
// ...
in one file, yo..
Is there a single Subversion command that would “reset” a working copy exactly to the state that’s stored in the repository? Something like git reset --hard or (ha, hard Git reset does not remov..
I am starting Android Development using Eclipse. I have downloaded all the required software but I am having the same problem as discussed here. Now I do not find the solution of the problem on that d..
I have a sort of column display, but the end two column's seem to not be aligning correctly. This is the code I have at the moment:
Console.WriteLine("Customer name "
+ "sales "
..
In my endless quest in over-complicating simple stuff, I am researching the most 'Pythonic' way to provide global configuration variables inside the typical 'config.py' found in Python egg packages.
..
If I have a struct like this:
typedef struct
{
unsigned char c1;
unsigned char c2;
} myStruct;
What would be the easiest way to initialize this struct to 0?
Would the following suffice?
my..
I have a very boiled down version of what I am doing that gets the problem across.
I have a simple directive. Whenever you click an element, it adds another one. However, it needs to be compiled firs..
Here's the problem. I have an image:
<img alt="alttext" src="filename.jpg"/>
Note no height or width specified.
On certain pages I want to only show a thumbnail. I can't alter the html, so I..
I want mercurial to remove several files from the current state of the repository. However, I want the files to exist in prior history.
How do forget and remove differ, and can they do what I want?..
Can anyone tell me how I can identify and switch to the iframe which has only a title?
<iframe frameborder="0" style="border: 0px none; width: 100%; height: 356px; min-width: 0px; min-height: 0px;..
I'm newly at server development and have been started from easy tutorial by
Lars Vogel.
Servlet and JSP development with Eclipse WTP .
Step by step accord this tutorial:
installed Eclipse Java E..
Let's say I had a text file with the following nine lines:
foo
bar
baz
qux
quux
How can I use Sublime Text 2 to remove all four of the blank/empty lines, leaving only five lines?..
I have a CSS Grid Layout in which I want to make some (middle 3) rows stretch to their maximum size. I'm probably looking for a property similar to what flex-grow: 1 does with Flexbox but I can't seem..
Is there a way to verify if a methodOne is called before methodTwo in Mockito?
public class ServiceClassA {
public void methodOne(){}
}
public class ServiceClassB {
public void methodTwo(){..
Creating a relatively simple data entry form, and just want to separate certain sections with a horizontal line (not unlike an HR tag in HTML) that stretches the full length of the form.
I have tried..
The HTML elements del, strike, or s may all be used for a text strike-through effect. Examples:
<del>del</del>
....gives: del
<strike>strike</strike> and <s>strike</s..
Running a quick experiment related to Is double Multiplication Broken in .NET? and reading a couple of articles on C# string formatting, I thought that this:
{
double i = 10 * 0.69;
Console.W..
I compiled and installed openCV 2.4.2 in ubuntu 12.04. Under /usr/local/include I can see the directories /usr/local/opencv and /usr/local/opencv2.
Here is the code I wrote:
#include <cv.h>
#i..
I basically need to get current date and time separately, formatted as:
2009-04-26
11:06:54
The code below, from another question on the same topic, generates
now: |2009-06-01 23:18:23 +..
Does anyone know how to get a progress bar for an upload in php? I am trying writing code for a photo album uploader. I would like a progress bar to display while the photos are uploading.
I am fair..
I want to output some data from the database in a HTML table, and I want the user to be able to reorder table rows. To achieve this, I used jQuery UI sortable, thus:
<script>
$(function() {..
I am running a VNC server on Linux and a TightVNC viewer (ver.1.3.10 from 2/10/2009) on Windows with 2 monitors attached to it. I would like to have a full-screen session on both monitors at the same ..
I am copying 7.5 GB file to a remote server using scp command. At some point in time file transfer breaks and I have to start all over again.
Is the temporary amount of file being transferred complet..
I'm wondering how to refresh/reload a page (or even specific div) once(!) using jQuery?
Ideally in a way right after the DOM structure is available (cf. onload event) and not negatively affecting ba..
Suppose I have an array, a = [2 5 4 7]. What is the function returning the maximum value and its index?
For example, in my case that function should return 7 as the maximum value and 4 as the index...
I have a service class. I have exported this class to jar and I have embed the jar in my client app.
When needed, I call the service class. When I try to do this, I get the following error:
Unable t..
This is a pretty simple question, at least it seems like it should be, about sudo permissions in Linux.
There are a lot of times when I just want to append something to /etc/hosts or a similar file b..
Is that possible to use grep on a continuous stream?
What I mean is sort of a tail -f <file> command, but with grep on the output in order to keep only the lines that interest me.
I've tried t..
I'd love some some help handling a strange edge case with a paginated API I'm building.
Like many APIs, this one paginates large results. If you query /foos, you'll get 100 results (i.e. foo #1-100),..
I have an XXX.cshtml file in a Views\ABC folder. Its controller is ABC
I also have an action method in my DEF controller that return a Partialview("XXX" , xyzmodel)
I get a "view not found" error.
..
I'm trying to run a script that launches, amongst other things, a python script. I get a ImportError: No module named ..., however, if I launch ipython and import the same module in the same way thro..
What's the easiest way to convert from a file: android.net.Uri to a File in Android?
Tried the following but it doesn't work:
final File file = new File(Environment.getExternalStorageDirectory(), "..
I recently created a WCF service that works fine when tested from Visual Studio 2008. but when I deploy the project to IIS and I try to access the .svc file from IIS, I get this error :
"Server Error..
In a UNIX shell script, what can I use to convert decimal numbers into hexadecimal? I thought od would do the trick, but it's not realizing I'm feeding it ASCII representations of numbers.
printf? ..
It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data.
$values = get_values();
foreach ($values as $value){
...
}
When you..
C# seems to show some promise for scientific computing, but I found very little about one plotting 2D graphs, which is very important both for science student and scientists.
Is there a reliable, fre..
I'm trying to create a unit test to test the case for when the timezone changes on a machine because it has been incorrectly set and then corrected.
In the test I need to be able to create DateTime o..
I want to be able to say
$(someElem).text('this\n has\n newlines);
and it renders with newlines in the browser. The only workaround I have found is to set the css property 'white-space' to 'pre' o..
How do I obtain a function pointer for a class member function, and later call that member function with a specific object? I’d like to write:
class Dog : Animal
{
Dog ();
void bark ();
}
..
Does anyone know how I can get a Windows Mobile 6.5 PDA to connect up to a Windows 10 PC?
Before upgrading the PC from Window 8.1 I was able to use Windows Mobile Device Center to link up to the PDA ..
I'm writing a Greasemonkey script for a site which at some point modifies location.href.
How can I get an event (via window.addEventListener or something similar) when window.location.href changes on..
I am planning to insert a PHP variable which holds the directory path for a file stored on my Windows machine. How can I include this variable in the a href tag inside my php script such that when the..
I'm trying to work with fractions in Java.
I want to implement arithmetic functions. For this, I will first require a way to normalize the functions. I know I can't add 1/6 and 1/2 until I have a ..
I'm working with Android Studio 1.1 Preview 1. I noticed that when I create a new project I'm getting the following hierarchy:
Mipmap folders for different DPIs, no more different DPIs drawable fol..
I've a div and want it to be centered horizontally - although I'm giving it margin:0 auto; it's not centered...
.container {
position: absolute;
top: 15px;
z-index: 2;
width:40%;
..
I've always had to put null in the else conditions that don't have anything. Is there a way around it?
For example,
condition ? x = true : null;
Basically, is there a way to do the following?
conditi..
Can two Java methods have the same name with different return type? The return type of the methods are different and they are declared with the same method's name.
Is that allowed?..
I read some articles written on "ClassCastException", but I couldn't get a good idea on that. Is there a good article or what would be a brief explanation?..
I have the following array
var countries = {};
countries.results = [
{id:'AF',name:'Afghanistan'},
{id:'AL',name:'Albania'},
{id:'DZ',name:'Algeria'}
];
How can I remove an item fro..
I want to do something that seems fairly simple. I get results but the problem is, I have no way to know if the results are correct.
I'm working in C and I have two pointers; I want to print the cont..
I am working on a larger GUI with Java and I am becoming angry on Layout Managers.
I have a "Settings-Panel" with a variable number of JComponents in it (Labels, Buttons, JSpinners, JSliders,...). I ..
The problem that I am having is that I can't get my Password Verification Program to check a string to ensure that, 1 of the characters is in upper case and one is in lower case, it will check the who..
I have a directory of pictures that I want to loop through and do some file calculations on. It might just be lack of sleep, but how would I use PHP to look in a given directory, and loop through each..
Hi I am having a "Uncaught ReferenceError: $ is not defined" while using bellow codes
I am currently getting the following error in my log. I have been looking at the samples in the framework and I j..
I am new to iPhone. Can anyone tell me the steps to follow to parse this data and get the activity details, first name, and last name?
{
"#error": false,
"#data": {
"": {
..
I have an HttpServletRequest object.
How do I get the complete and exact URL that caused this call to arrive at my servlet?
Or at least as accurately as possible, as there are perhaps things that ca..
After following the instructions on Doug Hellman's virtualenvwrapper post, I still could not fire up a test environment.
[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found..
Is there a way to detect whether or not a user is using a mobile device in jQuery? Something similar to the CSS @media attribute? I would like to run a different script if the browser is on a handheld..
I am trying to get the source code of HTML by using an XMLHttpRequest with a URL. How can I do that?
I am new to programming and I am not too sure how can I do it without jQuery...
I just installed the Android Eclipse Plugin and the Android SDK from Google yesterday. I open the AVD Manager window by going to Window -> Android Virtual Device Manager. I then click "New" and am ..