Time management is the act or process of planning and exercising conscious control over the amount of time spent on specific activities, especially to increase effectiveness, efficiency or productivity.
In IB's library, the introduction tells us that when the return key is pressed, the keyboard for UITextView will disappear. But actually the return key can only act as '\n'.
I can add a button and u..
On my local machine, I run a python script which contains this line
bashCommand = "cwm --rdf test.rdf --ntriples > test.nt"
os.system(bashCommand)
This works fine.
Then I run the same code on a..
This line worked until I had whitespace in the second field.
svn status | grep '\!' | gawk '{print $2;}' > removedProjs
is there a way to have awk print everything in $2 or greater? ($3, $4.. u..
I just downloaded the Android Studio. While trying to run it, I had to modify the environment variable and add
JAVA_HOME
and
C:\Progra~2\Java\jdk1.6.0_22
Once I finished that hurdle, now ..
I have a situation in which I need to re-attach detached objects to a hibernate session, although an object of the same identity MAY already exist in the session, which will cause errors.
Right now, ..
For example, I have a RESTful service called Purchase Service. Should I name my repository:
purchaserestservice
purchase-rest-service
purchase_rest_service
or something else?
What's the convention..
When I can call the 3rd party api and get back a single class worth of data everything deserialises fine using this code
TheUser me = jsonSerializer.Deserialize(response, typeof(TheUser)) as TheUser..
I have used spline interpolation to smooth a time series and would also like to add a horizontal line to the plot. But there seems to be an issue that is out of my grips. Any assistance would be reall..
I just discovered a logical bug in my code which was causing all sorts of problems. I was inadvertently doing a bitwise AND instead of a logical AND.
I changed the code from:
r = mlab.csv2rec(datafi..
I am trying to create a Local IIS Website using ASP.NET.
When I click on New -----> Website and select the type as HTTP and from the dialog box if I select the option as LOCAL IIS WEBSITE I am get..
To get TimeSpan in minutes from given two Dates I am doing the following
int totalMinutes = 0;
TimeSpan outresult = end.Subtract(start);
totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24..
I am fairly new to coding in general and really new to Xcode (Swift). I understand that I need to register a nib or a class but I don't understand 'where or how?'.
import UIKit
class NotesListViewCo..
In my HTML form I have the below as a set of radio buttons, depending on what radio button you select depends on what the next form <fieldset> is revealed, this all works. The problem is for som..
How do I convert a structure to a byte array in C#?
I have defined a structure like this:
public struct CIFSPacket
{
public uint protocolIdentifier; //The value must be "0xFF+'SMB'".
public ..
Is there a simple (non-LayoutBuilder) way to size an element relative to screen size (width/height)? For example: how do I set the width of a CardView to be 65% of the screen width.
It can't be done ..
I am using a jQuery placeholder plugin(https://github.com/danielstocks/jQuery-Placeholder). I need to change the placeholder text with the change in dropdown menu. But it is not changing. Here is the ..
I have spent the best part of two days "faffing" about with code samples and etc., trying to read a very large JSON file into an array in c# so I can later split it up into a 2d array for processing.
..
Where are MIN and MAX defined in C, if at all?
What is the best way to implement these, as generically and type safely as possible? (Compiler extensions/builtins for mainstream compilers preferred.)..
The typescript handbook currently has nothing on arrow functions. Normal functions
can be generically typed with this syntax:
example:
function identity<T>(arg: T): T {
return arg;
}
What..
I've started to use Subversion with TortoiseSVN. If I open up the log and right click on an old revision I see two options that sound like they roll back to an older version: "Update item to revision"..
I have latitude and longitude for 2 points on database, I want my Google Map to display a route from point A to point B...
Just like we see here (Google Maps Directions)
How to draw that direction..
I found these things in my regex body but I haven't got a clue what I can use them for.
Does somebody have examples so I can try to understand how they work?
(?!) - negative lookahead
(?=) - positive..
Is there an easy way to verify that an object belongs to a given class? For example, I could do
if(a.getClass() = (new MyClass()).getClass())
{
//do something
}
but this requires instantiating ..
I have the following javascript in my page which does not seem to be working.
$('form').bind("keypress", function(e) {
if (e.keyCode == 13) {
e.preventDefault();
return false..
My Java standalone application gets a URL (which points to a file) from the user and I need to hit it and download it. The problem I am facing is that I am not able to encode the HTTP URL address prop..
I am in need to set a JS object property name dynamically.
for(i=1; i<3; i++) {
var key = i+'name';
data = {
key : 'name1',
}
}
Result should be:
data = {
1name: 'name..
I've created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).
Despite both the input fields AND the form field having th..
I am building My first MVC application, I have a table in database containing 3 columns:
Id ? primary key
Username
password
When I am clicking on edit link edit a record, its throwing following ex..
Is there an equivalent tool available for use in Windows 7? I just need to browse the membership of some small Active Directory groups that are deep within a huge hierarchy, so I can eventually write..
I am having a slight is regarding functions. I believe it is likely because I am not using them. My code is as follows:
/*date difference calculator*/
#include <stdio.h>
int main()
{
int Da..
How would I create an object in jQuery, and then proceed to make a couple of different instances of this object I.e
Create an object named box which holds a variable called color.
And then make a co..
I've encountered a problem with CSS transitions. I'm designing a CSS gallery for my portfolio and I need my images to fade in on hover.
I've been playing around with this for over an hour and I was h..
My java program is packaged in a jar file and makes use of an external jar library, bouncy castle. My code compiles fine, but running the jar leads to the following error:
Exception in thread "main" ..
I'd like to get started with ANTLR, but after spending a few hours reviewing the examples at the antlr.org site, I still can't get a clear understanding of the grammar to Java process.
Is there some ..
I am getting this error:
Server Error in '/' Application.
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or &l..
I'm trying to write a script that will calculate a directory size and if the size is less than 10GB, and greater then 2GB do some action. Where do I need to mention my folder name?
# 10GB
SIZE="1074..
I am new to shell scripts. I want to send a http request using curl and then extract some string using regular expressions. For example, how can I extract a domain name from a http response? (The exam..
I am moving away from Linode because I don't have the Linux sysadmin skills necessary; before I complete the transition to a more noob-friendly service, I need to download the contents of a MySQL data..
I have a column 'hour'
I have a column 'kind' (it can be 1,2 or 3)
I'd like to do something like:
SELECT count(id), SUM(hour) as totHour, SUM( IF ( kind = 1, 1, 0 ) ) as countKindOne
or
SELECT ..
Is it possible to replace a file in a zip file without unzipping deleting the old file adding the new file and rezipping it back?
Reason is I have a zip file which is really big there is one xml insi..
I have some sample data like: |H.RISK|NOTE|NORMAL| The | are actually in the data, it's a String. I am using Access, and am trying to exclude records that contain RISK in the String. Sample query..
Problem: NSAttributedString takes an NSRange while I'm using a Swift String that uses Range
let text = "Long paragraph saying something goes here!"
let textRange = text.startIndex..<text.endIndex
..
I am trying to extract a substring. I need some help with doing it in PHP.
Here are some sample strings I am working with and the results I need:
home/cat1/subcat2 => home
test/cat2 => test
..
I am very new to AngularJS. can anybody explain me the difference among these AngularJS operators: &, @ and = when isolating scope with proper example...
I am running into some issues with the Java socket API. I am trying to display the number of players currently connected to my game. It is easy to determine when a player has connected. However, it ..
Why would someone prefer either the Lodash or Underscore.js utility library over the other?
Lodash seems to be a drop-in replacement for underscore, the latter having been around longer.
I think both ..
How can I get the year/month/day of a NSDate object, given no other information? I realize that I could probably do this with something similar to this:
NSCalendar *cal = [[NSCalendar alloc] init];
N..
I would like to concatenate a number of text files into one large file in terminal. I know I can do this using the cat command. However, I would like the filename of each file to precede the "data dum..
I have a site as a remote Git repo pulling from Bitbucket.com using an SSH alias. I can manually start the ssh-agent on my server but I have to do this every time I login via SSH.
I manually start th..
I installed the latest version of Python (3.6.4 64-bit) and the latest version of PyCharm (2017.3.3 64-bit). Then I installed some modules in PyCharm (Numpy, Pandas, etc), but when I tried installing ..
How do you return a JSON object form a Java servlet.
Previously when doing AJAX with a servlet I have returned a string. Is there a JSON object type that needs to be used, or do you just return a Str..
I've run out of space on a virtual machine disk which is a vmdk and need to resize the virtual image. Resizing with the command
vboxmanage modifyhd Machine-disk1.vmdk --resize 30720
gives the erro..
I don't have much experience with JavaScript but i'm trying to create a tag system which, instead of using @ or #, would use /.
var start = /#/ig; // @ Match
var word = /#(\w+)/ig; //@abc Match
Ho..
I have started pods with command
$ kubectl run busybox --image=busybox --restart=Never --tty -i --generator=run-pod/v1
Something went wrong, and now I can't delete this Pod.
I tried using the meth..
Seeing as how the three primary colors are cyan, magenta and yellow (CMY), why do monitors and almost all the GUI components out there use red, green and blue (RGB)? (If I'm not mistaken, printers use..
I just have a question regarding structuring and handling responses from http requests within a service. I am using Angular2.alpha46 Typescript ( Just started testing it out- which I love... Ps.. Than..
I want to play .mov video like as this, but video doesn't play in any browser.
<video width="400" controls Autoplay=autoplay>
<source src="D:/mov1.mov" type="video/mov">
</video>
..
I have this scenario:
public class Member
{
public int MemberID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public virtual ICollection&l..
I am trying to call a Lambda Function through AWS API Gateway.
When I mention Authentication type NONE it works fine but API become public and anyone with url can access my API.
To make API call secu..
Let's say I have:
v = rep(c(1,2, 2, 2), 25)
Now, I want to count the number of times each unique value appears. unique(v) returns what the unique values are, but not how many they are.
> uniq..
So I'm new to AngularJS and I'm trying to build a very simple list app, where I can create an ng-repeat item list and then push a selected item into another ng-repeat list. Although my problem seems t..
So, I have some PHP code that looks a bit like this:
<body>
The ID is
<?php
echo $_GET["id"] . "!";
?>
</body>
Now, when I pass an ID like http://localhost/myph..
How to select Boolean value from sub query with IF EXISTS statement (SQL Server)?
It should be something like :
SELECT
TABEL1.Id,
NewFiled = (IF EXISTS(SELECT Id FROM TABLE2 WHERE TABLE2.ID = ..
I want a way to search in a given text. For that, I use grep:
grep -i "my_regex"
That works. But given the data like this:
This is the test data
This is the error data as follows
. . .
. ...
How can I use homebrew cask to install Sublime Text 3? I only see sublime text 2 in the repos. I even tried tapping homebrew/versions, but no luck.
Thanks!
EDIT: Answered by my answer below..
I am trying to get a list of list of tuples : something like [ [(1,0),(2,0),(3,0)],[(1,1),(2,1),(3,1)....]]
I used this statement
set([(a,b)for a in range(3)]for b in range(3))
But it gives me an ..
I was wondering when I should use interfaces.
Lets think about the following:
public abstract class Vehicle {
abstract float getSpeed();
}
and :
public interface IVehicle {
float getSpeed();..
I am able to read Excel file via FileReader but it outputs text as well as weird characters with it. I need to read xls file row-wise, read data in every column and convert it to JSON.
How to read x..
I have an array of structs that I created somewhere in my program.
Later, I want to iterate through that, but I don't have the size of the array.
How can I iterate through the elements? Or do I need..
I'm trying to get Javascript to read/write to a PostgreSQL database. I found this project on github. I was able to get the following sample code to run in node.
var pg = require('pg'); //native libpq..
I have a problem with my PHP code saying that "Notice: Undefined index" I am sure its very simple, since I am a beginner i am not getting well what is wrong exactly so please help me.
Here's the code..
After reading this article about elapsed time, I wrote a simple code to calculate the execution time of a loop:
#include <stdio.h>
#include <sys/time.h>
int main (int argc, char** argv) ..
I have a script that uses $(document).ready, but it doesn't use anything else from jQuery. I'd like to lighten it up by removing the jQuery dependency.
How can I implement my own $(document).ready fu..
I have a input tag with an onblur event listener:
<input id="myField" type="input" onblur="doSomething(this)" />
Via JavaScript, I want to trigger the blur event on this input so that it, in ..
I opened the Nav example which comes with the standard Bootstrap download (bootstrap-3.0.0\examples\navbar\index.html) and added vertical dividers between two of the links.
However, it doesn't seem t..
I need to load an animated Gif image from a URL in UIImageview.
When I used the normal code, the image didn't load.
Is there any other way to load animated Gif images?..
I would like to list all tables in the liferay database in my PostgreSQL install. How do I do that?
I would like to execute SELECT * FROM applications; in the liferay database. applications is a tabl..
I am having a bit of trouble trying to find an answer to this. I would like to know what the syntax sep="" and \t means. I have found some informaion about it but I didn't quite understand what the pu..
I have to generate a xml file dynamically at runtime. Please help me in generating the below XML file dynamically using PHP.
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<track>
..
I'm using the Google Maps JavaScript API V3 and the official examples always have you include this meta tag:
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
Most of the..
When I try to run my Android app on an emulator I get this error:
/dev/kvm permission denied.
I checked the permissions and added the user I am currently logged in with to the kvm group. What ..
Given a transparent PNG displaying a simple shape in white, is it possible to somehow change the color of this through CSS? Some kind of overlay or what not?..
I want to set a default value for my html <textarea>. I read from a material that to add default value you have to do something like <textarea>This is default text</textarea>. I did ..
I would like to catch the error and show the appropriate message if the Ajax request fails.
My code is like the following, but I could not manage to catch the failing Ajax request.
function getAjaxD..
Hey, I need to delete all images from a string and I just can't find the right way to do it.
Here is what I tryed, but it doesn't work:
preg_replace("/<img[^>]+\>/i", "(image) ", $content);..
I would like to create a vector in which each element is the i+6th element of another vector.
For example, in a vector of length 120 I want to create another vector of length 20 in which each element..
Is there any way I can disable all external CSS in a browser (Firefox, Chrome...)?
When using slower internet connection, sometimes only the bare HTML is loaded by the browser without the CSS info. I..
I am trying to use the H2 database from a Java application.
I created the database and its tables through the H2 Console and then I try to connect from Java using
Connection con = DriverManager.ge..
After some android apps installed, I found that it will change to odex file (not apk) in smartphone.
How does it happens? Who can teach me, I am very interested about it...
I have created a small application to find max number by using user-defined function with parameter. When I run it, it shows this message
Error 1 error C4996: 'scanf': This function or variab..
I would like to add some style on a select box with the pseudo :after (to style my select box with 2 parts and without images). Here's the HTML:
<select name="">
<option value="">Test&l..
I am using Log4J in my application for logging. Previously I was using debug call like:
Option 1:
logger.debug("some debug text");
but some links suggest that it is better to check isDebugEnabled(..
Well just getting into the flow of thing with Python. Reading a few books, finding it fairly easy as I already have some experience with C++/Java from school and Python is definetly my favorite thus f..
I know that I can svn diff -r a:b repo to view the changes between the two specified revisions. What I'd like is a diff for every revision that changed the file. Is such a command available?..
I want to do something like this:
List<Animal> animals = new ArrayList<Animal>();
for( Class c: list_of_all_classes_available_to_my_app() )
if (c is Animal)
animals.add( new c()..
I am trying to figure out if it is possible to pass a JSON object to rest API, Or pass a multiple parameters to that API ? And how to read these parameters in Spring ? Lets assume that the url looks l..
I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem).
The probl..
I search how to plot something with less instruction as possible with Matplotlib but I don't find any help for this in the documentation.
I want to plot the following things:
a wireframe cube cente..
despite many tries I can't get the result that I would like to see - text centered within the JLabel and the JLabel somewhat centered in the BorderLayout. I said "somewhat" because there should be als..
I am currently uploading images pasted from the clipboard with the following code:
// Turns out getAsFile will return a blob, not a file
var blob = event.clipboardData.items[0].getAsFile(),
form..
I thought by setting the first element to a null would clear the entire contents of a char array.
char my_custom_data[40] = "Hello!";
my_custom_data[0] = '\0';
However, this only sets the first ele..
Basically I have:
JSONArray j = new JSONArray();
j.add(new JSONObject()); //JSONObject has a bunch of data in it
j.add(new JSONArray()); //JSONArray has a bunch of data in it
And now I would like ..
I know there is a method for a Python list to return the first index of something:
>>> l = [1, 2, 3]
>>> l.index(2)
1
Is there something like that for NumPy arrays?..
When we create a table in MySQL with a VARCHAR column, we have to set the length for it. But for TEXT type we don't have to provide the length.
What are the differences between VARCHAR and TEXT?..
Note: I realise this could be seen as a duplicate but i have looked at the other responses and they didn't fix the problem for me.
I have recently installed Zend Studio and Zend Server with the mys..
I want to check if a variable is null. If it is null, then I want to set a value to that variable:
//data type of var is number
if Var = null then
var :=5;
endif
But I am geting error in it. ..
I seem to be running around in circles and have been doing so in the last hours.
I want to populate a datagridview from an array of strings. I've read its not possible directly, and that I need to cr..
I am using Json.NET to serialize a class to JSON.
I have the class like this:
class Test1
{
[JsonProperty("id")]
public string ID { get; set; }
[JsonProperty("label")]
public string ..
I want to create a list of dates, starting with today, and going back an arbitrary number of days, say, in my example 100 days. Is there a better way to do it than this?
import datetime
a = datetime..
Just completed a todolist tutorial.
When submitting the form the input field doesn't clear.
After trying both:
document.getElementById("todo-field").reset();
document.getElementById("#todo..
I have looked to no avail, and I'm afraid that it might be such a simple question that nobody dares ask it.
Can one input multiple things from standard input in one line? I mean this:
float a, b;
ch..
I'm debating whether I should learn PowerShell, or just stick with Cygwin/Perl scripts/Unix shell scripts, etc.
The benefit of PowerShell would be that the scripts could be more easily used by teamma..
I've been trying to add a smooth scrolling function to my site for a while now but can't seem to get it to work.
Here is my HTML code relating to my navigation:
<div id="nav-wrapper">
<di..
I've got a table with two columns, ID and Value. I want to change a part of some strings in the second column.
Example of Table:
ID Value
---------------------------------
1 c..
I am using jspdf.debug.js to export different data from a website but there are a few problems, I can't get it to render the CSS in the exported PDF and if I have an image in the page I am exporting, ..
How do I update all MySQL table rows at the same time?
For example, I have the table:
id | ip | port | online_status |
1 | ip1 | port1 | |
2 | ip2 | por..
I've created a div with a bottom arrow using ::after. Here is the HTML code:
<div class="sidebar-resources-categories">Topics</div>
<div class="text-content">ok ok</div>
And..
This is probably something really dumb, but I don't understand why this doesn't work.
var a = {"cat":"large"};
a.forEach(function(value, key, map){
console.log(value);
});
Uncaught TypeError: ..
The docs mention an executable called code, but I'm not sure where I can find that so I can put it on my path. The zip I downloaded from the VSCode site did not include any such executable. (I am able..
I am having a problem importing classes and setting variables and I need help with a test program I am doing. So I am testing out a program that just simply outputs what your input was and puts a time..
I want to run a query, get the results and then iterate through the results of that query with another select statement using the values of the first statement in my 2nd statement (cursor).
I have 40..
Does anyone know how to make a jbutton close a gui? I think it is like System.CLOSE(0); but that didnt work. it also could be exitActionPerformed(evt);, but that didn't work either. just the line of c..
I am getting that exception from this code:
class Transaction:
def __init__ (self):
self.materials = {}
def add_material (self, m):
self.materials[m.type + m.purity] = m
..
I wanted to know if it is possible to get all the names of text files in a certain folder.
For example, I have a folder with the name Maps, and I would like to get the names of all the text files in..
I'm trying to display a Back button on the Action bar to move previous page/activity or to the main page (first opening).
And I can not do it.
my code.
ActionBar actionBar = getActionBar();
actionBa..
Is it possible to use Async when using ForEach? Below is the code I am trying:
using (DataContext db = new DataLayer.DataContext())
{
db.Groups.ToList().ForEach(i => async {
await GetA..
I've recently used our company's spare laptop (that has a general user set up) while mine was being repaired. I've checked the "Remember password" option in SQL Server Management Studio when logging i..
In a comment on this question, I saw a statement that recommended using
result is not None
vs
result != None
I was wondering what the difference is, and why one might be recommended over the oth..
I am following the Artifactory 1-min Setup. I have Artifactory up and running on my localhost, and now I am trying to integrate it with Intellij/Gradle.
The artifactory webapp gives a gradle.properti..
Say I have the following three constants:
final static int MY_INT1 = 25;
final static int MY_INT2 = -10;
final static double MY_DOUBLE1 = 15.5;
I want to take the three of them and use Math.max() t..
I would like to know if there is a better way to print all objects in a Python list than this :
myList = [Person("Foo"), Person("Bar")]
print("\n".join(map(str, myList)))
Foo
Bar
I read this way is..
Normally I would start a command like
longcommand &;
I know you can redirect it by doing something like
longcommand > /dev/null;
for instance to get rid of the output or
longcommand 2&g..
I have generated an EF4 Model from a MySQL database and I have included both StoredProcedures and Tables.
I know how to make regular instert/update/fetch/delete operations against the EF but I can't ..
Could someone explain to me the meaning of @classmethod and @staticmethod in python? I need to know the difference and the meaning.
As far as I understand, @classmethod tells a class that it's a met..
I would like to automatically format TypeScript code using the build-in formatter when I save a file in Visual Studio Code.
I'm aware of the following options, but none of them is good enough:
Fo..
I need to have users enter floating point numbers, so I use the following element:
<input type="number" name="my_number" placeholder="Enter number"/>
Works great on Firefox, but Chrome compla..
I want to detect whenever a textbox's content has changed. I can use the keyup method, but that will also detect keystrokes which do not generate letters, like the arrow keys. I thought of two methods..
I'm looking for a simple script which can truncate a string with ellipsis (...)
I want to truncate something like 'this is a very long string' to 'this is a ve...'
I don't want to use CSS or PHP...
I have a table set up that currently has no primary key. All I need to do is add a primary key, no null, auto_increment.
I'm working with a Microsoft SQL Server database. I understand that it can't b..
What is difference between %d and %u when printing pointer addresses?
For example:
int a = 5;
// check the memory address
printf("memory address = %d\n", &a); // prints "memory address = -12"
pr..
I know that this Question is repeated but I can't find the answer in Internet.
I want to call a method from another class.
I've Class1 and Class2.
In Class 2 I've that method:
public void UpdateEm..
In the pandas library many times there is an option to change the object inplace such as with the following statement...
df.dropna(axis='index', how='all', inplace=True)
I am curious what is being ..
I'm using $http in AngularJs, and I'm not sure on how to use the returned promise and to handle errors.
I have this code:
$http
.get(url)
.success(function(data) {
// Handle data
..
I want to setup a hadoop-cluster in pseudo-distributed mode. I managed to perform all the setup-steps, including startuping a Namenode, Datanode, Jobtracker and a Tasktracker on my machine.
Then I tr..
Is it possible to convert an array in JavaScript into a function argument sequence? Example:
run({ "render": [ 10, 20, 200, 200 ] });
function run(calls) {
var app = .... // app is retrieved from ..
I have a question about if - else structure in a batch file. Each command runs individually, but I couldn't use "if - else" blocks safely so these parts of my programme doesn't work. How can I do make..
I have an array of distances called dists. I want to select dists which are between two values. I wrote the following line of code to do that:
dists[(np.where(dists >= r)) and (np.where(dists <..
I'm running Windows 2003 Service Pack 2. I have a batch file that runs on demand. I want to have an email sent every time the batch file runs. The email is simple, just a sentence indicating that the ..
I'm trying to write some short script in python which would start another python code in subprocess if is not already started else terminate terminal & app (Linux).
So it looks like:
#!/usr/bin/..
In Firefox, how do I do the equivalent of --disable-web-security in Chrome. This has been posted a lot, but never a true answer. Most are links to add-ons (some of which don't work in the latest Firef..
I am trying to forward engineer my new schema onto my db server, but I can't figure out why I am getting this error. I've tried to search for the answer here, but everything I've found has said to ei..
How can I convert the str representation of a dict, such as the following string, into a dict?
s = "{'muffin' : 'lolz', 'foo' : 'kitty'}"
I prefer not to use eval. What else can I use?
The main re..
When installing a node package using sudo npm link in the package's directory, how can I uninstall the package once I'm done with development?
npm link installs the package as a symbolic link in the ..
I'm trying to debug a curl request to a webservice 'getToken' endpoint.
I'm not 100% confident that the URL and the auth info is getting written in to the curl handle correctly.
I'm trying to use ..
How can I convert an int to a bit array?
If I e.g. have an int with the value 3 I want an array, that has the length 8 and that looks like this:
0 0 0 0 0 0 1 1
Each of these numbers are in a sepa..
I have an array like
vendors = [{
Name: 'Magenic',
ID: 'ABC'
},
{
Name: 'Microsoft',
ID: 'DEF'
} // and so on...
];
How do I check this array to see if "Magenic" exis..
On one server, when I run:
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2009-05-30 16:54:29 |
+---------------------+
1 row in set (0.00 sec)
On..
I have a fluid width container DIV.
Within this I have 4 DIVs all 300px x 250px...
<div id="container">
<div class="box1"> </div>
<div class="box2"> </div>
<..
It's possible to clone down a git repository, specifying username and password in the command. Example:
git clone https://username:[email protected]/file.git
Is it is possible to also specif..
I'm jusing jQuery's $.getJSON() function to return a short set of JSON data.
I've got the JSON data sitting on a url such as example.com.
I didn't realize it, but as I was accessing that same url, t..
I would like to use case insensitive string as a HashMap key for the following reasons.
During initialization, my program creates HashMap with user defined String
While processing an event (network ..
I am trying to do the following, in a clear pythonic way:
def remove_prefix(str, prefix):
return str.lstrip(prefix)
print remove_prefix('template.extensions', 'template.')
This gives:
xtensio..
Is the only difference between the RegisterStartupScript and the RegisterClientScriptBlock is that RegisterStartupScript puts the javascript before the closing </form> tag of the page and Regist..
I know I can iterate over a map m by,
for k, v := range m { ... }
and look for a key but is there a more efficient way of testing a key's existence in a map?
I couldn't find the answer in the lan..
We use self signed certificates on our intranet. What do I need to do to get Internet Explorer 8 to accept them without showing an error message to the user? What we did for Internet Explorer 7 appare..
Is there any way to open a view from a controller action in a new window?
public ActionResult NewWindow()
{
// some code
return View();
}
How would I get the NewWindow.cshtml view to open i..
As I said before, how do I test if the entered character is one of the parameters? I've written this code, but it doesn't seem to run very well(or at all), no errors, however. Also, I need to use the ..
I am trying to open a program for the first time on Windows XP Pro that uses PostgreSQL 9. I'm getting an error message that says :
A problem was encountered while trying to log into or create the..
I am writing a script in bash, which is calling two bash scripts internally. Where first script includes different tests which runs in background and second script print results of first script.
When..
I have a reporting spreadsheet that grabs some data from a database and forms three sheets of summary report information. I want to run the spreadsheet automatically from the command line, and have it..