instruction stringlengths 0 30k ⌀ |
|---|
I've been looking at the [NTag][1] project as well, which handles MP3/WMA/OGG. I don't know of a single library that handles audio and video files, so you might have to use a few.
[1]: http://www.orthogonal.com.au/computers/ntag/index.htm |
I think that this is one of these issues that cause quasi-religious debates, and its almost futile to talk about. I would just say use what you prefer. In 99% of systems it will no matter which type of key you use, so the benefits (stated in the other posts) of using one sort over the other will never be an issue. |
I use [MediaInfo](http://mediainfo.sourceforge.net/en) with my C# apps, gives you a lot of information about media files. |
I have not tested the OnTime thing, but keep in mind that both FogBugz and OnTime have free versions as well, Axosoft for 1 user and FogBugz for 2 Users, although it's the hosted version. (Check [my answer here][1] to see how to sign up for the free FogBugz version)
So you can have some real first-hand experience on... |
Try [this article][1] but short answer is My.Application.CommandLineArgs
[1]: http://www.codeproject.com/KB/vb/VBFileAssociation.aspx |
In no particular order:
Lists<>
Mutex
The new property definitions shortcut in Framework 3.5.
|
Would a View work better in this case? |
Would a View work better in this case?
CREATE VIEW vwTable
as
SELECT
col1
, col2
, col3
, col..
, col53
FROM table |
This sounds pretty strange. Here's what I would check next:
1. Check that there's nothing lingering in your Properties/AssemblyInfo.cs file.
2. Check that there's nothing lingering in your SuperUI.csproj file.
3. Delete all references and re-add them. |
You need to delete the column by yourself from the designer or the XML file. |
It can allow you two have phantom caches which are very efficient in memory management.
Simply put, if you have huge objects that are expensive to create but seldom used, you can use a phantom cache to reference them and be sure they do not take up memory that is more valuable. If you use regular references you have ... |
Variables have a type and a value.
- $var = "test" is a string that contain "test"
- $var2 = 24 is an integer vhose value is 24.
When you use these variables (in PHP), sometimes you don't have the good type.
For example, if you do
if ($var == 1) {... do something ...}
PHP have to convert ("to cast... |
Again, my be overkill, but the [OSE][1] library allows thins kind of thing.
[1]: http://ose.sf.net |
I think the idea is to let other objects do extra cleanup above and beyond what the original object does. For example, if the original object cannot be extended to implement some finalization stuff, you can use phantom references.
The bigger problem is that the JVM makes no guarantee that an object will ever be fina... |
See [Options for HTML Scraping](http://stackoverflow.com/questions/2861/options-for-html-scraping) |
Highlight the method name and press f12 |
From [the manual][1] (Example 11.61. Example of parenthesizing Boolean expressions)
<pre><code>
// Build this query:
// SELECT product_id, product_name, price
// FROM "products"
// WHERE (price < 100.00 OR price > 500.00)
// AND (product_name = 'Apple')
$minimumPrice = 100;
$maximumPrice = 500... |
Lotus/ Domino is your answer. I've been working with it for ten years and its exactly what you need. It may not be trendy (a perception that I would challenge) but its powerful, adaptable and very secure, The latest version R8 is the best yet. |
To check if a directory exists in a bash shell script you can use the following:
<pre>
if [ -d $DIRECTORY ]; then
# Will enter here if $DIRECTORY exists
fi
</pre>
Or to check if a directory doesn't exist:
<pre>
if [ ! -d $DIRECTORY ]; then
# Will enter here if $DIRECTORY doesn't exist
fi
</pre> |
To check if a directory exists in a bash shell script you can use the following:
<pre>
if [ -d $DIRECTORY ]; then
# Will enter here if $DIRECTORY exists
fi
</pre>
Or to check if a directory doesn't exist:
<pre>
if [ ! -d $DIRECTORY ]; then
# Will enter here if $DIRECTORY doesn't exist
fi
</pre>
... |
To check if a directory exists in a bash shell script you can use the following:
<pre>
if [ -d "$DIRECTORY" ]; then
# Will enter here if $DIRECTORY exists
fi
</pre>
Or to check if a directory doesn't exist:
<pre>
if [ ! -d "$DIRECTORY" ]; then
# Will enter here if $DIRECTORY doesn't exist
fi
</pre>
... |
How about plain old XML (somewhat unfortunately referred to as POX)?
Another very useful option would be [JSON](http://www.json.org/). There are libraries for every single programming language out there.
Possibly, since you are working in an environment that is constrained in terms of both computing and networkin... |
What is the best way to stop people hacking the PHP-based highscore table of a Flash game. |
|actionscript-3|actionscript-2|actionscript|php|security| |
The main problems seem to be things like TamperData and LiveHTTP headers, but I understand there are more advanced hacking tools as well. I need to know the best solutions for both AS2 and AS3, if they are different. |
I'm talking about an action game with no upper score limit and no way to verify the score on the server by replaying moves etc.
What I really need is the strongest encryption possible in Flash/PHP, and a way to prevent people calling the PHP page other than through my Flash file. I have tried some simple methods in... |
I'm talking about an action game with no upper score limit and no way to verify the score on the server by replaying moves etc.
What I really need is the strongest encryption possible in Flash/PHP, and a way to prevent people calling the PHP page other than through my Flash file. I have tried some simple methods in... |
|php|security|actionscript-3|actionscript|actionscript-2| |
I'm talking about an action game with no upper score limit and no way to verify the score on the server by replaying moves etc.
What I really need is the strongest encryption possible in Flash/PHP, and a way to prevent people calling the PHP page other than through my Flash file. I have tried some simple methods in... |
Since it's a compiler error, there must be a reference or use of SuperException somewhere in the project.
1. Do a find/replace in the entire project or solution for that type and remove every reference (it's possible you already did this).
2. If you reference any types that inherits from SuperException (even if the... |
Office 2008 allows limited connectivity to MOSS. However there is no Mac OS browser yet that is completely compatible to MOSS.
I do have it on good authority the Microsoft Mac BU team is working with the MOSS team to see this changing in future versions of the platform, specifically around the Safari support. |
Try creating a new project, and adding all your classes to it. |
One thing you should be sure to consider is what ports are open to the world. I personally just open port 22 for SSH and port 123 for ntpd. But if you open port 80 (http) or ftp make sure you learn to know at least what you are serving to the world and who can do what with that. I don't know a lot about ftp, but there ... |
Looks like MediaInfo is read-only at this point, by the way: [http://sourceforge.net/forum/message.php?msg_id=4241318&abmode=1][1]
Very cool project, though. It's fun finding out about all this cool stuff here on SO.
[1]: http://sourceforge.net/forum/message.php?msg_id=4241318&abmode=1 |
jQuery is the way i'd deal with this personally. css support is minimal, images are too fiddly, to be able to select the elements you want to have round corners in jQuery makes perfect sense to me even though some will no doubt argue otherwise. Theres a plugin I recently used for a project at work here: [http://plugins... |
1. Exit Visual Studio
2. Delete the obj Folder in your solution directory
3. Restart and see what happens |
1. Exit Visual Studio
2. Delete the bin and obj Folders in your solution directory
3. Restart and see what happens |
I had an application that worked likewise: an MS Access frontend to a MySQL backend. It was such a huge pain that I ended up writing a Win32 frontend instead. From the top of my head, I encountered the following problems:
- Development of the ODBC link seems to have ceased long ago. There are various different ver... |
I use most of ZTD (http://zenhabits.net/2007/11/zen-to-done-the-simple-productivity-e-book/). GTD is too sophisticated and to big for me.
Basically, I make lists of tasks. Every morning I select three which I really need to do that day. I work on them until they're done. I struggle not to get dragged to other things... |
Brian has a great list: I'd add "Always mark single argument constructors explicit (except in those rare cases you want automatic casting)." |
Armed with the knowledge of which tables to get (thanks Sten) and a bit of judicious editing, I have come up with a query which serves my needs:
SELECT SUBSTR(e.profile_option_name,1,30) PROFILE,
DECODE(a.level_id,10001,'Site',10002,'Application',10003,'Responsibility',10004,'User') L,
DECODE(a.level... |
You need to use :%s/,/^M/g
To get the ^M character, press Ctrl+V followed by ENTER |
[Clojure][1] is a Lisp-1 that is **compiled** on-the-fly to Java bytecode, leading to very good runtime performance. You can use Clojure, and cross-compile it to a .NET assembly using [IKVM][2]'s ikvmc. Of course, when used in .NET, Clojure happily generates .NET IL, leading to the same kind of compiled-code performa... |
The audio driver controls which mixer controls are available, and this will depend largely on the capabilities of the hardware.
If the Vista driver doesn't have certain controls, then it's likely to be a shortcoming of that driver and not of Vista.
(Please tell us which sound card/device you are using.)
It wou... |
Other than trying to convince management of the problems of this approach, you can look into the windows registry.
Basically, if WinHelp is registered, the following registry entries are present:
- HKEY_CLASSES_ROOT \ .hlp -> (Default) = hlpfile
- HKEY_CLASSES_ROOT \ hlpfile \ shell \ open \ command \ (Default... |
There also useful when you need several "constructors" with the same parameter type but with different behavior. |
How do I reference a diagram in a DSL T4 template? |
|visual-studio|diagram|dsl| |
Google's not coming to my rescue, here, and I just **know** this is the perfect place to ask.
I'm writing a custom DirectiveProcessor for a DSL and I want to be able to access a diagram from within my T4 template.
Within my DirectiveProcessor, I've loaded the domain model and my diagram using (wait for it...) Loa... |
Ok, so the main problem with the implementation is: how to make sure no signal is lost and avoid dead locks ?
In my experience, this is REALLY hard to achieve with condition variables and mutex, but easy with semaphores. It so happens that ruby implement an object called Queue (or SizedQueue) that should solve the p... |
If you can convert the source into valid XHTML/XML using something like [SgmlReader][1] or [HtmlTidy][2] then you could use XSLT. Simply create a XSL template for each site you wish to scrape.
[1]: http://wiki.developer.mindtouch.com/Community/SgmlReader
[2]: http://tidy.sourceforge.net/ |
The ExecutorService interface does not define a method to examine the number of worker threads in the pool, as this is an implementation detail
public int getPoolSize()
Returns the current number of threads in the pool.
Is available on the ThreadPoolExecutor class
<pre>
import java.util.concurrent.Li... |
Sounds like you might have to URL-encode it, rather than HTML-encode it. Not sure without the code sample though. The URL-encoded code for ampersand is '%26'. |
Simply put, Netbeans. You have to try it out. It's so good. It's much better than Eclipse with the CDT plugin. |
Just for completeness in this - if you're using Microsoft's nmake utility, you might not actually see the $(CFLAGS) macro used in the makefile because nmake has some defaults for things like compiling C/C++ files. Among others, the following are pre-defined in nmake (I'm not sure if GNU Make does anything like this), ... |
Merge XML documents |
|xml| |
I need to "merge" two XML documents, overwriting the overlapsed attributes and elements. For instance if I have **document1** |
I need to "merge" two XML documents, overwriting the overlapsed attributes and elements. For instance if I have **document1**:
<mapping>
<key value="assigned">
<a/>
</key>
<whatever attribute="x">
<k/>
<j/>
</key>
</mapping>
and *... |
I would create some kind of in memory thread safe lock. Each thread could wait on the lock until it was free. When the lock becomes free, take the lock and read the file for a defined length of time or a defined amount of data, then release the lock for any other waiting threads. |
IL level code debugger |
|.net|debugging|il| |
Is there any IL level debugger in form of a VS plugin or standalone application?
Visual studio’s debugger is great, but it allows you to debug on either HLL code level or asselbly language, you can’t debug IL.
It seems that in some situations it would be useful to have an opportunity to debug at IL level.
In pa... |
grep your project folder. It could be a hidden reference in your project, or a project that your project references. Cleanse with Notepad if needed. |
My approach tends to be to ensure I can completely validate on all pages, however I still send the page as text/html instead of application/xhtml+xml so there are no ugly XML errors in the event I have missed something. |
The best way to do this is to use ILDASM to disassemble the managed binary, which will generate the IL instructions. Then recompile that IL source code using ILASM, when you fire up the Visual Studio debugger you will be able to step through the raw IL.
1. ildasm foo.exe /OUT=foo.exe.il /SOURCE
2. ilasm foo.exe.il... |
Test Distribution |
|testing|distributedtesting|java|enterprise| |
At my work we are running a group of tests that consist of about 3,000 separate test cases. Previously we were running this entire test suite on one machine, which took about 24-72 hours to complete the entire test run. We now have created our own system for grouping and distributing the tests among about three separat... |
from: http://vim.wikia.com/wiki/Change_end-of-line_format_for_dos-mac-unix
[Esc] :%s/\r$// |
I would update all the columns with NULL values and set it to an empty string, for example, ''. Then you should be able to run your ALTER TABLE script with no problems. A lot less work than creating a new column. |
I'm not sure if that would solve the problem. IMHO the performance problem with cursors is around the amount of memory you use to keep the dataset resident and loop through it, if you then add a waitfor inside the loop you're hogging resources for longer.
But I may be wrong here, what I would suggest is to use perf... |
GWT is quite powerful and easy to use (all Java, no Javascript/HTML/CSS coding). If Google has their way it will be a dominant framework/tool in web applications development, and for good reason. It already works with Google Gears (which allows offline access to web apps) - and more than likely will be optimized to wor... |
Sharepoint UserProfileManager without Manage User Profiles right |
|c#|sharepoint| |
I have an issue that is driving me a bit nuts: Using a UserProfileManager as an non-authorized user.
The problem: The user does not have "Manage User Profiles" rights, but I still want to use the UserProfileManager. The idea of using SPSecurity.RunWithElevatedPrivileges does not seem to work, as the UserProfileManag... |
Maybe http://www.planetplanet.org/
will do what you want.
It's for creating blog aggregations like [planet lisp][1].
[1]: http://planet.lisp.org/ |
[JSON][1] is fairly compact, and supported by most frameworks. You can transfer data over HTTP using standard REST techniques.
There are JSON libraries for [Java][2], [Objective C][3], and [C#][1] (scroll down).
[1]: http://www.json.org/
[2]: http://www.json.org/java/
[3]: http://code.brautaset.org/JSON/ |
The equivalent of variant in C# is System.Object. So you might want to try to return the result cast to object and pick it back up on the other side as a variant.
VB doesn't have any facilities that C# lacks, so I doubt it would be better or easier if the .NET side was written in VB.
|
a) the manual -- extremely comprehensive, up-to-date and just a huge source for inspiration while problem-solving - stuck? browse/search the manual, it'll come to you
b) arrays - they're plastic, they're associatively indexed, they can be easily nested (!) to make up some wild data structures, and there's a multitud... |
[Disclaimer: *personally*, I prefer Vim. Disclaimer disclaimer: read on.]
Vim excels in the small: by making motion and action separate concepts and providing facilities for complex repeats, you can perform incredibly powerful editing operations in just a short sequence of keystrokes. You can easily do things in Vim... |
What is the purpose of:
while (usec >= 1000)
usec /= 10;
I gather that you want the most significant three digits of the usec; in that case, the most straightforward way I can think of is to divide usec by 1000, and be done with that.
Test cases:
- 999999 ⇒ 999
- 99999 ⇒ 999 (should be 099)
... |
I need to "merge" two XML documents, overwriting the overlapsed attributes and elements. For instance if I have **document1**:
<mapping>
<key value="assigned">
<a/>
</key>
<whatever attribute="x">
<k/>
<j/>
</key>
</mapping>
and *... |
What will definitely make your loop faster across a variety of browsers, especially IE browsers, is looping as follows:
for (var i = 0, iLength = imgs.length; i < iLength; i++)
{
// do something
}
You've put in an arbitrary 1000 into the loop condition, but you get my drift if you wanted to ... |
Visual Studio 2008 defaults this to F12, but you can set it in Tools | Options | Environment | Keyboard, and change Edit.GoToDefinition - however, I'm not sure how you can get it to CTRL+mouseclick. |
Here's an idea: assuming your main use case is getting a notification whenever an HTML file changes, why not use a standard diff tool and then loop through the changed lines, applying your rules?
Also, if this is a situation where you have access to the server and the files you're watching, you might be able to put... |
<a href="http://www.jetbrains.com/resharper/">Resharper</a> does that but it's not free.
Higly recomended plugin tho, most experienced developers use it |
re.pl from Devel::REPL |
In recent years it has been 'The C++ Standard Library' by 'Nicolai M. Josuttis'. It's my bible.
![alt text][1]
[1]: http://ecx.images-amazon.com/images/I/51BT5SKXTCL._SL500_AA240_.jpg |
I prefer creating a (static) Logger for each class (with it's explicit class name). I than use the logger as is. |
Sepia and PDE have also own REPLs (for GNU Emacs). |
Does new URL(...).openConnection() necessarily imply a POST? |
|java|http|url| |
If I create an HTTP java.net.URL and then call openConnection() on it, does it necessarily imply that an HTTP post is going to happen? I know that openStream() implies a GET. If so, how do you perform one of the other HTTP verbs without having to work with the raw socket layer? |
|java|testing|enterprise| |
Have you tried
sysmail_stop_sp
then
sysmail_start_sp
|
These are the example class files for different languages found in the MediaInfo.dll zip
* MediaInfoDLL.cs
* MediaInfoDLL.def
* MediaInfoDLL.h
* MediaInfoDLL.java
* MediaInfoDLL.jsl
* MediaInfoDLL.pas
* MediaInfoDLL.py
* MediaInfoDLL.vb
* MediaInfoDLL_Static.h
You do have to use interop and I don't know i... |
It's definitely a hack, but I post-process the autogen'd config.h file:
> sed -e 's/.*PACKAGE_.*//' < config.h > config.h.sed && mv config.h.sed config.h
This is tolerable in our build environment but I'd be interested in a cleaner way. |
It does seem a little strange that you see no difference across quite a wide range of windows versions and nothing between a single drive and hardware raid-5.
It's only 'gut feel', but that does make me doubtful that this is really a simple seeking problem. Other than the OS X and the Raid5, was all this tried o... |
If you do run a Linux server from home, install [ossec][1] on it for a nice lightweight IDS that works really well.
[1]: http://www.ossec.net/ |