instruction
stringlengths
0
30k
Your simplest answer lies in the next version of css (3), which currently no browser supports. For now you are relegated to calculating heights in javascript and setting them on the left side. If the navigation is so important to be positioned in such a way, run it along the top. you could also do a visual ...
Your simplest answer lies in the next version of css (3), which currently no browser supports. For now you are relegated to calculating heights in javascript and setting them on the left side. If the navigation is so important to be positioned in such a way, run it along the top. you could also do a visual ...
Anyone soloing using fogbugz?
|fogbugz|
Is there anyone working solo and using fogbugz out there? I'm interested in personal experience/overhead versus paper. I am involved in several projects and get pretty hammered with lots of details to keep track of... Any experience welcome. (Yes I know Mr. Joel is on the stackoverflow team... I still want good a...
I'm guessing Date.Parse() doesn't work?
Well then method 2 seems the best way: private function castMethod2(dateString:String):Date { if ( dateString == null ) { return null; } if ( dateString.indexOf("0000-00-00") != -1 ) { return null; } dateString = dateString.split(...
I had no luck using the BinaryFormatter, I guess I have to have a complete struct that matches the content of the file exactly. I realised that in the end I wasn't interested in very much of the file content anyway so I went with the solution of reading part of stream into a bytebuffer and then converting it using ...
The best I've found is gedit unfortunately. Spend a few hours with it and you'll discover it's not so bad, with plugins and themes. You can use the command line to open documents in it.
Try [akismet][1] from wp guys [1]: http://akismet.com/
I use [SciTE][1] very small and simple text editor. [1]: http://www.scintilla.org/SciTE.html
Maybe he doesn't want to use **BinaryFormatter** because it's too slow. Anyway, I don't see any problem with your code. just out of my head, what if you try to do it manually? does it work? BinaryReader reader = new BinaryReader(stream); StructType o = new StructType(); o.FileDate = Encoding.ASCI...
Maybe he doesn't want to use **BinaryFormatter** because it's too slow. Anyway, I don't see any problem with your code. just out of my head, what if you try to do it manually? does it work? BinaryReader reader = new BinaryReader(stream); StructType o = new StructType(); o.FileDate = Encoding.ASCI...
As far as I know, without programmatically generating the CSS file, there's no way to, say, define your favorite shade of blue (#E0EAF1) in one and only one spot. You could pretty easily write a computer program to generate the file. Execute a simple find-and-replace operation and then save as a .css file.
As far as I know, without programmatically generating the CSS file, there's no way to, say, define your favorite shade of blue (#E0EAF1) in one and only one spot. You could pretty easily write a computer program to generate the file. Execute a simple find-and-replace operation and then save as a .css file. Go fr...
As far as I know, without programmatically generating the CSS file, there's no way to, say, define your favorite shade of blue (#E0EAF1) in one and only one spot. You could pretty easily write a computer program to generate the file. Execute a simple find-and-replace operation and then save as a .css file. Go fr...
The most readable, IMO: SELECT * FROM TABLE WHERE Date > DATEADD(yy, -1, CONVERT(datetime, CONVERT(varchar, GETDATE(), 101))) Which: 1. Gets now's datetime *GETDATE() = #8/27/2008 10:23am#* 2. Converts to a string with format 101 *CONVERT(varchar, #8/27/2008 10:23am#, 101) = '8/27/2007'* 3. Co...
As many posters have already mentioned, you should use tables to display for tabular data. Tables were introduced in <a href="http://www.w3.org/TR/REC-html32.html#body">HTML 3.2</a> here is the relevant paragraph from the spec on their usage: > [tables] can be used to markup tabular material or for layout purpose...
Have you considered adding the DefaultValue as a static property of the ExtenderProvider, then you can access it without requiring an instance of the provider?
Here is a way to do it using a P/Invoke. public const int WM_NCLBUTTONDOWN = 0xA1; public const int HTCAPTION = 0x2; [DllImport("User32.dll")] public static extern bool ReleaseCapture(); [DllImport("User32.dll")] public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int ...
Remove duplicates from a List<T> in C#
|c#|generics|
Anyone have a quick method for de-duplicating a generic List<T> in C#?
I think the best approach to simulate it would be a **Fork** class with a method like *use*() that holds the fork (bool available = false) and a *release*() that releases it. A **Philosopher** class with *getFork*(**Fork**) and *releaseFork*(**Fork**) that operates the holding/releasing of the object Fork (seems to ...
I think the best approach to simulate it would be a `Fork` class with a method like `use()` that holds the fork (`bool available = false`) and a `release()` that releases it. A `Philosopher` class with `getFork(Fork)` and `releaseFork(Fork)` that operates the holding/releasing of the object Fork (seems to me a timer...
Tom is correct in describing exactly what the + operator does. It creates a temporary `StringBuilder`, appends the parts, and finishes with `toString()`. However, all of the answers so far are ignoring the effects of HotSpot runtime optimizations. Specifically, these temporary operations are recognized as a common...
How do I create an HTML anchor in a FogBugz wiki page?
|wiki|fogbugz|
The StackOverflow transcripts are enormous, and sometimes I want to link to a little bit within it. How do I create an HTML anchor in a FogBugz wiki page?
When dealing with indexes, you have to determine what your table is going to be used for. If you are primarily inserting 1000 rows a second and not doing any querying, then a clustered index is a hit to performance. If you are doing 1000 queries a second, then not having an index will lead to very bad performance. T...
When dealing with indexes, you have to determine what your table is going to be used for. If you are primarily inserting 1000 rows a second and not doing any querying, then a clustered index is a hit to performance. If you are doing 1000 queries a second, then not having an index will lead to very bad performance. T...
When dealing with indexes, you have to determine what your table is going to be used for. If you are primarily inserting 1000 rows a second and not doing any querying, then a clustered index is a hit to performance. If you are doing 1000 queries a second, then not having an index will lead to very bad performance. T...
x86 Assembly on a mac...
|asm|macos|x86|xcode|
Does anyone know of any good tools (i'm looking for IDEs, primarily) to write assembly on the mac... XCode is a little cumbersome to me. Also, on the Intel Macs, can I use generic x86 asm? or is there a modified instruction set? Any information about post Intel Mac assembly helps.
|macos|xcode|x86|asm|
Does anyone know of any good tools (i'm looking for IDEs, primarily) to write assembly on the mac... XCode is a little cumbersome to me. Also, on the Intel Macs, can I use generic x86 asm? or is there a modified instruction set? Any information about post Intel Also: I know that on windows, asm can run in an e...
Variation on @KG, using the milliseconds since EPOCH as the seed for rand?
I don't understand why you would use a custom control for that, when the builtin ASP.NET AJAX UpdatePanel does the same thing. It just adds more complexity, gives you less support, and makes it more difficult for others to work on your app.
According to [this support message](http://our.fogbugz.com/default.asp?fogbugz.4.25208), the feature is not yet currently implemented: > The FogBugz wiki does not currently support anchors within a document, unfortunately. It's definitely on the list of features we're considering for the next release, though.
The Haskell wikibook: <http://en.wikibooks.org/wiki/Haskell> which includes the text from the great tutorial Yet Another Haskell Tutorial.
The Haskell wikibook: <http://en.wikibooks.org/wiki/Haskell> which includes the text from the great tutorial Yet Another Haskell Tutorial. (The "Generic Haskell User Guide" paper is a fine paper, but I think it is a particularly bad recommendation for a beginning Haskell programmer, as it is more of an academi...
Another route you could take is not to mess around with your own repository per se, for fear of messing things up, but you could use someone else's repository or set up your own elsewhere. Point being, I learned by using SourceForge, which has both CVS and SVN... but hearing good things about SVN and weighing the diffe...
That topic is covered in depth here [Easily Change or Switch the Default Audio Sound Output in Vista or XP][1]. Note that sound management was changed in Vista significantly. On a side note, I believe [SnapStream][2] is/was working on an application to allo multi-channel sound cards to output to different rooms (se...
You should also checkout [syntaxhighlighter][1] from Google Code. [1]: http://code.google.com/p/syntaxhighlighter/
CreateProcessAsUser vs ShellExecute
|winapi|windows-nt|
I need to ShellExecute something as another user, currently I start a helper process with CreateProcessAsUser that calls ShellExecute, but that seems like too much of a hack (Wrong parent process etc.) Is there a better way to do this?
I need to ShellExecute something as another user, currently I start a helper process with CreateProcessAsUser that calls ShellExecute, but that seems like too much of a hack (Wrong parent process etc.) Is there a better way to do this? @PabloG: ImpersonateLoggedOnUser does not work: <pre> HANDLE hTok; VERIFY(Logo...
Tom is correct in describing exactly what the + operator does. It creates a temporary `StringBuilder`, appends the parts, and finishes with `toString()`. However, all of the answers so far are ignoring the effects of HotSpot runtime optimizations. Specifically, these temporary operations are recognized as a common...
Sort it, then check two and two next to each others, as the duplicates will clump together. Something like this: list.Sort(); Int32 index = 0; while (index < list.Count - 1) { if (list[index] == list[index + 1]) list.RemoveAt(index); else index++; ...
to andy47, I did not mean that you can use the empty string in a comparison, but oracle treats it like null if you use it in an insert. Re-read my entry, then try the following SQL: CREATE TABLE atable (acol VARCHAR(10)); INsERT INTO atable VALUES( '' ); SELECT * FROM atable WHERE acol IS NULL;
to andy47, I did not mean that you can use the empty string in a comparison, but oracle treats it like null if you use it in an insert. Re-read my entry, then try the following SQL: CREATE TABLE atable (acol VARCHAR(10)); INsERT INTO atable VALUES( '' ); SELECT * FROM atable WHERE acol IS NULL; ...
The Rails community has been very vocal in evangelising RoR, with the result that high expectations have been set and not always met (programmer productivity is good, but ensuring good performance once deployed isn't so easy). Grails has been designed as the scripted successor to Java, whereas the Ruby-Java integrat...
Perhaps you should consider using a [HashSet][1]? [1]: http://msdn.microsoft.com/en-us/library/bb359438.aspx
I ran a similar test as @marcio but with the following loop instead: String c = a; for (long i = 0; i < 100000L; i++) { c = c.concat(b); // make sure javac cannot skip the loop // using c += b for the alternative } Just for good measure, I threw in `StringBuilder.append()` as well....
I don't see any problem with your code. just out of my head, what if you try to do it manually? does it work? BinaryReader reader = new BinaryReader(stream); StructType o = new StructType(); o.FileDate = Encoding.ASCII.GetString(reader.ReadBytes(8)); o.FileTime = Encoding.ASCII.GetString(reader...
I think asking the user simple questions like: "How many legs does a dog have?" Would be much more effective that any CAPTCHA systems out there at the moment. Not only is it very difficult for the computer to answer that question, but it is **very easy for a human to answer**!
+1 for pico/nano -- lightweight, gets the job done, good help
If you used Server.MapPath, then you should already have the relative web path. According to the [MSDN documentation][1], this method takes one variable, *path*: > Specifies the relative or virtual path > to map to a physical directory. If > Path starts with either a forward (/) > or backward slash (\), the MapPa...
If you used Server.MapPath, then you should already have the relative web path. According to the [MSDN documentation][1], this method takes one variable, *path*, which is the virtual path of the Web server. So if you were able to call the method, you should already have the relative web path immediately accessible. ...
Kate, the KDE Advanced Text Editor is quite good. It has syntax highlighting, block selection mode, terminal/console, sessions, window splitting both horizontal and vertical etc.
Altova's [XML Spy](http://www.altova.com/products/xmlspy/xml_editor.html) is a great editor, but not necesarily the cheapest option out there.
I found that if you append the last modified timestamp of the file onto the end of the URL the browser will request the files when it is modified. For example in PHP: function urlmtime($url) { $parsed_url = parse_url($url); $path = $parsed_url['path']; if ($path[0] == "/") { $...
If you go into the submit options, there is an option to perform custom action using rules. If you have all of the data connections set up, you can configure rules to select which connection to submit to.
Format numbers to strings in Python
|python|
I need to find out how to format numbers as strings. My code is here: return str(hours)+":"+str(minutes)+":"+str(seconds)+" "+ampm Hours and minutes are integers, and seconds is a float. the str() function will convert all of these numbers to the tenths (0.1) place. So instead of my string outputting "5:30:...
I'd say that any of the current iMac models are more that good enough for development with their dual core, 6MB cache, 1066MHz FSB cpus. You might consider going with more than 1GB of ram, but compare aftermarket prices at places like <a href="http://www.newegg.com/">NewEgg</a> to what Apple wants (for example, I upgra...
Formatting in Python is done via the [string formatting (`%`) operator](http://docs.python.org/lib/typesseq-strings.html): "%02d:%02d:%02d" % (hours, minutes, seconds) /Edit: There's also [strftime](http://docs.python.org/lib/module-time.html#l2h-2826).
A great book if you're just beginning is Matthew MacDonald's [Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional][1]. Once you're done with that a great reference (also by MacDonald) is [Pro ASP.NET 3.5 in C# 2008][2]. One of my favorite sources of information online is [4GuysFromRolla][3]. [1]: http:...
You can use C style string formatting: "%d:%d:d" % (hours, minutes, seconds) See here, especially: http://diveintopython.org/native_data_types/formatting_strings.html
Mercurial Stuck
|mercurial|
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now get this message for almost all hg commands: c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' interrupted! Goog...
Mercurial "Stuck waiting for lock"
Mercurial stuck "waiting for lock"
While you can differenciate the code execution looking the exception don't matter if it's done by the "catch exceptionType hierarchy mode" or by "if(...) else...exception code mode" but if you are developing software wich is going to be used by other people, like a library i think it's usefull create your own except...
Provided this question is properly tagged, you can select LAMP server option during installation of Ubuntu. This will install and configure all required components automatically. A detailed instruction on how to do this can be found, for example, there: [http://www.ubuntugeek.com/ubuntu-804-hardy-heron-lamp-server-setu...
"Send to --> Compressed (zipped) Folder" creates a zip file. What it puts in there is based on your settings. It does not include hidden files with the default settings. If you have your explorer view settings set as Kibbee mentioned to "Show hidden files and folders", then "Send to --> Compressed (zipped) Folder" w...
"Send to --> Compressed (zipped) Folder" creates a zip file. What it puts in there is based on your settings. It does not include hidden files with the default settings. If you have your explorer view settings set as Kibbee mentioned to "Show hidden files and folders", then "Send to --> Compressed (zipped) Folder" w...
>I dont´t know ASP.NET MVC, but I am very familiar with MVC pattern. I don´t see another way to build professional applications without MVC. And it has to be MVC model 2, like Spring or Struts. By the way, how you people were building web applications without MVC? When you have a situation that some kind of validation ...
`menuItem.Icon = new BitmapImage(new Uri("images/sample.png", UriKind.Relative));`
NullReferenceException on User Control handle
|asp.net|user-controls|
I have an Asp.NET application (VS2008, Framework 2.0). When I try to set a property on one of the user controls like myUserControl.SomeProperty = someValue; I get a NullReferenceException. When I debug, I found out that myUserControl is null. How is it possible that a user control handle is null? How do I fix...
<MenuItem> <MenuItem.Icon> <Image.Source> <BitmapImage UriSource="/your_assembly;component/yourpath/Image.png" /> </Image.Source> </MenuItem.Icon> </MenuItem> Just make sure your image in also included in the project file and marked as resource,...
How-to: Ranking Search Results
|php|mysql|search|
I have a webapp development problem that I've developed one solution for, but am trying to find other ideas that might get around some performance issues I'm seeing. problem statement: - a user enters several keywords/tokens - the application searches for matches to the tokens - need one result for each ...
Read Luke Kanies' discussion of exactly this question in [this blog post][1]. He references [a post from Jay Fields][2] which even suggests that using [a equivalent to ruby's/mocha's] stub_everything is preferrable to make the tests more robust. To quote Fields' final words: "Mocha makes it as easy to define a mock as ...
Is there a way to attach a debugger to a multi-threaded python process?
|python|debugging|
I'm trying to debug a deadlock in a multi-threaded python app after it has locked up. Is there a way to attach a debugger to inspect the state of the process?
I'm trying to debug a deadlock in a multi-threaded python app after it has locked up. Is there a way to attach a debugger to inspect the state of the process? Edit: I'm attempting this on Linux, but it would be great if there were a cross-platform solution. It's Python after all :)
You have probably touched on a much larger issue of designing for high scalability and performance in general. Essentially, for your database design I would follow good practices such as adding foreign keys and indexes to data you expect to be used frequently, normalise your data by splitting it into smaller tables ...
You have probably touched on a much larger issue of designing for high scalability and performance in general. Essentially, for your database design I would follow good practices such as adding foreign keys and indexes to data you expect to be used frequently, normalise your data by splitting it into smaller tables ...
I need to ShellExecute something as another user, currently I start a helper process with CreateProcessAsUser that calls ShellExecute, but that seems like too much of a hack (Wrong parent process etc.) Is there a better way to do this? @PabloG: ImpersonateLoggedOnUser does not work: <pre> HANDLE hTok; VERIFY(Logo...
I need to ShellExecute something as another user, currently I start a helper process with CreateProcessAsUser that calls ShellExecute, but that seems like too much of a hack (Wrong parent process etc.) Is there a better way to do this? @PabloG: ImpersonateLoggedOnUser does not work: <pre> HANDLE hTok; VERIFY(Logo...
I use [pygame][1] myself and it is very good. It has good documentation and tutorials, and is quite well designed. I've also heard wonderful reviews of [pyglet][2]. [1]: http://www.pygame.org/news.html [2]: http://www.pyglet.org/