instruction
stringlengths
0
30k
I'm fairly certain you are getting accurate values. It might help if you thing of an MPEG stream as, well, a stream. In that case, prior to the IBBPBB that you see there would normally be another GOP. Maybe something like this (using same notation as original question): P(-3,-2) B(-2,-1) B(-1,0) Basicall...
##It depends... It depends on how much encapsulated you want your class to be, and what you want to hide, or show. The code I see seems ok for me. You're right about the fact the std::list's data and iterators won't be invalidated in case of another data/iterator's modification/deletion. Now, returning the poi...
Have you considered using an ORM? [SQLAlchemy][1] is pretty good, and [Elixir][2] makes it beautiful. It can really reduce the ammount of boilerplate code needed to deal with databases. Also, a lot of the *gotchas* mentioned have already shown up and the SQLAlchemy developers dealt with them. [1]: http://www....
Check [this out][1] on msdn, it explains how to set this up. Essentially, here are the steps (during debugging): 1. On the Debug menu, click Exceptions. 2. In the Exceptions dialog box, select Thrown for an entire category of exceptions, for example, Common Language Runtime Exceptions. -or- Expand ...
Do do what Bill was talking about with the list you just need to create a List<int> property on your user control. Then you can implement it as Bill described.
Can anyone recommend a simple Java web-app framework?
|java|java-web-framework|
I'm trying to get started on what I'm hoping will be a relatively quick web application in Java, yet most of the frameworks I've tried (Apache Wicket, Liftweb) require so much set-up, configuration, and trying to wrap my head around Maven while getting the whole thing to play nice with Eclipse, that I spent the whole w...
No. The Img's SRC attribute is not an event, therefore the inline JS will never fire.
You were told correctly. mysql can do this count for you which is much more efficient. $result = mysql_query( "select count(id) from table as num_rows" ); $row = mysql_fetch_object( $result ); $total = $row->num_rows;
You were told correctly. mysql can do this count for you which is much more efficient. $result = mysql_query( "select count(id) as num_rows from table" ); $row = mysql_fetch_object( $result ); $total = $row->num_rows;
The following c++ code will read an entire file... <pre> <code> #include &lt;iostream&gt; #include &lt;fstream&gt; #include &lt;string&gt; using namespace std; int main () { string line; ifstream myfile ("foo.txt"); if (myfile.is_open()){ while (!myfile.eof()){ getline (myfile,line);...
You cannot do it inline the image @src, but you should be able to call it from an inline script block immediately following your image: <img src="" id="myImage"/> <script type="text/javascript"> document.getElementById("myImage").src = GetImage(); </script>
You probably need to install GNU binutils first. It contains the assembler.
Why you can't use capistrano anymore? Why you dislike svn-update? What things in your app requires an special deployment ?
I think the reason everyone has so many different answers is that you haven't quite got your problem specified well enough to be answered. First off, it depends what kind of differences you want to track. Are you wanting the differences to be output like in a WinDiff where the first file is the "original" and second ...
The stack solution sounds interesting, but it will probably break if the user chooses to navigate "in parallel" on different tabs or using bookmarks. I'm afraid I don't really understand why you have to keep all this state for each user: ideally the web should follow the [REST principle][1] and be completely statele...
You can try using Is.Matching() and providing a predicate constraint (moved out-of line for clarity): Predicate nestedBValIsTrue = delegate(ObjA a)({ return a.B.Val == true;}); Expect.Call( delegate {mockobj.DoSomething(null);}) .Constraints( Is.Matching(nestedBValIsTrue));
You can try using Is.Matching() and providing a predicate constraint (moved out-of line for clarity): Predicate nestedBValIsTrue = delegate(ObjA a) { return a.B.Val == true;}; Expect.Call( delegate {mockobj.DoSomething(null);}) .Constraints( Is.Matching(nestedBValIsTrue));
so what you're looking for is a paradigm shift in web technology. it's always tough to imagine how that will look - maybe new tech will become a more immersive experience, incorporating more senses then just sight and sound (touch is a good candidate), as well as something that allows for full-range-motion interaction ...
$string =~ s/(\w+)/\u$1/g; should work just fine
If every class has its own dynamic library, just check if the library exists.
Getting The XML Data Inside Custom XPath function
Directory layout for pure Ruby project
|ruby|layout|sourcecode|
I'm starting to learn ruby. I'm also a day-to-day C++ dev. For C++ projects I usually go with following dir structure / -/bin <- built binaries -/build <- build time temporary object (eg. .obj, cmake intermediates) -/doc <- manuals and/or Doxygen docs -/src --/module-1 --/mod...
|ruby|source-code|layout|
I need a helper method to compare a char Enum and a char boxed to an object
|c#|enums|casting|
I have an enum that looks as follows: public enum TransactionStatus { Open = 'O', Closed = 'C'}; and I'm pulling data from the database with a single character indicating - you guessed it - whether 'O' the transaction is open or 'C' the transaction is closed. now because the data comes out of the database ...
Terracotta is closer to a "tiered" model - all client applications talk to a Terracotta Server Array (and more importantly, for scale, not to one another). The Terracotta Server Array is capable of being clustered for both scale and availability (mirrored, for availability, and striped, for scale). In any case as y...
Terracotta is closer to a "tiered" model - all client applications talk to a Terracotta Server Array (and more importantly for scale they don't talk to one another). The Terracotta Server Array is capable of being clustered for both scale and availability (mirrored, for availability, and striped, for scale). In any...
Guys, don't forget about transactions. begin tran if exists (select * from table with (updlock,serializable) where key = @key) begin update table set ... where key = @key end else begin insert table (key, ...) values (@key, ...) end commit tran
Guys, don't forget about transactions. When multiple threads will try to perform Insert-or-update you can easily get primary key violation. Solutions provided by @Beau Crawford & @Esteban show general idea but error-prone. To avoid deadlocks and PK violations you can use something like this: begin tran ...
Guys, don't forget about transactions. Performance is good, but simple (IF EXISTS..) approach is very dangerous. When multiple threads will try to perform Insert-or-update you can easily get primary key violation. Solutions provided by @Beau Crawford & @Esteban show general idea but error-prone. To avoid dea...
Scott Meyers in his book [Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library][1] says it's just not worth trying to encapsulate your containers since none of them are completely replaceable for another. [1]: http://www.amazon.com/Effective-STL-Addison-Wesley-Professional-Computi...
Multi-Format File Viewer for .Net Development
|.net|
Is anyone aware of a multi-format file viewer, capable of displaying common image formats, as well as MS Office document formats (at least Word and Excel), and PDFs? I've seen several image viewers available, but none besides Outside In from Oracle. I'm looking for viewer technology that can be imbedded in a .net a...
|.net|components|
It can help with performance. moving certain tables/elemnts to distinct file areas/portions of the disk. this can reduce to a certain extent the amount of external fragmentation impacting the daabase. I would also look at other factors such as tracesql to determine why queries etc are slowing down - there can be oth...
I would suggest [JSON][1]. - Just as readable/editable as YAML - If you happen to use for Web then can be eval()'ed into JavaScript objects - Probably as cross language as YAML [1]: http://www.json.org/
What is the most convincing command in Vim.
|vim|editor|
.. That tells me I should start using it.
|vim|editor|
What is the most convincing command in Vim?
I'm interested in the power of Vim. Tell me some commands that show me why I should start using it.
What is the most convincing command in Vim.
.. That tells me I should start using it. Ok, I'm a emacs guy at the moment. And I feel safe, since I know I always will have all the features of the future. (I don't have to wait for some hacker with time, to create the feature I need. I can do it my self. That is a nice feeling) But. All the big guys out there ...
.. That tells me I should start using it. Ok, I'm a emacs guy at the moment. And I feel safe, since I know I always will have all the features of the future. (I don't have to wait for some hacker, to create the feature I need. I can do it my self. That is a nice feeling) But. All the big guys out there are using ...
I'm a emacs guy at the moment. And I feel safe, since I know I always will have all the features of the future. (I don't have to wait for some hacker, to create the feature I need. I can do it my self. That is a nice feeling) But. All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul grah...
I'm a emacs guy at the moment. And I feel safe, since I know I always will have all the features of the future. (I don't have to wait for some hacker, to create the feature I need. I can do it my self. That is a nice feeling) But. All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul grah...
I want to ditch my current editor. I feel I need some thing else. That do not expose my hands to the risk of RSI. I need to se why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old. All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul Gr...
You should be able to set an expression on the subreport's visibility so that it does not show if there isn't a logo. Here is the XML from an RDL I had handy: <Subreport Name="SubReport"> <ReportName>SubReport</ReportName> <Visibility> <Hidden>=Not Parameters!ShowLogo.Value</Hidden> ...
How to use Decision Tables to help your application
null
I learned some time ago about Decision Trees and Decision tables. I feel that Decision Tables can help with conditional If-Then-Else statements. In particular, I feel that Decision Tables have no side-effects, for example, if you didn't notice that you need one more "else if" statement. But I am not sure how I can i...
|table-driven|
Flow charts tend to confuse some non-technical people (ie clients), as well as data flow diagrams. Use Cases are good and understandable, as well as Business Requirement and Technical Requirement documentation, possible some sort of rough wireframe sketches.
[Spring layout](http://java.sun.com/docs/books/tutorial/uiswing/layout/spring.html) which was developed for the mantissa gui builder which is part of netbeans.
You aren't specifying what you are selecting and checking the CASE against... SELECT ***HERE*** = *** CASE WHEN fldField like 'YYY' THEN 'OTH' ELSE 'XXX' END AS newField FROM tmpTable
You aren't specifying what you are selecting and checking the CASE against... SELECT CASE fldField WHEN 'YYY' THEN 'OTH' ELSE 'XXX' END AS newField FROM tmpTable
Pulling in a dynamic image in a control based on a url using C# and ASP.net
|dynamic|image|asp.net|commerce|server|
I know this is a dumb question. For some reason my mind is blank on this. Any ideas?
|dynamic|image|asp.net|
|asp.net|image|dynamic|
I know this is a dumb question. For some reason my mind is blank on this. Any ideas? Sorry should have been more clear. Using a HtmlGenericControl to pull in link description as well as image. <code> private void InternalCreateChildControls() { if (this.DataItem != null && this.Relati...
|saxon|xpath|java|
Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an `XPathContext` but is this enough?
|java|xpath|saxon|
Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an `XPathContext` but is this enough? **Example:** Our XML: <foo> <bar>smang</bar> <fizz>buzz</fizz> </foo> Our XSL: <xsl:template match="/"> <x...
Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an `XPathContext` but is this enough? **Example:** Our XML: <foo> <bar>smang</bar> <fizz>buzz</fizz> </foo> Our XSL: <xsl:template match="/"> <x...
Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an `XPathContext` but is this enough? **Example:** Our XML: <foo> <bar>smang</bar> <fizz>buzz</fizz> </foo> Our XSL: <xsl:template match="/"> <x...
Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an `XPathContext` but is this enough? **Example:** Our XML: <foo> <bar>smang</bar> <fizz>buzz</fizz> </foo> Our XSL: <xsl:template match="/"> <x...
How to make any arbitrary SECTION of ANY aspx webpage available as an Ajax popup
|asp.net|asp.net-ajax|
I'm not sure about number of lines, but if you can use the length of the string, here's something that would work using XPath. static void Main(string[] args) { string[] myFiles = { @"C:\temp\XMLFile1.xml", @"C:\temp\XMLFile2.xml", @"C:\...
I just found an approach in the .Net MVC system that you could replicate for PHP using Apache Rewrites, .htaccess files or if you are using IIS, a web.config file. As the MVC pattern doens't need the user to directly access aspx files these are not served and a 404 is sent instead. If you have a naming convention fo...
Eric Meyer's [Pure CSS Popups 2][1] demo sounds similar enough to what you want. [1]: http://meyerweb.com/eric/css/edge/popups/demo2.html
Can IIS7 be installed on XP?
|iis-7|windows-xp|
I'm pretty sure I know the answer to this, but short of a virtual Vista installation, is there a way to install II7 on XP?
|windows-xp|iis-7|
I'm pretty sure I know the answer to this, but short of a virtual Vista installation, is there a way to install IIS 7 on XP?
Example to set in the "V" environment variable the most recent file FOR /F %I IN ('DIR *.* /O:D /B') DO SET V=%I in a batch file you have to use double prefix in the loop variable: FOR /F %%I IN ('DIR *.* /O:D /B') DO SET V=%%I
With [some help][1] from Dave Beazley (PLY's creator), my problem was solved. The idea is to use special sub-rules and do the actions in them. In my case, I split the `declaration` rule to: def p_decl_body(self, p): """ decl_body : declaration_specifiers init_declarator_list_opt """ ...
Including a WebService reference in a control
|c#|.net|javascript|web-services|ajax|
I've written a control in C# that overrides the built-in DropDownList control. For this I need a javascript resource included, which I'm including as an embedded resource then adding the `WebResource` attribute, which works fine. However, I also need to reference a webservice, which I would normally include in the...
<a href="http://www.jfree.org/jfreechart/">JFreeChart</a> is a option, or a software reporting software tool (can recommend <a href="http://www.inetsoftware.de">i-net Crystal-Clear</a>).
If you truly need to use dynamic controls, the following should work: * In OnInit, recreate the exact same control hierarchy that was on the page when the previous request was fulfilled. (If this isn't the initial request, of course) * After OnInit, the framework will load the viewstate from the previous request an...
If you truly need to use dynamic controls, the following should work: * In OnInit, recreate the exact same control hierarchy that was on the page when the previous request was fulfilled. (If this isn't the initial request, of course) * After OnInit, the framework will load the viewstate from the previous request an...
I am trying to create a service with C# that launches a process that can be displayed on the Windows XP Logon screen. I found some code that is doing this in C++. The C++ code is for a service that creates another process with STARTUPINFO.lpDesktop set to "WinSta0\\WinLogon". The created process is then displayed ...
Have you tried something like: //a[contains(@foo, "Foo")] I've never used the contains function before but suspect that it should work as advertised...
Have you tried something like: //a[contains(@prop, "Foo")] I've never used the contains function before but suspect that it should work as advertised...
The emulator is super slow on my Mobile Intel Pentium M 725, 1600 MHz. I'm assuming the emulator isn't representative of real world performance.
How to determine the Schemas inside an Oracle Data Pump Export file.
|oracle-database|import|