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.
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.
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
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.
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).
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
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++.........
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'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
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?
After reading a question on @private I understand how that works. However, since all variables default to @protected and you cannot really access a variable without defining an accessor, what exactly does @public do? When would you use it?
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.
What is the "computer science" term for the practice of assigning a special meaning to one of a type's values. For example a numeric variable called "amount_to_transfer" where the special value "0" means "entire account balance" or a date value "spouse_date_of_birth" where "1/1/1800" means "unmarried".
I happen to feel that this is quite a bad "smell", but I'd like to have a name for it, and if possible, some blog post or article about why it's bad and how to fix it.
Hi,
I have this code that works just fine on the development server but
when I deploy the application, the session isn't created.
What am I doing wrong?
HttpSession session = req.getSession(true);
session.setAttribute("loggedIn", new String("true"));
Edit:
The sessions are enabled.
What I realized now is that the _ah_SESSION variable is not being
created, not even on the development server (although it works).
I have two fields:
string date1 = "04/26/10";
string date2 = "04/25/10";
How can I compare these two fields like so?:
if (date2 <= date1)
{
// perform some code here
}
Can this be done without first converting the fields to a separate date-type variable?
How can I write the output of this line of code to a float variable instead of piping it to a file? The output of this line is a floating number.
FILE *child = _popen("java -jar c:\\simmetrics.jar c:\\chtml.txt c:\\thtml.txt", "r");
Hi,
I'm creating a used cars website (written in PHP), and I'm stuck on sending advanced search options from form. I have more than 30 of them and I wonder if it's possible, and how, to send them in one variable (for example &options=1,2,3,5,6,10 or some other way..). Also I've heard that this is possible with "bitwise" but I don't have a clue how to do that. Or if someone have a better idea, please let me know.
Thanx
defined variable:
LinkedList list1=new LinkedList();
Object get() in list1 obtains a node of list1
Object remove() in list1 deletes a node of list1
count() is length of list1
for(int i=1;i<list1.count();i++){
if(list1.get(i).startsWith('"',0)) //Error here
list1.remove(i);
}
Error: cannot find symbol
symbol: method charAt(int)
location: class Object
how to fix this problem?
I would like to delete the node in list1 which starts with (").
I am trying to obtain an instance of my live wallpaper engine in another class,
here is my code...
In the other class:
WallpaperEngine wpe = (WallpaperEngine) LiveWallpaperService.onCreateEngine();
In LiveWallpaperService:
@Override
public Engine onCreateEngine() {
// TODO Auto-generated method stub
return new WallpaperEngine();
}
But when I refer to an object in my engine (i.e, "wpe.variable"), I get a NullPointerException and the wallpaper force closes.