instruction
stringlengths
0
30k
|java|swing|
When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck. Searched for "java ensureIndexIsVisible" and tried all solutions proposed in the first 20 results. import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; ...
|java|swing|
When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck. import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; import javax.swing.ListSelectionModel; import javax.swing.JScrollPane; import java.awt.D...
This prose by Alberto Savoia answers precisely that question (in a nicely entertaining manner at that!): [http://www.artima.com/forums/flat.jsp?forum=106&thread=204677][1] > **Testivus On Test Coverage** > > Early one morning, a programmer asked > the great master: > > “I am ready to write some unit tes...
Depending on exactly what you mean by "gotten to grips with the basics", I'd suggest reading through [Dive Into Python][1] and typing/executing all the chapter code, then get something like [Programming Collective Intelligence][2] and working through it - you'll learn python quite well, not to mention some quite excell...
I've used visual studio 6 and visual studio 2005 on the same system, so I know you can set it up so that both debuggers work. However, when I did it the setup just worked, so I can't tell you what I did to make it work, except that VS2005 was on the machine first.
How to make visualstudio .net work with VB6 and service pack 6
|visualstudio.net|with|service|pack|6|
I have VB application that requires visual service pack 6 to run , now when I install visualstudio.net (any version of .net) Its debugger doesn't work properly ,I am able to create windows/web application in visualstudio.net but not able to debug anything , so I have to keep 2 computers , one for VB and one for .net ...
|visual-studio|
When I read thise quote I focus on the "*applications*" part rather than the "mission critical" part. I read it as saying bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekeeping scripts but don't go writing `critical-business-logic.sh` because another la...
I have encountered the slow playing problem in your player, about 25% of the times I reloaded it, but only if another application using the audio device is running when the stream starts playing, as I reckon after a quick look. Maybe you should test this situation on multiple computers. I would guess that it's an audio...
[Here is Adobe's 5 part series][1] - whether it is easy to understand depends on the individual users perspective! Also [this post][2] describes the "comparator" much like a filter. [1]: http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html [2]: http://nyls.blogspot.com/2006/11/flex-cairngormfilteri...
It's simple, but have you checked endianness? It could easily be a mismatch between the endianness you have sent the data in and the endianness you are recieving in.
I think in your case there is probably no reason to not pick Varchar. It gives you flexibility and as has been mentioned by a number of respondants, performance is such now that except in very specific circumstances us meer mortals (as opposed to Google DBA's) will not notice the difference. An interesting thing wo...
The other answers are correct that headers are indeed encrypted, along with the body, when using SSL. But keep in mind that the URL, which can include query parameters, is **never** encrypted. So be careful to never put any sensitive information in URL query parameters.
Very reasonable. As an example, take a look at the aspnet_* services tables [here](http://msdn.microsoft.com/en-us/library/ms229862.aspx "table example"). Their built in schema has a `aspnet_Users` and `aspnet_Membership` with the later table having more extended information about a given user (hashed passwords...
The answer might very well depend on the compiler, so you probably want to edit your question (I mean, even the notion of segments is not mandated by ISO C nor ISO C++). For instance, on Windows an executable doesn't carry symbol names. One 'foo' would be offset 0x100, the other perhaps 0x2B0, and code from both transl...
danivo, so long as the server's cert is capable of AES encryption, the level of encryption between the browser and the server is independent of the cert itself -- that level of encryption is negotiated between the browser and server. In other words, my understanding is that the cert doesn't specify the level of encryp...
c# Creating hidden folders
|c#|folders|hidden|creation|
Is there any way that I can programmatically create (and I guess access) hidden folders on a storage device from within c#?
|.net|filesystems|
Its largely for security reasons. Its much harder to secure a system if you can't trust that your strings are tamperproof.
Another alternative would be to not automate creating the classes, and instead create separate classes that only contain the data members that individual executables are interested in, so that those classes only pull the necessary data. Don't know how many tables we're talking about, though, so that may explode the ...
I don't believe there will be a collision. Using static at the file level (outside functions) marks the variable as local to the current compilation unit (file). It's never visible outside the current file so never has to have a name. Using static inside a function is different - the variable is only visible to th...
[ProcessExplorer][1] shows you all the DLLs that are currently loaded in a process at a particular moment. This gives you another angle on [Dependency Walker][2] which I believe does a static scan and can miss some DLLs that are dynamically loaded on demand. [1]: http://technet.microsoft.com/en-us/sysinternals/d...
Whether a file is downloaded or opened automatically is a browser, not a server, side setting. The other way of doing it would be to change the MIME type for the file to something like application/octet-stream or similar to try and force your browser to download it.
Can you try single-stepping through the debugger to see what exactly is going wrong? It could easily be %Zone that is wrong - %tz may be set correctly on line 1 or 2, but then the lookup on line 3 fails, ending up with undef.
Can you try single-stepping through the debugger to see what exactly is going wrong? It could easily be %Zone that is wrong - %tz may be set correctly on line 1 or 2, but then the lookup on line 3 fails, ending up with undef. Edit: %Date::Manip::Cnf and %Date::Manip::Zone are global variables, so you should be able ...
If you're not against using a JavaScript framework to play a sound scriptaculous provides an API for playing sounds. http://github.com/madrobby/scriptaculous/wikis/sound
Ah, found it, based on [a subtle hint from Jan Tielens][1]. It's on the Settings page for the list, under Communications -> RSS settings. /_layouts/listsyndication.aspx?List=*<list id>* I could have sworn there was more, like an actual template file you could customize. [1]: http://weblogs.asp.net...
HTML drag and drop sortable tables
|javascript|html|table|drag-and-drop|
Ever wanted to have an HTML drag and drop sortable table in which you could sort both rows and columns? I know it's something i'd die for. There's a lot of sortable lists going around but finding a sortable table seems to be impossible to find. I know that you can get pretty close with the tools that script.aculo.u...
What is the best way of speccing plugins with RSpec?
|rspec|plugin-development|
I'm creating a plugin, and am looking to use RSpec so I can build it using BDD. Is there a recommended method of doing this?
I think that the most important factor is to place your html elements in a way that makes sense semantically, and with luck your layout in CSS will not have to do too much work. For example, your site's header will probably be the first element on the page, followed by common navigation, then sub-navigation, content a...
Well, there are great ressources for advanced Python programming : - Dive Into Python (can be freely read at http://diveintopython.org/) - Online python cookbooks (http://code.activestate.com/recipes/langs/python/ and http://the.taoofmac.com/space/Python/Grimoire) - O'Reilly's Python Cookbook (see amazon) - A fun...
mysql_insert_id alternative for postgresql
|php|insert-id|postgresql|
is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....
|php|postgresql|insert-id|
I'm not aware of any tools, but if you're working under MSVC you can use [DIA SDK][1] to extract size information from .PDB files. Sadly, this wont work for stack footprints IIRC. [1]: http://msdn.microsoft.com/en-us/library/t6tay6cz(VS.80).aspx
If you are using Jetty 6 you can use the following code: String webApp = "./web/myapp"; String contextPath = "/myapp"; WebAppContext webAppContext = new WebAppContext(webApp, contextPath); ServletHandler servletHandler = webAppContext.getServletHandler(); ServletHolder holder = new Servl...
If you are using Jetty 6 you can use the following code: String webApp = "./web/myapp"; // Location of the jsp files String contextPath = "/myapp"; WebAppContext webAppContext = new WebAppContext(webApp, contextPath); ServletHandler servletHandler = webAppContext.getServletHandler(); Ser...
What's the easiest way to merge (server-side) a collection of PDF documents into one big PDF document in JAVA
|java|pdf|pdf-generation|
I have 3 PDF documents that are generated on the fly by a legacy library that we use, and written to disk. What's the easiest way for my JAVA server code to grab these 3 documents and turn them into one long PDF document where it's just all the pages from document #1, followed by all the pages from document #2, etc. ...
You have differents things to do to have a "globalized" application. **1) Translate every label in your forms and controls in your application** You need to set the property "Localizable" to true on every form and control. This property enables the creation of resources files in each language and region. Now, wit...
The guys over at [vbdotnetheaven.com][1] have a simple example using the WebClient, WebRequest and HttpWebRequest classes. Here is their WebClient class example: Imports System Imports System.IO Imports System.Net Module Module1 Sub Main() ' Address of URL Dim URL A...
|ruby-on-rails|plugin-development|rspec|
Is it worth the effort to move from a hand crafted hibernate mapping file to annotaions?
|hibernate|java|annotations|
I've got a webapp whose original code base was developed with a hand crafted hibernate mapping file. Since then, I've become fairly proficient at 'coding' my hbm.xml file. But all the cool kids are using annotations these days. So, the question is: Is it worth the effort to refactor my code to use hibernate annota...
|java|hibernate|annotations|
I've got a webapp whose original code base was developed with a hand crafted hibernate mapping file. Since then, I've become fairly proficient at 'coding' my hbm.xml file. But all the cool kids are using annotations these days. So, the question is: **Is it worth the effort** to refactor my code to use hibernate an...
Use Type.IsSerializable as others have pointed out. It's probably not worth attempting to reflect and check if all members in the object graph are serializable. A member could be declared as a serializable type, but in fact be instantiated as a derived type that is not serializable, as in the following contrive...
Runs them where: on the server, or on the client? If on the server: set the handler mappings of the file so that CGI-exe is disabled. If on the client: then this is a web browser issue - it shouldn't be running EXEs directly! What browser is it? As Dave Webb mentions, you could use the *Content-Disposition* HTTP he...
There probably won't be a whole lot of winforms apps in the traditional sense being written, but the next version of both windows live messenger will be written in windows presnetation foundation and I think this is what the trend will be towards. Windows Media Centre was written in C# which is pretty impressive, bu...
For C++, a map works well. Several million objects won't be a problem. 10 million items took about 4.4 seconds and about 57 meg on my computer. #include <stdio.h> #include <stdlib.h> #include <map> class triple { public: int x; int y; int z; bool operat...
ps aux will give you the answer, but it drops down to day-precision which might not be as useful. USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 7200 308 ? Ss Jun22 0:02 init [5] root 2 0.0 0.0 0 0 ? S Jun22...
For anything older than one day, ps aux will give you the answer, but it drops down to day-precision which might not be as useful. USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 7200 308 ? Ss Jun22 0:02 init [5] root 2 ...
Could you try [parsing the XML with hpricot][1] and using the output to build a plain old Ruby object? [DISCLAIMER]I haven't tried this. [1]: http://www.rubyinside.com/parse-xml-quickly-and-easily-with-hpricot-166.html
[Jhenzie's answer](http://stackoverflow.com/questions/90246/how-would-i-store-a-date-that-can-be-partial-ie-just-the-year-maybe-the-month-t#90273) seems like a good fit, so I'd probably go with that if I were you. The only way that I could think of doing it _without_ requiring extra columns in your table would be to...
[As proposed by Jhenzie](http://stackoverflow.com/questions/90246/how-would-i-store-a-date-that-can-be-partial-ie-just-the-year-maybe-the-month-t#90273), create a bitmask to show which parts of the date have been specified. 1 = Year, 2 = Month, 4 = Day, 8 = Hour _(if you decide to get more specific)_ and then store tha...
Track installs of software
|vb.net|
Despite my lack of coding knowledge I managed to write a small little app in VB net that a lot of people are now using. Since I made it for free I have no way of knowing how popular it really is and was thinking I could make it ping some sort of online stat counter so I could figure out if I should port it to other la...
Despite my lack of coding knowledge I managed to write a small little app in VB net that a lot of people are now using. Since I made it for free I have no way of knowing how popular it really is and was thinking I could make it ping some sort of online stat counter so I could figure out if I should port it to other la...
HttpContext.Items as a request-level caching tool
HttpContext.Items as a request-level caching tool that can be used across boundaries (pages, user controls, etc)
HttpContext.Items as a request-level caching tool
I agree that Java SDK has a terrible implementation of datetime library. Hopefully JSR-310 will fix this problem in Java 7. If you can't wait for Java 7, I would recommend the precursor to JSR-310, Joda Time. I agree that Ruby on Rails implementation in ActiveSupport is an excellent implementation that gets the basi...
You really haven't given us enough info to help you. Do you need to load each file in its entiretly in order to process it? Or can you process it line by line? Loading an entire file at a time is likely to result in poor performance even for files that aren't terribly large. Your best bet is to define a buffer size ...
It is much the simplest to link to the runtime statically. c++ -> Code Generation -> Runtime Library and select "multi-threaded /MT" However, this does make your executable a couple hundred KByte larger. This might be a problem if you are installing a large number of small programs, since each will be burdened b...
You can do it pretty easily if you use some GUI for SVN. Personally I love [TortoiseSVN][1] for when I'm working in Windows. You just open up the "Repository Browser", right-click on some folder, and choose "Move...". Or, you have the option of doing it straight from within Windows Explorer, drag the files/folders you ...
Date APIs are very difficult to design, especially if they have to deal with localization. Try to roll your own and see, it's worth doing at least once. The fact that Joda was able to do such a good job is a real credit to its developers. To answer your question, I've heard nothing but good things about that library...
You can use brackets for any fieldname, e.g.: CREATE TABLE [TableName] ([Date] string, [Container] string)
You can use brackets for any fieldname, e.g.: CREATE TABLE [TableName] ([Date] string, [Container] string) Full example: using (OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\temp\\test.xls;Extended Properties='Excel 8.0;HDR=Yes'")) { conn.Open(...
If you're talking about using Javascript as part of a web page on this site, you can't. Or any other public wiki for that matter - it's a security risk. If you're talking about posting a code sample, click on the '101010' button above the text box.
1. The fast startup time. 2. The sharp distinction between editing and viewing. (you know when you edit) 3. The only way you ever find what you are looking for is with search "/" and that is good, since it much faster than your eyes. But the best command(s) are: / - search string ZZ - quit . - repea...
pseudo-streaming of wmv files
|microsoft|video|streaming|wmv|
Is it possible to do pseudo-streaming(eg start playback at any point) with wmv files and silverlight? This is possible using Flash in a progressive download setup but can it be done on the Microsoft track?
One thing you'll gain from using annotations instead of an external mapping file is that your mapping information will be on classes and fields which improves maintainability. You add a field, you immediately add the annotation. You remove one, you also remove the annotation. you rename a class or a field, the annotati...
Launch Local Mail Client from App Hosted on Citrix
|citrix|
I have a desktop application (Windows Forms) which my client hosts on a Citrix server. I would like to launch the user's locally configured mail client to send mail from my application. How do I do this? In addition to this, I will need to attach a file to the email before it is sent.
TechSmith's Jing is .NET, and in fact it is WPF so it is 3.5, bleeding edge .NET.
How about using a static logger? Or do you need a different logger reference for each instance of the class? Static fields are not serialized as far as I know.
How about using a static logger? Or do you need a different logger reference for each instance of the class? Static fields are not serialized as far as I know. Added content: As you use getLogger(getClass()), you will use the same logger in each instance. If you want to use separate logger for each instance you ha...
How about using a static logger? Or do you need a different logger reference for each instance of the class? Static fields are not serialized as far as I know. Added content: As you use [getLogger(getClass())][1], you will use the same logger in each instance. If you want to use separate logger for each instance y...
Tools for command line file parsing in cygwin.
|parsing|cygwin|
I have to deal with text files in a motley selection of formats. Here's an example (Columns A and B are tab delimited): A B a Name1=Val1, Name2=Val2, Name3=Val3 b Name1=Val4, Name3=Val5 c Name1=Val6, Name2=Val7, Name3=Val8 The files could have headers or not, have mixed delimiting schemes, have columns wit...
Silverlight interaction with DataSet web services
|silverlight|