safe

Has anyone written a thread-safe BindingList<T>?

I am currently getting exceptions when modifying an IBindingList on multiple threads. Does anyone have a threadsafe version before I write my own? ...

$SAFE on ruby

I want to be able to run unstrusted ruby code. I want to be able to pass variables to said untrusted code that it may use. I also want said code to return a result to me. Here is a conceptual example of what I am thinking input = "sweet" output = nil Thread.start { $SAFE = 4 #... untrusted code goes here, it uses the input variabl...

Is there a way of making strings file-path safe in c#?

My program will take arbitrary strings from the internet and use them for file names. Is there a simple way to remove the bad characters from these strings or do I need to write a custom function for this? ...

Does thread-safety of sqlite3 mean different threads can modify the same table of a database concurrently?

Thank you! ...

Pattern for compile time discovery of unsafe/wrong queries

My team is developing a large java application which extensively queries a MySQL database (in different classes and modules). I'd like to known if there is a pattern that allows me to be notified at compile time if there are queries that refer to a wrong table structure (for instance if I remove or add a field on a table and the query s...

Is it safe to reuse pointers variables after freeing what they point to?

Is it safe and predictable to reuse pointers after freeing the data they point to? For example: char* fileNames[] = { "words.txt", "moreWords.txt" }; char** words = NULL; int* wordsCount = NULL; for ( i = 0; i < 2; ++i ) { data = fopen( fileNames[i], "r" ); words = readWords( data ); wordsCount = countWords( words ); f...

Is there a truly safe formatting library for C?

Bearing in mind the answers given to a question about a safer formatting library for C, I'm wondering whether there is a safe C formatting library? What I mean is: there's no possibility to mismatch the format string from the arguments there's no possibility to crash by passing the wrong type there're no platform-dependent aspects P...

java expression language that can't access 'unsafe' java methods

I am working on a project where I will let users submit small 'scripts' to the server, and I will execute those scripts. There are many scripting languages which can be embedded into a Java program, such as mvel, ognl, uel, clojure, rhino javascript, etc., but, as far as I can tell, they all allow script writer to call Java constructors...

iPhone dev - objects stay until user quits, don't release?

In in my app, say it count downs to something and at the end just beeps forever until the user quits the app, is it safe to say have an NSTimer and never release (or in NSTimer's case, invalidate it) it, since it will need to stay until the user quits the app? ...

Thread safe char string in C

In C: If I have 3 threads, 2 threads that are appending strings to a global char string (char*), and 1 thread that is reading from that char string. Let's say that the 2 threads are appending about 8 000 strings per second each and the 3rd thread is reading pretty often too. Is there any possibility that they will append at exactly th...

Is this fileuploading script safe?

Hi is this totally safe or not? I would like a totally safe fileuploading script for my new project. Thanks in advice. Here is the one i found: <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_...

PHP echo vs PHP short tags

Are they equal in safeness? I was informed that using <?=$function_here?> was less safe, and that it slows down page load. So I am now strictly biased to using echo. I just wanted to know the advantages/disadvantages, or are they pretty much the same. ...

Visual Source Safe adding my local directory structure when project is checked in

Hello, I have a VB.net 2005 application in My Documents/Visual Studio.net 2005/Projects folder. When I Add the project to source safe it is adding it in a wierd folder structure like C:\documents and settings\users\xxxxx\Mydocuments...... How do I get it checked in with just projectname.root/project/...... ...

A SAFE way to pass an array or arrys[][] in C# to a DLL

I have an array of arrays that I want to pass into a DLL. I am running into the error "There is no marshaling support for nested arrays." I can pass a single array in fine but if I stack them up it fails. I need/want a "safe" way of passing in the array of arrays. private static extern int PrintStuff(string[][] someStringsInGroups, int...

How to safely write to a file?

Imagine you have a library for working with some sort of XML file or configuration file. The library reads the whole file into memory and provides methods for editing the content. When you are done manipulating the content you can call a write to save the content back to file. The question is how to do this in a safe way. Overwriting th...

Is it safe to use user input for Python's regular expressions?

I would like to let my users use regular expressions for some features. I'm curious what the implications are of passing user input to re.compile(). I assume there is no way for a user to give me a string that could let them execute arbitrary code. The dangers I have thought of are: The user could pass input that raises an exception...

PHP-MySQL-How to safely increment MySQL integer field?

I wan to increment a field value safely using php and mysql. what type of table/field must I use? is there a minimum version of MySQL I must use? what's the sql code for this, safe transaction for MySQL? ...

create safe title from string

hello guys - moving a lot more of my old php functions to jquery alternatives. I'm a bit stuck on creating a decent preg_match function. Is there an easy way to make strings url safe & seo'd? php; function superClean($str){ $str = strtolower($str); $str = str_replace(" ", "-", $str); $str = preg_replace('/[^a-z0-9_]/i', '-', $str); $...

Is it safe now to develop web application with HTML 5 specifications?

Is it safe now to develop web application with HTML 5 specifications? or should we wait longer for final standards? I want to start developing a new project. I want it to be up to date in every aspects. should I wait more for html 5 or I can start programming based on it? ...

PHP include() alternative?

Hello, I want to know if my code is safe and if there are other safer alternatives to include external files.. So this is my code example, is it safe? How can I make it safer? Thanks! <?php switch($_GET['p']){ case 'test1': include 'test1.php'; break; case 'test2': include 'test2.php'; break; case 'tes...