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
158,814
159,113
Costs vs Consistant gets
What does it indicate to see a query that has a low cost in the explain plan but a high consistent gets count in autotrace? In this case the cost was in the 100's and the CR's were in the millions.
The cost can represent two different things depending on version and whether you are running in cpu-based costing mode or not. Briefly, the cost represents that amount of time that the optimizer expects the query to execute for, but it is expressed in units of the amount of time that a single block read takes. For exam...
Costs vs Consistant gets What does it indicate to see a query that has a low cost in the explain plan but a high consistent gets count in autotrace? In this case the cost was in the 100's and the CR's were in the millions.
TITLE: Costs vs Consistant gets QUESTION: What does it indicate to see a query that has a low cost in the explain plan but a high consistent gets count in autotrace? In this case the cost was in the 100's and the CR's were in the millions. ANSWER: The cost can represent two different things depending on version and w...
[ "database", "sql-execution-plan" ]
4
4
1,515
2
0
2008-10-01T17:42:01.413000
2008-10-01T18:47:21.990000
158,816
158,835
How hard is it to migrate a web app from localhost to a hosting platform?
Since I'm not a huge fan of any of the current solutions for managing the resources and knowledge that I have, I was thinking about making my own solution, which will involve custom code as well as possible integration of FOSS solutions. I would start development on my local machine, but if I like it, how difficult wou...
In theory, nothing, beyond just the process of moving stuff to the new machine. You can set up your own servers, on your own ports (port 80 for example). You can even create your own fake domain at home, with just a tweak to the /etc/hosts files (or the equivalent on Windows). Now, if you're developing on Windows and h...
How hard is it to migrate a web app from localhost to a hosting platform? Since I'm not a huge fan of any of the current solutions for managing the resources and knowledge that I have, I was thinking about making my own solution, which will involve custom code as well as possible integration of FOSS solutions. I would ...
TITLE: How hard is it to migrate a web app from localhost to a hosting platform? QUESTION: Since I'm not a huge fan of any of the current solutions for managing the resources and knowledge that I have, I was thinking about making my own solution, which will involve custom code as well as possible integration of FOSS s...
[ "deployment" ]
0
1
148
3
0
2008-10-01T17:42:20.197000
2008-10-01T17:45:20.923000
158,818
158,837
Create JSON with .net
First off, let me start off that I am not a.net developer. The reason why I am asking this question is that we rolled out our REST-API and one of our first integration partners is a.net shop. So basically we assumed that.net would provide some sort of wrapper to create JSON, but the developer in question created the st...
There are a couple first-party and third-party options. Rick Strahl has a good overview. JSON.net is the most popular third-party option.
Create JSON with .net First off, let me start off that I am not a.net developer. The reason why I am asking this question is that we rolled out our REST-API and one of our first integration partners is a.net shop. So basically we assumed that.net would provide some sort of wrapper to create JSON, but the developer in q...
TITLE: Create JSON with .net QUESTION: First off, let me start off that I am not a.net developer. The reason why I am asking this question is that we rolled out our REST-API and one of our first integration partners is a.net shop. So basically we assumed that.net would provide some sort of wrapper to create JSON, but ...
[ ".net", "asp.net", "json" ]
15
15
8,535
6
0
2008-10-01T17:42:33.427000
2008-10-01T17:45:38.113000
158,821
158,845
Managed C++ Assembly Attributes
Is there a way to add assembly attributes to a Managed C++ assembly? In a typical C# project, there is usually a line of code in the AssemblyInfo.cs file like the following one: [assembly: AssemblyTitle("Some Assembly")] I have a private assembly attribute that I want to add (not one of the version attributes that coul...
It is possible - the easy way is to add an AssemblyInfo.cpp file and put: #include attributes.h //your attribute decl [assembly: MyCustomAttribute()]; It can be in any file you want, though. edit - added required semicolon for assembly attribute
Managed C++ Assembly Attributes Is there a way to add assembly attributes to a Managed C++ assembly? In a typical C# project, there is usually a line of code in the AssemblyInfo.cs file like the following one: [assembly: AssemblyTitle("Some Assembly")] I have a private assembly attribute that I want to add (not one of ...
TITLE: Managed C++ Assembly Attributes QUESTION: Is there a way to add assembly attributes to a Managed C++ assembly? In a typical C# project, there is usually a line of code in the AssemblyInfo.cs file like the following one: [assembly: AssemblyTitle("Some Assembly")] I have a private assembly attribute that I want t...
[ ".net", "attributes", "managed-c++" ]
8
14
3,807
1
0
2008-10-01T17:42:48.683000
2008-10-01T17:46:50.920000
158,848
158,905
mod_rewrite for trailing slash problem
I'm pulling my hair out on what should be an insanely simple problem. We are running WebSphere IHS (Apache) through an F5 BigIP. BigIP is doing the https translation for us. Our url (changed for web, not valid) is https://superniftyserver.com/lawson/portal. When someone types in just that without the slash after portal...
If you can't get an answer on the RewriteRule syntax, here are two other options for you: Write an custom iRule on BigIp (see F5 DevCentral ) that looks for 301 responses and convert them to SSL; let the URL pass into your WebSphere server and do a programmatic redirect that sends out HTTPS. However, because F5 termina...
mod_rewrite for trailing slash problem I'm pulling my hair out on what should be an insanely simple problem. We are running WebSphere IHS (Apache) through an F5 BigIP. BigIP is doing the https translation for us. Our url (changed for web, not valid) is https://superniftyserver.com/lawson/portal. When someone types in j...
TITLE: mod_rewrite for trailing slash problem QUESTION: I'm pulling my hair out on what should be an insanely simple problem. We are running WebSphere IHS (Apache) through an F5 BigIP. BigIP is doing the https translation for us. Our url (changed for web, not valid) is https://superniftyserver.com/lawson/portal. When ...
[ "apache", "mod-rewrite" ]
10
6
5,871
5
0
2008-10-01T17:47:08.780000
2008-10-01T18:02:30.197000
158,856
158,899
Knowing whether SubVersion working copy has been updated
Is there a way to have a file that is modified / touched whenever the WC is updated to a new revision? Or, as the second-best option, whenever svn update is executed? Here's the motivation: I want to have the SVN revision number inside my executable. So I have to run SubWCRev as part of the build. The output file of Su...
Get the SubWCRev output into a temporary file Compare this file to the current revision-number file Overwrite it with the temp file only if the two are different Delete the temporary file You might even be able to do this with a.bat file (using fc ). Something like... REM ***UNTESTED*** FC temp.rev curr.rev | FIND "FC:...
Knowing whether SubVersion working copy has been updated Is there a way to have a file that is modified / touched whenever the WC is updated to a new revision? Or, as the second-best option, whenever svn update is executed? Here's the motivation: I want to have the SVN revision number inside my executable. So I have to...
TITLE: Knowing whether SubVersion working copy has been updated QUESTION: Is there a way to have a file that is modified / touched whenever the WC is updated to a new revision? Or, as the second-best option, whenever svn update is executed? Here's the motivation: I want to have the SVN revision number inside my execut...
[ "svn", "build-process" ]
0
3
553
3
0
2008-10-01T17:48:56.717000
2008-10-01T18:01:46.063000
158,889
158,953
Are doubles faster than floats in C#?
I'm writing an application which reads large arrays of floats and performs some simple operations with them. I'm using floats, because I thought it'd be faster than doubles, but after doing some research I've found that there's some confusion about this topic. Can anyone elaborate on this?
The short answer is, "use whichever precision is required for acceptable results." Your one guarantee is that operations performed on floating point data are done in at least the highest precision member of the expression. So multiplying two float 's is done with at least the precision of float, and multiplying a float...
Are doubles faster than floats in C#? I'm writing an application which reads large arrays of floats and performs some simple operations with them. I'm using floats, because I thought it'd be faster than doubles, but after doing some research I've found that there's some confusion about this topic. Can anyone elaborate ...
TITLE: Are doubles faster than floats in C#? QUESTION: I'm writing an application which reads large arrays of floats and performs some simple operations with them. I'm using floats, because I thought it'd be faster than doubles, but after doing some research I've found that there's some confusion about this topic. Can...
[ "c#", "performance", "floating-point", "precision" ]
56
64
18,340
10
0
2008-10-01T17:58:46.337000
2008-10-01T18:15:00.680000
158,893
158,979
Limiting HTML Input into Text Box
How do I limit the types of HTML that a user can input into a textbox? I'm running a small forum using some custom software that I'm beta testing, but I need to know how to limit the HTML input. Any suggestions?
i'd suggest a slightly alternative approach: don't filter incoming user data (beyond prevention of sql injection). user data should be kept as pure as possible. filter all outgoing data from the database, this is where things like tag stripping, etc.. should happen keeping user data clean allows you more flexibility in...
Limiting HTML Input into Text Box How do I limit the types of HTML that a user can input into a textbox? I'm running a small forum using some custom software that I'm beta testing, but I need to know how to limit the HTML input. Any suggestions?
TITLE: Limiting HTML Input into Text Box QUESTION: How do I limit the types of HTML that a user can input into a textbox? I'm running a small forum using some custom software that I'm beta testing, but I need to know how to limit the HTML input. Any suggestions? ANSWER: i'd suggest a slightly alternative approach: do...
[ "html", "user-input", "markup" ]
1
2
1,554
6
0
2008-10-01T18:00:08.110000
2008-10-01T18:19:26.160000
158,895
158,927
How to make a Windows Forms .NET application display as tray icon?
What needs to be done to have your.NET application show up in Window's system tray as icon? And how do you handle mousebutton clicks on said icon?
First, add a NotifyIcon control to the Form. Then wire up the Notify Icon to do what you want. If you want it to hide to tray on minimize, try this. Private Sub frmMain_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize If Me.WindowState = FormWindowState.Minimized Then Me.ShowInTa...
How to make a Windows Forms .NET application display as tray icon? What needs to be done to have your.NET application show up in Window's system tray as icon? And how do you handle mousebutton clicks on said icon?
TITLE: How to make a Windows Forms .NET application display as tray icon? QUESTION: What needs to be done to have your.NET application show up in Window's system tray as icon? And how do you handle mousebutton clicks on said icon? ANSWER: First, add a NotifyIcon control to the Form. Then wire up the Notify Icon to do...
[ ".net", "vb.net", "winforms", "system-tray", "systray" ]
20
22
24,989
3
0
2008-10-01T18:00:28.517000
2008-10-01T18:08:12.163000
158,908
158,931
MFC File upload
How would I upload a file to a webserver using c++ and MFC. We are not using.Net. Would I need to open a socket and do everything myself? If so, where is a good reference to follow?
You don't want to use direct socket calls. It's hard to get HTTP right this way. The easier way is to the WinINet APIs. Check out the docs for InternetOpen, this will likely be the first call you make. Functions you will likely need: InternetOpen InternetConnect HttpOpenRequest HttpSendRequest HttpQueryInfo InternetClo...
MFC File upload How would I upload a file to a webserver using c++ and MFC. We are not using.Net. Would I need to open a socket and do everything myself? If so, where is a good reference to follow?
TITLE: MFC File upload QUESTION: How would I upload a file to a webserver using c++ and MFC. We are not using.Net. Would I need to open a socket and do everything myself? If so, where is a good reference to follow? ANSWER: You don't want to use direct socket calls. It's hard to get HTTP right this way. The easier way...
[ "c++", "mfc", "upload" ]
2
5
8,095
6
0
2008-10-01T18:03:09.273000
2008-10-01T18:08:50.960000
158,935
158,947
Why I can't parse a SimpleDateFormat with pattern "MMMMM dd" in Java?
I need to parse a string like "February 12, 1981" as a Date. I use SimpleDateFormat. But if I do: new SimpleDateFormat("MMMMM dd, yyyy").parse("February 12, 1981") I get java.text.ParseException. I tried to reduce it to see where the problem is. First: new SimpleDateFormat("MMMMM").parse("February") works. Then: new Si...
What version of JDK/JRE are you using? This works fine for me with 1.4.2_14, 1.5.0_16, and 1.6.0_07: SimpleDateFormat df = new SimpleDateFormat("MMMMM dd, yyyy"); Date parsed = df.parse("February 12, 1981"); System.out.println(parsed); output: Thu Feb 12 00:00:00 EST 1981
Why I can't parse a SimpleDateFormat with pattern "MMMMM dd" in Java? I need to parse a string like "February 12, 1981" as a Date. I use SimpleDateFormat. But if I do: new SimpleDateFormat("MMMMM dd, yyyy").parse("February 12, 1981") I get java.text.ParseException. I tried to reduce it to see where the problem is. Firs...
TITLE: Why I can't parse a SimpleDateFormat with pattern "MMMMM dd" in Java? QUESTION: I need to parse a string like "February 12, 1981" as a Date. I use SimpleDateFormat. But if I do: new SimpleDateFormat("MMMMM dd, yyyy").parse("February 12, 1981") I get java.text.ParseException. I tried to reduce it to see where th...
[ "java", "parsing", "date" ]
4
7
3,457
1
0
2008-10-01T18:09:22.003000
2008-10-01T18:13:24.677000
158,940
159,099
Resetting Buffers in Vim
Is it possible to reset the alternate buffer in a vim session to what it was previously? By alternate buffer, I mean the one that is referred to by #, i.e. the one that is displayed when you enter cntl-^. Say I've got two files open main.c and other.c and:ls gives me: 1 %a "main.c" lines 27 2 # "other.c" lines 56 Say I...
In this case, "alternate" just means "previous". So, yes,:b2 (or 2 ctrl-6) is probably the easiest way to change which two buffers will be toggled by ctrl-6. Also, take a look at the:keepalt command.
Resetting Buffers in Vim Is it possible to reset the alternate buffer in a vim session to what it was previously? By alternate buffer, I mean the one that is referred to by #, i.e. the one that is displayed when you enter cntl-^. Say I've got two files open main.c and other.c and:ls gives me: 1 %a "main.c" lines 27 2 #...
TITLE: Resetting Buffers in Vim QUESTION: Is it possible to reset the alternate buffer in a vim session to what it was previously? By alternate buffer, I mean the one that is referred to by #, i.e. the one that is displayed when you enter cntl-^. Say I've got two files open main.c and other.c and:ls gives me: 1 %a "ma...
[ "vim", "buffer", "keyboard-shortcuts" ]
4
7
2,658
2
0
2008-10-01T18:10:51.110000
2008-10-01T18:43:17.773000
158,943
159,020
What are the legalities of repackaging other's RSS feeds into a new presentation?
I know that services like my.yahoo.com allow you to add content from RSS feeds to your personal page, but in general they are links which draw the user to the site which provided the feed. What are the legalities and implications of using RSS feeds as a data source for a site which repackages the data so as to be unrec...
In my opinion it depends on the data source company as to whether they allow it in their terms and conditions. It probably also depends on where your servers are located (i.e. Which legal framework they fall under.) Unless it is allowed explicitly or you have written consent I don't think it's ethical. It also depends ...
What are the legalities of repackaging other's RSS feeds into a new presentation? I know that services like my.yahoo.com allow you to add content from RSS feeds to your personal page, but in general they are links which draw the user to the site which provided the feed. What are the legalities and implications of using...
TITLE: What are the legalities of repackaging other's RSS feeds into a new presentation? QUESTION: I know that services like my.yahoo.com allow you to add content from RSS feeds to your personal page, but in general they are links which draw the user to the site which provided the feed. What are the legalities and imp...
[ "rss" ]
4
2
850
9
0
2008-10-01T18:11:34.293000
2008-10-01T18:31:08.927000
158,954
160,330
When should an oldschool flash developer use flex?
What are the key differences between Flash and Flex? I have over five years experience with flash and feel very comfortable developing with it and ActionScript3. I find myself more and more curious about Flex and want to know when it is best to use flash or flex. Also, is everything that can be done with MXML, able to ...
Flex is great if you quickly want to build a UI, you can mock up a functioning UI in a couple hours. Since it still can be limiting for some custom UI's it's not perfect for everything but if something should "look" more or less like an application and fit in a grid it's super quick to mock up the UI in MXML. Also don'...
When should an oldschool flash developer use flex? What are the key differences between Flash and Flex? I have over five years experience with flash and feel very comfortable developing with it and ActionScript3. I find myself more and more curious about Flex and want to know when it is best to use flash or flex. Also,...
TITLE: When should an oldschool flash developer use flex? QUESTION: What are the key differences between Flash and Flex? I have over five years experience with flash and feel very comfortable developing with it and ActionScript3. I find myself more and more curious about Flex and want to know when it is best to use fl...
[ "apache-flex", "flash", "actionscript-3", "mxml" ]
10
5
1,997
7
0
2008-10-01T18:15:11.087000
2008-10-02T00:09:38.423000
158,968
159,066
Changing Vim indentation behavior by file type
Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a Python file it should indent with 2 spaces, but if I open a Powershell script it should use 4 spaces.
You can add.vim files to be executed whenever vim switches to a particular filetype. For example, I have a file ~/.vim/after/ftplugin/html.vim with this contents: setlocal shiftwidth=2 setlocal tabstop=2 Which causes vim to use tabs with a width of 2 characters for indenting (the noexpandtab option is set globally else...
Changing Vim indentation behavior by file type Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a Python file it should indent with 2 spaces, but if I open a Powershell script it should use 4 spaces.
TITLE: Changing Vim indentation behavior by file type QUESTION: Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a Python file it should indent with 2 spaces, but if I open a Powershell script it should use 4 spaces. ...
[ "file", "vim", "settings", "indentation" ]
447
351
237,780
12
0
2008-10-01T18:17:44.730000
2008-10-01T18:37:48.037000
158,975
159,019
ASP.NET UpdatePanel Time Out
I'm making a request from an UpdatePanel that takes more then 90 seconds. I'm getting this timeout error: Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out. Does anyone know if there is a way to increase the amount of time before the call times out?
There is a property on the ScriptManager which allows you to set the time-out in seconds. The default value is 90 seconds. AsyncPostBackTimeout="300"
ASP.NET UpdatePanel Time Out I'm making a request from an UpdatePanel that takes more then 90 seconds. I'm getting this timeout error: Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out. Does anyone know if there is a way to increase the amount of time before ...
TITLE: ASP.NET UpdatePanel Time Out QUESTION: I'm making a request from an UpdatePanel that takes more then 90 seconds. I'm getting this timeout error: Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out. Does anyone know if there is a way to increase the amou...
[ "asp.net", "ajax", "updatepanel" ]
60
95
90,762
7
0
2008-10-01T18:18:58.237000
2008-10-01T18:31:02.607000
158,986
159,042
How to relate objects from multiple contexts using the Entity Framework
I am very new to the entity framework, so please bear with me... How can I relate two objects from different contexts together? The example below throws the following exception: System.InvalidOperationException: The relationship between the two objects cannot be defined because they are attached to different ObjectCont...
You will have to use the same context (you can pass the context to the getdefaultrole method) or rethink the relationships and extend the entity. EDIT: Wanted to add this was for the example provided, using asp.net will require you to fully think out your context and relationship designs. You could simply pass the cont...
How to relate objects from multiple contexts using the Entity Framework I am very new to the entity framework, so please bear with me... How can I relate two objects from different contexts together? The example below throws the following exception: System.InvalidOperationException: The relationship between the two obj...
TITLE: How to relate objects from multiple contexts using the Entity Framework QUESTION: I am very new to the entity framework, so please bear with me... How can I relate two objects from different contexts together? The example below throws the following exception: System.InvalidOperationException: The relationship b...
[ "c#", ".net", "entity-framework" ]
14
11
23,918
4
0
2008-10-01T18:21:08.700000
2008-10-01T18:34:15.970000
159,006
159,018
Max and min values in a C++ enum
Is there a way to find the maximum and minimum defined values of an enum in c++?
No, there is no way to find the maximum and minimum defined values of any enum in C++. When this kind of information is needed, it is often good practice to define a Last and First value. For example, enum MyPretendEnum { Apples, Oranges, Pears, Bananas, First = Apples, Last = Bananas }; There do not need to be named v...
Max and min values in a C++ enum Is there a way to find the maximum and minimum defined values of an enum in c++?
TITLE: Max and min values in a C++ enum QUESTION: Is there a way to find the maximum and minimum defined values of an enum in c++? ANSWER: No, there is no way to find the maximum and minimum defined values of any enum in C++. When this kind of information is needed, it is often good practice to define a Last and Firs...
[ "c++", "enums" ]
90
110
70,208
7
0
2008-10-01T18:27:26.500000
2008-10-01T18:30:33.747000
159,011
166,296
generate HTML document server-side with jquery and classic asp
Here is my question, Would it be possible, knowing that classic asp support server-side javascript, to be able to generate "server side HTML" to send to the client like Response.write $(page).html() Of course it would be great to use jQuery to do it because it's easy to parse complicated structure and manipulate them. ...
I such situations I use an XML DOM as surrogate for the HTML DOM I would have in a browser. jQuery can manipulating an XML DOM however jQuery expects window to be present in its context. It may be possible to fool jQuery (or tweak it) so that it would work server-side but it could be quite fragile. Personnally I just u...
generate HTML document server-side with jquery and classic asp Here is my question, Would it be possible, knowing that classic asp support server-side javascript, to be able to generate "server side HTML" to send to the client like Response.write $(page).html() Of course it would be great to use jQuery to do it because...
TITLE: generate HTML document server-side with jquery and classic asp QUESTION: Here is my question, Would it be possible, knowing that classic asp support server-side javascript, to be able to generate "server side HTML" to send to the client like Response.write $(page).html() Of course it would be great to use jQuer...
[ "jquery", "dom", "asp-classic", "server-side" ]
1
2
4,204
3
0
2008-10-01T18:28:55.560000
2008-10-03T10:43:26.230000
159,015
159,021
What is the use of a Dispatcher Object in WPF?
What is the use of a Dispatcher Object in WPF?
A dispatcher is often used to invoke calls on another thread. An example would be if you have a background thread working, and you need to update the UI thread, you would need a dispatcher to do it.
What is the use of a Dispatcher Object in WPF? What is the use of a Dispatcher Object in WPF?
TITLE: What is the use of a Dispatcher Object in WPF? QUESTION: What is the use of a Dispatcher Object in WPF? ANSWER: A dispatcher is often used to invoke calls on another thread. An example would be if you have a background thread working, and you need to update the UI thread, you would need a dispatcher to do it.
[ "wpf", "dispatcher" ]
23
16
23,830
3
0
2008-10-01T18:29:46.463000
2008-10-01T18:31:13.357000
159,017
159,126
Named string formatting in C#
Is there any way to format a string by name rather than position in C#? In python, I can do something like this example (shamelessly stolen from here ): >>> print '%(language)s has %(#)03d quote types.' % \ {'language': "Python", "#": 2} Python has 002 quote types. Is there any way to do this in C#? Say for instance: S...
There is no built-in method for handling this. Here's one method string myString = "{foo} is {bar} and {yadi} is {yada}".Inject(o); Here's another Status.Text = "{UserName} last logged in at {LastLoginDate}".FormatWith(user); A third improved method partially based on the two above, from Phil Haack Update: This is now ...
Named string formatting in C# Is there any way to format a string by name rather than position in C#? In python, I can do something like this example (shamelessly stolen from here ): >>> print '%(language)s has %(#)03d quote types.' % \ {'language': "Python", "#": 2} Python has 002 quote types. Is there any way to do t...
TITLE: Named string formatting in C# QUESTION: Is there any way to format a string by name rather than position in C#? In python, I can do something like this example (shamelessly stolen from here ): >>> print '%(language)s has %(#)03d quote types.' % \ {'language': "Python", "#": 2} Python has 002 quote types. Is the...
[ "c#", ".net-3.5", "string-formatting" ]
157
131
86,057
18
0
2008-10-01T18:30:04.637000
2008-10-01T18:49:49.443000
159,034
159,073
Are C++ enums signed or unsigned?
Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is <= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)?
You shouldn't rely on any specific representation. Read the following link. Also, the standard says that it is implementation-defined which integral type is used as the underlying type for an enum, except that it shall not be larger than int, unless some value cannot fit into int or an unsigned int. In short: you canno...
Are C++ enums signed or unsigned? Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is <= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)?
TITLE: Are C++ enums signed or unsigned? QUESTION: Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is <= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)? ANSWER: You shouldn't rely on any specific representation. R...
[ "c++", "enums" ]
119
65
106,758
10
0
2008-10-01T18:33:03.960000
2008-10-01T18:38:27.567000
159,038
161,410
How can foreign key constraints be temporarily disabled using T-SQL?
Are disabling and enabling foreign key constraints supported in SQL Server? Or is my only option to drop and then re- create the constraints?
If you want to disable all constraints in the database just run this code: -- disable all constraints EXEC sp_MSforeachtable "ALTER TABLE? NOCHECK CONSTRAINT all" To switch them back on, run: (the print is optional of course and it is just listing the tables) -- enable all constraints exec sp_MSforeachtable @command1="...
How can foreign key constraints be temporarily disabled using T-SQL? Are disabling and enabling foreign key constraints supported in SQL Server? Or is my only option to drop and then re- create the constraints?
TITLE: How can foreign key constraints be temporarily disabled using T-SQL? QUESTION: Are disabling and enabling foreign key constraints supported in SQL Server? Or is my only option to drop and then re- create the constraints? ANSWER: If you want to disable all constraints in the database just run this code: -- disa...
[ "sql-server", "t-sql", "foreign-keys", "constraints" ]
924
1,242
760,342
17
0
2008-10-01T18:33:43.630000
2008-10-02T08:50:21.667000
159,039
160,019
Wasabi like web programming language
Are there any open source or commercial web programming language that function much like Fog Creek's Wasabi? As in you write your web app in this parent language and it then compiles down to php for Linux hosts and ASP.NET for Windows hosts.
Genexus is a commercial development tool that does that. It can generate several other languages. Its oriented toward database apps, it generates database schemas and queries from its internal language. That said, I have worked with it, and I don't like it. It's quite buggy and its programming language is very archaic.
Wasabi like web programming language Are there any open source or commercial web programming language that function much like Fog Creek's Wasabi? As in you write your web app in this parent language and it then compiles down to php for Linux hosts and ASP.NET for Windows hosts.
TITLE: Wasabi like web programming language QUESTION: Are there any open source or commercial web programming language that function much like Fog Creek's Wasabi? As in you write your web app in this parent language and it then compiles down to php for Linux hosts and ASP.NET for Windows hosts. ANSWER: Genexus is a c...
[ "programming-languages" ]
3
1
1,056
6
0
2008-10-01T18:33:56.673000
2008-10-01T22:17:44.060000
159,059
219,739
What is the correct term for the documentation that we put just above a method declaration?
I'm writing a whitepaper and realized that I am not sure what the official term is for the kind of internal documentation that we put as a comment block before a declaration of definition. The same thing that eventually becomes JavaDoc member documentation. It's not simply internal documentation, and I'm not sure "head...
This is called a method specification or procedure specification. That is, it specifies the behaviour of the procedure rather than the implementation details. Some text books refer to it as the contract of the method but that may be a bit ambiguous.
What is the correct term for the documentation that we put just above a method declaration? I'm writing a whitepaper and realized that I am not sure what the official term is for the kind of internal documentation that we put as a comment block before a declaration of definition. The same thing that eventually becomes ...
TITLE: What is the correct term for the documentation that we put just above a method declaration? QUESTION: I'm writing a whitepaper and realized that I am not sure what the official term is for the kind of internal documentation that we put as a comment block before a declaration of definition. The same thing that e...
[ "oop", "terminology", "javadoc" ]
1
4
228
6
0
2008-10-01T18:36:41.580000
2008-10-20T20:15:42.563000
159,076
159,083
Windows services with windows forms in the same process
I have a c# application that runs as a windows service controlling socket connections and other things. Also, there is another windows forms application to control and configure this service (systray with start, stop, show form with configuration parameters). I'm using.net remoting to do the IPC and that was fine, but ...
Two separate processes that communicate using your technology of choice. Services with UI is a bad idea. Don't go down this road - you'll regret it. I've had very good results having service communication through a simple socket connection - document your service protocol well, keep it as simple as possible, and it'll ...
Windows services with windows forms in the same process I have a c# application that runs as a windows service controlling socket connections and other things. Also, there is another windows forms application to control and configure this service (systray with start, stop, show form with configuration parameters). I'm ...
TITLE: Windows services with windows forms in the same process QUESTION: I have a c# application that runs as a windows service controlling socket connections and other things. Also, there is another windows forms application to control and configure this service (systray with start, stop, show form with configuration...
[ "c#", "windows", "windows-services" ]
6
19
20,007
8
0
2008-10-01T18:38:42.417000
2008-10-01T18:40:03.863000
159,087
160,085
Composite primary keys versus unique object ID field
I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should never be used as a primary key. Because I was building a Rails front-end for this database, I ran into difficulties getting it to conform to...
Most of the commonly used engines (MS SQL Server, Oracle, DB2, MySQL, etc.) would not experience noticeable issues using a surrogate key system. Some may even experience a performance boost from the use of a surrogate, but performance issues are highly platform-specific. In general terms, the natural key (and by extens...
Composite primary keys versus unique object ID field I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should never be used as a primary key. Because I was building a Rails front-end for this datab...
TITLE: Composite primary keys versus unique object ID field QUESTION: I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should never be used as a primary key. Because I was building a Rails front-...
[ "ruby-on-rails", "database", "design-patterns", "database-design" ]
71
91
21,524
15
0
2008-10-01T18:40:33.473000
2008-10-01T22:38:55.007000
159,088
159,284
DependencyProperty and DataBinding?
In WPF: Can someone please explain the relationship between DependencyProperty and Databinding? I have a property in my code behind I want to be the source of my databinding. When does a DependencyProperty (or does it) come into play if I want to bind this object to textboxes on the XAML.
The target in a binding must always be a DependencyProperty, but any property (even plain properties) can be the source. The problem with plain properties is that the binding will only pick up the value once and it won't change after that because change notification is missing from the plain source property. To provide...
DependencyProperty and DataBinding? In WPF: Can someone please explain the relationship between DependencyProperty and Databinding? I have a property in my code behind I want to be the source of my databinding. When does a DependencyProperty (or does it) come into play if I want to bind this object to textboxes on the ...
TITLE: DependencyProperty and DataBinding? QUESTION: In WPF: Can someone please explain the relationship between DependencyProperty and Databinding? I have a property in my code behind I want to be the source of my databinding. When does a DependencyProperty (or does it) come into play if I want to bind this object to...
[ "wpf", "data-binding" ]
7
14
1,955
2
0
2008-10-01T18:40:42.130000
2008-10-01T19:24:52.337000
159,097
159,203
Issue with XDocument and the BOM (Byte Order Mark)
Is there any way to output the contents of an XDocument without the BOM? When reading the output with Flash, it causes errors.
If you're writing the XML with an XmlWriter, you can set the Encoding to one that has been initialized to leave out the BOM. EG: System.Text.UTF8Encoding's constructor takes a boolean to specify whether you want the BOM, so: XmlWriter writer = XmlWriter.Create("foo.xml"); writer.Settings.Encoding = new System.Text.UTF8...
Issue with XDocument and the BOM (Byte Order Mark) Is there any way to output the contents of an XDocument without the BOM? When reading the output with Flash, it causes errors.
TITLE: Issue with XDocument and the BOM (Byte Order Mark) QUESTION: Is there any way to output the contents of an XDocument without the BOM? When reading the output with Flash, it causes errors. ANSWER: If you're writing the XML with an XmlWriter, you can set the Encoding to one that has been initialized to leave out...
[ ".net", "xml", "linq-to-xml" ]
5
9
3,315
7
0
2008-10-01T18:42:41.893000
2008-10-01T19:07:26.920000
159,114
159,120
Which Type of Input is Least Vulnerable to Attack?
Which type of input is least vulnerable to Cross-Site Scripting (XSS) and SQL Injection attacks. PHP, HTML, BBCode, etc. I need to know for a forum I'm helping a friend set up.
We need to know more about your situation. Vulnerable how? Some things you should always do: Escape strings before storing them in a database to guard against SQL injections HTML encode strings when printing them back to the user from an unknown source, to prevent malicious html/javascript I would never execute php pro...
Which Type of Input is Least Vulnerable to Attack? Which type of input is least vulnerable to Cross-Site Scripting (XSS) and SQL Injection attacks. PHP, HTML, BBCode, etc. I need to know for a forum I'm helping a friend set up.
TITLE: Which Type of Input is Least Vulnerable to Attack? QUESTION: Which type of input is least vulnerable to Cross-Site Scripting (XSS) and SQL Injection attacks. PHP, HTML, BBCode, etc. I need to know for a forum I'm helping a friend set up. ANSWER: We need to know more about your situation. Vulnerable how? Some t...
[ "php", "html", "forum", "bbcode", "security" ]
1
3
552
7
0
2008-10-01T18:47:30.773000
2008-10-01T18:48:35.030000
159,118
159,139
How do I match any character across multiple lines in a regular expression?
For example, this regex (.*) will match: abcde But how do I get it to match across multiple lines? abcde fghij
It depends on the language, but there should be a modifier that you can add to the regex pattern. In PHP it is: /(.*) /s The s at the end causes the dot to match all characters including newlines.
How do I match any character across multiple lines in a regular expression? For example, this regex (.*) will match: abcde But how do I get it to match across multiple lines? abcde fghij
TITLE: How do I match any character across multiple lines in a regular expression? QUESTION: For example, this regex (.*) will match: abcde But how do I get it to match across multiple lines? abcde fghij ANSWER: It depends on the language, but there should be a modifier that you can add to the regex pattern. In PHP i...
[ "regex", "multiline" ]
611
307
1,021,901
26
0
2008-10-01T18:48:22.160000
2008-10-01T18:52:18.033000
159,135
160,858
DLL versions and Visual Studio attach to process
I'm trying to use VS's attach to process tool to debug add-ins I'm developing for Sql Server Reporting Services. I am able to correctly debug it with attach to process when I copy dll's and pdb's in my project debug/bin dir to the ReportServer/bin dir. But, if I use my msbuild script and copy those dlls and pdbs to the...
I don't know anything about Sql Server Reporting Services, but 1) you can inspect the version of a DLL with ildasm.exe 2) when you use VS 'attach to process', in the 'Modules' window it shows the version numbers of all the loaded assemblies
DLL versions and Visual Studio attach to process I'm trying to use VS's attach to process tool to debug add-ins I'm developing for Sql Server Reporting Services. I am able to correctly debug it with attach to process when I copy dll's and pdb's in my project debug/bin dir to the ReportServer/bin dir. But, if I use my m...
TITLE: DLL versions and Visual Studio attach to process QUESTION: I'm trying to use VS's attach to process tool to debug add-ins I'm developing for Sql Server Reporting Services. I am able to correctly debug it with attach to process when I copy dll's and pdb's in my project debug/bin dir to the ReportServer/bin dir. ...
[ "visual-studio", "dll", "reporting-services" ]
0
2
2,026
1
0
2008-10-01T18:51:24.243000
2008-10-02T04:13:30.023000
159,137
159,195
Getting MAC Address
I need a cross platform method of determining the MAC address of a computer at run time. For windows the 'wmi' module can be used and the only method under Linux I could find was to run ifconfig and run a regex across its output. I don't like using a package that only works on one OS, and parsing the output of another ...
Python 2.5 includes an uuid implementation which (in at least one version) needs the mac address. You can import the mac finding function into your own code easily: from uuid import getnode as get_mac mac = get_mac() The return value is the mac address as 48 bit integer.
Getting MAC Address I need a cross platform method of determining the MAC address of a computer at run time. For windows the 'wmi' module can be used and the only method under Linux I could find was to run ifconfig and run a regex across its output. I don't like using a package that only works on one OS, and parsing th...
TITLE: Getting MAC Address QUESTION: I need a cross platform method of determining the MAC address of a computer at run time. For windows the 'wmi' module can be used and the only method under Linux I could find was to run ifconfig and run a regex across its output. I don't like using a package that only works on one ...
[ "python", "windows", "linux", "networking" ]
137
191
203,443
17
0
2008-10-01T18:51:36.880000
2008-10-01T19:06:30.667000
159,138
159,160
Branch Current changes then "rollback" in TFS
I have a specific changeset that I want to "rollback" my Development branch to, but I want to take all of the the changes after that specific changeset and put them in to a new branch. Is this possible in TFS? If so, how could I do such a thing? Thanks, Dave
Well.. The easiest way is to do exactly what you just said. Branch the existing code into a new spot. Then get the changeset you want, checkout the project, and check the changeset back in.
Branch Current changes then "rollback" in TFS I have a specific changeset that I want to "rollback" my Development branch to, but I want to take all of the the changes after that specific changeset and put them in to a new branch. Is this possible in TFS? If so, how could I do such a thing? Thanks, Dave
TITLE: Branch Current changes then "rollback" in TFS QUESTION: I have a specific changeset that I want to "rollback" my Development branch to, but I want to take all of the the changes after that specific changeset and put them in to a new branch. Is this possible in TFS? If so, how could I do such a thing? Thanks, Da...
[ "version-control", "tfs" ]
2
2
1,300
3
0
2008-10-01T18:51:42.260000
2008-10-01T18:59:27.327000
159,148
159,270
Groovy executing shell commands
Groovy adds the execute method to String to make executing shells fairly easy; println "ls".execute().text but if an error happens, then there is no resulting output. Is there an easy way to get both the standard error and standard output? (other than creating a bunch of code to create two threads to read both inputstr...
Ok, solved it myself; def sout = new StringBuilder(), serr = new StringBuilder() def proc = 'ls /badDir'.execute() proc.consumeProcessOutput(sout, serr) proc.waitForOrKill(1000) println "out> $sout\nerr> $serr" displays: out> err> ls: cannot access /badDir: No such file or directory
Groovy executing shell commands Groovy adds the execute method to String to make executing shells fairly easy; println "ls".execute().text but if an error happens, then there is no resulting output. Is there an easy way to get both the standard error and standard output? (other than creating a bunch of code to create t...
TITLE: Groovy executing shell commands QUESTION: Groovy adds the execute method to String to make executing shells fairly easy; println "ls".execute().text but if an error happens, then there is no resulting output. Is there an easy way to get both the standard error and standard output? (other than creating a bunch o...
[ "groovy" ]
223
292
417,122
8
0
2008-10-01T18:54:39.320000
2008-10-01T19:20:26.123000
159,152
159,467
Check out from a remote SVN repository TO a remote location?
Is there a way with SVN to check out from a remote repository to another remote location rather than my local file system? Something like: svn co http://myrepository/svn/project ssh me@otherlocation.net:/var/www/project
I think you could do: ssh me@other.net 'svn co http://repository/svn/project /var/www/project' This takes advantage of the fact that ssh lets you execute a command remotely.
Check out from a remote SVN repository TO a remote location? Is there a way with SVN to check out from a remote repository to another remote location rather than my local file system? Something like: svn co http://myrepository/svn/project ssh me@otherlocation.net:/var/www/project
TITLE: Check out from a remote SVN repository TO a remote location? QUESTION: Is there a way with SVN to check out from a remote repository to another remote location rather than my local file system? Something like: svn co http://myrepository/svn/project ssh me@otherlocation.net:/var/www/project ANSWER: I think you ...
[ "svn", "ssh" ]
3
6
3,544
3
0
2008-10-01T18:56:19.817000
2008-10-01T20:07:17.650000
159,173
416,736
What's the difference between DTCPing and DTCTester?
I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two? From what I can tell so far, DTCPing needs to run on both client and server machines, whereas DTCTester only needs to run from the client. Are there any other...
Testing DTC settings is very common when installing BizTalk Server, so from the BTS documentation, so - from http://msdn.microsoft.com/en-us/library/aa561924.aspx Use the DTCTester utility to verify transaction support between two computers if SQL Server is installed on one of the computers. The DTCTester utility uses ...
What's the difference between DTCPing and DTCTester? I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two? From what I can tell so far, DTCPing needs to run on both client and server machines, whereas DTCTester o...
TITLE: What's the difference between DTCPing and DTCTester? QUESTION: I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two? From what I can tell so far, DTCPing needs to run on both client and server machines, w...
[ "windows", "transactions", "msdtc" ]
7
7
11,657
2
0
2008-10-01T19:03:03.047000
2009-01-06T14:30:34.800000
159,183
159,361
How do you convert pixels to printed inches in JavaScript?
I want to resize the font of a SPAN element's style until it the SPAN's text is 7.5 inches wide when printed out on paper, but JavaScript only reports the SPAN's clientWidth property in pixels. 123456 And then: #test { font-size:1.2in; /* adjust this for yourself until printout measures 7.5in wide */ } And then: consol...
I think this does what you want. But I agree with the other posters, HTML isn't really suited for this sort of thing. Anyway, hope you find this useful. Untitled Document test resize text
How do you convert pixels to printed inches in JavaScript? I want to resize the font of a SPAN element's style until it the SPAN's text is 7.5 inches wide when printed out on paper, but JavaScript only reports the SPAN's clientWidth property in pixels. 123456 And then: #test { font-size:1.2in; /* adjust this for yourse...
TITLE: How do you convert pixels to printed inches in JavaScript? QUESTION: I want to resize the font of a SPAN element's style until it the SPAN's text is 7.5 inches wide when printed out on paper, but JavaScript only reports the SPAN's clientWidth property in pixels. 123456 And then: #test { font-size:1.2in; /* adju...
[ "javascript", "css", "printing" ]
4
2
9,733
9
0
2008-10-01T19:05:03.447000
2008-10-01T19:42:28.613000
159,190
439,165
Eclipse RCP Toolbar buttons with the Eclipse Look
In Eclipse, its easy to specify buttons for your toolbar using the ActionSets extension point. However, when I need to specify some items programmatically, I can't get the same look. I don't believe that the framework is using native buttons for these, but so far, I can't find the right recipe to match the Eclipse look...
It's difficult to tell from your question, but it sounds like you may be attempting to add a ControlContribution to the toolbar and returning a Button. This would make the button on the toolbar appear like a native button like you seem to be describing. This would look something like this: IToolBarManager toolBarManage...
Eclipse RCP Toolbar buttons with the Eclipse Look In Eclipse, its easy to specify buttons for your toolbar using the ActionSets extension point. However, when I need to specify some items programmatically, I can't get the same look. I don't believe that the framework is using native buttons for these, but so far, I can...
TITLE: Eclipse RCP Toolbar buttons with the Eclipse Look QUESTION: In Eclipse, its easy to specify buttons for your toolbar using the ActionSets extension point. However, when I need to specify some items programmatically, I can't get the same look. I don't believe that the framework is using native buttons for these,...
[ "java", "eclipse", "swt", "rcp" ]
1
6
7,432
2
0
2008-10-01T19:05:47.843000
2009-01-13T14:43:47.197000
159,227
436,777
Can anyone recommend a good reference for setting up Hibernate3 with Eclipse?
I've looked at some of the Eclipse and Hibernate tutorials and the ones for Hibernate2 are pretty good, pretty intuitive. Recently I tried to setup Hibernate3, using the Eclipse plugin, and failed to get the Hibernate tools to work, outside of physically moving the jar files from the plugins directory to my lib directo...
I'm not sure if you are still needing an answer to your question, but our very own stackoverflow website has probably the solution you are looking for. If that doesn't fully answer your question, then this might do the trick: "Hibernate and Eclipse Integration. from the linked Hibernate website: In the MANIFEST.MF file...
Can anyone recommend a good reference for setting up Hibernate3 with Eclipse? I've looked at some of the Eclipse and Hibernate tutorials and the ones for Hibernate2 are pretty good, pretty intuitive. Recently I tried to setup Hibernate3, using the Eclipse plugin, and failed to get the Hibernate tools to work, outside o...
TITLE: Can anyone recommend a good reference for setting up Hibernate3 with Eclipse? QUESTION: I've looked at some of the Eclipse and Hibernate tutorials and the ones for Hibernate2 are pretty good, pretty intuitive. Recently I tried to setup Hibernate3, using the Eclipse plugin, and failed to get the Hibernate tools ...
[ "eclipse", "hibernate" ]
2
4
2,655
1
0
2008-10-01T19:11:53.680000
2009-01-12T19:53:46.340000
159,237
159,246
Visual Studio 2008: is there any way to turn on the Class Name/Method Name drop downs in C#? (like VB.Net has)
I'm working in.Net 3.5sp1 in C# for an ASP.Net solution and I'm wondering if there's any way to turn on the Class Name and Method Name drop-downs in the text editor that VB.Net has at the top. It's one of the few things from VB that I actually miss. Edit: Also, is there any way to get the drop downs to be populated wit...
Go To: Tools -> Options -> Text Editor -> C# -> General -> Navigation Bar Make sure it is clicked, and that should show something at the top of your code that has all the classes and methods listed in your file.
Visual Studio 2008: is there any way to turn on the Class Name/Method Name drop downs in C#? (like VB.Net has) I'm working in.Net 3.5sp1 in C# for an ASP.Net solution and I'm wondering if there's any way to turn on the Class Name and Method Name drop-downs in the text editor that VB.Net has at the top. It's one of the ...
TITLE: Visual Studio 2008: is there any way to turn on the Class Name/Method Name drop downs in C#? (like VB.Net has) QUESTION: I'm working in.Net 3.5sp1 in C# for an ASP.Net solution and I'm wondering if there's any way to turn on the Class Name and Method Name drop-downs in the text editor that VB.Net has at the top...
[ "c#", "vb.net", "visual-studio-2008" ]
1
4
573
4
0
2008-10-01T19:13:16.407000
2008-10-01T19:16:07.867000
159,242
159,458
.net framework version req'd for MS Sync Framework
Can anyone tell me what version of the.NET framework (CLR and BCL) is req'd for the recently-released MS Sync Framework (for support of occasionally-connected-applications)? Its listed as Sync Framework V1 for ADO.NET v2.0 but none of its listed req'ments say anything about the.NET fx version that is required to suppor...
Sync Services for ADO.NET 2.0 requires ADO.NET 2.0 on the server. Sync Services requires ADO.NET 2.0 for desktop clients or.NET Compact Framework 2.0 Service Pack 2 for device clients. So, you should have.net framework 2.0 or above.
.net framework version req'd for MS Sync Framework Can anyone tell me what version of the.NET framework (CLR and BCL) is req'd for the recently-released MS Sync Framework (for support of occasionally-connected-applications)? Its listed as Sync Framework V1 for ADO.NET v2.0 but none of its listed req'ments say anything ...
TITLE: .net framework version req'd for MS Sync Framework QUESTION: Can anyone tell me what version of the.NET framework (CLR and BCL) is req'd for the recently-released MS Sync Framework (for support of occasionally-connected-applications)? Its listed as Sync Framework V1 for ADO.NET v2.0 but none of its listed req'm...
[ ".net", "microsoft-sync-framework" ]
0
3
334
3
0
2008-10-01T19:15:15.793000
2008-10-01T20:04:25.660000
159,251
159,295
Pitch identification in Linux
Is there any free software tool or combination that allows me to identify the pitch of a recorded singing session? The idea is to display some kind of graph with the current pitch in a time line along with markers for the standard notes (C3, C#3, D, etc). I don't need pitch correction and I don't need it to be done in ...
Checkout Audacity. It came out of a project to do musical pitch analysis.
Pitch identification in Linux Is there any free software tool or combination that allows me to identify the pitch of a recorded singing session? The idea is to display some kind of graph with the current pitch in a time line along with markers for the standard notes (C3, C#3, D, etc). I don't need pitch correction and ...
TITLE: Pitch identification in Linux QUESTION: Is there any free software tool or combination that allows me to identify the pitch of a recorded singing session? The idea is to display some kind of graph with the current pitch in a time line along with markers for the standard notes (C3, C#3, D, etc). I don't need pit...
[ "linux", "audio", "pitch-tracking" ]
4
5
4,979
4
0
2008-10-01T19:16:35.290000
2008-10-01T19:27:32.720000
159,252
159,330
How do I perform an action after an UpdatePanel updates?
When I have a regular textbox in a UpdatePanel (not an ASP.NET control) with some JavaScript events on it, after the UpdatePanel updates my events are gone. Is there a way to re-attach my events after the update? (Preferably without putting my events inline).
You can use the endRequest event of the PageRequestManager class.
How do I perform an action after an UpdatePanel updates? When I have a regular textbox in a UpdatePanel (not an ASP.NET control) with some JavaScript events on it, after the UpdatePanel updates my events are gone. Is there a way to re-attach my events after the update? (Preferably without putting my events inline).
TITLE: How do I perform an action after an UpdatePanel updates? QUESTION: When I have a regular textbox in a UpdatePanel (not an ASP.NET control) with some JavaScript events on it, after the UpdatePanel updates my events are gone. Is there a way to re-attach my events after the update? (Preferably without putting my e...
[ "javascript", "asp.net-ajax", "updatepanel" ]
3
4
535
3
0
2008-10-01T19:16:48.847000
2008-10-01T19:36:32.717000
159,261
159,374
Cross Browser Flash Detection in Javascript
Does anyone have an example of script that can work reliably well across IE/Firefox to detect if the browser is capable of displaying embedded flash content. I say reliably because I know its not possible 100% of the time.
SWFObject is very reliable. I have used it without trouble for quite a while.
Cross Browser Flash Detection in Javascript Does anyone have an example of script that can work reliably well across IE/Firefox to detect if the browser is capable of displaying embedded flash content. I say reliably because I know its not possible 100% of the time.
TITLE: Cross Browser Flash Detection in Javascript QUESTION: Does anyone have an example of script that can work reliably well across IE/Firefox to detect if the browser is capable of displaying embedded flash content. I say reliably because I know its not possible 100% of the time. ANSWER: SWFObject is very reliable...
[ "javascript", "flash", "cross-browser" ]
97
94
105,531
16
0
2008-10-01T19:19:30.867000
2008-10-01T19:44:52.307000
159,262
161,041
Seeking a way to have a "Hover button" to expand a section
i have a flow panel that i'm adding extra items to it at runtime based on whether they have chosen to show all the items. that's all works fine; the expansion is controlled by a toolbar button. the trouble is we'd like the user to be able to move his mouse over the "+" sign to expand the section. initially i looked at ...
I always liked the approach used by the ModelMaker Code Explorer. For example, when you're adding a new method, some rarely-used stuff is displayed collapsed ('Options and Directives' in the image below). (source: 17slon.com ) When you hover over the text, you notice that it's actually a flat button. (Except that it's ...
Seeking a way to have a "Hover button" to expand a section i have a flow panel that i'm adding extra items to it at runtime based on whether they have chosen to show all the items. that's all works fine; the expansion is controlled by a toolbar button. the trouble is we'd like the user to be able to move his mouse over...
TITLE: Seeking a way to have a "Hover button" to expand a section QUESTION: i have a flow panel that i'm adding extra items to it at runtime based on whether they have chosen to show all the items. that's all works fine; the expansion is controlled by a toolbar button. the trouble is we'd like the user to be able to m...
[ "delphi", "components" ]
2
6
1,687
3
0
2008-10-01T19:19:49.417000
2008-10-02T05:56:21.960000
159,266
159,336
In Flash, how would I run an e4x statement when that statement is stored in a String?
So I have something like this: var xmlStatement:String = "xmlObject.node[3].@thisValue"; What mystery function do I have to use so that I can execute xmlStatement and get thisValue from that xmlObject? Like.... var attribute:String = mysteryFunction(xmlStatement); P.S. I know eval() works for actionscript2, I need the ...
Unfortunately this is not possible in ActionScript 3. This however might be a solution: http://blog.betabong.com/2008/09/23/e4x-string-parser/
In Flash, how would I run an e4x statement when that statement is stored in a String? So I have something like this: var xmlStatement:String = "xmlObject.node[3].@thisValue"; What mystery function do I have to use so that I can execute xmlStatement and get thisValue from that xmlObject? Like.... var attribute:String = ...
TITLE: In Flash, how would I run an e4x statement when that statement is stored in a String? QUESTION: So I have something like this: var xmlStatement:String = "xmlObject.node[3].@thisValue"; What mystery function do I have to use so that I can execute xmlStatement and get thisValue from that xmlObject? Like.... var a...
[ "apache-flex", "flash", "actionscript-3" ]
3
5
327
2
0
2008-10-01T19:20:09.807000
2008-10-01T19:37:34.180000
159,280
167,815
Do OCUnit and OCMock work on the iPhone SDK?
I simply could not make it work, and I am wondering if I am wasting my time, or if I am simply stupid! Sorry I don't have the exact error I have right now. But I just want to know if it work or not!
I don't know whether OCUnit works with iPhone, but there is an iPhoneUnitTesting framework available from Google Code.
Do OCUnit and OCMock work on the iPhone SDK? I simply could not make it work, and I am wondering if I am wasting my time, or if I am simply stupid! Sorry I don't have the exact error I have right now. But I just want to know if it work or not!
TITLE: Do OCUnit and OCMock work on the iPhone SDK? QUESTION: I simply could not make it work, and I am wondering if I am wasting my time, or if I am simply stupid! Sorry I don't have the exact error I have right now. But I just want to know if it work or not! ANSWER: I don't know whether OCUnit works with iPhone, bu...
[ "iphone", "objective-c", "cocoa", "unit-testing", "mocking" ]
19
17
9,209
9
0
2008-10-01T19:22:46.337000
2008-10-03T16:45:15.320000
159,296
159,323
How can I prevent a base constructor from being called by an inheritor in C#?
I've got a (poorly written) base class that I want to wrap in a proxy object. The base class resembles the following: public class BaseClass: SomeOtherBase { public BaseClass() {} public BaseClass(int someValue) {} //...more code, not important here } and, my proxy resembles: public BaseClassProxy: BaseClass { public...
If you do not explicitly call any constructor in the base class, the parameterless constructor will be called implicitly. There's no way around it, you cannot instantiate a class without a constructor being called.
How can I prevent a base constructor from being called by an inheritor in C#? I've got a (poorly written) base class that I want to wrap in a proxy object. The base class resembles the following: public class BaseClass: SomeOtherBase { public BaseClass() {} public BaseClass(int someValue) {} //...more code, not impor...
TITLE: How can I prevent a base constructor from being called by an inheritor in C#? QUESTION: I've got a (poorly written) base class that I want to wrap in a proxy object. The base class resembles the following: public class BaseClass: SomeOtherBase { public BaseClass() {} public BaseClass(int someValue) {} //...mo...
[ "c#", "oop", "inheritance", "proxy", "constructor" ]
31
26
34,712
13
0
2008-10-01T19:28:25.463000
2008-10-01T19:35:06.977000
159,298
162,265
How do you compile static pthread-win32 lib for x64?
It looks like some work has been done to make pthread-win32 work with x64, but there are no build instructions. I have tried simly building with the Visual Studio x64 Cross Tools Command Prompt, but when I try to link to the lib from an x64 application, it can't see any of the function exports. It seems like it is stil...
Until it's officially released, it looks like you have to check out the CVS head to get version 2.9 of the library. Version 2.9 has all the x64 patches, but you will still have problems if you try to compile the static library from the command line. The only workaround I know of is to use the DLLs instead of statically...
How do you compile static pthread-win32 lib for x64? It looks like some work has been done to make pthread-win32 work with x64, but there are no build instructions. I have tried simly building with the Visual Studio x64 Cross Tools Command Prompt, but when I try to link to the lib from an x64 application, it can't see ...
TITLE: How do you compile static pthread-win32 lib for x64? QUESTION: It looks like some work has been done to make pthread-win32 work with x64, but there are no build instructions. I have tried simly building with the Visual Studio x64 Cross Tools Command Prompt, but when I try to link to the lib from an x64 applicat...
[ "c++", "c", "windows", "64-bit", "pthreads" ]
5
2
15,860
7
0
2008-10-01T19:28:40.597000
2008-10-02T13:29:29.437000
159,313
163,167
Runtime callable wrapper (RCW) scope - process or application domain?
What is the scope of Runtime Callable Wrapper (RCW), when referencing unmanaged COM objects? According to the docs: The runtime creates exactly one RCW for each COM object, regardless of the number of references that exist on that object. If I had to "guess" - this explanation should mean "one per process", but is it r...
In managed, we have a per app domain cache mapping canonical IUnknowns back to RCWs. When an IUnknown enters the system (through a marshal call, through activation, as a return parameter from a method call, etc.), we check the cache to see if an RCW already exists for the COM object. If a mapping exists, a reference to...
Runtime callable wrapper (RCW) scope - process or application domain? What is the scope of Runtime Callable Wrapper (RCW), when referencing unmanaged COM objects? According to the docs: The runtime creates exactly one RCW for each COM object, regardless of the number of references that exist on that object. If I had to...
TITLE: Runtime callable wrapper (RCW) scope - process or application domain? QUESTION: What is the scope of Runtime Callable Wrapper (RCW), when referencing unmanaged COM objects? According to the docs: The runtime creates exactly one RCW for each COM object, regardless of the number of references that exist on that o...
[ ".net", "com", "interop", "marshalling", "appdomain" ]
6
3
2,896
3
0
2008-10-01T19:32:50.960000
2008-10-02T15:59:28.097000
159,339
159,385
C++ compile-time expression as an array size
I'm not sure if the term's actually "Array Addition". I'm trying to understand what does the following line do: int var[2 + 1] = {2, 1}; How is that different from int var[3]? I've been using Java for several years, so I'd appreciate if explained using Java-friendly words. Edit: Thousands of thanks to everyone who help...
It's not different. C++ allows expressions (even non-constant expressions) in the subscripts of array declarations (with some limitations; anything other than the initial subscript on a multi-dimensional array must be constant). int var[]; // illegal int var[] = {2,1}; // automatically sized to 2 int var[3] = {2,1}; //...
C++ compile-time expression as an array size I'm not sure if the term's actually "Array Addition". I'm trying to understand what does the following line do: int var[2 + 1] = {2, 1}; How is that different from int var[3]? I've been using Java for several years, so I'd appreciate if explained using Java-friendly words. E...
TITLE: C++ compile-time expression as an array size QUESTION: I'm not sure if the term's actually "Array Addition". I'm trying to understand what does the following line do: int var[2 + 1] = {2, 1}; How is that different from int var[3]? I've been using Java for several years, so I'd appreciate if explained using Java...
[ "c++", "arrays" ]
1
8
378
6
0
2008-10-01T19:38:08.937000
2008-10-01T19:46:39.087000
159,359
874,198
Why can't we declare var a = new List<string> at class level?
I know we cannot do this at class level but at method level we can always do this. var myList=new List // or something else like this This question came to my mind since wherever we declare variable like this. We always provide the type information at the RHS of the expression. So compiler doesn't need to do type guess...
There are technical issues with implementing this feature. The common cases seem simple but the tougher cases (e.g., fields referencing other fields in chains or cycles, expressions which contain anonymous types) are not. See Eric Lippert's blog for an in-depth explanation: Why no var on fields?
Why can't we declare var a = new List<string> at class level? I know we cannot do this at class level but at method level we can always do this. var myList=new List // or something else like this This question came to my mind since wherever we declare variable like this. We always provide the type information at the RH...
TITLE: Why can't we declare var a = new List<string> at class level? QUESTION: I know we cannot do this at class level but at method level we can always do this. var myList=new List // or something else like this This question came to my mind since wherever we declare variable like this. We always provide the type inf...
[ "c#" ]
5
6
3,334
5
0
2008-10-01T19:42:11.187000
2009-05-17T09:07:04.273000
159,362
159,412
Are standard .Net 2 dlls compatible with the silverlight 2.0 runtime?
If I avoid referencing assemblies that don't exist in the silverlight 2.0 runtime, will the.Net 2.0 library dlls I create with VS2008 work with silverlight without recompilation or other alteration?
No, you will still need to recompile against the Silverlight versions of the assemblies. You can add these files to a Silverlight Class Library project "as link", sharing the same file between both projects so you at least won't have to worry about getting out of sync.
Are standard .Net 2 dlls compatible with the silverlight 2.0 runtime? If I avoid referencing assemblies that don't exist in the silverlight 2.0 runtime, will the.Net 2.0 library dlls I create with VS2008 work with silverlight without recompilation or other alteration?
TITLE: Are standard .Net 2 dlls compatible with the silverlight 2.0 runtime? QUESTION: If I avoid referencing assemblies that don't exist in the silverlight 2.0 runtime, will the.Net 2.0 library dlls I create with VS2008 work with silverlight without recompilation or other alteration? ANSWER: No, you will still need ...
[ "silverlight", "compatibility" ]
3
3
272
2
0
2008-10-01T19:42:29.923000
2008-10-01T19:52:52.737000
159,391
159,575
ReportViewer Control and Ajax UpdatePanel
Did anyone of you ever find a way of getting the Microsoft Report Viewer Control (Web) to work from within an Ajax UpdatePanel?
The only way really is to create an iframe with the report in there iirc. However, this post here a guy claims he has a way to fix it with some code. albeit i havnt even tried this as I have never had a need to show any of my reports in an update panel. I tend to keep my reports external of any ajax apps, for example w...
ReportViewer Control and Ajax UpdatePanel Did anyone of you ever find a way of getting the Microsoft Report Viewer Control (Web) to work from within an Ajax UpdatePanel?
TITLE: ReportViewer Control and Ajax UpdatePanel QUESTION: Did anyone of you ever find a way of getting the Microsoft Report Viewer Control (Web) to work from within an Ajax UpdatePanel? ANSWER: The only way really is to create an iframe with the report in there iirc. However, this post here a guy claims he has a way...
[ "asp.net", "ajax", "updatepanel", "reportviewer" ]
4
3
14,199
5
0
2008-10-01T19:47:08.807000
2008-10-01T20:34:51.187000
159,393
159,452
How can I parse Apache's error log in PHP?
I want to create a script that parses or makes sense of apache's error log to see what the most recent error was. I was wondering if anyone out there has something that does this or has any ideas where to start?
There are a few things to consider first: Firstly, your PHP user may not have access to Apache's log files. Secondly, PHP and Apache aren't going to tell you where said log file is, Lastly, Apache log files can get quite large. However, if none of these apply, you can use the normal file reading commands to do it. The ...
How can I parse Apache's error log in PHP? I want to create a script that parses or makes sense of apache's error log to see what the most recent error was. I was wondering if anyone out there has something that does this or has any ideas where to start?
TITLE: How can I parse Apache's error log in PHP? QUESTION: I want to create a script that parses or makes sense of apache's error log to see what the most recent error was. I was wondering if anyone out there has something that does this or has any ideas where to start? ANSWER: There are a few things to consider fir...
[ "php", "apache", "error-log" ]
18
15
19,041
5
0
2008-10-01T19:47:13.517000
2008-10-01T20:03:01.433000
159,423
159,501
Awk scripting help - Logic Issue
I'm currently writing a simple.sh script to parse an Exim log file for strings matching " o' ". Currently, when viewing output.txt, all that is there is a 0 printed on every line(606 lines). I'm guessing my logic is wrong, as awk does not throw any errors. Here is my code(updated for concatenation and counter issues). ...
There is no real need for the grep here. Let awk select the matching lines for you (and fixing your concatenation bug as per ΤΖΩΤΖΙΟΥ): awk '/o'\''/ { line = "> "; for(i = 20; i <= 33; i++) { line = line " " $i; } print line; }' /var/log/exim/main.log > output.txt Of course, you end up needing some weird escaping if yo...
Awk scripting help - Logic Issue I'm currently writing a simple.sh script to parse an Exim log file for strings matching " o' ". Currently, when viewing output.txt, all that is there is a 0 printed on every line(606 lines). I'm guessing my logic is wrong, as awk does not throw any errors. Here is my code(updated for co...
TITLE: Awk scripting help - Logic Issue QUESTION: I'm currently writing a simple.sh script to parse an Exim log file for strings matching " o' ". Currently, when viewing output.txt, all that is there is a 0 printed on every line(606 lines). I'm guessing my logic is wrong, as awk does not throw any errors. Here is my c...
[ "scripting", "awk", "logic" ]
2
2
465
4
0
2008-10-01T19:55:43.637000
2008-10-01T20:17:17.860000
159,431
317,565
ReceivePayment Pending for Quickbooks XML and Merchant Services
In the Quickbooks SDK Manual, there is a section called "Using ReceivePayment for Credit Card Authorization and Capture". It reads... Using ReceivePayment for Credit Card Authorization and Capture If the company is subscribed to QBMS, you can record a ReceivePaymentAdd that is basically a pending transaction. That is, ...
I'm not quite sure what you mean... the way I would approach it is: Use the QBMS XML API to authorize the card Push the receive payment and authorization to QuickBooks When ready, use the QBMS API to charge the card Issue an ReceivePaymentMod to record the capture in QuickBooks As far as I know, there is no way to tell...
ReceivePayment Pending for Quickbooks XML and Merchant Services In the Quickbooks SDK Manual, there is a section called "Using ReceivePayment for Credit Card Authorization and Capture". It reads... Using ReceivePayment for Credit Card Authorization and Capture If the company is subscribed to QBMS, you can record a Rece...
TITLE: ReceivePayment Pending for Quickbooks XML and Merchant Services QUESTION: In the Quickbooks SDK Manual, there is a section called "Using ReceivePayment for Credit Card Authorization and Capture". It reads... Using ReceivePayment for Credit Card Authorization and Capture If the company is subscribed to QBMS, you...
[ "quickbooks", "qbxml" ]
0
1
1,018
1
0
2008-10-01T19:57:51.447000
2008-11-25T14:41:38.400000
159,442
159,462
What is the simplest way to convert char[] to/from tchar[] in C/C++(ms)?
This seems like a pretty softball question, but I always have a hard time looking up this function because there seem there are so many variations regarding the referencing of char and tchar.
MultiByteToWideChar but also see "A few of the gotchas of MultiByteToWideChar".
What is the simplest way to convert char[] to/from tchar[] in C/C++(ms)? This seems like a pretty softball question, but I always have a hard time looking up this function because there seem there are so many variations regarding the referencing of char and tchar.
TITLE: What is the simplest way to convert char[] to/from tchar[] in C/C++(ms)? QUESTION: This seems like a pretty softball question, but I always have a hard time looking up this function because there seem there are so many variations regarding the referencing of char and tchar. ANSWER: MultiByteToWideChar but also...
[ "c++", "c", "string", "char", "tchar" ]
18
7
47,139
8
0
2008-10-01T20:00:12.127000
2008-10-01T20:05:22.943000
159,456
159,803
Pivot Table and Concatenate Columns
I have a database in the following format: ID TYPE SUBTYPE COUNT MONTH 1 A Z 1 7/1/2008 1 A Z 3 7/1/2008 2 B C 2 7/2/2008 1 A Z 3 7/2/2008 Can I use SQL to convert it into this: ID A_Z B_C MONTH 1 4 0 7/1/2008 2 0 2 7/2/2008 1 0 3 7/2/2008 So, the TYPE, SUBTYPE are concatenated into new columns and COUNT is summed wher...
SQL Server 2005 offers a very useful PIVOT and UNPIVOT operator which allow you to make this code maintenance-free using PIVOT and some code generation/dynamic SQL /* CREATE TABLE [dbo].[stackoverflow_159456]( [ID] [int] NOT NULL, [TYPE] [char](1) NOT NULL, [SUBTYPE] [char](1) NOT NULL, [COUNT] [int] NOT NULL, [MONTH] ...
Pivot Table and Concatenate Columns I have a database in the following format: ID TYPE SUBTYPE COUNT MONTH 1 A Z 1 7/1/2008 1 A Z 3 7/1/2008 2 B C 2 7/2/2008 1 A Z 3 7/2/2008 Can I use SQL to convert it into this: ID A_Z B_C MONTH 1 4 0 7/1/2008 2 0 2 7/2/2008 1 0 3 7/2/2008 So, the TYPE, SUBTYPE are concatenated into ...
TITLE: Pivot Table and Concatenate Columns QUESTION: I have a database in the following format: ID TYPE SUBTYPE COUNT MONTH 1 A Z 1 7/1/2008 1 A Z 3 7/1/2008 2 B C 2 7/2/2008 1 A Z 3 7/2/2008 Can I use SQL to convert it into this: ID A_Z B_C MONTH 1 4 0 7/1/2008 2 0 2 7/2/2008 1 0 3 7/2/2008 So, the TYPE, SUBTYPE are ...
[ "sql", "sql-server", "database", "pivot" ]
15
33
24,003
2
0
2008-10-01T20:03:57.720000
2008-10-01T21:18:37.820000
159,459
160,526
Experiences and tips for programming with and for Amazon's cloud servers/apps/tools?
We're looking into developing a product that would use Amazon's cloud tools (EC2, SQS, etc), and I'm curious what tips/gotchas/pointers people that have used these technologies have. One tip/whatever per post, please.
The Elasticfox plug-in for Mozilla makes doing a lot of the EC2 stuff easier. It can be found at: Elasticfox Firefox Extension for Amazon EC2. This page has links specifically to download the Elasticfox plug-in and also the associated Sourceforge project. Well worth using...
Experiences and tips for programming with and for Amazon's cloud servers/apps/tools? We're looking into developing a product that would use Amazon's cloud tools (EC2, SQS, etc), and I'm curious what tips/gotchas/pointers people that have used these technologies have. One tip/whatever per post, please.
TITLE: Experiences and tips for programming with and for Amazon's cloud servers/apps/tools? QUESTION: We're looking into developing a product that would use Amazon's cloud tools (EC2, SQS, etc), and I'm curious what tips/gotchas/pointers people that have used these technologies have. One tip/whatever per post, please....
[ "amazon-s3", "amazon-ec2", "amazon-web-services", "cloud" ]
8
5
709
6
0
2008-10-01T20:04:35.923000
2008-10-02T01:47:18.127000
159,470
526,065
Reset Expander to default collapse behavior
I'm using an expander inside a Resizer (a ContentControl with a resize gripper), and it expands/collapses properly when the control initially comes up. Once I resize it, the Expander won't properly collapse, as documented below. I ran Snoop on my application, and I don't see any heights set on Expander or its constitue...
I haven't had a chance to mock up this particular issue since then, but I recently discovered that setting Height or Width to Double.NaN resets it to its default free-spirited behavior. Ironically, this was from reading the code of the Resizer control I was using in the first place.
Reset Expander to default collapse behavior I'm using an expander inside a Resizer (a ContentControl with a resize gripper), and it expands/collapses properly when the control initially comes up. Once I resize it, the Expander won't properly collapse, as documented below. I ran Snoop on my application, and I don't see ...
TITLE: Reset Expander to default collapse behavior QUESTION: I'm using an expander inside a Resizer (a ContentControl with a resize gripper), and it expands/collapses properly when the control initially comes up. Once I resize it, the Expander won't properly collapse, as documented below. I ran Snoop on my application...
[ "wpf", "expander" ]
2
1
6,253
3
0
2008-10-01T20:08:00.020000
2009-02-08T17:24:26.923000
159,487
159,500
Can not get CSS Sticky footer to work. What am I doing wrong?
Well, this is my first post here and really enjoying the site. I have a very basic (ugly as sin) site I have started and for some reason, I can not get the CSS Sticky footer to work for FireFox. IE works but FF shows it halfway up the page. The URL is http://dev.aipoker.co.uk I know I should be developing in FF and bug...
Try this one, it works well on Firefox. BTW, you should listen to Boagworld's podcast if you don't already. It's brilliant!:) Cheers.
Can not get CSS Sticky footer to work. What am I doing wrong? Well, this is my first post here and really enjoying the site. I have a very basic (ugly as sin) site I have started and for some reason, I can not get the CSS Sticky footer to work for FireFox. IE works but FF shows it halfway up the page. The URL is http:/...
TITLE: Can not get CSS Sticky footer to work. What am I doing wrong? QUESTION: Well, this is my first post here and really enjoying the site. I have a very basic (ugly as sin) site I have started and for some reason, I can not get the CSS Sticky footer to work for FireFox. IE works but FF shows it halfway up the page....
[ "css", "footer", "sticky" ]
4
3
6,883
4
0
2008-10-01T20:12:54.907000
2008-10-01T20:16:47.767000
159,491
159,553
Scriptaculous sortable matrix
I am trying to create a sortable image matrix, 5x5 using scriptaculous javascript library by I can't make it work. I am trying using a table but I am having trouble linking the into the Sortable object. Do you guys have any hint or documentation I can go through to create this? Thanks
Use floating DIVs, not tables. 1) Create a class in your stylesheet for your boxes..boxes { float:left; width:150px; height:150px; border:1px solid #cccccc } 2) Make a container for your boxes. and put the boxes inside....etc 3) Make your Sortable Sortable.create('container',{tag:'div'}) There is a demo of this type of...
Scriptaculous sortable matrix I am trying to create a sortable image matrix, 5x5 using scriptaculous javascript library by I can't make it work. I am trying using a table but I am having trouble linking the into the Sortable object. Do you guys have any hint or documentation I can go through to create this? Thanks
TITLE: Scriptaculous sortable matrix QUESTION: I am trying to create a sortable image matrix, 5x5 using scriptaculous javascript library by I can't make it work. I am trying using a table but I am having trouble linking the into the Sortable object. Do you guys have any hint or documentation I can go through to create...
[ "javascript", "sorting", "scriptaculous" ]
2
2
1,365
1
0
2008-10-01T20:14:43.433000
2008-10-01T20:29:51.620000
159,506
3,029,266
Setting the scrollbar position of a ListBox
Can I programatically set the position of a WPF ListBox's scrollbar? By default, I want it to go in the center.
To move the vertical scroll bar in a ListBox do the following: Name your list box (x:Name="myListBox") Add Loaded event for the Window (Loaded="Window_Loaded") Implement Loaded event using method: ScrollToVerticalOffset Here is a working sample: XAML: Zamboni Zamboni Zamboni Zamboni Zamboni Zamboni Zamboni Zamboni Zamb...
Setting the scrollbar position of a ListBox Can I programatically set the position of a WPF ListBox's scrollbar? By default, I want it to go in the center.
TITLE: Setting the scrollbar position of a ListBox QUESTION: Can I programatically set the position of a WPF ListBox's scrollbar? By default, I want it to go in the center. ANSWER: To move the vertical scroll bar in a ListBox do the following: Name your list box (x:Name="myListBox") Add Loaded event for the Window (L...
[ "wpf", "listbox", "scrollviewer" ]
10
7
22,522
5
0
2008-10-01T20:18:58.463000
2010-06-12T16:08:00.273000
159,512
161,507
What are the limitations of Loose XAML?
I have been experimenting with WPF and rendering strict XAML markup in a web browser, also known as Loose XAML (explained here and here ). It strikes me as mostly useful for displaying static content. However, it also appears possible to bind to an XML data provider. Loose XAML files are not compiled with an applicatio...
AFAIK it's impossible to define a connection string in XAML. So you can't access your SQL db. Note: It IS possible to databind to a webservice however using XmlDataProvider. So that could be a way you could send your data through... Edit: btw, I found this list of features of the Sandboxed environment, which your app i...
What are the limitations of Loose XAML? I have been experimenting with WPF and rendering strict XAML markup in a web browser, also known as Loose XAML (explained here and here ). It strikes me as mostly useful for displaying static content. However, it also appears possible to bind to an XML data provider. Loose XAML f...
TITLE: What are the limitations of Loose XAML? QUESTION: I have been experimenting with WPF and rendering strict XAML markup in a web browser, also known as Loose XAML (explained here and here ). It strikes me as mostly useful for displaying static content. However, it also appears possible to bind to an XML data prov...
[ ".net", "wpf", "data-binding", "xaml", "seo" ]
3
1
4,444
3
0
2008-10-01T20:20:07.010000
2008-10-02T09:29:57.003000
159,521
159,537
Text editor to open big (giant, huge, large) text files
I mean 100+ MB big; such text files can push the envelope of editors. I need to look through a large XML file, but cannot if the editor is buggy. Any suggestions?
Free read-only viewers: Large Text File Viewer (Windows) – Fully customizable theming (colors, fonts, word wrap, tab size). Supports horizontal and vertical split view. Also support file following and regex search. Very fast, simple, and has small executable size. klogg (Windows, macOS, Linux) – A maintained fork of gl...
Text editor to open big (giant, huge, large) text files I mean 100+ MB big; such text files can push the envelope of editors. I need to look through a large XML file, but cannot if the editor is buggy. Any suggestions?
TITLE: Text editor to open big (giant, huge, large) text files QUESTION: I mean 100+ MB big; such text files can push the envelope of editors. I need to look through a large XML file, but cannot if the editor is buggy. Any suggestions? ANSWER: Free read-only viewers: Large Text File Viewer (Windows) – Fully customiza...
[ "windows", "xml", "editor", "text-editor", "large-files" ]
1,022
1,647
2,086,462
2
0
2008-10-01T20:22:35.133000
2008-10-01T20:25:19.993000
159,523
159,538
Why do I get "Cannot redirect after HTTP headers have been sent" when I call Response.Redirect()?
When I call Response.Redirect(someUrl) I get the following HttpException: Cannot redirect after HTTP headers have been sent. Why do I get this? And how can I fix this issue?
According to the MSDN documentation for Response.Redirect(string url), it will throw an HttpException when "a redirection is attempted after the HTTP headers have been sent". Since Response.Redirect(string url) uses the Http "Location" response header ( http://en.wikipedia.org/wiki/HTTP_headers#Responses ), calling it ...
Why do I get "Cannot redirect after HTTP headers have been sent" when I call Response.Redirect()? When I call Response.Redirect(someUrl) I get the following HttpException: Cannot redirect after HTTP headers have been sent. Why do I get this? And how can I fix this issue?
TITLE: Why do I get "Cannot redirect after HTTP headers have been sent" when I call Response.Redirect()? QUESTION: When I call Response.Redirect(someUrl) I get the following HttpException: Cannot redirect after HTTP headers have been sent. Why do I get this? And how can I fix this issue? ANSWER: According to the MSDN...
[ "asp.net", "http-headers", "response.redirect", "httpexception" ]
93
128
145,744
16
0
2008-10-01T20:22:48.533000
2008-10-01T20:25:23.097000
159,547
159,550
Mahjong - Arrange tiles to ensure at least one path to victory, regardless of layout
Regardless of the layout being used for the tiles, is there any good way to divvy out the tiles so that you can guarantee the user that, at the beginning of the game, there exists at least one path to completing the puzzle and winning the game? Obviously, depending on the user's moves, they can cut themselves off from ...
Place all the tiles in reverse (ie layout out the board starting in the middle, working out) To tease the player further, you could do it visibly but at very high speed.
Mahjong - Arrange tiles to ensure at least one path to victory, regardless of layout Regardless of the layout being used for the tiles, is there any good way to divvy out the tiles so that you can guarantee the user that, at the beginning of the game, there exists at least one path to completing the puzzle and winning ...
TITLE: Mahjong - Arrange tiles to ensure at least one path to victory, regardless of layout QUESTION: Regardless of the layout being used for the tiles, is there any good way to divvy out the tiles so that you can guarantee the user that, at the beginning of the game, there exists at least one path to completing the p...
[ "algorithm", "mahjong" ]
10
20
7,599
8
0
2008-10-01T20:28:21.343000
2008-10-01T20:29:29.500000
159,549
161,133
Javascript Commands Only Executed When Unminimized
I want to log to the console when I'm using un-minimized JavaScript files. Comments are taken out already when I minimize JavaScript. I'm wondering if there's a way I can write a command that isn't commented out but will still be taken out when I minimize the JavaScript file.
If your goal is just to reduce the js size you can separate you logging functions into a separate file. In your "main" js add a function function doLogging(object){} then in your separate logging functions file replace the function with function doLogging(object){/*your logging code*/}; Just remember to include your ma...
Javascript Commands Only Executed When Unminimized I want to log to the console when I'm using un-minimized JavaScript files. Comments are taken out already when I minimize JavaScript. I'm wondering if there's a way I can write a command that isn't commented out but will still be taken out when I minimize the JavaScrip...
TITLE: Javascript Commands Only Executed When Unminimized QUESTION: I want to log to the console when I'm using un-minimized JavaScript files. Comments are taken out already when I minimize JavaScript. I'm wondering if there's a way I can write a command that isn't commented out but will still be taken out when I mini...
[ "javascript", "minimize" ]
0
1
308
3
0
2008-10-01T20:29:12.650000
2008-10-02T06:47:05.847000
159,567
159,760
SQL: parse the first, middle and last name from a fullname field
How do I parse the first, middle, and last name out of a fullname field with SQL? I need to try to match up on names that are not a direct match on full name. I'd like to be able to take the full name field and break it up into first, middle and last name. The data does not include any prefixes or suffixes. The middle ...
Here is a self-contained example, with easily manipulated test data. With this example, if you have a name with more than three parts, then all the "extra" stuff will get put in the LAST_NAME field. An exception is made for specific strings that are identified as "titles", such as "DR", "MRS", and "MR". If the middle n...
SQL: parse the first, middle and last name from a fullname field How do I parse the first, middle, and last name out of a fullname field with SQL? I need to try to match up on names that are not a direct match on full name. I'd like to be able to take the full name field and break it up into first, middle and last name...
TITLE: SQL: parse the first, middle and last name from a fullname field QUESTION: How do I parse the first, middle, and last name out of a fullname field with SQL? I need to try to match up on names that are not a direct match on full name. I'd like to be able to take the full name field and break it up into first, mi...
[ "sql", "sql-server", "t-sql", "parsing" ]
51
142
172,002
27
0
2008-10-01T20:32:30.787000
2008-10-01T21:08:45.503000
159,568
159,592
LINQ to XML for a small appliction can it replace a small database?
I am creating a small application that will be deployed on Window. The database will have less than 10 tables. Instead of installing a database on the client box is using XML documents for the database and LINQ going to cost in performance of queries, waiting for the XML file to be loaded and be written? If I use a dat...
You can use an embedded database like SQLite or the portable version of SQL server (can't remember what it's called), that way you can still use SQL and LINQ but you don't need to install a database server
LINQ to XML for a small appliction can it replace a small database? I am creating a small application that will be deployed on Window. The database will have less than 10 tables. Instead of installing a database on the client box is using XML documents for the database and LINQ going to cost in performance of queries, ...
TITLE: LINQ to XML for a small appliction can it replace a small database? QUESTION: I am creating a small application that will be deployed on Window. The database will have less than 10 tables. Instead of installing a database on the client box is using XML documents for the database and LINQ going to cost in perfor...
[ ".net", "linq", "linq-to-xml" ]
3
2
685
4
0
2008-10-01T20:33:10.643000
2008-10-01T20:39:26.887000
159,590
159,777
Way to go from recursion to iteration
I've used recursion quite a lot during my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems. So, sometime in the very far past I went to try and find if there existed any "pattern" or text-book way of transforming a common recursion ap...
Usually, I replace a recursive algorithm by an iterative algorithm by pushing the parameters that would normally be passed to the recursive function onto a stack. In fact, you are replacing the program stack by one of your own. var stack = []; stack.push(firstObject); // while not empty while (stack.length) { // Pop ...
Way to go from recursion to iteration I've used recursion quite a lot during my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems. So, sometime in the very far past I went to try and find if there existed any "pattern" or text-book way...
TITLE: Way to go from recursion to iteration QUESTION: I've used recursion quite a lot during my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems. So, sometime in the very far past I went to try and find if there existed any "pattern...
[ "recursion", "iteration", "language-agnostic", "computer-science", "theory" ]
452
419
197,979
21
0
2008-10-01T20:38:46.373000
2008-10-01T21:12:30.660000
159,598
159,679
Can't copy file with appropriate permissions using FileIOPermission
This snippet works well if I try to write in a user directory but as soon as I try to write in Program Files, it just executes silently and the file has not been copied (no exception). If I try to copy the file in C:\ or in C:\Windows I catch an UnauthorizedAccessException. Do you know another way to get the permission...
If you are running under Vista then the system just redirects writes to the program files folder, this is done so old program that keep their configuration in the program directory will continue to work when the user is not an Admin (or UAC is enabled). All you have to do is add a manifest to your program that specify ...
Can't copy file with appropriate permissions using FileIOPermission This snippet works well if I try to write in a user directory but as soon as I try to write in Program Files, it just executes silently and the file has not been copied (no exception). If I try to copy the file in C:\ or in C:\Windows I catch an Unauth...
TITLE: Can't copy file with appropriate permissions using FileIOPermission QUESTION: This snippet works well if I try to write in a user directory but as soon as I try to write in Program Files, it just executes silently and the file has not been copied (no exception). If I try to copy the file in C:\ or in C:\Windows...
[ "c#", "file", "permissions", "copy" ]
2
1
4,586
4
0
2008-10-01T20:41:20.610000
2008-10-01T20:53:23.873000
159,600
1,952,998
What is the best client side browser library to upload multiple files over http?
What is the best client side http library to upload multiple files? If it can handle directories that's a huge bonus. I'm looking for something that is open source or free. I'm looking for something like FTP, but that works over http, through the browser. Uploading multiple files through a normal HTML 4.x form is a bit...
Uploadify is also another great multiple file uploader. It was built off of SWFUpload and they added new features to it. Some of the features that I have found most helpful are: The user can upload all the files at once using ctrl + clicking on all of the files As the files are being downloaded a queue is displayed whi...
What is the best client side browser library to upload multiple files over http? What is the best client side http library to upload multiple files? If it can handle directories that's a huge bonus. I'm looking for something that is open source or free. I'm looking for something like FTP, but that works over http, thro...
TITLE: What is the best client side browser library to upload multiple files over http? QUESTION: What is the best client side http library to upload multiple files? If it can handle directories that's a huge bonus. I'm looking for something that is open source or free. I'm looking for something like FTP, but that wor...
[ "html", "file-upload", "uploading", "multifile-uploader" ]
14
9
5,917
7
0
2008-10-01T20:42:25.693000
2009-12-23T14:05:04.050000
159,615
161,151
DB2 CLI result output
When running command-line queries in MySQL you can optionally use ' \G ' as a statement terminator, and instead of the result set columns being listed horizontally across the screen, it will list each column vertically, which the corresponding data to the right. Is there a way to the same or a similar thing with the DB...
I don't think such an option is available with the DB2 command line client. See http://www.dbforums.com/showthread.php?t=708079 for some suggestions. For a more general set of information about the DB2 command line client you might check out the IBM DeveloperWorks article DB2's Command Line Processor and Scripting.
DB2 CLI result output When running command-line queries in MySQL you can optionally use ' \G ' as a statement terminator, and instead of the result set columns being listed horizontally across the screen, it will list each column vertically, which the corresponding data to the right. Is there a way to the same or a sim...
TITLE: DB2 CLI result output QUESTION: When running command-line queries in MySQL you can optionally use ' \G ' as a statement terminator, and instead of the result set columns being listed horizontally across the screen, it will list each column vertically, which the corresponding data to the right. Is there a way to...
[ "db2" ]
5
2
3,816
3
0
2008-10-01T20:44:43.143000
2008-10-02T06:55:40.227000
159,625
160,777
How do you implement a multiculture web application
I believe several of us have already worked on a project where not only the UI, but also data has to be supported in different languages. Such as - being able to provide and store a translation for what I'm writing here, for instance. What's more, I also believe several of us have some time-triggered events (such as wh...
Be very very cautious. From what you say about the i18n features you're trying to implement, I wonder if you're over-reaching. Notice that the big boy (e.g. eBay, amazon.com, yahoo, bbc) web applications actually deliver separate apps in each language they want to support. Each of these web applications do consume a co...
How do you implement a multiculture web application I believe several of us have already worked on a project where not only the UI, but also data has to be supported in different languages. Such as - being able to provide and store a translation for what I'm writing here, for instance. What's more, I also believe sever...
TITLE: How do you implement a multiculture web application QUESTION: I believe several of us have already worked on a project where not only the UI, but also data has to be supported in different languages. Such as - being able to provide and store a translation for what I'm writing here, for instance. What's more, I ...
[ "translation", "multilingual" ]
3
3
344
6
0
2008-10-01T20:46:10.973000
2008-10-02T03:28:46.917000
159,627
159,702
Keeping Visual Studio Projects on a Network Drive
We just did a move from storing all files locally to storing them on a network drive. The problem is that is where my Visual Studio projects are also stored now (no versioning system yet, working on that). I've heard of problems with doing this in the past, but never heard of a work-around. Is there a work around now? ...
While we do use Source Control, we do also run all our projects from Network Drives (not shared directories, private directories on network drives). The network drives are backed up nightly, and also use Volume Shadow Copy, so if you need to revert to something before it made it's way to SC, then you can. To get projec...
Keeping Visual Studio Projects on a Network Drive We just did a move from storing all files locally to storing them on a network drive. The problem is that is where my Visual Studio projects are also stored now (no versioning system yet, working on that). I've heard of problems with doing this in the past, but never he...
TITLE: Keeping Visual Studio Projects on a Network Drive QUESTION: We just did a move from storing all files locally to storing them on a network drive. The problem is that is where my Visual Studio projects are also stored now (no versioning system yet, working on that). I've heard of problems with doing this in the ...
[ "visual-studio", "network-drive" ]
47
35
66,231
15
0
2008-10-01T20:46:17.680000
2008-10-01T20:57:57.467000
159,633
159,655
linuXploit_crew hit my webserver
We run an old Windows NT Machine, fully patched running IIS4.0. Today we were hit by "linuXploit_crew", and they took down our websites for a minute or two. (luckily we were quick to notice a change on the websites and fix it within minutes of the attack). However -- After fixing the website, I'm left with trying to fi...
NT/IIS4 no longer get security updates. Any new exploits will remain unpatched. Time to upgrade. Once you've been "owned" enough to change your site, you can't necessarily trust your logs anymore- they could have been "cleaned" by the attacker.
linuXploit_crew hit my webserver We run an old Windows NT Machine, fully patched running IIS4.0. Today we were hit by "linuXploit_crew", and they took down our websites for a minute or two. (luckily we were quick to notice a change on the websites and fix it within minutes of the attack). However -- After fixing the we...
TITLE: linuXploit_crew hit my webserver QUESTION: We run an old Windows NT Machine, fully patched running IIS4.0. Today we were hit by "linuXploit_crew", and they took down our websites for a minute or two. (luckily we were quick to notice a change on the websites and fix it within minutes of the attack). However -- A...
[ "windows", "iis", "nt" ]
4
6
4,355
5
0
2008-10-01T20:46:51.640000
2008-10-01T20:49:18.563000
159,720
159,745
What is the naming convention in Python for variables and functions?
Coming from a C# background the naming convention for variables and methods are usually either camelCase or PascalCase: // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod() In Python, I have seen the above but I have also seen snake_case being used: # python example this_is_my_variable = 'a' def thi...
See Python PEP 8: Function and Variable Names: Function names should be lowercase, with words separated by underscores as necessary to improve readability. Variable names follow the same convention as function names. mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py ), t...
What is the naming convention in Python for variables and functions? Coming from a C# background the naming convention for variables and methods are usually either camelCase or PascalCase: // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod() In Python, I have seen the above but I have also seen snak...
TITLE: What is the naming convention in Python for variables and functions? QUESTION: Coming from a C# background the naming convention for variables and methods are usually either camelCase or PascalCase: // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod() In Python, I have seen the above but I h...
[ "python", "naming-conventions", "camelcasing", "pascalcasing", "snakecasing" ]
1,083
1,140
806,019
15
0
2008-10-01T21:01:16.757000
2008-10-01T21:05:24.187000
159,721
159,791
How to find oracle error codes that could result from a connection error?
I would like to handle an OracleException thrown when my network/database connection is interrupted, where can I find out what error codes I might can receive? I guess since we are talking about a connection interruption these would be technically TNS errors such as ORA-12560 "TNS:protocol adapter error." But I have no...
Take a look at Oracle Database Error Messages 11g Release 1 (11.1). And here are the search results for TNS errors.
How to find oracle error codes that could result from a connection error? I would like to handle an OracleException thrown when my network/database connection is interrupted, where can I find out what error codes I might can receive? I guess since we are talking about a connection interruption these would be technicall...
TITLE: How to find oracle error codes that could result from a connection error? QUESTION: I would like to handle an OracleException thrown when my network/database connection is interrupted, where can I find out what error codes I might can receive? I guess since we are talking about a connection interruption these w...
[ "oracle", "ora-12560" ]
1
2
6,750
3
0
2008-10-01T21:01:21.700000
2008-10-01T21:15:14.227000
159,744
204,306
Converting MS Word Documents to PDF in ASP.NET
Similar questions have been asked, but nothing exactly like mine, so here goes. We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server must convert the document to PDF and stream it do...
It's not exactly Open Source, but Aspose has a couple products which can do that, Aspose.Pdf.Kit Aspose.Pdf.Kit is a non-graphical PDF® document manipulation component that enables both.NET and Java developers to manage existing PDF files as well as manage form fields embedded within PDF files. Aspose.Pdf is perfect fo...
Converting MS Word Documents to PDF in ASP.NET Similar questions have been asked, but nothing exactly like mine, so here goes. We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server mu...
TITLE: Converting MS Word Documents to PDF in ASP.NET QUESTION: Similar questions have been asked, but nothing exactly like mine, so here goes. We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field me...
[ "asp.net", "pdf", "pdf-generation" ]
20
13
53,947
8
0
2008-10-01T21:05:21.317000
2008-10-15T10:53:40.173000
159,768
163,339
Using a subdomain to identify a client
I'm working on building a Silverlight application whereas we want to be able to have a client hit a url like: http://{client}.domain.com/ and login, where the {client} part is their business name. so for example, google's would be: http://google.domain.com/ What I was wondering was if anyone has been able, in silverlig...
Wouldn't it work to put the service on a specific subdomain itself, such as wcf.example.com, and then setup a cross domain policy file on the service to allow it to access it? As long as this would work you could just load the silverlight in the proper subdomain and then pass that subdomain to your service and let it d...
Using a subdomain to identify a client I'm working on building a Silverlight application whereas we want to be able to have a client hit a url like: http://{client}.domain.com/ and login, where the {client} part is their business name. so for example, google's would be: http://google.domain.com/ What I was wondering wa...
TITLE: Using a subdomain to identify a client QUESTION: I'm working on building a Silverlight application whereas we want to be able to have a client hit a url like: http://{client}.domain.com/ and login, where the {client} part is their business name. so for example, google's would be: http://google.domain.com/ What ...
[ "silverlight", "web-services", "subdomain" ]
0
0
914
6
0
2008-10-01T21:10:12.770000
2008-10-02T16:34:09.493000
159,769
159,779
Oracle ROWNUM pseudocolumn
I have a complex query with group by and order by clause and I need a sorted row number (1...2...(n-1)...n) returned with every row. Using a ROWNUM (value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregation) gives me a non-sorted list (4...567...123...
Is there a reason that you can't just do SELECT rownum, a.* FROM (< >) a
Oracle ROWNUM pseudocolumn I have a complex query with group by and order by clause and I need a sorted row number (1...2...(n-1)...n) returned with every row. Using a ROWNUM (value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregation) gives me a non...
TITLE: Oracle ROWNUM pseudocolumn QUESTION: I have a complex query with group by and order by clause and I need a sorted row number (1...2...(n-1)...n) returned with every row. Using a ROWNUM (value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregati...
[ "oracle", "rownum" ]
3
11
4,377
6
0
2008-10-01T21:10:13.753000
2008-10-01T21:12:49.880000
159,797
159,857
Is Ruby a functional language?
Wikipedia says Ruby is a functional language, but I'm not convinced. Why or why not?
I most definitely think you can use functional style in Ruby. One of the most critical aspects to be able to program in a functional style is if the language supports higher order functions... which Ruby does. That said, it's easy to program in Ruby in a non-functional style as well. Another key aspect of functional st...
Is Ruby a functional language? Wikipedia says Ruby is a functional language, but I'm not convinced. Why or why not?
TITLE: Is Ruby a functional language? QUESTION: Wikipedia says Ruby is a functional language, but I'm not convinced. Why or why not? ANSWER: I most definitely think you can use functional style in Ruby. One of the most critical aspects to be able to program in a functional style is if the language supports higher ord...
[ "ruby", "functional-programming" ]
93
30
26,269
12
0
2008-10-01T21:16:13.303000
2008-10-01T21:30:40.927000
159,799
160,966
VB.Net Automating MS Word for Spell Check Capabilities
An application currently in development has the requirements for using MS Word to perform spell check on certain textareas within the application. I currently have Office 2007 (which is the Office 12 com objects). My question is, if I add in the Office 12 objects what will happen on boxes which have Office 2003? This i...
We gave up on trying to use a dependency on Word, as both have differing versions installed or no Office installation at all! Instead opting for NetSpell.
VB.Net Automating MS Word for Spell Check Capabilities An application currently in development has the requirements for using MS Word to perform spell check on certain textareas within the application. I currently have Office 2007 (which is the Office 12 com objects). My question is, if I add in the Office 12 objects w...
TITLE: VB.Net Automating MS Word for Spell Check Capabilities QUESTION: An application currently in development has the requirements for using MS Word to perform spell check on certain textareas within the application. I currently have Office 2007 (which is the Office 12 com objects). My question is, if I add in the O...
[ "vb.net", "winforms", "office-2007", "office-automation" ]
1
1
3,291
5
0
2008-10-01T21:16:38.963000
2008-10-02T05:12:12.970000
159,802
159,809
Python Web Services
Elementree has become the accepted standard for interacting with xml. What is the prevalent web service/SOAP library in use today?
I'm not sure about an accepted standard, but I've found SOAPpy to be fairly straight-forward and useful library for handling SOAP-based web services. SOAPy is a SOAP/XML Schema Library for Python. Given either a WSDL or SDL document, SOAPy discovers the published API for a web service and exposes it to Python applicati...
Python Web Services Elementree has become the accepted standard for interacting with xml. What is the prevalent web service/SOAP library in use today?
TITLE: Python Web Services QUESTION: Elementree has become the accepted standard for interacting with xml. What is the prevalent web service/SOAP library in use today? ANSWER: I'm not sure about an accepted standard, but I've found SOAPpy to be fairly straight-forward and useful library for handling SOAP-based web se...
[ "python", "web-services" ]
3
1
1,244
3
0
2008-10-01T21:18:26.433000
2008-10-01T21:20:36.333000
159,821
351,109
How do I scroll a UITableView to a section that contains no rows?
In an app I'm working on, I have a plain style UITableView that can contain a section containing zero rows. I want to be able to scroll to this section using scrollToRowAtIndexPath:atScrollPosition:animated: but I get an error when I try to scroll to this section due to the lack of child rows. Apple's calendar applicat...
UPDATE: Looks like this bug is fixed in iOS 3.0. You can use the following NSIndexPath to scroll to a section containing 0 rows: [NSIndexPath indexPathForRow:NSNotFound inSection:section] I'll leave my original workaround here for anyone still maintaining a project using the 2.x SDK. Found a decent workaround: CGRect s...
How do I scroll a UITableView to a section that contains no rows? In an app I'm working on, I have a plain style UITableView that can contain a section containing zero rows. I want to be able to scroll to this section using scrollToRowAtIndexPath:atScrollPosition:animated: but I get an error when I try to scroll to thi...
TITLE: How do I scroll a UITableView to a section that contains no rows? QUESTION: In an app I'm working on, I have a plain style UITableView that can contain a section containing zero rows. I want to be able to scroll to this section using scrollToRowAtIndexPath:atScrollPosition:animated: but I get an error when I tr...
[ "iphone", "cocoa-touch", "scroll" ]
36
122
34,289
6
0
2008-10-01T21:21:57.127000
2008-12-08T22:07:18.607000
159,837
159,861
Determine logged on user on a remote Windows machine
Is there a way to determine who is logged on to a particular (remote) machine given the IP address (or the workstation name) of the machine? The machines in question are on an Active Directory Domain The user running the script probably won't have any special rights on either their local or the remote machine Operating...
PSloggedon from SysInternals will provide this from a batch file, however the user would require admin access on the remote machine. I doubt you can get this information without Administrator access.
Determine logged on user on a remote Windows machine Is there a way to determine who is logged on to a particular (remote) machine given the IP address (or the workstation name) of the machine? The machines in question are on an Active Directory Domain The user running the script probably won't have any special rights ...
TITLE: Determine logged on user on a remote Windows machine QUESTION: Is there a way to determine who is logged on to a particular (remote) machine given the IP address (or the workstation name) of the machine? The machines in question are on an Active Directory Domain The user running the script probably won't have a...
[ "windows", "administration" ]
1
3
5,564
3
0
2008-10-01T21:27:15.773000
2008-10-01T21:32:16.617000
159,846
180,587
UnsatisfiedLinkError: The specified procedure could not be found
I'm writing some JNI code in C++ to be called from an applet on Windows XP. I've been able to successfully run the applet and have the JNI library loaded and called, even going so far as having it call functions in other DLLs. I got this working by setting up the PATH system environment variable to include the director...
I figured out the problem. This was a doozy. The message "The specified procedure could not be found" for UnsatisfiedLinkError indicates that a function in the root dll or in a dependent dll could not be found. The most likely cause of this in a JNI situation is that the native JNI function is not exported correctly. B...
UnsatisfiedLinkError: The specified procedure could not be found I'm writing some JNI code in C++ to be called from an applet on Windows XP. I've been able to successfully run the applet and have the JNI library loaded and called, even going so far as having it call functions in other DLLs. I got this working by settin...
TITLE: UnsatisfiedLinkError: The specified procedure could not be found QUESTION: I'm writing some JNI code in C++ to be called from an applet on Windows XP. I've been able to successfully run the applet and have the JNI library loaded and called, even going so far as having it call functions in other DLLs. I got this...
[ "java", "java-native-interface" ]
13
19
30,835
6
0
2008-10-01T21:28:31.853000
2008-10-07T21:47:12.510000
159,853
160,028
subversion diff including new files
I have some local changes to an open source project which uses Subversion as its source control. (I do not have commit access on the original project repository.) My change adds a file, but this file is not included in the output of "svn diff". (It may be worth noting that the new file is a binary, not plain text.) How...
The fact that your file is binary is exactly why it is not displayed I'm afraid. Subversion's diff command only does textual diffs/patches (even though Subversion internally can handle binary file differences efficiently between versions).
subversion diff including new files I have some local changes to an open source project which uses Subversion as its source control. (I do not have commit access on the original project repository.) My change adds a file, but this file is not included in the output of "svn diff". (It may be worth noting that the new fi...
TITLE: subversion diff including new files QUESTION: I have some local changes to an open source project which uses Subversion as its source control. (I do not have commit access on the original project repository.) My change adds a file, but this file is not included in the output of "svn diff". (It may be worth noti...
[ "svn", "patch" ]
20
6
19,275
4
0
2008-10-01T21:30:04.440000
2008-10-01T22:20:27.923000
159,856
162,689
log4net Configuration Section for NUnit Test Project
I am running NUnit with the project named AssemblyTest.nunit. The test calls another assembly which uses the log4net assembly. This is using nunit version 2.4.3 with the.net 2.0 framework. In TestFixtureSetup I am calling log4net.Config.XmlConfigurator.Configure( ) and am getting the following error: System.Configurati...
Create a separate config file for log4net with root element log4net. In TestFixtureSetup create a FileInfo object for this config file and give it as argument to log4net.Config.XmlConfigurator.Configure( ).
log4net Configuration Section for NUnit Test Project I am running NUnit with the project named AssemblyTest.nunit. The test calls another assembly which uses the log4net assembly. This is using nunit version 2.4.3 with the.net 2.0 framework. In TestFixtureSetup I am calling log4net.Config.XmlConfigurator.Configure( ) a...
TITLE: log4net Configuration Section for NUnit Test Project QUESTION: I am running NUnit with the project named AssemblyTest.nunit. The test calls another assembly which uses the log4net assembly. This is using nunit version 2.4.3 with the.net 2.0 framework. In TestFixtureSetup I am calling log4net.Config.XmlConfigura...
[ ".net", "configuration", "nunit", "log4net" ]
6
4
9,574
3
0
2008-10-01T21:30:33.470000
2008-10-02T14:44:09.680000
159,862
159,882
How do I sort my code (by method name) in Visual Studio 2008?
Short of cutting and pasting, is there a way to sort the methods in my classes in Visual Studio 2008? I like orderly code.
You can use the Visual Studio 2005/2008 extension Regionerate for this.
How do I sort my code (by method name) in Visual Studio 2008? Short of cutting and pasting, is there a way to sort the methods in my classes in Visual Studio 2008? I like orderly code.
TITLE: How do I sort my code (by method name) in Visual Studio 2008? QUESTION: Short of cutting and pasting, is there a way to sort the methods in my classes in Visual Studio 2008? I like orderly code. ANSWER: You can use the Visual Studio 2005/2008 extension Regionerate for this.
[ "visual-studio" ]
11
10
9,207
5
0
2008-10-01T21:32:37.617000
2008-10-01T21:41:07.143000
159,864
275,954
Synchronized ListViews in .Net
I'm working on a control to tie together the view from one ListView to another so that when the master ListView is scrolled, the child ListView view is updated to match. So far I've been able to get the child ListViews to update their view when the master scrollbar buttons are clicked. The problem is that when clicking...
I wanted to do the same thing, and after searching around I found your code here, which helped, but of course didn't solve the problem. But after playing around with it, I have found a solution. The key came when I realized that since the scroll buttons work, that you can use that to make the slider work. In other word...
Synchronized ListViews in .Net I'm working on a control to tie together the view from one ListView to another so that when the master ListView is scrolled, the child ListView view is updated to match. So far I've been able to get the child ListViews to update their view when the master scrollbar buttons are clicked. Th...
TITLE: Synchronized ListViews in .Net QUESTION: I'm working on a control to tie together the view from one ListView to another so that when the master ListView is scrolled, the child ListView view is updated to match. So far I've been able to get the child ListViews to update their view when the master scrollbar butto...
[ "c#", ".net", "winforms", "winapi", "listview" ]
4
2
6,513
4
0
2008-10-01T21:32:46.600000
2008-11-09T14:18:13.797000
159,869
161,475
From SourceSafe to Team Foundation Server
Our team would like to move from the Visual SourceSafe (VSS) to the Team Foundation Server (TFS). I know that the TFS is much more than just a version control system, but for the first time I would like to use it this way. Currently our projects are organized within the single solution that consists of the shared part ...
TFS certainly has much more potential than just as a source repository, but it's quite understandable why you would want to migrate source control first. The migration utility of choice is generally VSSConverter.exe which allows you to map VSS paths to Team Project source control paths and is pretty well documented in ...
From SourceSafe to Team Foundation Server Our team would like to move from the Visual SourceSafe (VSS) to the Team Foundation Server (TFS). I know that the TFS is much more than just a version control system, but for the first time I would like to use it this way. Currently our projects are organized within the single ...
TITLE: From SourceSafe to Team Foundation Server QUESTION: Our team would like to move from the Visual SourceSafe (VSS) to the Team Foundation Server (TFS). I know that the TFS is much more than just a version control system, but for the first time I would like to use it this way. Currently our projects are organized ...
[ "tfs", "visual-sourcesafe", "tfs-migration" ]
12
9
8,760
4
0
2008-10-01T21:33:47.877000
2008-10-02T09:18:16.093000
159,881
160,476
Is there a way to make cffile.oldFileSize return a correct value?
When working with cffile in ColdFusion, after an upload of a file to a webserver, the cffile structure is created that is supposed to have a value in it called "oldFileSize". Every time I do an upload and examine that value, it has the new file's size, not the overwritten file's size. Is there some setting somewhere to...
If the oldfilesize attribute is not returning correctly, I would use nameconflict=unique to preserve the old file. Then, you can use cfdirectory to check the old filesize, and cffile action="delete" and action="rename" to replace the old file, so that you have essentially overwritten the old file, only manually. A bit ...
Is there a way to make cffile.oldFileSize return a correct value? When working with cffile in ColdFusion, after an upload of a file to a webserver, the cffile structure is created that is supposed to have a value in it called "oldFileSize". Every time I do an upload and examine that value, it has the new file's size, n...
TITLE: Is there a way to make cffile.oldFileSize return a correct value? QUESTION: When working with cffile in ColdFusion, after an upload of a file to a webserver, the cffile structure is created that is supposed to have a value in it called "oldFileSize". Every time I do an upload and examine that value, it has the ...
[ "coldfusion", "cffile" ]
2
2
248
3
0
2008-10-01T21:40:32.823000
2008-10-02T01:25:05.700000
159,886
160,138
Is it OK to put a database initialization call in a C# constructor?
I've seen this is various codebases, and wanted to know if this generally frowned upon or not. For example: public class MyClass { public int Id; public MyClass() { Id = new Database().GetIdFor(typeof(MyClass)); } }
There are several reasons this is not generally considered good design some of which like causing difficult unit testing and difficulty of handling errors have already been mentioned. The main reason I would choose not to do so is that your object and the data access layer are now very tightly coupled which means that ...
Is it OK to put a database initialization call in a C# constructor? I've seen this is various codebases, and wanted to know if this generally frowned upon or not. For example: public class MyClass { public int Id; public MyClass() { Id = new Database().GetIdFor(typeof(MyClass)); } }
TITLE: Is it OK to put a database initialization call in a C# constructor? QUESTION: I've seen this is various codebases, and wanted to know if this generally frowned upon or not. For example: public class MyClass { public int Id; public MyClass() { Id = new Database().GetIdFor(typeof(MyClass)); } } ANSWER: There ar...
[ "c#", "database", "constructor" ]
9
11
6,708
7
0
2008-10-01T21:42:17.063000
2008-10-01T22:54:47.123000
159,888
160,024
How to execute GetLastError() while debugging in Visual Studio
You're stepping through C/C++ code and have just called a Win32 API that has failed (typically by returning some unhelpful generic error code, like 0). Your code doesn't make a subsequent GetLastError() call whose return value you could inspect for further error information. How can you get the error value without reco...
As mentioned a couple times, the @err pseudo-register will show the last error value, and @err,hr will show the error as a string (if it can). According to Andy Pennell, a member of the Visual Studio team, starting with VS 7 (Visual Studio.NET 2002), using the '@' character to indicate pseudo-registers is deprecated - ...
How to execute GetLastError() while debugging in Visual Studio You're stepping through C/C++ code and have just called a Win32 API that has failed (typically by returning some unhelpful generic error code, like 0). Your code doesn't make a subsequent GetLastError() call whose return value you could inspect for further ...
TITLE: How to execute GetLastError() while debugging in Visual Studio QUESTION: You're stepping through C/C++ code and have just called a Win32 API that has failed (typically by returning some unhelpful generic error code, like 0). Your code doesn't make a subsequent GetLastError() call whose return value you could in...
[ "visual-studio", "debugging", "winapi" ]
56
76
26,476
3
0
2008-10-01T21:42:41.553000
2008-10-01T22:19:05.757000
159,889
160,015
How do I access SQLite database instance on iPhone?
I'm developing an iPhone app that uses the built-in SQLite database. I'm trying to view and open the database via the sqlite3 command line tool so I can execute arbitrary SQL against it. When I run my app in the simulator, the.sqlite file it creates is located at ~/Library/Application Support/iPhone Simulator/User/Appl...
In Xcode select window->organizer and expand the node next to your application in the applications section on your phone. Select the black downward pointing arrow next to application data and save the file anywhere on your desktop. Your sqlite database should be in there somewhere. As for how to go about getting it bac...
How do I access SQLite database instance on iPhone? I'm developing an iPhone app that uses the built-in SQLite database. I'm trying to view and open the database via the sqlite3 command line tool so I can execute arbitrary SQL against it. When I run my app in the simulator, the.sqlite file it creates is located at ~/Li...
TITLE: How do I access SQLite database instance on iPhone? QUESTION: I'm developing an iPhone app that uses the built-in SQLite database. I'm trying to view and open the database via the sqlite3 command line tool so I can execute arbitrary SQL against it. When I run my app in the simulator, the.sqlite file it creates ...
[ "ios", "iphone", "sqlite" ]
40
44
42,892
8
0
2008-10-01T21:42:50.617000
2008-10-01T22:16:03.627000
159,910
159,930
Determine if a program is running on a Remote Desktop
Is there a way my program can determine when it's running on a Remote Desktop (Terminal Services)? I'd like to enable an "inactivity timeout" on the program when it's running on a Remote Desktop session. Since users are notorious for leaving Remote Desktop sessions open, I want my program to terminate after a specified...
GetSystemMetrics(SM_REMOTESESSION) (as described in http://msdn.microsoft.com/en-us/library/aa380798.aspx )
Determine if a program is running on a Remote Desktop Is there a way my program can determine when it's running on a Remote Desktop (Terminal Services)? I'd like to enable an "inactivity timeout" on the program when it's running on a Remote Desktop session. Since users are notorious for leaving Remote Desktop sessions ...
TITLE: Determine if a program is running on a Remote Desktop QUESTION: Is there a way my program can determine when it's running on a Remote Desktop (Terminal Services)? I'd like to enable an "inactivity timeout" on the program when it's running on a Remote Desktop session. Since users are notorious for leaving Remote...
[ "windows", "terminal-services", "citrix" ]
24
20
18,619
3
0
2008-10-01T21:49:14.207000
2008-10-01T21:53:17.097000