Is it possible to temporarily disable constraints in MySQL?
I have two Django models, each with a foreign key to the other one. Deleting instances of a model returns an error because of the foreign ke..
I need a function that can return the difference between the below two dates as 24.
DateTime a = new DateTime(2008, 01, 02, 06, 30, 00);
DateTime b = new DateTime(2008, 01, 03, 06, 30, 00);
..
I need to collect the standard output and error log from several processes into one single log file.
So every output must append to this log file.
I want to call all the jobs with lines like this:
..
I have a simple shell script that removes trailing whitespace from a file. Is there any way to make this script more compact (without creating a temporary file)?
sed 's/[ \t]*$//' $1 > $1__.tmp
ca..
Sometimes, Activerecord data types confuse me. Err, often. One of my eternal questions is, for a given case,
Should I use :decimal or :float?
I've often come across this link, ActiveRecord: :dec..
I have a dynamically created select option using a javascript function. the select object is
<select name="country" id="country">
</select>
when the js function is executed, the "countr..
I was trying to update the existing pods with the pod install command, but it takes forever to run.
The verbose mode shows it was stuck at the following line (forever)
Updating spec repo master
$ /us..
Background
I have the most basic "newbie" AngularJS question, forgive my ignorance: how do I refresh the model via code? I'm sure it's answered multiple times somewhere, but I simply couldn't
find i..
Is there a Utility method somewhere that can do this in 1 line? I can't find it anywhere in Collections, or List.
public List<String> stringToOneElementList(String s) {
List<String> l..
I'm replacing cookies with localStorage on browsers that can support it (anyone but IE). The problem is site.com and www.site.com store their own separate localStorage objects. I believe www is consid..
I've seen this post already and tried everything I could to change the padding for my placeholder but alas, it seems it just doesn't want to cooperate.
Anyway, here is the code for the css. (EDIT: Th..
Is there a simple shell command/script that supports excluding certain files/folders from being archived?
I have a directory that need to be archived with a sub directory that has a number of very la..
I want to indent a specific section of code in Visual Studio Code.
I read How do you format code in Visual Studio Code? that gives shortcuts to indent the whole code, but it doesn't work when selecti..
I want to loop through all elements in a piece of XML printing each one. My problem is that I keep getting a null pointer exception after the staff1 tag, i.e. john 465456433 gmail1 area1 city1
This ..
How to create maven pom, which will make project buildable, can I include propriatery jars with my project directly without having to take them from repository? anyone did this before ?
EDIT :
I do..
We offer a platform for video- and audio-clips, photos and vector-grafics. We started with MySQL as the database backend and recently included MongoDB for storing all meta-information of the files, be..
I'm thinking that this needs to be changed to a while clause, at the moment it'll wait till all 10000 pings are done, I need it to return when the ping is successful. The program "say" is on OSX it ma..
I need to use the
(rdd.)partitionBy(npartitions, custom_partitioner)
method that is not available on the DataFrame. All of the DataFrame methods refer only to DataFrame results. So then how to c..
This is the VBA code im using to try add a new sheet to the last place in the workbook
mainWB.Sheets.Add(After:=Sheets(Sheets.Count)).Name = new_sheet_name
I saw this in a similar question on this ..
I am developing a simple platform game using Java using BlueJ as the IDE. Right now I have player/enemy sprites, platforms and other items in the game drawn using polygons and simple shapes. Eventuall..
I have a problem when data is null and the warning has appear when the result is display.
How to solve this problem?. How to change the null data to 0 when no data in the table?.
This is my code:-
S..
If I have a mysql database running on some host machine, and that host is also running a docker container: How would I access the mysql database from within the docker container that is running on the..
TLDR: Use defaultChecked instead of checked, working jsbin.
Trying to setup a simple checkbox that will cross out its label text when it is checked. For some reason handleChange is not getting fired..
I'm looking for a list of all locales and their short codes for a PHP application I am writing. Is there much variation in this data between platforms?
Also, if I am developing an international appli..
I'm relative new to the webservices world and my research seems to have confused me more than enlighten me, my problem is that I was given a library(jar) which I have to extend with some webservice fu..
Moving a working C# project from a 64-bit Windows 7 machine to a 32-bit XP machine caused the following error:
Retrieving the COM class factory for component with CLSID {681EF637-F129-4AE9-94BB-61..
I have encountered many half-solutions to the task of returning XML in ASP.NET. I don't want to blindly copy & paste some code that happens to work most of the time, though; I want the right code,..
I'm aware of the reason that git push --tags is a separate operation to plain old git push. Pushing tags should be a conscious choice since you don't want accidentally push one. That's fine. But is th..
So this is the current code I have
$(document).ready(function() {
$('.abouta').click(function(){
$('html, body').animate({scrollTop:308}, 'slow');
return false;
});
$('.po..
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.
I can find the Web Service using it's URL, but when I try..
I'm in Linux, Elementary OS, and installed lampp in opt.
My CSS and JS won't load. When I inspect my page through browser. The console says
Failed to load resource: the server responded with a status..
I would like to make a Join query using Jpa repository with annotation @Query.
I have two tables:
table user
with iduser,user_name
and:
table area
with idarea, area_name and iduser
The ..
Can you round a number in javascript to 1 character after the decimal point (properly rounded)?
I tried the *10, round, /10 but it leaves two decimals at the end of the int...
Is it legitimate to use items() instead of iteritems() in all places? Why was iteritems() removed from Python 3? Seems like a terrific and useful method. What's the reasoning behind it?
Edit: To clar..
Hi there I have a question about dynamically creating a canvas using javascript.
I create a canvas like this:
var canvas = document.createElement('canvas');
canvas.id = "CursorLayer";
canvas.wid..
Something like this, would make the widget appear normally:
Label(self, text = 'hello', visible ='yes')
While something like this, would make the widget not appear at all:
Label(self, text = 'hel..
How to mock methods with void return type?
I implemented an observer pattern but I can't mock it with Mockito because I don't know how.
And I tried to find an example on the Internet but didn't suc..
How do I write a PHP ternary operator with the elseif portion?
I see basic examples with the if and else portions of the PHP ternary operator like this:
echo (true) ? "yes" : "no"; //prints yes
..
I want the user to give me the full path where the file exists and not just the file name. How do I open the file this way?
Is it something like this:
ifstream file;
file.open("C:/Demo.txt", ios::in..
I am Javascript beginner.
I am initing web page via the window.onload, I have to find bunch of elements by their class name (slide) and redistribute them into different nodes based on some logic. I h..
In the Oracle "Primitive data types" page, it mentions that Java 8 adds support for unsigned ints and longs:
int: By default, the int data type is a 32-bit signed two's complement integer, ..
How can I, using Javascript, make a function that will trim string passed as argument, to a specified length, also passed as argument. For example:
var string = "this is a string";
var length = 6;
va..
I have a very large 2D array which looks something like this:
a=
[[a1, b1, c1],
[a2, b2, c2],
...,
[an, bn, cn]]
Using numpy, is there an easy way to get a new 2D array with, e.g., 2 random rows..
I have a custom Content Management System (CMS) I've built that works perfectly on my dev box (Ubuntu/PHP5+/MySQL5+).
I just moved it up to the production box for my client and now all form submission..
I'd like to handle the Closing event (when a user clicks the upper right 'X' button) of my window in order to eventually display a confirm message or/and cancel the closing.
I know how to do this in ..
How can I split the following string based on the '-' character?
So if I had this string: LD-23DSP-1430
How could I split it into separate columns like this:
LD 23DSP 1430
Also, ..
So I accidentally formatted my hard drive and re-installed Windows and forgot to backup an important database I had in my MySQL server. I'm trying to salvage files now using some software, but I don't..
I have installed the new Android Studio. Everything was working fine but when I try to create a new project it gets stuck at downloading Gradle.
Is there any way to install the Gradle required by And..
Relevant questions:
About C++11:
C++11: std::thread pooled?
Will async(launch::async) in C++11 make thread pools obsolete for avoiding expensive thread creation?
About Boost:
C++ boost thread r..
I am trying to merge multiple linux commands in one line to perform deployment operation.
For example
cd /my_folder
rm *.jar
svn co path to repo
mvn compile package install
..
I am using sequelize ORM; everything is great and clean, but I had a problem when I use it with join queries.
I have two models: users and posts.
var User = db.seq.define('User',{
username: { typ..
In C# WinApp, how can I add both Text and Value to the items of my ComboBox?
I did a search and usually the answers are using "Binding to a source".. but in my case I do not have a binding source read..
Here's the scenario.
My Java web application has following path
https://www.mywebsite.com:9443/MyWebApp
Let's say there is a JSP file
https://www.mywebsite.com:9443/MyWebApp/protected/index.jsp
..
Learning SQL. Have a simple table games with field title. I want to search based on title. If I have a game called Age of Empires III: Dynasties, and I use LIKE with parameter Age of Empires III: Dyna..
How to set border-width of an element in percentages? I tried the syntax
border-width:10%;
But it doesn't work.
The reason I want to set border-width in percentages is I have an element with width..
I am attempting to split a list into a series of smaller lists.
My Problem: My function to split lists doesn't split them into lists of the correct size. It should split them into lists of size 30 bu..
I always thought that && operator in Java is used for verifying whether both its boolean operands are true, and the & operator is used to do Bit-wise operations on two integer types.
Rece..
I'm new to LINQ and want to know how to execute multiple where clause. This is what I want to achieve: return records by filtering out certain user names. I tried the code below but not working as exp..
If I have list=[1,2,3] and I want to add 1 to each element to get the output [2,3,4],
how would I do that?
I assume I would use a for loop but not sure exactly how...
I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit (Git and SVN) to a remote location over SSH many times in an hou..
I need to convert a decimal to a string with N decimals (two or four) and NO thousand separator:
'XXXXXXX (dot) DDDDD'
The problem with CultureInfo.InvariantCulture is that is places ',' to separate..
Possible Duplicate:
How to center div horizontally and vertically
I need to put image in center of html page, both vertical and horizontal ... been trying few stuff but seems to work fine. ..
I am using Visual Studio 2017 and am trying to create a .Net Standard 1.5 library and use it in a .Net 4.6.2 nUnit test project.
I am getting the following error...
Could not load file or assemb..
I have the following codes to create a graph using Chart.js v2.1.3:
var ctx = $('#gold_chart');
var goldChart = new Chart(ctx, {
type: 'line',
data: {
labels: dates,
datasets:..
I'm on windows, but I'm using a putty shell to connect to a linux machine, and want to install python 2.7. Can't figure out how to do it. How can I download python from command line?..
I have a file that can contain from 3 to 4 columns of numerical values which are separated by comma. Empty fields are defined with the exception when they are at the end of the row:
1,2,3,4,5
1,2,3,,..
I have an image at this link: http://d38daqc8ucuvuv.cloudfront.net/avatars/216/2014-02-19%2017.13.48.jpg
As you can see, this is a normal image with correct orientation. However, when I set this link..
When I use following URL in browser then it prompt me to download a text file with JSOn content.
https://chart.googleapis.com/chart?cht=p3&chs=250x100&chd=t:60,40&chl=Hello|World&chof..
I'm getting in an int with a 6 digit value. I want to display it as a String with a decimal point (.) at 2 digits from the end of int. I wanted to use a float but was suggested to use String for a bet..
Assuming I have no control over the content in the iframe, is there any way that I can detect a src change in it via the parent page? Some sort of onload maybe?
My last resort is to do a 1 second int..
What code I should do change in this PHP script to send one email to more than 20 email addresses?
<?php
$email_to = "[email protected]"; // your email address
$email_subject = "Con..
This question is related to Should I be concerned about excess, non-running, Docker containers?.
I'm wondering how to remove old containers. The docker rm 3e552code34a lets you remove a single one, b..
When selecting a sub dataframe from a parent dataframe, I noticed that some programmers make a copy of the data frame using the .copy() method. For example,
X = my_dataframe[features_list].copy()
.....
What is the safe width in pixels to print a web page?
My page includes large images and I want to make sure they will not be cut of when printed.
I know about different browser margins and US Lette..
I need to check when function was changed last time. I know how to check creation date (it is in function properties window in SQL Server Management Studio).
I found that in SQL Server 2000 it wasn't ..
After a successful import of an Eclipse-Android-Project into "Android Studio 1.4", I get the error
"Please select Android SDK"
when I click on the button to run the application in simulator, bu..
I'm using ASP.NET, some of my buttons just do redirects. I'd rather they were ordinary links, but I don't want my users to notice much difference in the appearance. I considered images wrapped by an..
I am new to Docker, and don't know how to run a java project with maven even though I have read many documents and tried many methods.
Should I build the image using Dockerfile?
What is the command..
Is it possible to turn on/off power supplies from USB manually with Linux?
There's this external USB cooling fan (the kind you use to cool yourself off, not the PC), and it would be nice to be able t..
I have been running into issues with the chrome autofill behavior on several forms.
The fields in the form all have very common and accurate names, such as "email", "name", or "password", and they a..
Is it possible to apply a custom background to each Listview item via the list selector?
The default selector specifies @android:color/transparent for the state_focused="false" case, but changing thi..
I have a UIView which is placed on the screen via several constraints. Some of the constraints are owned by the superview, others are owned by other ancestors (e.g. perhaps the view property of a UIVi..
Is there a standard way in .NET/C# to convert a datetime object to ISO 8601 format yyyy-mm-dd hh:mm:ss?
Or do I need to do some string manipulation to get the date string?..
Using this code I only have a fade in, I'm looking for how to add a fade out as well. I've added another xml called "fadeout" but I can't integrate it in my code.
ImageView imageView = (ImageView)fin..
I have read a similar post, but i just cant figure out the problem.
I have changed the windows permissions and changed routes.
When i try to save a file it throws me the exception:
Access to th..
How can I check to see if a database in SQL Server is case-sensitive? I have previously been running the query:
SELECT CASE WHEN 'A' = 'a' THEN 'NOT CASE SENSITIVE' ELSE 'CASE SENSITIVE' END
But I ..
I've been trying to figure out how to add the attribute "checked" to a checkbox on click. The reason I want to do this is so if I check off a checkbox; I can have my local storage save that as the htm..
I would like to add an image in my template for my ruby on rails project where i currenly have the code <img src="../../../public/images/rss.jpg" alt="rss feed" /> in a the layout stores.html.er..
I lost the source code from one project I did on the company I'm working for and haven't been able to find a Visual Basic 6 decompiler; does that even exists?
I only have the EXE that I've rescued fr..
I have a small function I found that takes a string from a textarea and then puts it into a canvas element and wraps the text when the line gets too long. But it doesn't detect line breaks. This is wh..
Set seems like a nice way to create Arrays with guaranteed unique elements, but it does not expose any good way to get properties, except for generator [Set].values, which is called in an awkward way ..
Let's say you don't want other sites to "frame" your site in an <iframe>:
<iframe src="http://example.org"></iframe>
So you insert anti-framing, frame busting JavaScript into all ..
I'm trying to format a date in yyyy-MM-dd'T'HH:mm:ss.SSSz format to yyyy-mm-dd HH:mm:ss, which should be easy but I can't get it to work.
A date that has to be parsed is in the form of: 2012-10-01T09..
I have written a bash script that takes an input file as an argument and reads it.
This file contains some paths (relative to its location) to additional files used.
I would like the script to go to..
I have a page with a row of about 10 imgs. For readability of the HTML, I want to put a linebreak in between each img tag, but doing so renders whitespace between the images, which I do not want. Is t..
I am looking for a way to get the user's current location (city) based on is IP address using the Google Maps APIs.
Something similar to http://freegeoip.net/json but only using the Google Maps APIs...
I have only found how to wait for user input. However, I only want to pause so that my while true doesn't crash my computer.
I tried pause(1), but it says -bash: syntax error near unexpected token '..
I am trying to create a JSON string representation of a class instance and having difficulty. Let's say the class is built like this:
class testclass:
value1 = "a"
value2 = "b"
A call to th..
I am using a Samsung galaxy nexus phone (Android 4.0 platform) .
I am developing Android app on Ubuntu linux OS. I would like to run my application directly on the Samsung handset device, so I perfor..
I am trying to add integers into an int array, but Eclipse says:
cannot invoke add(int) on the array type int[]
Which is completely illogical to me. I also tried addElement() and addInt(), howe..
IIS has an annoying feature for low traffic websites where it recycles unused worker processes, causing the first user to the site after some time to get an extremely long delay (30+ seconds).
I've b..
I'm working with wechat APIs ...
here I've to upload an image to wechat's server using this API
http://admin.wechat.com/wiki/index.php?title=Transferring_Multimedia_Files
url = 'http://file.api.we..
I have a function that returns a char array and I want that turned into a String so I can better process it (compare to other stored data). I am using this simple for that should work, but it doesn't ..
I just created sample BB app, which can allow to choose the date.
DateField curDateFld = new DateField("Choose Date: ",
System.currentTimeMillis(), DateField.DATE | DateField.FIELD_LEFT);
After c..
I'm developing Snake game using Java. Board's (where all action takes it place) width and height should be fixed (640 pixels * 480 pixels).
Structure:
Main class that extends from JFrame class,
Boa..
Yes, I know what you are thinking - yet another CORS question, but this time I'm stumped.
So to start off, the actual error message:
XMLHttpRequest cannot load http://localhost/Foo.API/token. The..
I cannot get onclick="location.href='link.html'" to load a new page in Safari (5.0.4).
I am building a drop-down navigation menu using the <select> and <option> HTML tags. I am using the ..
How do I add new record to DataGridView control in VB.Net?
I don't use dataset or database binding. I have a small form with 3 fields and when the user clicks OK they should be added to the DataGridV..
I have to disable inputs at first and then on click of a link to enable them.
This is what I have tried so far, but it doesn't work.
HTML:
<input type="text" disabled="disabled" class="inputDisa..
I come from PHP world, where declaring a function in the middle of a php page is pretty simple.
I tried to do the same in JSP:
public String getQuarter(int i){
String quarter;
switch(i){
case 1: ..
I deleted it by accident and have made many changes to package.json since. An npm install or npm update do not generate package-lock.json anymore. I tried clearing my npm cache and my nvm cache, but n..
i am still new on c# and i'm trying to create an application for this page that will tell me when i get a notification (answered, commented, etc..). But for now i'm just trying to make a simple call t..
I have a class named Fruit. I am creating a list of this class and adding each fruit in the list. I want to sort this list based on the order of fruit name.
public class Fruit{
private String fr..
I was googling about how to create a user and grant all privileges to him.
I found these two methods :
The first method :
create user userName identified by password;
grant connect to userName;
gra..
I get this error, but I don't know how to fix it.
I'm using Visual Studio 2013. I made the solution name MyProjectTest
This is the structure of my test solution:
-function.h
#ifndef MY_FUNCTION_H
#de..
I am thinking this may not be possible in Java because annotation and its parameters are resolved at compile time. I have an interface as follows,
public interface FieldValues {
String[] FIELD1 = ..
I'm working with JavaScript, JQuery and HTML. UI Of my project is completely dynamic. I am looking for a dynamic JavaScript/JQuery Grid which supports following features.
Can anybody tell me is there..
When I am using a proxy in webdriver like FirefoxDriver, if the proxy is bad then the get method will block forever. I set some timeout parameters, but this did not work out.
This is my code:
Firefo..
I've been using Bootstrap's carousel class and it has been straightforward so far, however one problem I've had is that images of different heights cause the arrows to bounce up and down to adjust to ..
My background - 4 weeks old in the Hadoop world. Dabbled a bit in Hive, Pig and Hadoop using Cloudera's Hadoop VM. Have read Google's paper on Map-Reduce and GFS (PDF link).
I understand that-
Pig'..
Although that link is disabled, it's still clickable.
<a href="/" disabled="disabled">123n</a>
Can I make it not-clickable if it's disabled? Should I use JavaScript necessarily?..
I HAVE READ apple documentation and it's not understandable for such a beginner in Objective-C as me. I'm trying to implement multicolumn UITableView following this link example and it just doesn't w..
I'm trying to select all the rows out of a database using entity framework for manipulation before they're sent to the form
var ptx = [modelname].[tablename]();
ptx.[tablename].Select(????)
what go..
Say I have a List like:
List<String> list = new ArrayList<>();
list.add("a");
list.add("h");
list.add("f");
list.add("s");
While iterating through this list I want to add an element at ..
Possible Duplicate:
Make error: missing separator
Have this code in makefile:
PROG = semsearch
all: $(PROG)
%: %.c
gcc -o $@ $< -lpthread
clean:
rm $(PROG)
and the error
missing sep..
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 changed the name of an app in Django by renaming its folder, imports and all its references (templates/indexes). But now I get this error when I try to run python manage.py runserver
Error: Co..
Probably an easy one but my prog skills are limited. I've created an account entry tool and want to warn the user if they've entered a credit amount for an Expenditure type of which there are two typ..
when am trying to read datetime type value from excel sheet it is returning a double value.for example if want to read value '2007-02-19 14:11:45.730' like this, i am getting a double type value .furt..
Can a main() method of class be invoked in another class in java?
e.g.
class class1{
public static void main(String []args){
}
}
class class2{
public static void main(String []args){
..
Let me explain my question first. I bought a certificate from a CA and used the following format to generate the csr and the private key:
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -..
top -c
Top lists all the processes, there are good options to filter the processes by username by using the option -u but I am wondering if there is any easy way to filter the processes based on pr..
I would like to store a command to use at a later period in a variable (not the output of the command, but the command itself)
I have a simple script as follows:
command="ls";
echo "Command: $comman..
Possible Duplicate:
The current element as its Event function param
Would this work
<script type="text/javascript">
var foo = function(param)
{
param.innerHTML = "Not a button";
..
I'm currently using the TextBlock below to bind the value of a property named Name:
<TextBlock Text="{Binding Name}" />
Now, I want to bind another property named ID to the same TextBlock.
I..
I am searching for a simple command to see logged on users on server.
I know this one :
Get-WmiObject -Class win32_computersystem
but this will not provide me the info I need.
It returns :
domain
M..
How do I configure sbt to use a proxy?
For example, my build definition needs to connect to GitHub, specifying connection parameters for http.proxy, http.proxyPort, user, and password.
How would I p..
I am not able to understand the difference between a kernel and an operating system. I do not see any difference between them. Is the kernel an operating system?..
..$ rails s
=> Booting WEBrick
=> Rails 4.0.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
A se..
When using this statement
create table demo (
ts timestamp
)
insert into demo select current_timestamp
I get the following error:
Cannot insert an explicit value into a timestamp column. U..
We have this json schema draft. I would like to get a sample of my JSON data and generate a skeleton for the JSON schema, that I can rework manually, adding things like description, required, etc, whi..
I build a function and I am trying to execute it...but some errors are occurring
CREATE FUNCTION dbo.Afisho_rankimin(@emri_rest int)
RETURNS int
AS
BEGIN
Declare @rankimi int
Select ..
I am making responsive website for school and my question is:
How do I set a max character length of the sentences (with CSS) on my website (like 75 characters) that when I have a very large screen, ..
Hello I need get client IP that request some method in web api,
I have tried to use this code from here but it always returns server local IP,
how to get in correct way ?
HttpContext.Current.Request..
I applied a custom font to a TextView, but it doesn't seems to change the typeface.
Here is my code:
Typeface myTypeface = Typeface.createFromAsset(getAssets(), "fonts/myFont.ttf");
TextView..
How would you initialise a static Map in Java?
Method one: static initialiser
Method two: instance initialiser (anonymous subclass)
or
some other method?
What are the pros and cons of each?
Here i..
My co-workers and I are having a problem using Firefox 3.0.6 to access a Java 1.6.0___11 web application we're developing. Everything works fine anywhere from 1-30 minutes into the session...but even..
I have a form where I have to post form values to my action class. In this form I have a checkbox that needs to be readonly. I tried setting disabled="true" but that doesn't work when posting to the a..
Whenever I try and run mycommand.exe from my windows cmd.exe terminal, I get this error:
''mycommand.exe' is not recognized as an internal or external command, operable program or batch file'
Th..
Cheers, I'm trying to get the current GPS-Location via Android. I followed this Tutorial and Vogellas article aswell. Though it ain't working. When using LocationManager.NETWORK_PROVIDER I'm always ge..
I understand that I can specify system properties to Tomcat by passing arguments with the -D parameter, for example "-Dmy.prop=value".
I am wondering if there is a cleaner way of doing this by specif..
What's the most pythonic way to scp a file in Python? The only route I'm aware of is
os.system('scp "%s" "%s:%s"' % (localfile, remotehost, remotefile) )
which is a hack, and which doesn't work o..
I am getting the following error. How do I resolve?:
git add .
git commit -m 't'
git push origin development
To [email protected]:myrepo.git
! [rejected] development -> developme..
I want to remove all special characters and spaces from a string and replace with an underscore.
The string is
var str = "hello world & hello universe";
I have this now which replaces only ..
To create a simple working PopupWindow, we need to do the following:
popup_example.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/ap..
I have worked on a local branch and also pushed the changes to remote. I want to revert the changes on that branch and do something else on it, but I don't want to lose the work completely. I was thin..
I have multiple IF statements that are independent of each other in my stored procedure. But for some reason they are being nested inside each other as if they are part of one big if statement
ELSE I..
Working my way through Effective STL at the moment. Item 5 suggests that it's usually preferable to use range member functions to their single element counterparts. I currently wish to copy all the va..
I always get this message when I would like access my phpMyAdmin.
w3m localhost/phpmyadmin
Forbidden
You don't have permission to access /phpmyadmin/ on this server.
Apache/2.2.15 (CentOS) Server ..
How can I use Unicode-aware regular expressions in JavaScript?
For example, there should be something akin to \w that can match any code-point in Letters or Marks category (not just the ASCII ones), ..
Is there a generator , or an easy way to generate text like this but without having to define every letter
So something like this:
_x000D_
_x000D_
.rainbow {_x000D_
background-image: -webkit-gradi..
I am not able to enable directory listing in my apache web server. I have tried various solutions posted but not working. I just freshly installed httpd 2.4.6 and enabled https using ssl.conf under /e..
With this simple class I am getting the compiler warning
Attempting to modify/access x within its own setter/getter
and when I use it like this:
var p: point = Point()
p.x = 12
I get an EXC_..
I created a local repository of my Visual Studio 2010 solution folder using Git GUI on my dev machine. I then created a remote repository in my GitHub account. Now, I am looking for how to push my loc..
Is there a way to create an instance of a particular class given the class name (dynamic) and pass parameters to its constructor.
Something like:
Object object = createInstance("mypackage.MyClass","..
Our TFS server has some temporary connectivity issues right now, and as such VS has gone unresponsive, leaving 50+ developers unable to work!
Is it possible to switch TFS into an offline mode in the ..
i have a wpf window where i have a stackpanel with two viewports in it - each Viewport with a textblock in it.
<Grid>
<StackPanel VerticalAlignment="Center" Orientation="Vertical" >
..
Why the following example shows the image in Firefox 4, but not in Chrome 10 and Internet Explorer 8?
HTML:
<div style="background-image: url('http://www.mypicx.com/uploadimg/1312875436_05012011_..
I have an untrusted string that I want to show as text in an HTML page. I need to escape the chars '<' and '&' as HTML entities. The less fuss the better.
I'm using UTF8 and don't need other ..
I've read about the difference between double precision and single precision. However, in most cases, float and double seem to be interchangeable, i.e. using one or the other does not seem to affect t..
Until now, I was working with Google Recaptcha v2, but now I want to update my WebApp using the lastest version (v3).
Is it possible to anyone add a fully working Google Recaptcha v3 example for a ba..
I have a dictionary, and would like to pass a part of it to a function, that part being given by a list (or tuple) of keys. Like so:
# the dictionary
d = {1:2, 3:4, 5:6, 7:8}
# the subset of keys I'..
I have a list where I want to replace values with None where condition() returns True.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
For example, if condition checks bool(item%2) should return:
[None, 1, Non..
I am trying to build a PDF file out of a binary stream which I receive as a response from an Ajax request.
Via XmlHttpRequest I receive the following data:
%PDF-1.4....
.....
....hole data represent..
IIS 7.5 , 2008rc2, classic asp, 500 error msg:
The page cannot be displayed because an internal server error has occurred.
I need to know how to configure IIS to get a more detailed error.
I've ..