instruction
stringlengths
0
30k
|javascript|dom|
What are good alternative data formats to XML?
|xml|data-structures|serialization|
XML, granted, is very useful, but can be quite verbose. What alternatives are there and are they specialised for any particular purpose? Library support to interrogate the contents easily is a big plus point.
There is a technique called "[Hole Punching][1]" that works well with "Cone" NAT (Cone is a technical familly of router). That's not an 100% sure technique, today, it works well with UDP on about 80% of the router. There is some implementations of library to realize Hole Punching: [STUN][2] ([wikipedia][3]) [1]: http://en.wikipedia.org/wiki/Hole_punching [2]: http://sourceforge.net/projects/stun/ [3]: http://en.wikipedia.org/wiki/STUN
There seems to be a lot of multi-platform support for [JSON][1]. [1]: http://www.json.org/
Starting in NHibernate 2.0, transactions are required for DB operations. Therefore, the `ITransaction.Commit()` call will handle any necessary flushing. If for some reason you aren't using NHibernate transactions, then there will be no auto-flushing of the session.
S-Expressions work great if you don't need to apply attributes to elements. Another alternative is YAML.
Don't forget about [YAML](http://www.yaml.org/)! JSON seems to have better support though. For example, the [Prototype JS](http://www.prototypejs.org/) library has excellent built-in JSON functions.
Here is a short pure-javascript example. Assume you have a div with the id "maincontent". var newnode = document.createTextNode('Here is some text.'); document.getElementById('maincontent').appendChild(newnode); Of course, things are a lot easier (especially when you want to do more complicated things) with jQuery.
You might want to look into Steganography; that is hiding data inside of images. There are forms that won't get lost if you convert to a lossier format or even crop parts of the image out.
There are is an addition in 3.5 SP1 that allow better interaction between DirectX and WPF (D3DImage), and one way to get to that is through XNA. Here is some details: http://jmorrill.hjtcentral.com/Default.aspx?tabid=428&EntryID=259
Difference between foreach and for loops over an IEnumerable class in C#
If you are working in the plane and you want the <a href="http://en.wikipedia.org/wiki/Euclidean_distance">Euclidean distance</a> "as the crow flies": // Cities are points x0,y0 and x1,y1 in kilometers or miles or Smoots[1] dx = x1 - x0; dy = y1 - y0; dist = sqrt(dx*dx + dy*y); No trigonometry needed! Just the <a href="http://en.wikipedia.org/wiki/Pythagorean_theorem">Pythagorean theorem</a> and the fact that squares are always positive so you don't need dx = abs(x1 - x0), etc. to get a positive number to pass to sqrt(). Note that you could probably do this in one line and a compiler would _probably_ reduce it the equivalent above code: dist = sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0)); [1] <http://en.wikipedia.org/wiki/Smoot>
I do not have personal experience with this product, but [dokeos][1] is recommended by several people on other sites. [1]: http://www.dokeos.com/
Microsoft Reporting Services, **free** and included with SQL Server 2005 and 2008. Of course, this is great if you need a separation of report design and application, which for Enterprise applications is a huge plus. However, if what you want is to be able to create "in application" dashboards, where "you" design the reports and have limited parameters you expose to the user, then I suggest looking into "control" based charting vendors like [TeeChart][1] . Pros/cons of each strategy: Crystal/Microsoft Reporting services will give you out of the box handling of things like report scheduling, export to excel and pdf, and separation between application and report design. The independent charting tools you can get give you better control, they render better on any size you need, easier to grammatically manipulate and can handle eye candy such as flash based (no flash charts in MS SSRS) [1]: http://www.steema.com/
@adeel - I think [this blog entry][1] can give you some details at least about one user that has tried [DimDim][2]. [1]: http://injenuity.com/archives/64 [2]: http://www.dimdim.com/
+1 SSRS and ActiveReports. ryw, use ActiveReports and close the gates of Crystal Hell behind you forever.
I think the first part is your Application. If you decide to go PHP, you almost automatically end up with LAMP, as WIMP or WISP stacks are quite rare (I think blog.stackoverflow.com runs on WIMP), and with .net you definitely want to go WISA. So normally, it boils down to .net vs. PHP. (Ignoring Ruby, Python and all the other stuff for a moment). When you made that decission, the rest comes naturally or adopts into your environment (i.e. if all your admins in the company are windows admins, maybe WAMP works better for you) I switched from PHP to .net about a year ago and I never looked back at PHP, but I never had to look at the bill for Windows and SQL Server licenses to be fair. Deployment on WISA has a much higher initial cost due to the licenses involved, whereas a LAMP Stack is free (Yes, MySQL is also free for commercial use). Addendum: All the funny acronyms stand for the combination of technologies: (L)inux or (W)indows, (A)pache or (I)IS, (M)ySQL or (S)QL Server, (P)hp or (A)SP.net.
Whats the best way to securely push a site to a live server?
Is it possible to settle this dispute? My first thought is to look to a symbolic language, like [Maple](http://en.wikipedia.org/wiki/Maple_(software). I don't think that counts as floating point though. In fact, how does one represent _i_ (or _j_ for the engineers) in a conventional programming language? Perhaps a better example is sin(π) = 0? (Or have I missed the point again?)
The GNU C Library supports [regular expressions][1]. It's open, and the RE code seems to be easily extractable. [1]: http://www.gnu.org/software/libtool/manual/libc/Regular-Expressions.html
How To Display 100 Floating Cubes Using DirectX OR OpenGL?
|language-agnostic|opengl|3d|directx|
I'd like to display ~100 floating cubes using DirectX or OpenGL. I'm looking for either some sample source code, or a description of the technique. I know this kind of thing is easy for you accomplished 3D gurus out there but I have enough trouble getting even one cube to display correctly. I've combed the net for a good series of tutorials and although they talk about how to do 3D primitives, what I can't find is information on how to do large numbers of 3D primitives - cubes, spheres, pyramids, and so forth. Thanks! Any help is appreciated.
In general, you can't change the effective user id of the vi process, but you can do this: :w !sudo tee myfile
While I haven't used a flash object inside a windows form application myself, I do know that it's possible. In Visual studio on your toolbox, choose to add a new component. Then in the new window that appears choose the **"COM Components"** tab to get a list in which you can find the **"Shockwave Flash Object"** Once added to the toolbox, simply use the control as you would use any other "standard" control from visual studio. three simple commands are available to interact with the control: - AxShockwaveFlash1.Stop() - AxShockwaveFlash1.Movie = FilePath & "\FileName.swf" - AxShockwaveFlash1.Play() which, I think, are all self explanatory.
While I haven't used a flash object inside a windows form application myself, I do know that it's possible. In Visual studio on your toolbox, choose to add a new component. Then in the new window that appears choose the **"COM Components"** tab to get a list in which you can find the **"Shockwave Flash Object"** Once added to the toolbox, simply use the control as you would use any other "standard" control from visual studio. three simple commands are available to interact with the control: - AxShockwaveFlash1.Stop() - AxShockwaveFlash1.Movie = FilePath & "\FileName.swf" - AxShockwaveFlash1.Play() which, I think, are all self explanatory. > It would be great to be able to load > the flash content from a stream of > sorts rather than a file on disk. I just saw you are also looking for a means to load the content from a stream, and because I'm not really sure that is possible with the shockwave flash object I will give you another option (two actually). the first is the one I would advise you to use only when necessary, as it uses the full blown **"webbrowser component"** (also available as an extra toolbox item), which is like trying to shoot a fly with a bazooka. of course it will work, as the control will act as [a real browser window][1] (actually the internet explorer browser), but its not really meant to be used in the way you need it. the second option is to use something I just discovered while looking for more information about plying flash content inside a windows form. [F-IN-BOX][2] is a commercial solution that will also play content from a given website URL. (The link provided will direct you to the .NET code you have to use). [1]: http://visualbasic.about.com/library/courses/blecvbsbs2202.htm [2]: http://www.f-in-box.com/dotnet/#feature_flv_playing
I believe that the real answer is that you can't. The file path won't be sent by the browser for security reasons. The file name will be sent, however I don't believe it gets sent without an actual upload. The closest you could come, afaik, would be to forcibly kill the connection just when the upload starts. That would net you the filename with little actual transferred data, but it doesn't sound like it would be useful to you. Alternatively, a signed Java applet might get you closer to a solution that you'd want.
I would say that it depends on what you want the "DB layer" to do... If you have general routines for executing a stored procedure, or sql statement, that return a dataset, then using static methods would make more sense to me, since you don't need a permanent reference to an object that created the dataset for you. I'd use a static method as well if I created a DB Layer that returned a strongly-typed class or collection as its result. If on the other hand you want to create an instance of a class, using a given parameter like an ID (see @barret-conrad's answer), to connect to the DB and get the necessary record, then you'd probably not want to use a static method on the class. But even then I'd say you'd probably have some sort of DB Helper class that DID have static methods that your other class was relying on.
Maybe a CLR stored procedure is what you are looking for. These are generally used when you need to interact with the system in some way.
Something like this might do the trick: /Seat (\d+): ([^\(]+) \((\d+)in chips\)/ And some basic explanation on how Regex works: + \d = digit. + \&lt;character> = escapes character, if not part of any character class or subexpression. for example: `\t` would render a tab, while `\\t` would render "\t" (since the backslash is escaped). + \+ = one or more of the preceding element. + \* = zero or more of the preceding element. + [ ] = bracket expression. Matches any of the characters within the bracket. Also works with ranges (ex. A-Z). + [^ ] = Matches any character that is NOT within the bracket. + ( ) = Marked subexpression. The data matched within this can be recalled later. Anyway, I chose to use ([^\(]+) since the example provides a name containing spaces (Seat 3 in the example). what this does is that it matches any character up to the point that it encounters an opening paranthesis. This will leave you with a blank space at the end of the subexpression (using the data provided in the example). However, his can easily be stripped away using the trim() command in PHP. If you do not want to match spaces, you could so something like this: ([A-Za-z0-9-_]+) Which would match any alphanumerical character (within A-Z, upper- & lowercase) as well as hyphens and underscores. Hope this helps :)
Something like this might do the trick: /Seat (\d+): ([^\(]+) \((\d+)in chips\)/ And some basic explanation on how Regex works: + \d = digit. + \&lt;character> = escapes character, if not part of any character class or subexpression. for example: `\t` would render a tab, while `\\t` would render "\t" (since the backslash is escaped). + \+ = one or more of the preceding element. + \* = zero or more of the preceding element. + [ ] = bracket expression. Matches any of the characters within the bracket. Also works with ranges (ex. A-Z). + [^ ] = Matches any character that is NOT within the bracket. + ( ) = Marked subexpression. The data matched within this can be recalled later. Anyway, I chose to use ([^\(]+) since the example provides a name containing spaces (Seat 3 in the example). what this does is that it matches any character up to the point that it encounters an opening paranthesis. This will leave you with a blank space at the end of the subexpression (using the data provided in the example). However, his can easily be stripped away using the trim() command in PHP. If you do not want to match spaces, only alphanumerical characters, you could so something like this: ([A-Za-z0-9-_]+) Which would match any letter (within A-Z, both upper- & lower-case), number as well as hyphens and underscores. Or the same variant, with spaces: ([A-Za-z0-9-_\s]+) Where "\s" is evaluated into a space. Hope this helps :)
|.net|animation|
What is a good way to perform animation using .Net. I would prefer not to use Flash if possible, so am looking for suggestions of ways which will work to implement different types of animation on a new site I am producing. The new site is for a magician, so I want to provide animated buttons (Cards turning over etc) and also embed video. Is it possible to do this without using Flash or is this the only real solution. I would like to keep it as cross platform and standard as possible. Cheers
Do be aware that certain parts of ffmpeg are under GPL. I believe the libpostproc module is and if I recall correctly this is used in transcoding. Make sure this license is compatible with what you're doing.
When you want to transcode to Flv (which is probably the best for the web) then I use this line: ffmpeg -hq -y -i $directory/$file -r 20 -s 300x200 -deinterlace -ar 22050 $directory/$file.flv 1>/dev/null 2>/dev/null It works very well, under linux of course :-).
[Silverlight][1] springs to mind as an obvious choice if you want to do animation using .NET on the web. It may not cover all platforms but will work in IE and FireFox and on the Mac. [1]: http://silverlight.net/Default.aspx
Trolltech's (or should I say Nokia?) Qt has also a nice Regular Expression implementation [QRegExp][1]. It is also paltformindependend. [1]: http://doc.trolltech.com/4.4/qregexp.html
Setting up Continuous Integration with SVN
|continuous-integration|
What tools would you recommend for setting up CI for build and deployment of multiple websites built on DotNetNuke using SVN for source control? We are currently looking at configuring Cruise Control to work with NAnt, NUnit, NCover and Trac as a test case. What other combinations would worth investigating? We have full control of our development environment so using some form of CI is certain here but I would also like to convince our production services team that they can reliably deploy to the system test, uat and even production environments using these tools.
Note that Matt's code above will result in an extra comma at the end of the string; using COALESCE (or ISNULL for that matter) as shown in the link in Lance's post uses a similar method but doesn't leave you with an extra comma to remove. For the sake of completeness, here's the relevant code from Lance's link on sqlteam.com: DECLARE @EmployeeList varchar(100) SELECT @EmployeeList = COALESCE(@EmployeeList + ', ', '') + CAST(EmpUniqueID AS varchar(5)) FROM SalesCallsEmployees WHERE SalCal_UniqueID = 1
Javascript is probably the way to go, if you want to avoid flash. Check this: [http://www.webreference.com/programming/javascript/java_anim/][1] It won't work for embedded video, though, so you're stuck with Flash for that (or silverlight, or quicktine). HTH [1]: http://www.webreference.com/programming/javascript/java_anim/
Javascript is probably the way to go, if you want to avoid flash. Check this: [http://www.webreference.com/programming/javascript/java_anim/][1] It won't work for embedded video, though, so you're stuck with Flash for that (or silverlight, or quicktime). HTH [1]: http://www.webreference.com/programming/javascript/java_anim/
Don't wait. Pick one, and go with it. All systems will have their pluses and minuses. Your power could go out, you computer gets stolen, or you forget to undo a major change and all your code gets fried while you're waiting to see who emerges victorious.
When I decided I must use a code versioning system, I looked around for any good tutorials on how to get started but didn't find any that could help me. So I simplely installed the SVN Server and Tortoise SVN for the client and dived into the deepend and i learn't how to use it along the way.
Well, mine isn't all that simpler, but here is the code I use to split a comma-delimited input variable into individual values and put it into a Table Variable. I'm sure you could modify this slightly to split based on a space and then to a basic SELECT query against that table variable to get your results. -- Create temporary table to parse the list of accounting cycles. DECLARE @tblAccountingCycles table ( AccountingCycle varchar(10) ) DECLARE @vchAccountingCycle varchar(10) DECLARE @intPosition int SET @vchAccountingCycleIDs = LTRIM(RTRIM(@vchAccountingCycleIDs)) + ',' SET @intPosition = CHARINDEX(',', @vchAccountingCycleIDs, 1) IF REPLACE(@vchAccountingCycleIDs, ',', '') <> '' BEGIN WHILE @intPosition > 0 BEGIN SET @vchAccountingCycle = LTRIM(RTRIM(LEFT(@vchAccountingCycleIDs, @intPosition - 1))) IF @vchAccountingCycle <> '' BEGIN INSERT INTO @tblAccountingCycles (AccountingCycle) VALUES (@vchAccountingCycle) END SET @vchAccountingCycleIDs = RIGHT(@vchAccountingCycleIDs, LEN(@vchAccountingCycleIDs) - @intPosition) SET @intPosition = CHARINDEX(',', @vchAccountingCycleIDs, 1) END END The concept is pretty much the same. One other alternative is to leverage the .NET compatability within SQL Server 2005 itself. You can essentially wight yourself a simple method in .NET that would split the string and then expose that as a stored procedure/function.
The [Subversion Book][1] is your best bet for learning the tool. There may be other quick-start tutorials out there, but the Book is the best single reference you'll find. Git has some nice features, but you won't be able to appreciate them unless you've already used something more standard like CVS or Subversion. I'd definitely agree with the previous posters and start with Subversion. [1]: http://svnbook.red-bean.com/
Start using SVN for your actual work, but try to make time for fiddling around with Git and/or Mercurial. SVN is reasonably stable for production, but eventually you'll face a scenario where you'll *need* a distributed SCM, by which time you'll be properly armed and the new systems will be mature enough.
My vote goes to Subversion. It's very powerful, yet easy to use, and has some great tools like [TortoiseSVN][1]. But as others have said before me, JUST START USING IT. Source control is such an important part of the software development process. No "serious" software project should be without it. [1]: http://tortoisesvn.tigris.org/
For a friendly explanation of most of the basic concepts, see [A Visual Guide to Version Control][1]. The article is very SVN-friendly. [1]: http://betterexplained.com/articles/a-visual-guide-to-version-control/ "Better Explained: A Visual Guide to Version Control"
While I haven't used a flash object inside a windows form application myself, I do know that it's possible. In Visual studio on your toolbox, choose to add a new component. Then in the new window that appears choose the **"COM Components"** tab to get a list in which you can find the **"Shockwave Flash Object"** Once added to the toolbox, simply use the control as you would use any other "standard" control from visual studio. three simple commands are available to interact with the control: - AxShockwaveFlash1.Stop() - AxShockwaveFlash1.Movie = FilePath & "\FileName.swf" - AxShockwaveFlash1.Play() which, I think, are all self explanatory. > It would be great to be able to load > the flash content from a stream of > sorts rather than a file on disk. I just saw you are also looking for a means to load the content from a stream, and because I'm not really sure that is possible with the shockwave flash object I will give you another option (two actually). the first is the one I would advise you to use only when necessary, as it uses the full blown **"webbrowser component"** (also available as an extra toolbox item), which is like trying to shoot a fly with a bazooka. of course it will work, as the control will act as [a real browser window][1] (actually the internet explorer browser), but its not really meant to be used in the way you need it. the second option is to use something I just discovered while looking for more information about playing flash content inside a windows form. [F-IN-BOX][2] is a commercial solution that will also play content from a given website URL. (The link provided will direct you to the .NET code you have to use). [1]: http://visualbasic.about.com/library/courses/blecvbsbs2202.htm [2]: http://www.f-in-box.com/dotnet/#feature_flv_playing
The # char is indexed as punctuation and therefore ignored, so it looks like we'll remove the letter C from our word indexing ignore lists. Tested it locally after doing that and rebuilding the indexes and I get results!
The # char is indexed as punctuation and therefore ignored, so it looks like we'll remove the letter C from our word indexing ignore lists. Tested it locally after doing that and rebuilding the indexes and I get results! Looking at using a different word breaker language on the indexed column, so that those special characters aren't ignored.
The # char is indexed as punctuation and therefore ignored, so it looks like we'll remove the letter C from our word indexing ignore lists. Tested it locally after doing that and rebuilding the indexes and I get results! Looking at using a different word breaker language on the indexed column, so that those special characters aren't ignored. EDIT: I also found [this information](http://www.simple-talk.com/sql/learn-sql-server/sql-server-full-text-search-language-features/): >c# is indexed as c (if c is not in your noise word list, see more on noise word lists later), but C# is indexed as C# (in SQL 2005 and SQL 2000 running on Win2003 regardless if C or c is in your noise word list). It is not only C# that is stored as C#, but any capital letter followed by #. Conversely, c++ ( and any other lower-cased letter followed by a ++) is indexed as c (regardless of whether c is in your noise word list).
[Sven][1], you reached the same conclusion as I did: I found the Shockwave Flash Object, all be it from a slightly different route, but was stumped on how to load the files from somewhere other than file on disk/URL. The F-IN-BOX, although just a wrapper of the Shockwave Flash Object seems to provide much more functionality, which may just help me! Shooting flys with bazookas may be fun, but an embeded web brower is not the path that I am looking for. :) [1]: http://stackoverflow.com/users/46/sven
Creating tempory folders
|.net|io|
I am working on a program that needs to create a multiple temporary folders for the application. These will not be seen by the user. The app is written in VB.net. I can think of a few ways to do it such as incremental folder name or random numbered folder names, but I was wondering, how other people solve this problem?
For a platform like the PSP, I'd worry slightly about the performance of an IM GUI solution. With a traditional retained mode type of solution, when you create a control, you can also create the vertex buffer/display list or what-have-you required to render it. With an immediate mode solution, it seems to me that you'd need to recreate this dynamically each frame. You might not care about this, if you're only doing a few buttons, or it's not going to be used in-game (assuming you're making a game) but, especially if you have a fair bit of text, the cost of rendering might start to hurt if you can't find a way to cache the display lists somehow.
I'm assuming with id:* you're just trying to match all documents, right? I've never used solr before, but in my Lucene experience, when ingesting data, we've added a hidden field to every document, then when we need to return every record we do a search for the string constant in that field that's the same for every record. If you can't add a field like that in your situation, you could use a RegexQuery with a regex that would match anything that could be found in the id field. Edit: actually answering the question. I've never heard of a patch to get that to work, but I would be surprised if it could even be made to work reasonably well. See [this question](http://stackoverflow.com/questions/8532/with-lucene-why-do-i-get-a-too-many-clauses-error-if-i-do-a-prefix-search) for a reason why unconstrained PrefixQuery's can cause a problem.
There are multiple issues here as ikvm is currently being transitioned away from the GNU classpath system to Sun's OpenJDK. Both are licensed as GPL+Exceptions to state explicitly that applications which merely use the OpenJDK libraries will not be considered derived works. Generally speaking, applications which rely upon components with defined specs such as this do not fall under the GPL anyway. For example, linking against public POSIX APIs does not trigger GPL reliance in a Linux application, despite the kernel being GPL. A similar principal will usually (the details can be tricky) apply to replacing Sun's Java with a FOSS/GPL implementation.
I was going to say that, I didn't think that Silverlight 2's HttpWebRequest supported streaming, because the request data gets buffered into memory entirely. It had been a while since the last time I looked at it though, therefore I went back to see if Beta 2 supported it. Well turns out it does. I am glad I went back and read before stating that. You can enable it by setting AllowReadStreamBuffering to false. Did you set this property on your HttpWebRequest? That could be causing your block. - [MSDN Reference][1] [1]: http://shrinkster.com/11cn
I was going to say that, I didn't think that Silverlight 2's HttpWebRequest supported streaming, because the request data gets buffered into memory entirely. It had been a while since the last time I looked at it though, therefore I went back to see if Beta 2 supported it. Well turns out it does. I am glad I went back and read before stating that. You can enable it by setting AllowReadStreamBuffering to false. Did you set this property on your HttpWebRequest? That could be causing your block. - [MSDN Reference][1] - [File upload component for Silverlight and ASP.NET][2] Edit, found another reference for you. You may want to follow this approach by breaking the file into chunks. This was written last March, therefore I am not sure if it will work in Beta 2 or not. [1]: http://shrinkster.com/11cn [2]: http://www.wilcob.com/Wilco/View.aspx?NewsID=212
A .NET event isn't actually an object, it's an endpoint represented by two functions -- one for adding and one for removing a handler. That's why the compiler won't let you do anything other than += (which represents the add) or -= (which represents the remove). The only way to refer to an event for metaprogramming purposes is as a System.Reflection.EventInfo, and reflection is probably the best way (if not the only way) to get ahold of one. EDIT: Emperor XLII has written some beautiful code which should work for your own events, provided you've declared them from C# simply as public event DelegateType EventName; That's because C# creates two things for you from that declaration: 1. A private delegate field to serve as the backing storage for the event 2. The actual event along with implementation code that makes use of the delegate. Conveniently, both of these have the same name. That's why the sample code will work for your own events. However, you can't rely on this to be the case when using events implemented by other libraries. In particular, the events in Windows Forms and in WPF don't have their own backing storage, so the sample code will not work for them.
Wordpress MediaWiki Cookie Integration
|php|wordpress|lamp|mediawiki|
I have my Wordpress install and MediaWiki [sharing the same login information][1]. Unfortunately users need to log into both separately, but at least they use the same credentials. What I would like to do is cause a successful log in on the Wordpress blog to also cause a log in for MediaWiki (ideally both directions). There are two ways this could happen: 1. Logging in causes a log in on the other application (writes the cookie and creates the session in the DB) 2. Accessing an application checks for the cookie of the other and then automatically logs in. Since the user names are shared it seems like the latter should be pretty easy to do. Any tips would be great. [1]: http://stackoverflow.com/questions/33745 "Thanks ceejayoz"
It goes something like: from t1 in db.Table1 join t2 in db.Table2 on t1.field equals t2.field select new { t1.field2, t2.field3} It would be nice to have sensible names and fields for your tables for a better example. :)
It goes something like: from t1 in db.Table1 join t2 in db.Table2 on t1.field equals t2.field select new { t1.field2, t2.field3} It would be nice to have sensible names and fields for your tables for a better example. :) **Update** I think for your query this might be more appropriate: var dealercontacts = from contact in DealerContact join dealer in Dealer on contact.DealerId equals dealer.ID select contact; Since you are looking for the contacts, not the dealers.
To instantiate A::v, the compiler needs to know the concrete type of B. If you're trying to minimize the amount of #included baggage to improve compile times, there are two things you can do, which are really variations of each other: 1. Use a pointer to B 2. Use a lightweight [proxy][1] to B [1]: http://en.wikipedia.org/wiki/Proxy_pattern
[Sven][1], you reached the same conclusion as I did: I found the Shockwave Flash Object, all be it from a slightly different route, but was stumped on how to load the files from somewhere other than file on disk/URL. The F-IN-BOX, although just a wrapper of the Shockwave Flash Object seems to provide much more functionality, which may just help me! Shooting flys with bazookas may be fun, but an embeded web brower is not the path that I am looking for. :) For those that are interested here is a link (that I have just found) on embeding flash in C# Winforms applicaitons: [Embedding and Communicating with the Macromedia Flash Player in C# Windows Applications][2] [1]: http://stackoverflow.com/users/46/sven [2]: http://www.adobe.com/devnet/flash/articles/stock_history03.html
Displaying Flash content in a C# WinForms application
|c#|flash|winforms|
What is the best way to display Flash content in a C# WinForms application? I would like to create a user control (similar to the current PictureBox) that will be able to display images and flash content. It would be great to be able to load the flash content from a stream of sorts rather than a file on disk.
|c#|winforms|flash|adobe|macromedia|
Process size on UNIX
|unix|size|
What is the correct way to get the process size on Solaris, HP-UX and AIX? Should we use top or ps -o vsz or something else?
You tried old builds, but is there a reason you can't keep going further back in the repository history and seeing exactly when the bug was introduced? Otherwise, I would suggest adding simple logging of some kind to help track down the problem, though I am at a loss of what specifically you might want to log. If you can find out what exactly CAN cause this problem, via google and documentation of the exceptions you are getting, maybe that will give further insight on what to look for in the code.
My first choice would be a dedicated heap tool such as [pageheap.exe](http://support.microsoft.com/default.aspx?scid=kb;en-us;286470). Rewriting new and delete might be useful, but that doesn't catch the allocs committed by lower-level code. If this is what you want, better to Detour the low-level alloc APIs using Microsoft Detours. Also sanity checks such as: verify your run-time libraries match (release vs. debug, multi-threaded vs. single-threaded, dll vs. static lib), look for bad deletes (eg, delete where delete [] should have been used), make sure you're not mixing and matching your allocs. Also try selectively turning off threads and see when/if the problem goes away. What does the call stack etc look like at the time of the first exception?
Rex, I suspect a good place to start looking is solutions that **compress the ViewState** -- they're grabbing ViewState on the server before it's sent down to the client and gzipping it. That's exactly where you want to be. - [Scott Hanselman on ViewState Compression](http://www.hanselman.com/blog/CommentView,guid,febce059-7e7c-439e-af3d-c53d250b3e9c.aspx) (2005) - [ViewState Compression with System.IO.Compression](http://www.bloggingdeveloper.com/post/How-To-Compress-ViewState-in-ASPNET-20-ViewState-Compression-with-SystemIOCompression.aspx) (2007)
|c#|performance|loops|
I have been told that there is a performance difference between the following code blocks. foreach (Entity e in entityList) { .... } and for (int i=0; i<entityList.Count; i++) { Entity e = (Entity)entityList[i]; ... } where List<Entity> entityList; I am no CLR expect but from what I can tell they should boil down to basically the same code. Does anybody have concrete (heck, I'd take packed dirt) evidence one way or the other?
I was going to post an answer similar to Ugh. I would suggest putting a small TXT file describing the image source (and perhaps a small copyright statement, if one applies) into the image in a manner that is difficult to detect and break.
I'm aware of [ffmpeg][1], but it is native C code only. If you're ok with interoperability this may be your ticket. Edit: It turns out someone already wrapped this in a .NET assembly. It's called [FFlib.NET][2]. [1]: http://ffmpeg.mplayerhq.hu/ [2]: http://www.intuitive.sk/fflib/
How to start learning JAVA for use with Oracle RDBMS?
|java|oracle-database|
I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDeveloper a good IDE for a beginner?
foreach creates an instance of an enumerator (returned from GetEnumerator) and that enumerator also keeps state throughout the course of the foreach loop. It then repeatedly calls for the Next() object on the enumerator and runs your code for each object it returns. They don't boil down to the same code in any way, really, which you'd see if you wrote your own enumerator.
[Here][1] is a good article that shows the IL differences between the two loops. Foreach is technically slower however much easier to use and easier to read. Unless performance is critical I prefer the foreach loop over the for loop. [1]: http://www.codeproject.com/KB/cs/foreach.aspx
You should be able to do everything related to Oracle using [JDBC][1], so make sure you bone up on that API. Other than that, it depends on the type of application. Standalone apps may use Swing (the Java UI toolkit) or in the future JavaFX, which is supposed to make Swing obsolete and may do so in a few years. Web/enterprisey apps will make use of Java Enterprise Edition, so take a look at the servlet API, and if the app uses Enterprise JavaBeans, look at the [Java Persistence API][2], which you would probably be using instead of JDBC. I haven't used JDeveloper, but I haven't found anything wrong with the free IDEs like [Eclipse][3] or [Netbeans][4], and my personal favorite is JetBrains's [IntelliJ IDEA][5]. [1]: http://java.sun.com/javase/6/docs/technotes/guides/jdbc/ [2]: http://java.sun.com/developer/technicalArticles/J2EE/jpa/ [3]: http://eclipse.org [4]: http://netbeans.org [5]: http://www.jetbrains.com/idea/
The compiler needs to know how big "B" is before it can generate the appropriate layout information. If instead, you said `std::vector<B*>`, then the compiler wouldn't need to know how big B is because it knows how big a pointer is.
Ultimately you always have a finite max of heap to use no matter what platform you are running on. In Windows 32 bit this is around 2gb (not specifically heap but total amount of memory per process). It just happens that Java happens to make the default smaller (presumably so that the programmer can't create programs that have runaway memory allocation without running into this problem and having to examine exactly what they are doing). So this given there are several approaches you could take to either determine what amount of memory you need or to reduce the amount of memory you are using. One common mistake with garbage collected languages such as Java or C# is to keep around references to objects that you no longer are using, or allocating many objects when you could reuse them instead. As long as objects have a reference to them they will continue to use heap space as the garbage collector will not delete them. In this case you can use a Java memory profiler to determine what methods in your program are allocating large number of objects and then determine if there is a way to make sure they are no longer referenced, or to not allocate them in the first place. One option which I have used in the past is "JMP" <http://www.khelekore.org/jmp/>. If you determine that you are allocating these objects for a reason and you need to keep around references (depending on what you are doing this might be the case), you will just need to increase the max heap size when you start the program. However, once you do the memory profiling and understand how your objects are getting allocated you should have a better idea about how much memory you need. In general if you can't guarantee that your program will run in some finite amount of memory (perhaps depending on input size) you will always run into this problem. Only after exhausting all of this will you need to look into caching objects out to disk etc. At this point you should have a very good reason to say "I need Xgb of memory" for something and you can't work around it by improving your algorithms or memory allocation patterns. Generally this will only usually be the case for algorithms operating on large datasets (like a database or some scientific analysis program) and then techniques like caching and memory mapped IO become useful.
The reason you can't use a forward declaration is because the size of B is unknown. There's no reason in your example that you can't include B.h inside of A.h, so what problem are you really trying to solve? **Edit:** There's another way to solve this problem, too: stop using C/C++! It's so 1970s... ;)
Since I don't know how your factory method looks like, all I can advise right now is to 1. Check to see the object is the correct concrete implementation you were looking for: IMyInterface fromFactory = factory.create(...); Assert.assertTrue(fromFactory instanceof MyInterfaceImpl1); 2. You can check if the factory setup the concrete instances with valid instance variables.
Since I don't know how your factory method looks like, all I can advise right now is to 1. Check to see the object is the correct concrete implementation you were looking for: IMyInterface fromFactory = factory.create(...); Assert.assertTrue(fromFactory instanceof MyInterfaceImpl1); 2. You can check if the factory setup the concrete instances with valid instance variables.
|deployment|
So, in your experience, whats the best way? Is there a secure way that's also scriptable/triggerable in a build automation tool?