I've inherited a very large project in ASP.net, SQL 2005 and have found where some SQL connections are not closed - which is bad. Without going thru every line of code, is there a way to detect if connections are not being closed? Performance counter? as a follow up - how does SQL reclaim unclosed connections. I'm using non-pooled connectionstring.
I'm new to Doctrine and ActiveRecord.
How should I filter a table after it has been loaded? (i suppose this is preferred over sending multiple queries?)
Is this 'good' or 'bad'?
class UserTable extends Doctrine_Table {
function filterByGroup($group) {
$ut = new UserTable();
foreach($this as $u) {
if($u->group = $group) $ut->add($u);
}
return $ut;
}
}
I'd like to store additional data if a particular value is chosen in the enumerated or looked-up column in a table. The obvious option is to have an extra column in the table, but this will lead to a mostly empty column and seems to be like bad approach. Is there another option/method of doing this?
OpenAL is such a huge thing, and the documentation doesn't tell what values are acceptable for properties. That's really bad.
I'm using the document: "OpenAL_Programmers_Guide.pdf"
Whenever I look up a property I'm left in the dark what value might be ok. For example, take AL_PITCH. What value?
Maybe someone wrote a better one? Or is there something like a wiki place with more details?
file.each_line do |line|
#skip the first one/not a user
3.times { next } if first == 1
first = 2
end
How can I get the 'next' to well, "next" the iteration of the each_line, instead of the 3.times iteration? Also, how can I write this to look better (ie: first == 1 looks bad)
I am working in Train Traffic Controller software project.
My responsibility in this project is to develop the visual railroad GUI.
By now I am using some svg graphics in that GUI.
I prefer them because of their scalability talents.
Is it good or bad idea to use svg in a desktop application?
Any suggestions?
First time I am bit disappointed in StackOverflow cause my http://stackoverflow.com/questions/2571727/c-concurrency-vs-java-concurrency-which-is-neatly-designed-which-is-better question was closed.
My intension was just trying to gather knowledge from programming guru's who worked in both the programming technologies. Rather closing this question, please help me by discussing what is good, bad, and ugly in multi-threading part in both the platforms.
It is also welcome, if someone would like to compare with .Net 4.0 with JDK 6 (or JDK 7)
Hey,
im using a connection to a server in my php script, opened with fsockopen() and i want it to share between different pages so i serialized it and saved it in a session variable but it seems that that ia a bad idea because when i do this nothing happens...
Not even an error.
The problem is that this connection requires a handshake so i cant reconnect everytime
Another question, whats the timeout of fsockopen or does the connection stay alive if the. original php script which called it is closed?
The idea behind the question is -
Just say No! to C# Regions
It is said that "the reason to use #region tags because all the things they are hiding is just really bad code."
How do you use regions effectively?
I know that on a 64-bit version of Windows the "Program Files" folder is for 64-bit programs and the "Program Files (x86)" folder is for 32-bit programs, but why is this even necessary?
By "necessary", I don't mean "why could Microsoft not have made any other design decisions?" because of course they could have. Rather, I mean, "why, given the current design of 64-bit Windows, must 32-bit programs have a separate top-level folder from 64-bit programs?"
There are plenty of questions on Super User and elsewhere that assert "one is for 32-bit programs, one is for 64-bit programs", but none that I can find give the reason. From my experience, it doesn't seem to matter whether a 32-bit program is installed in the correct place or not.
Does Windows somehow present itself differently to a program running out of "Program Files (x86)"? Is there a description that shows exactly what's different for a program installed in "Program Files (x86)" instead of "Program Files"? I think it's unlikely that Microsoft would introduce a new folder without a legitimate technical reason.
Is there any good framework for comparing whole objects?
now i do
assertEquals("[email protected]", obj.email);
assertEquals("5", obj.shop);
if bad email is returned i never get to know if it had the right shop, i would like to get a list of incorrect fields.
Hello,
when my user enters data validated as wrong a red circle with a white exclamation mark is shown in the right part of the textbox with the wrong data. The error message is only shown when the user hovers the textbox with wrong data.
Do you think that is a bad User experience ?
I could show the red error message text to the right side of the textboxes if there would still be space...
I've done 'git pull', and received a merge conflict. I know that the other version of the file is good, and that mine is bad (all my changes should be abandoned). How do I do this?
unmerged: _widget.html.erb
You are in the middle of a conflicted merge.
I was wondering if anyone new how to get access the metadata (the date in particular) from jpg, arw and dng files.
I've recently lost the folder structure after a merge operation gone-bad and would like to rename the recovered files according to the metadata.
I'm planning on creating a little C++ app to dig into each file and get the metadata.
any input is appreciated.
( alternatively, if you know of an app that already does this I'd like to know :)
#!/usr/bin/perl
use strict;
use warnings;
my $s = "sad day
Good day
May be Bad Day
";
$s =~ s/\w+ \w+/_/gm;
print $s;
I am trying to substitute all spaces between words with _, but it is not working. What is wrong with that?
Hi,
In class design, is it a bad habit if one method calls another method in the same class (For example, 3 methods call 1 method in the same class).
Thanks
I was happily running my CentOS 5.4 before something bad happened that somehow corrupted the 'nautilus' package. It stopped me from using the default Gnome Desktop.
Then I installed (using yum) the KDE and nautilus later on. Now, KDE is running perfectly with one exception that it takes around 10 minutes before showing up the Login Screen and only a blue screen with mouse pointer keeps showing during those 10 minutes.
Thanks in Anticipation.
Regards, Talal
Yet another newbie question..
Let's say I have an user table in declarative mode:
class User(Base):
__tablename__ = 'user'
id = Column(u'id', Integer(), primary_key=True)
name = Column(u'name', String(50))
When I have a list of users identifiers, I fetch them from db with:
user_ids = [1, 2, 3, 4, 5]
users = Session.query(User).filter(User.id.in_(user_ids)).all()
I dislike using in_ because I think I learned it has bad performance on indexed fields
(is that true/false?).
Anyway, is there a better way doing that query?
Thanks!
I just spent some time reading http://stackoverflow.com/questions/2768248/is-md5-really-that-bad (I highly recommend!).
In it, it talks about hash collisions. Maybe I'm missing something here, but can't you just encrypt your password using, say, MD5 and then, say, SHA-1 (or any other, doesn't matter.) Wouldn't this increase the processing power required to brute-force the hash and reduce the possibility of collision?
In a spring mvc + spring core app, we have have a view layers, a facade, a service layer, a dao layer and a stored-proc based persistance layer.
The service layer is unaware of the clients that utilitize its methods. Is it fine to propagate raw http requests into the service layer? Or is it bad practice and a violation of the loose coupling principles?
If it is, then what's a clean workaround?
When I look back my codes that written earlier time, I found something terribly bad.
Whenever I want to delete a record in the database, I did like this :
$.post("deleteAction.do",{recordId:10});
I cannot prevent a malicious user visit my database operation url directly :
deleteAction.do?recordId=10
What's the solution for this kind of problem ?
How do I restrict a string to whitelisted characters?
// "HOW am I to understand; this is, BAD"
$str = restrictTo($str,"0-9a-z,. ");
// " am I to understand this is, "
Is there an inbuilt function in PHP that does something close? I can't formulate a regular expression for this though :(
Hi everyone,
I work in a small company and we - as many others = use google analytics to monitor how well/bad our site is doing.
To access this information we put the google account's details (username and pwd) and off we go.
I now want to share this information with one of my clients but I don't want to give him my google account.
can anybody suggest the best way or the best practices to achieve this ?
Many Thanks
Lp
I merged the wrong way between two branches. I then ran the following:
git reset --hard HEAD^
I am now back at the previous commit (which is where I want to be). Was that the correct thing to do?
The bad commit is still in the repository, is that okay or should I do something else to remove it from the repository?
I have not pushed or committed anything else yet.