PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
77,694
09/16/2008 22:02:57
8,450
09/15/2008 16:03:44
71
8
Drupal 6: How to quickly theme a view ?
I've defined a view with the cck and view modules. I would like now to quickly define a template specific to this view. Any tutorial or information on this ? What are the files I need to modify ?
drupal
view
cck
theme
php
null
open
Drupal 6: How to quickly theme a view ? === I've defined a view with the cck and view modules. I would like now to quickly define a template specific to this view. Any tutorial or information on this ? What are the files I need to modify ?
0
77,695
09/16/2008 22:02:59
9,532
09/15/2008 19:04:16
1
1
Local CPAN mirror
What do I need to setup and maintain a local CPAN mirror? What scripts and best practices should I be aware of?
perl
administration
cpan
null
null
null
open
Local CPAN mirror === What do I need to setup and maintain a local CPAN mirror? What scripts and best practices should I be aware of?
0
77,697
09/16/2008 22:03:27
479
08/06/2008 08:37:10
390
28
BugzScout in hosted Fogbugz
Is it possible to use BugzScout in the fogcreek-hosted version of Fogbugz?
fogbugz
null
null
null
null
null
open
BugzScout in hosted Fogbugz === Is it possible to use BugzScout in the fogcreek-hosted version of Fogbugz?
0
77,726
09/16/2008 22:05:27
1,147
08/12/2008 19:29:43
131
15
Xml or Sqlite, When to drop Xml for a Database?
I really like Xml for saving data, but when does sqlite/database become the better option? eg, when the xml has more than _x_ items or is greater than _y_ MB? I am coding an rss reader and I believe I made the wrong choice in using xml over a sqlite database to store a cache of _all_ the feeds items. There are some feeds which have an xml file of ~1mb after a month, another has over 700 items, while most only have ~30 items and are ~50kb in size after a _several_ months. I currently have no plans to implement a cap because I like to be able to search through everything. So, my questions are: 1. When is the overhead of sqlite/databases justified over using xml? 2. Are the **few large xml files** justification enough for the database when there are **a lot of small** ones, though even the small ones will grow over time? (a long _long_ time)
xml
database
null
null
null
05/05/2012 13:43:15
not constructive
Xml or Sqlite, When to drop Xml for a Database? === I really like Xml for saving data, but when does sqlite/database become the better option? eg, when the xml has more than _x_ items or is greater than _y_ MB? I am coding an rss reader and I believe I made the wrong choice in using xml over a sqlite database to store a cache of _all_ the feeds items. There are some feeds which have an xml file of ~1mb after a month, another has over 700 items, while most only have ~30 items and are ~50kb in size after a _several_ months. I currently have no plans to implement a cap because I like to be able to search through everything. So, my questions are: 1. When is the overhead of sqlite/databases justified over using xml? 2. Are the **few large xml files** justification enough for the database when there are **a lot of small** ones, though even the small ones will grow over time? (a long _long_ time)
4
77,731
09/16/2008 22:05:58
13,996
09/16/2008 21:39:20
1
2
iBATIS for Python?
At my current gig, we use iBATIS through Java to CRUD our databases. I like the abstract qualities of the tool, especially when working with legacy databases, as it doesn't impose its own syntax on you. **I'm looking for a Python analogue to this library**, since the website only has Java/.NET/Ruby versions available. I don't want to have to switch to Jython if I don't need to. Are there any other projects similar to iBATIS functionality out there for Python?
python
orm
ibatis
null
null
null
open
iBATIS for Python? === At my current gig, we use iBATIS through Java to CRUD our databases. I like the abstract qualities of the tool, especially when working with legacy databases, as it doesn't impose its own syntax on you. **I'm looking for a Python analogue to this library**, since the website only has Java/.NET/Ruby versions available. I don't want to have to switch to Jython if I don't need to. Are there any other projects similar to iBATIS functionality out there for Python?
0
77,744
09/16/2008 22:06:36
234
08/03/2008 20:25:38
4,634
244
How can I change the text color in the windows command prompt
I have a command line program, which outputs logging to the screen. I want error lines to show up in red. Is there some special character codes I can output to switch the text color to red, then switch it back to white? I'm using ruby but I imagine this would be the same in any other language. Something like: red = "\0123" # character code white = "\0223" print "#{red} ERROR: IT BROKE #{white}" print "other stuff"
windows
ruby
command-line
colors
null
null
open
How can I change the text color in the windows command prompt === I have a command line program, which outputs logging to the screen. I want error lines to show up in red. Is there some special character codes I can output to switch the text color to red, then switch it back to white? I'm using ruby but I imagine this would be the same in any other language. Something like: red = "\0123" # character code white = "\0223" print "#{red} ERROR: IT BROKE #{white}" print "other stuff"
0
77,748
09/16/2008 22:07:06
13,709
09/16/2008 20:34:36
1
0
Mongrel hangs with 100% CPU / EBADF (Bad file descriptor)
We have a server with 10 running mongrel_cluster instances with apache in front of them, and every now and then one or some of them hang. No activity is seen in the database (we're using activerecord sessions). Mysql with innodb tables. show innodb status shows no locks. show processlist shows nothing. The server is linux debian 4.0 Ruby is: ruby 1.8.6 (2008-03-03 patchlevel 114) [i486-linux] Rails is: Rails 1.1.2 (yes, quite old) We're using the native mysql connector (gem install mysql) "strace -p PID" gives the following in a loop for the hung mongrel process: gettimeofday({1219834026, 235289}, NULL) = 0 select(4, [3], [0], [], {0, 905241}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235477}, NULL) = 0 select(4, [3], [0], [], {0, 905053}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235654}, NULL) = 0 select(4, [3], [0], [], {0, 904875}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235829}, NULL) = 0 select(4, [3], [0], [], {0, 904700}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236017}, NULL) = 0 select(4, [3], [0], [], {0, 904513}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236192}, NULL) = 0 select(4, [3], [0], [], {0, 904338}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236367}, NULL) = 0 ... I used lsof and found that the process used 67 file descriptors (lsof -p PID |wc -l) Is there any other way I can debug this, so that I could for example determine which file descriptor is "bad"? Any other info or suggestions? Anybody else seen this? The site is fairly used, but not overly so, load averages usually around 0.3. --- Some additional info. I installed mongrelproctitle to show what the hung processes were doing, and it seems they are hanging on a method that displays images using file_column / images from the database / rmagick to resize and make the images greyscale. Not conclusive the problem is here, but it is a suspicion. Is there something obviously wrong with the following? The method displays a static image if the order doesn't contain an image, else the image resized from the order. The cache stuff is so that the image gets updated in the browser every time. The image is inserted in the page with a normal image tag. code: def preview_image @order = session[:order] if @order.image.nil? @headers['Pragma'] = 'no-cache' @headers['Cache-Control'] = 'no-cache, must-revalidate' send_data(EMPTY_PIC.to_blob, :filename => "img.jpg", :type => "image/jpeg", :disposition => "inline") else @pic = Image.read(@order.image)[0] if (@order.crop) @pic.crop!(@order.crop[:x1].to_i, @order.crop[:y1].to_i, @order.crop[:width].to_i, @order.crop[:height].to_i, true) end @pic.resize!(103,130) @pic = @pic.quantize(256, Magick::GRAYColorspace) @headers['Pragma'] = 'no-cache' @headers['Cache-Control'] = 'no-cache, must-revalidate' send_data(@pic.to_blob, :filename => "img.jpg", :type => "image/jpeg", :disposition => "inline") end end Here is the lsof output if anybody can find any problems in it. Don't know how it will format in this message... lsof: WARNING: can't stat() ext3 file system /dev/.static/dev Output information may be incomplete. COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME mongrel_r 11628 username cwd DIR 9,2 4096 1870688 /home/domains/example.com/usernameOrder/releases/20080831121802 mongrel_r 11628 username rtd DIR 9,1 4096 2 / mongrel_r 11628 username txt REG 9,1 3564 167172 /usr/bin/ruby1.8 mongrel_r 11628 username mem REG 0,0 0 [heap] (stat: No such file or directory) mongrel_r 11628 username DEL REG 0,8 15560245 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560242 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560602 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560601 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560684 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560683 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560685 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560568 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560607 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560569 /dev/zero mongrel_r 11628 username mem REG 9,1 1933648 456972 /usr/lib/libmysqlclient.so.15.0.0 mongrel_r 11628 username DEL REG 0,8 15442414 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560546 /dev/zero mongrel_r 11628 username mem REG 9,1 67408 457393 /lib/i686/cmov/libresolv-2.7.so mongrel_r 11628 username mem REG 9,1 17884 457386 /lib/i686/cmov/libnss_dns-2.7.so mongrel_r 11628 username DEL REG 0,8 15560541 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560246 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560693 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560608 /dev/zero mongrel_r 11628 username mem REG 9,1 25700 164963 /usr/lib/gconv/gconv-modules.cache mongrel_r 11628 username mem REG 9,1 83708 457384 /lib/i686/cmov/libnsl-2.7.so mongrel_r 11628 username mem REG 9,1 140602 506903 /var/lib/gems/1.8/gems/mysql-2.7/lib/mysql.so mongrel_r 11628 username mem REG 9,1 1282816 180935 /usr/lib/locale/locale-archive mongrel_r 11628 username mem REG 9,1 16672 167438 /usr/lib/libXdmcp.so.6.0.0 mongrel_r 11628 username mem REG 9,1 7220 167436 /usr/lib/libXau.so.6.0.0 mongrel_r 11628 username mem REG 9,1 434840 167477 /usr/lib/libfreetype.so.6.3.10 mongrel_r 11628 username mem REG 9,1 1147196 167011 /usr/lib/libxml2.so.2.6.27 mongrel_r 11628 username mem REG 9,1 66200 457138 /lib/libbz2.so.1.0.3 mongrel_r 11628 username mem REG 9,1 965952 167440 /usr/lib/libX11.so.6.2.0 mongrel_r 11628 username mem REG 9,1 85060 168009 /usr/lib/libICE.so.6.3.0 mongrel_r 11628 username mem REG 9,1 32144 168011 /usr/lib/libSM.so.6.0.0 mongrel_r 11628 username mem REG 9,1 320344 168013 /usr/lib/libXt.so.6.0.0 mongrel_r 11628 username mem REG 9,1 52848 168023 /usr/lib/libXext.so.6.4.0 mongrel_r 11628 username mem REG 9,1 137760 167484 /usr/lib/libpng12.so.0.15.0 mongrel_r 11628 username mem REG 9,1 127488 167481 /usr/lib/libjpeg.so.62.0.0 mongrel_r 11628 username mem REG 9,1 288776 168015 /usr/lib/libjasper-1.701.so.1.0.0 mongrel_r 11628 username mem REG 9,1 343712 168021 /usr/lib/libtiff.so.4.2.1 mongrel_r 11628 username mem REG 9,1 197880 168017 /usr/lib/liblcms.so.1.0.15 mongrel_r 11628 username mem REG 9,1 3637020 168025 /usr/lib/libMagick.so.9.0.0 mongrel_r 11628 username DEL REG 0,8 15560547 /dev/zero mongrel_r 11628 username mem REG 9,1 252348 217396 /usr/lib/ruby/1.8/i486-linux/RMagick.so mongrel_r 11628 username mem REG 9,1 38412 457387 /lib/i686/cmov/libnss_files-2.7.so mongrel_r 11628 username mem REG 9,1 195564 457011 /lib/libncurses.so.5.6 mongrel_r 11628 username mem REG 9,1 188760 457143 /lib/libreadline.so.5.2 mongrel_r 11628 username DEL REG 0,8 15560542 /dev/zero mongrel_r 11628 username mem REG 9,1 15312 214202 /usr/lib/ruby/1.8/i486-linux/readline.so mongrel_r 11628 username mem REG 9,1 12192 213239 /usr/lib/ruby/1.8/i486-linux/digest/sha1.so mongrel_r 11628 username mem REG 9,1 12868 213153 /usr/lib/ruby/1.8/i486-linux/iconv.so mongrel_r 11628 username mem REG 9,1 11744 213164 /usr/lib/ruby/1.8/i486-linux/racc/cparse.so mongrel_r 11628 username mem REG 9,1 236540 213151 /usr/lib/ruby/1.8/i486-linux/nkf.so mongrel_r 11628 username mem REG 9,1 6688 213237 /usr/lib/ruby/1.8/i486-linux/digest/md5.so mongrel_r 11628 username mem REG 9,1 15552 213160 /usr/lib/ruby/1.8/i486-linux/strscan.so mongrel_r 11628 username mem REG 9,1 31312 213245 /usr/lib/ruby/1.8/i486-linux/zlib.so mongrel_r 11628 username mem REG 9,1 12608 213243 /usr/lib/ruby/1.8/i486-linux/thread.so mongrel_r 11628 username mem REG 9,1 36325 360155 /var/lib/gems/1.8/gems/fastthread-1.0.1/lib/fastthread.so mongrel_r 11628 username mem REG 9,1 44423 347866 /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/http11.so mongrel_r 11628 username mem REG 9,1 38844 213246 /usr/lib/ruby/1.8/i486-linux/socket.so mongrel_r 11628 username mem REG 9,1 7840 213249 /usr/lib/ruby/1.8/i486-linux/etc.so mongrel_r 11628 username mem REG 9,1 109364 213241 /usr/lib/ruby/1.8/i486-linux/syck.so mongrel_r 11628 username mem REG 9,1 15888 213244 /usr/lib/ruby/1.8/i486-linux/stringio.so mongrel_r 11628 username mem REG 9,1 78500 163229 /usr/lib/libz.so.1.2.3 mongrel_r 11628 username mem REG 9,1 1338692 182762 /usr/lib/i686/cmov/libcrypto.so.0.9.8 mongrel_r 11628 username mem REG 9,1 278628 182763 /usr/lib/i686/cmov/libssl.so.0.9.8 mongrel_r 11628 username mem REG 9,1 3820 213247 /usr/lib/ruby/1.8/i486-linux/fcntl.so mongrel_r 11628 username mem REG 9,1 224716 212332 /usr/lib/ruby/1.8/i486-linux/openssl.so mongrel_r 11628 username mem REG 9,1 1360292 457376 /lib/i686/cmov/libc-2.7.so mongrel_r 11628 username mem REG 9,1 149328 457382 /lib/i686/cmov/libm-2.7.so mongrel_r 11628 username mem REG 9,1 38300 457378 /lib/i686/cmov/libcrypt-2.7.so mongrel_r 11628 username mem REG 9,1 9684 457379 /lib/i686/cmov/libdl-2.7.so mongrel_r 11628 username mem REG 9,1 112354 457392 /lib/i686/cmov/libpthread-2.7.so mongrel_r 11628 username mem REG 9,1 783564 164396 /usr/lib/libruby1.8.so.1.8.6 mongrel_r 11628 username mem REG 9,1 10228 213152 /usr/lib/ruby/1.8/i486-linux/digest.so mongrel_r 11628 username mem REG 9,1 109152 457054 /lib/ld-2.7.so mongrel_r 11628 username 1w REG 9,2 462923 1575329 /home/domains/example.com/usernameOrder/shared/log/mongrel.8001.log mongrel_r 11628 username 2w REG 9,2 462923 1575329 /home/domains/example.com/usernameOrder/shared/log/mongrel.8001.log mongrel_r 11628 username 3u IPv4 15442350 TCP localhost:8001 (LISTEN) mongrel_r 11628 username 4w REG 9,2 118943548 1575355 /home/domains/example.com/usernameOrder/shared/log/production.log mongrel_r 11628 username 5u REG 9,1 145306 234226 /tmp/mongrel.11628.0 (deleted) mongrel_r 11628 username 7u unix 0xc3c12480 15442417 socket mongrel_r 11628 username 11u REG 9,1 50 234180 /tmp/CGI.11628.2 mongrel_r 11628 username 12u REG 9,1 26228 234227 /tmp/CGI.11628.3
ruby
rubyonrails
mongrel
rmagick
null
null
open
Mongrel hangs with 100% CPU / EBADF (Bad file descriptor) === We have a server with 10 running mongrel_cluster instances with apache in front of them, and every now and then one or some of them hang. No activity is seen in the database (we're using activerecord sessions). Mysql with innodb tables. show innodb status shows no locks. show processlist shows nothing. The server is linux debian 4.0 Ruby is: ruby 1.8.6 (2008-03-03 patchlevel 114) [i486-linux] Rails is: Rails 1.1.2 (yes, quite old) We're using the native mysql connector (gem install mysql) "strace -p PID" gives the following in a loop for the hung mongrel process: gettimeofday({1219834026, 235289}, NULL) = 0 select(4, [3], [0], [], {0, 905241}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235477}, NULL) = 0 select(4, [3], [0], [], {0, 905053}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235654}, NULL) = 0 select(4, [3], [0], [], {0, 904875}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 235829}, NULL) = 0 select(4, [3], [0], [], {0, 904700}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236017}, NULL) = 0 select(4, [3], [0], [], {0, 904513}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236192}, NULL) = 0 select(4, [3], [0], [], {0, 904338}) = -1 EBADF (Bad file descriptor) gettimeofday({1219834026, 236367}, NULL) = 0 ... I used lsof and found that the process used 67 file descriptors (lsof -p PID |wc -l) Is there any other way I can debug this, so that I could for example determine which file descriptor is "bad"? Any other info or suggestions? Anybody else seen this? The site is fairly used, but not overly so, load averages usually around 0.3. --- Some additional info. I installed mongrelproctitle to show what the hung processes were doing, and it seems they are hanging on a method that displays images using file_column / images from the database / rmagick to resize and make the images greyscale. Not conclusive the problem is here, but it is a suspicion. Is there something obviously wrong with the following? The method displays a static image if the order doesn't contain an image, else the image resized from the order. The cache stuff is so that the image gets updated in the browser every time. The image is inserted in the page with a normal image tag. code: def preview_image @order = session[:order] if @order.image.nil? @headers['Pragma'] = 'no-cache' @headers['Cache-Control'] = 'no-cache, must-revalidate' send_data(EMPTY_PIC.to_blob, :filename => "img.jpg", :type => "image/jpeg", :disposition => "inline") else @pic = Image.read(@order.image)[0] if (@order.crop) @pic.crop!(@order.crop[:x1].to_i, @order.crop[:y1].to_i, @order.crop[:width].to_i, @order.crop[:height].to_i, true) end @pic.resize!(103,130) @pic = @pic.quantize(256, Magick::GRAYColorspace) @headers['Pragma'] = 'no-cache' @headers['Cache-Control'] = 'no-cache, must-revalidate' send_data(@pic.to_blob, :filename => "img.jpg", :type => "image/jpeg", :disposition => "inline") end end Here is the lsof output if anybody can find any problems in it. Don't know how it will format in this message... lsof: WARNING: can't stat() ext3 file system /dev/.static/dev Output information may be incomplete. COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME mongrel_r 11628 username cwd DIR 9,2 4096 1870688 /home/domains/example.com/usernameOrder/releases/20080831121802 mongrel_r 11628 username rtd DIR 9,1 4096 2 / mongrel_r 11628 username txt REG 9,1 3564 167172 /usr/bin/ruby1.8 mongrel_r 11628 username mem REG 0,0 0 [heap] (stat: No such file or directory) mongrel_r 11628 username DEL REG 0,8 15560245 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560242 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560602 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560601 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560684 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560683 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560685 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560568 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560607 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560569 /dev/zero mongrel_r 11628 username mem REG 9,1 1933648 456972 /usr/lib/libmysqlclient.so.15.0.0 mongrel_r 11628 username DEL REG 0,8 15442414 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560546 /dev/zero mongrel_r 11628 username mem REG 9,1 67408 457393 /lib/i686/cmov/libresolv-2.7.so mongrel_r 11628 username mem REG 9,1 17884 457386 /lib/i686/cmov/libnss_dns-2.7.so mongrel_r 11628 username DEL REG 0,8 15560541 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560246 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560693 /dev/zero mongrel_r 11628 username DEL REG 0,8 15560608 /dev/zero mongrel_r 11628 username mem REG 9,1 25700 164963 /usr/lib/gconv/gconv-modules.cache mongrel_r 11628 username mem REG 9,1 83708 457384 /lib/i686/cmov/libnsl-2.7.so mongrel_r 11628 username mem REG 9,1 140602 506903 /var/lib/gems/1.8/gems/mysql-2.7/lib/mysql.so mongrel_r 11628 username mem REG 9,1 1282816 180935 /usr/lib/locale/locale-archive mongrel_r 11628 username mem REG 9,1 16672 167438 /usr/lib/libXdmcp.so.6.0.0 mongrel_r 11628 username mem REG 9,1 7220 167436 /usr/lib/libXau.so.6.0.0 mongrel_r 11628 username mem REG 9,1 434840 167477 /usr/lib/libfreetype.so.6.3.10 mongrel_r 11628 username mem REG 9,1 1147196 167011 /usr/lib/libxml2.so.2.6.27 mongrel_r 11628 username mem REG 9,1 66200 457138 /lib/libbz2.so.1.0.3 mongrel_r 11628 username mem REG 9,1 965952 167440 /usr/lib/libX11.so.6.2.0 mongrel_r 11628 username mem REG 9,1 85060 168009 /usr/lib/libICE.so.6.3.0 mongrel_r 11628 username mem REG 9,1 32144 168011 /usr/lib/libSM.so.6.0.0 mongrel_r 11628 username mem REG 9,1 320344 168013 /usr/lib/libXt.so.6.0.0 mongrel_r 11628 username mem REG 9,1 52848 168023 /usr/lib/libXext.so.6.4.0 mongrel_r 11628 username mem REG 9,1 137760 167484 /usr/lib/libpng12.so.0.15.0 mongrel_r 11628 username mem REG 9,1 127488 167481 /usr/lib/libjpeg.so.62.0.0 mongrel_r 11628 username mem REG 9,1 288776 168015 /usr/lib/libjasper-1.701.so.1.0.0 mongrel_r 11628 username mem REG 9,1 343712 168021 /usr/lib/libtiff.so.4.2.1 mongrel_r 11628 username mem REG 9,1 197880 168017 /usr/lib/liblcms.so.1.0.15 mongrel_r 11628 username mem REG 9,1 3637020 168025 /usr/lib/libMagick.so.9.0.0 mongrel_r 11628 username DEL REG 0,8 15560547 /dev/zero mongrel_r 11628 username mem REG 9,1 252348 217396 /usr/lib/ruby/1.8/i486-linux/RMagick.so mongrel_r 11628 username mem REG 9,1 38412 457387 /lib/i686/cmov/libnss_files-2.7.so mongrel_r 11628 username mem REG 9,1 195564 457011 /lib/libncurses.so.5.6 mongrel_r 11628 username mem REG 9,1 188760 457143 /lib/libreadline.so.5.2 mongrel_r 11628 username DEL REG 0,8 15560542 /dev/zero mongrel_r 11628 username mem REG 9,1 15312 214202 /usr/lib/ruby/1.8/i486-linux/readline.so mongrel_r 11628 username mem REG 9,1 12192 213239 /usr/lib/ruby/1.8/i486-linux/digest/sha1.so mongrel_r 11628 username mem REG 9,1 12868 213153 /usr/lib/ruby/1.8/i486-linux/iconv.so mongrel_r 11628 username mem REG 9,1 11744 213164 /usr/lib/ruby/1.8/i486-linux/racc/cparse.so mongrel_r 11628 username mem REG 9,1 236540 213151 /usr/lib/ruby/1.8/i486-linux/nkf.so mongrel_r 11628 username mem REG 9,1 6688 213237 /usr/lib/ruby/1.8/i486-linux/digest/md5.so mongrel_r 11628 username mem REG 9,1 15552 213160 /usr/lib/ruby/1.8/i486-linux/strscan.so mongrel_r 11628 username mem REG 9,1 31312 213245 /usr/lib/ruby/1.8/i486-linux/zlib.so mongrel_r 11628 username mem REG 9,1 12608 213243 /usr/lib/ruby/1.8/i486-linux/thread.so mongrel_r 11628 username mem REG 9,1 36325 360155 /var/lib/gems/1.8/gems/fastthread-1.0.1/lib/fastthread.so mongrel_r 11628 username mem REG 9,1 44423 347866 /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/http11.so mongrel_r 11628 username mem REG 9,1 38844 213246 /usr/lib/ruby/1.8/i486-linux/socket.so mongrel_r 11628 username mem REG 9,1 7840 213249 /usr/lib/ruby/1.8/i486-linux/etc.so mongrel_r 11628 username mem REG 9,1 109364 213241 /usr/lib/ruby/1.8/i486-linux/syck.so mongrel_r 11628 username mem REG 9,1 15888 213244 /usr/lib/ruby/1.8/i486-linux/stringio.so mongrel_r 11628 username mem REG 9,1 78500 163229 /usr/lib/libz.so.1.2.3 mongrel_r 11628 username mem REG 9,1 1338692 182762 /usr/lib/i686/cmov/libcrypto.so.0.9.8 mongrel_r 11628 username mem REG 9,1 278628 182763 /usr/lib/i686/cmov/libssl.so.0.9.8 mongrel_r 11628 username mem REG 9,1 3820 213247 /usr/lib/ruby/1.8/i486-linux/fcntl.so mongrel_r 11628 username mem REG 9,1 224716 212332 /usr/lib/ruby/1.8/i486-linux/openssl.so mongrel_r 11628 username mem REG 9,1 1360292 457376 /lib/i686/cmov/libc-2.7.so mongrel_r 11628 username mem REG 9,1 149328 457382 /lib/i686/cmov/libm-2.7.so mongrel_r 11628 username mem REG 9,1 38300 457378 /lib/i686/cmov/libcrypt-2.7.so mongrel_r 11628 username mem REG 9,1 9684 457379 /lib/i686/cmov/libdl-2.7.so mongrel_r 11628 username mem REG 9,1 112354 457392 /lib/i686/cmov/libpthread-2.7.so mongrel_r 11628 username mem REG 9,1 783564 164396 /usr/lib/libruby1.8.so.1.8.6 mongrel_r 11628 username mem REG 9,1 10228 213152 /usr/lib/ruby/1.8/i486-linux/digest.so mongrel_r 11628 username mem REG 9,1 109152 457054 /lib/ld-2.7.so mongrel_r 11628 username 1w REG 9,2 462923 1575329 /home/domains/example.com/usernameOrder/shared/log/mongrel.8001.log mongrel_r 11628 username 2w REG 9,2 462923 1575329 /home/domains/example.com/usernameOrder/shared/log/mongrel.8001.log mongrel_r 11628 username 3u IPv4 15442350 TCP localhost:8001 (LISTEN) mongrel_r 11628 username 4w REG 9,2 118943548 1575355 /home/domains/example.com/usernameOrder/shared/log/production.log mongrel_r 11628 username 5u REG 9,1 145306 234226 /tmp/mongrel.11628.0 (deleted) mongrel_r 11628 username 7u unix 0xc3c12480 15442417 socket mongrel_r 11628 username 11u REG 9,1 50 234180 /tmp/CGI.11628.2 mongrel_r 11628 username 12u REG 9,1 26228 234227 /tmp/CGI.11628.3
0
77,813
09/16/2008 22:12:52
1,693
08/18/2008 02:25:37
1,063
41
Way to read Windows EventLog with Java
Does anyone have any pointers on how to read the Windows EventLog without using JNI? Or if you *have to* use JNI, are there any good open-source libraries for doing so?
java
jni
event-log
null
null
null
open
Way to read Windows EventLog with Java === Does anyone have any pointers on how to read the Windows EventLog without using JNI? Or if you *have to* use JNI, are there any good open-source libraries for doing so?
0
77,817
09/16/2008 22:13:07
13,986
09/16/2008 21:37:02
1
3
C++ runtime knowledge of classes
I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded. Is there a way to determine what classes have been compiled, at run-time preferably, so that I can remove the linking and instead provide dynamically loadable libraries instead.
c++
class
runtime
null
null
null
open
C++ runtime knowledge of classes === I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded. Is there a way to determine what classes have been compiled, at run-time preferably, so that I can remove the linking and instead provide dynamically loadable libraries instead.
0
77,826
09/16/2008 22:13:48
11,995
09/16/2008 12:47:26
1
1
PHP: $_SESSION - What are the pros and cons of storing temporarily used data in the $_SESSION variable
One thing I've started doing more often recently is **retrieving some data** at the beginning of a task **and storing it in a $_SESSION['myDataForTheTask']**. Now it seems very convenient to do so but I don't know anything about performance, security risks or similar, using this approach. Is it something which is regularly done by programmers with more expertise or is it more of an amateur thing to do? **For example:** if (!isset($_SESSION['dataentry'])) { $query_taskinfo = "SELECT participationcode, modulearray, wavenum FROM mng_wave WHERE wave_id=".$_GET['wave_id']; $result_taskinfo = $db->query($query_taskinfo); $row_taskinfo = $result_taskinfo->fetch_row(); $dataentry = array("pcode" => $row_taskinfo[0], "modules" => $row_taskinfo[1], "data_id" => 0, "wavenum" => $row_taskinfo[2], "prequest" => FALSE, "highlight" => array()); $_SESSION['dataentry'] = $dataentry; } I'm an amateur so feel free to comment other aspects of that code.
php
-session
session
scope
null
null
open
PHP: $_SESSION - What are the pros and cons of storing temporarily used data in the $_SESSION variable === One thing I've started doing more often recently is **retrieving some data** at the beginning of a task **and storing it in a $_SESSION['myDataForTheTask']**. Now it seems very convenient to do so but I don't know anything about performance, security risks or similar, using this approach. Is it something which is regularly done by programmers with more expertise or is it more of an amateur thing to do? **For example:** if (!isset($_SESSION['dataentry'])) { $query_taskinfo = "SELECT participationcode, modulearray, wavenum FROM mng_wave WHERE wave_id=".$_GET['wave_id']; $result_taskinfo = $db->query($query_taskinfo); $row_taskinfo = $result_taskinfo->fetch_row(); $dataentry = array("pcode" => $row_taskinfo[0], "modules" => $row_taskinfo[1], "data_id" => 0, "wavenum" => $row_taskinfo[2], "prequest" => FALSE, "highlight" => array()); $_SESSION['dataentry'] = $dataentry; } I'm an amateur so feel free to comment other aspects of that code.
0
77,833
09/16/2008 22:15:30
8,678
09/15/2008 16:34:57
1
2
How to make any arbitrary SECTION of ANY aspx webpage available as an Ajax popup
I wonder if anyone can think of a good technique to enable any arbitrary section of an aspx page (say, the contents within a specified DIV tag) to be able to be called and displayed in an ajax modal popup? (So, only a certain section of the page would be displayed) For example: 1) You have a large application with many entities (Customers, Products, Stores, etc, etc etc) 2) Each entity has an EntityDetails aspx page Now, say from an Invoice screen that shows many entities of different types, I would like to be able to mouseover (or click a small icon) an entity, and have a little tooltip style modal ajax window popup, and what is shown will be the PORTION of the corresponding EntityDetails aspx page that was designated as available for rendering as a popup. Obviously, the corresponding aspx arguments identifying the specific entity would have to be passed from the page as well. So to do this, ** I think the requested page would have to be rendered in memory on the server **, and then the innerhtml would have to be pulled out of the designated div, and returned to the calling page, which would then display this html in a popup ajax window. So, unless there is an easier way to do this that I am missing, how would this rendering be done on the server? Has anyone seen this done before, is there any sort of a pre-existing framework or anything to do this? And to complicate things further, would it be possible to have the popup form be editable and saved back to the server utilizing the existing asp.net form mechanism already embedded within the existing page (if the calling form already had an asp.net form....I think only one form is allowed per page, correct?) And of course, opening the EntityDetails form via a simple javascript popup or new window is not what I am looking for. And I do not want to have to embed the details form on each page where I may want it to display...every form in the application could conceivably call any other as a popup. Thanks!
asp.net
asp.net-ajax
null
null
null
null
open
How to make any arbitrary SECTION of ANY aspx webpage available as an Ajax popup === I wonder if anyone can think of a good technique to enable any arbitrary section of an aspx page (say, the contents within a specified DIV tag) to be able to be called and displayed in an ajax modal popup? (So, only a certain section of the page would be displayed) For example: 1) You have a large application with many entities (Customers, Products, Stores, etc, etc etc) 2) Each entity has an EntityDetails aspx page Now, say from an Invoice screen that shows many entities of different types, I would like to be able to mouseover (or click a small icon) an entity, and have a little tooltip style modal ajax window popup, and what is shown will be the PORTION of the corresponding EntityDetails aspx page that was designated as available for rendering as a popup. Obviously, the corresponding aspx arguments identifying the specific entity would have to be passed from the page as well. So to do this, ** I think the requested page would have to be rendered in memory on the server **, and then the innerhtml would have to be pulled out of the designated div, and returned to the calling page, which would then display this html in a popup ajax window. So, unless there is an easier way to do this that I am missing, how would this rendering be done on the server? Has anyone seen this done before, is there any sort of a pre-existing framework or anything to do this? And to complicate things further, would it be possible to have the popup form be editable and saved back to the server utilizing the existing asp.net form mechanism already embedded within the existing page (if the calling form already had an asp.net form....I think only one form is allowed per page, correct?) And of course, opening the EntityDetails form via a simple javascript popup or new window is not what I am looking for. And I do not want to have to embed the details form on each page where I may want it to display...every form in the application could conceivably call any other as a popup. Thanks!
0
77,835
09/16/2008 22:15:46
12,645
09/16/2008 15:05:47
1
0
How do I solve this error: "Class PHPUnit_Extensions_SeleniumTestCase could not be found"
I am trying to run a SeleniumTestCase with phpunit but I cannot get it to run with the phpunit.bat script. My goal is to use phpunit with Selenium RC in CruiseControl & phpUnderControl. This is what the test looks like: require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; class WebTest extends PHPUnit_Extensions_SeleniumTestCase { protected function setUp() { $this->setBrowser('*firefox'); $this->setBrowserUrl('http://www.example.com/'); } public function testTitle() { $this->open('http://www.example.com/'); $this->assertTitleEquals('Example Web Page'); } } I also got PEAR in the include_path and PHPUnit installed with the Selenium extension. I installed these with the pear installer so I guess that's not the problem. Any help would be very much appreciated. Thanks, Remy
cruisecontrol
phpundercontrol
phpunit
selenium
unit-testing
null
open
How do I solve this error: "Class PHPUnit_Extensions_SeleniumTestCase could not be found" === I am trying to run a SeleniumTestCase with phpunit but I cannot get it to run with the phpunit.bat script. My goal is to use phpunit with Selenium RC in CruiseControl & phpUnderControl. This is what the test looks like: require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; class WebTest extends PHPUnit_Extensions_SeleniumTestCase { protected function setUp() { $this->setBrowser('*firefox'); $this->setBrowserUrl('http://www.example.com/'); } public function testTitle() { $this->open('http://www.example.com/'); $this->assertTitleEquals('Example Web Page'); } } I also got PEAR in the include_path and PHPUnit installed with the Selenium extension. I installed these with the pear installer so I guess that's not the problem. Any help would be very much appreciated. Thanks, Remy
0
77,836
09/16/2008 22:15:57
14,157
09/16/2008 22:15:57
1
0
How do I clip a line segment against a frustum?
Given two vectors __A__ and __B__ which form the line segment __L__ = A-B. Furthermore given a frustum __F__ which is defined by its left, right, bottom and top planes. How do I clip __L__ against __F__? That is, test for an intersection *and* where on L that intersection occurs? (Keep in mind that a line segment can have __more__ than one intersection with the frustum if it intersects two sides at a corner.) If possible, provide a code example please (C++ or Python preferred).
mathematics
clipping
null
null
null
null
open
How do I clip a line segment against a frustum? === Given two vectors __A__ and __B__ which form the line segment __L__ = A-B. Furthermore given a frustum __F__ which is defined by its left, right, bottom and top planes. How do I clip __L__ against __F__? That is, test for an intersection *and* where on L that intersection occurs? (Keep in mind that a line segment can have __more__ than one intersection with the frustum if it intersects two sides at a corner.) If possible, provide a code example please (C++ or Python preferred).
0
77,839
09/16/2008 22:16:09
13,750
09/16/2008 20:44:07
1
0
What are the best resources for learning Java (books, websites, etc.)?
What are the best (as in most effective) resources for learning Java?
java
books
null
null
null
09/30/2011 22:45:46
not constructive
What are the best resources for learning Java (books, websites, etc.)? === What are the best (as in most effective) resources for learning Java?
4
77,873
09/16/2008 22:19:08
14,166
09/16/2008 22:19:08
1
0
Filling PDF Forms with PHP
Is there a way to fill PDF forms and then save (flatten) them to PDF files from within PHP? Which library would you recommend?
php
pdf
null
null
null
null
open
Filling PDF Forms with PHP === Is there a way to fill PDF forms and then save (flatten) them to PDF files from within PHP? Which library would you recommend?
0
77,887
09/16/2008 22:21:27
14,173
09/16/2008 22:21:27
1
0
Interpreting Stacks in Windows Minidumps
As someone who is just starting to learn the intricacies of computer debugging, for the life of me, I can't understand how to read the Stack Text of a dump in Windbg. I've no idea of where to start on how to interpret them or how to go about it. Can anyone offer direction to this poor soul?
stack
windbg
multithreading
null
null
null
open
Interpreting Stacks in Windows Minidumps === As someone who is just starting to learn the intricacies of computer debugging, for the life of me, I can't understand how to read the Stack Text of a dump in Windbg. I've no idea of where to start on how to interpret them or how to go about it. Can anyone offer direction to this poor soul?
0
77,890
09/16/2008 22:21:38
12,425
09/16/2008 14:20:15
1
1
In Delphi, How do I get an enumerator from LocalPolicy.CurrentProfile.GloballyOpenPorts in the Firewall API
I am writing some code to see if there is a hole in the firewall exception list for WinXP and Vista for a specific port used by our client software. I can see that I can use the NetFwMgr.LocalPolicy.CurrentProfile.GloballyOpenPorts to get a list of the current Open port exceptions but can not figure out how to get that enumerated list in to something that I can use in my Delphi program. My latest try is listed below, its gving me an access violation when I use port_list.Item. I know thats wrong, it was mostly wishful thinking on my part. Any help would be appreciated. function TFirewallUtility.IsPortInExceptionList(iPortNumber: integer): boolean; var i, h: integer; port_list, port: OleVariant; begin Result := False; port_list := mxFirewallManager.LocalPolicy.CurrentProfile.GloballyOpenPorts; for i := 0 to port_list.Count - 1 do begin port := port_list.Item[i]; if (port.PortNumber = iPortNumber) then begin Result := True; break; end; end; end;
delphi
firewall
null
null
null
null
open
In Delphi, How do I get an enumerator from LocalPolicy.CurrentProfile.GloballyOpenPorts in the Firewall API === I am writing some code to see if there is a hole in the firewall exception list for WinXP and Vista for a specific port used by our client software. I can see that I can use the NetFwMgr.LocalPolicy.CurrentProfile.GloballyOpenPorts to get a list of the current Open port exceptions but can not figure out how to get that enumerated list in to something that I can use in my Delphi program. My latest try is listed below, its gving me an access violation when I use port_list.Item. I know thats wrong, it was mostly wishful thinking on my part. Any help would be appreciated. function TFirewallUtility.IsPortInExceptionList(iPortNumber: integer): boolean; var i, h: integer; port_list, port: OleVariant; begin Result := False; port_list := mxFirewallManager.LocalPolicy.CurrentProfile.GloballyOpenPorts; for i := 0 to port_list.Count - 1 do begin port := port_list.Item[i]; if (port.PortNumber = iPortNumber) then begin Result := True; break; end; end; end;
0
77,891
09/16/2008 22:21:47
4,246
09/02/2008 14:03:59
178
4
What emails clients are being used out there?
This is not "exactly" a programming question, but it's highly related. We are writing an app that sends out email invitations for a client (no, it's not spam). Their designer gave us an HTML and CSS template to use which is fine. The problem is that it looks like crap in Outlook 2007 because Microsoft decided to use Word (of all things!) as the [rendering engine for HTML in Outlook 2007][1]. I want the client to understand that they should design a "compatible" look and would love to be able to show some kind of statistics about what email clients are being used out there, namely that Outlook 2007 is growing in use. Has anyone run across any white papers, web sites, studies that even come close to providing a view on this? I don't expect census level accuracy, but something fairly credible would be good. Thanks for any help. [1]: http://msdn.microsoft.com/en-us/library/aa338201.aspx
email
statistics
usage
outlook
null
null
open
What emails clients are being used out there? === This is not "exactly" a programming question, but it's highly related. We are writing an app that sends out email invitations for a client (no, it's not spam). Their designer gave us an HTML and CSS template to use which is fine. The problem is that it looks like crap in Outlook 2007 because Microsoft decided to use Word (of all things!) as the [rendering engine for HTML in Outlook 2007][1]. I want the client to understand that they should design a "compatible" look and would love to be able to show some kind of statistics about what email clients are being used out there, namely that Outlook 2007 is growing in use. Has anyone run across any white papers, web sites, studies that even come close to providing a view on this? I don't expect census level accuracy, but something fairly credible would be good. Thanks for any help. [1]: http://msdn.microsoft.com/en-us/library/aa338201.aspx
0
77,900
09/16/2008 22:23:10
8,678
09/15/2008 16:34:57
1
2
How to convert all controls on an aspx webform to a read-only equivalent
Has anyone ever written a function that can convert all of the controls on an aspx page into a read only version? For example, if UserDetails.aspx is used to edit and save a users information, if someone with inappropriate permissions enter the page, I would like to render it as read-only. So, most controls would be converted to labels, loaded with the corresponding data from the editable original control. I think it would likely be a fairly simple routine, ie: Dim ctlParent As Control = Me.txtTest.Parent Dim ctlOLD As TextBox = Me.txtTest Dim ctlNEW As Label = New Label ctlNEW.Width = ctlOLD.Width ctlNEW.Text = ctlOLD.Text ctlParent.Controls.Remove(ctlOLD) ctlParent.Controls.Add(ctlNEW) ...is really all you need for a textbox --> label conversion, but I was hoping someone might know of an existing function out there as there are likely a few pitfalls here and there with certain controls and situations.
asp.net
null
null
null
null
null
open
How to convert all controls on an aspx webform to a read-only equivalent === Has anyone ever written a function that can convert all of the controls on an aspx page into a read only version? For example, if UserDetails.aspx is used to edit and save a users information, if someone with inappropriate permissions enter the page, I would like to render it as read-only. So, most controls would be converted to labels, loaded with the corresponding data from the editable original control. I think it would likely be a fairly simple routine, ie: Dim ctlParent As Control = Me.txtTest.Parent Dim ctlOLD As TextBox = Me.txtTest Dim ctlNEW As Label = New Label ctlNEW.Width = ctlOLD.Width ctlNEW.Text = ctlOLD.Text ctlParent.Controls.Remove(ctlOLD) ctlParent.Controls.Add(ctlNEW) ...is really all you need for a textbox --> label conversion, but I was hoping someone might know of an existing function out there as there are likely a few pitfalls here and there with certain controls and situations.
0
77,914
09/16/2008 22:26:08
13,956
09/16/2008 21:27:06
1
0
Failures caused by logrotate on Apache 2 with passphrase protected SSL key
I have an Apache 2 installation on Debian with mod_ssl installed. The server private key is protected by a passphase that needs to be entered on start-up. The error and access logs are subject to logrotate on a weekly basis. I find that Apache crashes with a passphrase-related error shortly after logrotate runs. I understand that logrotate fires a SIGHUP to Apache after archiving logs and I suspect this is causing a reload and subsequent failure getting the passphrase for the server key. Well, enough with my theories, here is the question: Is there a "best practice" way in which to configure Apache to allow its SSL server keys to be protected by a passphrase (without storing that passphrase in a file somewhere) so that it won't crash when logrotate runs? It is fine to require user input on server startup, but not restart or reload.
ssl
crash
apache2
passphrase
logrotate
null
open
Failures caused by logrotate on Apache 2 with passphrase protected SSL key === I have an Apache 2 installation on Debian with mod_ssl installed. The server private key is protected by a passphase that needs to be entered on start-up. The error and access logs are subject to logrotate on a weekly basis. I find that Apache crashes with a passphrase-related error shortly after logrotate runs. I understand that logrotate fires a SIGHUP to Apache after archiving logs and I suspect this is causing a reload and subsequent failure getting the passphrase for the server key. Well, enough with my theories, here is the question: Is there a "best practice" way in which to configure Apache to allow its SSL server keys to be protected by a passphrase (without storing that passphrase in a file somewhere) so that it won't crash when logrotate runs? It is fine to require user input on server startup, but not restart or reload.
0
77,931
09/16/2008 22:28:34
327
08/04/2008 17:08:49
774
49
Do you know of any language-aware diffing tools?
I got to thinking about how annoying messy merges can be and was wondering if there are any language aware diffing tools that go beyond the typical language-aware features of comment skipping and case sensitivity. Seems like the diffing engine could infer a lot more if it were aware of the syntax of what it is diffing instead of just treating it like text (essentially doing a diff on the abstract syntax tree).
algorithm
programming-languages
diff
merge
null
07/28/2011 13:22:18
not constructive
Do you know of any language-aware diffing tools? === I got to thinking about how annoying messy merges can be and was wondering if there are any language aware diffing tools that go beyond the typical language-aware features of comment skipping and case sensitivity. Seems like the diffing engine could infer a lot more if it were aware of the syntax of what it is diffing instead of just treating it like text (essentially doing a diff on the abstract syntax tree).
4
77,934
09/16/2008 22:28:50
6,355
09/14/2008 18:12:35
105
10
How do I display an image with ltk?
I have written code to read a windows bitmap and would now like to display it with ltk. How can I construct an appropriate object? Is there such functionality in ltk? If not how can I do it directly interfacing to tk?
lisp
tcl
sbcl
tk
ltk
null
open
How do I display an image with ltk? === I have written code to read a windows bitmap and would now like to display it with ltk. How can I construct an appropriate object? Is there such functionality in ltk? If not how can I do it directly interfacing to tk?
0
77,936
09/16/2008 22:28:58
676
08/07/2008 16:46:54
517
22
What's the best way to calculate a 3D (or n-D) centroid?
As part of a project at work I have to calculate the centroid of a set of points in 3D space. Right now I'm doing it in a way that seems simple but naive -- by taking the average of each set of points, as in: centroid = average(x), average(y), average(z) where `x`, `y` and `z` are arrays of floating-point numbers. I seem to recall that there is a way to get a more accurate centroid, but I haven't found a simple algorithm for doing so. Anyone have any ideas or suggestions? I'm using Python for this, but I can adapt examples from other languages.
python
math
3d
geometry
null
null
open
What's the best way to calculate a 3D (or n-D) centroid? === As part of a project at work I have to calculate the centroid of a set of points in 3D space. Right now I'm doing it in a way that seems simple but naive -- by taking the average of each set of points, as in: centroid = average(x), average(y), average(z) where `x`, `y` and `z` are arrays of floating-point numbers. I seem to recall that there is a way to get a more accurate centroid, but I haven't found a simple algorithm for doing so. Anyone have any ideas or suggestions? I'm using Python for this, but I can adapt examples from other languages.
0
77,954
09/16/2008 22:30:07
14,193
09/16/2008 22:27:01
1
0
How can you get Perl to stop when referencing an undef value?
How do you get Perl to stop and give a stack trace when you reference an undef value, rather than merely warning? It seems that `use strict;` isn't sufficient for this purpose.
perl
undef
null
null
null
null
open
How can you get Perl to stop when referencing an undef value? === How do you get Perl to stop and give a stack trace when you reference an undef value, rather than merely warning? It seems that `use strict;` isn't sufficient for this purpose.
0
77,957
09/16/2008 22:30:19
13,208
09/16/2008 17:38:30
1
1
Visual Studio keeps adding blank lines
I'm using Visual Studio 2008 for an ASP .Net application, and Visual Studio keeps adding blank lines to my aspx file whenever I save, switch to design mode and back to code view, switch to split mode, or switch between files. Before I save, I will have: </ContentTemplate></asp:UpdatePanel> </ContentTemplate> </ajax:TabPanel> </ajax:TabContainer> Then, it will magically transform into: </ContentTemplate></asp:UpdatePanel> </ContentTemplate> </ajax:TabPanel> </ajax:TabContainer> I know it's mostly an aesthetics issue, but it's also adding 17 lines of nothing to each tab container (and making the file that much longer to scroll through) and it's very annoying. I've checked that I don't have a misplaced quotation mark, there's no misaligned tags earlier in the file, any ideas?
visual-studio
visual-studio-2008
null
null
null
null
open
Visual Studio keeps adding blank lines === I'm using Visual Studio 2008 for an ASP .Net application, and Visual Studio keeps adding blank lines to my aspx file whenever I save, switch to design mode and back to code view, switch to split mode, or switch between files. Before I save, I will have: </ContentTemplate></asp:UpdatePanel> </ContentTemplate> </ajax:TabPanel> </ajax:TabContainer> Then, it will magically transform into: </ContentTemplate></asp:UpdatePanel> </ContentTemplate> </ajax:TabPanel> </ajax:TabContainer> I know it's mostly an aesthetics issue, but it's also adding 17 lines of nothing to each tab container (and making the file that much longer to scroll through) and it's very annoying. I've checked that I don't have a misplaced quotation mark, there's no misaligned tags earlier in the file, any ideas?
0
77,982
09/16/2008 22:33:25
14,131
09/16/2008 22:06:25
1
0
Esc and Enter keys in Cocoa dialog
How can I dismiss dialog in Cocoa application when user presses Esc or Enter key? I have OK button, is it possible to make it default button?
cocoa
null
null
null
null
null
open
Esc and Enter keys in Cocoa dialog === How can I dismiss dialog in Cocoa application when user presses Esc or Enter key? I have OK button, is it possible to make it default button?
0
77,990
09/16/2008 22:34:03
14,210
09/16/2008 22:34:02
1
0
Redraw screen in terminal
How do some programs edit whats being displayed on the terminal (to pick a random example, the program 'sl')? I'm thinking of the Linux terminal here, it may happen in other OS's too, I don't know. I've always thought once some text was displayed, it stayed there. How do you change it without redrawing the entire screen?
linux
terminal
ouput
null
null
null
open
Redraw screen in terminal === How do some programs edit whats being displayed on the terminal (to pick a random example, the program 'sl')? I'm thinking of the Linux terminal here, it may happen in other OS's too, I don't know. I've always thought once some text was displayed, it stayed there. How do you change it without redrawing the entire screen?
0
77,992
09/16/2008 22:34:15
14,206
09/16/2008 22:32:26
1
0
SAP .NET Connector
Need to integrate SAP with .NET applications. Is .NET Connector the best choice? What about NetWeaver? Simply looking to push data to and pull data from SAP.
.net
sap
null
null
null
null
open
SAP .NET Connector === Need to integrate SAP with .NET applications. Is .NET Connector the best choice? What about NetWeaver? Simply looking to push data to and pull data from SAP.
0
77,996
09/16/2008 22:34:20
13,790
09/16/2008 20:52:24
8
0
Custom events in C++?
Is it possible to create custom events in C++? For example, say I have the variable X, and the variable Y. Whenever X changes, I would like to execute a function that sets Y equal to 3X. Is there a way to create such a trigger/event? (triggers are common in some databases)
c++
null
null
null
null
null
open
Custom events in C++? === Is it possible to create custom events in C++? For example, say I have the variable X, and the variable Y. Whenever X changes, I would like to execute a function that sets Y equal to 3X. Is there a way to create such a trigger/event? (triggers are common in some databases)
0
78,018
09/16/2008 22:38:06
3,957
09/01/2008 02:50:44
379
22
Executing different set of MSBuild tasks for each user?
In our development environment each developer has their own dev server. Often times they do not actually develop on that server but develop from their local machine, deploy to their dev server, and then attach with the remote debugger to do debugging. My question is; how can I use MSBuild to execute a different set of tasks for each user? I want to enable each user to define their own build process with MSBuild tasks but I don't want that to necessarily affect the other developers. I also want a default set of tasks to execute if a given user explicitly defined their own process. Example: - SomeProj.csproj - Default MS Build process is to copy to test server or staging server - Custom process for Steve is to copy to Steve's dev server - Custom process for Eric is to copy to Eric's dev server
visual-studio
msbuild
build
deploy
null
null
open
Executing different set of MSBuild tasks for each user? === In our development environment each developer has their own dev server. Often times they do not actually develop on that server but develop from their local machine, deploy to their dev server, and then attach with the remote debugger to do debugging. My question is; how can I use MSBuild to execute a different set of tasks for each user? I want to enable each user to define their own build process with MSBuild tasks but I don't want that to necessarily affect the other developers. I also want a default set of tasks to execute if a given user explicitly defined their own process. Example: - SomeProj.csproj - Default MS Build process is to copy to test server or staging server - Custom process for Steve is to copy to Steve's dev server - Custom process for Eric is to copy to Eric's dev server
0
78,043
09/16/2008 22:40:24
14,204
09/16/2008 22:31:05
1
0
Rich User Interface on Embedded Linux Device
I'm designing a user interface for a large touchscreen device running Linux. What would be the best toolkit/developer kit/SDK to use? The only requirement is that its able to run on a semi-low performace device, and that there is a Linux version. Nice-to-haves would be build in support for effects/animations and a modern look-and-feel, but they are not necessary. I'm looking at Adobe Flex/AIR already, but I'm not sure if the device will meet the minimum specs.
linux
gui
embedded
touchscreen
null
null
open
Rich User Interface on Embedded Linux Device === I'm designing a user interface for a large touchscreen device running Linux. What would be the best toolkit/developer kit/SDK to use? The only requirement is that its able to run on a semi-low performace device, and that there is a Linux version. Nice-to-haves would be build in support for effects/animations and a modern look-and-feel, but they are not necessary. I'm looking at Adobe Flex/AIR already, but I'm not sure if the device will meet the minimum specs.
0
78,048
09/16/2008 22:40:50
13,967
09/16/2008 21:31:46
9
0
Best way to detect an application crash and restart it?
What's the best way to detect an application crash in XP (produces the same pair of 'error' windows each time - each with same window title) and then restart it? I'm especially interested to hear of solutions that use minimal system resources as the system in question is quite old. I had thought of using a scripting language like AutoIt (http://www.autoitscript.com/autoit3/), and perhaps triggering a 'detector' script every few minutes? Any ideas, tips, or thoughts much appreciated.
windows-xp
application
crash
null
null
null
open
Best way to detect an application crash and restart it? === What's the best way to detect an application crash in XP (produces the same pair of 'error' windows each time - each with same window title) and then restart it? I'm especially interested to hear of solutions that use minimal system resources as the system in question is quite old. I had thought of using a scripting language like AutoIt (http://www.autoitscript.com/autoit3/), and perhaps triggering a 'detector' script every few minutes? Any ideas, tips, or thoughts much appreciated.
0
78,049
09/16/2008 22:41:05
3,420
08/28/2008 14:19:36
203
5
Publishing multiple sites on a single instance of umbraco
I am looking to setup a parallel site to one already that already uses umbraco for its content management system. The new site would share admins, templates, macros, and media resources, but not any content. If I setup multiple host headers pointing to the same directory with an umbraco install, how can I switch the top node (home vs home2) of the site based on which url is being accessed?
content-management-system
sites
hostheaders
umbraco
null
null
open
Publishing multiple sites on a single instance of umbraco === I am looking to setup a parallel site to one already that already uses umbraco for its content management system. The new site would share admins, templates, macros, and media resources, but not any content. If I setup multiple host headers pointing to the same directory with an umbraco install, how can I switch the top node (home vs home2) of the site based on which url is being accessed?
0
78,053
09/16/2008 22:41:20
14,238
09/16/2008 22:41:20
1
0
How to iterate over all the page breaks in an Excel 2003 worksheet via COM
I've been trying to retrieve the locations of all the page breaks on a given Excel 2003 worksheet over COM. Here's an example of the kind of thing I'm trying to do: Excel::HPageBreaksPtr pHPageBreaks = pSheet->GetHPageBreaks(); long count = pHPageBreaks->Count; for (long i=0; i < count; ++i) { Excel::HPageBreakPtr pHPageBreak = pHPageBreaks->GetItem(i+1); Excel::RangePtr pLocation = pHPageBreak->GetLocation(); printf("Page break at row %d\n", pLocation->Row); pLocation.Release(); pHPageBreak.Release(); } pHPageBreaks.Release(); I expect this to print out the row numbers of each of the horizontal page breaks in `pSheet`. The problem I'm having is that although `count` correctly indicates the number of page breaks in the worksheet, I can only ever seem to retrieve the first one. On the second run through the loop, calling `pHPageBreaks->GetItem(i)` throws an exception, with error number 0x8002000b, "invalid index". Attempting to use `pHPageBreaks->Get_NewEnum()` to get an enumerator to iterate over the collection also fails with the same error, immediately on the call to `Get_NewEnum()`. I've looked around for a solution, and the closest thing I've found so far is [http://support.microsoft.com/kb/210663/en-us][1]. I have tried activating various cells beyond the page breaks, including the cells just beyond the range to be printed, as well as the lower-right cell (IV65536), but it didn't help. If somebody can tell me how to get Excel to return the locations of all of the page breaks in a sheet, that would be awesome! Thank you. [1]: http://support.microsoft.com/kb/210663/en-us
excel
c++
com
null
null
null
open
How to iterate over all the page breaks in an Excel 2003 worksheet via COM === I've been trying to retrieve the locations of all the page breaks on a given Excel 2003 worksheet over COM. Here's an example of the kind of thing I'm trying to do: Excel::HPageBreaksPtr pHPageBreaks = pSheet->GetHPageBreaks(); long count = pHPageBreaks->Count; for (long i=0; i < count; ++i) { Excel::HPageBreakPtr pHPageBreak = pHPageBreaks->GetItem(i+1); Excel::RangePtr pLocation = pHPageBreak->GetLocation(); printf("Page break at row %d\n", pLocation->Row); pLocation.Release(); pHPageBreak.Release(); } pHPageBreaks.Release(); I expect this to print out the row numbers of each of the horizontal page breaks in `pSheet`. The problem I'm having is that although `count` correctly indicates the number of page breaks in the worksheet, I can only ever seem to retrieve the first one. On the second run through the loop, calling `pHPageBreaks->GetItem(i)` throws an exception, with error number 0x8002000b, "invalid index". Attempting to use `pHPageBreaks->Get_NewEnum()` to get an enumerator to iterate over the collection also fails with the same error, immediately on the call to `Get_NewEnum()`. I've looked around for a solution, and the closest thing I've found so far is [http://support.microsoft.com/kb/210663/en-us][1]. I have tried activating various cells beyond the page breaks, including the cells just beyond the range to be printed, as well as the lower-right cell (IV65536), but it didn't help. If somebody can tell me how to get Excel to return the locations of all of the page breaks in a sheet, that would be awesome! Thank you. [1]: http://support.microsoft.com/kb/210663/en-us
0
78,061
09/16/2008 22:42:32
14,053
09/16/2008 21:50:26
1
1
Chart controls for MFC application?
I would like to have some suggestions about which third-part controls can we use in our Visual C++ MFC application?
gui
mfc
visual-c++
null
null
null
open
Chart controls for MFC application? === I would like to have some suggestions about which third-part controls can we use in our Visual C++ MFC application?
0
78,062
09/16/2008 22:42:41
2,291
08/21/2008 14:00:19
13
4
SSRS 2005 Matrix and border styles when exporting to XLS
The Matrix in SSRS (SQL Server Reporting Services 2005) seems to have issues with certain the border styles when exporting to XLS (but not PDF or web view; maybe other formats, not sure?). For example: Create a matrix and set the Matrix border style to Black Solid 1px, but all 4 of the cells to have a border style of Black None 1px. When viewed via the ASP.NET control, it looks correct. But after export to XLS, it creates borders around all of the header cells (column and row headers, and the top left cell), and even the right most data column. But all the cells in the middle of the report correctly have no border set. Ideas?
reporting-services
reporting
asp.net
styles
reportviewer
null
open
SSRS 2005 Matrix and border styles when exporting to XLS === The Matrix in SSRS (SQL Server Reporting Services 2005) seems to have issues with certain the border styles when exporting to XLS (but not PDF or web view; maybe other formats, not sure?). For example: Create a matrix and set the Matrix border style to Black Solid 1px, but all 4 of the cells to have a border style of Black None 1px. When viewed via the ASP.NET control, it looks correct. But after export to XLS, it creates borders around all of the header cells (column and row headers, and the top left cell), and even the right most data column. But all the cells in the middle of the report correctly have no border set. Ideas?
0
78,064
09/16/2008 22:43:01
1,747
08/18/2008 12:12:28
157
22
Error code or Exception - which is the best practice for an ASP.Net web service?
I've read this [thread][1] for WCF has inbuilt Custom Fault codes and stuff. But what is the best practice for ASP.Net web services. Do I throw exceptions and let the client handle the exception or send Error code (success, failure etc) that the client would rely upon to do it's processing. [1]: http://stackoverflow.com/questions/40122/exceptions-in-web-services
web-services
asp.net
null
null
null
null
open
Error code or Exception - which is the best practice for an ASP.Net web service? === I've read this [thread][1] for WCF has inbuilt Custom Fault codes and stuff. But what is the best practice for ASP.Net web services. Do I throw exceptions and let the client handle the exception or send Error code (success, failure etc) that the client would rely upon to do it's processing. [1]: http://stackoverflow.com/questions/40122/exceptions-in-web-services
0
78,069
09/16/2008 22:44:14
3,957
09/01/2008 02:50:44
379
22
Any good PowerShell MSBuild tasks?
Anyone know of any good MSBuild tasks that will execute a PowerShell script and pass it different parameters? I was able to find [B# .NET Blog: Invoking PowerShell scripts from MSBuild][1], but I'm hoping for something that is a little more polished. If I can't find anything I will of course just go ahead and polish my own using that blog post as a starter. [1]: http://bartdesmet.net/blogs/bart/default.aspx
visual-studio
powershell
msbuild
null
null
null
open
Any good PowerShell MSBuild tasks? === Anyone know of any good MSBuild tasks that will execute a PowerShell script and pass it different parameters? I was able to find [B# .NET Blog: Invoking PowerShell scripts from MSBuild][1], but I'm hoping for something that is a little more polished. If I can't find anything I will of course just go ahead and polish my own using that blog post as a starter. [1]: http://bartdesmet.net/blogs/bart/default.aspx
0
78,077
09/16/2008 22:45:27
14,239
09/16/2008 22:41:58
1
0
Alphanumeric Sorting
What is the best/fastest way to sort Alphanumeric fields?
sorting
alphanumeric
null
null
null
null
open
Alphanumeric Sorting === What is the best/fastest way to sort Alphanumeric fields?
0
78,091
09/16/2008 22:47:41
316
08/04/2008 15:40:45
361
18
Capture stdin and stdout of system command from a Perl script
In the middle of a Perl script, there is a system command I want to execute. I have a string that contains the data that needs to be fed into stdin (the command only accepts input from stdin), and I need to capture the output written to stdout. I've looked at the various methods of executing system commands in Perl, and the `open` function seems to be what I need, except that it looks like I can only capture stdin or stdout, not both. At the moment, it seems like my best solution is to use `open`, redirect stdout into a temporary file, and read from the file after the command finishes. Is there a better solution?
perl
null
null
null
null
null
open
Capture stdin and stdout of system command from a Perl script === In the middle of a Perl script, there is a system command I want to execute. I have a string that contains the data that needs to be fed into stdin (the command only accepts input from stdin), and I need to capture the output written to stdout. I've looked at the various methods of executing system commands in Perl, and the `open` function seems to be what I need, except that it looks like I can only capture stdin or stdout, not both. At the moment, it seems like my best solution is to use `open`, redirect stdout into a temporary file, and read from the file after the command finishes. Is there a better solution?
0
78,107
09/16/2008 22:49:22
14,230
09/16/2008 22:39:57
1
0
Anyone used the Rebol programming language? What do you think of it?
Just curious if anyone has used this language much? I find it very interesting and has some good potential. http://rebol.com/ If you are using it, what are you using it for? Do you use it purely as a personal toolset/language or are you using it in a broader sense (i.e. many others use it, or the result of it)
rebol
null
null
null
null
null
open
Anyone used the Rebol programming language? What do you think of it? === Just curious if anyone has used this language much? I find it very interesting and has some good potential. http://rebol.com/ If you are using it, what are you using it for? Do you use it purely as a personal toolset/language or are you using it in a broader sense (i.e. many others use it, or the result of it)
0
78,108
09/16/2008 22:49:22
6,355
09/14/2008 18:12:35
115
12
Is there a difference between apache module vs cgi (concerning security)?
E.g. Is it more secure to use mod_php instead of php-cgi? Or is it more secure to use mod_perl instead of traditional cgi-scripts? I'm mainly interested in security concerns but speed might be an issue if there are significant differences.
php
perl
apache
mod-perl
mod-php
null
open
Is there a difference between apache module vs cgi (concerning security)? === E.g. Is it more secure to use mod_php instead of php-cgi? Or is it more secure to use mod_perl instead of traditional cgi-scripts? I'm mainly interested in security concerns but speed might be an issue if there are significant differences.
0
78,125
09/16/2008 22:50:30
14,266
09/16/2008 22:50:30
1
0
char** to a const char* const* in C
The following code snippet gives a warning in C and an error in C++: char **a; const char** b = a; I can understand and accept this.<br> The C++ solution to this problem is to change b to be a const char * const *, which disallows reassignment of the pointers and prevents you from circumventing const-correctness ([C++ FAQ][1]).<br> However, in pure C, this still gives a warning, and I don't understand why. Is there a way to get around this without using a cast? [1]: http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.17
c
const
pointers
pointer-to-pointer
const-correctness
null
open
char** to a const char* const* in C === The following code snippet gives a warning in C and an error in C++: char **a; const char** b = a; I can understand and accept this.<br> The C++ solution to this problem is to change b to be a const char * const *, which disallows reassignment of the pointers and prevents you from circumventing const-correctness ([C++ FAQ][1]).<br> However, in pure C, this still gives a warning, and I don't understand why. Is there a way to get around this without using a cast? [1]: http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.17
0
78,127
09/16/2008 22:50:43
10,947
09/16/2008 03:19:04
1
1
CGPathAddArc vs CGPathAddArcToPoint
Apple's CoreGraphics library defines two functions for describing an arc. * CGPathAddArc adds an arc based on a center point, radius, and pair of angles. * CGPathAddArcToPoint adds an arc based on a radius and a pair of tangent lines. The details are explained in [the CGPath API reference][api]. Why two functions? Simple convenience? Is one more efficient than the other? Is one defined in terms of the other? [api]: http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPath/Reference/reference.html
c
osx
drawing
core-graphics
null
null
open
CGPathAddArc vs CGPathAddArcToPoint === Apple's CoreGraphics library defines two functions for describing an arc. * CGPathAddArc adds an arc based on a center point, radius, and pair of angles. * CGPathAddArcToPoint adds an arc based on a radius and a pair of tangent lines. The details are explained in [the CGPath API reference][api]. Why two functions? Simple convenience? Is one more efficient than the other? Is one defined in terms of the other? [api]: http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPath/Reference/reference.html
0
78,141
09/16/2008 22:53:15
7,984
09/15/2008 14:50:45
11
7
Calling base.Dispose() automatically from derived classes
## Background ## We are developing a system in C# 3.0 with a relatively big class hierarchy. Some of these classes, anywhere in the hierarchy, have resources that need to be disposed of, those implement the **IDisposable** interface. ## The Problem ## Now, to facilitate maintenance and refactoring of the code I would like to find a way, for classes implementing IDisposable, to "automatically" call **base.Dispose(bDisposing)** if any ancestors also implements IDisposable. This way, if some class higher up in the hierarchy starts implementing or stops implementing IDisposable that will be taken care of automatically. The issue is two folds. - First, finding if any ancestors implements IDisposable. - Second, calling base.Dispose(bDisposing) conditionally. The first part, finding about ancestors implementing IDisposable, I have been able to deal with. The second part is the tricky one. Despite all my efforts, I haven't been able to call base.Dispose(bDisposing) from a derived class. All my attempts failed. They either caused compilation errors or called the wrong Dispose() method, that is the most derived one, thus looping forever. The main issue is that you **cannot actually refer to base.Dispose()** directly in your code if there is no such thing as an ancestor implementing it (*be reminded that there might have no ancestors yet implementing IDisposable, but I want the derived code to be ready when and if such a thing happens in the future*). That leave us with the **Reflection** mechanisms, but I did not find a proper way of doing it. Our code is quite filled with advanced reflection techniques and I think I did not miss anything obvious there. ## My Solution ## My best shot yet was to have some conditional code using in commented code. Changing the IDisposable hierarchy would either break the build (if no IDisposable ancestor exists) or throw an exception (if there are IDisposable ancestors but base.Dispose is not called). Here is some code I am posting to show you what my Dispose(bDisposing) method looks like. I am putting this code at the end of all the Dispose() methods throughout the hierarchy. Any new classes are created from templates that also includes this code. public class MyOtherClassBase { // ... } public class MyDerivedClass : MyOtherClassBase, ICalibrable { private bool m_bDisposed = false; ~MyDerivedClass() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool bDisposing) { if (!m_bDisposed) { if (bDisposing) { // Dispose managed resources } // Dispose unmanaged resources } m_bDisposed = true; Type baseType = typeof(MyDerivedClass).BaseType; if (baseType != null) { if (baseType.GetInterface("IDisposable") != null) { // If you have no ancestors implementing base.Dispose(...), comment // the following line AND uncomment the throw. // // This way, if any of your ancestors decide one day to implement // IDisposable you will know about it right away and proceed to // uncomment the base.Dispose(...) in addition to commenting the throw. //base.Dispose(bDisposing); throw new ApplicationException("Ancestor base.Dispose(...) not called - " + baseType.ToString()); } } } } **So, I am asking is there a way to call base.Dispose() automatically/conditionally instead?** ## More Background ## There is another mechanism in the application where all objects are registered with a main class. The class checks if they implement IDisposable. If so, they are disposed of properly by the application. This avoids having the code using the classes to deal with calling Dispose() all around by themselves. Thus, adding IDisposable to a class that has no ancestor history of IDisposable still works perfectly.
c#
reflection
idisposable
null
null
null
open
Calling base.Dispose() automatically from derived classes === ## Background ## We are developing a system in C# 3.0 with a relatively big class hierarchy. Some of these classes, anywhere in the hierarchy, have resources that need to be disposed of, those implement the **IDisposable** interface. ## The Problem ## Now, to facilitate maintenance and refactoring of the code I would like to find a way, for classes implementing IDisposable, to "automatically" call **base.Dispose(bDisposing)** if any ancestors also implements IDisposable. This way, if some class higher up in the hierarchy starts implementing or stops implementing IDisposable that will be taken care of automatically. The issue is two folds. - First, finding if any ancestors implements IDisposable. - Second, calling base.Dispose(bDisposing) conditionally. The first part, finding about ancestors implementing IDisposable, I have been able to deal with. The second part is the tricky one. Despite all my efforts, I haven't been able to call base.Dispose(bDisposing) from a derived class. All my attempts failed. They either caused compilation errors or called the wrong Dispose() method, that is the most derived one, thus looping forever. The main issue is that you **cannot actually refer to base.Dispose()** directly in your code if there is no such thing as an ancestor implementing it (*be reminded that there might have no ancestors yet implementing IDisposable, but I want the derived code to be ready when and if such a thing happens in the future*). That leave us with the **Reflection** mechanisms, but I did not find a proper way of doing it. Our code is quite filled with advanced reflection techniques and I think I did not miss anything obvious there. ## My Solution ## My best shot yet was to have some conditional code using in commented code. Changing the IDisposable hierarchy would either break the build (if no IDisposable ancestor exists) or throw an exception (if there are IDisposable ancestors but base.Dispose is not called). Here is some code I am posting to show you what my Dispose(bDisposing) method looks like. I am putting this code at the end of all the Dispose() methods throughout the hierarchy. Any new classes are created from templates that also includes this code. public class MyOtherClassBase { // ... } public class MyDerivedClass : MyOtherClassBase, ICalibrable { private bool m_bDisposed = false; ~MyDerivedClass() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool bDisposing) { if (!m_bDisposed) { if (bDisposing) { // Dispose managed resources } // Dispose unmanaged resources } m_bDisposed = true; Type baseType = typeof(MyDerivedClass).BaseType; if (baseType != null) { if (baseType.GetInterface("IDisposable") != null) { // If you have no ancestors implementing base.Dispose(...), comment // the following line AND uncomment the throw. // // This way, if any of your ancestors decide one day to implement // IDisposable you will know about it right away and proceed to // uncomment the base.Dispose(...) in addition to commenting the throw. //base.Dispose(bDisposing); throw new ApplicationException("Ancestor base.Dispose(...) not called - " + baseType.ToString()); } } } } **So, I am asking is there a way to call base.Dispose() automatically/conditionally instead?** ## More Background ## There is another mechanism in the application where all objects are registered with a main class. The class checks if they implement IDisposable. If so, they are disposed of properly by the application. This avoids having the code using the classes to deal with calling Dispose() all around by themselves. Thus, adding IDisposable to a class that has no ancestor history of IDisposable still works perfectly.
0
78,153
09/16/2008 22:54:14
14,278
09/16/2008 22:54:14
1
0
Cross platform RTF control?
Does anyone know of an RTF control that can be used on Linux/Windows/Mac? It's unfortunate that I have to mention it, but it actually has to be able to save and open rtf files... unlike wxWidgets wxRichTextCtrl for instance.
rtf
cross-platform
null
null
null
null
open
Cross platform RTF control? === Does anyone know of an RTF control that can be used on Linux/Windows/Mac? It's unfortunate that I have to mention it, but it actually has to be able to save and open rtf files... unlike wxWidgets wxRichTextCtrl for instance.
0
78,157
09/16/2008 22:54:34
14,200
09/16/2008 22:30:07
1
0
How can I stop bursty writes to SD/USB stalling my time-critical apps on embedded Linux?
I'm working on an embedded Linux project that interfaces an ARM9 to a hardware video encoder chip, and writes the video out to SD card or USB stick. The software architecture involves a kernel driver that reads data into a pool of buffers, and a userland app that writes the data to a file on the mounted removable device. I am finding that above a certain data rate (around 750kbyte/sec) I start to see the userland video-writing app stalling for maybe half a second, about every 5 seconds. This is enough to cause the kernel driver to run out of buffers - and even if I could increase the number of buffers, the video data has to be synchronised (ideally within 40ms) with other things that are going on in real time. Between these 5 second "lag spikes", the writes complete well within 40ms (as far as the app is concerned - I appreciate they're buffered by the OS) I think this lag spike is to do with the way Linux is flushing data out to disk - I note that pdflush is designed to wake up every 5s, my understanding is that this would be what does the writing. As soon as the stall is over the userland app is able to quickly service and write the backlog of buffers (that didn't overflow). I think the device I'm writing to has reasonable ultimate throughput: copying a 15MB file from a memory fs and waiting for sync to complete (and the usb stick's light to stop flashing) gave me a write speed of around 2.7MBytes/sec. I'm looking for two kinds of clues: 1. How can I stop the bursty writing from stalling my app - perhaps process priorities, realtime patches, or tuning the filesystem code to write continuously rather than burstily? 2. How can I make my app(s) aware of what is going on with the filesystem in terms of write backlog and throughput to the card/stick? I have the ability to change the video bitrate in the hardware codec on the fly which would be much better than dropping frames, or imposing an artificial cap on maximum allowed bitrate. Some more info: this is a 200MHz ARM9 currently running a Montavista 2.6.10-based kernel. I hope this makes sense. First embedded Linux question on stackoverflow? :)
embedded
linux
filesystems
real-time
video
null
open
How can I stop bursty writes to SD/USB stalling my time-critical apps on embedded Linux? === I'm working on an embedded Linux project that interfaces an ARM9 to a hardware video encoder chip, and writes the video out to SD card or USB stick. The software architecture involves a kernel driver that reads data into a pool of buffers, and a userland app that writes the data to a file on the mounted removable device. I am finding that above a certain data rate (around 750kbyte/sec) I start to see the userland video-writing app stalling for maybe half a second, about every 5 seconds. This is enough to cause the kernel driver to run out of buffers - and even if I could increase the number of buffers, the video data has to be synchronised (ideally within 40ms) with other things that are going on in real time. Between these 5 second "lag spikes", the writes complete well within 40ms (as far as the app is concerned - I appreciate they're buffered by the OS) I think this lag spike is to do with the way Linux is flushing data out to disk - I note that pdflush is designed to wake up every 5s, my understanding is that this would be what does the writing. As soon as the stall is over the userland app is able to quickly service and write the backlog of buffers (that didn't overflow). I think the device I'm writing to has reasonable ultimate throughput: copying a 15MB file from a memory fs and waiting for sync to complete (and the usb stick's light to stop flashing) gave me a write speed of around 2.7MBytes/sec. I'm looking for two kinds of clues: 1. How can I stop the bursty writing from stalling my app - perhaps process priorities, realtime patches, or tuning the filesystem code to write continuously rather than burstily? 2. How can I make my app(s) aware of what is going on with the filesystem in terms of write backlog and throughput to the card/stick? I have the ability to change the video bitrate in the hardware codec on the fly which would be much better than dropping frames, or imposing an artificial cap on maximum allowed bitrate. Some more info: this is a 200MHz ARM9 currently running a Montavista 2.6.10-based kernel. I hope this makes sense. First embedded Linux question on stackoverflow? :)
0
78,161
09/16/2008 22:55:54
165,305
09/16/2008 03:48:55
6
0
Assistance porting commctrl commands to C#
In a C++ app, I have an hWnd pointing to a window which contains controls which extend the COM TreeView control.<br> I use the hWnd to get an HTREEITEM using TreeView_GetRoot(hwnd) from commctrl.h hwnd points to the window and hItem is return value from TreeView_GetRoot(hwnd). They are used as follows: int iCheckState = TreeView_GetCheckState(hwnd, hItem); switch (iCheckState) { case 0: // (unchecked) case 1: // checked ... } I'm looking to port this code into a C# app which does the same thing (switches off the CheckState of the TreeView control). I have never used COM and am quite unfamiliar. I have tried using the .NET mscomctl but can't find equivalent methods to TreeView_GetRoot or TreeView_GetCheckState. I'm totally stuck and don't know how to recreate this code in C# :( Suggestions?
c#
treeview
com
null
null
null
open
Assistance porting commctrl commands to C# === In a C++ app, I have an hWnd pointing to a window which contains controls which extend the COM TreeView control.<br> I use the hWnd to get an HTREEITEM using TreeView_GetRoot(hwnd) from commctrl.h hwnd points to the window and hItem is return value from TreeView_GetRoot(hwnd). They are used as follows: int iCheckState = TreeView_GetCheckState(hwnd, hItem); switch (iCheckState) { case 0: // (unchecked) case 1: // checked ... } I'm looking to port this code into a C# app which does the same thing (switches off the CheckState of the TreeView control). I have never used COM and am quite unfamiliar. I have tried using the .NET mscomctl but can't find equivalent methods to TreeView_GetRoot or TreeView_GetCheckState. I'm totally stuck and don't know how to recreate this code in C# :( Suggestions?
0
78,172
09/16/2008 22:59:37
11,688
09/16/2008 10:13:56
1
0
Using C/Pthreads: do shared variables need to be volatile?
In the C programming language and Pthreads as the threading library; do variables/structures that are shared between threads need to be declared as volatile? Assuming that they might be protected by a lock or not (barriers perhaps). Does the pthread POSIX standard have any say about this, is this compiler-dependent or neither?
c
pthreads
multithreading
null
null
null
open
Using C/Pthreads: do shared variables need to be volatile? === In the C programming language and Pthreads as the threading library; do variables/structures that are shared between threads need to be declared as volatile? Assuming that they might be protected by a lock or not (barriers perhaps). Does the pthread POSIX standard have any say about this, is this compiler-dependent or neither?
0
78,194
09/16/2008 23:03:26
14,284
09/16/2008 22:55:52
1
0
Timed batch process in J2EE
my employer just asked me to run a timed batch process in a J2EE websphere applicatin they have running. Its supposed to run a certain class at 1130 pm everyday. I'm not very familiar with J2EE nor websphere server (or tomcat, in the develpment environment), and i've been digging around but all i've found is about the java timer class but not how to set it or invoke it. It seems that editing the web.xml file is required as well. any help will be apreciated!
java-ee
websphere
tomcat
timer
process
null
open
Timed batch process in J2EE === my employer just asked me to run a timed batch process in a J2EE websphere applicatin they have running. Its supposed to run a certain class at 1130 pm everyday. I'm not very familiar with J2EE nor websphere server (or tomcat, in the develpment environment), and i've been digging around but all i've found is about the java timer class but not how to set it or invoke it. It seems that editing the web.xml file is required as well. any help will be apreciated!
0
78,230
09/16/2008 23:10:27
1,227,001
09/16/2008 23:02:33
1
0
Compiling mxml files with ant and flex sdk
I am just getting started with flex and am using the SDK (not Flex Builder). I was wondering what's the best way to compile a mxml file from an ant build script.
flex
ant
mxml
null
null
null
open
Compiling mxml files with ant and flex sdk === I am just getting started with flex and am using the SDK (not Flex Builder). I was wondering what's the best way to compile a mxml file from an ant build script.
0
78,233
09/16/2008 23:10:38
2,916
08/25/2008 23:34:09
33
2
XML to Excel (2007) Ideas using Windows XP, and C#.Net
I have a dataset that I have modified into an xml document and then used a xsl sheet to transform into an Excel xml format in order to allow the data to be opened programatically from my application. I have run into two problems with this: 1. Excel is not the default Windows application to open Excel files, therefore when Program.Start("xmlfilename.xml") is run, IE is opened and the XML file is not very readable. 2. If you use Excel to manually open the file, you receive a warning, "This is not an excel file, do you wish to continue". This is certainly not ideal. Ideally, I would like Windows to open the file in Excel without modifying the default OS setting for opening Excel files. Office interop is a possibility, but seems like a little overkill for this application. Does anyone have any ideas to make this work? The solution is in .Net/C#, but I am open to other possibilities to create a clean solution.
c#
.net
xml
excel
null
null
open
XML to Excel (2007) Ideas using Windows XP, and C#.Net === I have a dataset that I have modified into an xml document and then used a xsl sheet to transform into an Excel xml format in order to allow the data to be opened programatically from my application. I have run into two problems with this: 1. Excel is not the default Windows application to open Excel files, therefore when Program.Start("xmlfilename.xml") is run, IE is opened and the XML file is not very readable. 2. If you use Excel to manually open the file, you receive a warning, "This is not an excel file, do you wish to continue". This is certainly not ideal. Ideally, I would like Windows to open the file in Excel without modifying the default OS setting for opening Excel files. Office interop is a possibility, but seems like a little overkill for this application. Does anyone have any ideas to make this work? The solution is in .Net/C#, but I am open to other possibilities to create a clean solution.
0
78,257
09/16/2008 23:14:16
12,178
09/16/2008 13:29:35
11
5
Any good dictioanry API available
Lot of googling did not help me! Are there any good dictionary web based available? I am looking for a site which can send me the meaning of words if we pass the word through query string!
web-services
null
null
null
null
null
open
Any good dictioanry API available === Lot of googling did not help me! Are there any good dictionary web based available? I am looking for a site which can send me the meaning of words if we pass the word through query string!
0
78,263
09/16/2008 23:15:03
9,467
09/15/2008 18:54:34
1
1
How to fix a corrupt Delphi 2009 Install
I installed both the Delphi 2009 trial and actual release via the web installer when I received them and experienced the same errors when installing both. Both times it appears that the core web installer failed when it went to spawn the additional install packages for boost, documentation and dbtools. (It brought up a findfile dialog asking for a setup.msi that didn't exist on my machine). When cancelling out of this, the installer reported a fatal error. The uninstaller did not appear in my program list, and would did not launch from the installation folder. Future attempts to bring up the installer had it in a state where it thought Delphi 2009 was already installed and it wouldn't correct or repair or uninstall it.
delphi
null
null
null
null
null
open
How to fix a corrupt Delphi 2009 Install === I installed both the Delphi 2009 trial and actual release via the web installer when I received them and experienced the same errors when installing both. Both times it appears that the core web installer failed when it went to spawn the additional install packages for boost, documentation and dbtools. (It brought up a findfile dialog asking for a setup.msi that didn't exist on my machine). When cancelling out of this, the installer reported a fatal error. The uninstaller did not appear in my program list, and would did not launch from the installation folder. Future attempts to bring up the installer had it in a state where it thought Delphi 2009 was already installed and it wouldn't correct or repair or uninstall it.
0
78,278
09/16/2008 23:17:06
1,227,001
09/16/2008 23:02:33
1
0
Clean implementation of the strategy pattern in Perl
How do I write a clean implementation of the strategy pattern in Perl? I want to do it in a way that leverages Perl's features.
perl
design-patterns
strategy
null
null
null
open
Clean implementation of the strategy pattern in Perl === How do I write a clean implementation of the strategy pattern in Perl? I want to do it in a way that leverages Perl's features.
0
78,293
09/16/2008 23:19:52
14,349
09/16/2008 23:19:52
1
0
Good book to learn to program well in Java (engineering or architecture-wise, not syntax)
I'm looking for a book to learn to "engineer" programs better. I program in Java already. Looking at the source code of open-source projects usually is too complicated as I have never made a program with more than 20 small files in it. I'm not an advanced programmer, I learned with a book and do this mostly for personal projects. My last program was a mess. I used Eclipse and put all my unrelated-files in the same package which didn't scale well. Examples of good suggestions would be: books on how to organize files in a program, on how to architect/engineer a program, books on design patterns, books on using OOP properly, books on how to mix GUI and logic code. Bad suggestions would be "learn java in 21 days", or stuff about advanced features. For example, I just saw "Interface Oriented Design" from the Pragmatic Programmers website and it seems to hit one part of what I need, but it probably won't explain how to organize files and such in a large program. Any ideas? Or perhaps ideas other than books on what I currently need? (besides participating in an open-source project, please)
java
software-engineering
architecture
oop
newbies
null
open
Good book to learn to program well in Java (engineering or architecture-wise, not syntax) === I'm looking for a book to learn to "engineer" programs better. I program in Java already. Looking at the source code of open-source projects usually is too complicated as I have never made a program with more than 20 small files in it. I'm not an advanced programmer, I learned with a book and do this mostly for personal projects. My last program was a mess. I used Eclipse and put all my unrelated-files in the same package which didn't scale well. Examples of good suggestions would be: books on how to organize files in a program, on how to architect/engineer a program, books on design patterns, books on using OOP properly, books on how to mix GUI and logic code. Bad suggestions would be "learn java in 21 days", or stuff about advanced features. For example, I just saw "Interface Oriented Design" from the Pragmatic Programmers website and it seems to hit one part of what I need, but it probably won't explain how to organize files and such in a large program. Any ideas? Or perhaps ideas other than books on what I currently need? (besides participating in an open-source project, please)
0
78,296
09/16/2008 23:21:23
14,322
09/16/2008 23:11:45
1
0
Reasons why PHP would echo errors, even with error_reporting(0)?
What are some reasons why php would force errors to show, no matter what you tell it to disable? I have tried error_reporting(0) and ini_set('display_errors',0) with no luck.
php
error-reporting
ini-set
null
null
null
open
Reasons why PHP would echo errors, even with error_reporting(0)? === What are some reasons why php would force errors to show, no matter what you tell it to disable? I have tried error_reporting(0) and ini_set('display_errors',0) with no luck.
0
78,303
09/16/2008 23:22:26
5,190
09/08/2008 12:03:43
1,670
110
Remoting facilities on Visual Studio 2008
I'm toying with my first remoting project and I need to create a RemotableType DLL. I know I can compile it by hand with csc, but I wonder if there are some facilities in place on Visual Studio to handle the Remoting case, or, more specificly, to tell it that a specific file should be compiled as a .dll without having to add another project to a solution exclusively to compile a class or two into DLLs. NOTE: I know I should toy with my first WCF project, but this has to run on 2.0.
c#
remoting
visual-studio
null
null
null
open
Remoting facilities on Visual Studio 2008 === I'm toying with my first remoting project and I need to create a RemotableType DLL. I know I can compile it by hand with csc, but I wonder if there are some facilities in place on Visual Studio to handle the Remoting case, or, more specificly, to tell it that a specific file should be compiled as a .dll without having to add another project to a solution exclusively to compile a class or two into DLLs. NOTE: I know I should toy with my first WCF project, but this has to run on 2.0.
0
78,319
09/16/2008 23:25:16
13,958
09/16/2008 21:27:24
1
1
Writing a book and targeting PDF and HTML
I have an idea for a combination book and web app to help newbies learn computer programming from the ground up, and while I'm working on the web app side of it, I've been thinking in the back of my mind about the best way to do the book. Can anyone share their experiences with similar projects? Here are my requirements: - Source must be plain text files in some markup language. (I want to be able to use version control, arbitrarly choose my editor, etc.) - Must compile or build to produce pretty PDF output (on par with [LaTeX][1]) **and** HTML - Include custom HTML/JavaScript macros in the HTML edition. For example, I want an "open this in my workspace" link on each sample code block in the HTML edition of the book but not the PDF edition. I might also want to include links to create/edit a forum thread at the bottom of each section in the HTML, including text like "There are (x) comments about this section in the Forum." (Clearly this will involve some web server-side code.) So far it looks like my best bet is LaTeX source, pdflatex output for PDF, and some custom hacking of [latex2html][2] to produce the HTML output I want. My past experience with LaTeX tells me it's very powerful but can sometimes be klunky and awkward. [lout][3] looks very appealing but doesn't seem to have very good built-in or third-party support for HTML. And the last option I was thinking of would be to write the book in a non-presentation format such as [Zim][4] Desktop Wiki (my favorite outliner/note taker app) and write scripts to translate this source to HTML and to lout. Do any of these ideas sound particularly good or particularly idiotic? Who has built a technical book and targeted more than one output format? [1]: http://en.wikipedia.org/wiki/LaTeX [2]: http://www.latex2html.org/ [3]: http://lout.wiki.sourceforge.net/ [4]: http://zim-wiki.org/
html
pdf
latex
book
publishing
null
open
Writing a book and targeting PDF and HTML === I have an idea for a combination book and web app to help newbies learn computer programming from the ground up, and while I'm working on the web app side of it, I've been thinking in the back of my mind about the best way to do the book. Can anyone share their experiences with similar projects? Here are my requirements: - Source must be plain text files in some markup language. (I want to be able to use version control, arbitrarly choose my editor, etc.) - Must compile or build to produce pretty PDF output (on par with [LaTeX][1]) **and** HTML - Include custom HTML/JavaScript macros in the HTML edition. For example, I want an "open this in my workspace" link on each sample code block in the HTML edition of the book but not the PDF edition. I might also want to include links to create/edit a forum thread at the bottom of each section in the HTML, including text like "There are (x) comments about this section in the Forum." (Clearly this will involve some web server-side code.) So far it looks like my best bet is LaTeX source, pdflatex output for PDF, and some custom hacking of [latex2html][2] to produce the HTML output I want. My past experience with LaTeX tells me it's very powerful but can sometimes be klunky and awkward. [lout][3] looks very appealing but doesn't seem to have very good built-in or third-party support for HTML. And the last option I was thinking of would be to write the book in a non-presentation format such as [Zim][4] Desktop Wiki (my favorite outliner/note taker app) and write scripts to translate this source to HTML and to lout. Do any of these ideas sound particularly good or particularly idiotic? Who has built a technical book and targeted more than one output format? [1]: http://en.wikipedia.org/wiki/LaTeX [2]: http://www.latex2html.org/ [3]: http://lout.wiki.sourceforge.net/ [4]: http://zim-wiki.org/
0
78,336
09/16/2008 23:28:43
13,912
09/16/2008 21:17:00
13
0
hard drive device name on solaris
I need to figure out the hard drive name for a solaris box and it is not clear to me what the device name is. On linux, it would be something like /dev/hda or /dev/sda, but on solaris I am getting a bit lost in the partitions and what the device is called. I think that entries like /dev/rdsk/c0t0d0s0 are the partitions, how is the whole hard drive referenced?
solaris
null
null
null
null
null
open
hard drive device name on solaris === I need to figure out the hard drive name for a solaris box and it is not clear to me what the device name is. On linux, it would be something like /dev/hda or /dev/sda, but on solaris I am getting a bit lost in the partitions and what the device is called. I think that entries like /dev/rdsk/c0t0d0s0 are the partitions, how is the whole hard drive referenced?
0
78,339
09/16/2008 23:29:24
893
08/10/2008 08:27:00
3,646
148
Extract relevant changes for code review
I'm working on a project with a team where we check in early and often. Individual checkins are completed to the satisfaction of the developer doing the change (including tests where possible) but sometimes the direction of work changes slightly and previous commits need to be reverted and done another way. Or, stub code is filled out in later commits. When it comes time for code review, there's a sequence of commits all tagged with the same bug tracking id number. It's easy to get a list of such changes. When a reviewer looks through the changes one by one, sometimes there will be a commit A that is undone or modified by a later commit B as part of the same review. This can make reviewing more difficult. If only one developer was working on the file for the duration of the change, then it's easy to do a diff between the original state of the file and the final state of the file. The problem arises when another developer happens to have made unrelated changes in the same file, or even in the same functions. How do you handle this situation? Are there tools that, given a sequence of patches to a file, can give the moral equivalent of a diff between the first and last versions, but only including a subset of those patches? Come to think of it, I could create a temporary branch in git starting from before the first related change, and cherry-pick the changes relevant to the review. Hopefully there won't be too many conflicts that need to be resolved (and if there are, then the whole lot should be reviewed at once anyway). Any other ideas?
code-review
diff
version-control
null
null
null
open
Extract relevant changes for code review === I'm working on a project with a team where we check in early and often. Individual checkins are completed to the satisfaction of the developer doing the change (including tests where possible) but sometimes the direction of work changes slightly and previous commits need to be reverted and done another way. Or, stub code is filled out in later commits. When it comes time for code review, there's a sequence of commits all tagged with the same bug tracking id number. It's easy to get a list of such changes. When a reviewer looks through the changes one by one, sometimes there will be a commit A that is undone or modified by a later commit B as part of the same review. This can make reviewing more difficult. If only one developer was working on the file for the duration of the change, then it's easy to do a diff between the original state of the file and the final state of the file. The problem arises when another developer happens to have made unrelated changes in the same file, or even in the same functions. How do you handle this situation? Are there tools that, given a sequence of patches to a file, can give the moral equivalent of a diff between the first and last versions, but only including a subset of those patches? Come to think of it, I could create a temporary branch in git starting from before the first related change, and cherry-pick the changes relevant to the review. Hopefully there won't be too many conflicts that need to be resolved (and if there are, then the whole lot should be reviewed at once anyway). Any other ideas?
0
78,352
09/16/2008 23:31:15
9,628
09/15/2008 19:24:42
74
7
What runs in a C heap vs a Java heap in HP-UX environment JVMs?
I've been running into a peculiar issue with certain Java applications in the HP-UX environment. The heap is set to -mx512, yet, looking at the memory regions for this java process using gpm, it shows it using upwards of 1.6GBs of RSS memory, with 1.1GB allocated to the DATA region. Grows quite rapidly over a 24-48hour period and then slows down substantially, still growing 2MB every few hours. However, the Java heap shows no sign of leakage. Curious how this was possible I researched a bit and found this HP write-up on memory leaks in java heap and c heap: http://docs.hp.com/en/JAVAPERFTUNE/Memory-Management.pdf My question is what determines what is ran in the C heap vs the java heap, and for things that do not run through the java heap, how would you identify those objects being run on the C heap? Additionally does the java heap sit inside the C heap?
java
c
jvm
heap
hp-ux
null
open
What runs in a C heap vs a Java heap in HP-UX environment JVMs? === I've been running into a peculiar issue with certain Java applications in the HP-UX environment. The heap is set to -mx512, yet, looking at the memory regions for this java process using gpm, it shows it using upwards of 1.6GBs of RSS memory, with 1.1GB allocated to the DATA region. Grows quite rapidly over a 24-48hour period and then slows down substantially, still growing 2MB every few hours. However, the Java heap shows no sign of leakage. Curious how this was possible I researched a bit and found this HP write-up on memory leaks in java heap and c heap: http://docs.hp.com/en/JAVAPERFTUNE/Memory-Management.pdf My question is what determines what is ran in the C heap vs the java heap, and for things that do not run through the java heap, how would you identify those objects being run on the C heap? Additionally does the java heap sit inside the C heap?
0
78,360
09/16/2008 23:32:10
14,372
09/16/2008 23:32:09
1
0
Absolute Minimum Requirements for Good Software Design
I am trying to write a spec for a software application. The application takes inputs from static files (configuration data), files that it obtained by ftp, and "live" data obtained via a TCP socket. It does some stuff and generates output data, which is delivered to somebody else via a TCP socket. It is not so difficult to write a spec describing what the system should do when nothing goes wrong and even describing what it should do when certain things go wrong. But recent experience has told me that it might be a good idea to include explicitly what some people might call "no-brainers". Like keep the user-configurable data separate from the software, so when an upgrade is installed, it doesn't clobber the user data. Or have user-configurable levels of error logging. Things like that. Does anyone have a list of basic requirements that they would want *any* system to have and that *any* decent software developer would do more or less automatically?
software-engineering
null
null
null
null
null
open
Absolute Minimum Requirements for Good Software Design === I am trying to write a spec for a software application. The application takes inputs from static files (configuration data), files that it obtained by ftp, and "live" data obtained via a TCP socket. It does some stuff and generates output data, which is delivered to somebody else via a TCP socket. It is not so difficult to write a spec describing what the system should do when nothing goes wrong and even describing what it should do when certain things go wrong. But recent experience has told me that it might be a good idea to include explicitly what some people might call "no-brainers". Like keep the user-configurable data separate from the software, so when an upgrade is installed, it doesn't clobber the user data. Or have user-configurable levels of error logging. Things like that. Does anyone have a list of basic requirements that they would want *any* system to have and that *any* decent software developer would do more or less automatically?
0
78,389
09/16/2008 23:37:01
769
08/08/2008 17:19:27
33
2
RhinoMocks: Correct way to mock property getter
I'm new to RhinoMocks, and trying to get a grasp on the syntax in addition to what is happening under the hood. I have a user object, we'll call it User, which has a property called IsAdministrator. The value for IsAdministrator is evaluated via another class that checks the User's security permissions, and returns either true or false based on those permissions. I'm trying to mock this User class, and fake the return value for IsAdministrator in order to isolate some Unit Tests. This is what I'm doing so far: public void CreateSomethingIfUserHasAdminPermissions() { User user = _mocks.StrictMock<User>(); SetupResult.For(user.IsAdministrator).Return(true); // do something with my User object } Now, I'm expecting that Rhino is going to 'fake' the call to the property getter, and just return true to me. Is this incorrect? Currently I'm getting an exception because of dependencies in the IsAdministrator property. Can someone explain how I can achieve my goal here?
tdd
rhino-mocks
null
null
null
null
open
RhinoMocks: Correct way to mock property getter === I'm new to RhinoMocks, and trying to get a grasp on the syntax in addition to what is happening under the hood. I have a user object, we'll call it User, which has a property called IsAdministrator. The value for IsAdministrator is evaluated via another class that checks the User's security permissions, and returns either true or false based on those permissions. I'm trying to mock this User class, and fake the return value for IsAdministrator in order to isolate some Unit Tests. This is what I'm doing so far: public void CreateSomethingIfUserHasAdminPermissions() { User user = _mocks.StrictMock<User>(); SetupResult.For(user.IsAdministrator).Return(true); // do something with my User object } Now, I'm expecting that Rhino is going to 'fake' the call to the property getter, and just return true to me. Is this incorrect? Currently I'm getting an exception because of dependencies in the IsAdministrator property. Can someone explain how I can achieve my goal here?
0
78,392
09/16/2008 23:38:21
7,946
09/15/2008 14:45:19
76
4
How to install php-gtk in the Acer Aspire One?
I have an application that works pretty well in Ubuntu, Windows and the Xandros that come with the Asus EeePC. Now we are moving to the <a href="http://en.wikipedia.org/wiki/Aspire_One">Acer Aspire One</a> but I'm having a lot of trouble making php-gtk to compile under the Fedora-like (Linpus Linux Lite) Linux that come with it.
php
aceraspireone
phpgtk
fedora
linpuslinuxlite
null
open
How to install php-gtk in the Acer Aspire One? === I have an application that works pretty well in Ubuntu, Windows and the Xandros that come with the Asus EeePC. Now we are moving to the <a href="http://en.wikipedia.org/wiki/Aspire_One">Acer Aspire One</a> but I'm having a lot of trouble making php-gtk to compile under the Fedora-like (Linpus Linux Lite) Linux that come with it.
0
78,422
09/16/2008 23:45:38
10,216
09/15/2008 21:43:25
1
0
How Many Network Connections Can a Computer Support?
When writing a custom server, what are the best practices or techniques to determine maximum number of users that can connect to the server at any given time? I would assume that the capabilities of the computer hardware, network capacity, and server protocol would all be important factors. Also, would you consider it to be a good practice to limit the number of network connections to a certain maximum number of users? Or should the server not limit the number of network connections and let performance degrade until the response time is extremely high?
networking
network-programming
null
null
null
null
open
How Many Network Connections Can a Computer Support? === When writing a custom server, what are the best practices or techniques to determine maximum number of users that can connect to the server at any given time? I would assume that the capabilities of the computer hardware, network capacity, and server protocol would all be important factors. Also, would you consider it to be a good practice to limit the number of network connections to a certain maximum number of users? Or should the server not limit the number of network connections and let performance degrade until the response time is extremely high?
0
78,431
09/16/2008 23:46:47
12,650
09/16/2008 15:06:46
1
1
Redirect command to input of another in Python
I would like to replicate this in python: gvimdiff <(hg cat file.txt) file.txt (hg cat file.txt outputs the most recently committed version of file.txt) I know how to pipe the file to gvimdiff, but it won't accept another file: $ hg cat file.txt | gvimdiff file.txt - Too many edit arguments: "-" Getting to the python part... # hgdiff.py import subprocess import sys file = sys.argv[1] subprocess.call(["gvimdiff", "<(hg cat %s)" % file, file]) When subprocess is called it merely passes <code><(hg cat file)</code> onto <code>gvimdiff</code> as a filename. So, is there any way to redirect a command as bash does? For simplicity's sake just cat a file and redirect it to diff: diff <(cat file.txt) file.txt
python
bash
diff
redirect
vimdiff
null
open
Redirect command to input of another in Python === I would like to replicate this in python: gvimdiff <(hg cat file.txt) file.txt (hg cat file.txt outputs the most recently committed version of file.txt) I know how to pipe the file to gvimdiff, but it won't accept another file: $ hg cat file.txt | gvimdiff file.txt - Too many edit arguments: "-" Getting to the python part... # hgdiff.py import subprocess import sys file = sys.argv[1] subprocess.call(["gvimdiff", "<(hg cat %s)" % file, file]) When subprocess is called it merely passes <code><(hg cat file)</code> onto <code>gvimdiff</code> as a filename. So, is there any way to redirect a command as bash does? For simplicity's sake just cat a file and redirect it to diff: diff <(cat file.txt) file.txt
0
78,447
09/16/2008 23:51:30
12,854
09/16/2008 15:59:33
21
1
How to create a DOM from a User's input in PHP5?
I can't seem to find any decent info about this on the web. Any advice?
php
web-applications
dom
php5
null
null
open
How to create a DOM from a User's input in PHP5? === I can't seem to find any decent info about this on the web. Any advice?
0
78,450
09/16/2008 23:52:04
14,382
09/16/2008 23:37:04
1
0
Python ReportLab use of splitfirst/splitlast
I'm trying to use Python with ReportLab 2.2 to create a PDF report. According to the [user guide](http://www.reportlab.com/docs/userguide.pdf), > Special TableStyle Indeces [sic] > > In any style command the first row index may be set to one of the special strings 'splitlast' or 'splitfirst' to indicate that the style should be used only for the last row of a split table, or the first row of a continuation. This allows splitting tables with nicer effects around the split. I've tried using several style elements, including: ('TEXTCOLOR', (0, 'splitfirst'), (1, 'splitfirst'), colors.black) ('TEXTCOLOR', (0, 'splitfirst'), (1, 0), colors.black) ('TEXTCOLOR', (0, 'splitfirst'), (1, -1), colors.black) and none of these seems to work. The first generates a TypeError with the message: TypeError: cannot concatenate 'str' and 'int' objects and the latter two generate TypeErrors with the message: TypeError: an integer is required Is this functionality simply broken or am I doing something wrong? If the latter, what am I doing wrong?
python
reportlab
null
null
null
null
open
Python ReportLab use of splitfirst/splitlast === I'm trying to use Python with ReportLab 2.2 to create a PDF report. According to the [user guide](http://www.reportlab.com/docs/userguide.pdf), > Special TableStyle Indeces [sic] > > In any style command the first row index may be set to one of the special strings 'splitlast' or 'splitfirst' to indicate that the style should be used only for the last row of a split table, or the first row of a continuation. This allows splitting tables with nicer effects around the split. I've tried using several style elements, including: ('TEXTCOLOR', (0, 'splitfirst'), (1, 'splitfirst'), colors.black) ('TEXTCOLOR', (0, 'splitfirst'), (1, 0), colors.black) ('TEXTCOLOR', (0, 'splitfirst'), (1, -1), colors.black) and none of these seems to work. The first generates a TypeError with the message: TypeError: cannot concatenate 'str' and 'int' objects and the latter two generate TypeErrors with the message: TypeError: an integer is required Is this functionality simply broken or am I doing something wrong? If the latter, what am I doing wrong?
0
78,453
09/16/2008 23:52:15
1,541
08/16/2008 13:56:32
184
9
How do I estimate tasks using function points?
What are the steps to estimating using function points? Is there a quick-reference guide of some sort out there?
estimation
project-planning
null
null
null
null
open
How do I estimate tasks using function points? === What are the steps to estimating using function points? Is there a quick-reference guide of some sort out there?
0
78,471
09/16/2008 23:55:18
10,422
09/15/2008 23:01:57
1
1
Date object last modified
How can I find out the date an SQL object was last modified? I need to get a list of all the views, procs, functions etc that were modified since Aug 15th. In sysObjects I can see the date objects were created but I need to know when they were last altered.
sql-server
null
null
null
null
null
open
Date object last modified === How can I find out the date an SQL object was last modified? I need to get a list of all the views, procs, functions etc that were modified since Aug 15th. In sysObjects I can see the date objects were created but I need to know when they were last altered.
0
78,474
09/16/2008 23:55:42
9,418
09/15/2008 18:45:02
1
2
Determine if a string is an integer or a float in ANSI C
Using only ANSI C, what is the best way to, with fair certainty, determine if a C style string is either a integer or a real number (i.e float/double)?
c
floating-point
numbers
ansi-c
null
null
open
Determine if a string is an integer or a float in ANSI C === Using only ANSI C, what is the best way to, with fair certainty, determine if a C style string is either a integer or a real number (i.e float/double)?
0
78,475
09/16/2008 23:55:59
62
08/01/2008 14:21:21
61
6
In Delphi, is TDataSet thread safe?
I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations, so I'm wondering if anyone has done this before. I've seen some sample apps where a TDataSet is created in a separate thread, it's opened and then data is read from it, but that's all done in the separate thread. I'm wondering if it's safe to read from the TDataSet from the main VCL thread after the other thread opens the data source. I'm doing Win32 programming in Delphi 7, using TmySQLQuery from [DAC for MySQL](http://www.microolap.com/products/connectivity/mysqldac/) as my TDataSet descendant.
delphi
multithreading
null
null
null
null
open
In Delphi, is TDataSet thread safe? === I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations, so I'm wondering if anyone has done this before. I've seen some sample apps where a TDataSet is created in a separate thread, it's opened and then data is read from it, but that's all done in the separate thread. I'm wondering if it's safe to read from the TDataSet from the main VCL thread after the other thread opens the data source. I'm doing Win32 programming in Delphi 7, using TmySQLQuery from [DAC for MySQL](http://www.microolap.com/products/connectivity/mysqldac/) as my TDataSet descendant.
0
78,477
09/16/2008 23:56:34
4,787
09/05/2008 15:36:12
34
1
.NET and AMF
How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF. I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious.
.net
flex
null
null
null
null
open
.NET and AMF === How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF. I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious.
0
78,493
09/16/2008 23:59:32
14,345
09/16/2008 23:18:38
1
1
$$ in Bash.
I once read that one way to obtain a unique filename in bash for temp files was to use a double dollar sign ($$). This does produce a number that varies from time to time... but if you call it repeatedly, it returns the same number. (The solution is to just use the time.) I am curious to know what $$ actually is, and why it would be suggested as a way to generate unique filenames.
bash
shell
sripts
null
null
null
open
$$ in Bash. === I once read that one way to obtain a unique filename in bash for temp files was to use a double dollar sign ($$). This does produce a number that varies from time to time... but if you call it repeatedly, it returns the same number. (The solution is to just use the time.) I am curious to know what $$ actually is, and why it would be suggested as a way to generate unique filenames.
0
78,497
09/17/2008 00:00:03
14,437
09/17/2008 00:00:03
1
0
design patterns or best practices for shell scripts
Does anyone know of any resources that talk about best practices or design patterns for shell scripts (sh, bash etc...)?
design-patterns
bash
shell
null
null
05/30/2012 11:07:42
not constructive
design patterns or best practices for shell scripts === Does anyone know of any resources that talk about best practices or design patterns for shell scripts (sh, bash etc...)?
4
78,523
09/17/2008 00:04:34
10,738
09/16/2008 01:25:21
275
10
OpenID Migration
I'm curious about OpenID. While I agree that the idea of unified credentials is great, I have a few reservations. What is to prevent an OpenID provider from going crazy and holding the OpenID accounts they have hostage until you pay $n? If I decide I don't like the provider I'm with this there a way to migrate to a different provider with out losing all my information at various sites?
openid
null
null
null
null
null
open
OpenID Migration === I'm curious about OpenID. While I agree that the idea of unified credentials is great, I have a few reservations. What is to prevent an OpenID provider from going crazy and holding the OpenID accounts they have hostage until you pay $n? If I decide I don't like the provider I'm with this there a way to migrate to a different provider with out losing all my information at various sites?
0
78,536
09/17/2008 00:06:27
3,742
08/30/2008 14:08:11
173
19
Cloning objects in C#
I want to do something like... myObject myObj = GetmyObj()//create and fill a new object myObject newObj = myObj.Clone(); ...and then make changes to the new object that are not reflected in the original object. I don't often need this functionality so when it's been necessary I've resorted to creating a new object and then copying each property individually but it always leaves me with the feeling that there is a better/more elegant way of handling the situation. How can I clone/deep copy an object so that the cloned object can be modified without any changes being reflected in the original object?
c#
.net
clone
null
null
null
open
Cloning objects in C# === I want to do something like... myObject myObj = GetmyObj()//create and fill a new object myObject newObj = myObj.Clone(); ...and then make changes to the new object that are not reflected in the original object. I don't often need this functionality so when it's been necessary I've resorted to creating a new object and then copying each property individually but it always leaves me with the feeling that there is a better/more elegant way of handling the situation. How can I clone/deep copy an object so that the cloned object can be modified without any changes being reflected in the original object?
0
78,548
09/17/2008 00:08:39
347,616
09/16/2008 14:01:59
11
1
Passing data to Master Page in ASP.NET MVC
What is your way of passing data to Master Page (using ASP.NET MVC) without breaking MVC rules? Personally, I prefer to code abstract controller (base controller) or base class which is passed to all views.
c#
.net
asp.net
asp.net-mvc
null
null
open
Passing data to Master Page in ASP.NET MVC === What is your way of passing data to Master Page (using ASP.NET MVC) without breaking MVC rules? Personally, I prefer to code abstract controller (base controller) or base class which is passed to all views.
0
78,560
09/17/2008 00:10:52
10,135
09/15/2008 21:22:39
1
0
Locked SQL Server Data Files
I have an SQL Server database where I have the data and log files stored on an external USB drive. I switch the external drive between my main development machine in my office and my laptop when not in my office. I am trying to use sp_detach_db and sp_attach_db when moving between desktop and laptop machines. I find that this works OK on the desktop - I can detach and reattach the database there no problems. But on the laptop I cannot reattach the database (the database was actually originally created on the laptop and the first detach happened there). When I try to reattach on the laptop I get the following error: Unable to open the physical file "p:\SQLData\AppManager.mdf". Operating system error 5: "5(error not found)" I find a lot of references to this error all stating that it is a permissions issue. So I went down this path and made sure that the SQL Server service account has appropriate permissions. I have also created a new database on this same path and been able to succesfully detach and reattach it. So I am confident permissions is not the issue. Further investigation reveals that I cannot rename or move the data files as Windows thinks they are locked. Process Explorer does not show up any process locking the files. How can I find out what is locking the files and unlock them.
sql-server-2005
attach
lockedfiles
null
null
null
open
Locked SQL Server Data Files === I have an SQL Server database where I have the data and log files stored on an external USB drive. I switch the external drive between my main development machine in my office and my laptop when not in my office. I am trying to use sp_detach_db and sp_attach_db when moving between desktop and laptop machines. I find that this works OK on the desktop - I can detach and reattach the database there no problems. But on the laptop I cannot reattach the database (the database was actually originally created on the laptop and the first detach happened there). When I try to reattach on the laptop I get the following error: Unable to open the physical file "p:\SQLData\AppManager.mdf". Operating system error 5: "5(error not found)" I find a lot of references to this error all stating that it is a permissions issue. So I went down this path and made sure that the SQL Server service account has appropriate permissions. I have also created a new database on this same path and been able to succesfully detach and reattach it. So I am confident permissions is not the issue. Further investigation reveals that I cannot rename or move the data files as Windows thinks they are locked. Process Explorer does not show up any process locking the files. How can I find out what is locking the files and unlock them.
0
78,570
09/17/2008 00:12:09
184
08/03/2008 05:34:19
2,420
48
Which JavaScript library is recommended for neat UI effects?
I need a JavaScript library that supports Ajax as well as help me in making simple and neat animation effects [in a website][1] I am working on. Which library do you recommend? [1]: http://www.voidy.com/
javascript
html
javascript-library
null
null
null
open
Which JavaScript library is recommended for neat UI effects? === I need a JavaScript library that supports Ajax as well as help me in making simple and neat animation effects [in a website][1] I am working on. Which library do you recommend? [1]: http://www.voidy.com/
0
78,586
09/17/2008 00:13:56
1,322
08/14/2008 14:11:10
198
8
Create a calendar event on Palm OS
I've been googling for a while now, and can't figure out how to create an event in the calendar on a newer Palm OS device. Any ideas on how to do this? I'm guessing that I'll be creating a record in the calendar database, but the format of the data in that record, and which database to put it in, I don't know.
palm-os
null
null
null
null
null
open
Create a calendar event on Palm OS === I've been googling for a while now, and can't figure out how to create an event in the calendar on a newer Palm OS device. Any ideas on how to do this? I'm guessing that I'll be creating a record in the calendar database, but the format of the data in that record, and which database to put it in, I don't know.
0
78,590
09/17/2008 00:14:45
14,470
09/17/2008 00:14:45
1
0
Similar thing to RJS (used in Ruby on Rails) in the Java web app world ?
In Ruby on Rails, there's RJS templates that help do AJAX by returning javascript code that will be executed in the client browser. How can I do a similar thing in the Java/J2EE world? Is Google Widget Toolkit similar to RJS? What options do I have?
java
rubyonrails
null
null
null
null
open
Similar thing to RJS (used in Ruby on Rails) in the Java web app world ? === In Ruby on Rails, there's RJS templates that help do AJAX by returning javascript code that will be executed in the client browser. How can I do a similar thing in the Java/J2EE world? Is Google Widget Toolkit similar to RJS? What options do I have?
0
78,592
09/17/2008 00:15:13
10,747
09/16/2008 01:28:47
1
0
What is a good equivalent to Perl lists in bash?
In perl one would simply do the following to store and iterate over a list of names my @fruit = (apple, orange, kiwi); foreach (@fruit) { print $_; } What would the equivalent be in bash?
unix
bash
null
null
null
null
open
What is a good equivalent to Perl lists in bash? === In perl one would simply do the following to store and iterate over a list of names my @fruit = (apple, orange, kiwi); foreach (@fruit) { print $_; } What would the equivalent be in bash?
0
78,619
09/17/2008 00:20:06
10,184
09/15/2008 21:36:31
6
0
What is the fastest way to convert float to int on x86
What is the fastest way you know to convert a floating-point number to an int on an x86 CPU. Preferrably in C or assembly (that can be in-lined in C) for any combination of the following: - 32/64/80-bit float -> 32/64-bit integer I'm looking for some technique that is faster than to just let the compiler do it.
c
optimization
floating-point
x86
null
null
open
What is the fastest way to convert float to int on x86 === What is the fastest way you know to convert a floating-point number to an int on an x86 CPU. Preferrably in C or assembly (that can be in-lined in C) for any combination of the following: - 32/64/80-bit float -> 32/64-bit integer I'm looking for some technique that is faster than to just let the compiler do it.
0
78,621
09/17/2008 00:20:35
255
08/04/2008 05:46:02
1,348
42
What do I need to start using Embedded Firebird with Delphi?
I wan a good lightweight FOSS embedded database to use with Delphi. I've used [DBISAM by Elevate Software][1] for years and I just love it, but I like to share the source on some of my utilities, and it is closed source commercial. Someone suggested Embedded Firebird as a FOSS alternative. Curious what experience others have had with Embedded Firebird and some good resources to get started with it. I know CodeGear offers BlackFish SQL and Interbase, but they have license restrictions. Thanks! [1]: http://www.elevatesoft.com/
delphi
foss
firebird
emdeded-database
null
null
open
What do I need to start using Embedded Firebird with Delphi? === I wan a good lightweight FOSS embedded database to use with Delphi. I've used [DBISAM by Elevate Software][1] for years and I just love it, but I like to share the source on some of my utilities, and it is closed source commercial. Someone suggested Embedded Firebird as a FOSS alternative. Curious what experience others have had with Embedded Firebird and some good resources to get started with it. I know CodeGear offers BlackFish SQL and Interbase, but they have license restrictions. Thanks! [1]: http://www.elevatesoft.com/
0
78,626
09/17/2008 00:21:09
9,754
09/15/2008 19:53:28
1
0
Is it stupid to write a large batch processing program entirely in PL/SQL?
I'm starting work on a program which is perhaps most naturally described as a batch of calculations on database tables, and will be executed once a month. All input is in Oracle database tables, and all output will be to Oracle database tables. The program should stay maintainable for many years to come. It seems straight-forward to implement this as a series of stored procedures, each performing a sensible transformation, for example distributing costs among departments according to some business rules. I can then write unit tests to check if the output of each transformation is as I expected. Is it a bad idea to do this all in PL/SQL? Would you rather do heavy batch calculations in a typical object oriented programming language, such as C#? Isn't it more expressive to use a database centric programming language such as PL/SQL?
oracle
design
plsql
batch-processing
null
null
open
Is it stupid to write a large batch processing program entirely in PL/SQL? === I'm starting work on a program which is perhaps most naturally described as a batch of calculations on database tables, and will be executed once a month. All input is in Oracle database tables, and all output will be to Oracle database tables. The program should stay maintainable for many years to come. It seems straight-forward to implement this as a series of stored procedures, each performing a sensible transformation, for example distributing costs among departments according to some business rules. I can then write unit tests to check if the output of each transformation is as I expected. Is it a bad idea to do this all in PL/SQL? Would you rather do heavy batch calculations in a typical object oriented programming language, such as C#? Isn't it more expressive to use a database centric programming language such as PL/SQL?
0
78,639
09/17/2008 00:22:51
4,920
09/06/2008 16:40:28
1
0
What should a conference newbie bring to make the most out of their first conference?
I am planning to attend my first developer conference (Microsoft TechDays 2008 in Toronto). I have been looking around for suggestions so that I can prepare and make the most out of my first developer conference. Many articles make suggestions about asking questions, getting involved, being social. These are great! I am also wondering about physical items. I have seen many conference photos with most of the audience having their laptops. Are they just taking notes? Are they working on a problem during the session? Are these photos just during a break and everyone is catching up on blogs/email/outside contact? Thank you StackOverflow-ers (StackOverflow-ites?)
conferences
newbies
self-improvement
null
null
03/02/2012 20:23:50
not constructive
What should a conference newbie bring to make the most out of their first conference? === I am planning to attend my first developer conference (Microsoft TechDays 2008 in Toronto). I have been looking around for suggestions so that I can prepare and make the most out of my first developer conference. Many articles make suggestions about asking questions, getting involved, being social. These are great! I am also wondering about physical items. I have seen many conference photos with most of the audience having their laptops. Are they just taking notes? Are they working on a problem during the session? Are these photos just during a break and everyone is catching up on blogs/email/outside contact? Thank you StackOverflow-ers (StackOverflow-ites?)
4
78,641
09/17/2008 00:23:28
9,611
09/15/2008 19:21:17
188
14
A Good 3D mesh library
I'm looking for a good 3D Mesh library - Should be able to read popular formats (OFF, OBJ...) - Should support both half-edge structure and a triangle soup - Should be tolerant to faults and illegal meshes. - Basic geometric operations - intersections, normal calculation, etc' - Most importantly - Should not be convoluted with endless template and inheritance hierarchies. I've tried both CGAL and OpenMesh but both fail miserably in the last point. Specifically CGAL which is impossible to follow even with the most advanced code analysis tools. So far I'm seriously considering to pull my own. My preference is C++ but I'm open to other options.
graphics
math
3d
mesh
null
06/14/2012 04:33:31
not constructive
A Good 3D mesh library === I'm looking for a good 3D Mesh library - Should be able to read popular formats (OFF, OBJ...) - Should support both half-edge structure and a triangle soup - Should be tolerant to faults and illegal meshes. - Basic geometric operations - intersections, normal calculation, etc' - Most importantly - Should not be convoluted with endless template and inheritance hierarchies. I've tried both CGAL and OpenMesh but both fail miserably in the last point. Specifically CGAL which is impossible to follow even with the most advanced code analysis tools. So far I'm seriously considering to pull my own. My preference is C++ but I'm open to other options.
4
78,669
09/17/2008 00:30:29
14,424
09/16/2008 23:53:40
11
2
How do I enable Platform Builder mode in VS2008
After installing VS2008, the platform builder mod, and the WM7 aku, VS usually prompts you, upon first startup, for your default mode. If you make a mistake and select something other than PB7, how do you get back into PB mode? I can get the device window, but it is always greyed out. I can also configure my normal connection settings, but VS will never connect to the device. I have other machines, where I did select the default option correctly. They work just fine. I'm hoping I do not have to reinstall everything. namaste, Mark
visual-studio
vs2008
windows-mobile
platformbuilder
smartphone
null
open
How do I enable Platform Builder mode in VS2008 === After installing VS2008, the platform builder mod, and the WM7 aku, VS usually prompts you, upon first startup, for your default mode. If you make a mistake and select something other than PB7, how do you get back into PB mode? I can get the device window, but it is always greyed out. I can also configure my normal connection settings, but VS will never connect to the device. I have other machines, where I did select the default option correctly. They work just fine. I'm hoping I do not have to reinstall everything. namaste, Mark
0
9,967,103
04/01/2012 18:36:33
1,306,600
04/01/2012 17:18:01
1
0
How to package a library as an eclipse plugin for use by another plugin
I'm trying to build an Eclipse plugin that depends on a library which has to be distributed separate to it. The reasons for that are: 1. It's a commercial library, while the plugin will be distributed freely. Also, most people won't need it and we don't want to confuse users. 2. There are currently at least two versions of the library in use and we don't want to build two different versions of the plugin. The interface is compatible, so we can ship just one version of the plugin. The plugin is for an Eclipse-based development environment and the purpose is to provide our library's functionality within that environment. The library itself depends on other free components, which I can bundle with it without a problem. Since I don't know if I'm allowed to say exactly which library it is, but I must keep this unambiguous, let's call the library "L" and the plugin I'm trying to develop "P". I'm using the bnd tool for this and so far I've tried both packaging L as a standalone plugin, and as a plugin fragment. As a standalone plugin, it was accepted by the host eclipse environment and I could list it as a dependency of P and successfully build that. However, at runtime the P plugin didn't see resources from the L library on its classpath. Mainly those in META-INF/services are needed. Next, I tried packaging L as a plugin fragment for P. I hoped this would work, since the specs say, that a fragment's classpath is merged with its host plugin's. This didn't work, because I couldn't use the classes from L as build dependencies of P - putting L in eclipse's plugins directory didn't result in it being recognised as an installed plugin. So I'm stuck. I need L's jars as part of P's runtime and build classpath, while at the same time having them in a separate plugin. Is what I'm trying to do even possible?
java
eclipse-plugin-dev
null
null
null
null
open
How to package a library as an eclipse plugin for use by another plugin === I'm trying to build an Eclipse plugin that depends on a library which has to be distributed separate to it. The reasons for that are: 1. It's a commercial library, while the plugin will be distributed freely. Also, most people won't need it and we don't want to confuse users. 2. There are currently at least two versions of the library in use and we don't want to build two different versions of the plugin. The interface is compatible, so we can ship just one version of the plugin. The plugin is for an Eclipse-based development environment and the purpose is to provide our library's functionality within that environment. The library itself depends on other free components, which I can bundle with it without a problem. Since I don't know if I'm allowed to say exactly which library it is, but I must keep this unambiguous, let's call the library "L" and the plugin I'm trying to develop "P". I'm using the bnd tool for this and so far I've tried both packaging L as a standalone plugin, and as a plugin fragment. As a standalone plugin, it was accepted by the host eclipse environment and I could list it as a dependency of P and successfully build that. However, at runtime the P plugin didn't see resources from the L library on its classpath. Mainly those in META-INF/services are needed. Next, I tried packaging L as a plugin fragment for P. I hoped this would work, since the specs say, that a fragment's classpath is merged with its host plugin's. This didn't work, because I couldn't use the classes from L as build dependencies of P - putting L in eclipse's plugins directory didn't result in it being recognised as an installed plugin. So I'm stuck. I need L's jars as part of P's runtime and build classpath, while at the same time having them in a separate plugin. Is what I'm trying to do even possible?
0
9,967,109
04/01/2012 18:37:27
602,141
02/03/2011 19:52:55
1
1
Why does the 256-color palette change in terminal VIM on OS X?
I have been playing with color schemes for terminal VIM and have found something annoyingly frustrating that I have been unable to solve thus far. I expect the 16 system colors to change. They are obviously configurable. For that reason, I attempted to use the 256-color palette to construct a VIM color scheme that would be the same regardless of the terminal's 16 (configurable) system color palette. I used only colors from the 256 color palette for everything, including background. However, I noticed that if I open terminals with different background and text colors specified for the terminals, the VIM color schemes appear quite different in the two terminals. I do not see similar behavior on Ubuntu even when the terminals have different background, foreground, AND system color palettes. I will happily accept an answer that explains why this happens. I will be ecstatic if someone can tell me a way around this beyond setting up a specific terminal for each set of color settings I want to use.
vim
terminal
null
null
null
null
open
Why does the 256-color palette change in terminal VIM on OS X? === I have been playing with color schemes for terminal VIM and have found something annoyingly frustrating that I have been unable to solve thus far. I expect the 16 system colors to change. They are obviously configurable. For that reason, I attempted to use the 256-color palette to construct a VIM color scheme that would be the same regardless of the terminal's 16 (configurable) system color palette. I used only colors from the 256 color palette for everything, including background. However, I noticed that if I open terminals with different background and text colors specified for the terminals, the VIM color schemes appear quite different in the two terminals. I do not see similar behavior on Ubuntu even when the terminals have different background, foreground, AND system color palettes. I will happily accept an answer that explains why this happens. I will be ecstatic if someone can tell me a way around this beyond setting up a specific terminal for each set of color settings I want to use.
0
9,967,111
04/01/2012 18:37:42
1,306,675
04/01/2012 18:31:47
1
0
Increase tumblr photo size
How do I edit this html so I can customise the width of a photo, tumblr doesn't seem to like changing the photo set size to anything bigger. I have looked up, but don't understand where a maxwidth:600px would fit in or if this is even the best way to do it. Massive thanks to anyone who can help me out {block:Photo} <div class="permalink"> {block:IfNotDisqusShortname}<a href="{Permalink}">&rarr;</a>{block:IfNotDisqusShortname} {block:Date}{block:IfDisqusShortname}<a href="{Permalink}#disqus_thread"></a>{block:IfDisqusShortname}{/block:Date} </div> <div class="photo post"> {LinkOpenTag} <img src="{PhotoURL-500}" alt="{PhotoAlt}"/> {LinkCloseTag} {block:Caption} <p>{Caption}</p> {/block:Caption} <div class="postmeta">{block:Date}<a href="{Permalink}">{TimeAgo}</a>&nbsp; {/block:Date}<a href="{Permalink}" style="text-transform:lowercase;">{lang:Notes} ({NoteCount})</a></div> </div> {block:PostNotes} <div>{PostNotes}</div> {/block:PostNotes} {/block:Photo}
html
image
photo
tumblr
max-width
null
open
Increase tumblr photo size === How do I edit this html so I can customise the width of a photo, tumblr doesn't seem to like changing the photo set size to anything bigger. I have looked up, but don't understand where a maxwidth:600px would fit in or if this is even the best way to do it. Massive thanks to anyone who can help me out {block:Photo} <div class="permalink"> {block:IfNotDisqusShortname}<a href="{Permalink}">&rarr;</a>{block:IfNotDisqusShortname} {block:Date}{block:IfDisqusShortname}<a href="{Permalink}#disqus_thread"></a>{block:IfDisqusShortname}{/block:Date} </div> <div class="photo post"> {LinkOpenTag} <img src="{PhotoURL-500}" alt="{PhotoAlt}"/> {LinkCloseTag} {block:Caption} <p>{Caption}</p> {/block:Caption} <div class="postmeta">{block:Date}<a href="{Permalink}">{TimeAgo}</a>&nbsp; {/block:Date}<a href="{Permalink}" style="text-transform:lowercase;">{lang:Notes} ({NoteCount})</a></div> </div> {block:PostNotes} <div>{PostNotes}</div> {/block:PostNotes} {/block:Photo}
0
9,967,113
04/01/2012 18:37:53
301,218
03/24/2010 21:14:20
340
6
Rspec, testing for update controller not working?
This is a homework I am working towards to familiar myself with TDD and Rspec. But somehow I don't understand why the following test failed: describe 'update' do fixtures :movies before :each do @fake_movie = movies(:star_wars_movie) end it 'should retrieve the right movie from Movie model to update' do Movie.should_receive(:find).with(@fake_movie.id.to_s).and_return(@fake_movie) put :update, :id => @fake_movie.id, :movie => {:rating => @fake_movie.rating} end it 'should prepare the movie object available for update' do put :update, :id => @fake_movie.id, :movie => {:rating => @fake_movie.rating} assigns(:movie).should == @fake_movie end it 'should pass movie object the new attribute value to updated' do fake_new_rating = 'PG-15' @fake_movie.stub(:update_attributes!).with("rating" => fake_new_rating).and_return(:true) put :update, :id => @fake_movie.id, :movie => {:rating => fake_new_rating} @fake_movie.should_receive(:update_attributes!).with("rating" => fake_new_rating).and_return(:true) end end The error message I got is: Failures: 1) MoviesController update should pass movie object the new attribute value to updated Failure/Error: @fake_movie.should_receive(:update_attributes!).with("rating" => fake_new_rating).and_return(:true) (#<Movie:0xd39ea38>).update_attributes!({"rating"=>"PG-15"}) expected: 1 time received: 0 times # ./spec/controllers/movies_controller_spec.rb:99:in `block (3 levels) in <top (required)>' Finished in 0.60219 seconds 12 examples, 1 failure Failed examples: rspec ./spec/controllers/movies_controller_spec.rb:95 # MoviesController update should pass movie object the new attribute value to updated And the controller code: def update @movie = Movie.find params[:id] @movie.update_attributes!(params[:movie]) flash[:notice] = "#{@movie.title} was successfully updated." redirect_to movie_path(@movie) end Thanks in advance
ruby-on-rails-3
homework
rspec
null
null
null
open
Rspec, testing for update controller not working? === This is a homework I am working towards to familiar myself with TDD and Rspec. But somehow I don't understand why the following test failed: describe 'update' do fixtures :movies before :each do @fake_movie = movies(:star_wars_movie) end it 'should retrieve the right movie from Movie model to update' do Movie.should_receive(:find).with(@fake_movie.id.to_s).and_return(@fake_movie) put :update, :id => @fake_movie.id, :movie => {:rating => @fake_movie.rating} end it 'should prepare the movie object available for update' do put :update, :id => @fake_movie.id, :movie => {:rating => @fake_movie.rating} assigns(:movie).should == @fake_movie end it 'should pass movie object the new attribute value to updated' do fake_new_rating = 'PG-15' @fake_movie.stub(:update_attributes!).with("rating" => fake_new_rating).and_return(:true) put :update, :id => @fake_movie.id, :movie => {:rating => fake_new_rating} @fake_movie.should_receive(:update_attributes!).with("rating" => fake_new_rating).and_return(:true) end end The error message I got is: Failures: 1) MoviesController update should pass movie object the new attribute value to updated Failure/Error: @fake_movie.should_receive(:update_attributes!).with("rating" => fake_new_rating).and_return(:true) (#<Movie:0xd39ea38>).update_attributes!({"rating"=>"PG-15"}) expected: 1 time received: 0 times # ./spec/controllers/movies_controller_spec.rb:99:in `block (3 levels) in <top (required)>' Finished in 0.60219 seconds 12 examples, 1 failure Failed examples: rspec ./spec/controllers/movies_controller_spec.rb:95 # MoviesController update should pass movie object the new attribute value to updated And the controller code: def update @movie = Movie.find params[:id] @movie.update_attributes!(params[:movie]) flash[:notice] = "#{@movie.title} was successfully updated." redirect_to movie_path(@movie) end Thanks in advance
0
9,967,118
04/01/2012 18:38:21
1,034,741
11/08/2011 00:38:50
95
0
Detect Mouse held down
I am trying to be able to detect when a mouse is held down instead of clicked in an ns event. this is what I have but instead of a click count I want to be able to detect the mouse being held down, how can i do this? thanks! -(void)mouseDown:(NSEvent *)event; { //instead of clickCount i want my if statement to be if the mouse is being held down. if ([event clickCount] < 1) { } else if ([event clickCount] > 1) { } }
objective-c
xcode
cocoa
null
null
null
open
Detect Mouse held down === I am trying to be able to detect when a mouse is held down instead of clicked in an ns event. this is what I have but instead of a click count I want to be able to detect the mouse being held down, how can i do this? thanks! -(void)mouseDown:(NSEvent *)event; { //instead of clickCount i want my if statement to be if the mouse is being held down. if ([event clickCount] < 1) { } else if ([event clickCount] > 1) { } }
0
78,696
09/17/2008 00:38:23
14,509
09/17/2008 00:32:46
1
0
Vista UAC, Access Elevation and .Net
I'm trying to find out if there is any way to elevate a specific function within an application. For example, I have an app with system and user settings that are stored in the registry, I only need elevation for when the system settings need to be changed. Unfortunately all of the info I've come across talks about only starting a new process with elevated privileges.
.net
uac
elevation
null
null
null
open
Vista UAC, Access Elevation and .Net === I'm trying to find out if there is any way to elevate a specific function within an application. For example, I have an app with system and user settings that are stored in the registry, I only need elevation for when the system settings need to be changed. Unfortunately all of the info I've come across talks about only starting a new process with elevated privileges.
0
78,700
09/17/2008 00:39:34
14,487
09/17/2008 00:23:44
1
0
KVM and Linux wireless bridging?
I'm using KVM to run a Windows virtual machine on my Linux box. Networking is accomplished through a tap device, hooked into a bridged Ethernet device, which allows the Windows VM to basically appear like a separate physical computer on my network. This is pretty nice. However, my understanding is that most, if not all, wireless drivers can't support bridging. I'd really like to be able to roam a little more freely while I'm working -- does anyone know of an effective workaround? User-mode networking won't work, as I have to use some Windows VPN software that wants lower-level networking access. Thanks in advance.
networking
kvm
null
null
null
null
open
KVM and Linux wireless bridging? === I'm using KVM to run a Windows virtual machine on my Linux box. Networking is accomplished through a tap device, hooked into a bridged Ethernet device, which allows the Windows VM to basically appear like a separate physical computer on my network. This is pretty nice. However, my understanding is that most, if not all, wireless drivers can't support bridging. I'd really like to be able to roam a little more freely while I'm working -- does anyone know of an effective workaround? User-mode networking won't work, as I have to use some Windows VPN software that wants lower-level networking access. Thanks in advance.
0
78,703
09/17/2008 00:40:58
14,521
09/17/2008 00:38:03
1
0
javascript (jquery) calendar plugin
Does any know of a good calendar (not datepicker, but a BIG browsable calendar) plugin for one of the major javascript frameworks. I'd prefer jQuery.
jquery
calendar
null
null
null
02/07/2012 15:07:04
too localized
javascript (jquery) calendar plugin === Does any know of a good calendar (not datepicker, but a BIG browsable calendar) plugin for one of the major javascript frameworks. I'd prefer jQuery.
3
78,704
09/17/2008 00:41:05
12,795
09/16/2008 15:43:17
11
4
Good Python Network Programing Resource
i'm begining on a new proyect that need to collect data from some VoIP network equiment, and i thinking to make a python app using some network library and need know some intersting Books or web resources about the netwoking library in python. best regards.
python
books
socket
network-library
network-programing
null
open
Good Python Network Programing Resource === i'm begining on a new proyect that need to collect data from some VoIP network equiment, and i thinking to make a python app using some network library and need know some intersting Books or web resources about the netwoking library in python. best regards.
0
78,716
09/17/2008 00:43:50
9,021
09/15/2008 17:31:26
967
29
Is XSLT worth it?
A while ago, I started on a project where I designed a html-esque XML schema so that authors could write their content (educational course material) in a simplified format which would then be transformed into HTML via XSLT. I played around (struggled) with it for a while and got it to a very basic level but then was too annoyed by the limitations I was encountering (which may well have been limitations of my knowledge) and when I read a blog suggesting to ditch XSLT and just write your own XML-to-whatever parser in your language of choice, I eagerly jumped onto that and it's worked out brilliantly. I'm still working on it to this day (_I'm actually supposed to be working on it right now, instead of playing on SO_), and I am seeing more and more things which make me think that the decision to ditch XSLT was a good one. I know that XSLT has its place, in that it is an accepted standard, and that if everyone is writing their own interpreters, 90% of them will end up on DailyWTF. But given that it is a declarative style language instead of the procedural style which most programmers are familiar with, for someone embarking on a project such as my own, **would you recommend they go down the path that I did, or stick it out with XSLT**?
xslt
xml
null
null
null
01/26/2012 16:30:00
not constructive
Is XSLT worth it? === A while ago, I started on a project where I designed a html-esque XML schema so that authors could write their content (educational course material) in a simplified format which would then be transformed into HTML via XSLT. I played around (struggled) with it for a while and got it to a very basic level but then was too annoyed by the limitations I was encountering (which may well have been limitations of my knowledge) and when I read a blog suggesting to ditch XSLT and just write your own XML-to-whatever parser in your language of choice, I eagerly jumped onto that and it's worked out brilliantly. I'm still working on it to this day (_I'm actually supposed to be working on it right now, instead of playing on SO_), and I am seeing more and more things which make me think that the decision to ditch XSLT was a good one. I know that XSLT has its place, in that it is an accepted standard, and that if everyone is writing their own interpreters, 90% of them will end up on DailyWTF. But given that it is a declarative style language instead of the procedural style which most programmers are familiar with, for someone embarking on a project such as my own, **would you recommend they go down the path that I did, or stick it out with XSLT**?
4