Hello,
I have a PHP code in which I want to use some functions of jQuery. Should I use a html file with PHP code and jQuery included in it or is there a way to use jQuery with PHP?
Hi,
I've been using notepad++ for a while now, but i noticed it doesn't have code snippets (i found quicktext plugin, but it doesn't work anymore), so i'd like to switch editor and my requirements would be:
Fast startup.
Code snippets.
Ability to use themes.
File tree view (or plugin, which does that).
What are you using?
Thank you all for suggestions!
In this code snippet:
use strict;
use warnings;
use Data::Dumper;
my $r = [qw(testing this thing)];
print Dumper($r);
foreach my $row (@({$r})
{
print "$row\n";
$row .= 'mod';
}
print Dumper($r);
print Dumper(@({$r});
I figured out that the '(' after the '@' in the foreach is causing this not to loop correctly. I have no idea why this code even works as there is no ending parenthesis. What is this doing? It looks to be creating a new variable on the fly, but shouldn't 'use strict' have fired or something?
Please help explain what that '@(' is doing and why it still runs without an ending parenthesis.
I'm looking for a Python IDE that can help me easily locate and manage and use the libraries on my system (Ubuntu). Specifically Twisted.
Code completion is important including the symbols I import.
(I've so far had a look at PyDev as well as OpenKomodo, but while both offer code completion for default Python concepts, I wasn't able to get either to import Twisted into my project and was thus getting reference errors.)
Usual disclaimer: I don't like EMACS or vi, please, nothing regarding those.
I have the following codesnippet. This is a c file in visual studio 2010. If i try to compile this with the line: int hello = 10; commented out it will compile just fine. If I comment that line in it will not compile. Am I missing something or should I not be using Visual Studio 2010 to compile C code. If this is a Visual Studio problem can anyone recommend a easy to use IDE / Compiler that I can for C.
Thank You
int* x = (int*) calloc(1, sizeof(int));
*x = 5;
//int hello = 10;
printf("Hello World! %i", *x);
getchar();
I am looking at some code that has a lot of sort calls using comparison functions, and it seems like it should be using key functions.
If you were to change seq.sort(lambda x,y: cmp(x.xxx, y.xxx)), which is preferable:
seq.sort(key=operator.attrgetter('xxx'))
or:
seq.sort(key=lambda a:a.xxx)
I would also be interested in comments on the merits of making changes to existing code that works.
I implemented a U.S. "find near zip code" search for somebody. The coordinates of U.S. zip codes come from a commercial zip code database. Now, they would like a similar ability for countries other than the U.S.
Has anybody implemented something like this for non-U.S. searches? How about general "find close to this address" searches? What commercial data is available?
Just had a curious thought, but for general coding and programming, do you think it's best to work out all the logic yourself and start from a blank sheet or just take a code that has been written already(by you or someone else) and just change it to your liking? Assuming you have a programming background of like 1year+. (because as a beginner, it's best to learn from nothing)
I'm not saying copy+paste someone else's code and say it's yours.
I want example.com/23-45 be transformed to example.com?id=23-45
Could you please post the code I should add to .htaccess file to make this work
(Is this everything I should do to make this work - add a piece of code to .htaccess file ???)
Thanks a lot!
I was working on a Rails template and was trying to write a bit of code that allows me to populate a table or multiple columns of ul tags "top-to-bottom" and "left-to-right" across however many columns I specify. I'm just getting the hang of Ruby so I couldn't figure this out. I'm also curious about an idiomatic Haskell version for this useful snippet. Improvements to Clojure version appreciated:
(defn table [xs & {:keys [cols direction]
:or {cols 1 direction 'right}}]
(into []
(condp = direction
'down (let [c (count xs)
q (int (/ c cols))
n (if (> (mod c q) 0) (inc q) q)]
(apply map vector (partition n n (repeat nil) xs)))
'right (map vec (partition cols cols (repeat nil) xs)))))
With this bit of code I can then do the following:
(table (range 10) :cols 3)
Printed out this would look like so:
0 1 2
3 4 5
6 7 8
9
And the trickier one:
(table (range 10) :cols 3 :direction 'down)
Looks like so:
0 4 8
1 5 9
2 6
3 7
ofstream f("test",app);
f.seekp(5,ios::beg);
f << "hello world";
f.close();
What I'm trying to do here is open a file that already has data in it, and then put "hello world" somewhere in the middle of the file. However, when I run my code, it overwrites the whole file. How can this code be fixed?
I have a Cocoa application which uses an installer. I want to be able to run code coverage over the code (after it has been installed).
This is not the usual unit-test scenario where a single binary will run a suite of tests. Rather, the tests in question will interact with the UI and the app back-end whilst it is running, so I ideally want to be able to start the application knowing that Gcov is profiling it and then run tests against it.
Any ideas?
I'm writing an InfoPath web form, using C# code behind. The form is a holiday request, after the user inputs the start and end dates I want the code to query a bank-holiday sharepoint list and count occurrences between the dates.
I've added the sharepoint list as a second datasource however I'm now stuck. Any ideas?
Hi Everybody, I want to know that we can use F12 to jump to the function that is called from this code , if i have to return to the code again how I can do this.
I've just started to use netbeans IDE 6.8. And consulted youtube for tutorials. And I've seen that the code is being completed just like in dreamweaver. Whenever you type something. And it shows some suggestions on what probably would be the next code.
But when I tried it on my computer. It does not do this. How do I configure it?
Is there any good reason to avoid unused import statements in Java? As I understand it, they are there for the compiler, so lots of unused imports won't have any impacts on the compiled code. Is it just to reduce clutter and to avoid naming conflicts down the line?
(I ask because Eclipse gives a warning about unused imports, which is kind of annoying when I'm developing code because I don't want to remove the imports until I'm pretty sure I'm done designing the class.)
Hi
There are several PHP or js code formatting libs out there -- does anyone know if similar libs exist in Java?
Ie., Given a string of code, return a formatted string with syntax colouring etc.
It'd be ideal if it auto detected the language, but I might be pushing my luck there...
This has to be pretty simple, but I'd like to parse the current URL and execute conditional code depending on whether the user is on the /sitemap/ directory.
So for example, if the site is example.com, and if the request is example.com/sitemap/.
Then I want to execute conditional code in that case. I'm using wordpress so I'm not sure if there is a built-in function that gets this...
A pure PHP solution is fine.
Hi, can anyone help me out.
i have a apllication where i want to log exception in files and dont want to change code.just acomponet which i can add in my code and it will start logging exceptions.
Thanks in advance.
I am not able to get through with this code...I need to capture the request but with this code I am able to redirect but it cannot find the particular search page.
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /searcha\.php\?name=(www\.)?([^/\ ]+)[^\ ]*\ HTTP/
RewriteRule ^.*$ http://www.mydomain.com/%2? [R=301,L]
can any one tell me what is I am missing??
Hi Everybody, I want to know that we can use F12 to jump to the function that is called from this code , if i have to return to the code again how I can do this.
<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,
Is sequential coupling (http://en.wikipedia.org/wiki/Sequential_coupling) really a bad thing in code?
Although it's an anti-pattern, the only risk I see is calling methods in the wrong order but documentation of an API/class library with this anti-pattern should take care of that. What other problems are there from code which is sequential? Also, this pattern could easily be fixed by using a facade it seems.
Thanks
Hi All,
I need to convert the IL to c# code.
I have an assembly and I am reading this assembly.
I get MethodBody from MethodInfo and the methodbody has a method GetILAsByteArraY()
which returns a byte array now I want to comvert this IL to C# code.
Please help me out in solving this.
Many of today's programming languages are based on C; like C++, C#, Java, Objective-C. So could I call a C method from C++ code? Or call C from Java or C#? Or is this goal out of reach and unreasonable? Please include a quick code sample for my and everyone else's understanding.