For clarification: I know how evil globals are and when not to use them :)
Is there any performance penalty when accessing/setting a global variable vs. a local one in a compiled C++ program?
How do I parameterize a query containing an IN clause with a variable number of arguments, like this one?
select * from Tags
where Name in ('ruby','rails','scruffy','rubyonrails')
order by Count desc
In this query, the number of arguments could be anywhere from 1 to 5.
I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some fancy SQL Server 2008 specific way of doing it elegantly, I am open to that.
I have HTML content stored in a variable. How do I extract data that is found between a set of common tags in the page? For example, I am interested in the data (represented by DATA kept between a set of tags which one line after the other:
...
<td class="jumlah">*DATA*</td>
<td class="ud"><a href="">*DATA*</a></td>
...
if i have defined a global variable(with initialization) in header file, and included this file in two file and try to compile and link, compiler gives linking error
-----------------
>>headers.h
#ifndef __HEADERS
#define __HEADERS
int x = 10;
#endif
>>1.c
#include "headers.h"
main ()
{
}
---------------------
>>2.c
#include "headers.h"
fun () {}
<script ID="clientEventHandlersVBS" LANGUAGE="vbscript">
s=pass()
y=s
</script>
<%
session("password")=y
Response.write(session("password"))
Response.write(y)
%>
i have this code. but nothing is getting stored inside the session variable neither anything is getting printed. cant i access the variables declared outside the asp code or is their any syntax mistake. any help is really appreciated
Hi all,
I'm trying to setup a simple logging framework in my shell scripts. For this I'd like to define a "log" function callable as
log "LEVEL" $message
Where the message is a variable to which I have previously redirected the outputs of executed commands. My trouble is that I get errors with the following
{message=command 2&3 1&3 3&-} &3
log "INFO" $message
There's something wrong isn't there?
TIA
How to create a new data type which to can check/validate its schema when is created a new variable (of that type)?
By example, to validate if a string has 20 characters, I tried:
{{{
// Format: 2006-01-12T06:06:06Z
func date(str string) {
if len(str) != 20 {
fmt.Println("error")
}
}
var Date = date()
type Account struct {
domain string
username string
created Date
}
}}}
but it faills because Date is not a type.
In scripting languages like Perl, it is possible to read a file into a variable in one shot.
open(FILEHANDLE,$file);
$content=<FILEHANDLE>;
What would be the most efficient way to do this in C++?
Suppose this is my URL route:
(r'^test/?$','hello.life.views.test'),
How do I make it so that people can do .json, .xml, and it would pass a variable to my views.test, so that I know to make json or xml?
I have a program that I'm working on that register global hotkeys
I would like to use that ability to trigger highlighted text or data to be copied to the clipboard and then read from the clipboard into a variable in my program
which i will later use in reverse to paste it back out.
(example ctrl+1 copys to quque #1 and alt+1 pasts what is in quque 1)
thanks so much.
Is there any possibility to copy variable by reference no matter if its int or class instance?
My goal is to have two lists of the same objects and when one changes, change is visible in second.
In other words i need pointers:/
On my page.
i have one textbox and one button.
-- on the button click event. -- one function will be called.
Now,
How to get that value of textbox and store in php variable? this should be done in that function which we will call on button click.
Hello,
GNU Emacs 23.1.1
I am maintaining someones code. There are many files and directories for the headers and source files.
I am wondering if there is a easy way to use emacs that when I highlight a variable name I can go straight to where it is declared?
Some of the structures I am working in are declared in other header files, rather than go searching for them, I just want to be taken straight to them.
Many thanks for any suggestions,
hi, i saw this post today: http://stackoverflow.com/questions/112796/how-to-view-contents-of-nsdictionary-variable-in-xcode-debugger. i need to see the contents of a dictonary but i only know the "key"...is there a way i can spit out the details like a print_r in php? po gives me the object, but i would like to go deeper
po 0x2027c0
NSCFDictionary
Hi ,
I wanted to know if there is any system variable which is can use to access package execution start and end times. My requirement is that i need to store this in 2 relevant fields in a table in the database.
Thank you.
Abhi
Hey,
I want to include a file to be accessible to any method/function in a PHP class. The file just contains a base-64 encoded variable. How do I do this?
Thanks.
Is it possible to store a type name as a C++ variable? For example, like this:
type my_type = int; // or string, or Foo, or any other type
void* data = ...;
my_type* a = (my_type*) data;
I know that 99.9% of the time there's a better way to do what you want without resorting to casting void pointers, but I'm curious if C++ allows this sort of thing.
Hi
I am doing this in my Main Thread:
CCAnimation *anim; //class variable
[NSThread detachNewThreadSelector:@selector(loadAimation) toTarget:self withObject:nil];
In loadAimation:
-(void) loadAimation {
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
anim = [[CCAnimaton alloc] init];
[autoreleasepool drain];
}
And in main thread I release it:
[anim release];
Now I want to ask if this is fine regarding memory management.
I've developed a website in php codeigniter with the idea of using single physical instance of the code.
Here the logic i wanted to be is on login page user will chose the companyid which will be internally to the database name.
I want to know how to update the active_group variable according to the company id chosen by the user at the time of login.
Is there any way to do so.
Hello - I have an image that is currently stored in variable of type "File"..
File img = ...;
What is the easiest way to display this image onto the screen so I can verify it is working correct?
Thanks!
int NM_Generator = 1;
//Aray to store thread handles
HANDLE Array_Of_Thread_Handles[1];
//variable to hold handle of North pulse
HANDLE Handle_Of_NM_Generator = 0;
//Create NM_Generator Thread
Handle_Of_NM_Generator = CreateThread( NULL, 0, NMGenerator, &dDifference, 0, NULL);
if ( Handle_Of_NM_Generator == NULL) ExitProcess(NM_Generator);
i want to pass a parameter double value in it how can i do so?
I just came back to C++ Builder after 5 or more years away. I seem to remember a nice tool where I could drag its pointer over the GUI of my running application and get lots of info about what was pointed at - handle, size, text, parent, children, etc
IIRC, if the exe include debug info I could also get the actual variable name as used in the source.
Does anyone know what program I am talking about? Thanks
I would like to assign a value in a class property dynamically (that is referring to it using a variable).
#Something like:
setPropValue($obj, $propName, $value);
I have a PHP file and it holds a value in this session variable: $_SESSION['image_value'].
I want this session value in a JavaScript function. Actually, I want to match a string in my JavaScript function with this session value.
Anyway I can do this?