instruction
stringlengths
0
30k
In C, a struct can have another struct as one of it's members. While this isn't exactly the same as what you're asking, you could end up either with a situation where one struct contains another, or one struct contains two structs, both of which hold parts of the info that you wanted. psuedocode: i don't remember t...
J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000100: Machine name: DEV J0000100: Project file: E:\mbiek\foo.pf J0000100: Template file: E:\mbiek\foot.xdt J0000100: Job name: MBiek J0000100: Output folder: E:\foo\...
I think you should just shake this feeling of "odd". There's nothing odd about it.
http://www.aquafold.com/ I use it at work on windows but it's java and supports OSX.
If I understand your schema and question correctly, how about something like this: select student_name, score from students join (select student_answers.student_id, count(*) as score from student_answers, answer_key group by student_id where student_answers.ques...
Make .* non-greedy by adding '?' after it: Project name:\s+(.*?)\s+J[0-9]{7}:
For python you can try using [processing module][1]. [1]: http://pyprocessing.berlios.de/
FYI, in this particular case, the reason the `IBOutlet` even exists is simply so that Interface Builder can parse the source file and glean bits of understanding from it. It's a clue (well, a bit stronger than a clue) that the variable preceded by `IBOutlet` should show up as an Outlet in Interface Builder when design...
Mike Rettig created a .NET library called [Retlang](http://code.google.com/p/retlang/) and a Java port called Jetlang that is inspired by Erlang's concurrency model.
Using non-greedy quantifiers here is probably the best solution, also because it is more efficient than the greedy alternative: Greedy matches generally go as far as they can (here, until the end of the text!) and then trace back character after character to try and match the part coming afterwards. Hower, consider ...
[RichQ's answer][1] is a reasonable technique, if you're using an array, vector, etc. If you're a collection that isn't indexed by ordinal values... or think you *might need to* at some point in the near future... then you might want to consider exposing your own iterator type(s), and associated `begin()`/`end()` m...
[RichQ's answer][1] is a reasonable technique, if you're using an array, vector, etc. If you're using a collection that isn't indexed by ordinal values... or think you *might need to* at some point in the near future... then you might want to consider exposing your own iterator type(s), and associated `begin()`/`en...
|sql|ms-access|
Updating an old ASP/Access site for a client (and hating it) - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas? This works fine ALTER TABLE documents ADD COLUMN membersOnly NUMBER I want this to work: ALTER TABLE documents ADD COLUMN membersOnly NUMB...
Win32 HCURSOR
|c++|winapi|native|
I am building a custom win32 control/widget and would like to change the cursor to a horizontal "splitter" symbol when hovering over a particular vertical line in the control. IE: I want to drag this vertical line (splitter bar) left and right (WEST and EAST). Of the the system cursors (OCR_*), the only cursor that ...
How far does SQL Server Express Edition scale?
|sql-server|
Wikipedia says SQL Server Express Edition is limited to "one processor, 1 GB memory and 4 GB database files". Does anyone have practical experience with how well this scales?
I'll second the vote for [Telerik][1]. Their controls for the most part "just work" and their support has been excellent. I primarily use their forums and I still receive a response within a day (unlike some other vendors who barely seem to notice that they've even got a forum). It also feels like they've actually...
I think that [HTML tidy][1] will do what you want. There is a Python binding for it. [1]: http://tidy.sourceforge.net/
This will work. It's messy because in BAT files you can't use set var=\`cmd\` like you can in unix. The fact that echo doesn't understand quotes is also messy, and could lead to trouble if `Some Pattern` contains shell meta characters. set FILENAME=%~f1 echo s/Some Pattern/%FILENAME%/ | sed -e "s/\\/\\\\/...
This will work. It's messy because in BAT files you can't use set var=\`cmd\` like you can in unix. The fact that echo doesn't understand quotes is also messy, and could lead to trouble if `Some Pattern` contains shell meta characters. set FILENAME=%~f1 echo s/Some Pattern/%FILENAME%/ | sed -e "s/\\/\\\\/...
How do I make bash reverse-search work in Terminal.app without it displaying garbled output?
|macos|bash|
Using Terminal.app on OS X 10.5, often you see the commands get garbled when you do a reverse-search with Bash. Is there some kind of termcap or perhaps a bash shopt command that can fix this? It is very annoying. Steps to reproduce: Open Terminal.app, reverse-search to a longish command. Hit <ctrl>-E once you...
I wouldn't recommend just making the switch on an existing project. Perhaps start a small "demo" project that the team can use to experiment with the technology and (if necessary) learn what they need to and demonstrate to management that it is worthwhile to make the switch. In the end, even the dev team might realize ...
SQL Server - testing the database
|sql-server|unit-testing|
What tools are people using for testing SQL Server databases? TSQLUnit?
What tools are people using for testing SQL Server databases? By this I mean all parts of the database - configuration, tables, column type, stored procedures, constraints. Most likely, there is no one tool to do it all.
You could launch a new bash process redirecting the stderr of that process: $ bash -i 2> stderr.log $
Use the `exec` builtin in bash: `exec 2> /tmp/myfile`
If you want a pen and papper kind of exercizes I'd recommend more designing than coding. Actually coding in paper sucks and it let's you learn almost nothing. Work enviroment does matter so typing in a computer, compiling, seeing what errors you've made, using refactor here and there, just doesn't compare to what yo...
Have you tried getting a write lock on the file? If it's being written to, that should fail, and you know to leave it alone for a bit...
To use the least amount of space you should use a CHAR field constrained to 'Y' or 'N'. Oracle doesn't support BOOLEAN, BIT, or TINYINT data types, so CHAR's one byte is as small as you can get.
You probably have to go with some out of band signaling: have the producer of "file.ext" write a dummy "file.ext.end".
Doing your own BigNum library is complicated, so i'd say like jjnguy. Use whatever your language offers as libraries. In .net, reference the VisualJ dll as they contain the BigInteger and BigDecimal classes. You should however be aware of some limitations of these libraries, like the lack of a square root method, fo...
I would create a test site first, and see what the team thinks, but for me I wouldn't go back to WebForms after using MVC. Some people don't like code mixed with HTML, and I can understand that, but I far prefer the flexibility over things like Page Lifecycle, rendering HTML and biggy for me - no viewstate cruft emb...
Can IIS 6 serve requests for pages with no extensions?
|iis|
Is there any way in IIS to map requests to a particular URL with no extension to a given application. For example, in trying to port something from a Java servlet, you might have a URL like this... http://[server]/MyApp/HomePage?some=parameter Ideally I'd like to be able to map everything under MyApp to a part...
This method is basically from David Marr's book "Vision" Gaussian blur your signal with the expected width of your peaks. this gets rid of noise spikes and your phase data is undamaged. Then edge detect (LOG will do) Then your edges were the edges of features (like peaks). look between edges for peaks, sor...
TBH, PHP probably isn't the best tool for this, really not what it was designed for. I've heard of memory leaks and other bad things happening when you try this. Also bear in mind PHP only has a finite amount of resource ids (for file handles, db connections ect) per execution of a script. Be better of using somethi...
Automatically floating all fields in a VFP report?
|visual-foxpro|foxpro|report|
I want to set all the fields and labels on a VFP7 report to "Float". I tried `USE`ing the `.frx` file and doing the following `REPLACE` but it didn't work. Is there some other field I need to change too? REPLACE float WITH .T. FOR objtype = 8
|report|foxpro|visual-foxpro|
I want to set all the fields and labels on a VFP7 report to "Float" and "Stretch with overflow". I tried `USE`ing the `.frx` file and doing the following `REPLACE` but it didn't work. Is there some other field I need to change too? REPLACE float WITH .T. FOR objtype = 8
You mean change the text file before it's committed? You can (I'm not sure how), but it's generally not a good idea, as it doesn't tell the client about the change, so the local copies become void on a commit. What I would do is block the commit (non zero exit), and give an error message as to why you don't want th...
What's the best way to keep a PHP script running as a daemon?
|php|daemon|
What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting. I have some scripts that need to run 24/7 and for the most part I can run them using nohup. But if they go down, what's the best way to monitor it so it can be automatically restarted?
**Very. Equally important as choosing good method and variable names.** Much more if your test suite is going to referred to by new devs in the future. As for your original question, definitely Answer1. Typing in a few more characters is a small price to pay for - the readability. For you and others. It'll...
The default is CTRL+F10 but it can be overridden. The place to find what your current shortcuts are and change them is > **T**ools **C**ustomize... **K**eyboard... Show **c**ommands containing: Debug.RunToCursor or >**T**ools **O**ptions **E**nvironment **K**eyboard Show **c**ommands c...
Maven2 Eclipse integration
|eclipse|maven2|
There seem to be two rival Eclipse plugins for integrating with Maven: [m2Eclipse][1] and [q4e][2]. Has anyone recently evaluated or used these plugins? Why would I choose one or the other? [1]: http://m2eclipse.codehaus.org/ [2]: http://code.google.com/p/q4e/
|eclipse|maven2|build|
User scripts are accessible via the script menu in Xcode's menubar (between the Window and Help menus). Wasn't sure what else to call them. What I'm asking about are not "run script" build phase scripts.
I have been using m2Eclipse for quiet some time now and have found it to be very reliable. I wasn't aware of q4e until I saw this question so I can't recommend one over the other.
Why don't you post the schema you have now? It's too broad a question to answer usefully without some detail of what platform and database you're going to use and the table structure you're proposing...
Given your mention of "C#'s reflection power", I am unsure whether you're looking for an interactive C# console for small code snippets of your own (à la Ruby's `irb`), or a means of interacting with an existing, compiled application currently running as a process. In the former case: * **Windows PowerShell** mig...
Yes. [Test] public void UsernameValidator_LessThanLengthLimit_ShouldValidate() {} Put the test subject first, the test statement next, and the expected result last. That way, you get a clear indication of what it is doing, and you can easily sort by name :)
Tools -&gt; Options -&gt; Tables/Queries -&gt; (At the bottom right:) Sql Server Compatible Syntax - turn option on for this database. then you can execute your query: ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0
Have you tried using Valgrind? That is usually the fastest and easiest way to debug these sorts of errors. If you are reading or writing outside the bounds of allocated memory, it will flag it for you.
jQuery AJAX vs. UpdatePanel
|asp.net|jquery|updatepanel|
We've got a page with a ton of jQuery (approximately 2000 lines) that we want to trim down b/c it is a maintenance nightmare, and it might be easier to maintain on the server. We've thought about using UpdatePanel for this. However, we don't like the fact that the UpdatePanel is sending the whole page back to the ser...
Seems like dealing with licensing issues would be nightmarish for the host.
As an interesting side note, WPF's binding handles marshaling automatically so you can bind the UI to object properties that are modified on background threads without having to do anything special. This has proven to be a great timesaver for me. In XAML: <TextBox Text="{Binding Path=Name}"/>
`malloc` can return `NULL` if no memory is available. You're not checking for that.
I run XCode on a 17" iMac (2 yrs old) with 2GB of RAM and haven't had any trouble.
Look into the LIKE clause
Well, `".*"` is a greedy selector. You make it non-greedy by using `".*?"` When using the latter construct, the regex engine will, at every step it matches text into the `"."` attempt to match whatever make come after the `".*?"`. This means that if for instance nothing comes after the `".*?"`, then it matches nothing....
memset() causing data abort
|c|c++|memory|
I'm getting some strange, intermittent, data aborts (< 5% of the time) in some of my code, when calling memset. The problem is that is usually doesn't happen unless the code is running for a couple days, so it's hard to catch it in the act. I'm using the following code: char *msg = (char*)malloc(sizeof(char)...
|c++|c|memory|windows-mobile|
I run XCode for Mac development on a 20" current-gen iMac and it works perfectly with plenty of other processes running. You can definitely use the iMac to develop software.
I don't have a recommendation, but I do have some feedback on the Telerik recommendations. I can't stand their tools myself. The performance of their more complicated controls (e.g., Tree, Grid) is very sluggish and feels very un-web 2.0.
I thought everyone used cometd for this sort of thing.
Try tidylib. You can get some really basic bindings as part of the elementtidy module (builds elementtrees from HTML documents). http://effbot.org/downloads/#elementtidy >>> import _elementtidy >>> xhtml, log = _elementtidy.fixup("<html></html>") >>> print log line 1 column 1 - Warning: missing <!...
I can't reproduce this, hitting either Ctrl+E, Ctrl+A or the arrow keys updates the command line correctly. Are you running 10.5.4? Is it perhaps a bug in earlier versions?
In FxCop 1.36 there is actually a project option on the "Spelling & Analysis" tab that will supress analysis for any generated code. If you don't want to turn analysis off for all generated code, you need to make sure that you add a CODE_ANALYSIS symbol to the list of conditional compilation symbols (project propert...
We have used SQL Server Express Edition in some of our smaller applications, maybe 5+ users, and smaller databases. The 4GB is very limiting in a high transaction environments, and in some cases we have had to migrate our customer to SQL Server Standard Edition.
I would second: Programming Game AI by example (Matt Buckland) This book gives great algorithms that should easly port to XNA.
It's a regular sql server, it just has a limit. SharePoint by default uses the sql server express if that gives you any idea. We have our entire office (80+) people running on that instance.
If you just want want the highest recursion depth couldn't you do something like this? WITH cteLevelOne (ParentID, CustID, Depth) AS ( SELECT a.ParentID, a.CustID, 1 FROM tblCustomer AS a WHERE a.CustID = @LookupID UNION ALL SELECT ...
There's a course for such things at my university: [CSE 326][1]. I didn't think the book was too useful, but the projects are fun and teach you a fair bit about implementing some of the simpler structures. As for examples, one of the most common problems (by number of people using it) that's solved with trees is th...
The first thing I think about when I read this question is: *what types of things use graphs/trees?* and then I think backwards to how I could use them. For example, take two common uses of a tree: - The DOM - File systems The DOM, and XML for that matter, resemble tree structures. <br> ![alt text][1] ...
You can try the BringWindowToTop function to not steal focus. I haven't used it, but it seems to be what you're looking for.
Unfortunately, I do not think that there is a clean way to do this in SQL2000. If you narrow your requirements to SQL2005+, then you are in business. You can use the SQLDependency class in System.Data.SqlClient. See <http://msdn.microsoft.com/en-us/library/t9x04ed2.aspx>
You need a reverse DNS entry. You need to not send the same content to the same user twice. You need to test it with some common webmail and email clients. Personally I ran mine through a freshly installed spam assassin, a trained spam assassin, and multiple hotmail, gmail, and aol accounts. But have you seen that ...
There are all sorts of icons, cursors, and images in use throughout the Windows UI which are not publicly available to 3rd-party software. Of course, you could still load up the module in which they reside and use them, but there's really no guarantee your program will keep working after a system update / upgrade. ...
Practical Experience using Stripes?
|java|stripes|
I am coming from an Enterprise Java background which involves a fairly heavyweight software stack, and have recently discovered the [Stripes framework](http://www.stripesframework.org/); my initial impression is that this seems to do a good job of minimising the unpleasant parts of building a web application in Java....
I just ended up reading the vim manual a few times, over the years, picking up useful features on each iteration. One thing that really made vim work for me as a perl IDE was starting to use tags, as explained here: http://www.vim.org/tips/tip.php?tip_id=94. Using the pltags script that ships with vim, you can jump...