Inspecting what facebook is doing in my navigator, I see this code:
for (;;);{"t":"refresh"}
If you try to evaluate it, you can figure what happens (infinite loop).
Do you Know what it is?
I was wondering if there was any tool available that detects code plagiarism and works well with Javascript. I want to test assignment submissions for homework I'm going to hand out.
The only tool that I know of that can do this is MOSS, but, from what I've heard, it's pretty poor for anything else than C. Unfortunately, I can't test it yet because I don't have submissions :).
Is there any way to bulk-export Microsoft Access code to files? I see I can export one file at a time, but there are hundreds and I'll be here all day. It there no "Export All" or multi-select export anywhere?
I wrote php code for use to contact us form
but I can not find free SMTP server to use it.
I Try to use SMTP Server For Gmail but I found this error.
Warning: mail() [function.mail]:
"sendmail_from" not set in php.ini or
custom "From:" header missing in
C:\www\htdocs\contactUs.php on line
25"
line 25 is :
mail ($to,$subject,$body,$headers);
statement that indicate using Gmail SMTP Server is :
ini_set("SMTP","smtp.gmail.com");
SO,can U help me ?:(
Hi, what does the 0x80 code mean when referring to the keyboard controls in C++ Windows environment?
For example,
if(GetKeyState('K') & 0x80) {
//do something
}
Thanks everyone!
I would like to evaluate some clojure code entered by users interactively, and I would like to "use" certain namespaces and "import" certain Java classes as well. I end up running the code using:
(defn execute-command [string-command]
let [
code-with-context (add-code-context string-command)
result (eval(read-string code-with-context))
]
result
)
My question is how can I program "add-code-context" to add the required context to the code in "string-command"?
I have spinner in my application .The spinner have drop down list.I want to take the value of the dropdown list from the database .how can i do this ?
here is my code for spinner with dropdownlist:
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, selectdefault);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
I am having this piece of code, which in my opinion is fairly ugly and I am wondering how it can be done better:
if dict.get(key, None) is None:
dict[key] = None
Points for elegance ;-)
Are there any free tools to help simplify working with an NHibernate project in .NET 3.5? Primarily, I'm looking for some kind of code and config file generator to automate some of the more tedious parts of working with NHibernate.
Hi,
How do you set the image for a UIButton in code?
I have this:
UIButton *btnTwo = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btnTwo.frame = CGRectMake(40, 140, 240, 30);
[btnTwo setTitle:@"vc2:v1" forState:UIControlStateNormal];
[btnTwo addTarget:self action:@selector(goToOne) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btnTwo];
but don't see what will set the image for it.
Any help appreciated,
Thanks // :)
Do you compile your code before committing it to the repository, even when you only change a few comments? I know comments are typically ignored by compilers, but I find myself doing this often out of habit.
My aim is to list all elements of the array a whose values are greater than their index positions. I wrote a Haskell code like this.
[a|i<-[0..2],a<-[1..3],a!!i>i]
When tested on ghci prelude prompt, I get the following error message which I am unable to understand.
No instance for (Num [a]) arising from the literal 3 at <interactive>:1:20 Possible fix: add an instance declaration for (Num [a])
I'm trying to invoke C++ from Java using GCJ using the CNI, so far I'm able to invoke Java code from C++. How can I invoke C++ from Java using the CNI?
Any libraries to aid writing programs with source code shaped like drawings
(such as http://www.ioccc.org/1998/banks.c or http://groups.google.com/group/comp.lang.c/msg/e105e5d339edec01). For any language.
I'm using the 3.5 library for microsoft code contracts
public object RetrieveById(int Id)
{
Contract.Ensures(newObject != null, "object must not be null");
return newProject;
//No error message if I move the Contract.Ensures to here
//But it isn't asserting/throwing a contract exception here either
}
I get the compiler message:
"Error 18 Contract section within try block in method 'Controller.RetrieveById(System.Int32)'
If I create a Web Application project in visual studio 2008 I can add a resource file for a page and using the Access Modifier drop down in the resource file editor to let visual studio generate the code so that the local resources are strongly typed.
However if I create a Web Site project this combo box is disabled. Is there anyway to acheive this for a web site?
I'm using subeclipse plugin for eclipse for SVN. My project looks like this :
ProjectName\
- branches
- special_
- tags
- trunk
I have currently checked out project from special_ and I've modified and added one class, how can I merge the code which I updated/added to trunk ? I'll take anything into consideration
my code-
<?php
session_start();
$_SESSION['errors']="failed";
?>
<head>
function myfunc()
{
alert(<?php echo $_SESSION['errors']; ?>);
}
</head>
<body onload="myfunc();">
but alert msg is not popping up.
Possible Duplicate:
A puzzle - a program printing its own source
In your favorite programming language, write a program that, when run, will print out its own source code!
Sounds interesting, now let's go!
ps: Literally, there is "NO" use case for this, just plain curiosity!
Is there any way to round numbers in C?
I do not want to use ceil and floor. Is there any other alternative?
I came across this code snippet when I Googled for the answer:
(int)(num < 0 ? (num - 0.5) : (num + 0.5))
The above line always prints the value as 4 even when float num =4.9.
Please suggest a solution.