instruction
stringlengths
0
30k
I've only done a small bit of coding in Erlang but I found the most useful method was just to write the code in a text editor and have a terminal open ready to build my code as I need to (this was in Linux, but a similar idea would work in Windows, I'm sure). Your question didn't mention it, but if you're looking for a good book on Erlang, try [this one][1] by O'Reilly. [1]: http://oreilly.com/catalog/9781934356005/index.html
Thanks for all the responses. I never expected to get an answer this quick. For my test application I think SQL Server Compact Edition would be the way to go. I'm basically creating a money managment app similar to Microsoft Money and although it is an exercise to learn skills, I would eventually want to use it to manage my finances (provided its not too crap!) This why I thought a fully blown database would be overkill.
If you want to know how much the GC uses try: GC.GetTotalMemory(true) If you want to know what your process uses from Windows (VM Size column in TaskManager) try: Process.GetCurrentProcess().PrivateMemorySize64 If you want to know what your process has in RAM (as opposed to in the pagefile) (Mem Usage column in TaskManager) try: Process.GetCurrentProcess().WorkingSet64 See [here][1] for more explanation on the different sorts of memory. [1]: http://shsc.info/WindowsMemoryManagement
You have found the biggest pain point of ASP.NET. As far as sealed, private classes that hinder unit testing. This is the main reason that TDD people will use a MVC framework (ASP.NET MVC, Castle MonoRail) as it provides a clear seperation from your view templates and your controller logic. The controllers are fully testable.
1. Navigate to Tools -> Options 2. Select "Projects and Solutions" in the tree view on the left 3. Select "Track Active Item in Solution Explorer"
Tools>Options...>Projects and Solutions>General Make sure "Track active item in Solution Explorer" is checked. That should do it.
`char(13)` is `CR`. For DOS-/Windows-style `CRLF` linebreaks, you want `char(13)+char(10)`, like: 'This is line 1.' + CHAR(13)+CHAR(10) + 'This is line 2.'
Also not related to Python, but [Ubiquity][1] (a firefox extension) is a graphical command-line-like tool for the web, with a similar spirit to Quicksilver/Launchy/GnomeDo. [1]: http://labs.mozilla.com/2008/08/introducing-ubiquity/
[GateKiller][1], how about adding a `break` to that `if` in the `foreach` loop? That would speed up things **a lot** because if like 6 is divisible by 2 you don't need to check with 3 and 5. (I'd vote your solution up anyway if I had enough reputation :-) ...) ArrayList primeNumbers = new ArrayList(); for(int i = 2; primeNumbers.Count < 10000; i++) { bool divisible = false; foreach(int number in primeNumbers) { if(i % number == 0) { divisible = true; break; } } if(divisible == false) { primeNumbers.Add(i); Console.Write(i + " "); } } [1]: http://stackoverflow.com/questions/622/most-efficient-code-for-the-first-10000-prime-numbers#2753
Tools->Options->Project and Solutions->General Check the box "Track Active Item in Solution Explorer"
This is always cool, because when you get exported lists from, say Oracle, then you get records spanning several lines, which in turn can be interresting for, say, cvs files, so beware. Anyow, Rob's answer is good, but I would advice to use something else than @, try a few more, like §§@@§§ or something, so it will have a chance for some uniqueness. (But still, remember the lengt of the varchar field you are inserting to..)
I don't think there is an official naming convention, but i've seen that Microsoft use m_ in the Microsoft.VisualBasic dll (via reflector).
Check out [asio][1]. It is a cross compatable c++ library for asyncronous IO. I am not sure if this would be useful for the server ( I have never tried to link a standard c++ DLL to a c# project) but for the client it would be useful. We use it with our application, and it solved most of our IO concurrency problems. [1]: http://tenermerx.com/Asio/
The reorganize and rebuild are different things. Reorganize: it's a defrag for indexes. Takes the existing index(es) and defragments the existing pages. However if the pages are not in a contiguous manner, they stays like before. Only the content of the pages are changing. Rebuild: actually it drops the index and rebuilds it from scratch. It means that you will get a completely new index, with defragmented and contiguous pages. Moreover with rebuild you can change partitioning or file groups, but with reorganize you can defrag only one partition of the index. The update statistics is automatic on clustered indexes, but not on the non-clutered ones.
The reorganize and rebuild are different things. Reorganize: it's a defrag for indexes. Takes the existing index(es) and defragments the existing pages. However if the pages are not in a contiguous manner, they stays like before. Only the content of the pages are changing. Rebuild: actually it drops the index and rebuilds it from scratch. It means that you will get a completely new index, with defragmented and contiguous pages. Moreover with rebuild you can change partitioning or file groups, but with reorganize you can defrag not only the whole index, but also only one partition of the index. The update statistics is automatic on clustered indexes, but not on the non-clutered ones.
Querying like Linq when you don't have Linq.
|database|linq|orm|
I have a project that I'm currently working on but it currently only supports the .net framework 2.0. I love linq, but because of the framework version I can't use it. What I want isn't so much the ORM side of things, but the "queryability" (is that even a word?) of Linq. So far the closest is [llblgen][1] but if there was something even lighter weight that could just do the querying for me that would be even better. I've also looked at [NHibernate][2] which looks like it could go close to doing what I want, but it has a pretty steep learning curve and the mapping files don't get me overly excited. If anyone is aware of something that will give me a similar query interface to Linq (or even better, how to get Linq to work on the .net 2.0 framework) I'd really like to hear about it. [1]: http://www.llblgen.com/defaultgeneric.aspx [2]: http://www.hibernate.org/343.html
There's a way to reference LINQ in the .NET 2.0 Framework, but I have to warn you that it *might* be against the terms of use/EULA of the framework: [http://stackoverflow.com/questions/2138/linq-on-the-net-20-runtime#2146][1] [1]: http://stackoverflow.com/questions/2138/linq-on-the-net-20-runtime#2146
I would agree with the slow refactoring approach; for example, take that copy-and-pasted code and extract it into whatever the appropriate Java paradigm is (a class, perhaps? or better yet, use an existing library?). When your code is really clean and terse, yet still lacking in overall architectural strategy, *then* you'll be able to make things fit into an overall architecture much more easily.
Style counts for a lot, and it seems to me that if there is a constructor with 20+ arguments, then the design should be altered. Provide reasonable defaults. You are the programmer; you control your class.
I think it all depends on the situation. For something like your example, a customer class, I wouldn't risk the chance of having that data being undefined when needed. On the flip side, passing a struct would clear up the argument list, but you would still have a lot of things to define in the struct.
I would think the easiest way would be to find an acceptable default for each value. In this case, each field looks like it would be required to construct, so possibly overload the function call so that if something is not defined in the call, to set it to a default. Then, make getter and setter functions for each property so that the default values could be changed. Java implementation: public static void setEmail(String newEmail){ this.email = newEmail; } public static String getEmail(){ return this.email; } This is also good practice to keep your global variables secure.
If your database is small enough to download to a laptop and work with it offline, you probably don't need to worry too much about the performance differences between ints and Guids. But do not underestimate how useful ints are when developing and troubleshooting a system! You will probably need to come up with some fairly complex import/synch logic regardless of whether or not you are using Guids, so they might not help as much as you think.
Well, OK. So what are we going to pick as the basic building block for this. Windows has two building blocks that look promising, I think; I/O Completion Ports (IOCPs) and Asynchronous Procedure Calls (APCs). Both of these give us FIFO queuing without having to perform explicit locking, and with a certain amount of built-in OS support in places like the scheduler (for example, IOCPs can avoid some context switches). APCs are perhaps a slightly better fit, but we will have to be slightly careful with them, because they are not quite "transparent". If the work item performs an alertable wait (::SleepEx, ::WaitForXxxObjectEx, etc.) and we accidentally dispatch an APC to the thread then the newly dispatched APC will take over the thread, suspending the previously executing APC until the new APC is finished. This is bad for our concurrency requirements and can make stack overflows more likely. Hmmm, let's see how that works out.
Steve Mcconnell writes in Code Complete that people have trouble keeping more 7 things in their head at a time, so that'd be the number I try to stay under.
Outside of SQL: Record.find(:all).group_by(&:date).count ActiveSupport's [Enumerable#group_by](http://api.rubyonrails.com/classes/Enumerable.html#M001795) is indispensable.
One more thing, there is a [Deep Fried Bytes Podcast][1] that is entirely about .NET development on Mac - you may find some nuggets in there too. [1]: http://deepfriedbytes.com/podcast/episode-5-developing-net-software-on-mac/
Another solution is [wget][1]. [1]: http://www.devarticles.com/c/a/Web-Services/Website-Mirroring-With-wget/1/
@Jonathan is correct, but you also have to change the return type to IList<T> also. Unless that is just a markdown bug.
@Jon and @Jonathan is correct, but you also have to change the return type to IList<T> also. Unless that is just a markdown bug. @[Jonathan][1], figured that was the case. [1]: http://stackoverflow.com/questions/43126/ilistcasttypeoft-returns-error-syntax-looks-ok#43137
@Jon and @Jonathan is correct, but you also have to change the return type to IList<T> also. Unless that is just a markdown bug. @[Jonathan][1], figured that was the case. I am not sure what version of nHibernate you are using. I haven't tried the gold release of 2.0 yet, but you could clean the method up some, by removing some lines: public static IList<T> LoadObjectListAll<T>() { ISession session = CheckForExistingSession(); // Not sure if you can configure a session after retrieving it. CheckForExistingSession should have this logic. // var cfg = new NHibernate.Cfg.Configuration().Configure(); var criteria = session.CreateCriteria(typeof(T)); return criteria.List<T>(); } [1]: http://stackoverflow.com/questions/43126/ilistcasttypeoft-returns-error-syntax-looks-ok#43137
@Jon and @Jonathan is correct, but you also have to change the return type to IList<T> also. Unless that is just a markdown bug. @[Jonathan][1], figured that was the case. I am not sure what version of nHibernate you are using. I haven't tried the gold release of 2.0 yet, but you could clean the method up some, by removing some lines: public static IList<T> LoadObjectListAll() { ISession session = CheckForExistingSession(); // Not sure if you can configure a session after retrieving it. CheckForExistingSession should have this logic. // var cfg = new NHibernate.Cfg.Configuration().Configure(); var criteria = session.CreateCriteria(typeof(T)); return criteria.List<T>(); } [1]: http://stackoverflow.com/questions/43126/ilistcasttypeoft-returns-error-syntax-looks-ok#43137
I develop in ASP.Net on my mac almost daily, and I have to question why you aren't interested in Boot Camp. Yeah, VMWare is nice, but for my money nothing beats the performance of running Windows by itself on the Mac.
@bpapa Nightly backups of work folders to servers will prevent losing more than a days work. @tonyo Let's see the requirement documents were completed the day after we finished coding. Does that tell you about our project management? We are a small shop so while you would think change is easy there are some here that are unbending to the old ways.
In C++, what alternatives do I have for exposing a collection, from the point of view of performance and data integrity.
Clearing Class::DBI's internal cache.
|perl|
I'm currently working on a large implementation of Class::DBI for an existing database structure, and am running into a problem with clearing the cache from Class::DBI. This is a mod_perl implementation, so an instance of a class can be quite old between times that it is accessed. From the man pages I found two options: Music::DBI->clear_object_index(); And: Music::Artist->purge_object_index_every(2000); Now, when I add clear_object_index() to the DESTROY method, it seems to run, but doesn't actually empty the cache. I am able to manually change the database, re-run the request, and it is still the old version. purge_object_index_every says that it clears the index every n requests. Setting this to "1" or "0", seems to clear the index... sometimes. I'd expect one of those two to work, but for some reason it doesn't do it every time. More like 1 in 5 times. Any suggestions for clearing this out?
Linux: What is the best way to estimate the code & static data size of program?
|c++|c|linux|
I want to be able to get an estimate of how much code & static data is used by my C++ program? Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime? Will objdump & readelf help?
Fluid rounded corners with jquery
|jquery|
What is the best way to create fluid width/height rounded corners with jquery?
How to divide two 64-bit numbers in Linux Kernel?
|linux|c|64-bit|
Some code (albeit a little contrived but close to the real thing) to demonstrate the problem (C-syntax): #define SINT64 long long int #define SINT32 long int SINT64 divRound(SINT64 dividend, SINT64 divisor) { SINT32 modResult = dividend % divisor; SINT32 multResult = modResult * 2; SINT32 quotient2 = multResult / divisor; SINT32 throwaway = dividend / divisor; SINT64 quotient = dividend + quotient2; return ( quotient ); } Now, if this were User-space we probably wouldn't even notice that our compiler is generating code for those operators (e.g. _divdi3()_ for division). Chances are we link with 'libgcc' without even knowing it. The problem is that Kernel-space is different (e.g. no libgcc). What to do? Crawl Google for a while, notice that pretty much everyone addresses the unsigned variant: #define UINT64 long long int #define UINT32 long int UINT64 divRound(UINT64 dividend, UINT64 divisor) { UINT32 modResult = dividend % divisor; UINT32 multResult = modResult * 2; UINT32 quotient2 = multResult / divisor; UINT32 throwaway = dividend / divisor; UINT64 quotient = dividend + quotient2; return ( quotient ); } I know how to fix this one: Override _udivdi3()_ and _umoddi3()_ with _do_div()_ from _asm/div64.h_. Done right? Wrong. Signed is not the same as unsigned, sdivdi3()_ does not simply call _udivdi3()_ , they are separate functions for a reason. Have you solved this problem? Do you know of a library that will help me do this? I'm really stuck so whatever you might see here that I just don't right now would be really helpful. Thanks, Chad
Working set isn't a good property to use. From what I gather, it includes everything the process can touch, even libraries shared by several processes, so you're seeing double-counted bytes in that counter. Private memory is a much better counter to look at.
Check out Share on [Acrobat.com][1], there you can upload PDFs and make them embedable Flash files (sort of like YouTube for documents). Should be possible to load those into Flex. Not an ideal solution, but unfortunately you need to convert the PDF to an SWF somehow to be able to load it into a Flex application. I don't know of any good tools that do this. If someone else knows please share. If you target AIR you can load a PDF into a HTML view, but that doesn't work when running in the browser (the HTML component is only available in AIR). [1]: http://www.acrobat.com
That it can close Firefox faster then I can with the mouse and that little [x] thing in the corner... :-P
If your objects are represented as points in 2D space you can use line intersection to determine if two objects have collided. You can use similar logic to check if an object is inside another object (and thus they have collided even any of their lines are not currently intersecting). The <a href="http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/">math to do this</a> is quite simple, and should be covered by any textbook on basic geometry. Detecting if an object has passed completely through an object might be a bit more tricky though.
If you plan on searching anything of remotely decent size, your best bet is going to be to use a dictionary or a set. Otherwise, you basically have to iterate through every element of the iterator until you get to the one you want. If this isn't necessarily performance sensitive code, then the list comprehension way should work. But note that it is fairly inefficient because it goes over every element of the iterator and then goes BACK over it again until it finds what it wants. Remember, python has one of the most efficient hashing algorithms around. Use it to your advantage.
I guess that "myStr" is an object of type String, in that case, this is not regex. \r and \n are the equivalents for CR and LF. My best guess is that if you know that you have an \n for EACH line, no matter what, then you first should strip out every \r. Then replace all \n with \r\n. The answer chakrit gives would also go, but then you need to use regex, but since you don't say what "myStr" is...
I guess that "myStr" is an object of type String, in that case, this is not regex. \r and \n are the equivalents for CR and LF. My best guess is that if you know that you have an \n for EACH line, no matter what, then you first should strip out every \r. Then replace all \n with \r\n. The answer chakrit gives would also go, but then you need to use regex, but since you don't say what "myStr" is... Edit:looking at the other examples tells me one thing.. why do the difficult things, when you can do it easy?, Because there is regex, is not the same as "must use" :D
I guess that "myStr" is an object of type String, in that case, this is not regex. \r and \n are the equivalents for CR and LF. My best guess is that if you know that you have an \n for EACH line, no matter what, then you first should strip out every \r. Then replace all \n with \r\n. The answer chakrit gives would also go, but then you need to use regex, but since you don't say what "myStr" is... Edit:looking at the other examples tells me one thing.. why do the difficult things, when you can do it easy?, Because there is regex, is not the same as "must use" :D Edit2: A tool is very valuable when fiddling with regex, xpath, and whatnot that gives you strange results, may I point you to: http://www.regexbuddy.com/
First of all. Getting linq itself to work on 2.0 is out of the question. Its possible, but really not something to do outside a testing environment. <br /><br /> The closest you can get in terms of the ORM/Dynamic Querying part of it, is imho SubSonic, which I'll recommend for anyone stuck in C# 2.0
` my %unique = (); for each my $item (@my_array) { $unique{$item} ++; } my @my_unique_array = keys %unique; ` If you use a hash and add the items to the hash. You also have the bonus of knowing how many times each item appears in the list
My usual was of doing this is: my %unique = (); for each my $item (@myarray) { $unique{$item} ++; } my @myuniquearray = keys %unique; If you use a hash and add the items to the hash. You also have the bonus of knowing how many times each item appears in the list
1. No. A table should be named after the entity it represents. Person, not persons is how you would refer to whoever one of the records represents. * Again, same thing. The column FirstName really should not be called FirstNames. It all depends on what you want to represent with the column. * NO. * Yes. Case it for clarity. If you need to have columns like "FirstName", casing will make it easier to read. <br /> <br /> Ok. Thats my $0.02
According to the standards, pwd -P should return the path with symlinks resolved. C function char *getcwd(char *buf, size_t size) from unistd.h should have the same behaviour.
According to the standards, pwd -P should return the path with symlinks resolved. C function char *getcwd(char *buf, size_t size) from unistd.h should have the same behaviour. [getcwd][1] [pwd][2] [1]: http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html [2]: http://www.opengroup.org/onlinepubs/009695399/utilities/pwd.html
Someone took the javascript code from Google Maps and ported it to python: [gmerc.py][1] I've used this and it works great. [1]:http://code.google.com/p/gheat/source/browse/trunk/__/lib/python/gmerc.py
You can use a similar technique on Windows, you just need to use different words for the same concepts. :) This article: http://msdn.microsoft.com/en-us/library/ms682499.aspx uses a win32 pipe to handle I/O from another process, you just have to do the same thing with threads within the same process. Of course, in your case all output to stderr from anywhere in the process will be redirected to your consumer. Actually, other pieces of the puzzle you may need are [_fdopen][1] and [_open_osfhandle][2]. In fact, here's a related example from some [code][3] I released years ago: DWORD CALLBACK DoDebugThread(void *) { AllocConsole(); SetConsoleTitle("Copilot Debugger"); // The following is a really disgusting hack to make stdin and stdout attach // to the newly created console using the MSVC++ libraries. I hope other // operating systems don't need this kind of kludge.. :) stdout->_file = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT); stdin->_file = _open_osfhandle((long)GetStdHandle(STD_INPUT_HANDLE), _O_TEXT); debug(); stdout->_file = -1; stdin->_file = -1; FreeConsole(); CPU_run(); return 0; } In this case, the main process was a GUI process which doesn't start with stdio handles at all. It opens a console, then shoves the right handles into stdout and stdin so the debug() function (which was designed as a stdio interactive function) can interact with the newly created console. You should be able to open some pipes and do the same sort of thing to redirect stderr. [1]: http://msdn.microsoft.com/en-us/library/dye30d82(VS.80).aspx [2]: http://msdn.microsoft.com/en-us/library/bdts1c9x(VS.71).aspx [3]: http://hewgill.com/pilot/copilot/
For bit operations, you need to use bitwise operators. This should do the trick: if(testItem & FlagTest.Flag1) { // Do something, // however This is never true. }
For bit operations, you need to use bitwise operators. This should do the trick: if ((testItem & FlagTest.Flag1) == FlagTest.Flag1) { // Do something, // however This is never true. } **Edit:** Fixed my if check - I slipped back into my C/C++ ways (thanks to Ryan Farley for pointing it out)
Palm or Pocket PC for developers
|mobile|device|
I need to develop some programs for mobile devices but haven't decided the platform to build upon. I'm looking for Palm or Pocket PC devices that have Touch screen and Wi-Fi connection and are cheep because I'll need to buy several of them. I don't really need mp3 players, video players, pdf readers or anything else since the apps are going to be simple data collection to feed to a server database. I'm proficient with C and C#. I could learn Java if I had to. What devices do you recommend? Should I look for other platforms (which ones)? Thanks
I need to develop some programs for mobile devices but haven't decided the platform to build upon. I'm looking for Palm or Pocket PC devices that have Touch screen and Wi-Fi connection and are cheep because I'll need to buy several of them. I don't really need mp3 players, video players, pdf readers or anything else since the apps are going to be simple data collection to feed via wireless to a server database. I'm proficient with C and C#. I could learn Java if I had to. What devices do you recommend? Should I look for other platforms (which ones)? Thanks
I need to develop some programs for mobile devices but haven't decided the platform to build upon. I'm looking for Palm or Pocket PC devices that have Touch screen and Wi-Fi connection and are cheep because I'll need to buy several of them. I don't really need mp3 players, video players, pdf readers or anything else since the apps are going to be simple data collection to feed via wireless to a server database. I'm proficient with C and C#. I could learn Java if I had to. What devices do you recommend? Linux devices maybe? Thanks
Mobile devices for developers
I need to develop some programs for mobile devices but haven't decided the platform to build upon. I'm looking for Palm or Pocket PC devices that have Touch screen and Wi-Fi connection and are cheep because I'll need to buy several of them. I don't really need mp3 players, video players, pdf readers or anything else since the apps are going to be simple data collection to feed via wireless to a server database. I'm proficient with C and C#. I could learn Java if I had to. What devices do you recommend? Linux devices maybe? Thanks PS: Changed the title because I don't want a flameware between platforms. I'm looking for devices instead.
|c++|
My problem is that I want to return an internal list of data to the caller, but I don't want to generate a copy. Thant leaves me with either returning a reference to the list, or a pointer to the list. However, I'm not crazy about letting the caller change the data, I just want to let it read the data. - Do I have to choose between performance and data integrity? - If so, is in general better to go one way or is it particular to the case? - Are there other alternatives?
Something to consider ... not everyone is capable of programming: Some people just cannot get past things like: A = 1 B = 2 A = B (these people will still think A = 1) [Jeff has talked about this too.][1] In fact, my example is in the link (and explained, to boot). [1]: http://www.codinghorror.com/blog/archives/000635.html
Oded, it depends on what type of .NET development one is trying to do, and for what platform. If you're targeting Windows and building something other than console apps, you're best off not using Mono, as Mono projects are not necessarily drop-in-to-Windows-and-go solutions.
Regex in VB6?
|regex|vb6|
I need to write a program that can sift through specially-formatted text files (essentially CSV files with a fixed set of column types that have different delimiters for some columns ... comma in most places, colons in others) to search for formatting errors. I figure regular expressions will be the way to go. The question: Is there a good regex library for VB6? Thank you!
I need to write a program that can sift through specially-formatted text files (essentially CSV files with a fixed set of column types that have different delimiters for some columns ... comma in most places, colons in others) to search for formatting errors. I figure regular expressions will be the way to go. The question: Is there a good regex library for VB6? Thank you! Edit: Holy crap, 3 responses in under an hour. Thanks a ton, folks! I've heard such good things about Regex Buddy from Jeff's postings / podcasting, that I will have to take a look.
One good way is to fix each bug in the stable branch and merge the stable branch into the development branch. This is the [Parallel Maintenance/Development Lines][1] pattern, and the key is to merge early and often. Merging infrequently and late means that the development branch is unrecognisable compared to the stable one, or the bug cannot be repeated in the same way. [Subversion][2] 1.5 includes merge tracking so you ensure that the same change set is not merged twice, causing silly conflicts. Other systems exist (e.g. [Git][3], [Accurev][4], [Perforce][5] to some extent) that let you make queries of the type "what changes on branch A have not been merged into branch B?" and cherry-pick the fixes you need across to the dev branch. [1]: http://www.cmcrossroads.com/bradapp/acme/branching/branch-structs.html#ParallelMaintDev [2]: http://subversion.tigris.org/ [3]: http://git.or.cz/ [4]: http://www.accurev.com [5]: http://www.perforce.com/
The page linked to in another answer is a good source, but a lot to read. Here is a short list of some the major differences: - internationalization: they used new terminology, rather than using language tied to US legal concepts - patents: they specifically address patents (including the Microsoft/Novell issue noted in another answer) - “Tivo-ization”: they address the restrictions (like Tivo’s) in consumer products that take away, though hardware, the ability to modify the software - DRM: they address digital rights management (which they call digital restrictions management) - compatibility: they addressed compatibility with some other open source licenses - termination: they addressed specifically what happens if the license is violated and the cure of violations I agree with the comment about consulting a lawyer (one who knows about software license issues, though). In doing these things (and more), they more than doubled the length of the GPL. GPL 3 is many things, and one of them is that it is a very complex, technical legal document.
Personally, I love the work of [Paul Bourke](http://local.wasp.uwa.edu.au/~pbourke/geometry/). Also, Paul Nettle used to write on the topic. He has a full 3D collision detection library, but you may be more interested in the ideas behind such libraries. For that, see [General Collision Detection for Games Using Ellipsoids](http://www.gamedev.net/reference/articles/article1026.asp).
Personally, I love the work of [Paul Bourke](http://local.wasp.uwa.edu.au/~pbourke/geometry/). Also, Paul Nettle used to write on the topic. He has a full 3D collision detection library, but you may be more interested in the ideas behind such libraries (which are very applicable to 2D). For that, see [General Collision Detection for Games Using Ellipsoids](http://www.gamedev.net/reference/articles/article1026.asp).
I took all of the podcasts from the answers scoring 5 or better (and those in the original question) and added them to an aggregated page on Cullect.com: [http://www.cullect.com/StackOverflow-Recommended-Podcasts][1] It provides a handy way to get a glimpse of these podcasts as well as a way to preview them if you're in a hurry or don't want to wade through all of the duplicates in the answers. I'm currently set up as the only curator of the "cullection", but if someone else wants to help keep it adjusted as the answers change, let me know. [1]: http://www.cullect.com/StackOverflow-Recommended-Podcasts
I think what you are looking for is called a toolStripSplitButton. It is only available in a toolStrip. But you can add a toolStripContainer anywhere on your form and then put the toolStrip and toolStripSplitButton inside your container. You won't want to show the grips so you'll want to set your gripMargin = 0. You can also set your autosize=true so that the toolstrip conforms to your button. The button will just look like a normal button (except for the split part) on your form.
For what it's worth, caching is DIRT SIMPLE in PHP even without an extension/helper package like memcached. All you need to do is create an output buffer using ob_start(). Create a global cache function. Call ob_start, pass the function as a callback. In the function, look for a cached version of the page. If exists, serve it and end. If it doesn't exist, the script will continue processing. When it reaches the matching ob_end() it will call the function you specified. At that time, you just get the contents of the output buffer, drop them in a file, save the file, and end. Add in some expiration/garbage collection. And many people don't realize you can nest ob_start()/ob_end() calls. So if you're already using an output buffer to, say, parse in advertisements or do syntax highlighting or whatever, you can just nest another ob_start/ob_end call.
Check out: http://www.swftools.org/ for tools to convert your PDF to SWF, speifically pdf2swf- http://www.swftools.org/pdf2swf.html
Since I found the control in Windows itself, I was hoping to find it built-in somewhere already so I didn't have to add anything to my code-base to use it. But the split button at this link (found via the msdn suggestion) looks pretty promising. [http://blogs.msdn.com/jfoscoding/articles/491523.aspx][1] I'll try it later myself, but does anyone know if it will handle visual styles well? [1]: http://blogs.msdn.com/jfoscoding/articles/491523.aspx
I think the best answer to each of those questions would be given by you and your team. It's far more important to have a naming convention then how exactly the naming convention is. As there's no right answer to that, you should take some time (but not too much) and choose your own conventions and - *here's* the important part - stick to it. Of course it's good to seek some information about standards on that, which is what you're asking, but don't get anxious or worried about the number of different answers you might get: choose the one that seems better for you. Just in case, here are my answers: 1. Yes. A table is a group of *records*, *teachers* or *actors*, so... plural. 2. Yes. 3. I don't use them. 4. The database I use more often - Firebird - keeps everything in upper case, so it doesn't matter. Anyway, when I'm programming I write the names in a way that it's easier to read, like *releaseYear*.
You can do something like this: sub uniq { return keys %{{ map { $_ => 1 } @_ }}; } @my_array = ("one","two","three","two","three"); print join(" ", @my_array), "\n"; print join(" ", uniq(@my_array)), "\n"; That destroys the original order of the items in the array, though.
You can do something like this: sub uniq { return keys %{{ map { $_ => 1 } @_ }}; } @my_array = ("one","two","three","two","three"); print join(" ", @my_array), "\n"; print join(" ", uniq(@my_array)), "\n"; That destroys the original order of the items in the array, though. Update: Here's an easier to understand function that preserves the original order: sub uniq2 { my %seen = {}; my @r = (); foreach my $a (@_) { unless ($seen{$a}) { push @r, $a; $seen{$a} = 1; } } return @r; }
You can do something like this: sub uniq { return keys %{{ map { $_ => 1 } @_ }}; } @my_array = ("one","two","three","two","three"); print join(" ", @my_array), "\n"; print join(" ", uniq(@my_array)), "\n"; That destroys the original order of the items in the array, though. Update: Here's an easier to understand function that preserves the original order: sub uniq2 { my %seen = (); my @r = (); foreach my $a (@_) { unless ($seen{$a}) { push @r, $a; $seen{$a} = 1; } } return @r; }
Common shell scripts often have to find their "home" directory even if they are invoked as a symlink. The script thus have to find their "real" position from just $0. cat `mvn` on my system prints a script containing the following, which should be a good hint at what you need. if [ -z "$M2_HOME" ] ; then ## resolve links - $0 may be a link to maven's home PRG="$0" # need this for relative symlinks while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG="`dirname "$PRG"`/$link" fi done saveddir=`pwd` M2_HOME=`dirname "$PRG"`/.. # make it fully qualified M2_HOME=`cd "$M2_HOME" && pwd`
I need to develop some programs for mobile devices but haven't decided the platform to build upon. I'm looking for Palm or Pocket PC devices that have Touch screen and Wi-Fi connection and are cheep because I'll need to buy several of them. I don't really need camera, mp3 players, video players, pdf readers or anything else since the apps are going to be simple data collection to feed via wireless to a server database. I'm proficient with C and C#. I could learn Java if I had to. What devices do you recommend? Linux devices maybe? PS: Changed the title because I don't want a flamewar between platforms. Please, don't answer with Windows Mobile sucks/rules. I'm looking for devices instead. Thanks
Regarding the edit. You can't make it true. I suggest you wrap what you want into another class (or extension method) to get closer to the syntax you need. i.e. public class FlagTestCompare { public static bool Compare(this FlagTest myFlag, FlagTest condition) { return ((myFlag & condition) == condition); } }
Regarding the edit. You can't make it true. I suggest you wrap what you want into another class (or extension method) to get closer to the syntax you need. i.e. public class FlagTestCompare { public static bool Compare(this FlagTest myFlag, FlagTest condition) { return ((myFlag & condition) == condition); } }
Does C# have built-in support for parsing page-number strings?
|c#|parsing|