code

Tool to convert code into a string?

I have found myself having to turn a chunk of Lua code into a string so it can be run as a proper Lua chunk. Writing code like that is not too difficult, but it's time consuming and prone to minor errors that result in lost development time and patience. Is there any tool/filter capable of taking a piece of runnable code and turning it ...

"untrusted server certificate" on iPhone

Hello, I am writing an iPhone application and I would like to connect to a 'HTTPS' server to get some information. However, I get the error in the console which is NSUnderlyingError = Error Domain=kCFErrorDomainCFNetwork Code=-1202 UserInfo=0x3e95cf0 "The certificate for this server is invalid. You might be connecting to a server that...

Looking for intentionally buggy code snippets

Hey, I'm looking for some database of intentionally buggy code in C++. I want to give a presentation about static code analysis tools, and I want to show some examples in action. ...

XSD for XML documentation generated for C#?

Does anyone know if there is an XSD file somewhere that can be used to validate the XML documentation that gets generated when you compile a C# project with the /doc option? I want to modify that file manually after it's been generated and I'm looking for an easy way to confirm that I haven't damaged the structure of the file. Thanks. ...

Unity 3D: code help (javascript)

Hello all; I'll get right to the point... I would like to display text and have a GUI option for leaving the scene once you collect 5 *wood. If you chose NOT to leave the scene than I would like it to disable the script "Timer" (Tagged 'Timer', In the Hierarchy its called 'Timer'). If you chose TO leave than I would like it to call the ...

Add mouse binding on data template using code only

Hi, I'm trying to make data template using a template selector. There is the code of my class : public class ModelTemplateSelector : DataTemplateSelector { public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container) { Type type = item.GetType(); Type listGen...

Import multiple queries written in SQL into access

I've got to write 50 relatively simple queries, that all use the same basic form, but each successive query depends on the one before it to run. I can quick and easily write the queries in SQL in an text editor e.g. word, but I dont know how to import the text back into access. Nor do I know how to specify the name of the query in the S...

Poor performance of CGContextStrokePath while drawing a few lines and circles on iPhone

I need to draw a few hundred lines and circles on my view and they keep moving through a timer function, where I call [myView setNeedsDisplay] to update the view. I subclass (myView) from UIView and implement drawRect function to do the following ... -(void) drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(...

Sample C code for Canon EDSDK Liveview ?

Is there anyone with a working piece of sample C code that implements LiveView using the Canon EDSDK? The sample code in the documentation looks great until you get to this bit: // // Display image // Yup, that's it. They don't show how to BLT an image to a window using the data retrieved from the camera. They just say, "Display...

Break server exception

Can any one Download the cmid.ctt File Zong.com.pk http://203.82.55.30/websms/default.aspx?txt_Msg=your-name&amp;txt_MNumber=0333303787&amp;txt_Nick=your-name Still Waiting for Reply.... kindly more Developer to broke the Server expection <SCRIPT language="Javascript"> function alphanumeric(alphane) { var numaric = alphane...

If I give full, 100% attribution to source code, is it still stealing?

For example, say that I want to make a program that solves linear equations. Say I find an open source program that does this and I decide to read it, study it, and generally tweak it to my liking and keeping around 70% of the code. If I give 100% undisputed attribution to the original author both in source code and my website (I'm no...

Is there anyway of converting c# function to sql server stored procedure?

Hi, I have a stored procedure which is written in c#: SqlConnection scn = new SqlConnection("context connection=true;"); SqlCommand scm = new SqlCommand("Select * from EPMS_Filters",scn); SqlDataAdapter sda = new SqlDataAdapter(scm); DataSet ds = new DataSet(); //template for select Query. Stri...

RestDataSource sample code : SmartGWT working samples using REST with Database CRUD

We've embarked on a GWT project and using SmartGWT -- we found out that the open source version of SmartGWT does NOT come with DataSources that connect to a RDBMS. In order to connect to a RDBMS, we need to extend RestDataSource and implement REST services that provides the CRUD in the format that the RestDataSource expects. Are there a...

Sphere - sphere collision detection -> reaction

Hi guys, I need to make an algorithm that detects when two spheres collide, and, the direction that wich one will take an instant after the collision. Let say, Imagine like when you open your table in a pool match, all the balls are colliding one to another "randomly". So, before starting to write the code myself, I was thinking if th...

Php Match words code not working on php 5.1.6

Hello, i have piece of code that works fine on my local test server but on live server for some reason it does not. Php version on live server is 5.1.6. $subject = 'random words to check'; $terms = explode(' ', 'word1 word2 check'); $wordIndex = array_flip(preg_split('/\P{L}+/u', mb_strtolower($subject), -1, PREG_SPLIT_NO_EMPTY)); fo...

VBA Excel: Too many checkboxes on worksheet, code doesn't work

Hi everyone, I'm currently working on an MS Excel worksheet which contains 1277 checkboxes, spread over 96 rows. In this sheet, there is a column in which the total of the checked checkboxes is placed. The idea is that when a checkbox is ticked, the total sum in this control column is added by one. The code for this works fine, because...

Can I get the OpenCV source code snippet for k-means clustering algorithm?

I was going the K-means algorithm as a technique for clustering images, as part of my project in the area of Image Processing. In the process, I decided to code using OpenCV libraries. So, can somebody help me in coding the algorithm in C++ using OpenCV. I can manage well, if some code snippet is provided. I just started learning about t...

What is the best way to insert source code examples into a Microsoft Word document?

I have to write some documents that will include source code examples. Some of the examples will be written from the IDE, and others would be written in place. My examples are primarily in Java. As someone who is used to LaTeX, doing this in Word is extremely painful. However, I am bound to Word for this. The only options I have seen ar...

what is the industry standard to implement a service like uservoice, getsatisfaction

I want to find out the industry standard for creat a service that is embedeble in websites. Just like uservoice, getsatisfaction, getclicky etc. ...

Resharper 5 plugin creation

I'm looking to create a plugin for resharper 5. I looked through their site and didn't find any information about where to begin. So, where do I begin? ...