code

What are good C# Problems to solve for practice?

I am still learning a lot of C#. And would like to hone my skills for future interviews. What are some simple C# problems to solve? The last interview I did had a pretty simple problem in it that I kind of struggled with, don't want that to happen again. ...

What code would you put before/after your R session?

R allows us to put code to run in the beginning/end of a session. What codes would you suggest putting there? I know of three interesting examples (although I don't have "how to do them" under my fingers here): Saving the session history when closing R. Running a fortune() at the beginning of an R session. I was thinking of having an...

Can I change the accepted extensions by PHP?

I'd like to accept other type of files that contains PHP code. For example, it would be nice to read an .aspx file by PHP as if it were .php. Could it be possible? Thank you very much in advance ...

android sqlite insert problem with error code 19

Hi everybody! when I'm trying to run the ContentValues cv = new ContentValues(); cv.put(table_LocalSettings_Unit, input); mDb.insert(table_LocalSettings, "", cv); I got the following error: Error inserting unit = 0; SqliteConstraintException: error code 19 constraint failed. What should be the problem ? The table...

How can I get PHP simplexml to save < as itself instead of &lt;

Basically I have a script that updates an xml document in various places... However, I need the text to be in CDATA... So I attempted this: $PrintQuestion->content->multichoice->feedback->hint->Passage->Paragraph->addChild('TextFragment', '<![CDATA[' . $value[0] . ']]>'); Unfortunately when I save the XML back to file,...

How to determine at run-time if app is for development, app store or ad hoc distribution?

Is there a way to determine programmatically if the currently running app was built and signed for development only or whether it was built for distribution? And can one determine if was build for app store or ad hoc distribution? Is it e.g. possibly to access the code signature and get the information from there? Or are there certain f...

Well documented open source project in .net

Hi, im seaching some good quality open source project in .net, according this topic http://stackoverflow.com/questions/143088/open-source-c-projects-that-have-high-code-quality i found intresting open source projects like "Sharp develop", its great because i can build & run it without problem, but i would like learn how it was developed...

javascript/jquery: code packer/obfuscator

Possible Duplicates: How can I obfuscate JavaScript? What do you use to minimize and compress JavaScript libraries? hi all, 2 questions: i'd like to compress my code, anyone knows which compressor the guys from jquery are using? or is there any free script? (i'd like to use the compressor using an automated asp-script, so...

HTML generation problem

I'm trying to generate a small part of the page using jquery which is generating in the wrong matter even though the code looks solid. $('#stages').html(""); var stage = $("#stages"); var L = $('<h2></h2>').attr('id', 'startachat').append('Who do you wish to connect to?'); stage.append(L); var k = $('<table></table>').at...

jQuery in Wordpress

Hello. I am using WP3 and am using some simple JQ to style some elements. However, I cannot get it to work. I am aware of but beyond that I don't know where to put my own code exactly, in which file or place. The code is: <script> $(document).ready(function(){ $("#image" + photoNum).animate({ opacity: 0, scale: 3 }, 0); </script> ...

jQuery in Wordpress doesn't work?

I'm trying to put some simple jQuery code into the Wordpress header (usually just use CSS) but no matter what I try I cannot seem to get it to work. The code is: <script type="text/javascript"> var fadein = 300; var fadeout = 200; $(document).ready(function(){ $("#btnforum img, #btnfacebook img, #btntwitter img, #btnyoutube img, #btnli...

Folder imported in Code Snippets Manager not showing in text editor - Visual Studio 2010

In the Code Snippet Manager I chose "Language: Visual C#" and added a folder containing one .snippet file I created. Then, when editing a .cs file, I try to insert a snippet using ctrl+k ctrl+x but my newly added folder does not show in the list. I'm I missing something? Do you have to specifically tell IntelliSense which snippets you ...

How to get Android project and std Java project to play nice?

I can now get our Android project to talk to our non-Android project. But there's still an issue: I are trying to have an Android class call a non Android Hello World class. I tried compiling our non-Android Hello World class in a separate Eclipse workspace. I then packaged it into a jar. I imported that jar into our Android Hello Worl...

how to determine junit code coverage?

How can i determine what percentage of my methods are covered by jUnit tests? I am assuming there is a more sophisticated way then simply counting ...and one and two etc ... I specifically wonder how will such counting be handled when single method is covered by 'n' tests. please let me know and as always "thanks for reading" ...

How to get started with sql and php?

I am just getting started in php and sql, I was wonder if how to link sql database to on my php code, I know how to create databases and i know a little about php, but i don't know how to link the databases to my code. i am using a database on my local server that i set up and i have already created a database, i tried writing a php scri...

python reorganize codes

Sorry I dont know how to add a comment with the format, so I post another question with code here, as I am new to python, seems that there are many better ways to reorgnize the codes to make it better: def min_qvalue(self): s = 0 q = 1 for i in range(len(self.results)): if self.results[i].score > s: s = s...

Code for directory monitor using Unix concepts in C language

On a server, a process monitors the files in a Unix file system. If a client sends the file name to be monitored, the server has to send the report to the client whether that file got changed or deleted. For server-client communication, we should use either message queues or sockets. For every change in the file, the server has to not...

Is there a way to determine that a .a or .so library has been compiled as position indepenent code?

I am getting a linking error when compiling the numpy library against lapack indicating I need to compile lapack with -fPIC. I thought I had done just that. Is there a way to determine that the produced lapack library is position independent? Thanks, S ...

What's the best way to update code remotely?

For example, I have a website with various types of information. If that goes down I have a copy of the same website the users use on a local webserver, like Apache or IIS on the client. They use this local version until the Internet version returns. They can have no downtime, in other words. The problem is that over time the Interne...

Is there any code editor that works on touch screen mobile phones?

Is there any code editor (like eclipse or visual studio) that works on mobile phones (such as nokia 5800)? So what I want is to edit my C/C++/C# code on my phone. (I have Nokia so it is my primary intrest, but I am also interested in other phones such as Android based ones.) I do not need ability to compile, but I'd love codehinting an...