I have the following TSQL Statement:
SELECT ProductId, OwnerId FROM Product
How I can store the ProductId and OwnerId in a TSQL variable and then return it to the calling application?
Let's say that on the C++ side my function takes a variable of type jstring named myString. I can convert it to an ANSI string as follows:
const char* ansiString = env-GetStringUTFChars(myString, 0);
is there a way of getting
const wchar_t* unicodeString = ...
Hi,
I need to use volume buttons to control a variable parameter in my application.
I use Activity.onKeyDown to get notified when the button is pressed but the media volume is also increased.
Android is doing something like below when I press the volume key:
1. increase media / ringtone volume
2. pass the event to my application
Is there a way to avoid increasing the system volume and use volume key only for my application ?
Thanks
This should be really simple but I'm a javascript/jQuery rookie, so here we go:
With the following code I can select a certain element
var user = $(".ui-selected .user-name").html();
But if there are multiple elements with the above classes, only the first value gets selected. What I would like to accomplish is a variable with all the elements seperated by a , like: user1,user2,user3 ... etc.
Any help would be greatly appreciated, thanks in advance!
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
system("pause");
return main();
}
The above works,but it hardcoded the main(),is there a magic variable to get the current running function?
We can replace strings in a batch file using the following command
set str="jump over the chair"
set str=%str:chair=table%
These lines work fine and change the string "jump over the chair" to "jump over the table". Now I want to replace the word "chair" in the string with some variable and I don't know how to do it.
set word=table
set str="jump over the chair"
??
Any ideas?
Lets say I have a variable that will always be a string.
Now take the code below:
if($myVar === "teststring")
Note $myVar will always be a string, so my questions is
Which is quicker/best, using === (Indentity) or the == (Equality)?
Dumb question, but whenever you call new, do you always have a pointer?
SomeClass *person = new SomeClass();
And is that because you need a pointer to point to that new space of memory that was allocated for the SomeClass variable person? Thanks!
Please help me with this problem. I'm new in extJs and i need a little help.
I have this code
Ext.onReady(function() {
var datesStore = new Ext.data.JsonStore({
start : 'StartTableDate',
end : 'FinishTableDate',
autoLoad : true,
proxy : new Ext.data.HttpProxy({
url : 'dates.json',
method:'GET'
}),
fields : [
// 2 mandatory fields
{name:'StartTableDate'},
{name:'FinishTableDate'}
]
});
// i want to pass to variable start si end the values from JSON
var start = 'StartTableDate';
var end = 'FinishTableDate';
I am having trouble believing the following code is the most efficient way to move a value from the stack to ST(0):
.data
var dd 4.2
tmp dd ?
.code
mov EAX, var
push EAX
; top of stack now contains a value
; move it to ST(0)
pop EAX
mov tmp, EAX
fld tmp
Is the temporary variable really necessary? Further, is there an easier way to get a value from the stack to ST(0)?
Hi, this is an intermitent problem in my Sony Vaio model PCG-5K1L. I keep on getting a "No Audio Output Device is installed" when hovering my loudspeaker icon in Windows Vista.
I have tried System Device Manager Sound Realtek High Definition Album Update Driver Software. The update process went through, but nothing happens. Still Vista does not seem to recognize my audio software.
The strange part is that out of nothing my sound card can resume working to stop again hours later... If someone has any clues to solve this, please, help. Thanks a lot.
When a Cocoa NIB file instantiates an instance of a custom controller object, what is the name of the variable that that custom controller instance is assigned to?
In case that isn't clear, if you manually created an instance of that class you would do:
MyControllerClass *myVar = [[MyControllerClass alloc] init];
What equivalent of "myVar" has the NIB used when doing this behind the scenes?
DatarowsForOneDay = dt.Select(
dt.Columns[0].Caption + "='" + x.ToString("dd/MM/yyyy HH") + "'");
doesn't work, but
DatarowsForOneDay = dt.Select(
dt.Columns[0].Caption + "='" + x.ToString("dd/MM/yyyy") + "'");
works.
So how can I select the date with a same hour?
Variable x type is DateTime.
I want to generate a bat file for multiple tag processing and the command lines look like this:
"C:\Program Files (x86)\tools\tag.exe" -t Genre="%genre%" "%_folderpath%\%track%. %title%.%_extension%"
IF ERRORLEVEL==1 PAUSE
I can populate all variables automatically but can I replace the %title% variable with a wildcard?
I'm writing a page that does very simple search queries, resulting in something like:
SELECT * FROM my_table WHERE A in (a1, a2, a3) AND B in (b1, b2) AND C in (c1, c2, c3, c4) AND
And so on for a variable number of columns, usually ~5. If I create a separate index for each column (one for A, one for B, one for C, not (A,B,C)), will all of them be used in the above query?
Hello!
I want to enable debug (DEBUG = True) For my Django project only if it runs on localhost. How can I get user IP address inside settings.py? I would like something like this to work:
#Debugging only on localhost
if user_ip = '127.0.0.1':
DEBUG = True
else:
DEBUG = False
How do I put user IP address in user_ip variable inside settings.py file?
Hi guys,
I am having a string which contains more the 25 characters;
NSString *str = @"This is the string to be truncated to 15 characters only";
In the above string I need only the 15 characters to be stored in another variable after truncation.
can anyone suggest me how to do this?
Anyone's help will be much appreciated.
Thank you,
Monish
I thought about this: Is there a performance difference in these two practices:
Store the return value of a function in a temporary variable than
give that variable as a parameter to another function.
Put the function into the other function.
Specification
Assuming all classes and functions are written correctly.
Case 1.
ClassA a = function1();
ClassB b = function2(a);
function3(b);
Case 2.
function3(function2(function1()));
I know there aren't a big difference with only one run, but supposed that we could run this a lot of times in a loop, I created some tests.
Test
#include <iostream>
#include <ctime>
#include <math.h>
using namespace std;
int main()
{
clock_t start = clock();
clock_t ends = clock();
// Case 1.
start = clock();
for (int i=0; i<10000000; i++)
{
double a = cos(1);
double b = pow(a, 2);
sqrt(b);
}
ends = clock();
cout << (double) (ends - start) / CLOCKS_PER_SEC << endl;
// Case 2.
start = clock();
for (int i=0; i<10000000; i++)
sqrt(pow(cos(1),2));
ends = clock();
cout << (double) (ends - start) / CLOCKS_PER_SEC << endl;
return 0;
}
Results
Case 1 = 6.375
Case 2 = 0.031
Why is the first one is much slower, and if the second one is faster why dont we always write code that way? Anyway does the second pratice has a name?
I also wondered what happens if I create the variables outside the for loop in the first case, but the result was the same. Why?
I am working in flex and I am just setting a variable to false. It doesnt do anything in the program but everything breaks when I put this line of code in:
somevar = false;
Does anyone know why?
We have server on Python and client + web service on Ruby. That works only if file from URL is less than 800 k. It seems like "socket.puts data" in a client works, but "output = socket.gets" - not. I think problem is in a Python part. For big files tests run "Connection reset by peer". Is it buffer size variable by default somewhere in a Python?
I have a Range variable that contains an address - $2:$2,$4:$205,$214:$214 - (3 groups of rows).
I would like to get the count of all the rows in that range.
However, range.Count gives me the count of all the cells (50,000~) and range.Rows.Count only return 1 - the count of all the rows in the first group. How do I get the count of all the rows
Thanks
use sed to replace every occurrence of /dir with $dir (replace / with $) in every script in a directory.
sed "s#/dir#$dir#g"
The $ keeps being interpreted as a function or variable call.
Is there a way around this?
thanks
How do I convert the value of a PHP variable to string? I was looking for something better than concatenating with an empty string:
$myText = $myVar . '';
like the ToString() method in Java or .NET.