instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
What follows is a regular expression I have written to match multi-line pre-processor macros in C / C++ code. I'm by no means a regular expressions guru, so I'd welcome any advice on how I can make this better.
Here's the regex:
\s*#define(.*\\\n)+[\S]+(?!\\)
It should match all of this:
#define foo(x) if(x) \
doSomet... | stackexchange/codereview |
I realize there is a somewhat related thread on this here:
Loading assemblies and its dependencies
But I am modifying something and this doesn't exactly apply.
string path = Path.GetDirectoryName( pathOfAssembly );
Environment.CurrentDirectory = path;
Assembly.Load(Path.GetFileNameWithoutExtension(pastOfAssembly));
... | stackexchange/codereview |
I despise the PHP language, and I'm quite certain that I'm not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating with the apache runtime, and achieves CGI-like request isolation and decent performance.
What's the shortest-distance approach to getting the same ... | stackexchange/codereview |
I've looked around for a good example of this, but I haven't run into one yet. I want to pass a custom string array from java to oracle and back, using the IBATIS framework. Does anyone have a good link to an example? I'm calling stored procs from IBATIS.
Thanks
| stackexchange/codereview |
It is discouraged to simply catch System.Exception. Instead, only the "known" exceptions should be caught.
Now, this sometimes leads to unnecessary repetitive code, for example:
try
{
WebId = new Guid(queryString["web"]);
}
catch (FormatException)
{
WebId = Guid.Empty;
}
catch (OverflowException)
{
WebId = ... | stackexchange/codereview |
I have three (C++) classes: Player, Hand, and Card.
Player has a member, hand, that holds a Hand. It also has a method, getHand(), that returns the contents of hand.
Hand Player::getHand() {
return hand;
}
Hand has a method, addCard(Card c), that adds a card to the hand.
I want to do this:
player1.getHand().addCar... | stackexchange/codereview |
You do you manage the same presenter working with different repositories using the MVP pattern?
I just have multiple constructor overloads and the presenter simply uses the one that is suitable for the scenario.
AddCustomerPresenter presenter = new AddCustomerPresenter(this,customerRepository);
presenter.AddCustomer... | stackexchange/codereview |
SELECT GETDATE()
Returns: 2008-09-22 15:24:13.790
I want that date part without the time part: 2008-09-22 00:00:00.000
How can I get that?
| stackexchange/codereview |
I am working on a client proposal and they will need to upgrade their network infrastructure to support hosting an ASP.NET application. Essentially, I need to estimate peak usage for a system with a known quantity of users (currently 250). A simple answer like "you'll need a dedicated T1 line" would probably suffice, b... | stackexchange/codereview |
How does AOP (Aspect Oriented Programming) work in Drupal?
I have learned about AOP in terms of using it for logging and security, but how does it apply to Drupal?
| stackexchange/codereview |
I've been learning Lisp to expand my horizons because I have heard that it is used in AI programming. After doing some exploring, I have yet to find AI examples or anything in the language that would make it more inclined towards it.
Was Lisp used in the past because it was available, or is there something that I'm jus... | stackexchange/codereview |
I am trying to install xampp 1.6.7 in a Red Hat Enterprise Edition. I followed the installation instructions and after that I started the stack with the command
sudo /opt/lampp/lampp start
And I get te usual response
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAM... | stackexchange/codereview |
Whenever I type a (, [, or {, Notepad++ completes it with the corresponding closing bracket. I find this 'feature' annoying and would like to disable it. It doesn't seem to be listed in the Preferences dialog and a search of the online documentation didn't yield any useful result.
Does anybody here know where the opti... | stackexchange/codereview |
The project I'm starting to work at will have several dozens of controllers, so it would be nice to structure them into logical directories and respective namespaces, like "Controllers/Admin/", "Controllers/Warehouse/Supplies/", etc.
Does ASP.NET MVC support nested controller directories and namespacing?
How do I mana... | stackexchange/codereview |
Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this.
We are running Redhat Linux 5.
| stackexchange/codereview |
I'm using lucene in my project.
Here is my question:
should I use lucene to replace the whole search module which has been implemented with sql using a large number of like statement and accurate search by id or sth,
or should I just use lucene in fuzzy search(i mean full text search)?
| stackexchange/codereview |
We've pre-defined Excel document structure with lots of formulas and macros written.
During download of Excel, thru Java application we populate certain cells in Excel with data. After download when user open Excel, macros & formulas embedded in it will read the pre-populated data and behave accordingly.
We are right n... | stackexchange/codereview |
fopen is failing when I try to read in a very moderately sized file in PHP. A 6 meg file makes it choke, though smaller files around 100k are just fine. i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files over 20 gigs or something ridiculous, but shoul... | stackexchange/codereview |
I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes.
My goal is to read data from database A in application B and transfer that data into the database of B (to make ... | stackexchange/codereview |
I'm trying to build a web crawler.
I need 2 things:
Convert the HTML into a DOM object.
Execute existing JavaScripts on demand.
The result I expect is a DOM Object, where the JavaScript that executes on-load is already executed.
Also, I need an option to execute on demand additional JavaScripts (on events like: onMous... | stackexchange/codereview |
Can I persuade operator>> in C++ to read both a hex value AND and a decimal value? The following program demonstrates how reading hex goes wrong. I'd like the same istringstream to be able to read both hex and decimal.
#include <iostream>
#include <sstream>
int main(int argc, char** argv)
{
int result = 0;
/... | stackexchange/codereview |
I have a lot of changes in a working folder, and something screwed up trying to do an update.
Now when I issue an 'svn cleanup' I get:
>svn cleanup .
svn: In directory '.'
svn: Error processing command 'modify-wcprop' in '.'
svn: 'MemPoolTests.cpp' is not under version control
MemPoolTests.cpp is a new file another de... | stackexchange/codereview |
I want to delete all directories and subdirectories under a root directory that are contain "tmp" in their names. This should include any .svn files too. My first guess is to use
<delete>
<dirset dir="${root}">
<include name="**/*tmp*" />
</dirset>
</delete>
This does not seem to work as you can't n... | stackexchange/codereview |
In Oracle, the number of rows returned in an arbitrary query can be limited by filtering on the "virtual" rownum column. Consider the following example, which will return, at most, 10 rows.
SELECT * FROM all_tables WHERE rownum <= 10
Is there a simple, generic way to do something similar in Ingres?
| stackexchange/codereview |
For many years I have used two great tools BoundsChecker & Purify, but the developers of these applications have let me down, they no longer put effort into maintaining them or developing them. We have corporate accounts with both companies, and they both tell me that they have no intention of producing versions to sup... | stackexchange/codereview |
I'm looking for an overview over different source code control policies. I only came across the Main-Line policy and would like to better know others before committing to one with the team.
Can someone provide a link to an overview or even give me some names of policies so I can launch google on it?
| stackexchange/codereview |
I'm wondering if the need to alter the indentation of code to adjust the nesting has any adverse effects on merging changes in a system like SVN.
| stackexchange/codereview |
What is the simplest way to determine the length (in seconds) of a given mp3 file, without using outside libraries? (python source highly appreciated)
| stackexchange/codereview |
What is the best way to generate a current datestamp in Java?
YYYY-MM-DD:hh-mm-ss
| stackexchange/codereview |
I'd like to check if the current browser supports the onbeforeunload event.
The common javascript way to do this does not seem to work:
if (window.onbeforeunload) {
alert('yes');
}
else {
alert('no');
}
Actually, it only checks whether some handler has been attached to the event.
Is there a way to detect if on... | stackexchange/codereview |
How long can I expect a client/server TCP connection to last in the wild?
I want it to stay permanently connected, but things happen, so the client will have to reconnect. At what point do I say that there's a problem in the code rather than there's a problem with some external equipment?
| stackexchange/codereview |
Can WampServer be used successfully in production? Is this a bad idea?
So everyone knows, and I don't see how this mattered, we've paid for a windows dedicated box and we have existing IIS apps. We just wanted to use a PHP based CMS which installs easier on apache (since it has some dependencies). So, as the title indi... | stackexchange/codereview |
In C# when I am done entering the fields of a snippet, I can hit Enter to get to the next line. What is the equivalent Key in VB?
Edit: I prefer not to use the mouse.
| stackexchange/codereview |
When used like this:
import static com.showboy.Myclass;
public class Anotherclass{}
what's the difference between import static com.showboy.Myclass and import com.showboy.Myclass?
| stackexchange/codereview |
How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.
Other alt... | stackexchange/codereview |
Why does the JavaScript function encodeURIComponent encode spaces to the hex Unicode value %20 instead of +. Should URI parameters not spaces to +?
| stackexchange/codereview |
How do SQL developers go about keeping up on current techniques and trends in the SQL world? Are there any blogs, books, articles, techniques, etc that are being used to keep up to date and in the know?
There are a lot of opportunities out their for OO, procedural, and functional programmers to take part in a variety ... | stackexchange/codereview |
I was wondering are there any security concerns with adding crossdomain.xml to the root of an application server? Can it be added to any other parts of the server and are you aware of any work arounds that dont require the server to have this file in place?
Thanks
Damien
| stackexchange/codereview |
I'm using Java, and need to generate a simple, standards-compliant RSS feed. How can I go about this?
| stackexchange/codereview |
Under what circumstances might you want to use multiple indirection (that is, a chain of pointers as in Foo **) in C++?
| stackexchange/codereview |
I have developed a simple page using JQuery. It works fine in almost all browsers (i.e. Firefox, IE, Chrome) but whenever the page is opened in IE, it prompts Javascript error like,
'guid' is null or not an object on line 1834
Do you have any idea ?
| stackexchange/codereview |
Is there a way to prevent VS2008 creating browse info file files for C++ projects.
I rarely use the class browser and it isn't worth the time it takes to recreate it after every build, especially since it runs even if the build failed.
EDIT - it's also needed for go to declaration/definition
| stackexchange/codereview |
I have a web app for commercial property management that needs spreadsheet-like functionality for doing budgets. I don't want to use Google Sheets because my users won't necessarily have a Google account.
So is there anything out there that I could use?
I looked and could only find SocialCalc which wasn't quite good e... | stackexchange/codereview |
Scott Hanselman says yes.
Adding System.Web to your non-web project is a good way to get folks to panic. Another is adding a reference to Microsoft.VisualBasic in a C# application. Both are reasonable and darned useful things to do, though.
MSDN says no.
The Cache class is not intended for use outside of ASP.NET app... | stackexchange/codereview |
I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause:
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { }
excelSheet = null;
GC.Collect();
GC.WaitForPendingFinalizers();
Although this kind of works, the Excel.exe process is still ... | stackexchange/codereview |
I'm trying to use CSS (under @media print) and JavaScript to print a one-page document with a given piece of text made as large as possible while still fitting inside a given width. The length of the text is not known beforehand, so simply using a fixed-width font is not an option.
To put it another way, I'm looking f... | stackexchange/codereview |
The question gives all necessary data: what is an efficient algorithm to generate a sequence of K non-repeating integers within a given interval [0,N-1]. The trivial algorithm (generating random numbers and, before adding them to the sequence, looking them up to see if they were already there) is very expensive if K is... | stackexchange/codereview |
There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It's not hard to produce a working (but absolutely useless) m... | stackexchange/codereview |
As Microsoft seems to have started their trickle feed of information regarding .NET 4.0, I thought I'd ask the question as I'm sure there's more out there than I've spotted!
What information has been released regarding the .NET Framework 4.0?
| stackexchange/codereview |
I work in an multi-site environment that's currently using Rational ClearCase for source control and Rational ClearQuest for issue tracking (I accept your condolences ahead of time). As a rough estimate I would say this is supporting 200 engineers.
How would you effectively migrate this SCM methodology to a comparativ... | stackexchange/codereview |
What are some scenarios where MultiView would be a good choice? The MultiView control along with its View controls simply seem to extend the notion of Panels.
Both Panels and MultiViews seem prone to abuse. If your UI concerns and biz logic concerns are properly separated, why lump views together in a single ASPX?
| stackexchange/codereview |
It often happens that characters such as é gets transformed to é, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the Content-Type for the page is also set to UTF8.
I know about utf8_encode/decode, but I'm not quite sure about where and how to use it.
I have read ... | stackexchange/codereview |
I am wondering if there is a way to combine multiple images into a single image using only JavaScript. Is this something that Canvas will be able to do. The effect can be done with positing, but can you combine them into a single image for download?
Update Oct 1, 2008:
Thanks for the advice, I was helping someone wor... | stackexchange/codereview |
It's the weekend, so I relax from spending all week programming by writing a hobby project.
I wrote the framework of a MOS 6502 CPU emulator yesterday, the registers, stack, memory and all the opcodes are implemented. (Link to source below)
I can manually run a series of operations in the debugger I wrote, but I'd like... | stackexchange/codereview |
Does anyone know of a really good editor to debug JavaScript (other then Visual Studio 2008 and FireBug)?
| stackexchange/codereview |
Can someone please remind me how to create a .Net class from an XML file?
I would prefer the batch commands, or a way to integrate it into the shell.
Thanks!
| stackexchange/codereview |
I'm trying to configure ASP caching in IIS, following the instructions of a software I purchased. This is supposed to make it run faster.
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/a5766228-828e-4e31-a92b-51da7d24d569.mspx?mfr=true
The software instructions point to that article.
The pro... | stackexchange/codereview |
Does a hash shrink in Perl as you delete elements.
More specifically I had a perl program that I inherited that would parse a huge file ( 1 GB ) and load up a hash of hashes. it would do that same for another file and then do a comparison of different elements. The memory consumption was huge during this process and e... | stackexchange/codereview |
I assume there must be a system and language independent way to just stick the "current" EOL character into a text file, but my MSDN-fu seems to be weak today. Bonus points if there is a way to do this in a web application that will put the correct EOL character for the current client's machine's OS, not the web serve... | stackexchange/codereview |
I use the commercial version of Jalopy for my Java projects but it doesn't work on Groovy files. IntelliJ has a serviceable formatter but I don't like requiring a particular IDE.
| stackexchange/codereview |
I am looking for any examples or guides to using Linq over WCF (n-tier application). Please specify if you are showing something for Linq-to-SQL or Linq-to-entities. I would like to see usage examples for both.
I am wondering how things like deffered execution works over WCF (if it works at all)? Cyclic references sup... | stackexchange/codereview |
How do I copy a file in Python?
| stackexchange/codereview |
When adding a DLL as a reference to an ASP.Net project, VS2008 adds several files to the bin directory. If the DLL is called foo.dll, VS2008 adds foo.dll.refresh, foo.pdb and foo.xml. I know what foo.dll is :-), why does VS2008 add the other three files? What do those three files do? Can I delete them? Do they nee... | stackexchange/codereview |
A table in my area of responsibility of our product has been criticised as having more than one orthogonal index.
What is an orthogonal index?
Why is it bad?
How can the situation be avoided?
--Update--
The back-end database engine isn't necessarily relevant here as our application is database-agnostic. But if it helps... | stackexchange/codereview |
With really small sets of data, the policy where I work is generally to stick them into text files, but in my experience this can be a development headache. Data generally comes from the database and when it doesn't, the process involved in setting it/storing it is generally hidden in the code. With the database you ca... | stackexchange/codereview |
I'm writing a series of Windows services. I want them to fail if errors are thrown during startup (in OnStart() method). I had assumed that merely throwing an error in OnStart() would do this, but I'm finding that instead it "Starts" and presents me with a message stating "The service has started, but is inactive. I... | stackexchange/codereview |
I've got a lot of mysql data that I need to generate reports from. It's mostly historic data so it won't be changing much, but it weighs in at 20-30 gigabytes easily and is expected to grow. I currently have a collection of php scripts that will do some complex queries and output csv and excel files. I also use phpMyAd... | stackexchange/codereview |
My question: Is the MIPS programming language that beneficial to know?
I'm a CS student and am taking an assembly class which focuses on MIPS. I'm very comfortable writing in high level languages, but MIPS has me a little bit down.
Is MIPS something that I should really focus on and try to completely grasp? Will it hel... | stackexchange/codereview |
Is there any downside or problem potential to change the Java compiler to automatically cast? In the example below the result of list.get(0) would automatically be casted to the type of the variable hi.
List list = new ArrayList();
list.add("hi");
String hi = list.get(0);
I know that generics allow you to reduce casti... | stackexchange/codereview |
We've got some problems with an external company trying in integrate into a WCF service we expose and they are a Java shop. I was wondering if there are more than one toolkit that they can try to solve their issues and would like a list to suggest to them but I'm not familiar with the Java world at all.
Essentially the... | stackexchange/codereview |
Our web site (running Rails) freezes IE6 nearly every time. The same code, deployed on a different server, does not freeze IE6. Where and how should we start tracking this down?
| stackexchange/codereview |
I would like to know when I should include external scripts or write them inline with the html code, in terms of performance and ease of maintenance.
What is the general practice for this?
Real-world-scenario - I have several HTML pages that need client-side form validation. For this I use a jQuery plugin that I includ... | stackexchange/codereview |
I need to know where i can get a free version of C and C++ compilers for Windows Vista. Many of the versions i have tried are not working in fullscreen mode.
| stackexchange/codereview |
I´m programming a .NET Compact Framework application which shows maps on a PDA.
I´ve created an ad hoc component that paints it´s own piece of the whole map, using several of this components the big picture is composed. I did it this way to avoid the latency of painting the whole map in a single step.
What I would like... | stackexchange/codereview |
I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook.
I found a page on microsoft.com that says ... | stackexchange/codereview |
How can I be notified when someone checks a file into Team System and doesn't associate it with a work item?
| stackexchange/codereview |
How do you use the nant <copy> command and maintain the directory structure? This is what I am doing, but it is copying all the files to a single directory.
<copy todir="..\out">
<fileset>
<includes name="..\src\PrecompiledWeb\**\*" />
</fileset>
</copy>
| stackexchange/codereview |
I'm using JavaScript to hide an image and show some text thats hidden under it. But, when the text is shown if you scroll over it, it fires the mouseout event on the container, that then hides the text and shows the image again, and it just goes into a weird loop.
The html looks like this:
<div onmouseover="jsHoverIn('... | stackexchange/codereview |
Let's say you have a function that returns a date:
Date myFunc(paramA, paramB){
//conditionally return a date?
}
Is it appropriate to return null from this function? This seems ugly because it forces clients to check for null.
The "null object" pattern is an implementation pattern that addresses this concern.
I'm ... | stackexchange/codereview |
I'm trying to iterate all the controls on a form and enable ClearType font smoothing. Something like this:
procedure TForm4.UpdateControls(AParent: TWinControl);
var
I: Integer;
ACtrl: TControl;
tagLOGFONT: TLogFont;
begin
for I := 0 to AParent.ControlCount-1 do
begin
ACtrl:= AParent.Controls[I];
// ... | stackexchange/codereview |
I really want to be able to have a way to take an app that currently gets its settings using ConfigurationManager.AppSettings["mysettingkey"] to actually have those settings come from a centralized database instead of the app.config file. I can make a custom config section for handling this sort of thing, but I really... | stackexchange/codereview |
I have an ASPX page (On server A) which is invoked using NTLM credentials. Part of that page's job is to call an HTML page (On server B) and proxy it back to the client. (The firewall allows access to A, but not to B. The user would normally be allowed access to both servers.). Server B is also not open to anonymou... | stackexchange/codereview |
I've installed .NET Framework 3.5 SP1 on web server (Server 2008 Enterprise), so running IIS 7.0.
I want to change the version of .NET Framework used by an existing site. So I right-click on appropriate Application Pool and selected Edit Application Pool. The .NET Framework dropdown does not include an explicit entry... | stackexchange/codereview |
I am trying to style an input-box rendered using jEditable.
I want to change the color of the table-cell when the text is double-clicked and made editable. Like this:
alt text http://www.hongaijitsu.com/temp/foobar/public/Picture-2.png
This is where I am at the moment: jEditable CSS Problem (double-click the text in th... | stackexchange/codereview |
I've been using Lisp on and off for a while but I'm starting to get more serious about doing some "real" work in Lisp. I'm a huge Vim fan and was wondering how I can be most productive using Vim as my editor for Lisp development. Plugins, work flow suggestions, etc. are all welcome.
Please don't say "use emacs" as I've... | stackexchange/codereview |
Compared to
Simple memory access
Disk access
Memory access on another computer(on the same network)
Disk access on another computer(on the same network)
in C++ on windows.
| stackexchange/codereview |
I am creating a site in which different pages can look very different depending upon certain conditions (ie logged in or not, form filled out or not, etc). This makes it necessary to output diferent blocks of html at different times.
Doing that, however, makes my php code look horrific... it really messes with the for... | stackexchange/codereview |
Are there any industry standard conventions for naming jar files?
| stackexchange/codereview |
How do I check from within my NSIS installer if my installer has the blocked option in preferences on it.
Even if you know of a way to check this without NSIS, please let me know so I can script it myself.
See this question to find out more info about this blocked option.
| stackexchange/codereview |
I am working on a web app that uses Perl and I need to look into speeding up portions of the app.
I thought I'd start profiling the particular calls for the portion I wish to investigate. I've done some searching on profiling Perl code, but unfortunately most of what I find says that I should run my perl code with -... | stackexchange/codereview |
I am planning on porting a PHP application over to Python. The application is mostly about data collection and processing. The main application runs as a stand alone command line application. There is a web interface to the application which is basically a very light weight reporting interface.
I did not use a fra... | stackexchange/codereview |
I have created a web reference (Add Web Reference) from Visual Studio 2008 and strangely, I need to set the propertyNameFieldSpecified to true for all the fields I want to submit. Failure to do that and values are not passed back to the WCF Service.
I have read at several places that this was fixed in the RTM version ... | stackexchange/codereview |
I'm using Java 6, Tomcat 6, and Metro. I use WebService and WebMethod annotations to expose my web service. I would like to obtain information about the request. I tried the following code, but wsCtxt is always null. What step must I take to not get null for the WebServiceContext.
In other words: how can I execute the ... | stackexchange/codereview |
When running an old MFC application in Visual Studio's debugger I've seen a lot of warnings in the Output window like the following:
Warning: skipping non-radio button in group.
I understand that in MFC you put radio buttons in groups to indicate which sets of radio buttons go together. If I remember correctly you d... | stackexchange/codereview |
We use oracle as the back-end database for our product. I have been running series of stress tests on our system and I have started noticing that oracle is much faster right after the database was restarted. Over time (a couple hours or so) the database seems to get slower and slower and I will see the database machine... | stackexchange/codereview |
I need to generate a directory in my makefile and I would like to not get the "directory already exists error" over and over even though I can easily ignore it.
I mainly use mingw/msys but would like something that works across other shells/systems too.
I tried this but it didn't work, any ideas?
ifeq (,$(findstring $... | stackexchange/codereview |
I hit this error while my web application was trying to execute a SELECT INTO on a MSSQL 2005 database. I really have two questions:
What does this error mean and how does this happen?
Is there a way to prevent these errors by coding in a different way?
| stackexchange/codereview |
I am looking for a Dataflow / Concurrent Programming API for Java.
I know there's DataRush, but it's not free. What I'm interested in specifically is multicore data processing, and not distributed, which rules out MapReduce or Hadoop.
Any thoughts?
Thanks,
Rollo
| stackexchange/codereview |
I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever.
Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the previous search highlighting.
Can't I just hit a magic key... | stackexchange/codereview |
I often see code like:
Iterator i = list.iterator();
while(i.hasNext()) {
...
}
but I write that (when Java 1.5 isn't available or for each can't be used) as:
for(Iterator i = list.iterator(); i.hasNext(); ) {
...
}
because
It is shorter
It keeps i in a smaller scope
It reduces the chance of confusion. (Is ... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.