Let's say I want to "pause" a thread so that other threads can run more efficiently. What is the minimum sleeping period before blocking becomes pointless (or almost pointless)?
is it possible to easily and dynamically decorate an object?
for example, lets say I have a List<PointF>. this list is actually a plot of the sine function. I'd like to go through these points and add a flag to each PointF of whether it's a peak or not.
but I don't want to create a new extended SpecialPointF or whatever, that has a boolean property.
judge me all you want for being lazy, but laziness is how awesome ideas are born (also bad ideas)
hey guys
i need to shorten or better to say ., harden my codes
this is my original code :
if ($type = "recent") {
$OrderType = "sid DESC";
}elseif ($type = "pop"){
$OrderType = "counter DESC";
}else {
$OrderType = "RAND()";
}
now how can i use markers like this :
$OrderType = ($type = "recent") ? "sid DESC" : "counter DESC" ;
i tried but i didnt know how to write elseif in marker way
We have a requirement to log IP address information of all users who use a certain web application based on JEE 5. What would be an appropriate sql data type for storing IPv4 or IPv6 addressses in the following supported databases (h2, mysql, oracle). There is also a need to filter activity from certain IP addresses. Should I just treat the representation as a string field (say varchar(32) to hold ipv4, ipv6 addresses)
In mysql a result of a query is
say select timestamp from newbie;
| 2010-03-12 14:50:46 |
| 2010-03-12 14:50:46 |
| 2010-03-12 14:50:51 |
| 2010-03-12 14:50:52 |
| 2010-03-12 14:50:54 |
| 2010-03-12 14:51:04 |
| 2010-03-12 14:51:07 |
| 2010-03-12 14:51:08 |
Is there a way to subquery the above and sum up the i.e, the final result should be the delta of each row in hh:mm:ss format
Hi!
I'm using the tags in HTML5 to play a video on a web browser... (and I'm very impressed with this new feature)
Is there the functionality to change the video being played through Javascript? Say when I select another video from a list, a Javascript function would be called which would contain something on the lines of MyVideo.VideoLocation = //location of new video to be played. Is this possible please?
Thanks and regards,
Krt_Malta
Hello,
I am doing web based projects in dotnet. Currently I am implementing security using session variables. I keep current user id and user type in session and authenticate user from these session variables (say Session["UserId"],Session["UserName"] and Session["UserType"]) I do authentications.
Please guide me how it is insecure ? I heard such security can be broken and applications can be hacked very easily, like it is possible to get session id and directly connect to that session id etc.
Please guide me on this
thanks
Hello Friends,
Actually I am working on Pdf by using IReport Software. This software provided two detail section but i want this two detail section with Column Header .then say me how i changes it
reply me on [email protected]
Hi, I need to know how I can replace the last "s" from a string with ""
Let's say I have a string like testers and the output should be tester.
It should just replace the last "s" and not every "s" in a string
how can I do that in PHP?
I have read a few questions here where people say that PHP is not the 'best' language for web development compared to python, ruby.
What about PHP makes it have such a bad rep?
So, lets say I have a $somestring thats holds the value "main/physician/physician_view".
I want to grab just "physician_view". I want it to also work if the passed string was "main/physician_view" or "site/main/physician/physician_view".
Hopefully my question makes sense. Any help would be appreciated!
Hi,
Lets say I have the following javascript:
var obj = {
key1 : "it ",
key2 : key1 + " works!"
};
alert(obj.key2);
This errors with "key1 is not defined". I have tried
this.key1
this[key1]
obj.key1
obj[key1]
this["key1"]
obj["key1"]
and they never seem to be defined.
How can I get key2 to refer to key1's value?
I have a .doc or .docx file where in after the booking of the hotel room i wanna give the agreement and the receipt in a .doc file.
for this i have a text file,
To, [NAME]
[ADDRESS]
Dear....
...Content;;;...
This will be my .doc file. My idea is to read this .doc file and replace the tags, say.([NAME] and [ADDRESS]) with the user's name and address.
How can i do this in ASP.NET?
I have the following problem:
Program 1 has a huge amount of data, say 10GB. The data in question consists of large integer- and double-arrays.
Program 2 has 1..n MPI processes that use tiles of this data to compute results.
How can I send the data from program 1 to the MPI Processes?
Using File I/O is out of question. The compute node has sufficient RAM.
Environment: JPA 1, Hibernate 3.3.x
I have an JPA entity class (User), how do I selectively fetch member variables say (first_name, last_name) instead of fetching all user attributes using the JPA api.
In the facebook authentication guide, i am suppose to:
Get the user to authorize my application, by redirecting them to authorize uri.
Get my access token from facebook by hitting the /outh/accesstoken uri.
Lets just say, that for whatever reason, this token is no longer valid. Do i need to perform step #1, or can i hit the /outh/accesstoken uri again?
A = imread(filename, fmt)
[X, map] = imread(...)
The above is in the synopsis part of imread, which seems to say that the return value of a MATLAB function depends on how it's called? Is that true?
Hello, I have this code in my .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L]
this turns the searchquery in /keyword+apple+fruit/
thats ok.. the only problem is, if I type in /keyword+apple+fruit +any+text+haha+ apple+fruit/
the htacces is showing content - but I don't want that.
is there any command to say - ok apple + fruit only one time in the url and the second time send a 404 or show nothing..
thank you!!
I have a requirement for developing a black hole generator. They say that this may allow time travel and getting rich...
whatever...what do you think it's the best approach for black hole generator
a) Infinite loop
while (1==1) blackHole++;
b) Division by 0
try
{
6/0
}
catch
{
//blackHoleGenerated
}
Say I have a method, and within that method it instantiates a Person class:
void methodA()
{
Person personObject;
}
How would I access that object's methods from within another method? I.e. something like:
void methodB()
{
personObject.someMethod();
}
I realise it's a painfully nooby question :P
I want to run multiple Google Chrome application windows logged into the same web site (Twitter.com, say), each with different credentials. Is this possible? If so, how?
My initial testing shows that multiple Chrome app windows are not sufficiently isolated to do this. Logging into the second account logs me into the second account in both windows, suggesting that they are sharing information just as two Chrome tabs might.
So I know you can say Kernel.const_get("ClassName") and you'll get back the class to which the string corresponds in name. But what about for variables? Is there a way to do:
test = "heyas"
some_method_here("test") #=> "heyas"
Thanks so much
What is a machine learning ?
What does machine learning code do ?
When we say machine learns, does it modify the code of itself or it modifies history(Data Base) which will contain the experience of code for given set of inputs ?