instruction stringlengths 0 30k ⌀ |
|---|
I'm trying to use cygwin as a build environment under Windows. I have some dependencies on 3rd party packages, for example, GTK+.
Normally when I build under Linux, in my Makefile I can add a call to pkg-config as an argument to gcc, so it comes out like so:
<pre>
gcc example.c `pkg-config --libs --cflags gtk+-2.... |
Don't forget either that unless you have lots of toolbar buttons or other such objects to fill, its possible to get by with very *few* icons beyond your own unique application icon and system icons. (Remember to call them from existing libraries on the user's machine, not repackage them, keep the lawyers happy.)
Hav... |
As long as it changes whenever the resource representation changes, how you produce it is completely up to you.
You should try to produce it in a way that additionally:
1. doesn't require you to re-compute it on each conditional GET, and
2. doesn't change if the resource content hasn't changed
Using hashes ... |
How to make a Flash movie with a transparent background |
|flash|firefox|safari| |
This page from Adobe says to add a "wmode" parameter and set its value to "transparent": [http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_1420][1]
This works flawlessly in IE. The background renders correctly in Firefox and Safari, however as soon as you use the browser's scroll bar then mouse over the... |
I don't know about Java and 2008... but you shouldn't have too much trouble with Java and SQL2000. As lubos suggested, you'd be doing yourself a favour to look at c# but if you're much more comfortable with Java then there shouldn't be any real limitations as the JDBC connector [is supported by Microsoft][1]
[1]: ht... |
Some places where OO isn't so good are where you're dealing with "Sets" of data like in SQL. OO tends to make set based operations more difficult because it isn't really designed to optimally take the intersection of two sets or the superset of two sets.
Also, there are times when a functional approach would make mo... |
By default the session expiry seems to be 20 minutes.
Update: I do not want the session to expire until the browser is closed. |
How do I explicitly set asp.net sessions to ONLY expire on closing the browser or explicit logou? |
By default the session expiry seems to be 20 minutes.
Update: I do not want the session to expire until the browser is closed.
Update2: This is my scenario. User logs into site. Plays around the site. Leaves computer to go for a shower (>20 mins ;)). Comes back to computer and *should* be able to play around. He... |
Instead of rolling your own boolean flag, why no just use the thread interrupts mechanism already in Java threads? Depending on how the internals were implements in the code you can't change, you may be able to abort part of it's execution too.
Outer Thread:
if(oldThread.isRunning())
{
oldThread... |
You could potentially use the GOF Decorator Pattern, and 'decorate' all classes that need tracing.
It's probably only really practical with an IOC container (but as pointer out earlier you may want to consider method interception if you're going to go down the IOC path). |
EasyMock or JMock are definitely the winners. I haven't used JMock, but I know with EasyMock you can setup the Mock object according to a testing script and it will return certain values in certain situations or points during your test. It's pretty easy to learn and get running, generally in less than an hour. |
If you are redirecting to another page, you are going to have to pass the currently opened section to it via a querystring and then when the new page sends you back, it'll send you back the same value so you know which one to open.
Another quick way would be to pop it into a session and then read from that session. ... |
Maybe you should try to force the width of the bbar:
main.getBottomToolbar().setWidth(500);
right after Panel creation?
But I think the problem is that bbar is rendered into inner div of the panel, so different browsers interpret outer padding differently.
Also you can try to set padding of the bbar to -1em... |
How to type faster |
Code coverage is great but only as long as the benefits that you get from it outweigh the cost/effort of achieving it.
We have been working to a standard of 80% for some time, however we have just made the decison to abandon this and instead be more focused on our testing. Concentrating on the complex business logic... |
As [the Oracle documentation says][1], the cost is the estimated cost relative to a particular execution plan. When you tweak the query, the particular execution plan that costs are calculated relative to can change. Sometimes dramatically.
The problem with v\_test's performance is that Oracle can think of no way ... |
Table and List view with single Model in Qt |
|qt|model|view| |
I have a 2D model where each row represents a frame in a video, and each column represents an object. The object can have different states on each frame, and this is stored in the model. Then I have a QTableView that shows this data. The model has header data, so each row has a header like "frame k" and each column has... |
You could have a colours.css file with just the colours/images for each tag in.
Then you can change the colours just by replacing the file, or having a dynamically generated CSS file, or having different CSS files available and selecting based upon website URL/subfolder/property/etc.
Or you can have colour tags as ... |
So you're saying you don't want to go back into your CSS to change color values if you find another color 'theme' that might work better?
Unfortunately, I don't see a way around this. CSS defines styles, and with color being one of them, the only way to change it is to go into the css and change it.
Of course, y... |
This probably centres on _how_ you truncated the file. _du_ and _df_ report different things as [this post on unix.com explains][1]. Just because space is not used does not necessarily mean that it's free...
[1]: http://www.unix.com/unix-dummies-questions-answers/29223-sco-unix-disk-space.html |
Using the [transferFrom][1] method should help with this, assuming you write to the channel incrementally and not all at once as previous answers also point out.
[1]: http://java.sun.com/j2se/1.5.0/docs/api/java/nio/channels/FileChannel.html#transferFrom(java.nio.channels.ReadableByteChannel,%20long,%20long)
|
<b />Reflection Emit and Expression trees come to mind...
<b />Don't miss Jeffrey Richter's CLR via C# and Jon Skeet's ![alt text][4]
See here for some resources:
<b />[http://www.codeproject.com/KB/trace/releasemodebreakpoint.aspx][1]
<b />[http://www.codeproject.com/KB/dotnet/Creating_Dynamic_Types.as... |
The [Expression site][1] is the first place to start. These are tools that bridge the developer/designer gap for building rich internet applications with Silverlight and WPF. They compete with Adobe Studio products.
Whilst Visual Studio is good for working with code, it has some weaknesses when it comes to dealing w... |
Expression Studio is targeted more at designers. It integrates with Visual Studio in that Expression Studio uses solution and project files, just like Visual Studio. Which makes collaborating with designer easier. The developer and the designer open up the same project. The developer sets up the initial page with a... |
Which Agile Software Development Method Have You Had The Most Success With? |
|agile|methods| |
There are numerous [Agile software development][1] methods. Which ones have you used in practice to deliver a successful project, and how did the method contribute to that success?
[1]: http://en.wikipedia.org/wiki/Agile_software_development |
Which Agile software development methods have you had the most success with? |
Please check for XAML .NET development, most of the tutorials makes use of many Expression tools. |
I've recently set up [ActiveRecord][1] from the Castle Project for an app. It was pretty easy to get going. After creating a new app with it, I even used MyGeneration to script out class files for a legacy app that ActiveRecord could use in a pretty short time. It uses NHibernate to interact with the database, but t... |
I find it helps to think of a given problem in terms of 'things'.
If the problem can be thought of as having one or more 'things', where each 'thing' has a number of attributes or pieces of information that refer to its state, and a number of operations that can be performed on it - then OOP is probably the way to g... |
Enabling windowless mode (wmode=) makes embedded flash act and render just like other elements. Without that, it's rendered in a seperate step and just overlaid on the browser's window.
Could the flash element be losing focus? Sounds like input focus is moved to the scollbar, then you have to move it back.
Also y... |
I would suggest not, since String.Format was not designed for concatenation, it was design for formatting the output of various inputs such as a date.
String s = String.Format("Today is {0:dd-MMM-yyyy}.", DateTime.Today); |
I use iCal in [Lightning][1] (Thunderbird) and [Rainlendar][2].
I have used Calendaring software for years (decades) and have never had a need for repeating events within the same day. It is simple to add additional daily repeating events in the same day if it is really needed.
[1]: http://www.mozilla.org/... |
It really depends. For small strings with few concatenations, it's actually faster just to append the strings.
String s = "String A" + "String B";
But for larger string (very very large strings), it's then more efficient to use StringBuilder. |
From the [MSDN documentation][1]:
> The performance of a concatenation operation for a String or StringBuilder object depends on how often a memory allocation occurs. A String concatenation operation always allocates memory, whereas a StringBuilder concatenation operation only allocates memory if the StringBuilder o... |
When you release a new version of your CSS or JS libraries, cause the following to occur:
1. modify the filename to include a unique version string
2. modify the HTML files which reference the library to point at the versioned file
(this is usually a pretty simple matter for a release script)
Now you can set ... |
I think in most cases like this clarity, and not efficiency, should be your biggest concern. Unless you're crushing together tons of strings, or building something for a lower powered mobile device, this probably won't make much of a dent in your run speed.
I've found that, in cases where I'm building strings in a ... |
Generally it's better to just find and replace the colours you are changing.
Anything more powerful than that will be more complex with few benefits. |
Data Visualization |
|charts|visualization| |
I need a framework for generating charts for data visualization. I picked up Processing www.processing.org/ but at the moment i can not run that in the "headless" mode from a web server. Is there any other candidate for this domain? What are the options if you need more chart type than what is supported by out-of-the-b... |
As in most languages underscore is just part of an identifier; no special meaning.
But are you sure it's Perl? There aren't any sigils on the variables. Can you post more context?
|
There is a rather good [talk on neural networks](http://video.google.com/videoplay?docid=228784531481853811&ei=c73TSP-XF6bU2gKO2aSAAQ&q=techtalks+neuralnetworks&vt=lf) on Google Techtalks that talks about using layered Boltzmann machines to generate feature vectors for documents that can then be used to measure documen... |
You could set up a view on that table that selects WHERE to_be_deleted != 1, and all of your normal selects are done on that view - that avoids having to put the WHERE on all of your queries. |
The pitfall is that it's unnecessarily complicated and someone will inadvertently forget too check the flag in their query. There's also the issue of potentially needing to delete something immediately instead of wait for the scheduled job to run. |
I was looking for this product myself, knowing that RedGate solution worked fine for "one" DB; unfortunately I have been unable to find such tool :(
In the end, I had to roll my own solution to do something "similar". It was a *pain in the…* but it worked.
My scenario was way simpler than yours, as we didn't hav... |
|touch-typing|typing|performance|wpm| |
I've typed around 75wpm for the last few years but I've always wondered how people type +100wpm. Are there exercises or tips to help break through the 75wpm wall? I've searched but I primarily find typing tutors that teach you to type.. not teach you to type faster. So far the only tip I've come across is to learn dvor... |
I've typed around 75wpm for the last few years but I've always wondered how people type +100wpm.
I've searched but I primarily find typing tutors that teach you to type.. not teach you to type faster. So far the only tip I've come across is to learn dvorak.
Are there exercises or tips to help break through the ... |
My hands aren't my bottleneck, so touchtyping doesn't make me any faster. I already don't get enough bitrate out of my head to max out my hunt and peck. some people (me) may never be able to TT effectively.
agreed on muscle memory though. common thngs like usr/pass always get boshed out quickly without thinking, but... |
##Practice!
----------
[GNU Typist](http://www.gnu.org/software/gtypist/) is a great, free, multi-platform program for practicing. |
##Practice!
----------
[GNU Typist](http://www.gnu.org/software/gtypist/) is a great, free, multi-platform program for practicing. They have different sets of exercises for practicing touch-typing as well as general Speed Drills. |
The best resource I've seen for creating rounded corners using DIV elements was an article on "A List Apart" - see [http://alistapart.com/articles/customcorners/][1]. If you're looking to use DIV elements to layout your entire site, there are several other relevant articles on that site. See:
[http://alistapart.co... |
The best resource I've seen for creating rounded corners using DIV elements was an article on "A List Apart" - see [http://alistapart.com/articles/customcorners/][1]. If you're looking to use DIV elements to layout your entire site, there are several other relevant articles on that site. See:
[http://alistapart.co... |
It sounds like you are appending a string often. You could try using a [StringBuilder class](http://www.vbaccelerator.com/home/Vb/Code/Techniques/StringBuilder/article.asp)
Also, it could be you have some stale objects that contain strings hanging around that aren't being used and should be freed. Check for circular... |
Try Secret Rabbit Code (= SRC = Sample Rate Conversion ) It's GPL, it's fast and it's high quality. http://www.mega-nerd.com/SRC/license.html |
To offer one option to my own question. There are [temp tables][1] - "temporary tables are automatically dropped at the end of a session, or optionally at the end of the current transaction (see ON COMMIT below)" - which I think don't generate WALs. Even so, this might not be ideal as the table creation & design will b... |
Import OLE Object from Access to MySQL |
|mysql|ms-access|import|data-transfer| |
I have a table in an access table which contains Product entries, one of the columns has a jpg image stored as an OLE Object. I am trying to import this table to MySQL but nothing seems to work. I have tried the MySQL migration tool but that has a known issue with Access and OLE Objects. (The issue being it doesnt ... |
Userinterface Testing |
|testing|integration-testing| |
We are working on a large project.
GUI functionality added or modified on our project.With this introduction of new functionality we often introduce new problems in related parts. Testing is done manually by non technical users, but often some parts are not covered.
My question:
what is the best practice for org... |
User Interface Testing |
|testing|user-interface|integration-testing| |
Generally speaking, I create a namespace for a body of code if I believe there might possibly be function or type name conflicts with other libraries. It also helps to brand code, ala [boost::][1] .
[1]: http://www.boost.org/ |
I prefer using a top-level namespace for the application and sub namespaces for the components.
The way you can use classes from other namespaces is surprisingly very similar to the way in java.
You can either use "use NAMESPACE" which is similar to an "import PACKAGE" statement, e.g. use std. Or you specify the pa... |
There are GUI testing tools that will click buttons and stuff for you but they're pretty fragile in my experience.
The best thing to do is to keep your UI layer as thin as possible. Your event handler classes should optimally be only one or two lines that call out to other more testable classes. That way you can t... |
One thing I've done here is break out my palette declarations from other style/layout markup, grouping commonly-colored items in lists, e.g.
h1 {
padding...
margin...
font-family...
}
p {
...
}
code {
...
}
/* time passes */
... |
You'll be reinventing the wheel, to be sure. But here's the basics:
- A list of unvisited URLs - seed this with one or more starting pages
- A list of visited URLs - so you don't go around in circles
- A set of rules for URLs you're not interesting - so you don't index the whole Internet
Put these in persist... |
CAST(REVERSE(LEFT(REVERSE(@Test),CHARINDEX(' ',REVERSE(@Test))-1)) AS INTEGER) |
To avoid the to_be_deleted WHERE clause you could create a trigger before the delete command fires off to insert the deleted rows into a separate table. This table could be cleared out when you're sure everything in it really needs to be deleted, or you could keep it around for archive purposes. |
That is fine if you want to do that, but it seems like a lot of work. How many people are manually changing the database? It should be very few, especially if your users have an app to work with.
When I work on the production db I put EVERYTHING I do in a transaction so if I mess up I can rollback. Just having a ... |
I know you can calculate the quarter of a date by:
Dim quarter As Integer = (someDate.Month - 1) \ 3 + 1
If you're using Visual Studio 2008, you could try bolting additional functionality on to the DateTime class by taking a look at [Extension Methods](http://msdn.microsoft.com/en-us/library/bb384936.aspx). |
<xsl:value-of select="count('/result/uf[@y=@x]')" /> |
<xsl:value-of select="count(/result/uf[@y=@x])" /> |
Don't override GetHashcode() and Equals() on mutable classes, only override it on immutable classes or structures, else if you modify a object used as key the hash table won't function properly anymore (you won't be able to retrieve the value associated to the key after the key object was modified)
Also hash tables ... |
I recommend just passing in cManager as a parameter in your GUI object constructor, but don't maintain a reference to it (Java code here, but you get the idea):
public GUI(CManager cManager)
{
this.aManager = new AManager(cManager);
this.bManager = new BManager(cManager);
// don't... |
Missing aar file in maven2 multi-project build |
|maven-2| |
I'm trying to use maven2 to build an axis2 project. My project is configured as a parent project with AAR, WAR, and EAR modules. When I run the parent project's package goal, the console shows a successful build and all of the files are created. However the AAR file generated by AAR project is not included in the ge... |
I'm trying to use maven2 to build an axis2 project. My project is configured as a parent project with AAR, WAR, and EAR modules. When I run the parent project's package goal, the console shows a successful build and all of the files are created. However the AAR file generated by AAR project is not included in the ge... |
You can always go on [Elance][1] and hire someone to make any icons/logos for you. I've done it several times and it's pretty cheap for what you're getting. There is so much competition on that site that someone will eventually come in at your price point. I've always believed theres no point in spinning your wheels wi... |
Drop the first marble at floor 10, 20, 30, etc. until it breaks then jump back to the last known *good* floor and start dropping marbles from there one floor at a time. Worst case is 99 being the Magic Floor and you can always find it in 19 drops or less. |
But why on earth do you think you need to make icons to make your interfaces look good? Icon driven interfaces are the bane of UI these days. Look at a screenshot of Komodo IDE or Eclipse for example. These are horrendously badly designed interfaces. It's impossible to tell what the buttons do until you hover over them... |
I echo other voices in here. I have used Master Pages in 2.0 and the feature have been great to me. I have been embedding banners, standardized background, captures from Active Dir and other JavaScript features on it for use throughout the app, maintaining the look and feel consistency and without the need to duplicat... |
Is String.Format as efficient as StringBuilder |
|c#|vb.net|stringbuilder|string.format| |
Suppose I have a stringbuilder in C# that does this:
StringBuilder sb = new StringBuilder();
string cat = "cat";
sb.Append("the ").Append(cat).(" in the hat");
string s = sb.ToString();
would that be as efficient or any more efficient as having:
string cat = "cat";
string s = String... |
|c#|vb.net|string.format|stringbuilder| |
Suppose I have a stringbuilder in C# that does this:
StringBuilder sb = new StringBuilder();
string cat = "cat";
sb.Append("the ").Append(cat).(" in the hat");
string s = sb.ToString();
would that be as efficient or any more efficient as having:
string cat = "cat";
string s = String... |
I work on windows mobile full time and have never really come across a good Windows Mobile scripting implementation unfortunately. For some reason MS has never seen the need for it. For example, even though you can actually get a command console on WM, it does not support running batch files, even though all the comm... |
I'd probably go for a REST approach and have resources that represent the different entities within the XML file being consumed. Do you have a specific example of the XML that you can give?
|
ASP.Net AJAX and PageRequestManagerParserErrorException |