question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
115,361
115,376
What is the best way to handle incoming SMS messages?
I have a client who wants a solution to allow delivery people to text (SMS messaging) in that they have completed a pick up at a particular location. What I'm looking for is Code to read an imbound SMS message or a SMS component if appropiate. This would allow me to create a windows service to read the message and upda...
Probably not quite what you're looking for but one approach is to use a gateway like iTagg which provides a number of interfaces for developers to send and receive SMS/MMS etc. Depending on your location, iTagg may be no use but I'm sure there'll be an equivalent for your region.
What is the best way to handle incoming SMS messages? I have a client who wants a solution to allow delivery people to text (SMS messaging) in that they have completed a pick up at a particular location. What I'm looking for is Code to read an imbound SMS message or a SMS component if appropiate. This would allow me to...
TITLE: What is the best way to handle incoming SMS messages? QUESTION: I have a client who wants a solution to allow delivery people to text (SMS messaging) in that they have completed a pick up at a particular location. What I'm looking for is Code to read an imbound SMS message or a SMS component if appropiate. This...
[ "sms", "messaging" ]
2
2
980
3
0
2008-09-22T15:06:30.423000
2008-09-22T15:09:22.537000
115,369
115,382
Do you use source control for your database items?
I feel that my shop has a hole because we don't have a solid process in place for versioning our database schema changes. We do a lot of backups so we're more or less covered, but it's bad practice to rely on your last line of defense in this way. Surprisingly, this seems to be a common thread. Many shops I have spoken...
Must read Get your database under version control. Check the series of posts by K. Scott Allen. When it comes to version control, the database is often a second or even third-class citizen. From what I've seen, teams that would never think of writing code without version control in a million years-- and rightly so-- ca...
Do you use source control for your database items? I feel that my shop has a hole because we don't have a solid process in place for versioning our database schema changes. We do a lot of backups so we're more or less covered, but it's bad practice to rely on your last line of defense in this way. Surprisingly, this se...
TITLE: Do you use source control for your database items? QUESTION: I feel that my shop has a hole because we don't have a solid process in place for versioning our database schema changes. We do a lot of backups so we're more or less covered, but it's bad practice to rely on your last line of defense in this way. Sur...
[ "database", "version-control" ]
616
398
140,981
58
0
2008-09-22T15:07:33.273000
2008-09-22T15:09:55.827000
115,388
115,413
How can I customize the syntax highlighting in Visual Studio 2005?
Is it possible to customize the syntax highlighting in Visual Studio 2005? Up to now, I found no way to do this. In eclipse for example, it's possible to setup custom highlighting.
Do you mean more than just changing the colors -- like defining a new language with its own symbols and keywords? If so, http://msdn.microsoft.com/en-us/library/bb165041(VS.80).aspx
How can I customize the syntax highlighting in Visual Studio 2005? Is it possible to customize the syntax highlighting in Visual Studio 2005? Up to now, I found no way to do this. In eclipse for example, it's possible to setup custom highlighting.
TITLE: How can I customize the syntax highlighting in Visual Studio 2005? QUESTION: Is it possible to customize the syntax highlighting in Visual Studio 2005? Up to now, I found no way to do this. In eclipse for example, it's possible to setup custom highlighting. ANSWER: Do you mean more than just changing the color...
[ "visual-studio", "syntax-highlighting" ]
5
7
11,315
4
0
2008-09-22T15:10:42.767000
2008-09-22T15:14:46.907000
115,389
115,415
Update SQL Server Database Schema with software update
How do you update your SQL sever database when installing your product's update? Are there any tools that will integrate with windows installer? My typical schema changes are: Adding/removing columns Adding/removing tables. Adding views. Adding/alter indexs.
Not sure about integration with the windows installer, but you might look into Red Gate's SQL Packager
Update SQL Server Database Schema with software update How do you update your SQL sever database when installing your product's update? Are there any tools that will integrate with windows installer? My typical schema changes are: Adding/removing columns Adding/removing tables. Adding views. Adding/alter indexs.
TITLE: Update SQL Server Database Schema with software update QUESTION: How do you update your SQL sever database when installing your product's update? Are there any tools that will integrate with windows installer? My typical schema changes are: Adding/removing columns Adding/removing tables. Adding views. Adding/al...
[ ".net", "sql-server", "windows-installer" ]
6
1
1,719
6
0
2008-09-22T15:10:45.047000
2008-09-22T15:15:06.347000
115,399
115,440
Converting a year from 4 digit to 2 digit and back again in C#
My credit card processor requires I send a two-digit year from the credit card expiration date. Here is how I am currently processing: I put a DropDownList of the 4-digit year on the page. I validate the expiration date in a DateTime field to be sure that the expiration date being passed to the CC processor isn't expir...
If you're creating a DateTime object using the expiration dates (month/year), you can use ToString() on your DateTime variable like so: DateTime expirationDate = new DateTime(2008, 1, 31); // random date string lastTwoDigitsOfYear = expirationDate.ToString("yy"); Edit: Be careful with your dates though if you use the D...
Converting a year from 4 digit to 2 digit and back again in C# My credit card processor requires I send a two-digit year from the credit card expiration date. Here is how I am currently processing: I put a DropDownList of the 4-digit year on the page. I validate the expiration date in a DateTime field to be sure that t...
TITLE: Converting a year from 4 digit to 2 digit and back again in C# QUESTION: My credit card processor requires I send a two-digit year from the credit card expiration date. Here is how I am currently processing: I put a DropDownList of the 4-digit year on the page. I validate the expiration date in a DateTime field...
[ "c#", "datetime", "2-digit-year" ]
77
133
195,332
16
0
2008-09-22T15:12:16.663000
2008-09-22T15:17:53.343000
115,425
118,855
How do I get a list of installed CPAN modules?
Aside from trying perldoc individually for any CPAN module that takes my fancy or going through the file system and looking at the directories, I have no idea what modules we have installed. What's the easiest way to just get a big list of every CPAN module installed? From the command line or otherwise.
This is answered in the Perl FAQ, the answer which can be quickly found with perldoc -q installed. In short, it comes down to using ExtUtils::Installed or using File::Find, variants of both of which have been covered previously in this thread. You can also find the FAQ entry "How do I find which modules are installed o...
How do I get a list of installed CPAN modules? Aside from trying perldoc individually for any CPAN module that takes my fancy or going through the file system and looking at the directories, I have no idea what modules we have installed. What's the easiest way to just get a big list of every CPAN module installed? From...
TITLE: How do I get a list of installed CPAN modules? QUESTION: Aside from trying perldoc individually for any CPAN module that takes my fancy or going through the file system and looking at the directories, I have no idea what modules we have installed. What's the easiest way to just get a big list of every CPAN modu...
[ "perl", "perl-module", "cpan" ]
109
73
271,620
27
0
2008-09-22T15:15:51.383000
2008-09-23T02:58:02.583000
115,426
115,520
Algorithm to detect intersection of two rectangles?
I'm looking for an algorithm to detect if two rectangles intersect (one at an arbitrary angle, the other with only vertical/horizontal lines). Testing if a corner of one is in the other ALMOST works. It fails if the rectangles form a cross-like shape. It seems like a good idea to avoid using slopes of the lines, which ...
The standard method would be to do the separating axis test (do a google search on that). In short: Two objects don't intersect if you can find a line that separates the two objects. e.g. the objects / all points of an object are on different sides of the line. The fun thing is, that it's sufficient to just check all e...
Algorithm to detect intersection of two rectangles? I'm looking for an algorithm to detect if two rectangles intersect (one at an arbitrary angle, the other with only vertical/horizontal lines). Testing if a corner of one is in the other ALMOST works. It fails if the rectangles form a cross-like shape. It seems like a ...
TITLE: Algorithm to detect intersection of two rectangles? QUESTION: I'm looking for an algorithm to detect if two rectangles intersect (one at an arbitrary angle, the other with only vertical/horizontal lines). Testing if a corner of one is in the other ALMOST works. It fails if the rectangles form a cross-like shape...
[ "algorithm", "math", "graphics", "geometry", "separating-axis-theorem" ]
148
165
102,040
20
0
2008-09-22T15:15:53.397000
2008-09-22T15:28:21.650000
115,445
115,600
Parsing Office Documents
I`d like to be able to read the content of office documents (for a custom crawler). The office version that need to be readable are from 2000 to 2007. I mainly want to be crawling words, excel and powerpoint documents. I don`t want to retrieve the formatting, only the text in it. The crawler is based on lucene.NET if t...
Here's a nice little post on c-charpcorner by Krishnan LN that gives basic code to grab the text from a Word document using the Word Primary Interop assemblies. Basically, you get the "WholeStory" property out of the Word document, paste it to the clipboard, then pull it from the clipboard while converting it to text f...
Parsing Office Documents I`d like to be able to read the content of office documents (for a custom crawler). The office version that need to be readable are from 2000 to 2007. I mainly want to be crawling words, excel and powerpoint documents. I don`t want to retrieve the formatting, only the text in it. The crawler is...
TITLE: Parsing Office Documents QUESTION: I`d like to be able to read the content of office documents (for a custom crawler). The office version that need to be readable are from 2000 to 2007. I mainly want to be crawling words, excel and powerpoint documents. I don`t want to retrieve the formatting, only the text in ...
[ "c#", "asp.net", "ms-office" ]
3
0
2,131
5
0
2008-09-22T15:18:26.463000
2008-09-22T15:39:17.160000
115,459
939,784
Online tool for generating mathematical equation image files
I'm looking for an online tool that will let me create a gif or png like this one: Some kind of LaTex online service, with friendly examples?
I use Roger's Online Equation Editor. PNG, colors, transparent background and anti-aliasing are all included.
Online tool for generating mathematical equation image files I'm looking for an online tool that will let me create a gif or png like this one: Some kind of LaTex online service, with friendly examples?
TITLE: Online tool for generating mathematical equation image files QUESTION: I'm looking for an online tool that will let me create a gif or png like this one: Some kind of LaTex online service, with friendly examples? ANSWER: I use Roger's Online Equation Editor. PNG, colors, transparent background and anti-aliasin...
[ "math", "image" ]
38
30
82,934
13
0
2008-09-22T15:20:20.047000
2009-06-02T14:07:22.093000
115,462
115,492
Proportional image resize
I'm having a little bit of a problem scaling my images to a properly predefined size. I was wondering - since it is purely mathematics, if there's some sort of common logical algorithm that works in every language (PHP, ActionScript, Javascript etc.) to scale images proportionally. I'm using this at the moment: var max...
ratio = MIN( maxWidth / width, maxHeight/ height ); width = ratio * width; height = ratio * height; Make sure all divides are floating-point.
Proportional image resize I'm having a little bit of a problem scaling my images to a properly predefined size. I was wondering - since it is purely mathematics, if there's some sort of common logical algorithm that works in every language (PHP, ActionScript, Javascript etc.) to scale images proportionally. I'm using t...
TITLE: Proportional image resize QUESTION: I'm having a little bit of a problem scaling my images to a properly predefined size. I was wondering - since it is purely mathematics, if there's some sort of common logical algorithm that works in every language (PHP, ActionScript, Javascript etc.) to scale images proportio...
[ "language-agnostic", "image-manipulation" ]
31
65
19,548
6
0
2008-09-22T15:20:41.667000
2008-09-22T15:24:33.407000
115,472
466,131
"No symbols loaded for the current document" while debugging JavaScript in Visual Studio
I'm working on a.NET 3.5 website, with three projects under one solution. I'm using jQuery in this project. I'd like to use the Visual Studio JavaScript debugger to step through my JavaScript code. If I set a breakpoint in any of the.js files I get a warning that says: The breakpoint will not currently be hit. No symbo...
I was experiencing the same behavior in Visual Studio 2008, and after spending several minutes trying to get the symbols to load I ended up using a workaround - adding a line with the "debugger;" command in my JavaScript file. After adding debugger; when you then reload the script in Internet Explorer it'll let you bri...
"No symbols loaded for the current document" while debugging JavaScript in Visual Studio I'm working on a.NET 3.5 website, with three projects under one solution. I'm using jQuery in this project. I'd like to use the Visual Studio JavaScript debugger to step through my JavaScript code. If I set a breakpoint in any of t...
TITLE: "No symbols loaded for the current document" while debugging JavaScript in Visual Studio QUESTION: I'm working on a.NET 3.5 website, with three projects under one solution. I'm using jQuery in this project. I'd like to use the Visual Studio JavaScript debugger to step through my JavaScript code. If I set a brea...
[ "javascript", "asp.net", "visual-studio", "debugging" ]
22
13
31,046
14
0
2008-09-22T15:21:36.580000
2009-01-21T17:10:10.567000
115,478
116,076
MVC Preview 5 - ViewData/HTML Helper Quirk
The following code is in the /Courses/Detail action: [AcceptVerbs("GET")] public ActionResult Detail(int id) { ViewData["Title"] = "A View Title"; return View(tmdc.GetCourseById(id)); } The tmdc.GetCourseById(id) method returns an instance of type Course for the View. In the View I am using <%= HTML.TextBox("Title")%> ...
Unfortunately I'm not at my dev machine right now so I can't test this, but have you tried something like this? <%= Html.TextBox("Title", ViewData.Model.Title) %>
MVC Preview 5 - ViewData/HTML Helper Quirk The following code is in the /Courses/Detail action: [AcceptVerbs("GET")] public ActionResult Detail(int id) { ViewData["Title"] = "A View Title"; return View(tmdc.GetCourseById(id)); } The tmdc.GetCourseById(id) method returns an instance of type Course for the View. In the V...
TITLE: MVC Preview 5 - ViewData/HTML Helper Quirk QUESTION: The following code is in the /Courses/Detail action: [AcceptVerbs("GET")] public ActionResult Detail(int id) { ViewData["Title"] = "A View Title"; return View(tmdc.GetCourseById(id)); } The tmdc.GetCourseById(id) method returns an instance of type Course for ...
[ "asp.net-mvc", "viewdata" ]
1
1
1,427
2
0
2008-09-22T15:22:26.953000
2008-09-22T16:56:32.687000
115,488
157,061
What is the most reliable way to create a custom event log and event source during the installation of a .Net Service
I am having difficulty reliably creating / removing event sources during the installation of my.Net Windows Service. Here is the code from my ProjectInstaller class: // Create Process Installer ServiceProcessInstaller spi = new ServiceProcessInstaller(); spi.Account = ServiceAccount.LocalSystem; // Create Service Serv...
The best recommendation would be to not use the Setup Project in Visual Studio. It has very severe limitations. I had very good results with WiX
What is the most reliable way to create a custom event log and event source during the installation of a .Net Service I am having difficulty reliably creating / removing event sources during the installation of my.Net Windows Service. Here is the code from my ProjectInstaller class: // Create Process Installer ServiceP...
TITLE: What is the most reliable way to create a custom event log and event source during the installation of a .Net Service QUESTION: I am having difficulty reliably creating / removing event sources during the installation of my.Net Windows Service. Here is the code from my ProjectInstaller class: // Create Process ...
[ "c#", ".net", "windows-services", "event-log", "eventlog-source" ]
25
5
28,770
12
0
2008-09-22T15:23:57.307000
2008-10-01T10:44:46.207000
115,493
115,544
How do I convince my team to drop sourcesafe and move to SVN?
My development team uses source safe at a very basic level. We're moving into some more advanced and extended development cycles and I can't help but think that not using branching and merging in order to manage changes is going to be biting us very soon. What arguments did you find most useful in order to convince you...
First, teach them how to use SourceSafe in an efficient way. If they are smart enough, they will begin to love the advantages of using a version-control system, and if so, they will soon reach the limits of SourceSafe. That's where they will be the more able to listen to your arguments for switching to a better VCS, co...
How do I convince my team to drop sourcesafe and move to SVN? My development team uses source safe at a very basic level. We're moving into some more advanced and extended development cycles and I can't help but think that not using branching and merging in order to manage changes is going to be biting us very soon. Wh...
TITLE: How do I convince my team to drop sourcesafe and move to SVN? QUESTION: My development team uses source safe at a very basic level. We're moving into some more advanced and extended development cycles and I can't help but think that not using branching and merging in order to manage changes is going to be bitin...
[ "visual-studio", "svn", "version-control", "visual-sourcesafe" ]
65
53
7,141
34
0
2008-09-22T15:24:46.993000
2008-09-22T15:31:43.450000
115,496
115,940
Glasses mode in Emacs
How to customize the color of the symbol inserted in the "glasses mode" in Emacs? I have not found the option for this. Can anyone suggest anything?
There's no option to set the face for the inserted separator (and from a brief study of the docs for emacs overlays, I don't think it's simple to add). You can customize the face used for the capital letters that glasses-mode splits on; it's called glasses-face.
Glasses mode in Emacs How to customize the color of the symbol inserted in the "glasses mode" in Emacs? I have not found the option for this. Can anyone suggest anything?
TITLE: Glasses mode in Emacs QUESTION: How to customize the color of the symbol inserted in the "glasses mode" in Emacs? I have not found the option for this. Can anyone suggest anything? ANSWER: There's no option to set the face for the inserted separator (and from a brief study of the docs for emacs overlays, I don...
[ "emacs", "customization" ]
4
5
1,401
3
0
2008-09-22T15:25:17.973000
2008-09-22T16:32:00.483000
115,500
115,695
How do you specify a port range for Java sockets?
In Java you can give the number zero as a single parameter for the Socket or DatagramSocket constructor. Java binds that Socket to a free port then. Is it possible to limit the port lookup to a specific range?
Hrm, after reading the docs, I don't think you can. You can either bind to any port, then rebind if it is not acceptable, or repeatedly bind to a port in your range until you succeed. The second method is going to be most "efficient". I am uneasy about this answer, because it is... inelegant, yet I really can't find an...
How do you specify a port range for Java sockets? In Java you can give the number zero as a single parameter for the Socket or DatagramSocket constructor. Java binds that Socket to a free port then. Is it possible to limit the port lookup to a specific range?
TITLE: How do you specify a port range for Java sockets? QUESTION: In Java you can give the number zero as a single parameter for the Socket or DatagramSocket constructor. Java binds that Socket to a free port then. Is it possible to limit the port lookup to a specific range? ANSWER: Hrm, after reading the docs, I do...
[ "java", "tcp", "sockets", "udp" ]
10
7
10,240
4
0
2008-09-22T15:26:11.450000
2008-09-22T15:53:51.603000
115,501
115,638
Is Ruby any good for GUI development?
I am considering creating a GUI-based tool that I want to be cross-platform. I've dismissed Java, as I personally do not like Swing. I'm currently considering C# and using Mono to make it cross-platform. However I'm wondering whether new-fangled cross-platform languages like Ruby can offer me a decent GUI development e...
The short answer: no (because you said cross-platform ). The long answer: cross-platform GUIs are an age-old problem. Qt, GTK, wxWindows, Java AWT, Java Swing, XUL -- they all suffer from the same problem: the resulting GUI doesn't look native on every platform. Worse still, every platform has a slightly different look...
Is Ruby any good for GUI development? I am considering creating a GUI-based tool that I want to be cross-platform. I've dismissed Java, as I personally do not like Swing. I'm currently considering C# and using Mono to make it cross-platform. However I'm wondering whether new-fangled cross-platform languages like Ruby c...
TITLE: Is Ruby any good for GUI development? QUESTION: I am considering creating a GUI-based tool that I want to be cross-platform. I've dismissed Java, as I personally do not like Swing. I'm currently considering C# and using Mono to make it cross-platform. However I'm wondering whether new-fangled cross-platform lan...
[ "ruby", "user-interface", "cross-platform" ]
22
38
17,638
13
0
2008-09-22T15:26:11.997000
2008-09-22T15:43:17.027000
115,503
115,540
Duplicate Oracle DES encrypting in Java
I recently asked a question about Oracle Encryption. Along the way to finding a solution for myself I decided to move the encryption (well, obfuscation) to the application side for certain tasks. My problem is that the database is already encrypting data a certain way and I need Java code to duplicate that functionalit...
I found this works: KeySpec ks = new DESKeySpec(new byte[] {'s','e','c','r','e','t','!','!'}); SecretKeyFactory skf = SecretKeyFactory.getInstance("DES"); SecretKey sk = skf.generateSecret(ks); Cipher c = Cipher.getInstance("DES/CBC/NoPadding"); IvParameterSpec ips = new IvParameterSpec(new byte[] {0,0,0,0,0,0,0,0}); c...
Duplicate Oracle DES encrypting in Java I recently asked a question about Oracle Encryption. Along the way to finding a solution for myself I decided to move the encryption (well, obfuscation) to the application side for certain tasks. My problem is that the database is already encrypting data a certain way and I need ...
TITLE: Duplicate Oracle DES encrypting in Java QUESTION: I recently asked a question about Oracle Encryption. Along the way to finding a solution for myself I decided to move the encryption (well, obfuscation) to the application side for certain tasks. My problem is that the database is already encrypting data a certa...
[ "java", "oracle", "encryption" ]
1
2
2,315
2
0
2008-09-22T15:26:15.257000
2008-09-22T15:30:56.620000
115,526
115,533
Is there a way to get the parent URL from an Iframe's content?
I'm running an c#.net app in an iframe of an asp page on an older site. Accessing the Asp page's session information is somewhat difficult, so I'd like to make my.net app simply verify that it's being called from an approved page, or else immediately halt. Is there a way for a page to find out the url of it's parent do...
top.location.href But that will only work if both pages (the iframe and the main page) are being served from the same domain.
Is there a way to get the parent URL from an Iframe's content? I'm running an c#.net app in an iframe of an asp page on an older site. Accessing the Asp page's session information is somewhat difficult, so I'd like to make my.net app simply verify that it's being called from an approved page, or else immediately halt. ...
TITLE: Is there a way to get the parent URL from an Iframe's content? QUESTION: I'm running an c#.net app in an iframe of an asp page on an older site. Accessing the Asp page's session information is somewhat difficult, so I'd like to make my.net app simply verify that it's being called from an approved page, or else ...
[ "html", "iframe" ]
11
11
27,697
3
0
2008-09-22T15:29:10.430000
2008-09-22T15:30:03.237000
115,548
115,696
Why is isNaN(null) == false in JS?
This code in JS gives me a popup saying "i think null is a number", which I find slightly disturbing. What am I missing? if (isNaN(null)) { alert("null is not a number"); } else { alert("i think null is a number"); } I'm using Firefox 3. Is that a browser bug? Other tests: console.log(null == NaN); // false consol...
I believe the code is trying to ask, "is x numeric?" with the specific case here of x = null. The function isNaN() can be used to answer this question, but semantically it's referring specifically to the value NaN. From Wikipedia for NaN: NaN ( N ot a N umber) is a value of the numeric data type representing an undefin...
Why is isNaN(null) == false in JS? This code in JS gives me a popup saying "i think null is a number", which I find slightly disturbing. What am I missing? if (isNaN(null)) { alert("null is not a number"); } else { alert("i think null is a number"); } I'm using Firefox 3. Is that a browser bug? Other tests: console...
TITLE: Why is isNaN(null) == false in JS? QUESTION: This code in JS gives me a popup saying "i think null is a number", which I find slightly disturbing. What am I missing? if (isNaN(null)) { alert("null is not a number"); } else { alert("i think null is a number"); } I'm using Firefox 3. Is that a browser bug? Ot...
[ "javascript" ]
160
135
69,292
10
0
2008-09-22T15:32:26.537000
2008-09-22T15:54:25.470000
115,573
115,732
Detecting what the target object is when NullReferenceException is thrown
I'm sure we all have received the wonderfully vague "Object reference not set to instance of an Object" exception at some time or another. Identifying the object that is the problem is often a tedious task of setting breakpoints and inspecting all members in each statement. Does anyone have any tricks to easily and eff...
At the point where the NRE is thrown, there is no target object -- that's the point of the exception. The most you can hope for is to trap the file and line number where the exception occurred. If you're having problems identifying which object reference is causing the problem, then you might want to rethink your codin...
Detecting what the target object is when NullReferenceException is thrown I'm sure we all have received the wonderfully vague "Object reference not set to instance of an Object" exception at some time or another. Identifying the object that is the problem is often a tedious task of setting breakpoints and inspecting al...
TITLE: Detecting what the target object is when NullReferenceException is thrown QUESTION: I'm sure we all have received the wonderfully vague "Object reference not set to instance of an Object" exception at some time or another. Identifying the object that is the problem is often a tedious task of setting breakpoints...
[ ".net", "exception" ]
31
17
16,140
10
0
2008-09-22T15:35:37.450000
2008-09-22T16:00:21.027000
115,627
115,690
Sharepoint, master pages and CSS
I am trying to develop everything in sharepoint as features so I can easily deploy to test and live sites without having to do any manual steps. I can deploy my master page okay, and though currently i have to switch it on by hand I am confident I can automate that in the future. What I am having difficulty is getting ...
I believe you are looking for the tag. The link below has quite a bit of detail about it (among other things): http://www.cleverworkarounds.com/2007/10/08/sharepoint-branding-how-css-works-with-master-pages-part-1/ This site is also a good one to take a look at, since Heather Solomon is the SharePoint Branding Queen: h...
Sharepoint, master pages and CSS I am trying to develop everything in sharepoint as features so I can easily deploy to test and live sites without having to do any manual steps. I can deploy my master page okay, and though currently i have to switch it on by hand I am confident I can automate that in the future. What I...
TITLE: Sharepoint, master pages and CSS QUESTION: I am trying to develop everything in sharepoint as features so I can easily deploy to test and live sites without having to do any manual steps. I can deploy my master page okay, and though currently i have to switch it on by hand I am confident I can automate that in ...
[ "css", "sharepoint", "master-pages" ]
2
3
4,235
1
0
2008-09-22T15:42:41.583000
2008-09-22T15:51:49.207000
115,634
116,821
Do you believe that ASP.Net MVC is ready for production?
I really like the fact that Microsoft has taken a commitment to bring MVC to the Web. To this end, I have become excited about converting one of my existing ASP.NET apps to MVC and wanted to know if I may be jumping the gun. While this site is using MVC, it's still technically in beta...what are your thoughts?
From Preview 5 to RTM, there will be less and less breaking changes. So if the concern is how much churn your project will face, it shouldn't be as bad as it was with earlier releases. If the concern is support, we do ship the source code and you're allowed to modify (but not redistribute) the source for your own needs...
Do you believe that ASP.Net MVC is ready for production? I really like the fact that Microsoft has taken a commitment to bring MVC to the Web. To this end, I have become excited about converting one of my existing ASP.NET apps to MVC and wanted to know if I may be jumping the gun. While this site is using MVC, it's sti...
TITLE: Do you believe that ASP.Net MVC is ready for production? QUESTION: I really like the fact that Microsoft has taken a commitment to bring MVC to the Web. To this end, I have become excited about converting one of my existing ASP.NET apps to MVC and wanted to know if I may be jumping the gun. While this site is u...
[ "asp.net-mvc" ]
9
7
737
4
0
2008-09-22T15:42:59.227000
2008-09-22T19:05:56.947000
115,644
115,689
Are there any jEdit syntax highlighting modes for Objective-J
I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not for jEdit, and unfortunately I'm just starting on Objective-J so can't make my own. If anyone has got one of them lying around it would be greatly appreciated.
According to the JEdit features page it already supports Objective C.
Are there any jEdit syntax highlighting modes for Objective-J I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not for jEdit, and unfortunately I'm just starting on Objective-J so can't make my own. If anyone has got one of them lying around it would be greatly appreciated.
TITLE: Are there any jEdit syntax highlighting modes for Objective-J QUESTION: I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not for jEdit, and unfortunately I'm just starting on Objective-J so can't make my own. If anyone has got one of them lying around it would be greatly apprecia...
[ "javascript", "syntax-highlighting", "cappuccino", "jedit", "objective-j" ]
1
1
1,361
2
0
2008-09-22T15:44:03.017000
2008-09-22T15:51:33.683000
115,649
117,294
Enumerate Windows network shares and all custom permissions on or within
We have various servers that have many directories shared. It's easy enough to look at the share browser to see what the "top level" shares are, but underneath is a jumbled mess of custom permissions, none of which is documented. I'd like to enumerate all the shares on the domain (definitely all the 'servers', local PC...
I know it isnt scripting, but have you tried ShareEnum? http://technet.microsoft.com/en-us/sysinternals/bb897442.aspx and then export it out? You can also compare to older runs. I don't think there is a cmd line interface (which sucks), but it will get you the info you need
Enumerate Windows network shares and all custom permissions on or within We have various servers that have many directories shared. It's easy enough to look at the share browser to see what the "top level" shares are, but underneath is a jumbled mess of custom permissions, none of which is documented. I'd like to enume...
TITLE: Enumerate Windows network shares and all custom permissions on or within QUESTION: We have various servers that have many directories shared. It's easy enough to look at the share browser to see what the "top level" shares are, but underneath is a jumbled mess of custom permissions, none of which is documented....
[ "windows", "active-directory", "file-permissions", "shared-directory" ]
1
1
5,499
2
0
2008-09-22T15:44:34.137000
2008-09-22T20:11:53.527000
115,656
116,255
ASP.NET Framework effects of moving from 2.0 to 3.5?
I've started using Visual Studio 2008 and it keeps asking me to upgrade my 2.0 website project to 3.5 every time it opens. What effectively happens when I "upgrade" a website project from 2.0 to 3.5 in Visual Studio? Does it update my web.config? How exactly does it change my project/website/code? Is there a potential ...
(As mentioned elsewhere across the other answers, plus some extras:) Converting a VS 2005 solution to VS 2008 will mean that you'll need to maintain duplicates, or others must also be using Visual Studio 2008 (while the project file format (which from your question you're not using anyway) is in theory unchanged betwee...
ASP.NET Framework effects of moving from 2.0 to 3.5? I've started using Visual Studio 2008 and it keeps asking me to upgrade my 2.0 website project to 3.5 every time it opens. What effectively happens when I "upgrade" a website project from 2.0 to 3.5 in Visual Studio? Does it update my web.config? How exactly does it ...
TITLE: ASP.NET Framework effects of moving from 2.0 to 3.5? QUESTION: I've started using Visual Studio 2008 and it keeps asking me to upgrade my 2.0 website project to 3.5 every time it opens. What effectively happens when I "upgrade" a website project from 2.0 to 3.5 in Visual Studio? Does it update my web.config? Ho...
[ ".net", "asp.net", "visual-studio", "visual-studio-2008", ".net-3.5" ]
12
10
5,709
8
0
2008-09-22T15:45:38.487000
2008-09-22T17:29:17.367000
115,658
115,684
When reading a CSV file using a DataReader and the OLEDB Jet data provider, how can I control column data types?
In my C# application I am using the Microsoft Jet OLEDB data provider to read a CSV file. The connection string looks like this: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Data;Extended Properties="text;HDR=Yes;FMT=Delimited I open an ADO.NET OleDbConnection using that connection string and select all the rows fro...
There's a schema file you can create that would tell ADO.NET how to interpret the CSV - in effect giving it a structure. Try this: http://www.aspdotnetcodes.com/Importing_CSV_Database_Schema.ini.aspx Or the most recent MS Documentation
When reading a CSV file using a DataReader and the OLEDB Jet data provider, how can I control column data types? In my C# application I am using the Microsoft Jet OLEDB data provider to read a CSV file. The connection string looks like this: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Data;Extended Properties="text...
TITLE: When reading a CSV file using a DataReader and the OLEDB Jet data provider, how can I control column data types? QUESTION: In my C# application I am using the Microsoft Jet OLEDB data provider to read a CSV file. The connection string looks like this: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Data;Extende...
[ "c#", ".net", "csv", "oledb" ]
15
10
34,815
4
0
2008-09-22T15:45:53.713000
2008-09-22T15:50:27.557000
115,659
161,600
Windows Mobile Development - Portable Programming?
I want to start developing for Windows Mobile Devices, as I plan to buy one next week. (pay day) So far most of my PDA experience is with Palm OS (m100, m105, Zire 71 and T3). For Palm there are a few good utilities for programming, mainly PocketC and OnboardC. These let you program and test on the road. I would use Po...
hmmm.. So you really want to develop on the device? Why? Anyway, Here are your options: Pocket GCC Pocket C# compiler Ruby on Windows Mobile & Supporting Article PythonCE PocketC for Windows CE I know you mentioned PythonCE & Pocket C. But added for comprehension:)
Windows Mobile Development - Portable Programming? I want to start developing for Windows Mobile Devices, as I plan to buy one next week. (pay day) So far most of my PDA experience is with Palm OS (m100, m105, Zire 71 and T3). For Palm there are a few good utilities for programming, mainly PocketC and OnboardC. These l...
TITLE: Windows Mobile Development - Portable Programming? QUESTION: I want to start developing for Windows Mobile Devices, as I plan to buy one next week. (pay day) So far most of my PDA experience is with Palm OS (m100, m105, Zire 71 and T3). For Palm there are a few good utilities for programming, mainly PocketC and...
[ "windows-mobile", "devtools" ]
0
3
450
4
0
2008-09-22T15:46:12.370000
2008-10-02T10:04:53.330000
115,665
138,574
In CakePHP, how can you determine if a field was changed in an edit action?
I'm using the cacheCounter in CakePHP, which increments a counter for related fields. Example, I have a Person table a Source table. Person.source_id maps to a row in the Source table. Each person has one Source, and each Source has none or many Person rows. cacheCounter is working great when I change the value of a so...
To monitor changes in a field, you can use this logic in your model with no changes elsewhere required: function beforeSave() { $this->recursive = -1; $this->old = $this->find(array($this->primaryKey => $this->id)); if ($this->old){ $changed_fields = array(); foreach ($this->data[$this->alias] as $key =>$value) { if ($...
In CakePHP, how can you determine if a field was changed in an edit action? I'm using the cacheCounter in CakePHP, which increments a counter for related fields. Example, I have a Person table a Source table. Person.source_id maps to a row in the Source table. Each person has one Source, and each Source has none or man...
TITLE: In CakePHP, how can you determine if a field was changed in an edit action? QUESTION: I'm using the cacheCounter in CakePHP, which increments a counter for related fields. Example, I have a Person table a Source table. Person.source_id maps to a row in the Source table. Each person has one Source, and each Sour...
[ "php", "cakephp" ]
11
18
9,802
7
0
2008-09-22T15:47:02.960000
2008-09-26T10:04:22.300000
115,681
115,785
MySQL InnoDB database restore
I have to restore a database that has been inadvertently DROPped in MySQL 5.0. From checking the backup files, I only seem to have.FRM files to hold the database data. Can anyone advise whether this is all I need to perform a database restore/import from the backup, or are there other files I should have to hand to com...
.frm files are not the data files, they just store the "data dictionary information" (see MySQL manual ). InnoDB stores its data in ib_logfile* files. That's what you need in order to do a backup/restore. For more details see here.
MySQL InnoDB database restore I have to restore a database that has been inadvertently DROPped in MySQL 5.0. From checking the backup files, I only seem to have.FRM files to hold the database data. Can anyone advise whether this is all I need to perform a database restore/import from the backup, or are there other file...
TITLE: MySQL InnoDB database restore QUESTION: I have to restore a database that has been inadvertently DROPped in MySQL 5.0. From checking the backup files, I only seem to have.FRM files to hold the database data. Can anyone advise whether this is all I need to perform a database restore/import from the backup, or ar...
[ "mysql", "backup", "innodb", "restore" ]
10
15
38,205
3
0
2008-09-22T15:49:22.957000
2008-09-22T16:06:31.790000
115,685
116,184
Code compiling in eclipse but not on command line
I once wrote this line in a Java class. This compiled fine in Eclipse but not on the command line. This is on Eclipse 3.3 JDK 1.5 Windows XP Professional Any clues? Error given on the command line is: Icons.java:16: code too large public static final byte[] compileIcon = { 71, 73, 70, 56, 57, 97, 50, ^ The code line in...
Taking from this forum on Sun's support site, no method can be more than 64 KB long: When you have code (pseudo) like the following... class MyClass { private String[] s = { "a", "b", "c"} public MyClass() { } The compiler ends up producing code that basically looks like the following. class MyClass { private String[]...
Code compiling in eclipse but not on command line I once wrote this line in a Java class. This compiled fine in Eclipse but not on the command line. This is on Eclipse 3.3 JDK 1.5 Windows XP Professional Any clues? Error given on the command line is: Icons.java:16: code too large public static final byte[] compileIcon ...
TITLE: Code compiling in eclipse but not on command line QUESTION: I once wrote this line in a Java class. This compiled fine in Eclipse but not on the command line. This is on Eclipse 3.3 JDK 1.5 Windows XP Professional Any clues? Error given on the command line is: Icons.java:16: code too large public static final b...
[ "java", "eclipse", "debugging", "eclipse-3.3" ]
2
4
2,117
8
0
2008-09-22T15:50:33.780000
2008-09-22T17:15:14.933000
115,691
118,197
Are there any MVC web frameworks that support multiple request types?
In every MVC framework I've tried (Rails, Merb, Waves, Spring, and Struts), the idea of a Request (and Response) is tied to the HTTP notion of a Request. That is, even if there is an AbstractRequest that is a superclass of Request, the AbstractRequest has things like headers, request method (GET, POST, etc.), and all o...
You seem to be working mostly with Java and/or Ruby, so forgive me that this answer is based on Perl:-). I'm very fond of the Catalyst MVC Framework ( http://www.catalystframework.org/ ). It delegates the actual mapping of requests (in the general, generic sense) to code via engines. Granted, all the engine classes are...
Are there any MVC web frameworks that support multiple request types? In every MVC framework I've tried (Rails, Merb, Waves, Spring, and Struts), the idea of a Request (and Response) is tied to the HTTP notion of a Request. That is, even if there is an AbstractRequest that is a superclass of Request, the AbstractReques...
TITLE: Are there any MVC web frameworks that support multiple request types? QUESTION: In every MVC framework I've tried (Rails, Merb, Waves, Spring, and Struts), the idea of a Request (and Response) is tied to the HTTP notion of a Request. That is, even if there is an AbstractRequest that is a superclass of Request, ...
[ "model-view-controller", "http", "twitter", "sms" ]
11
0
439
4
0
2008-09-22T15:52:00.733000
2008-09-22T23:21:02.043000
115,692
118,976
How to avoid type safety warnings with Hibernate HQL results?
For example I have such query: Query q = sess.createQuery("from Cat cat"); List cats = q.list(); If I try to make something like this it shows the following warning Type safety: The expression of type List needs unchecked conversion to conform to List List cats = q.list(); Is there a way to avoid it?
Using @SuppressWarnings everywhere, as suggested, is a good way to do it, though it does involve a bit of finger typing each time you call q.list(). There are two other techniques I'd suggest: Write a cast-helper Simply refactor all your @SuppressWarnings into one place: List cats = MyHibernateUtils.listAndCast(q);... ...
How to avoid type safety warnings with Hibernate HQL results? For example I have such query: Query q = sess.createQuery("from Cat cat"); List cats = q.list(); If I try to make something like this it shows the following warning Type safety: The expression of type List needs unchecked conversion to conform to List List c...
TITLE: How to avoid type safety warnings with Hibernate HQL results? QUESTION: For example I have such query: Query q = sess.createQuery("from Cat cat"); List cats = q.list(); If I try to make something like this it shows the following warning Type safety: The expression of type List needs unchecked conversion to conf...
[ "java", "generics" ]
110
101
74,619
15
0
2008-09-22T15:53:27.143000
2008-09-23T03:38:11.490000
115,694
115,716
How to permanently disable region-folding in Visual Studio 2008
Anyone know how to turn off code folding in visual studio 2008? Some of my colleagues love it, but I personally always want to see all the code, and never want code folded out of sight. I'd like a setting that means my copy of Visual Studio never folds #regions or function bodies.
Edit: I recommend this other answer Go to the Tools->Options menu. Go to Text Editor->C#->Advanced. Uncheck "Enter outlining mode when files open". That will disable all outlining, including regions, for all c# code files.
How to permanently disable region-folding in Visual Studio 2008 Anyone know how to turn off code folding in visual studio 2008? Some of my colleagues love it, but I personally always want to see all the code, and never want code folded out of sight. I'd like a setting that means my copy of Visual Studio never folds #re...
TITLE: How to permanently disable region-folding in Visual Studio 2008 QUESTION: Anyone know how to turn off code folding in visual studio 2008? Some of my colleagues love it, but I personally always want to see all the code, and never want code folded out of sight. I'd like a setting that means my copy of Visual Stud...
[ "c#", "visual-studio-2008", "text-editor", "outlining" ]
114
145
27,648
9
0
2008-09-22T15:53:41.073000
2008-09-22T15:58:01.767000
115,701
117,457
Obfuscating Silverlight XAP
I am wondering any efficient way to hide our Silverlight code. I know there are some obfuscators available but it looks like people can hack that too. Anybody have any success on this front?
Pragma No-Cache on the page hosting the silverlight application will prevent the the browser from caching the xap, instead it will read it by streaming from the web server. That will make it harder for peeps to get the xap. Obfuscation will make it harder still. Also make sure the app is hosted in https, have authentic...
Obfuscating Silverlight XAP I am wondering any efficient way to hide our Silverlight code. I know there are some obfuscators available but it looks like people can hack that too. Anybody have any success on this front?
TITLE: Obfuscating Silverlight XAP QUESTION: I am wondering any efficient way to hide our Silverlight code. I know there are some obfuscators available but it looks like people can hack that too. Anybody have any success on this front? ANSWER: Pragma No-Cache on the page hosting the silverlight application will preve...
[ "silverlight", "obfuscation" ]
3
4
1,744
6
0
2008-09-22T15:55:32.223000
2008-09-22T20:36:56.743000
115,703
115,735
Storing C++ template function definitions in a .CPP file
I have some template code that I would prefer to have stored in a CPP file instead of inline in the header. I know this can be done as long as you know which template types will be used. For example:.h file class foo { public: template void do(const T& t); };.cpp file template void foo::do(const T& t) { // Do something...
The problem you describe can be solved by defining the template in the header, or via the approach you describe above. I recommend reading the following points from the C++ FAQ Lite: Why can’t I separate the definition of my templates class from its declaration and put it inside a.cpp file? How can I avoid linker error...
Storing C++ template function definitions in a .CPP file I have some template code that I would prefer to have stored in a CPP file instead of inline in the header. I know this can be done as long as you know which template types will be used. For example:.h file class foo { public: template void do(const T& t); };.cpp...
TITLE: Storing C++ template function definitions in a .CPP file QUESTION: I have some template code that I would prefer to have stored in a CPP file instead of inline in the header. I know this can be done as long as you know which template types will be used. For example:.h file class foo { public: template void do(c...
[ "c++", "templates" ]
725
319
575,684
14
0
2008-09-22T15:55:52.830000
2008-09-22T16:00:44.317000
115,705
115,729
Why does IE7 specify a mime-type of image/pjpeg rather than just image/jpeg?
When uploading a file (jpeg) via a form in IE7 I am seeing a mime-type of "image/pjpeg" instead of "image/jpeg" (as I see in Firefox or similar). It's easy enough to work around this problem, but I'm just wondering why IE7 is behaving differently in this case?
I believe it's because the JPEG you're working with is a progressive JPEG, which has a different mime-type.
Why does IE7 specify a mime-type of image/pjpeg rather than just image/jpeg? When uploading a file (jpeg) via a form in IE7 I am seeing a mime-type of "image/pjpeg" instead of "image/jpeg" (as I see in Firefox or similar). It's easy enough to work around this problem, but I'm just wondering why IE7 is behaving differen...
TITLE: Why does IE7 specify a mime-type of image/pjpeg rather than just image/jpeg? QUESTION: When uploading a file (jpeg) via a form in IE7 I am seeing a mime-type of "image/pjpeg" instead of "image/jpeg" (as I see in Firefox or similar). It's easy enough to work around this problem, but I'm just wondering why IE7 is...
[ "internet-explorer-7", "file-upload", "jpeg" ]
54
36
22,773
4
0
2008-09-22T15:56:18.430000
2008-09-22T15:59:57.283000
115,720
115,756
Is there a way to clear a user's browser of my page, or say not to use cache?
Is there a command in classic ASP I can use to tell the browser not to pull the page from it's cache, or, to not cache, or clear the cache of my page?
You can use HTML meta tags: Or you can use ASP response headers: <% Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 %>
Is there a way to clear a user's browser of my page, or say not to use cache? Is there a command in classic ASP I can use to tell the browser not to pull the page from it's cache, or, to not cache, or clear the cache of my page?
TITLE: Is there a way to clear a user's browser of my page, or say not to use cache? QUESTION: Is there a command in classic ASP I can use to tell the browser not to pull the page from it's cache, or, to not cache, or clear the cache of my page? ANSWER: You can use HTML meta tags: Or you can use ASP response headers:...
[ "http", "asp-classic" ]
4
9
2,743
6
0
2008-09-22T15:58:52.527000
2008-09-22T16:03:09.333000
115,770
121,588
In Eclipse, why does "Build Automatically" get mysteriously disabled?
I'm running Eclipse Europa (3.3). I leave the "Build Automatically" setting, under the Project menu, on all the time. Once in awhile my code isn't compiling, and I puzzle over it and then pull down the Project menu... lo and behold, it's not set anymore. What gives? Is this a bug, or is there something else I'm doing t...
I don't have eclipse right here to test and make sure but here is an idea. Is any of the project or even workspace file in SVN? if they are and they were uploaded with auto build disabled that might explain it You update and overwrite your settings. This doesn't become apparent until you restart eclipse. this would als...
In Eclipse, why does "Build Automatically" get mysteriously disabled? I'm running Eclipse Europa (3.3). I leave the "Build Automatically" setting, under the Project menu, on all the time. Once in awhile my code isn't compiling, and I puzzle over it and then pull down the Project menu... lo and behold, it's not set anym...
TITLE: In Eclipse, why does "Build Automatically" get mysteriously disabled? QUESTION: I'm running Eclipse Europa (3.3). I leave the "Build Automatically" setting, under the Project menu, on all the time. Once in awhile my code isn't compiling, and I puzzle over it and then pull down the Project menu... lo and behold,...
[ "eclipse" ]
7
3
10,573
7
0
2008-09-22T16:04:31.063000
2008-09-23T15:04:57.890000
115,773
115,826
How do I configure the ip address with CherryPy?
I'm using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the config files. I recently changed machines so I installed the latest Python and cherrypy and when I run the site I can access it from localhost:8080 b...
That depends on how you are running the cherrypy init. If using cherrypy 3.1 syntax, that wold do it: cherrypy.server.socket_host = 'www.machinename.com' cherrypy.engine.start() cherrypy.engine.block() Of course you can have something more fancy, like subclassing the server class, or using config files. Those uses are ...
How do I configure the ip address with CherryPy? I'm using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the config files. I recently changed machines so I installed the latest Python and cherrypy and when I r...
TITLE: How do I configure the ip address with CherryPy? QUESTION: I'm using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the config files. I recently changed machines so I installed the latest Python and che...
[ "python", "cherrypy" ]
20
18
25,701
3
0
2008-09-22T16:04:54.290000
2008-09-22T16:16:12.190000
115,789
115,824
Indexing nulls for fast searching on DB2
It's my understanding that nulls are not indexable in DB2, so assuming we have a huge table (Sales) with a date column (sold_on) which is normally a date, but is occasionally (10% of the time) null. Furthermore, let's assume that it's a legacy application that we can't change, so those nulls are staying there and mean ...
I'm no DB2 expert, but if 10% of your values are null, I don't think an index on that column alone will ever help your query. 10% is too many to bother using an index for -- it'll just do a table scan. If you were talking about 2-3%, I think it would actually use your index. Think about how many records are on a page/b...
Indexing nulls for fast searching on DB2 It's my understanding that nulls are not indexable in DB2, so assuming we have a huge table (Sales) with a date column (sold_on) which is normally a date, but is occasionally (10% of the time) null. Furthermore, let's assume that it's a legacy application that we can't change, s...
TITLE: Indexing nulls for fast searching on DB2 QUESTION: It's my understanding that nulls are not indexable in DB2, so assuming we have a huge table (Sales) with a date column (sold_on) which is normally a date, but is occasionally (10% of the time) null. Furthermore, let's assume that it's a legacy application that ...
[ "sql", "performance", "indexing", "null", "db2" ]
4
4
4,629
4
0
2008-09-22T16:07:13.023000
2008-09-22T16:15:50.413000
115,809
118,904
When is the right time (and the wrong time) to use backticks?
Many beginning programmers write code like this: sub copy_file ($$) { my $from = shift; my $to = shift; `cp $from $to`; } Is this bad, and why? Should backticks ever be used? If so, how?
A few people have already mentioned that you should only use backticks when: You need to capture (or supress) the output. There exists no built-in function or Perl module to do the same task, or you have a good reason not to use the module or built-in. You sanitise your input. You check the return value. Unfortunately,...
When is the right time (and the wrong time) to use backticks? Many beginning programmers write code like this: sub copy_file ($$) { my $from = shift; my $to = shift; `cp $from $to`; } Is this bad, and why? Should backticks ever be used? If so, how?
TITLE: When is the right time (and the wrong time) to use backticks? QUESTION: Many beginning programmers write code like this: sub copy_file ($$) { my $from = shift; my $to = shift; `cp $from $to`; } Is this bad, and why? Should backticks ever be used? If so, how? ANSWER: A few people have already mentioned that yo...
[ "perl" ]
15
22
17,448
14
0
2008-09-22T16:12:30.390000
2008-09-23T03:13:54.793000
115,813
525,124
How to statically compile an SDL game on Windows
I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using cygwin/mingw/gcc. As far as I can tell all exist...
When compiling your project, you need to make just a couple changes to your makefile. Instead of sdl-config --libs, use sdl-config --static-libs Surround the use of the above-mentioned sdl-config --static-libs with -Wl,-Bstatic and -Wl,-Bdynamic. This tells GCC to force static linking, but only for the libraries specif...
How to statically compile an SDL game on Windows I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using...
TITLE: How to statically compile an SDL game on Windows QUESTION: I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to comp...
[ "windows", "sdl", "sdl-image", "sdl-mixer" ]
18
24
19,597
5
0
2008-09-22T16:13:53.803000
2009-02-08T03:52:49.217000
115,818
115,838
Which format for small website images? GIF or PNG?
When doing small icons, header graphics and the like for websites, is it better to use GIFs or PNGs? Obviously if transparency effects are required, then PNGs are definitely the way to go, and for larger, more photographic images I'd use JPEGs - but for normal web "furniture", which would you recommend and why? It may ...
As a general rule, PNG is never worse, and often better than GIF because of superior compression. There might be some edge cases where GIF is slightly better (because the PNG format may have a slightly larger overhead from metadata) but it's really not worth the worry. It may just be the tools I'm using, but GIF files ...
Which format for small website images? GIF or PNG? When doing small icons, header graphics and the like for websites, is it better to use GIFs or PNGs? Obviously if transparency effects are required, then PNGs are definitely the way to go, and for larger, more photographic images I'd use JPEGs - but for normal web "fur...
TITLE: Which format for small website images? GIF or PNG? QUESTION: When doing small icons, header graphics and the like for websites, is it better to use GIFs or PNGs? Obviously if transparency effects are required, then PNGs are definitely the way to go, and for larger, more photographic images I'd use JPEGs - but f...
[ "graphics", "png", "file-format", "gif" ]
35
58
10,664
17
0
2008-09-22T16:14:37.280000
2008-09-22T16:18:20.967000
115,836
115,865
How would you go about reverse engineering a set of binary data pulled from a device?
A friend of mine brought up this questiont he other day, he's recently bought a garmin heart rate moniter device which keeps track of his heart rate and allows him to upload his heart rate stats for a day to his computer. The only problem is there are no linux drivers for the garmin USB device, he's managed to interpre...
I had the same problem and initially found this project at Google Code that aims to complete a cross-platform version of tools for the Garmin devices... see: http://code.google.com/p/garmintools/. There's a link on the front page of that project to the protocols you need, which Garmin was thoughtful enough to release p...
How would you go about reverse engineering a set of binary data pulled from a device? A friend of mine brought up this questiont he other day, he's recently bought a garmin heart rate moniter device which keeps track of his heart rate and allows him to upload his heart rate stats for a day to his computer. The only pro...
TITLE: How would you go about reverse engineering a set of binary data pulled from a device? QUESTION: A friend of mine brought up this questiont he other day, he's recently bought a garmin heart rate moniter device which keeps track of his heart rate and allows him to upload his heart rate stats for a day to his comp...
[ "binary", "reverse-engineering", "binary-data" ]
8
4
1,140
8
0
2008-09-22T16:18:00.530000
2008-09-22T16:22:14.220000
115,844
116,703
Recommended Python publish/subscribe/dispatch module?
From PyPubSub: Pypubsub provides a simple way for your Python application to decouple its components: parts of your application can publish messages (with or without data) and other parts can subscribe/receive them. This allows message "senders" and message "listeners" to be unaware of each other: one doesn't need to i...
PyDispatcher is used heavily in Django and it's working perfectly for me (and for whole Django community, I guess). As I remember, there are some performance issues: Arguments checking made by PyDispatcher is slow. Unused connections have unnecessary overhead. AFAIK it's very unlikely you will run into this issues in a...
Recommended Python publish/subscribe/dispatch module? From PyPubSub: Pypubsub provides a simple way for your Python application to decouple its components: parts of your application can publish messages (with or without data) and other parts can subscribe/receive them. This allows message "senders" and message "listene...
TITLE: Recommended Python publish/subscribe/dispatch module? QUESTION: From PyPubSub: Pypubsub provides a simple way for your Python application to decouple its components: parts of your application can publish messages (with or without data) and other parts can subscribe/receive them. This allows message "senders" an...
[ "python", "publish-subscribe", "pypubsub" ]
31
16
35,545
7
0
2008-09-22T16:19:16.487000
2008-09-22T18:44:43.627000
115,850
115,902
What pre-existing services exist for calculating distance between two addresses?
I'd like to implement a way to display a list of stored addresses sorted by proximity to a given address. Addresses in the list will be stored in a database table. Separate parts have separate fields (we have fields for postal code, city name, etc.) so it is not just a giant varchar. These are user-entered and due to t...
Google and Yahoo! both provide geocoding services for free. You can calculate distance using the Haversine formula ( implemented in.NET or SQL ). Both services will let you do partial searches (zip code only, city only) and will let you know what the precision of their results are (so that you can exclude locations wit...
What pre-existing services exist for calculating distance between two addresses? I'd like to implement a way to display a list of stored addresses sorted by proximity to a given address. Addresses in the list will be stored in a database table. Separate parts have separate fields (we have fields for postal code, city n...
TITLE: What pre-existing services exist for calculating distance between two addresses? QUESTION: I'd like to implement a way to display a list of stored addresses sorted by proximity to a given address. Addresses in the list will be stored in a database table. Separate parts have separate fields (we have fields for p...
[ "algorithm", "geolocation", "distance" ]
12
10
10,807
8
0
2008-09-22T16:19:54.363000
2008-09-22T16:26:50.150000
115,851
115,890
How fast is LINQ?
I need to manipulate 100,000 - 200,000 records. I am thinking of using LINQ (to SQL) to do this. I know from experience that filtering dataviews is very slow. So how quick is LINQ? Can you please tell me your experiences and if it is worth using, or would I be better off using SQL stored procedures (heavy going and les...
LINQ to SQL translates your query expression into T-SQL, so your query performance should be exactly the same as if you sent that SQL query via ADO.NET. There is a little overhead I guess, to convert the expression tree for your query into the equivalent T-SQL, but my experience is that this is small compared with the ...
How fast is LINQ? I need to manipulate 100,000 - 200,000 records. I am thinking of using LINQ (to SQL) to do this. I know from experience that filtering dataviews is very slow. So how quick is LINQ? Can you please tell me your experiences and if it is worth using, or would I be better off using SQL stored procedures (h...
TITLE: How fast is LINQ? QUESTION: I need to manipulate 100,000 - 200,000 records. I am thinking of using LINQ (to SQL) to do this. I know from experience that filtering dataviews is very slow. So how quick is LINQ? Can you please tell me your experiences and if it is worth using, or would I be better off using SQL st...
[ ".net", "linq", "linq-to-sql" ]
9
19
5,595
7
0
2008-09-22T16:20:13.723000
2008-09-22T16:25:27.613000
115,868
115,905
How do I get the title of the current active window using c#?
I'd like to know how to grab the Window title of the current active window (i.e. the one that has focus) using C#.
See example on how you can do this with full source code here: http://www.csharphelp.com/2006/08/get-current-window-handle-and-caption-with-windows-api-in-c/ [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] static extern int GetWindowText(IntPtr hWnd, StringBuilder text, ...
How do I get the title of the current active window using c#? I'd like to know how to grab the Window title of the current active window (i.e. the one that has focus) using C#.
TITLE: How do I get the title of the current active window using c#? QUESTION: I'd like to know how to grab the Window title of the current active window (i.e. the one that has focus) using C#. ANSWER: See example on how you can do this with full source code here: http://www.csharphelp.com/2006/08/get-current-window-...
[ "c#", ".net", "windows", "winforms" ]
128
191
155,878
7
0
2008-09-22T16:22:23.097000
2008-09-22T16:27:14.113000
115,874
115,982
Obtaining information about the physical device from a given file path
Suppose you have a full path to an accessible file or folder on the system. How can I get some kind of unique identifier for the physical device that the file (or folder) actually resides on? My first attempt was to use System.IO.DriveInfo which depends on having a drive letter. But UNC paths and multiple network drive...
This win API call should get you what you need regarding disk space GetDiskFreeSpaceEx http://msdn.microsoft.com/en-us/library/aa364937(VS.85).aspx Also, to determine if the three mappings all are from the same physical disk, perform a call to GetVolumeInformation and compare the returned volume serial numbers http://m...
Obtaining information about the physical device from a given file path Suppose you have a full path to an accessible file or folder on the system. How can I get some kind of unique identifier for the physical device that the file (or folder) actually resides on? My first attempt was to use System.IO.DriveInfo which dep...
TITLE: Obtaining information about the physical device from a given file path QUESTION: Suppose you have a full path to an accessible file or folder on the system. How can I get some kind of unique identifier for the physical device that the file (or folder) actually resides on? My first attempt was to use System.IO.D...
[ "windows", "file", "path" ]
3
2
607
1
0
2008-09-22T16:23:07.353000
2008-09-22T16:40:40.523000
115,882
115,927
How do you deal with lots of small files?
A product that I am working on collects several thousand readings a day and stores them as 64k binary files on a NTFS partition (Windows XP). After a year in production there is over 300000 files in a single directory and the number keeps growing. This has made accessing the parent/ancestor directories from windows exp...
NTFS performance severely degrades after 10,000 files in a directory. What you do is create an additional level in the directory hierarchy, with each subdirectory having 10,000 files. For what it's worth, this is the approach that the SVN folks took in version 1.5. They used 1,000 files as the default threshold.
How do you deal with lots of small files? A product that I am working on collects several thousand readings a day and stores them as 64k binary files on a NTFS partition (Windows XP). After a year in production there is over 300000 files in a single directory and the number keeps growing. This has made accessing the pa...
TITLE: How do you deal with lots of small files? QUESTION: A product that I am working on collects several thousand readings a day and stores them as 64k binary files on a NTFS partition (Windows XP). After a year in production there is over 300000 files in a single directory and the number keeps growing. This has mad...
[ "windows-xp", "filesystems", "ntfs" ]
31
30
14,817
14
0
2008-09-22T16:24:20.080000
2008-09-22T16:29:51.987000
115,928
115,962
What is the best way to make a thread signal another thread in .NET?
I need to have a thread signal another if the user wishes to interrupt execution, however I'm unsure about how to implement the signaling/signal-checking mechanism. I wouldn't like to have a singleton in my project (like a global bool ), but is there an alternative? In this thread people suggest proper structures for t...
Try out BackgroundWorker. It supports progress updates and cancellation of a running task. If you want one thread to wait until another thread has finished doing its thing, then Monitor.Wait and Monitor.Pulse are good, as is ManualResetEvent. However, these are not really of any use for cancelling a running task. If yo...
What is the best way to make a thread signal another thread in .NET? I need to have a thread signal another if the user wishes to interrupt execution, however I'm unsure about how to implement the signaling/signal-checking mechanism. I wouldn't like to have a singleton in my project (like a global bool ), but is there ...
TITLE: What is the best way to make a thread signal another thread in .NET? QUESTION: I need to have a thread signal another if the user wishes to interrupt execution, however I'm unsure about how to implement the signaling/signal-checking mechanism. I wouldn't like to have a singleton in my project (like a global boo...
[ ".net", "multithreading", "signals" ]
10
7
3,809
6
0
2008-09-22T16:29:54.217000
2008-09-22T16:35:59.740000
115,955
115,965
Linq to SQL Grouping Child Relationships
I'm trying to run a LINQ to SQL query that returns a result in a grid view in a search engine style listing. In the simplified example below, is it possible to populate the collection with a comma-separated list of any children that the parent has (NAMESOFCHILDREN) in a single query? var family = from p in db.Parents w...
Your joins are going to screw up your cardinality! You don't have a list of Parents! Here's some untested free-hand code. Adding the relationships in the Linq designer gives you relationship properties. String.Join will put the list together. I've added two optional method calls. Where... Any will filter the parents to...
Linq to SQL Grouping Child Relationships I'm trying to run a LINQ to SQL query that returns a result in a grid view in a search engine style listing. In the simplified example below, is it possible to populate the collection with a comma-separated list of any children that the parent has (NAMESOFCHILDREN) in a single q...
TITLE: Linq to SQL Grouping Child Relationships QUESTION: I'm trying to run a LINQ to SQL query that returns a result in a grid view in a search engine style listing. In the simplified example below, is it possible to populate the collection with a comma-separated list of any children that the parent has (NAMESOFCHILD...
[ "c#", ".net", "linq", "linq-to-sql" ]
2
4
2,114
3
0
2008-09-22T16:34:25.623000
2008-09-22T16:36:11.067000
115,971
116,004
Indirectly referenced from required .class file
I'm getting an error message when I try to build my project in eclipse: The type weblogic.utils.expressions.ExpressionMap cannot be resolved. It is indirectly referenced from required.class files I've looked online for a solution and cannot find one (except for those sites that make you pay for help). Anyone have any i...
How are you adding your Weblogic classes to the classpath in Eclipse? Are you using WTP, and a server runtime? If so, is your server runtime associated with your project? If you right click on your project and choose build path->configure build path and then choose the libraries tab. You should see the weblogic librari...
Indirectly referenced from required .class file I'm getting an error message when I try to build my project in eclipse: The type weblogic.utils.expressions.ExpressionMap cannot be resolved. It is indirectly referenced from required.class files I've looked online for a solution and cannot find one (except for those site...
TITLE: Indirectly referenced from required .class file QUESTION: I'm getting an error message when I try to build my project in eclipse: The type weblogic.utils.expressions.ExpressionMap cannot be resolved. It is indirectly referenced from required.class files I've looked online for a solution and cannot find one (exc...
[ "java", "eclipse", "weblogic" ]
41
27
179,309
5
0
2008-09-22T16:38:01.170000
2008-09-22T16:44:20.717000
115,974
116,035
What would be the simplest way to daemonize a python script in Linux?
What would be the simplest way to daemonize a python script in Linux? I need that this works with every flavor of Linux, so it should only use python based tools.
See Stevens and also this lengthy thread on activestate which I found personally to be both mostly incorrect and much to verbose, and I came up with this: from os import fork, setsid, umask, dup2 from sys import stdin, stdout, stderr if fork(): exit(0) umask(0) setsid() if fork(): exit(0) stdout.flush() stderr.flush(...
What would be the simplest way to daemonize a python script in Linux? What would be the simplest way to daemonize a python script in Linux? I need that this works with every flavor of Linux, so it should only use python based tools.
TITLE: What would be the simplest way to daemonize a python script in Linux? QUESTION: What would be the simplest way to daemonize a python script in Linux? I need that this works with every flavor of Linux, so it should only use python based tools. ANSWER: See Stevens and also this lengthy thread on activestate whic...
[ "python", "scripting", "daemon" ]
10
21
6,040
5
0
2008-09-22T16:39:09.670000
2008-09-22T16:47:31.380000
115,979
116,243
Flash: Coming back from another tab in browser, can flash listen to return to tab event of some sort?
I got this flash application where you can click a link while watching a video. It will open a new tab and pause the video. Now when you come back to the flash application it would be nice if the video would start playing again. Is there a way, an event or so to do this?
I think i have solved it like this: I listen to a mouse_leave event on the stage, because your mouse will leave the stage when in another tab. (or at least, you have to click a tab to get back to the flash, so you always end up outside of the flash). When you left the stage a stageLeave boolean is set to true. Then I h...
Flash: Coming back from another tab in browser, can flash listen to return to tab event of some sort? I got this flash application where you can click a link while watching a video. It will open a new tab and pause the video. Now when you come back to the flash application it would be nice if the video would start play...
TITLE: Flash: Coming back from another tab in browser, can flash listen to return to tab event of some sort? QUESTION: I got this flash application where you can click a link while watching a video. It will open a new tab and pause the video. Now when you come back to the flash application it would be nice if the vide...
[ "javascript", "actionscript-3", "events", "focus", "stage" ]
0
0
1,175
4
0
2008-09-22T16:39:55.190000
2008-09-22T17:26:49.213000
115,983
932,982
How do I add an empty directory to a Git repository?
How do I add an empty directory (that contains no files) to a Git repository?
Another way to make a directory stay (almost) empty (in the repository) is to create a.gitignore file inside that directory that contains these four lines: # Ignore everything in this directory * # Except this file!.gitignore Then you don't have to get the order right the way that you have to do in m104's solution. Thi...
How do I add an empty directory to a Git repository? How do I add an empty directory (that contains no files) to a Git repository?
TITLE: How do I add an empty directory to a Git repository? QUESTION: How do I add an empty directory (that contains no files) to a Git repository? ANSWER: Another way to make a directory stay (almost) empty (in the repository) is to create a.gitignore file inside that directory that contains these four lines: # Igno...
[ "git", "directory", "git-add" ]
5,347
5,113
1,547,579
37
0
2008-09-22T16:41:03.660000
2009-05-31T22:10:40.167000
115,984
116,029
Generate PDF from structured data
I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form. Currently our graphic designer creates these PDF files in Photoshop manually after getting the content as a MS Word Document. But usually, there ar...
There are some tools out there for doing this. XSL-FO is useful. Here is a tutorial for creating a pdf from xml (or xhtml) with cocoon. Also see Apache FOP. You could format your SQL data as XML and still use the same templates this way.
Generate PDF from structured data I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form. Currently our graphic designer creates these PDF files in Photoshop manually after getting the content as a MS Wo...
TITLE: Generate PDF from structured data QUESTION: I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form. Currently our graphic designer creates these PDF files in Photoshop manually after getting the ...
[ "pdf", "graphics", "pdf-generation" ]
2
3
6,124
12
0
2008-09-22T16:41:07.730000
2008-09-22T16:46:27.763000
116,002
116,049
Pointers and containers
We all know that RAW pointers need to be wrapped in some form of smart pointer to get Exception safe memory management. But when it comes to containers of pointers the issue becomes more thorny. The std containers insist on the contained object being copyable so this rules out the use of std::auto_ptr, though you can s...
Boost pointer containers have strict ownership over the resources they hold. A std::vector > has shared ownership. There are reasons why that may be necessary, but in case it isn't, I would default to boost::ptr_vector. YMMV.
Pointers and containers We all know that RAW pointers need to be wrapped in some form of smart pointer to get Exception safe memory management. But when it comes to containers of pointers the issue becomes more thorny. The std containers insist on the contained object being copyable so this rules out the use of std::au...
TITLE: Pointers and containers QUESTION: We all know that RAW pointers need to be wrapped in some form of smart pointer to get Exception safe memory management. But when it comes to containers of pointers the issue becomes more thorny. The std containers insist on the contained object being copyable so this rules out ...
[ "c++", "stl", "containers", "smart-pointers" ]
11
13
2,931
3
0
2008-09-22T16:44:11.060000
2008-09-22T16:50:44.417000
116,050
116,061
Location of My Pictures
How do I programatically (Using C#) find out what the path is of my My Pictures folder? Does this work on XP and Vista?
The following will return a full-path to the location of the users picture folder (Username\My Documents\My Pictures on XP, Username\Pictures on Vista) Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
Location of My Pictures How do I programatically (Using C#) find out what the path is of my My Pictures folder? Does this work on XP and Vista?
TITLE: Location of My Pictures QUESTION: How do I programatically (Using C#) find out what the path is of my My Pictures folder? Does this work on XP and Vista? ANSWER: The following will return a full-path to the location of the users picture folder (Username\My Documents\My Pictures on XP, Username\Pictures on Vist...
[ "c#", "windows", "windows-vista", "windows-xp" ]
24
55
14,992
3
0
2008-09-22T16:51:12.433000
2008-09-22T16:53:20.290000
116,054
116,063
What is the best way to embed LaTeX in a webpage?
I'm not asking about converting a LaTeX document to html. What I'd like to be able to do is have some way to use LaTeX math commands in an html document, and have it appear correctly in a browser. This could be done server or client side.
MediaWiki can do what you are looking for. It uses Texvc ( http://en.wikipedia.org/wiki/Texvc ) which "validates (AMS) LaTeX mathematical expressions and converts them to HTML, MathML, or PNG graphics." Sounds like what you are looking for. Check out Wikipedia's article on how they handle math equations here: http://en...
What is the best way to embed LaTeX in a webpage? I'm not asking about converting a LaTeX document to html. What I'd like to be able to do is have some way to use LaTeX math commands in an html document, and have it appear correctly in a browser. This could be done server or client side.
TITLE: What is the best way to embed LaTeX in a webpage? QUESTION: I'm not asking about converting a LaTeX document to html. What I'd like to be able to do is have some way to use LaTeX math commands in an html document, and have it appear correctly in a browser. This could be done server or client side. ANSWER: Medi...
[ "html", "latex" ]
68
17
82,203
12
0
2008-09-22T16:51:29.017000
2008-09-22T16:53:30.400000
116,074
116,075
How do I ignore a directory with SVN?
I just started using SVN, and I have a cache directory that I don't need under source control. How can I ignore the whole directory/folder with SVN? I am using Versions and TextMate on OS X and commandline.
Set the svn:ignore property of the parent directory: svn propset svn:ignore dirname. If you have multiple things to ignore, separate by newlines in the property value. In that case it's easier to edit the property value using an external editor: svn propedit svn:ignore.
How do I ignore a directory with SVN? I just started using SVN, and I have a cache directory that I don't need under source control. How can I ignore the whole directory/folder with SVN? I am using Versions and TextMate on OS X and commandline.
TITLE: How do I ignore a directory with SVN? QUESTION: I just started using SVN, and I have a cache directory that I don't need under source control. How can I ignore the whole directory/folder with SVN? I am using Versions and TextMate on OS X and commandline. ANSWER: Set the svn:ignore property of the parent direct...
[ "svn", "version-control", "directory" ]
791
831
619,766
22
0
2008-09-22T16:55:59.443000
2008-09-22T16:56:30.563000
116,088
127,087
With Blogger (FTP, Classic) how do you add features that are too complex for the template?
Using classic templates, publishing via FTP to a custom domain. I want to add custom elements such as: a tree view for archived posts (expanding using CSS/JavaScript) a tag cloud a slideshow of images
I used PHP to process a Blogger blog after it is published via FTP. Any server side language can do this (ASP, ASP.NET, Python, JSP,...). I wrote a PHP script ( blogger_functions.php ) to scan the directory that Blogger FTP's to and generate a snippet of HTML to represent the archive hierarchy ( $snippet ). I added thi...
With Blogger (FTP, Classic) how do you add features that are too complex for the template? Using classic templates, publishing via FTP to a custom domain. I want to add custom elements such as: a tree view for archived posts (expanding using CSS/JavaScript) a tag cloud a slideshow of images
TITLE: With Blogger (FTP, Classic) how do you add features that are too complex for the template? QUESTION: Using classic templates, publishing via FTP to a custom domain. I want to add custom elements such as: a tree view for archived posts (expanding using CSS/JavaScript) a tag cloud a slideshow of images ANSWER: I...
[ "ftp", "blogger" ]
1
2
562
1
0
2008-09-22T16:59:11.713000
2008-09-24T13:21:42.733000
116,090
116,098
How do I kill a process using Vb.NET or C#?
I have a scenario where I have to check whether user has already opened Microsoft Word. If he has, then I have to kill the winword.exe process and continue to execute my code. Does any one have any straight-forward code for killing a process using vb.net or c#?
You'll want to use the System.Diagnostics.Process.Kill method. You can obtain the process you want using System.Diagnostics.Proccess.GetProcessesByName. Examples have already been posted here, but I found that the non-.exe version worked better, so something like: foreach ( Process p in System.Diagnostics.Process.GetPr...
How do I kill a process using Vb.NET or C#? I have a scenario where I have to check whether user has already opened Microsoft Word. If he has, then I have to kill the winword.exe process and continue to execute my code. Does any one have any straight-forward code for killing a process using vb.net or c#?
TITLE: How do I kill a process using Vb.NET or C#? QUESTION: I have a scenario where I have to check whether user has already opened Microsoft Word. If he has, then I have to kill the winword.exe process and continue to execute my code. Does any one have any straight-forward code for killing a process using vb.net or ...
[ "c#", "vb.net", "process", "kill" ]
72
98
178,951
10
0
2008-09-22T16:59:17.297000
2008-09-22T17:00:44.063000
116,121
119,377
Should I keep my project files under version control?
Should I keep project filesm like Eclipse's.project,.classpath,.settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)?
You do want to keep in version control any portable setting files, meaning: Any file which has no absolute path in it. That includes:.project,.classpath ( if no absolute path used, which is possible with the use of IDE variables, or user environment variables) IDE settings (which is where i disagree strongly with the '...
Should I keep my project files under version control? Should I keep project filesm like Eclipse's.project,.classpath,.settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)?
TITLE: Should I keep my project files under version control? QUESTION: Should I keep project filesm like Eclipse's.project,.classpath,.settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)? ANSWER: You do want to keep in version control any portable setting files, meaning: Any file which has ...
[ "java", "eclipse", "version-control", "ide" ]
92
99
19,227
12
0
2008-09-22T17:05:14.507000
2008-09-23T06:25:25.423000
116,139
116,217
How can I search a word in a Word 2007 .docx file?
I'd like to search a Word 2007 file (.docx) for a text string, e.g., "some special phrase" that could/would be found from a search within Word. Is there a way from Python to see the text? I have no interest in formatting - I just want to classify documents as having or not having "some special phrase".
More exactly, a.docx document is a Zip archive in OpenXML format: you have first to uncompress it. I downloaded a sample (Google: some search term filetype:docx ) and after unzipping I found some folders. The word folder contains the document itself, in file document.xml.
How can I search a word in a Word 2007 .docx file? I'd like to search a Word 2007 file (.docx) for a text string, e.g., "some special phrase" that could/would be found from a search within Word. Is there a way from Python to see the text? I have no interest in formatting - I just want to classify documents as having or...
TITLE: How can I search a word in a Word 2007 .docx file? QUESTION: I'd like to search a Word 2007 file (.docx) for a text string, e.g., "some special phrase" that could/would be found from a search within Word. Is there a way from Python to see the text? I have no interest in formatting - I just want to classify docu...
[ "python", "ms-word", "openxml", "docx" ]
84
42
87,586
10
0
2008-09-22T17:08:12.423000
2008-09-22T17:22:10.097000
116,140
116,253
Using AssemblyInfo to automatically update multiple AssemblyInfo.cs files
I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity. To make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo community task in conjunction with an ItemGroup e.g. Which blatently doesn't work because Out...
Try changing the @ to a % as below This creates a call for every entry in AllAssemblyInfos. Have a look at this article too, should help. http://blogs.msdn.com/aaronhallberg/archive/2006/09/05/msbuild-batching-generating-a-cross-product.aspx
Using AssemblyInfo to automatically update multiple AssemblyInfo.cs files I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity. To make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo community task in c...
TITLE: Using AssemblyInfo to automatically update multiple AssemblyInfo.cs files QUESTION: I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity. To make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo c...
[ "msbuild", "continuous-integration", "teamcity" ]
8
9
7,921
2
0
2008-09-22T17:08:16.543000
2008-09-22T17:28:49.440000
116,142
116,156
C# 3.0 Auto-Properties - Is it possible to add custom behaviour?
I would like to know if there is any way to add custom behaviour to the auto property get/set methods. An obvious case I can think of is wanting every set property method to call on any PropertyChanged event handlers as part of a System.ComponentModel.INotifyPropertyChanged implementation. This would allow a class to h...
No, you'll have to use "traditional" property definitions for custom behavior.
C# 3.0 Auto-Properties - Is it possible to add custom behaviour? I would like to know if there is any way to add custom behaviour to the auto property get/set methods. An obvious case I can think of is wanting every set property method to call on any PropertyChanged event handlers as part of a System.ComponentModel.INo...
TITLE: C# 3.0 Auto-Properties - Is it possible to add custom behaviour? QUESTION: I would like to know if there is any way to add custom behaviour to the auto property get/set methods. An obvious case I can think of is wanting every set property method to call on any PropertyChanged event handlers as part of a System....
[ "c#", ".net", "properties", "automatic-properties" ]
6
18
4,814
6
0
2008-09-22T17:08:24.653000
2008-09-22T17:10:37.550000
116,147
116,219
How do you install an SSL certificate on IIS 6 and 7?
Is there a tool or programmatic way to install an SSL certificate to the default website in IIS 6 and 7? Ideally I am looking for something that can be done via unmanaged code or.NET managed code.
You can look at http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/bf6b6472-f58e-4271-9297-284357f69023.mspx?mfr=true Something like: set ssl = CreateObject("IIS.CertObj") ssl.InstanceName = "0.0.0.0:443" ssl.Import pfxfile, pfxfilepassword, true, true
How do you install an SSL certificate on IIS 6 and 7? Is there a tool or programmatic way to install an SSL certificate to the default website in IIS 6 and 7? Ideally I am looking for something that can be done via unmanaged code or.NET managed code.
TITLE: How do you install an SSL certificate on IIS 6 and 7? QUESTION: Is there a tool or programmatic way to install an SSL certificate to the default website in IIS 6 and 7? Ideally I am looking for something that can be done via unmanaged code or.NET managed code. ANSWER: You can look at http://www.microsoft.com/t...
[ ".net", "iis-7", "iis-6", "windows-server-2008", "windows-server-2003" ]
0
1
650
1
0
2008-09-22T17:09:07.773000
2008-09-22T17:22:20.457000
116,163
116,492
Delphi: Paradox DB Field Name Issue (Spaces in field name)
I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. "Street 1". When I try and formulate a query in delphi for only the "Street 1" field, I get an error - Invalid use of keyword. Token: 1, Line Number: 1 Delphi V7 - object pascal, standard Tquery objec...
You need to prefix the string with the table name in the query. For example: field name is 'Street 1', table is called customers the select is: SELECT customers."Street 1" FROM customers WHERE...
Delphi: Paradox DB Field Name Issue (Spaces in field name) I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. "Street 1". When I try and formulate a query in delphi for only the "Street 1" field, I get an error - Invalid use of keyword. Token: 1, Line...
TITLE: Delphi: Paradox DB Field Name Issue (Spaces in field name) QUESTION: I have a paradox table from a legacy system I need to run a single query on. The field names have spaces in them - i.e. "Street 1". When I try and formulate a query in delphi for only the "Street 1" field, I get an error - Invalid use of keywo...
[ "sql", "delphi", "paradox", "tquery" ]
7
9
5,417
4
0
2008-09-22T17:12:18.513000
2008-09-22T18:10:37.797000
116,164
116,186
How do you handle developer individual files under version control?
Some files in our repository are individual to each developer. For example some developers use a local database, which is configured in a properties file in the project. So each developer has different settings. When one developer commits, he always has to take care to not commit his individually configured files. How ...
Our properties files are under a "properties" directory. Each developer has their own "username.properties" files which they can override properties in the environment-specific files such as "dev.properties", or "test.properties". This takes advantage of ANT's immutable properties (include personal first, THEN environm...
How do you handle developer individual files under version control? Some files in our repository are individual to each developer. For example some developers use a local database, which is configured in a properties file in the project. So each developer has different settings. When one developer commits, he always ha...
TITLE: How do you handle developer individual files under version control? QUESTION: Some files in our repository are individual to each developer. For example some developers use a local database, which is configured in a properties file in the project. So each developer has different settings. When one developer com...
[ "java", "version-control" ]
7
4
1,029
13
0
2008-09-22T17:12:19.793000
2008-09-22T17:15:23.840000
116,221
116,234
How do you handle browser specific .js and .css
This is not a new topic, but I am curious how everyone is handling either.js or.css that is browser specific. Do you have.js functions that have if/else conditions in them or do you have separate files for each browser? Is this really an issue these days with the current versions of each of the popular browsers?
It's a very real issue. Mostly just because of IE6. You can handle IE6-specific CSS by using conditional comments. For JavaScript, I'd recommend using a library that has already done most of the work of abstracting away browser differences. jQuery is really good in this regard.
How do you handle browser specific .js and .css This is not a new topic, but I am curious how everyone is handling either.js or.css that is browser specific. Do you have.js functions that have if/else conditions in them or do you have separate files for each browser? Is this really an issue these days with the current ...
TITLE: How do you handle browser specific .js and .css QUESTION: This is not a new topic, but I am curious how everyone is handling either.js or.css that is browser specific. Do you have.js functions that have if/else conditions in them or do you have separate files for each browser? Is this really an issue these days...
[ "javascript", "css" ]
6
10
2,550
12
0
2008-09-22T17:22:50.923000
2008-09-22T17:25:24.613000
116,228
138,958
Replication with lots of temporary table writes
I've got a database which I intend to replicate for backup reasons (performance is not a problem at the moment). We've set up the replication correctly and tested it and all was fine. Then we realized that it replicates all the writes to the temporary tables, which in effect meant that replication of one day's worth of...
I've come up with the solution. It makes use of replicate-do-db mentioned by Nick. Writing it down here in case somebody had a similar problem. The problem with just using replicate-(wild-)do* options in this case (like I said, we use temp tables to repopulate a central table) is that either you ignore temp tables and ...
Replication with lots of temporary table writes I've got a database which I intend to replicate for backup reasons (performance is not a problem at the moment). We've set up the replication correctly and tested it and all was fine. Then we realized that it replicates all the writes to the temporary tables, which in eff...
TITLE: Replication with lots of temporary table writes QUESTION: I've got a database which I intend to replicate for backup reasons (performance is not a problem at the moment). We've set up the replication correctly and tested it and all was fine. Then we realized that it replicates all the writes to the temporary ta...
[ "mysql", "replication" ]
1
3
2,594
2
0
2008-09-22T17:23:49.547000
2008-09-26T11:51:18.600000
116,248
117,033
PowerBuilder database connection pool? How-to
How to make database connection pool in PowerBuilder (v9+) with......ODBC?...SQL Server?...Oracle?
Unfortunately, at least with PB 9, you can't natively. PB has always been a two-tier dev tool. However, if you are using the WebServices support that started in PB 9 you can get around this limitation by invoking WebServices on a connection pooled appServer. I haven't played with PB 11.5 yet BTW. Could be different the...
PowerBuilder database connection pool? How-to How to make database connection pool in PowerBuilder (v9+) with......ODBC?...SQL Server?...Oracle?
TITLE: PowerBuilder database connection pool? How-to QUESTION: How to make database connection pool in PowerBuilder (v9+) with......ODBC?...SQL Server?...Oracle? ANSWER: Unfortunately, at least with PB 9, you can't natively. PB has always been a two-tier dev tool. However, if you are using the WebServices support tha...
[ "database", "connection-pooling", "powerbuilder" ]
2
2
4,749
6
0
2008-09-22T17:27:36.463000
2008-09-22T19:39:54.120000
116,258
116,306
How to add a Numeric Up / Down control to a .Net StatusStrip container
I'm looking to add a numeric up / down control to a.Net StatusStrip. Unfortunately, it isn't listed as an option in the UI designer. Is there a way to do this?
You can use a ToolStripControlHost class to host a custom ( NumericUpDown for now ) class. You can also derive from this class "NumericUpDownToolStripItem" which initialize the "Control" property with the custom control and can populate next properties from the hosted control ( Min, Max, Value - for example ).
How to add a Numeric Up / Down control to a .Net StatusStrip container I'm looking to add a numeric up / down control to a.Net StatusStrip. Unfortunately, it isn't listed as an option in the UI designer. Is there a way to do this?
TITLE: How to add a Numeric Up / Down control to a .Net StatusStrip container QUESTION: I'm looking to add a numeric up / down control to a.Net StatusStrip. Unfortunately, it isn't listed as an option in the UI designer. Is there a way to do this? ANSWER: You can use a ToolStripControlHost class to host a custom ( Nu...
[ "visual-studio-2008", "statusstrip" ]
0
2
1,625
2
0
2008-09-22T17:29:25.320000
2008-09-22T17:39:02.303000
116,261
123,482
Software for managing medium sized projects
So, at my current job we're usually 1-3 developers, 1-2 art directors and 1 project manager on each project, with the smallest ones just being one of each and the larger ones being three developers and two art directors. I'm looking for a software, combination of softwares or some type of service that will allow us to ...
Since you seem to have a maximum of six people working in a single room - I'd give serious consideration to not using software at all. A whiteboard & cork board for each project, plus a whole lot of index cards / stickies can go a long, long way towards meeting the project management needs of one or two small projects....
Software for managing medium sized projects So, at my current job we're usually 1-3 developers, 1-2 art directors and 1 project manager on each project, with the smallest ones just being one of each and the larger ones being three developers and two art directors. I'm looking for a software, combination of softwares or...
TITLE: Software for managing medium sized projects QUESTION: So, at my current job we're usually 1-3 developers, 1-2 art directors and 1 project manager on each project, with the smallest ones just being one of each and the larger ones being three developers and two art directors. I'm looking for a software, combinati...
[ "windows", "project-management", "agile", "bug-tracking" ]
1
2
457
7
0
2008-09-22T17:29:57.737000
2008-09-23T20:01:36.663000
116,276
116,532
ArrayList in Java and inputting
I'm used to python, so this is a bit confusing to me. I'm trying to take in input, line-by-line, until a user inputs a certain number. The numbers will be stored in an array to apply some statistical maths to them. Currently, I have a main class, the stats classes, and an "reading" class. Two Questions: I can't seem to...
Answers: >1. I can't seem to get the input loop to work out, what's the best practice for doing so. I would rather have a simple while loop instead of a do{}while... and place the condition in the while... In my example it read: while the read number is not end signal and count is lower than limit: do. >2. What is the ...
ArrayList in Java and inputting I'm used to python, so this is a bit confusing to me. I'm trying to take in input, line-by-line, until a user inputs a certain number. The numbers will be stored in an array to apply some statistical maths to them. Currently, I have a main class, the stats classes, and an "reading" class...
TITLE: ArrayList in Java and inputting QUESTION: I'm used to python, so this is a bit confusing to me. I'm trying to take in input, line-by-line, until a user inputs a certain number. The numbers will be stored in an array to apply some statistical maths to them. Currently, I have a main class, the stats classes, and ...
[ "java", "arrays", "arraylist" ]
6
2
17,662
5
0
2008-09-22T17:32:06.423000
2008-09-22T18:15:37.533000
116,292
116,345
What is the best IDE for PHP?
I'm a PHP developer and now I use Notepad++ for code editing, but lately I've been searching for an IDE to ease my work. I've looked into Eclipse, Aptana Studio and several others, but I'm not really decided, they all look nice enough but a bit complicated. I'm sure it'll all get easy once I get used to it, but I don't...
Are you sure you're looking for an IDE? The features you're describing, along with the impression of being too complicated that you got from e.g. Aptana, suggest that perhaps all you really want is a good editor with syntax highlighting and integration with some common workflow tools. For this, there are tons of option...
What is the best IDE for PHP? I'm a PHP developer and now I use Notepad++ for code editing, but lately I've been searching for an IDE to ease my work. I've looked into Eclipse, Aptana Studio and several others, but I'm not really decided, they all look nice enough but a bit complicated. I'm sure it'll all get easy once...
TITLE: What is the best IDE for PHP? QUESTION: I'm a PHP developer and now I use Notepad++ for code editing, but lately I've been searching for an IDE to ease my work. I've looked into Eclipse, Aptana Studio and several others, but I'm not really decided, they all look nice enough but a bit complicated. I'm sure it'll...
[ "php", "ide" ]
48
20
1,460,054
40
0
2008-09-22T17:35:32.297000
2008-09-22T17:46:39.367000
116,294
116,346
How do you handle code promotion in a Sharepoint environment?
In a typical enterprise scenario with in-house development, you might have dev, staging, and production environments. You might use SVN to contain ongoing development work in a trunk, with patches being stored in branches, and your released code going into appropriately named tags. Migrating binaries from one environme...
I assume when you talk about database content you are referring to the actual contents contained in a site a or a list. Probably the best way to do this is to use the stsadm import and export commands to export and import content from one environment to another. (Don't use backup/restore when going from one environment...
How do you handle code promotion in a Sharepoint environment? In a typical enterprise scenario with in-house development, you might have dev, staging, and production environments. You might use SVN to contain ongoing development work in a trunk, with patches being stored in branches, and your released code going into a...
TITLE: How do you handle code promotion in a Sharepoint environment? QUESTION: In a typical enterprise scenario with in-house development, you might have dev, staging, and production environments. You might use SVN to contain ongoing development work in a trunk, with patches being stored in branches, and your released...
[ "sharepoint", "deployment" ]
4
1
1,001
4
0
2008-09-22T17:36:38.953000
2008-09-22T17:47:01.083000
116,297
116,364
SVN Client integrated with OS X's Finder
Is there a TortoiseSVN equivalent for OS X? I'm looking for an SVN client that will integrate with OS X's Finder and be added as Context menu items. Update: Just found SmartSVN. Anyone with feedback on it?
There is SCPlugin which is the closest match to TortoiseSVN on OS X. It adds overlay icons as well as context menu entries to the Finder.
SVN Client integrated with OS X's Finder Is there a TortoiseSVN equivalent for OS X? I'm looking for an SVN client that will integrate with OS X's Finder and be added as Context menu items. Update: Just found SmartSVN. Anyone with feedback on it?
TITLE: SVN Client integrated with OS X's Finder QUESTION: Is there a TortoiseSVN equivalent for OS X? I'm looking for an SVN client that will integrate with OS X's Finder and be added as Context menu items. Update: Just found SmartSVN. Anyone with feedback on it? ANSWER: There is SCPlugin which is the closest match t...
[ "macos", "smartsvn" ]
17
9
17,304
7
0
2008-09-22T17:37:19.890000
2008-09-22T17:51:02.257000
116,309
116,490
open solaris code vs solaris code
How compatible is code written under Solaris with Open Solaris? I would be interested specifically in some kernel modules.
Kernel modules in particular will be very compatible between Solaris and OpenSolaris. OpenSolaris (via Project Indiana) is evolving the user-space components more heavily, including the installer and packages.
open solaris code vs solaris code How compatible is code written under Solaris with Open Solaris? I would be interested specifically in some kernel modules.
TITLE: open solaris code vs solaris code QUESTION: How compatible is code written under Solaris with Open Solaris? I would be interested specifically in some kernel modules. ANSWER: Kernel modules in particular will be very compatible between Solaris and OpenSolaris. OpenSolaris (via Project Indiana) is evolving the ...
[ "solaris", "opensolaris" ]
2
1
858
4
0
2008-09-22T17:40:01.240000
2008-09-22T18:10:18.703000
116,338
116,410
Dragging HTML cells over the table using Javascript
Folks, I need a solution that allows drag-and-drop cell over the table. The cells can be of different colspans, so when the cell is dropped into the middle of another cell, which is bigger, the following steps should be performed: Another td element is created, which is equal in width to the draggable element. Cells on...
Not sure if it supports tables, but I have used link text before and it worked fairly well for me
Dragging HTML cells over the table using Javascript Folks, I need a solution that allows drag-and-drop cell over the table. The cells can be of different colspans, so when the cell is dropped into the middle of another cell, which is bigger, the following steps should be performed: Another td element is created, which ...
TITLE: Dragging HTML cells over the table using Javascript QUESTION: Folks, I need a solution that allows drag-and-drop cell over the table. The cells can be of different colspans, so when the cell is dropped into the middle of another cell, which is bigger, the following steps should be performed: Another td element ...
[ "javascript", "jquery", "html" ]
3
1
2,133
2
0
2008-09-22T17:45:25.737000
2008-09-22T17:57:42.337000
116,343
116,458
What is the difference between vmalloc and kmalloc?
I've googled around and found most people advocating the use of kmalloc, as you're guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a contiguous physical block that you want can't be found. What are the advantages of having a contiguous block of memory? Specif...
You only need to worry about using physically contiguous memory if the buffer will be accessed by a DMA device on a physically addressed bus (like PCI). The trouble is that many system calls have no way to know whether their buffer will eventually be passed to a DMA device: once you pass the buffer to another kernel su...
What is the difference between vmalloc and kmalloc? I've googled around and found most people advocating the use of kmalloc, as you're guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a contiguous physical block that you want can't be found. What are the advan...
TITLE: What is the difference between vmalloc and kmalloc? QUESTION: I've googled around and found most people advocating the use of kmalloc, as you're guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a contiguous physical block that you want can't be found. ...
[ "c", "linux-kernel", "kmalloc", "vmalloc" ]
130
113
127,202
8
0
2008-09-22T17:46:20.273000
2008-09-22T18:05:22.613000
116,353
120,288
Uploading files in Ruby on Rails
I have a web application that needs to take a file upload from the user and upload it to a remote server. I can take input from user to server fine via file_field, but can't seem to work out the next step of uploading from server to remote. Net::HTTP doesn't do multipart forms out of the box, and I haven't been able to...
I believe the attachment_fu plugin would allow for this: http://svn.techno-weenie.net/projects/plugins/attachment_fu/
Uploading files in Ruby on Rails I have a web application that needs to take a file upload from the user and upload it to a remote server. I can take input from user to server fine via file_field, but can't seem to work out the next step of uploading from server to remote. Net::HTTP doesn't do multipart forms out of th...
TITLE: Uploading files in Ruby on Rails QUESTION: I have a web application that needs to take a file upload from the user and upload it to a remote server. I can take input from user to server fine via file_field, but can't seem to work out the next step of uploading from server to remote. Net::HTTP doesn't do multipa...
[ "ruby-on-rails", "ruby", "file-upload" ]
8
2
5,266
2
0
2008-09-22T17:48:43.760000
2008-09-23T10:47:07.823000
116,368
116,382
C compiler for Windows?
I'm fine working on Linux using gcc as my C compiler but would like a Windows solution. Any ideas? I've looked at Dev-C++ from Bloodshed but looking for more options.
You can use GCC on Windows by downloading MingW ( discontinued ) or its successor Mingw-w64.
C compiler for Windows? I'm fine working on Linux using gcc as my C compiler but would like a Windows solution. Any ideas? I've looked at Dev-C++ from Bloodshed but looking for more options.
TITLE: C compiler for Windows? QUESTION: I'm fine working on Linux using gcc as my C compiler but would like a Windows solution. Any ideas? I've looked at Dev-C++ from Bloodshed but looking for more options. ANSWER: You can use GCC on Windows by downloading MingW ( discontinued ) or its successor Mingw-w64.
[ "c", "windows", "compiler-construction" ]
134
84
479,331
22
0
2008-09-22T17:51:34.083000
2008-09-22T17:53:07.823000
116,402
116,407
SQL Server 2000 Function for record created datetime
I was given a task to display when a record in the database was added, however the previous developers never made a field for this, and I can't go back and make up dates for all the existing records. Is there an easy way to extract out a record Creation date from a SQL server 2000 query. SELECT RECORD_CREATED_DATE FROM...
If it's not stored as a field, the info is lost after the transaction log recycles (typically daily), and maybe even sooner.
SQL Server 2000 Function for record created datetime I was given a task to display when a record in the database was added, however the previous developers never made a field for this, and I can't go back and make up dates for all the existing records. Is there an easy way to extract out a record Creation date from a S...
TITLE: SQL Server 2000 Function for record created datetime QUESTION: I was given a task to display when a record in the database was added, however the previous developers never made a field for this, and I can't go back and make up dates for all the existing records. Is there an easy way to extract out a record Crea...
[ "sql", "sql-server" ]
4
11
4,641
5
0
2008-09-22T17:56:02.620000
2008-09-22T17:57:20.120000
116,403
116,417
A regular expression to remove a given (x)HTML tag from a string
Let's say I have a string holding a mess of text and (x)HTML tags. I want to remove all instances of a given tag (and any attributes of that tag), leaving all other tags and text along. What's the best Regex to get this done? Edited to add: Oh, I appreciate that using a Regex for this particular issue is not the best s...
Attempting to parse HTML with regular expressions is generally an extremely bad idea. Use a parser instead, there should be one available for your chosen language. You might be able to get away with something like this: ]*?> But it depends on exactly what you're doing. For example, that won't remove the tag's content, ...
A regular expression to remove a given (x)HTML tag from a string Let's say I have a string holding a mess of text and (x)HTML tags. I want to remove all instances of a given tag (and any attributes of that tag), leaving all other tags and text along. What's the best Regex to get this done? Edited to add: Oh, I apprecia...
TITLE: A regular expression to remove a given (x)HTML tag from a string QUESTION: Let's say I have a string holding a mess of text and (x)HTML tags. I want to remove all instances of a given tag (and any attributes of that tag), leaving all other tags and text along. What's the best Regex to get this done? Edited to a...
[ "html", "regex", "string" ]
6
17
8,744
8
0
2008-09-22T17:56:48.407000
2008-09-22T17:58:39.587000
116,415
116,520
Find potential SQL inject problems in Java/JSP code
I'm working for a customer with a huge legacy codebase consisting of various Java en JSP based applications. Most querying is done using the home-build 'orm' system. Some applications use Plain Old JDBC. Some applications are based on Hibernate (yes HQL build with plus signs is a potential problem as well). Some of the...
I would recommend FindBugs (there is also an eclipse plugin) which can track down these issues and many more. We are using it at work, it's fast and it's worth the money (as in free). We've solved some common problems with its help.
Find potential SQL inject problems in Java/JSP code I'm working for a customer with a huge legacy codebase consisting of various Java en JSP based applications. Most querying is done using the home-build 'orm' system. Some applications use Plain Old JDBC. Some applications are based on Hibernate (yes HQL build with plu...
TITLE: Find potential SQL inject problems in Java/JSP code QUESTION: I'm working for a customer with a huge legacy codebase consisting of various Java en JSP based applications. Most querying is done using the home-build 'orm' system. Some applications use Plain Old JDBC. Some applications are based on Hibernate (yes ...
[ "java", "jsp", "security", "sql-injection" ]
2
3
1,558
7
0
2008-09-22T17:58:35.547000
2008-09-22T18:14:38.893000
116,423
116,449
How can my application benefit from temporary tables?
I've been reading a little about temporary tables in MySQL but I'm an admitted newbie when it comes to databases in general and MySQL in particular. I've looked at some examples and the MySQL documentation on how to create a temporary table, but I'm trying to determine just how temporary tables might benefit my applica...
Temporary tables are often valuable when you have a fairly complicated SELECT you want to perform and then perform a bunch of queries on that... You can do something like: CREATE TEMPORARY TABLE myTopCustomers SELECT customers.*,count(*) num from customers join purchases using(customerID) join items using(itemID) GROUP...
How can my application benefit from temporary tables? I've been reading a little about temporary tables in MySQL but I'm an admitted newbie when it comes to databases in general and MySQL in particular. I've looked at some examples and the MySQL documentation on how to create a temporary table, but I'm trying to determ...
TITLE: How can my application benefit from temporary tables? QUESTION: I've been reading a little about temporary tables in MySQL but I'm an admitted newbie when it comes to databases in general and MySQL in particular. I've looked at some examples and the MySQL documentation on how to create a temporary table, but I'...
[ "sql", "mysql" ]
15
16
6,939
6
0
2008-09-22T18:00:10.693000
2008-09-22T18:04:15.970000
116,444
116,662
How to change the location of the netbeans settings directory (~/.netbeans)
By default netbeans stores it's settings in a directory called.netbeans under the user's home directory. Is it possible to change the location of this directory (especially under Windows)? Thanks to James Schek I now know the answer (change the path in netbeans.conf) but that leads me to another question: Is there a wa...
yes, edit the netbeans.conf file under %NETBEANS_HOME%\etc. Edit the line with: netbeans_default_userdir="${HOME}/.netbeans/6.0" If you need different "profiles"--i.e. want to run different copies of Netbeans with different home directories, you can pass a new home directory to the launcher. Run "netbeans.exe --userdir...
How to change the location of the netbeans settings directory (~/.netbeans) By default netbeans stores it's settings in a directory called.netbeans under the user's home directory. Is it possible to change the location of this directory (especially under Windows)? Thanks to James Schek I now know the answer (change the...
TITLE: How to change the location of the netbeans settings directory (~/.netbeans) QUESTION: By default netbeans stores it's settings in a directory called.netbeans under the user's home directory. Is it possible to change the location of this directory (especially under Windows)? Thanks to James Schek I now know the ...
[ "netbeans" ]
12
16
26,245
3
0
2008-09-22T18:03:20.280000
2008-09-22T18:37:07.700000
116,468
125,891
Winforms for Mono on Mac, Linux and PC (Redux)
(I asked this question in another way, and got some interesting responses but I'm not too convinced.) Is Mono's GtkSharp truly cross-platform? It seems to be Gnome based... how can that work with PC and Mac? Can someone give me examples of a working Mac/PC/Linux app that is written with a single codebase in Microsoft.N...
Plastic SCM is supported on Windows, Linux, Solaris, and Mac OS X. The link includes screenshots on Windows and Linux.
Winforms for Mono on Mac, Linux and PC (Redux) (I asked this question in another way, and got some interesting responses but I'm not too convinced.) Is Mono's GtkSharp truly cross-platform? It seems to be Gnome based... how can that work with PC and Mac? Can someone give me examples of a working Mac/PC/Linux app that i...
TITLE: Winforms for Mono on Mac, Linux and PC (Redux) QUESTION: (I asked this question in another way, and got some interesting responses but I'm not too convinced.) Is Mono's GtkSharp truly cross-platform? It seems to be Gnome based... how can that work with PC and Mac? Can someone give me examples of a working Mac/P...
[ "winforms", "mono", "cross-platform", "gtk#" ]
3
1
2,798
5
0
2008-09-22T18:06:51.487000
2008-09-24T07:47:10.743000
116,469
116,510
Cleaning a string of punctuation in C++
Ok so before I even ask my question I want to make one thing clear. I am currently a student at NIU for Computer Science and this does relate to one of my assignments for a class there. So if anyone has a problem read no further and just go on about your business. Now for anyone who is willing to help heres the situati...
The problem with empty entries is in your while loop. If you get an empty string, you clean the next one, and add it without checking. Try changing: not_s = ""; clean_entry(s, not_s); if((int)not_s.length() == 0) { input >> s; clean_entry(s, not_s); } mapz[not_s]++; //increment occurence input >>s; to not_s = ""; cle...
Cleaning a string of punctuation in C++ Ok so before I even ask my question I want to make one thing clear. I am currently a student at NIU for Computer Science and this does relate to one of my assignments for a class there. So if anyone has a problem read no further and just go on about your business. Now for anyone ...
TITLE: Cleaning a string of punctuation in C++ QUESTION: Ok so before I even ask my question I want to make one thing clear. I am currently a student at NIU for Computer Science and this does relate to one of my assignments for a class there. So if anyone has a problem read no further and just go on about your busines...
[ "c++" ]
9
7
4,600
4
0
2008-09-22T18:07:03.327000
2008-09-22T18:12:41.707000
116,485
116,636
Fastest way to see how many bytes are equal between fixed length arrays
I have 2 arrays of 16 elements (chars) that I need to "compare" and see how many elements are equal between the two. This routine is going to be used millions of times (a usual run is about 60 or 70 million times), so I need it to be as fast as possible. I'm working on C++ (C++Builder 2007, for the record) Right now, I...
UPDATE: This answer has been modified to make my comments match the source code provided below. There is an optimization available if you have the capability to use SSE2 and popcnt instructions. 16 bytes happens to fit nicely in an SSE register. Using c++ and assembly/intrinsics, load the two 16 byte arrays into xmm re...
Fastest way to see how many bytes are equal between fixed length arrays I have 2 arrays of 16 elements (chars) that I need to "compare" and see how many elements are equal between the two. This routine is going to be used millions of times (a usual run is about 60 or 70 million times), so I need it to be as fast as pos...
TITLE: Fastest way to see how many bytes are equal between fixed length arrays QUESTION: I have 2 arrays of 16 elements (chars) that I need to "compare" and see how many elements are equal between the two. This routine is going to be used millions of times (a usual run is about 60 or 70 million times), so I need it to...
[ "c++", "arrays", "optimization" ]
12
17
4,882
15
0
2008-09-22T18:09:23.010000
2008-09-22T18:30:55.593000
116,486
116,588
Mapping to Dictionary with iBATIS
Given a simple statement, such as: SELECT * FROM Products Is it possible to get a list of dictionary objects where the keys are the column names? ie. var list = Mapper.QueryForList >("SelectProducts", null); IDictionary dict = list[0]; // dict["id"] == "1" // dict["name"] == "Some Product Name" // dict["price"] == "$9...
You can do this by setting the class attribute to HashTable in the resultMap configuration. More details available here.
Mapping to Dictionary with iBATIS Given a simple statement, such as: SELECT * FROM Products Is it possible to get a list of dictionary objects where the keys are the column names? ie. var list = Mapper.QueryForList >("SelectProducts", null); IDictionary dict = list[0]; // dict["id"] == "1" // dict["name"] == "Some Pro...
TITLE: Mapping to Dictionary with iBATIS QUESTION: Given a simple statement, such as: SELECT * FROM Products Is it possible to get a list of dictionary objects where the keys are the column names? ie. var list = Mapper.QueryForList >("SelectProducts", null); IDictionary dict = list[0]; // dict["id"] == "1" // dict["n...
[ ".net", "ibatis", "datamapper" ]
0
1
2,759
1
0
2008-09-22T18:09:42.947000
2008-09-22T18:23:35.427000
116,494
116,622
Python regular expression to split paragraphs
How would one write a regular expression to use in Python to split paragraphs? A paragraph is defined by two line breaks (\n). But one can have any amount of spaces/tabs together with the line breaks, and it still should be considered as a paragraph. I am using Python, so the solution can use Python's regular expressio...
Unfortunately there's no nice way to write "space but not a newline". I think the best you can do is add some space with the x modifier and try to factor out the ugliness a bit, but that's questionable: (?x) (?: [ \t\r\f\v]*? \n ){2} [ \t\r\f\v]*? You could also try creating a subrule just for the character class and i...
Python regular expression to split paragraphs How would one write a regular expression to use in Python to split paragraphs? A paragraph is defined by two line breaks (\n). But one can have any amount of spaces/tabs together with the line breaks, and it still should be considered as a paragraph. I am using Python, so t...
TITLE: Python regular expression to split paragraphs QUESTION: How would one write a regular expression to use in Python to split paragraphs? A paragraph is defined by two line breaks (\n). But one can have any amount of spaces/tabs together with the line breaks, and it still should be considered as a paragraph. I am ...
[ "python", "regex", "parsing", "text", "split" ]
6
6
11,722
4
0
2008-09-22T18:10:41.370000
2008-09-22T18:28:47.923000
116,506
116,513
How to get a quick status from the Emacs compilation buffer?
By default, emacs 22.1.1 only shows the top of the compilation buffer when you first issue the compile command. I would like it to scroll to the bottom automatically when I use the compile command in order to save keystrokes. This way I can easily get a status of the current compilation by just looking at the compile b...
From Info > emacs > Compilation: If you set the variable compilation-scroll-output to a non- nil value, then the compilation buffer always scrolls to follow output as it comes in.
How to get a quick status from the Emacs compilation buffer? By default, emacs 22.1.1 only shows the top of the compilation buffer when you first issue the compile command. I would like it to scroll to the bottom automatically when I use the compile command in order to save keystrokes. This way I can easily get a statu...
TITLE: How to get a quick status from the Emacs compilation buffer? QUESTION: By default, emacs 22.1.1 only shows the top of the compilation buffer when you first issue the compile command. I would like it to scroll to the bottom automatically when I use the compile command in order to save keystrokes. This way I can ...
[ "emacs" ]
15
12
1,433
3
0
2008-09-22T18:12:08.777000
2008-09-22T18:13:17.057000
116,522
116,590
What Oracle privileges do I need to use DBMS_METADATA.GET_DDL?
(Excuse any ignorance of mine here - I'm not a seasoned Oracle user.) I'm attempting to use the DBMS_METADATA.GET_DDL function (in conjunction with ALL_OBJECTS or some such) to get the DDL for all of the tables in a particular schema. When I do this (either for all objects or for a single specific object) I get an ORA-...
Read this document, but basically, you need SELECT_CATALOG_ROLE http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1016867
What Oracle privileges do I need to use DBMS_METADATA.GET_DDL? (Excuse any ignorance of mine here - I'm not a seasoned Oracle user.) I'm attempting to use the DBMS_METADATA.GET_DDL function (in conjunction with ALL_OBJECTS or some such) to get the DDL for all of the tables in a particular schema. When I do this (either...
TITLE: What Oracle privileges do I need to use DBMS_METADATA.GET_DDL? QUESTION: (Excuse any ignorance of mine here - I'm not a seasoned Oracle user.) I'm attempting to use the DBMS_METADATA.GET_DDL function (in conjunction with ALL_OBJECTS or some such) to get the DDL for all of the tables in a particular schema. When...
[ "oracle", "metadata", "privilege" ]
6
6
16,453
1
0
2008-09-22T18:14:42.670000
2008-09-22T18:23:58.403000
116,523
116,534
String vs string
In C# there are String objects and string objects. What is the difference between the two? What are the best practices regarding which to use?
There is no difference. string (lower case) is just an alias for System.String.
String vs string In C# there are String objects and string objects. What is the difference between the two? What are the best practices regarding which to use?
TITLE: String vs string QUESTION: In C# there are String objects and string objects. What is the difference between the two? What are the best practices regarding which to use? ANSWER: There is no difference. string (lower case) is just an alias for System.String.
[ "c#", ".net", "string", "declaration" ]
40
36
3,949
12
0
2008-09-22T18:14:54.027000
2008-09-22T18:15:55.757000
116,525
116,611
How to restrict NULL input parameters into oracle stored procedure
I have writtent some Oracle storedprocedures in these there are more then 20 input parameters and from them morethen 10 parameters are required, I want all with some value and do not want to accept null values for that, Is there anything that I can declare in the Procedure defination itself which can restrict null inpu...
In PL/SQL I don't know of a way around checking each one. If you are calling the stored procedure from an external library, that library might have that functionality. This is probably not likely because frequently NULL input parameters are required. You could make a helper PL/SQL procedure that, given a value, will ra...
How to restrict NULL input parameters into oracle stored procedure I have writtent some Oracle storedprocedures in these there are more then 20 input parameters and from them morethen 10 parameters are required, I want all with some value and do not want to accept null values for that, Is there anything that I can decl...
TITLE: How to restrict NULL input parameters into oracle stored procedure QUESTION: I have writtent some Oracle storedprocedures in these there are more then 20 input parameters and from them morethen 10 parameters are required, I want all with some value and do not want to accept null values for that, Is there anythi...
[ "oracle", "stored-procedures" ]
10
6
17,001
2
0
2008-09-22T18:15:00.517000
2008-09-22T18:27:16.727000
116,527
119,045
Is there a way to dump the objects in memory from a running ruby process?
Killing the processs while obtaining this information would be fine.
For the more hardcore there is also BleakHouse which gives you a special custom-compiled copy of ruby with better memory leak tracking powarz
Is there a way to dump the objects in memory from a running ruby process? Killing the processs while obtaining this information would be fine.
TITLE: Is there a way to dump the objects in memory from a running ruby process? QUESTION: Killing the processs while obtaining this information would be fine. ANSWER: For the more hardcore there is also BleakHouse which gives you a special custom-compiled copy of ruby with better memory leak tracking powarz
[ "ruby", "heap-memory" ]
3
0
1,296
3
0
2008-09-22T18:15:09.703000
2008-09-23T04:01:03.290000