instruction
stringlengths
0
30k
If you use MyISAM, you won't be doing **any** transactions per hour, unless you consider each DML statement to be a transaction (which in any case, won't be durable or atomic in the event of a crash). Therefore I think you have to use InnoDB. 300 transactions per second sounds like quite a lot. If you absolutely ...
I have a line of C# in my ASP.NET code behind that looks like this: DropDownList ddlStates = (DropDownList)fvAccountSummary.FindControl("ddlStates"); The DropDownList control is explicitly declared in the markup on the page, not dynamically created. It is inside of a FormView control. When my code hits this l...
- Make sure the "stand-up" remains a STAND-up. It is very easy to slide into longer and longer meetings. - One day of sprint planning and three days at the end may be too much. Only schedule as much time as you need. - +1 to the idea of shorter iterations. Personally, four one-week iterations within a sprint ha...
What I did in this circumstance is I created a repository class that passes back IQueryable<t> but basically is just >from t in _db.Table select t; this is usually referenced by tableRepository.GetAllXXX(); but you could have a tableRepository.GetAllNonDeletedXXX(); that puts in that preliminary where clause...
The easiest way is the sql server database publishing wizard. -Open source -Free -Does exactly what you want -Developed by microsoft It does not have all the features of mysqldump but it is close enough. http://www.codeplex.com/sqlhost/wiki/view.aspx?title=database%20publishing%20wizard
Too bad it's not Oracle, or else you could use trunc() or to_char(). But I had similar issues with SQL Server and used the CONVERT() and DateDiff() methods, as referenced [here][1] [1]: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54594
I don't think there is a built in way to get it from Python itself. My question is, how are you getting the IP information from your network? To get it from your local machine you could parse ifconfig (unix) or ipconfig (windows) with little difficulty.
There's no way to specify a format with the helpers themselves. The approach you've taken will work. Another approach is to add the value pre-formatted into the ModelState.
There's no way to specify a format with the helpers themselves. The approach you've taken will work. Another approach is to add the value pre-formatted into the ModelState. **EDIT**: Are you sure you even want to format a text input with the currency? For example, what you would see in the input is: <input type="...
Datediff becomes more difficult to use as you have more dateparts in your difference (i.e. in your case, looks like minutes and seconds; occasionally hours). Fortunately, in most variations of TSQL, you can simply perform math on the dates. Assuming this is a date field, you can probably just query: select duratio...
Almost. It's uglier than that though (and you probably don't want a trailing semi-colon in the macro itself: #define DBGPRINT( DBGPRINT_ARGS ) printf DBGPRINT_ARGS To use it: DBGPRINT("%s\n", "Hello World");
Almost. It's uglier than that though (and you probably don't want a trailing semi-colon in the macro itself: #define DBGPRINT( DBGPRINT_ARGS ) printf DBGPRINT_ARGS To use it: DBGPRINT(("%s\n", "Hello World")); (was missing a pair of parens). Not sure why all the negatives, the original question didn't stat...
You might find the latest C++0x [draft Standard][1] useful. [1]: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2723.pdf/ "C++0x draft Standard"
You really should not access any derived classes from the base class as it pretty much breaks the idea of OOP. Readibility certainly goes a long way, but I wouldn't trade it for reusability. Consider the case when you'll need to add another subclass - you'll also need to update the base class accordingly.
A potentially dangerous Request.Form value was detected from the client
|asp.net|form-validation|html-encode|
Everytime a user posts something containing < or > in a page in my webapp, I get this exception thrown. I don't want to go into the discussion about the smartness of throwing an exception or crashing an entire webapp because somebody entered a character in a textbox, but I am looking for an elegant way to handle t...
how to get login credentials by openId?
|web-applications|openid|
Is is possible to get login credentials such as name/id if user does login by openId
Keep the old stuff in VB. All new stuff in C#. The transistion might be slow but you will not loss time. On free time, change stuff in C#.
You can do it by messing with the paint command, sort of like this: public class JVertLabel extends JComponent{ private String text; public JVertLabel(String s){ text = s; } public void paintComponent(Graphics g){ super.paintComponent(g); ...
Start with the business logic and work your way out to the pages. Encapsulate everything you can into C# libraries that you can add as references to the VB.NET site. Once you've got all of your backend ported over and tested, you can start doing individual pages, though I would suggest that you not roll out until y...
Effective Methods to Manage Digital Distraction
|time-management|communication|
With the plethora of communication methods available to co-workers, how do you manage to keep distractions at bay for a large enough block of time to accomplish some focused programming? Do you quit or close all communications, have you informed people that an away message really means you are a way, or something el...
A few questions: 1. At what point in the page lifecycle do you load the control? 2. Where is the event handler code? In the control itself or do you try to hook it up to the page? 3. What have you done so far to wire up the event? Finally, the style guidelines for .Net specifically recommend _against_ usi...
Reverse Engineering for Database Diagramming in Visio with SQL Server 2008
|database|odbc|visio|sql-server-2008|
I need to reverse engineer a **Microsoft SQL Server 2008** in order to create a **Microsoft Visio 2007 Database Model Diagram**. So I choose **Reverse Engineer** from the Database menu to connect to the DB. I configured the Microsoft SQL Server Visio driver so that is uses SQL Server Native Client 10.0 as the ODBC d...
What is the linux equivalent to DOS pause?
|linux|
I have a bash shell script in which I would like to pause execution until the user presses a key. In DOS, this is easily accomplished with the "pause" command. Is there a linux equivalent I can use in my script?
(defun maybe-kill-buffer () (if (and (not buffer-file-name) (buffer-modified-p)) ;; buffer is not visiting a file (y-or-n-p (format "Buffer %s has been edited. Kill it anyway? " (buffer-name))) t)) (add-to-list 'kill-buff...
- There's a header that can include information about a proxy server the user is using, and that can also include the user's IP address (in which case the other IP is the one of the proxy) - Screen Resolution, Operating System, Color Depth, size of your taskbar (compare max and current resolution), if Java is enable...
You will need to issue the following command (connected as a user that has alter system privileges, sys will do it) alter system set sessions=*numberofsessions* scope=spfile; Have you been getting an ORA-12516 or ORA-12520 error? If so it's probably a good idea to increase the number of processes too alter sy...
How to embed and play audio/video on HTML page that plays on iPhone browser over GPRS
|html|iphone|
Although I don't have an iPhone to test this out, my colleague told me that embedded media files such as the one in the snippet below, only works when the iphone is connected over the WLAN connection or 3G, and does not work when connecting via GPRS. <html><body> <object data="http://joliclic.free.fr/html...
How to embed audio/video on HTML page that plays on iPhone browser over GPRS
If you need to access an overloaded static property/Method within a method that hasn't been overloaded in a subclass - you need late static binding. A quick example: [paste2.org][1] The classic example is the ActiveRecord class from Rails, if you try to implement something similar in PHP, which would look like this:...
I find that using this function helps to strip out a lot of possible xss attacks: http://www.codebelay.com/killxss.phps
Another option is to add in a global error handler, that would capture the exception at the application level and redirect the user to a "Session Elapsed" page. If you want an idea of a general implementation of a global error handler, I have one available on my website, I can give you the code if needed - http://i...
Well... Maybe because it is a pain to write xslts... I had to write a few xslts a few months ago and I was dreaming of pointy brackets... <Really> <No> <fun/> </No> </Really> (I do know, that this is no xslt)
We have been using an alternative approach in my current project - we haven't got the db under source control but instead have been using a database diff tool to script out the changes when we get to each release. It has been working very well so far.
On Windows you can always use `PeekNamedPipe`, but I doubt that's what you want to do anyway. MSN
TBH, I dont think there is much value in setting a breakpoint within the Javascript since it pretty much comes straight back to the server anyways. It would be best to set breakpoints in your server code.. Depending on what you are trying to debug this will be in different places.. Either in the page event cycle or ...
I know that's not exactly the answer you're looking for, but you should opt for a more "serious" installer. We're using Advanced Installer and it's a blast, does anything and everything you can think of.
Because most XSLT implementations have a high memory footprint (I suppose that's caused by the design of the language), because people tended to abuse XSLT for all kinds of things that it was not particularly well-suited for and the purely-declarative nature of XSL which makes certain types of transformations quite dif...
if i remember right, in vb you want to redim with preserve to grow an array.
We bind to almost nothing but Interfaces in our project, all without problem. The problem you're experiencing is due to entlib... but I'm not familiar enough with entlib to help you there. WPF can, however, bind to Interfaces.
How about a static generic method? You could reuse it from within your enum's getByCode() methods or simply use it directly. I always user integer ids for my enums, so my getById() method only has do do this: return values()[id]. It's a lot faster and simpler.
Generally, the times when you will be required to transform XML data into a different form of XML data, but not do any other processing to it are going to be very limited. Usually XML is used as an intermediary between two separate systems, one of which is usually custom made to process the output of the other. As such...
It was basically a way of saying that in subsequent regexes (s/// or m//), the ^ or $ assertions should be able to match before or after newlines embedded in the string. The recommended equivalent is the m modifier at the end of your regex (e.g., s/\n((\w*\-*\.*\w*\/*)+\:)/$1/gm;).
You could write a function which would perform the conversion from price to string. This way you have a lot of control over the output. The problem with locale is that it's web server dependent and not web browser dependent.
It turns on multi-line mode. Since perl 5.0 (from 1994), the correct way to do that is adding a *m* and/or the *s*modifier to your regexps, like this s/\n?Project.*rebuilt\.//msg
It turns on multi-line mode. Since perl 5.0 (from 1994), the correct way to do that is adding a *m* and/or the *s* modifier to your regexps, like this s/\n?Project.*rebuilt\.//msg
I know I am little bit off-topic here, and know nothing about voice recognition software; however, you might find it useful to investigate changing your keyboard to the Dvorak layout, which I have heard is a lot kinder on the wrists. http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard
How do I create a node from a cron job in drupal?
|php|drupal|drupal6|
In a custom module for drupal 4.7 I hacked together a node object and passed it to node_save($node) to create nodes. This hack appears to no longer work in drupal 6. While I'm sure this hack could be fixed I'm curious if there is a standard solution to create nodes without a form. In this case the data is pulled in ...
just use `typeof`. typeof(foobar) // -> undefined typeof(alert) // -> function You can't, however, defined a function based on typeof, because you'd need to pass an identifier which might not exist. So if you define `function isfun(sym) { return typeof(sym) }`, and then tried calling `isfun(inexistent...
just use `typeof`. typeof(foobar) // -> undefined typeof(alert) // -> function You can't, however, defined a function based on typeof, because you'd need to pass an identifier which might not exist. So if you define `function isfun(sym) { return typeof(sym) }`, and then tried calling `isfun(inexistent...
just use `typeof`. typeof(foobar) // -> undefined typeof(alert) // -> function You can't, however, defined a function based on typeof, because you'd need to pass an identifier which might not exist. So if you define `function isfun(sym) { return typeof(sym) }`, and then tried calling `isfun(inexistent...
I'd suggest looking at the code for PDFCreator (VB, if I'm not mistaken, but that shouldn't matter since you'd just be implementing similar code in another language), which uses GhostScript (GNU license). Or just dig straight into GhostScript itself; there's also a facade layer available called GhostPDF, which may do w...
I would back up the designer.cs file associated with it (like copy it to the desktop), then edit the designer.cs file and remove the offending lines (keeping track of what they do) and then I'd try to redo those lines via the design mode of that form.
You need [ARP](http://en.wikipedia.org/wiki/Address_Resolution_Protocol). Python's standard library doesn't include any code for that, so you either need to call an external program (your OS may have an 'arp' utility) or you need to build the packets yourself (possibly with a tool like [Scapy](http://www.secdev.org/pro...
A [Ruby-Talk][1] post suggests using the **[pdftk][2]** toolkit to merge the PDFs. It should be relatively straightforward to call *pdftk* as an external process and have it handle the merging. *PDF::Writer* may be overkill because all you're looking to accomplish is a simple append. [1]: http://www.ruby-f...
Try to connect to the repository using command line SVN to see if you get a similar error. $ svn checkout http://svn.python.org/projects/peps/trunk If you keep getting the error, it is probably an issue with your proxy server. I have found that I can't check out internet based SVN projects at work because ...
Depends on your platform. If you're using *nix, you can use the 'arp' command to look up the mac address for a given IP (assuming IPv4) address. If that doesn't work, you could ping the address and then look, or if you have access to the raw network (using BPF or some other mechanism), you could send your own ARP packe...
Rich Edit Control in raw Win32
|winapi|windows|
Is the documentation for Rich Edit Controls really as bad (wrong?) as it seems to be? Right now I'm manually calling LoadLibrary("riched20.dll") in order to get a Rich Edit Control to show up. The documentation for Rich Edit mentions nothing about this, it talks about calling InitCommonControlsEx(), but makes no ment...
Use the Fourier transform, it's much more noise insensitive than counting zero crossings
Use the Fourier transform, it's much more noise insensitive than counting zero crossings Edit: @WaveyDavey I found an F# library to do an FFT: [From here][1] > As it turns out, the best free > implementation that I've found for F# > users so far is still the fantastic > FFTW library. Their site has a > pr...
Are "proxy properties" good style?
|c#|properties|code-style|
I have a class with a string property that's actually several strings joined with a separator. I'm wondering if it is good form to have a proxy property like this: public string ActualProperty { get { return actualProperty; } set { actualProperty = value; } } public string[]...
SQL Select Upcoming Birthdays
|sql|t-sql|
I'm trying to write a stored procedure to select employees who have birthdays that are upcoming. `SELECT * FROM Employees WHERE Birthday > @Today AND Birthday < @Today + @NumDays` This will not work because the birth year is part of Birthday, so if my birthday was '09-18-1983' that will not fall between '09-18-...
I'm trying to write a stored procedure to select employees who have birthdays that are upcoming. `SELECT * FROM Employees WHERE Birthday > @Today AND Birthday < @Today + @NumDays` This will not work because the birth year is part of Birthday, so if my birthday was '09-18-1983' that will not fall between '09-18-...
|sql|t-sql|sql-server|
I'm trying to write a stored procedure to select employees who have birthdays that are upcoming. `SELECT * FROM Employees WHERE Birthday > @Today AND Birthday < @Today + @NumDays` This will not work because the birth year is part of Birthday, so if my birthday was '09-18-1983' that will not fall between '09-18-...
There was a question awhile back on [removing duplicates from an array][1]. For the purpose of the question performance wasn't much of a consideration, but you might want to take a look at the answers as they might give you some ideas. Also, I might be off base here, but if you are trying to remove duplicates from the ...
If you want to use the literal method, it's like this: var query = from l in transaction_log where SqlMethods.Like(l.stoptime, "%2008%") select l; That method is in the **System.Data.Linq.SqlClient** namespace
If you want to use the literal method, it's like this: var query = from l in transaction_log where SqlMethods.Like(l.stoptime, "%2008%") select l; Another option is: var query = from l in transaction_log where l.stoptime.Contains("2008") selec...
Here's my answer in the new correct 'answer your own question' format. ---------- Here's how I do it. fake-command /u %1 /p %2 Here's what the command line looks like: test.cmd admin P@55w0rd > test-log.txt The %1 applies to the first parameter the %2 (and here's the tricky part) applies ...
That sounds like quite an involved task! Off the top of my head, a consonant phoneme needs a vowel either before or after it. Determining what a phoneme is will be quite hard though! You'll probably need to manually write out a list of them. For example, "TR" is ok but not "TD", etc.
We had a similar issue with iFrame sizing on our web app main page, although in IE6. The solution was to trap the window.onresize event and call a JavaScript funtion to appropriately size the iFrame. "content" is the name of the iframe we want sized. Also note that we are using ASP.Net AJAX's $get which translates to d...
Cygwin Folders
|cygwin|
Can I safely rename the cygdrive folder? Also, I would like to add other folders at root and map them to folders on windows in the same way as /cygdrive/c maps to my C drive. Is that possible?
I've done multithreaded data access, and it's not straightforward: 1) You need to create a session per thread. 2) Everything done to that TDataSet instance must be done in context of the thread where it was created. That's not easy if you wanted to place e.g. a db grid on top of it. 3) If you want to let e.g....
One would think [Wireshark][1] would solve your problem -- no hassle install and pretty easy to use. [1]: http://www.wireshark.org/
One would think [Wireshark][1] would solve your problem -- no hassle install and pretty easy to use. Edit: Ah, I see now the interception requirement vs. just sniffing.. in this case Wireshark alone won't cut it. Probably whatever's the equivalent of iptables on windows would. [1]: http://www.wireshark.org/
In your specific case, the getCode() / getByCode(String code) methods seems very closed (euphemistically speaking) to the behaviour of the toString() / valueOf(String value) methods provided by all enumeration. Why don't you want to use them?
You will not get their actual username (or password), but you will get their OpenID wich is unique.
You may want to consider looking at [J/Invoke][1] as an alternative to thew much berated JNI. [1]: http://www.jinvoke.com/
You may want to consider looking at [J/Invoke][1] as an alternative to the much berated JNI. [1]: http://www.jinvoke.com/