What's the easiest way to change a text's color based on a variable?
For example: If $var is between 1-5, green. Between 6-10, Orange. Greater than 11, Red.
In NumPy functions, there are often initial lines that do checking of variable types, forcing them to be certain types, etc. Can someone explain the point of these lines? What does subtracting a value from itself do?
t,w = asarray(t), asarray(duty)
w = asarray(w + (t-t))
t = asarray(t + (w-w))
Hi,
I am trying to only select the objects where the id is smaller than an int value.
e.g.: i have 3 objects - id = 1, id = 2, id = 3
Now I want to only get the objects with the id smaller than the variable i = 2;
How can I manage this?
sql = "SELECT id FROM table_name WHERE id <= i";
Thanks ;-)
Is there a simple way to see if the xsd code generating C# code has a particular column? Or if you can reference a variable column? table.getColumn("column") instead of table.column?
When I reading the code of CodeIgniter,I found some functions written as follows:
function &get_instance()
{
global $CI, $OBJ;
if (is_object($CI))
{
return $CI;
}
return $OBJ->load;
}
I can understand variable refrence,but I can hardly get this through.Is it necessary to use this function style?And any benefit?
Thanks.
according to http://www.cplusplus.com/reference/clibrary/cstring/memcpy/ c++'s memcpy takes three parameters: destination, source and size/bytes. it also returns a pointer. why is that so? aren't the parameters enough to input and copy data.
or am i misunderstanding something? the examples don't use the return value
I am building an iphone app and would like to keep track of how many times it has been opened so that I can prompt the user to do certain actions after it has been opened X number of times. I have thought about storing a variable in Core Data which I update every time it is opened, but this seems like a waste since it is a singleton data, not multiple instances of an object. What is the best way to store data like this and access it without slowing down the app opening time?
I have following problem.
in one request i am updating session variable.
in the other request, i am trying to access that session value, but it was blocked until the first request finish.
I am using C# with ASP.NET 2.0
What resources do folks use for UITableView related stuff? Apple's Docs seem sufficient , but am sure everyone has a UITableView reference that they use when implementing table views.
I want to retrieve all objects (not DOM elements) of a given type created with the "new" keyword.
Is it possible ?
function foo(name)
{
this.name = name;
}
var obj = new foo();
How can I retrieve a reference to all the foo objects ?
I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket.
I'm not even sure if they both need separate classes, but here's what I have so far:
http://pastebin.com/qzMFFTrY
(it wouldn't all go in a code tag)
The variable I need is con for line 86.
I am using Sqlite database in my app.I Have 3 tables in database(group, category & categorygroup).I want to retrieve the contents from the category table with reference to the primary key of the group table.category group act as a junction table which as both the primary keys of group and category .How can i achieve that.Please help me out,Thanks
How can I validate a String null or empty using the c tags of JSLT.
I have a variable of name var1 and I can display it, but I want to add a comparator for validate it.
I want to validate when is different of null or empty (my values are string).
I am using a library that prints a bunch of superfluous information to the console when I reference it. Is there a way to silence the output of the library?
a difficult one..
using classes of primitive types in java, like Integer, Float, Long, etc, write a code fragment using a method to double the value of a variable passed as an argument
If a variable will always be a number, is there a performace loss by putting it in inverted commas?
for example
"SELECT prod.product_name FROM prod WHERE prod.id = '$id'";
I am using ofstream() to write data into file, i want to program to perform such a way that it should be keep on writting the string into the file as soon as the value gets assingned to string variable, and it should be writting before calling the close() for the buffer and while the program runs itself.
can anyone help me to do that in c++.........
I'm using curl to send POST request to web service http ://localhost 2325//Service
How can I desirialize body of the POST request into a variable which I could then access within my POST method ?
Can someone give me an example?
This is my method
[WebInvoke(RequestFormat = WebMessageFormat.Json, UriTemplate = "/user", Method = "POST")] public void Create(User us)
Class User contains user_id and user_name.
Can anyone please help?
All I need is an example how to formulate POST request in curl
Thanks
I have an F# library in the same solution as a Silverlight (C#) project that I'd like to use the library in. When I try to add a reference to the library project, it says I can only add Silverlight references. How can I make this F# library compatible with my Silverlight project?
I'm using Visual Studio 2010.
As the title states, I need to relace all occurrences of the $ sign in a string variable with an underscore.
I have tried:
str.replace(new RegExp('$', 'g'), '_');
But this doesn't work for me and nothing gets replaced.
Say you have a variable n1 which will be the value of three digits entered
how can i then without knowing what exactly will be input split n1 into 3 seperate integers to do futher calculations with?
Google didn't turn up anything that seemed relevant.
I have a bunch of existing, working C++ code, and I'd like to use python to crawl through it and figure out relationships between classes, etc.
EDIT: Just wanted to point out: I don't think I need or want to parse every bit of C++; I just need something smart enough to pick up on class, function and member variable declarations, and to skip over function definitions.
Probably a stupid question, but I can't find any documentation anywhere for it. Is there a way to do an if in prolog, e.g. if a variable is 0, then to do some actions (write text to the terminal). An else isn't even needed, but I can't find any implementation of if.