I'm compiling a C program for a MIPS embedded system.
GCC keeps sticking in stuff like __do_global_dtors_aux, frame_dummy, __do_global_ctors_aux.
How can I avoid that?
Is it considered crazy to store common SQL queries for my web app in a database for use in execution? Or is that common practice? Or is it impossible?
My thinking is, this way, I avoid hard-coding SQL into my application files, and add another level of abstraction.
Is this crazy? Is this what a stored procedure is? Or is that something else?
Could I somehow disable action (send, redirect) from submit if the textarea was empty (so nothing at all happens onclick). I want toavoid displaying error here, thats why I'm asking.
My textarea:
<textarea id="message" name="message" maxlength="35"></textarea>
My submit button:
<input id="send" type="image" src="/site_media/static/images/submit.png" value="Submit">
This is what i tried: http://jsfiddle.net/5Xwyb/
My brain died couple of hours ago.
I have seen people define their events like this:
public event EventHandler<EventArgs> MyEvent = delegate{};
Can somebody explain how this is different from defining it without it? Is it toavoid checking for null when raising the event?
In Perl most of my print statements take the form
print "hello." . "\n";
Is there a nice way toavoid keeping all the pesky "\n"s lying around?
I know I could make a new function such as myprint that automatically appends \n, but it would be nice if I could override the existing print.
i have 3 div tags.Each having no. of textboxs and button.Each textbox having validation.For all button causesvalidation property is true.If i click "button1" in "div1" tag will cause validation of other textbox in other div tags.I dont want to do this ? How toavoid this?
Certain websites like Twitter, Flickr, etc avoid being stuck within an iframe. Is there any way to stop this from happening? I just need to see the public data so I am open to disabling Javascript, etc. How do I disable Javascript running on the iframe? Is this possible?
I like the ease of using @Resource annotation to get a DataSource, but as far as I know, it's not possible to use it in a regular JavaBean. Would it be considered a bad practice if I pass the DataSource object from a servlet to a bean along with the other data toavoid having that lookup code in the bean?
Often time methods take more than 3 parameters which are all of the same type, eg.
void mymethod (String param1, String param2, String param3)
then it's very easy for the client to mix up the parameters orders, for instance inverting param1 and param2:
mymethod (param2, param1, param3);
...which can be the cause of much time spent debugging what should be a trivial matter.
Any tips on how toavoid this sort of mistake (apart from unit tests) ?
This is a simple database security & performance question, but I've always used either a special user (eg. mydbuser), or Windows' built-in NETWORK SECURITY account as the owner when attaching databases to my SQL Server instances.
When deploying my database to a production server, is there a specific user I should stick to or avoid? I would think that using an account with a set password could open the database up to a potential security issue.
I'd like to decorate a function, using a pattern like this:
def deco(func):
def wrap(*a,**kw):
print "do something"
return func(*a,**kw)
return wrap
The problem is that if the function decorated has a prototype like that:
def function(a,b,c): return
When decorated, the prototype is destroyed by the varargs, for example, calling function(1,2,3,4) wouldn't result in an exception. Is that a way toavoid that?
How can define the wrap function with the same prototype as the decorated (func) one?
There's something conceptually wrong?
I'd like to take a snapshot of my database, make some changes and then use the db compare functionality to identify the changes, and who knows, maybe even generate scripts to make the change.
I'd like toavoid having to backup the current db and restore it as a separate db just to have a "before" snapshot. I'm guessing I shouldn't have to.
Obsviously, I'm clueless about db projects and am looking to be pointed in the right direction.
ty!
How common is it for coding style guidelines to include a requirement that all functions include a return statement (including functions which return void)?
Toavoid being subjective or argumentative, I'd like answers which can name specific companies or open-source projects which have this requirement. If you haven't ever come across this coding style guideline, or you have a resource (book, online article) which discusses it, that would be useful as well.
Thanks!
Hi,
Purify is pointing memory leak in ole32.dll while returning a Variant with VT set to VT_RECORD as OUT parameter. I am using User Marshalling by generating proxy/stub dll from IDL.
Can you suggest how toavoid this memory leak?
Thanks
Picaro De Vosio
I am using Firefox's native JSON.parse() to parse some JSON strings that include regular expressions as values, for example:
var test = JSON.parse('{"regex":"/\\d+/"}');
The '\d' in the above throws an exception with JSON.parse(), but works fine when I use eval (which is what I'm trying to avoid).
What I want is to preserve the '\' in the regex - is there some other JSON-friendly way to escape it?
I seem to remember seeing some neat way of calling InvokeRequired and BeginInvoke toavoid repeating too much code in every event handler but I can't remember what that was.
So does anyone know a neat way of writing that code?
hi ,
When I'm running the report I'm getting that message above.
The Report Works fine when I press the "Run Report" Button but I want also toavoid
that annoying message that appears when the page loads.
I've tried to set the report viewer control to Enable = false;
and only after hitting the button to Enable = true;
but it didn't work.
I want to crawl a website and store the content on my computer for later analysis. However my OS file system has a limit on the number of sub directories, meaning storing the original folder structure is not going to work.
Suggestions?
Map the URL to some filename so can store flatly? Or just shove it in a database like sqlite toavoid file system limitations?
I try to draw a table on a panel in C# Windows Form by using GDI+. The problem is that when I minimize the application, my drawing disappears. How can I avoid this and why acting this way?
In my SVN repository tags are listed by version where name contains dots. e.g. 0.10 or 0.12.1
branches are named like proj-0.24-rc
In the same time, for example in Mono project branches has not dots.
Is it some practice toavoid dots? Could it be treated like extension delimiter (by web server where repository is been served), etc?
In Rails, when I want to find by a user given value and avoid SQL injection (escape apostrophes and the like) I can do something like this:
Post.all(:conditions => ['title = ?', params[:title]])
I know that an unsafe way of doing this (possible SQL injection) is this:
Post.all(:conditions => "title = #{params[:title]}")
My question is, does the following method prevent SQL injection or not?
Post.all(:conditions => {:title => params[:title]})
DataGridView inserting an extra row every time I populate with data. The row appears even if I only fill the column headers. This is causing problems when I try to get values of each cell.
Is there a way toavoid this perhaps in properties?
Thanks in advance for any suggestions.
I have a number of database table that looks like this:
EntityId int : 1
Countries1: "1,2,3,4,5"
Countries2: "7,9,10,22"
I would like to have NHibernate load the Country entities identifed as 1,2,3,4,5,7,9 etc. whenever my EntityId is loaded.
The reason for this is that we want toavoid a proliferation of joins, as there are scores of these collections.
I'm working to create an HTML email which includes 2 images. Currently, I'm using tags to place the image in the email. Problem is when users get the email, it's asking the user to "click to download" for security reasons.
Is there a way to embed the image in the email, toavoid this issue?
I'm using Coldfusion to send the email.
Thanks
I am running multiple applications with a single Codeigniter system/ folder using the recommended way on the Codeigniter wiki. Each application runs fine and I can link between apps using absolute URLs.
Is there some way I can use or extend the URL helper class (functions like anchor(), redirect()... etc.) to generate links to controllers across applications. I would like toavoid absolute URLs
Thanks!