instruction
stringlengths
0
30k
|windows|ide|editor|
I'm teaching (or trying to teach) computer programming to a grad-student. Her previous experience amounts to little more than writing spreadsheet formulae. Which IDE or text editor should I recommend? Please bear in mind that: * I only meet my student about once a week. * She uses Windows and I use Linux. * S...
I'd be interested in this too. I'm coding several apps that uses automation in Word and I even have things like object oFalse = false, oTrue = true, oOne = 1; It's very nasty, but it's the only way I know so far. The only thing I can think of is writing a wrapper class for the frequently used functions....
- Right-click the folder in your project - select "Exclude from project"
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^([0-9]{6})$ scriptname.php?no=$1 [L] </IfModule> To preserve the clean URL http://mywebsite.com/132483 while serving scriptname.php use only [L]. Using [R=301] will redirect you to your scriptname.php?no=xxx You may find th...
This may simply be a syntax error, but shouldn't If Page.IsPostBack Then GetUIValues() Else Look like this If NOT Page.IsPostBack Then GetUIValues() Else
You could get your hands on one of the original Happy Hacker keyboards (no arrow keys) and place your (wireless) mouse out of reach each time you start editing.
Compacting an Access database (also known as a MS JET database) is a bit like defragmenting a hard drive. Access (or, more accurately, the MS JET database engine) isn't very good with re-using space - so when a record is updated, inserted, or deleted, the space is not always reclaimed - instead, new space is added to t...
Are there any projects for replacing HTML and the current javascript?
|javascript|html|ajax|flash|silverlight|
Google created protocol buffers as a replacement for the bulky XML method of data transition. Faster XML processing was just not good enough. Most of the web has grown up as a hodge podge of different technologies that have been integrated to work within the browser or to generate html. JavaScript is separate from H...
I installed 'ksh' and 'pdksh' on my local Ubuntu Hardy system. ii ksh 93s+20071105-1 The real, AT&T version of the Korn shell ii pdksh 5.2.14-21ubunt A public domain version of the Korn shell ksh has the "correct" behavior that you're expecting while pdksh does not. You might check...
Check out <a href="http://testers.cpan.org">CPAN Testers</a>, which have a lot of tools for automated testing. Most of that should be on CPAN so you'll be able to modify it to meet your needs. It's also very easy to write your own tester using TAP::Harness. What exactly do you need to do and how are you trying to fi...
|ruby|ruby-on-rails|http|
My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. But sessions are implemented in Rails as session cookies, which are not persist...
Using only Javas own API: <pre><code> String[] join(String[]... arrays) { // calculate size of target array int size = 0; for (String[] array : arrays) { size += array.length; } // create list of appropriate size java.util.List<String> list = new java.util.ArrayList(size); // add arrays ...
Creating/modifying images in JavaScript
|javascript|image|editing|pixel|creation|
Is it possible to **dynamically create and modify images** on a **per pixel level** in JavaScript (on client side)? Or has this to be done with server based languaged, such as PHP? My use case is as follows: * The user opens webpage and loads locally stored image * A preview of the image is displayed * The use...
I'll reply with a different approach of the problem. My approach is to store the lengths in seconds. Then depending the needs, it's easy to render these seconds as hh:mm:ss by using : `print gmdate($seconds >= 3600 ? 'H:i:s' : 'i:s', $seconds);` (for your question) or to search on the length in a database: `SE...
What would be a good, windows and iis (http) based distributed version control system
|http|version-control|distributed|
At my job we make & sell websites. Usually we install our .NET C# based site on a customer's server and maintain and support it remotely. However, every once in a while, for bigger development works and just to make things simpler (and faster!), we will copy the site to a local server. This is great, but has one pai...
This won't answer directly to the question, but why not using `<a href="{% url mapper.views.foo %}">foo</a>` in template then?
Nooooo!!! Don't implement method\_missing on your controller! And please try to avoid action_missing as well. The frequently touted pattern is to add a route: map.connect '*', :controller => 'error', :action => 'not_found' Where you can show an appropriate error. Rails also has a mechanism called rescue...
Referenced Assemblies in Web Site
|asp.net|
Am I correct in assuming that I always need to explicitly deploy referenced assemblies when their source changes?
If you want to log on a specific page, I believe asp.net pages' lifecycle begin with PreInit and end with Disposed, so you can log anything you want in those events. Or, if you want to log on every page, as Bob Dizzle pointed out, you can use the Global.asax file, which has a thousand events to choose from : http://...
These "small words" are considered "noise words" by the full text index. You can customize the list of noise words. This [blog post][1] provides more details. You need to repopulate your full text index when you change the noise words file. [1]: http://arcanecode.wordpress.com/2008/05/29/creating-and-customizing...
Personally, I'd get more data from the database through fewer methods and then bind the UI against only those parts of the data set that I currently want to display. Managing lots of small methods that get out specific chunks of data is harder than getting out large chunks and using only those parts you need.
How do you set up your .NET development tree?
|c#|.net|development-environment|
How do you set up your .NET development tree? I use a structure like this: -projectname --config (where I put the configuration files) --doc (where I put all the document concerning the project: e-mails, documentation) --tools (all the tools I use: Nunit, Moq) --lib (all the librarie...
Kevin, This works without javascript or CSS in most browsers: &lt;form&gt; &lt;p&gt;&lt;input type="text" name="field1" /&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="previousname.html"&gt;&lt;button type="button"&gt;Previous Page&lt;/button&gt;&lt;/a&gt; &lt;button type="submit"&gt;&lt;/button&gt;&lt;/p&gt; &lt;/form&gt...
If I were you I would take the log and write a quick script to do something like the following (mine is in Ruby): allocations = [] file = File.new "the-log.log" file.each_line { |line| # custom function to determine if line is an alloc/dealloc if allocation? line # custom functio...
If I were you I would take the log and write a quick script to do something like the following (mine is in Ruby): def allocation?(line) # determine if this line is a log line indicating allocation/deallocation end def unique_stack(line) # return a string that is equal for pairs of alloc...
If I were you I would take the log and write a quick script to do something like the following (mine is in Ruby): def allocation?(line) # determine if this line is a log line indicating allocation/deallocation end def unique_stack(line) # return a string that is equal for pairs of alloc...
Check out <a href="http://testers.cpan.org">CPAN Testers</a>, which have a lot of tools for automated testing. Most of that should be on CPAN so you'll be able to modify it to meet your needs. It's also very easy to write your own tester using TAP::Harness. What exactly do you need to do and how are you trying to fi...
We found a solution! Apparently the picture boxes stretched out on the Chinese XP PC, but the images they contained did not. The fix was to add code like the following: Me.PictureBoxIcon.Width = Me.PictureBoxIcon.Image.Width Me.PictureBoxIcon.Height = Me.PictureBoxIcon.Image.Height Dim loc As New Poi...
I've written more than a few lines of assembly language over the years. Ultimately, every high level language compiles down to gotos. Okay, call them "branches" or "jumps" or whatever else, but they're gotos. Can anyone write goto-less assembler? Now sure, you can point out to a Fortran, C or BASIC programmer that ...
Don't forget to use Subversion (http://subversion.tigris.org/). I subversion my whole life (it's awesome).
What you're describing is something the *computer* has, not the user. So you can supposedly (depending on implementation) be assured that it is the computer, but no assurance regarding the user... Now, since we're talking about remote login, perhaps the situation is personal laptops? In which case, *the laptop* is...
At a psuedo-code level what you want to do is define an array of image names then take the number of days from a given point in time then modulo (remainder after division) by the number of images and access that index in the array and set the image, e.g. (untested code) var images = new Array("image1.gif", "imag...
At a psuedo-code level what you want to do is define an array of image names then take the number of days from a given point in time then modulo (remainder after division) by the number of images and access that index in the array and set the image, e.g. (untested code) var images = new Array("image1.gif", "imag...
From the E600 reference manual: The HID0 special-purpose register contains several bits that invalidate, disable, and lock the instruction and data caches. You should use HID0[DCE] = 0 to disable the data cache. You should use HID0[ICE] = 0 to disable the instruction cache. Note that at power up, both cache...
A delegate is a function signature; something like delegate string MyDelegate(int param1); The delegate does not implement a body. The lambda is a function call that matches the signature of the delegate. For the above delegate, you might use any of; (int i) => i.ToString(); (int i) => "ignor...
Duplicate a whole line in Vim
|vim|
How do I duplicate a whole line in Vim in a similiar way to CTRL+D in IntelliJ IDEA/Resharper or Ctrl Alt Arrow in Eclipse?
This would be by far the easiest with Perl, and the following CPAN modules: * [http://search.cpan.org/~gaas/HTML-Parser-3.56/Parser.pm][1] * [http://search.cpan.org/~gaas/libwww-perl-5.814/lib/LWP.pm][1] * [http://search.cpan.org/author/CAPTTOFU/DBD-mysql-4.008/lib/DBD/mysql.pm][1] * [http://search.cpan.org/autho...
If you don't mind strongly typed view data and want a quick and dirty solution. You can put all the master page data in a common base class for view data. You can set this data in the base class's constructor. All your views with view specific data will then need strongly typed viewdata that inherits form this base cla...
If you don't mind strongly typed view data, you can put all the master page data in a common base class for viewData. You can set this data in the base class's constructor. All your views requiring additional data will then need strongly typed viewdata that inherits from this base class. To allow a call to View() in...
The main css file that drives your content is the styles.css file located in your currently selected theme. In your case that means that most of your site styling is driven by this file: /aroda/roda/themes/garland/style.css with basic coloring effects handled by this file: /aroda/roda/files/color/garland-d3985506/sty...
Document Server: Handling Concurrent Saves
|versioning|document-server|locking|concurrent|
I'm implementing a document server. Currently, if two users open the same document, modify it and save the changes, document's state will be undefined (either the first user's changes are saved permanently, or the second's). This is entirely unsatisfactory. I considered two possibilities to solve this problem. The f...
|concurrency|versioning|locking|document-server|
SQL 2000 equivalent of SQLAgentReaderRole
|sql-server|sql-server-agent|
I have quite a few developers asking me if certain SQL jobs ran, and I would like to give them access to check it on their own without giving them 'sysadmin' rights. I know that in SQL 2005, you can grant them the SQLAgentReaderRole, but I am looking for a solution in SQL 2000.
|version-control|http|distributed|
At my job we make & sell websites. Usually we install our .NET C# based site on a customer's server and maintain and support it remotely. However, every once in a while, for bigger development works and just to make things simpler (and faster!), we will copy the site to a local server. This is great, but has one pai...
|version-control|https|distributed|
|version-control|http|distributed|
If you're not calling it from code, and want to use {3}, you need to use backslashes to escape the curly braces. If you don't want to match any part of the longer strings of numbers, use \b to match word boundaries around the numbers. This leaves: \b[0-9]\{3\}\b
If you're not calling it from code, and want to use {3}, you need to use backslashes to escape the curly braces. If you don't want to match any part of the longer strings of numbers, use \b to match word boundaries around the numbers. This leaves: \b[0-9]\{3\}\b For those wanting more information about \b, ...
If you're entering the regex interactively, and want to use `{3}`, you need to use backslashes to escape the curly braces. If you don't want to match any part of the longer strings of numbers, use `\b` to match word boundaries around the numbers. This leaves: \b[0-9]\{3\}\b For those wanting more informatio...
At a basic level what you want to do is define an array of image names then take the number of days from a given point in time then modulo (remainder after division) by the number of images and access that index in the array and set the image, e.g. (untested code) var images = new Array("image1.gif", "image2.jpg...
Any exception not explicitly or generally handled at a specific level will trickle upwards in the call stack. The Delphi RTL (Run Time Library) will generate a set of different exception classes - (mathematical errors, access errors, class specific errors etc). You can chose to handle them specifically or generally i...
Any exception not explicitly or generally handled at a specific level will trickle upwards in the call stack. The Delphi RTL (Run Time Library) will generate a set of different exception classes - (mathematical errors, access errors, class specific errors etc). You can chose to handle them specifically or generally i...
You should start with **[vim][1]** (Vi IMproved) and especially its GUI - **gVim**. The GUI has menus and on Windows you can use the copy, cut and paste shortcuts, so you can replace Notepad immediately. And since the menus display the shortcuts (vim commands) you could learn a lot. [1]: http://www.vim.org/
You should start with **[vim][1]** (Vi IMproved) and especially its GUI - **gVim**. The GUI has menus and on Windows you can use the copy, cut and paste shortcuts, so you can replace Notepad immediately. And since the menus display the shortcuts (vim commands) you could learn a lot. Another thing that you should do ...
I use D for web development and it proved quite a lot more productive compared to C/C++. There are a lot of frameworks based on ruby/php/python, of course. But when you want to develop something unique that also have to be as fast as C and nearly as easy as to program with as you do in many sript languages, then D is...
Unless you're desperate to use C++ for your own education, you should definitely look at [XNA][1] for your game & graphics framework (it uses C#). It's completely free, it does a lot of things for you, and soon you'll be able to sell your game on Xbox Live. To answer your main question, nothing that you can already ...
Do this: yy p
yy will yank the current line without deleting it dd will delete the current line p will 'put' a line grabbed by either of the previous methods
I use unicode arrow characters in the title of the column and make the header a linkbutton.
Len: the problem with that is that pStruct is a STRUCT*, but the memory allocated is actually a BYTE[] of some unknown size. So delete[] pStruct will not de-allocate all of the allocated memory.
Just started a project in .net and found great info [here][1] about using Windows Image Acquisition. Lots of sample VB code and some c#. [1]: http://www.csharpfriends.com/Forums/ShowPost.aspx?PostID=60471
Apache CXF has tools that generate JavaScript clients that talk soap. Actually, any CXF service can have a javascript client autogenerated by doing a get to the URL with ?js appended. (just like ?wsld produces the wsdl) There are command line tools as well, but the dynamic generated stuff is kind of neat.
How can I save some JavaScript state information back to my server onUnload?
|javascript|ajax|extjs|
I have an ExtJS grid on a web page and I'd like to save some of its state information back to the server when the users leaves the page. Can I do this with an Ajax request onUnload? If not, what's a better solution?
INSTR and CHARINDEX are great alternative approaches but I'd like to explore the benefits of embedding Regex.
how are you processing the cube? through XMLA or through the GUI? If you do it in XMLA then you should see the results as they come in the output window
<a href="http://www.jetbrains.com">IntelliJ IDEA</a> with Ruby plugin supports some refactorings. ![alt text][1] [1]: http://www.skavish.com/rubyrefactorings.png
Vista is _more_ restrictive about this kind of thing, so if you can't do it for XP you can bet Vista won't let you either. You are right that installing to the program files folder using windows installer requires administrative permissions. In fact, _all write access_ to that folder requires admin permsissions, wh...
Kevin, This works without javascript or CSS in most browsers:<br/> &lt;form&gt;<br/> &lt;p&gt;&lt;input type="text" name="field1" /&gt;&lt;/p&gt;<br/> &lt;p&gt;&lt;a href="previousname.html"&gt;&lt;button type="button"&gt;Previous Page&lt;/button&gt;&lt;/a&gt;<br/> &lt;button type="submit"&gt;Next Page&lt;/butto...
Kevin, This works without javascript or CSS in most browsers:<br/> &lt;form&gt;<br/> &lt;p&gt;&lt;input type="text" name="field1" /&gt;&lt;/p&gt;<br/> &lt;p&gt;&lt;a href="previousname.html"&gt;&lt;button type="button"&gt;Previous Page&lt;/button&gt;&lt;/a&gt;<br/> &lt;button type="submit"&gt;Next Page&lt;/b...
Kevin, This works without javascript or CSS in most browsers: <pre><code>&lt;form&gt; &lt;p&gt;&lt;input type="text" name="field1" /&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="previousname.html"&gt;&lt;button type="button"&gt;Previous Page&lt;/button&gt;&lt;/a&gt; &lt;button type="submit"&gt;Next Page&lt;/button&gt;&lt;...
Kevin, This works without javascript or CSS in most browsers: <pre><code>&lt;form&gt; &lt;p&gt;&lt;input type="text" name="field1" /&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="previous.html"&gt; &lt;button type="button"&gt;Previous Page&lt;/button&gt;&lt;/a&gt; &lt;button type="submit"&gt;Next Page&lt;/button&gt;&lt;/p...
Database query representation impersonating file on Windows share?
|http|
Is there any way to have something that looks just like a file on a Windows file share but is really a resource served up over HTTP? For context, I'm working with an old app that can only deal with files on a Windows file share, I want to create a simple HTTP-based service to serve the content of the files dynamical...
|http|file|dav|
Is there any way to have something that looks just like a file on a Windows file share but is really a resource served up over HTTP? For context, I'm working with an old app that can only deal with files on a Windows file share, I want to create a simple HTTP-based service to serve the content of the files dynamical...
|https|file|dav|
|http|file|dav|
We've created an application which does 3D visualization in a browser or as a standalone application. The application is written in JavaScript (for app logic) and C++ (for 3D rendering) and uses the Qt library from http://www.trolltech.com. When running in a browser, the application is wrapped in a thin layer as ...