instruction stringlengths 0 30k ⌀ |
|---|
How do i set the column which has the header sort glyph, and its direction, in a .NET ListView.
Without custom drawing. |
What you're looking for is "acceptance testing." How you do it depends on the frameworks you're using, what type of application you are creating and in what language. If you google your particular technology and the above phrase, you should find some tools you can use. |
crti.o file missing |
|makefile|linker| |
I'm building a project using a gnu tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.o, wouldn't it use a library file, e.g... |
|linker|makefile| |
I'm building a project using a gnu tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find crti.o. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this crti.o, wouldn't it use a library file, e.g... |
Modern C++ Design by Alexandrescu has a thread-safe, inherietence-safe generic singleton.
For my 2p-worth, I think it's important to have defined lifetimes for your singletons (when it's absolutely necessary to use them). I normally don't let the static get() function instantiate anything, and leave set up and dest... |
Smallest Unicode encodings for different languages? |
|unicode| |
What are the typical average bytes-per-character rates for different unicode encodings in different languages?
E.g. if I wanted the smallest number of bytes to encode some english text, then on average UTF-8 would be 1-byte per character and UTF-16 would be 2 so I'd pick UTF-8.
If I wanted some Korean text, then ... |
If you have Visio and select Project->Visio UML->Reverse engineer you will get a uml of the project.
Sparx Systems has made a product called "Enterprise Architect" that should be able to do the trick as well. |
while anything is possible. . . .
No, unless you are storing session state in sql server or some other out of process storage and then messing with it. . . |
Findstr is fairly powerful, supports RegEx and has the advantages of being on all Windows machines already.
c:\>FindStr /?
Searches for strings in files.
FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
[/C:string] [/G:file] [/D:dir list] [/A:color at... |
If you're in the correct checked out directory, I don't see why it wouldn't work? Your shell should expand the *.php to a list of php files, and svn move accepts multiple sources as arguments. |
I've used this tool before and it worked perfectly.
http://www.mysqldiff.org/
It takes as an input either a DB connection or a SQL file, and compares it to the same (either another DB connection or another SQL file). It can spit out the SQL to make the changes or make the changes for you. |
Well I'd say your "set" is high risk, what if somebody didn't know they had to pass an already joined sequence of values or your example above was maybe missing that. What if the string already contained the separator - you'd break.
I'm sure performance isn't great depending on how often this property is used. |
|listview|sorting|header|glyph| |
How do i set the column which has the header sort glyph, and its direction, in a .NET 2.0 WinForms ListView.
|
I would use structs when:
1. an object is supposed to be read only(every time you pass/assign a struct it gets copied). Read only objects are great when it comes to multithreaded processing as they don't requite locking in most cases.
2. an object is small and short-living. In such a case there is a good chan... |
I would take out the static assignment in the designer to the resource CrystalReport11 and then add a load handler to your form and before setting the ReportSource back to CrystalReport11 do a check
If(Not DesignMode) Then Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11
Here is a mockup.. in C# but... |
I would take out the static assignment in the designer to the resource CrystalReport11 and then add a load handler to your form and before setting the ReportSource back to CrystalReport11 do a check
If(Not DesignMode) Then Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11
Here is a mockup..
Publi... |
I found a way, but I have to think there is an easier way:
String portTypeContainerLocation = portTypeContainer
.getLocation();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot workspaceRoot = workspace.getRoot();
String[] parts = portTypeContainerLocation.split("/");
... |
String platformLocationString = portTypeContainer
.getLocation();
String locationString = platformLocationString
.substring("platform:/resource/".length());
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot workspaceRoot = workspace.getRoot();
IFile wSDLFile = (... |
It seems to be working now.
I enabled "Trust this computer for delegation" for the computer object in Active Directory. Normally IIS cannot both authenticate you and then subsequently impersonate you across the network (in my case to a domain controller to query Active Directory) without the delegation trust enable... |
There's seperate stages for this one.
Firstly there's the technical testing, where you check all technical functionality:
- SQL injections
- Cross-site Scripting (XSS)
- load times
- stress levels
Then there's the phase where you have someone completely computer-illiterate sit down and ask them to f... |
Others propose that exceptions should not be used because the bad login is to be expected in a normal flow if the user mistypes. I disagree and I don't get the reasoning. Compare it with opening a file.. if the file doesn't exist or is not available for some reason then an exception will be thrown by the framework. ... |
I have no previous OpenGL, DirectX or videogame experience and i have made have an [open source race videogame][1] with [Ogre3d][2]. Is a very good framework to start in videogames: well done code, plenty of [docs][3] and info in the net and [very good starting tutorials][4].
The rendering engine is DirectX/OpenGl a... |
Dont.... just go get a new job in a place thats more in synch with you. |
Array.newInstance(Class componentType, int length) |
It's great for xml, but not great for typical coding. It lacks typical basic concepts (ie mutable variables) and makes what should be simple quite complex (or impossible). Most of its problems stem from the fact that xml is a great data representation language but not a great programming language. That being said, I... |
By looking at how ArrayList does it:
public <T> T[] toArray(T[] a) {
if (a.length < size)
a = (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size);
System.arraycopy(elementData, 0, a, 0, size);
if (a.length > size)
a[size] = null;
... |
Some additional info, that might be of interest:
- Using the ip address, one can resolve the hostname, net provider / organization the IP belongs to, and rough geographic location.
- Using the referer, the list of queries a specified client makes, and a reliable cookie mechanism, one can resolve the path the visito... |
Parsing the WSDL is probably the simplest way to do this. Using WCF, it's also possible to download the WSDL at runtime, essentially run svcutil on it through code, and end up with a dynamically generated proxy that you can check the structure of. See http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programmi... |
["Open Source cms"][1] has tons of them, and running demos with admin logins
[1]: http://opensourcecms.com/ |
Define "good". It shouldn't break (unless you failed to properly guarantee that the delimiter(s) passed to `Split()` are never allowed in the individual strings themselves), but if `IndividualStrings` is accessed more frequently than `ActualProperty` you'll end up parsing `actualProperty` far more often than you should... |
> I think the only problem with max concurrent in IIS is it might block page requests rather than just download requests.
I'm no IIS expert but, if this setting is per domain / virtual host, you are set. If you can serve your downloads from a sub-domain that isn't used for anything, the setup it will not interf... |
Possibly the largest cost with naive toString() chaining is appending all those strings. If you want to generate large strings, you should use an underlying representation that supports an efficient append. If you know the append is efficient, then toString()s probably have a relatively low cost.
For example, in J... |
toString() is used to represent an object as a String. So if you need slow running code to create a representation of an object, you need to be **very careful** and have a very good reason to do so. Debugging would be the only one I can think of where a slow running toString is acceptable.
|
The best way to find out is to profile your code. However, rather than worry that a particular function has a high overhead, it's (usually) better to worry about the correctness of your application and then do performance profiling on it (but be wary that real-world use and your test setup may differ radically). As i... |
I'm slightly biased here, but I would suggest modelling this in some process language and model check it. Freely available tools are, for example, the mCRL2 toolset (using a ACP-based language), the Mobility Workbench (pi-calculus) and Spin (PROMELA).
Otherwise I would suggest removing every bit of code that is not ... |
You can use command line windows tools "tasklist" and "taskkill" and call them from Java using "Runtime.exec()". |
- If you have complete control of your codebase and your thought-process, by all means do.
- If not, you'll regret this the day some new person injects a BItem derivation that you didn't see coming into *your* BList or BDictionary.
If you have to do this, atleast wrap it (control access to the list) in a class ... |
That's a shame. The only reason to hold back on desktop development with .net is the requirement of the .net framework on the desktop machine, but imho that is a small price to pay for the bennefits you get when being able to work in the .net environment. |
Hmm. I would actually argue that the first line of coded is more readable than the second - it takes a little longer to figure out what's going on it, but its more apparant that you're treating objects as BList or BDictionary. Applying the methods to the abstract class hides that detail, which can make it harder to fig... |
Over the last year I have become more and more convinced of the benefits of TDD.
The things that I have learned along the way:
1) dependency injection is your friend. I'm not talking about inversion of control containers and frameworks to assemble plugin architectures, just passing dependencies into the constructor ... |
I am re-building our poorly designed web application from scratch, and wanted to get into TDD and basically "do things right" as kind of a learning project. What tools, processes, and resources are recommended to do it "right" from the start? I will be working alone as the architect and developer, with the backup of ... |
I am re-building our poorly designed web application from scratch, and wanted to get into TDD and basically "do things right" as kind of a learning project. What tools, processes, and resources are recommended to do it "right" from the start? I will be working alone as the architect and developer, with the backup of ... |
|c#|asp.net|unit-testing|web-applications| |
I am re-building our poorly designed web application from scratch, and wanted to get into TDD and basically "do things right" as kind of a learning project. What tools, processes, and resources are recommended to do it "right" from the start? I will be working alone as the architect and developer, with the backup of ... |
Switching an OSS project license from GPL to L-GPL on Sourceforge |
|licensing|open-source| |
Is that possible to switch an Open Source Project license from [GPL][1] to [LGPL v3][2] if I am the project originator/administrator ?
[1]: http://opensource.org/licenses/gpl-2.0.php
[2]: http://opensource.org/licenses/lgpl-3.0.html |
|open-source|licensing| |
Is that possible to switch an Open Source Project license from [GPL][1] to [LGPL v3][2] ?
I am the project originator and the only contributor.
[1]: http://opensource.org/licenses/gpl-2.0.php
[2]: http://opensource.org/licenses/lgpl-3.0.html |
I believe this is what you're after: [jQuery.Preload][1]
Here's the example code from the demo, you specify the loading and not found images and you're all set:
$('#images img').preload({
placeholder:'placeholder.jpg',
notFound:'notfound.jpg'
});
[1]: http://flesler.blogspot.com/... |
Not sure if there is a better way, but I can think of a hack to get it - you could ajax post to the img url, and parse the response to see if the image actually came back. If it came back as a 404 or something, then swap out the img. Though i expect this to be quite slow. |
Query Web Service for list of Messages? |
|.net|c#|soap|web-services| |
Is there a straightforward way to query a web service to see which messages it supports? The C# .NET application I'm working on needs to be able to handle an older version of the web service, which does not implement the message I'm trying to send. The web service does not expose a version number, so Plan B is to see i... |
|c#|.net|web-services|soap| |
Is there a straightforward way to query a web service to see which messages it supports? The C# .NET application I'm working on needs to be able to handle an older version of the web service, which does not implement the message I'm trying to send. The web service does not expose a version number, so Plan B is to see i... |
Have a look at [PG Foundry][1], extra utilities for Postgres tend to live there. I believe that the tool you're looking for does exist though.
[1]: http://pgfoundry.org/ |
You can build a markov-chain of a huge english text.
Afterwards you can feed workds into the markov chain and check how high the probability is that the word is english.
See here: http://en.wikipedia.org/wiki/Markov_chain
At the bottom of the page you can see the markov text generator. What you want is exactl... |
You can build a markov-chain of a huge english text.
Afterwards you can feed words into the markov chain and check how high the probability is that the word is english.
See here: http://en.wikipedia.org/wiki/Markov_chain
At the bottom of the page you can see the markov text generator. What you want is exactly... |
IMHO rcreswick's solution has the undesired effect of requiring you to use a specific sub class of a JTextField for all of your fields. The code can be written to add a listener that is not a concrete instance of anything other than the code needed to select the whole text.
public class SelectAllListener implem... |
A separate class that attaches a FocusListener to the desired text field can be written. All the focus listener would do is call selectAll() on the text widget when it gains the focus.
public class SelectAllListener implements FocusListener {
private static INSTANCE = new SelectAllListener();
pu... |
The way I see it, not all BItems are collections, thus not all BItems have indexers, so the indexer shouldn't be in BItem. I would derive another abstract class from BItem, let's name it BCollection, and put the indexers there, something like:
abstract class BCollection : BItem {
public BItem this[i... |
For .png images you could look into Cairo (and CairoMM). There's also Anti-Grain which people consider very fast. |
**Please remember that TDD is not a panaceum.** It's hard, it's supposed to be hard, and it's especially hard to write mocking tests "in advance".
So I would say - do what works for you. Even it's not "certified TDD". I do basically the same thing.
You may want to provide your own API for GUI that would sit betwe... |
Quicker way to create deplicate Virtual PC images? |
|vpc| |
I use Virtual PC to create fresh environments for testing my installer. But I must be doing something wrong because a VPC image with Vista or XP inside is taking around 15GB of disk space (that includes VS2005/S2008 installed in them).
To create a new copy for testing I copy and paste the folder that has the .vhd, ... |
|virtual-pc| |
Quicker way to create duplicate Virtual PC images? |
We have the same problem at Last.fm, I looked at DeployQt and it's not much use if you have third party libraries. In the end I wrote a perl script that generates a Makefile, which you can use to generate a .app and/or .dmg.
I uploaded it here: <http://www.methylblue.com/detritus/QMake.dmg/>
To use it add this to... |
Rails is more mature, has more plugins, has a bigger userbase, has better documentation and support available. It can also run on JRuby giving access to Java libraries if you require.
Grails has some interesting qualities, but can't claim to be up there with rails just yet. However, if you're predominantly a Java ... |
I strongly urge you to go to heroic lengths to prevent breaking the back button, it is a sure fire way to alienate your users and even made it to No.1 on [Jacob Neilsen's Top 10 Web Design Mistakes in 1999][1].
Perhaps you could consider rather asking the question: "How to avoid breaking the back button for <inse... |
Chaching is handled differently by different frameworks, so you'd have to help us out with some more information. But I also wonder if you could pass that as a parameter instead of using `$GLOBALS.`
$this->renderSomeHTML(true); |
This seems like a simple implementation in java, based on ImageMagick:
http://gurge.com/amd/java/quantize/index.html
|
I'm not sure what the benefit of this design would be. I think the split would be better served in an extension method.
At a minimum, I'd remove the setter on the IndividualStrings property, or move it into two methods: string[] SplitActualProperty() and void MergeToActualProperty(string[] parts). |
For gmail:
http://sourceforge.net/projects/gmail-api
http://johnvey.com/features/gmailapi/
|
How many DataTable objects should I use in my C# app? |
|c#|.net|sql-server|dataset|datatable| |
I'm an experienced programmer in a legacy (yet object oriented) development tool and making the switch to C#/.Net. I'm writing a small single user app using SQL server CE 3.5. I've read the conceptual DataSet and related doc and my code works.
Now I want to make sure that I'm doing it "right", get some feedback from... |
Its kind of a difficult question to answer, the development life cycles are so active you're asking for something that's likely to have been solved already ( and if its been reported so that we know of it, the likelihood its fixed is really high )
What you need is a 0-day hack for them, and asking this list really w... |
Not sure about svn itself, but either your shell should be able to expand that wildcard and svn can take multiple source arguments, or you can use something like
for file in *.php; do svn mv $file php-folder/; done
in a bash shell, for example. |
To resolve question #1 I'd recommend looking into creating a hash of each line. That way you can compare hashes quick and easy using a dictionary.
To resolve question #2 one quick and dirty solution would be to use an IDictionary<string, string>. Using itemId as your first string type and the rest of the line as ... |
You can simply make a new c# class library project in the solution. recode a few classes at a time in here and then replace the vb classes in the main project.
but to be honest I would agree I don't see the benefit unless your trying to learn c# or just really don't like vb or just bored. |
You need to include a command line option in your SVN_EDITOR (or EDITOR) variable
export SVN_EDITOR='mate -w'
This makes the svn command wait for the editor to close/release the file before continuing, which is where the process is getting mucked up now.
See [here](http://manual.macromates.com/en/using_textmat... |
You are allowed to keep your App_Code Directory with both VB code and C# code in it. So effectively, you could do it very slowly when you have the spare time to convert it.
I currently have both VB.Net and C# code in my App_Code directory and on my spare time I convert to VB.Net code or anytime I have to go back to ... |
I'm evaluating a new opensource web page instrumentation and measurement suite called [Jiffy][1]. It's not particularly for ruby, it works for all kind of webapps
[1]: http://code.google.com/p/jiffy-web/ |
I'm evaluating a new opensource web page instrumentation and measurement suite called [Jiffy][1]. It's not particularly for ruby, it works for all kind of webapps
There's also a [Jiffy Firebug Extension][2] for rendering the metrics inside the browser.
[1]: http://code.google.com/p/jiffy-web/
[2]: http://b... |
Converting Table Layout To Div |
|html|css|layout| |
I'm implementing a comment control that uses an ASP.Repeater to display each comment. The comment itself is currently displayed using a table to divide up some images to display the comment in a bubble.
I know that tables are supposed to be the epitome of evil for design layout, and really expensive to display for ... |
Whats a good Javascript plugin color picker? |
|javascript|color-picker| |
I make a lot of web applications and from time to time I need a color picker. Whats one that I can use like an API and doesn't require a lot of code to plug in? I also need it to work in all browsers. |
[R] How to access the last value in a vector? |