I am testing Python threading with the following script:
import threading
class FirstThread (threading.Thread):
def run (self):
while True:
print 'first'
class SecondThread ..
I have a form with name orderproductForm and an undefined number of inputs.
I want to do some kind of jQuery.get or ajax or anything like that that would call a page through Ajax, and send along all ..
I tried to declare a Boolean variable in a shell script using the following syntax:
variable=$false
variable=$true
Is this correct? Also, if I wanted to update that variable would I use the same s..
Usually we can define a variable for a C++ struct, as in
struct foo {
int bar;
};
Can we also define functions for a struct? How would we use those functions?..
Is there a cleaner way to get the short version hash of HEAD from Git?
I want to see the same output as I get from:
git log -n 1 | head -n 1 | sed -e 's/^commit //' | head -c 8
I originally use..
According to the HTTP/1.1 Spec:
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-..
Possible Duplicate:
What is an undefined reference/unresolved external symbol error and how do I fix it?
Trying to compile my program via g++ -o prog1 main.cpp -std=c++0x
I get the error:
/tmp/cc1p..
I have a Join
SELECT * FROM Y
INNER JOIN X ON ISNULL(X.QID, 0) = ISNULL(y.QID, 0)
Isnull in a Join like this makes it slow. It's like having a conditional Join.
Is there any work around to somet..
My Select2 3.4.5 is not working with JSON data.
Here is my input box on HTML:
<input class='form-control col-lg-5 itemSearch' type='text' placeholder='select item' />
…and my JavaScript
$..
I want to replace an element into a specific position of a vector, can I just use an assignment:
// vec1 and 2 have the same length & filled in somehow
vec1;
vec2;
vec1[i] = vec2[i] // insert ve..
Part of a website's JSON response had this (... added for context):
{..., now:function(){return(new Date).getTime()}, ...}
Is adding anonymous functions to JSON valid? I would expect each time you..
I have problem with laravel view is not found by route function I did composer dumpautoload but no use
ArticleController.php
<?php
class ArticleController extends BaseController
{
public func..
I'm going through the Getting Started with Rails guide and got confused with section 6.7. After generating a scaffold I find the following auto-generated block in my controller:
def index
@posts = ..
I have following html in email template.
I am getting different view in MS Outlook and in gmail for the same.
<tr>
<td bgcolor="#7d9aaa" style="color: #fff; font-size:15px; font-family:..
I am trying to do a basic string replace using a regex expression, but the answers I have found do not seem to help - they are directly answering each persons unique requirement with little or no expl..
I was looking at the new features for Visual Studio 2015 and Shared Project came up a lot but I don't understand how it is different to using a Class Library or a Portable Class Library. Can anyone ex..
The question duplicates some older questions, but the things may have changed since then.
Is there some official support for connecting to SQL Server from Node.js (e.g. official library from MS)? Or ..
When I Ping a remote system with windows it says there is no reply, but when I ping with c# it says success. Windows is correct, the device is not connected. Why is my code able to successfully ping w..
I am currently using the following (clumsy) pieces of code for determining if a (non-empty) Swift dictionary contains a given key and for obtaining one (any) value from the same dictionary.
How can o..
I couldn't find anything about getting the total JSON record count using jQuery.
Here is the JSON returned:
{"Email":"Please enter your Email.","Password":"Please enter a password."}
Here is my cod..
I have a stored procedure as follows.
CREATE OR REPLACE PROCEDURE TEST(
X IN VARCHAR2 DEFAULT 'P',
Y IN NUMBER DEFAULT 1) AS
BEGIN
DBMS_OUTPUT.PUT_LINE('X'|| X||'--'||'Y'||Y);
END;
..
I am trying to make a button, such that when the user clicks on it, it changes its style while the mouse button is being held down. I also want it to change its style in a similar way if it is touched..
Suppose we have a HashMap<String, Integer> in Java.
How do I update (increment) the integer-value of the string-key for each existence of the string I find?
One could remove and reenter the pa..
In my main page I have dropdowns that show v-show=show by clicking on link @click = "show=!show" and I want to set show=false when I change route. Advise me please how to realize this thing...
I have seen lots of countdown timers in JavaScript and wanted to get one working in React.
I have borrowed this function I found online:
secondsToTime(secs){
let hours = Math.floor(secs / (60 * ..
Is there any way to plot a bar plot using matplotlib using data directly from a dict?
My dict looks like this:
D = {u'Label1':26, u'Label2': 17, u'Label3':30}
I was expecting
fig = plt.figure(..
Given an array [1, 2, 3, 4], how can I find the sum of its elements? (In this case, the sum would be 10.)
I thought $.each might be useful, but I'm not sure how to implement it...
Is there a way to find out how much time has passed since a web page was changed?
For example,
I have a page hosted at: www.mywebsitenotupdated.com
Is there a way to find out when this HTML page w..
Recently I started working with JWT based authentication. After user login, a user token is generated which will look like
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6I..
I am referring the following tutorial to make a login page for my web application.
http://code.tutsplus.com/tutorials/intro-to-flask-signing-in-and-out--net-29982
I am having issue with the database...
Go's standard library does not have a function solely intended to check if a file exists or not (like Python's os.path.exists). What is the idiomatic way to do it?..
I am trying to move something to /usr/bin on OS X El Capitan. I have disabled rootless using the following commands: sudo nvram boot-args="rootless=0"; sudo reboot, but I keep getting the same error:..
What is the meaning of polyfills in HTML5? I saw this word in many sites about HTML5, e.g. HTML5-Cross-Browser-Polyfills.
So here we're collecting all the shims, fallbacks, and polyfills
in orde..
I just started developing PHP projects on my mac (using PDT) and was wondering where localhost is located? How does Mac OS X serve websites, I haven't changed any settings during the installation of P..
DECLARE @dbName nvarchar(128) = 'myDb'
DECLARE @siteId int
exec ('SELECT TOP 1 @siteId = Id FROM ' + @dbName + '..myTbl')
select @siteId
When I run the script above I get the following error
Msg..
I'm attempting to run a cmake hello world program on Windows 7 x64 with both Visual Studio 2010 and Cygwin, but can't seem to get either to work. My directory structure is as follows:
HelloWorld
-- C..
Is it possible to store multiple different JSONObjects into a single JSONArray? This is the structure, I want to store in a JSONArray.
[{"value1":1,"value2":900,"value3":1368349},{"value1":2,"value2"..
Can someone please instruct me on the easiest way to change the font size for the text in a UITableView section header?
I have the section titles implemented using the following method:
- (NSString ..
You can have 80-characters / right margin line in Netbeans, Text Mate and probably many, many more other IDEs. Is it possible to have it in Sublime Text 3 as well? Any option, plugin etc.?..
I need to find the first blank row in a workbook and write information to (row, 1) and (row, 2). I think I'm currently pretty stuck...
Function WriteToMaster(num, path) As Boolean
'Declare variables..
How do you read a CSV file and display the results in a grid in Visual Basic 2010? This sounds so simple but I still can't find the answer to it after googling for a while. I have DataGridView on a fo..
I have always been wondering how other people get to align to the centre the main div container as the only way I manage so far is adding to the css file the following:
*{
padding:auto;
margin:auto;
..
I was wondering how we can make a HTML element like <div> or <p> tag element resizable when clicked using pure JavaScript, not the jQuery library or any other library...
How do I determine if two jQuery objects are equal? I would like to be able to search an array for a particular jQuery object.
$.inArray(jqobj, my_array);//-1
alert($("#deviceTypeRoot") == $("#de..
Apologies in advance for the potential n00b questions, I am trying to install the mcrypt extension for PHP on my OSX Mountain Lion machine.
The following steps in terminal is what I have done so far ..
I have a JET table with an auto-number as the primary key, and I would like to know how I can retrieve this number after inserting a row. I have thought of using MAX() to retrieve the row with the hi..
I have the following error with one of our web applications -
Query3 failed: Error writing file '/tmp/MY1fnqpm' (Errcode: 28) ... INSERT MailList... (removed the rest of the query for security reaso..
I want to write a shell script (.sh file) to get a given process id. What I'm trying to do here is once I get the process ID, I want to kill that process. I'm running on Ubuntu (Linux).
I was able to..
I have a batch file that I intend to distribute to our customers to run a software task.
We distribute them as a folder or .zip with the files inside. Inside, there is the batch files and another fo..
I've started programming today and have this issue with Python. It's pretty dumb but I can't figure out how to do it. When I use the print command, it prints whatever I want and then goes to a differe..
I would like to troubleshoot per directory authentication with client certificate. I would specially like to find out which acceptable client certificates does server send.
How do I debug SSL handsha..
Is there any way to remove "Server" response header from IIS7? There are some articles showing that using HttpModules we can achieve the same thing. This will be helpful if we don't have admin right t..
I installed Ubuntu 14.04 (Trusty Tahr) yesterday. Everything seems OK. But when I tried to compile some C code, I encounter the following error. The error seems to be due to the OS lacking the 32-bit ..
I am able to display sweet alert after the page refresh but I have to click on Ok button which I am getting on sweet alert to redirect the page.Please help me in this.
<?php
echo '<script ..
I was looking into Valgrind to help improve my C coding/debugging when I discovered it is only for Linux - I have no other need or interest in moving my OS to Linux so I was wondering if there is a eq..
Using the code below leaves me with an open connection, how do I close?
import pyodbc
conn = pyodbc.connect('DRIVER=MySQL ODBC 5.1 driver;SERVER=localhost;DATABASE=spt;UID=who;PWD=testest')
csr..
Suppose from index.py with CGI, I have post file foo.fasta to display file. I want to change foo.fasta's file extension to be foo.aln in display file. How can I do it?..
Intersect can be used to find matches between two collections, like so:
// Assign two arrays.
int[] array1 = { 1, 2, 3 };
int[] array2 = { 2, 3, 4 };
// Call Intersect extension method.
var intersect..
How can I disable cors? For some reason I wild carded the allowed origins and headers yet my ajax requests still complain that the origin was not allowed by my CORS policy....
My applications control..
Why does pandas make a distinction between a Series and a single-column DataFrame?
In other words: what is the reason of existence of the Series class?
I'm mainly using time series with datetime ind..
Is it possible to increase the width of a scrollbar on a <div> element placed inside the <body>?
I am not talking about the default scrollbar on the browser itself, this page runs in full..
I'm having trouble converting a UTC Time or TimeWithZone to local time in Rails 3.
Say moment is some Time variable in UTC (e.g. moment = Time.now.utc). How do I convert moment to my time zone, takin..
I am a registered iOS developer and a developer friend of mine is trying to send me a testflight version.
For some reason he can't sent me an invitation - I believe this is because I am registered as..
I want to integrate Marketo form with my existing website on yii framework.
My code works on all the browsers except Firefox.
Excerpt from my code:
$('#button').click(function () {
var formD..
I want to write a regular expression for a standard US type phone number that supports the following formats:
###-###-####
(###) ###-####
### ### ####
###.###.####
where # means any number. So far ..
I'm trying to track down a bug that's deleting rows in a mysql table.
For the life of me I can't track it down in my PHP code, so I'd like to work backwards by finding the actual mysql query that's ..
Directory is something like:
home/
file1.html
file2.html
Another_Dir/
file8.html
Sub_Dir/
file19.html
I am using the same PHP Zip class used in PHPMyAdmin http://trac.seagul..
This is a beginner's question.
What's the difference between ^ and **?
For example:
2 ^ 10
[1] 1024
2 ** 10
[1] 1024
Is there a function such as power(x,y)?
..
I'm running Mountain Lion and the basic default Python version is 2.7. I downloaded Python 3.3 and want to set it as default.
Currently:
$ python
version 2.7.5
$ python3.3
version 3.3
How ..
I want to uninstall Eclipse version Mars 2, but it doesn't appear in the "Programs and Features" area of the Windows Control Panel. The installer has installed start menu shortcuts and other artifacts..
how can I display a layout in the center with slideUp when I press the button, and press again to hide ... slideDown in ANDROID
help me with that, thnkss..
I've searched the documentation but only found this:
Link. Which is used to make the bar translucent? What I'm trying to do is to make the status bar completely transparent (as shown in the image belo..
I have two questions:
How can I force IE10 to render in IE9 document mode? Currently it's rendering my page in Standard document mode.
In IE10's developer toolbar, I am not able to see the option of..
I have a list of objects and I need to save that somewhere in my computer. I have read some forums and I know that the object has to be Serializable. But it would be nice if I can get an example. For ..
Although I have no problem whatsoever understanding recursion, I can't seem to wrap my head around the recursive solution to the Tower of Hanoi problem. Here is the code from Wikipedia:
procedure Ha..
I am trying to add additional text to the end of a paragraph using jQuery. My thought was to produce a structure like this:
Judging by my answers I will clarify. I need to create this structure first..
touch is a Unix utility that sets the modification and access times of files to the current time of day. If the file doesn't exist, it is created with default permissions.
How would you implement it..
Problem statement:
I am trying to access an REST API that will return a JSON object for various HTTP status codes (400, 403, 200 etc) using Volley.
For any HTTP status other than 200, it seems the '..
I have heard lots of raving about Akka framework (Java/Scala service platform), but so far have not seen many actual examples of use cases it would be good for. So I would be interested in hearing abo..
I'm trying to redirect all insecure HTTP requests on my site (e.g. http://www.example.com) to HTTPS (https://www.example.com). I'm using PHP btw. Can I do this in .htaccess?..
Is there a way in which we can implement onBackPressed() in Android Fragment similar to the way in which we implement in Android Activity?
As the Fragment lifecycle do not have onBackPressed(). Is th..
I have come across this problem several times in which I would like to have multiple versions of the same file in the same directory. The way I have been doing it using C# is by adding a time stamp to..
Please suggest pyspark dataframe alternative for Pandas df['col'].unique().
I want to list out all the unique values in a pyspark dataframe column.
Not the SQL type way (registertemplate then SQL qu..
Is it possible to get git to produce a diff between a specific file as it exists now, and as it existed before the last commit that changed it?
That is, if we know:
$ git log --oneline myfile
123abc..
I am novice in javascript and jQuery.
In my html have 2 radio buttons and one div. I want to show that div if I check the first radio-button but otherwise I want it to be hidden
so: If radio button #..
How to return HTML from ASP.NET MVC Web API controller?
I tried the code below but got compile error since Response.Write is not defined:
public class MyController : ApiController
{
[HttpPost]
..
This question has been edited due to lengthy comments and updates from proposed answers.
As requested here is module 13;
Sub SaveInFormat()
Application.DisplayAlerts = False
Workbooks.Application.Ac..
How can I can convert my JS Object to FormData?
The reason why I want to do this is, I have an object that I constructed out of the ~100 form field values.
var item = {
description: 'Some Item',..
What is the proper way to get a list of all available serial ports/devices on a Linux system?
In other words, when I iterate over all devices in /dev/, how do I tell which ones are serial ports in th..
I have an associative array in the form key => value where key is a numerical value, however it is not a sequential numerical value. The key is actually an ID number and the value is a count. This ..
I need to develop a process that will detect if the users computer has certain programs installed and if so, what version. I believe I will need a list with the registry location and keys to look for ..
Hi read all the included documentation here in https://laravel.com/docs/5.4/migrations.
Is there a way on how to migrate a certain migration file (1 migration only), cause right now every time there ..
If I define a Ruby functions like this:
def ldap_get ( base_dn, filter, scope=LDAP::LDAP_SCOPE_SUBTREE, attrs=nil )
How can I call it supplying only the first 2 and the last args? Why isn't somethi..
I've tried so may ways on the Internet to append a character to a char* but none of them seems to work. Here is one of my incomplete solution:
char* appendCharToCharArray(char * array, char a)
{
..
I need a batch file which will do the following:
1. Open CMD and navigate to a location C:/Users/...../program.exe
2. Run the program.exe with an additional command to point it to a config file:
e.g...
What would be the best way to calculate someone's age in years, months, and days in T-SQL (SQL Server 2000)?
The datediff function doesn't handle year boundaries well, plus getting the months and day..
Here's what I'm using. The token doesn't necessarily have to be heard to guess, it's more like a short url identifier than anything else, and I want to keep it short. I've followed some examples I've ..
So I have an input field, if it's blank, I want its value to be the words "empty", but if there is any value inputted, I want the value to be the inputted value. I want to use javascript for this, any..
I've been looking around a fair bit for an answer. I'm going to make a series of my own string functions like my_strcmp(), my_strcat(), etc.
Does strcmp() work through each index of two arrays of cha..
I have created a web system using Java Servlets and now want to make JUnit testing. My dataManager is just a basic piece of code that submits it to the database. How would you test a Servlet with JUni..
Here are the files that I use:
component.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchem..
Using the React.findDOMNode method that was introduced in v0.13.0 I am able to get the DOM node of each child component that was passed into a parent by mapping over this.props.children.
However, if ..
I am currently creating and reading a DataTable with the following code in my Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["AllFeatures1"] == null)
{
S..
I used the strcpy() function and it only works if I use C-string arrays like:
char a[6] = "text";
char b[6] = "image";
strcpy(a,b);
but whenever I use
string a = "text";..
We use the code below to inject Spring beans with properties from a properties file.
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name=..
I want to create a series of lists, all of varying lengths. Each list will contain the same element e, repeated n times (where n = length of the list).
How do I create the lists, without using a list..
I have two use cases.
A. I want to synchronise access to a queue for two threads.
B. I want to synchronise access to a queue for two threads and use a condition variable because one of the threads wil..
I've been experimenting with React. In my experiement, I'm using the Reactstrap framework.When I click a button, I've noticed that the HTML form submits. Is there a way to prevent form submission when..
I saw a lot of questions about methods of using git blame, but I don't really understand them.
I see a Blame button on top of files on the GitHub interface. Upon clicking it, it shows some diff with ..
I have a close link on my web page. I would like to function it to close the current tab when click it. I have written
<a href="#" onclick = "javascript:self.close();">close</a>
The abo..
My code is like this:
if( ($this->master=socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) < 0 )
{
die("socket_create() failed, reason: ".socket_strerror($this->master));
}
when I r..
I have a Facebook Page that I want to get some things from it. First thing are feeds and from what I read they are public (no need for access_token). But I want to also get the events... and they aren..
I want to use curl to view the source of a page and if that source contains a word that matches the string then it will execute a print. How would I do a if $string contains?
In VB it would be like.
..
How can I get the e.printStackTrace() and store it into a String variable?
I want to use the string generated by e.printStackTrace() later in my program.
I'm still new to Java so I'm not too familiar..
I know it can be done, but I never remember how.
How can you reimport a module in python?
The scenario is as follows: I import a module interactively and tinker with it, but then I face an error. I ..
I have a JSON file I want to convert to a CSV file. How can I do this with Python?
I tried:
import json
import csv
f = open('data.json')
data = json.load(f)
f.close()
f = open('data.csv')
csv_file =..
why
getRequestDispatcher(String path) of
the ServletRequest interface cannot
extend outside the current servlet
context
where as
getRequestDispatcher(String path) of
the ServletCon..
OK, so I know there are tons of articles stating I shouldn't use DOUBLE to store money on a MySQL database, or I'll end up with tricky precision bugs. The point is I am not designing a new database, I..
This is PascalCase: SomeSymbol
This is camelCase: someSymbol
This is snake_case: some_symbol
So my questions is whether there is a widely accepted name for this: some-symbol? It's commonly used in ..
I managed to create a little mess in my local git repository. I was trying to fix a broken commit by using the following instructions. Before running the "git commit --amend" (and after the git rebase..
I have problem. I need to write a program in .Net Core(C#) which use app.config like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section..
I'm getting an error in React Native saying it can't resolve a module. It's saying a certain folder doesn't exist but the path isn't accurate. It is telling me that Directory /Users/user/Desktop/RNApp..
I sometimes get this message in the logs of Xcode 8b3 when running my app, everything seems to work, but I'd like to know where this comes from. Google did not help at all...
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..
I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use.
Since supposedly char columns of a fixed width are more efficient, I was thi..
I am trying find a way to ignore the certificate check when request a Https resource, so far, I found some helpful article in internet.
But I still have some problem. Please review my code. I just d..
I'm trying to extract a certain (the fourth) field from the column-based, 'space'-adjusted text stream. I'm trying to use the cut command in the following manner:
cat text.txt | cut -d " " -f 4
Unf..
I'm trying to build a simple calculator in Angular in which I can override the total if I want. I have this part working but when I then go back to enter in a number in fields one or two the total isn..
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm..
I want to perform a Shapiro-Wilk Normality Test test. My data is csv format. It looks like this:
heisenberg
HWWIchg
1 -15.60
2 -21.60
3 -19.50
4 -19.10
5 -20.90
6 -20.70
7 -..
Which annotation, @Resource (jsr250) or @Autowired (Spring-specific) should I use in DI?
I have successfully used both in the past, @Resource(name="blah") and @Autowired @Qualifier("blah")
My instin..
Bootstrap 3 is still at RC, but I was just trying to implement it. I couldn't figure out how to put a sub menu class. Even there is no class in css and even the new docs don't say anything about it
I..
I am storing a SQL query in my strings.xml file and I want to use String.Format to build the final string in code. The SELECT statement uses a like, something like this:
SELECT Field1, Field2 FROM m..
I am trying to print out Python path folders using this:
import sys
print sys.path
The output is like this:
>>> print sys.path
['.', '/usr/bin', '/home/student/Desktop', '/home/student/my..
I am very new to django and was able to finish the tutorial on djangoproject.com without any errors. I am now going through the Django REST framework tutorial found at http://www.django-rest-framework..
I am attempting to detect a change on ngModel in a <select> tag. In Angular 1.x, we might solve this with a $watch on ngModel, or by using ngChange, but I've yet to understand how to detect a ch..
Is it possible in MS SQL Server 2008 to export database structure into a T-SQL file?
I want to export not only tables schema but also primary keys, foreign keys, constraints, indexes, stored procedu..
I am redirecting from a controller to another controller. But I also need to pass model attributes to the second controller.
I don't want to put the model in session.
Please help...
I want to allow allow_url_fopen on my server . I have asked my host and they said it can be done with a .htaccess file. Can anyone tell me how to go about this ?..
While working with browser events, I've started incorporating Safari's touchEvents for mobile devices. I find that addEventListeners are stacking up with conditionals. This project can't use JQuery.
..
I am getting this error
java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=map/CareMonths, offset=6
My Eclipse's Java compiler is set to 1.6 and my installed Java SDK in C:\..
I have a form showing progress messages as a fairly long process runs. It's a call to a web service so I can't really show a percentage complete figure on a progress bar meaningfully. (I don't particu..
How can I access the images stored inside public/images folder without the use of Laravel's own functions like assets()?
I just want to get the direct URL of the images stored in images folder.
Eg:..
I have a code:
int MonthNow = System.DateTime.Now.Month;
int YearNow = System.DateTime.Now.Year;
int DayNow = System.DateTime.Now.Day;
How can I get yesterday and tomorrow day, month and year in C#..
So far I have the following model:
class Listing extends Eloquent {
//Class Logic HERE
}
I want a basic function that retrieves the first 10 rows of my table "listings" and passes them on to t..
I'm not certain when this first occured.
I have a new drop-shipping affiliate website, and receive an exported copy of the product catalog from the wholesaler. I format and import this into Prestasho..
I am coding a program that reads data directly from user input and was wondering how could I (without loops) read all data until EOF from standard input. I was considering using cin.get( input, '\0' )..
I have an NFS-mounted directory on a Linux machine that has hung. I've tried to force an unmount, but it doesn't seem to work:
$ umount -f /mnt/data
$ umount2: Device or resource busy
$ umount: /mnt/..
I am working on file operations using python.
I have a filepath as :
filepath = "E:/ABC/SEM 2/testfiles/all.txt"
when I am opening the file using python, it says me :
IOError: No such file:..
I'd like to generate random unique strings like the ones being generated by MSDN library.(Error Object), for example. A string like 't9zk6eay' should be generated...
How do I grant a user DBA rights in Oracle? I guess something like:
CREATE USER NewDBA
IDENTIFIED BY passwd;
GRANT DBA TO NewDBA WITH ADMIN OPTION;
Is it the right way, or.....
I have a string containing the UNIX Epoch time, and I need to convert it to a Java Date object.
String date = "1081157732";
DateFormat df = new SimpleDateFormat(""); // This line
try {
Date expiry ..
I have an array of integers.
For example:
array = [123,321,12389]
Is there any nice way to get the sum of them?
I know, that
sum = 0
array.each { |a| sum+=a }
would work...
Using PHP, what's the fastest way to convert a string like this: "123" to an integer?
Why is that particular method the fastest? What happens if it gets unexpected input, such as "hello" or an array?..
I'd really like to be able to print out valid SQL for my application, including values, rather than bind parameters, but it's not obvious how to do this in SQLAlchemy (by design, I'm fairly sure).
H..
In Java, is it legal to call remove on a collection when iterating through the collection using a foreach loop? For instance:
List<String> names = ....
for (String name : names) {
// Do som..
In Sql Server, often times when I'm testing the body of a stored procedure, I copy the body into SSMS, DECLARE the variables at the top of the page, set them to some sample values, and execute the bod..
In my app, I write to an excel file. After writing, the user is able to view the file by opening it. But if the user forgets to close the file before any further writing, a warning message should appe..
How can I play an .mp3 and a .wav file in my Java application? I am using Swing. I tried looking on the internet, for something like this example:
public void playSound() {
try {
AudioInp..
I have a Flash project, and it has many source files. I have a fairly heavily-used class, call it Jenine. I recently (and, perhaps, callously) relocated Jenine from one namespace to another. I thought..
How do I fire a server side button click event from JavaScript?
I tried like this:
document.getElementById("<%= ButtonID.ClientID %>").click();
But no use. How can I do it?..
How to handle a back button in an activity? I have some buttons. If I click one of the button it's redirecting to the buttons which I required. It's working fine but When I press back button it gets f..
I have a javascript function:
function myFunction(value1,value2,value3)
{
//Do stuff and
value2=somevalue2 //to return
value3=somevalue3 //to return
}
function call in Code:
....
..
How would I remove the border from an iframe embedded in my web app? An example of the iframe is:
<iframe src="myURL" width="300" height="300">Browser not compatible.</iframe>
I would l..
I compiled a jar file in one project so it can be consumed in the 2nd one. I can see the jar file in .m2 folder. But in the 2nd project it complains about artifact not found.
I guess I have to force ..
For example, I recently came across this in the linux kernel:
/* Force a compilation error if condition is true */
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
So, in ..
Naturally, for bool isprime(number) there would be a data structure I could query.
I define the best algorithm, to be the algorithm that produces a data structure with lowest memory consumption for th..
I want to change my Anaconda Prompt User file path. Currently it is as follows:
I want it to change to: C:\Users\u354590
How do I do this?
The current version of anaconda I have is:
Python 3.6..
For instance, if you were to run a Python script you would type python filename.py or if you wanted to run a C program make filename then ./ filename. How do you do this with .js files?..
Before you mark it as duplicate please read my problem:
I am trying to import a class from a file from a subdirectory
> main.py
> --->folder/
> ----->file.py
and in file.py i have a c..
How do I restart MySQL on Windows 7?
I'm using HeidiSql as a front end and there's no option in there.
The only other things I have is the MySQL 5.5 command line client...
I want to get current time in a specific format with javascript.
With the function below and calling it will give me
Fri Feb 01 2013 13:56:40 GMT+1300 (New Zealand Daylight Time)
but I want to forma..