instruction stringlengths 0 30k ⌀ |
|---|
Should be available to non-U.S. companies, easy to setup, reliable, cheap, customizable, etc. What are your experiences? |
As always, Google is your friend:
<http://nixbit.com/cat/programming/libraries/c-generic-library/>
specifically:
<http://nixbit.com/cat/programming/libraries/generic-data-structures-library/> |
Flash is certainly the most ubiquitous and portable solution. [98% of browsers][1] have Flash installed. Other alternatives are [Quicktime][2], [Windows Media Player][3], or even [Silverlight][4] (Microsoft's Flash competitor, which can be used to embed several video formats).
I would recommend using Flash (and it... |
Flash is usually the product of choice: Everyone has it, and using the [JW FLV Player][1] makes it relatively easy on your side.
As for other Video Formats, there are WMV and QuickTime, but the players are rather "heavy", not everyone might have them and they feel so 1990ish...
Real Player... Don't let me even st... |
What is a good web-based Grid that accepts Excel clipboard data? |
|excel|csv|clipboard|grid| |
Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept pasted Excel data and can emit Excel-compliant clipboard data during a Copy?
I believe Excel data is formatted as CSV during "normal" clipboard operations. |
The explicit cast to double in the first answer isn't necessary - identifying the constant as 5000.0 (or as 5000d) is sufficient. |
Binary Data in MYSQL |
|database|mysql| |
How do I store binary data in mysql? |
For a table like this:
CREATE TABLE binary_data (
id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY,
description CHAR(50),
bin_data LONGBLOB,
filename CHAR(50),
filesize CHAR(50),
filetype CHAR(50)
);
Here is a PHP example:
<?php
// store.php3 - by Florian Ditt... |
How to use the C socket API in C++ |
|c++|c|sockets|zos| |
I've been having issues getting the C sockets API to work properly in C++. Specifically, although I am including sys/socket.h, I still get compile time errors telling me that AF_INET is not defined. Am I missing something obvious, or could this be related to the fact that I'm doing this coding on z/OS and my problems a... |
There are no HTTP headers that will report the clients timezone so far although it has been suggested to include it in the HTTP specification.
If it was me, I would probably try to fetch the timezone using clientside JavaScript and then submit it to the server using Ajax or something. |
I've had no trouble using the BSD sockets API in C++, in GNU/Linux. Here's the sample program I used:
#include <sys/socket.h>
int
main()
{
return AF_INET;
}
So my take on this is that z/OS is probably the complicating factor here, however, because I've never used z/OS before... |
HTML 4.01. There is absolutely **no reason** to use XHTML for anything but experimental or academic problems that you only want to run on the 'obscure' web browsers.
XHTML Transitional is completely pointless even to _those_ browsers, so I'm not sure why anyone would aim for that. It's actually pretty alarming that ... |
When i worked in a small dev team (small meaning me, another programmer and the boss), it was quite the chaotic mess. However we found that Assigning a "gatekeeper" type of process worked for us.
The gatekeeper was the person who had done the most work on the app (in this case, i had 2 projects i developed from the... |
Best method for creating a "tree-view preferences dialog" type of interface in C#? |
|c#|gui| |
I'm writing an application that is basically just a preferences dialog much like the tree-view preferences dialog that Visual Studio itself uses. The function of the application is simply a pass-through for data from a serial device to a file. It performs many, many transformations on the data before writing it to the ... |
It depends on your application:
- for loop, if efficiency is a priority
- foreach loop or ForEach method, whichever communicates your intent more clearly
|
My only suggestion is to programmatically remove the dojoType on the server-side or client-side. It is not possible to keep the dojoType and not have it validate. Unless you create your own type that has you logic in it. |
I really like the rewritten Threading API from Java 1.6. Callables are great. They are basically threads with a return value. |
How do I generate ASCII codes 2 and 3 in a Bash command line? |
|linux|unix|bash|ascii| |
If I press ctrl-b that ought to give me ASCII code 2, but ctrl-c is going to be interpreted as a Break.
So I figure I've got to redirect a file in. How do I get these characters into a file? |
perl -e 'print "\xFF"', where FF is the hex code of the ACSII code you want to print. So for ACSII code 2, it would be \x02. |
@James
> I'm not even really clear why it needs the additional data, as you wouldn't call delete[] on the array anyway, so I don't entirely see why it needs to know how many items are in it.
After giving this some thought, I agree with you. There is no reason why placement new should need to store the number of el... |
static imports to "enhance" the language, so you can do nice literal things in type safe ways:
List<String> ls = List("a", "b", "c");
(can also do with maps, arrays, sets).
http://gleichmann.wordpress.com/2008/01/13/building-your-own-literals-in-java-lists-and-arrays/
Taking it further:
List<Map<Strin... |
static imports to "enhance" the language, so you can do nice literal things in type safe ways:
List<String> ls = List("a", "b", "c");
(can also do with maps, arrays, sets).
http://gleichmann.wordpress.com/2008/01/13/building-your-own-literals-in-java-lists-and-arrays/
Taking it further:
List<M... |
I dunno how he did it but [Tomas Restrepo has a Visual Studio theme that is able to italicize comments and string literals][1].
This one is in Visual Studio 2005, but the theme editing for both versions appear unchange so it might provide you with some clues as to how to do it on your own theme.
[1]: http://w... |
I dunno how he did it but [Tomas Restrepo has a Visual Studio theme that is able to italicize comments and string literals][1].
This one is in Visual Studio 2005, but the theme editing for both versions appear unchange so it might provide you with some clues as to how to do it on your own theme.
**Update:** I did... |
I second the OWASP info as being a valuable resource. The following may be of interest as well, notably the attack patterns:
- [CERT Top 10 Secure Coding Practices][1]
- [Common Attack Pattern Enumeration and Classification][2]
- [Attack Patterns][3]
- [Secure Programming for Linux and Unix][4]
- [A Ta... |
Does the button need to be black? you could apply the black background to the options instead. |
What versions of Visual Studio can be installed concurrently? |
|windows|visual-studio|microsoft| |
Are there any conflicts with having any combination of Visual Studio 2003, 2005 and/or 2008 installed? I noticed a related question [here][1] but wanted a more general answer.
[1]: http://stackoverflow.com/questions/9693/visual-studio-2005-macros-stop-working-when-visual-studio-2008-is-installed |
I have all 3 installed and have had no adverse problems...knocking on wood |
6, 2000/2001 (I can't remember which is .net 1.0), 2003, 2005, 2008... of course within .NET you may have issues with getting the right solution with the right version. I haven't really seen any conflicts in particular. |
How do I create an xml document in python |
|python|xml| |
It's my first time generating xml with python, and the python documentation, which is generally good, is really lacking for xml creation...here is my sample code:
<pre>
<code>
from xml.dom.minidom import *
def make_xml():
doc = Document();
node = doc.createElement('foo')
node.innerText = 'bar'
d... |
It's my first time generating xml with python, and the python documentation, which is generally good, is really lacking for xml creation...here is my sample code:
<pre>
<code>
from xml.dom.minidom import *
def make_xml():
doc = Document()
node = doc.createElement('foo')
node.innerText = 'bar'
do... |
I am building an open search add-on for Firefox/IE and the image needs to be Base64 Encoded so how can I base 64 encode the favicon I have?
I am only familiar with PHP |
You can do it in jQuery really simple, but I am not sure JS should be used for such things. The best way is to do it with pure css.
1. Take a look at [faux columns](http://www.alistapart.com/articles/fauxcolumns/) or even [Fluid Faux Columns](http://www.communitymx.com/content/article.cfm?cid=AFC58)
2. Also anoth... |
Google led me to [this][1] solution (base64_encode). Hope this helps!
[1]: http://fr.php.net/base64_encode |
There exists no platform-independent way that can be guaranteed to work in all jvm implementations.
ManagementFactory.getRuntimeMXBean().getName() looks like the best (closest) solution. It's short, and *probably* works in every implementation in wide use. |
As far as I remember there is an xml element for the image data. You can use this [website][1] to encode a file (use the upload field). Then just copy and paste the data to the XML element.
You could also use PHP to do this like so:
<?php
// Use appropriate function for your filetype
// - fi... |
Grid controls compatible with .NET and Mono? |
|c#|controls|mono|datagrid| |
Do you know any grid control compatible with .NET and Mono?
DataGridView seems to be quite buggy on Mono, and GTK# controls depends on GTK+ so you need to install it in windows machines where, usually, it's not present. |
What Types of testing are part of your build process? |
|testing|tfs|build-automation| |
I use TFS 2008. We run unit tests as part of our continuous integration build and integration tests nightly.
What other types of testing do you automate and include in your build process? what technologies do you use to do so?
I'd thinking about smoke tests, performance tests, load tests but don't know how re... |
What types of testing do you include in your build process? |
I use TFS 2008. We run unit tests as part of our continuous integration build and integration tests nightly.
What other types of testing do you automate and include in your build process? what technologies do you use to do so?
I'm thinking about smoke tests, performance tests, load tests but don't know how re... |
Analogy: If you build cars for a living (programming), then its very pertinent to know how the engine works (Win32). |
Is there a real benefit of using J#? |
|java|j#| |
I just saw a [comment of suggesting J#][1], and it made me wonder... is there a real, beneficial use of J# over Java? So, my feeling is that the only reason you would even consider using J# is that management has decreed that the company should jump on the Java bandwagon... and the .NET bandwagon. If you use J#, you ... |
J# is no longer included in VS2008. Unless you already have J# code, you should probably stay away.
From [j# product page:][1]
> Since customers have told us that the
> existing J# feature set largely meets
> their needs and usage of J# is
> declining, Microsoft is retiring the
> Visual J# product and Java La... |
Simple answer, YES. |
The whole purpose of J# is to ease the transition of Java developers to the .NET environment which didn't work so well (I guessing here) so Microsoft dropped J# from Visual Studio 2008.
For your question, "Is there a real benefit of using J#?"..
in a nutshell... No.. |
One of the killers I've found with J# in the past is that there is no built in support for referencing web services. That alone has been enough to deter me from it ever since. |
You can use an [OrderedDictionary][1].
> Represents a collection of key/value
> pairs that are accessible by the key
> or index.
[1]: http://msdn.microsoft.com/en-us/library/system.collections.specialized.ordereddictionary.aspx |
VirtualBox also has API's for automating their VM's. |
What has probably happened is that the object provided when rendering the user control is actually null. |
I still use Hungarian Notation when it comes to UI elements, where several UI elements are related to a particular object/value, e.g.,
lblFirstName for the label object, txtFirstName for the text box. I definitely can't name them both "FirstName" even if *that* is the concern/responsibility of both objects.
How d... |
Recently Raymond Chen also ran an interesting series of articles on the yield keyword.
- http://blogs.msdn.com/oldnewthing/archive/2008/08/12/8849519.aspx (part 1)
- http://blogs.msdn.com/oldnewthing/archive/2008/08/13/8854601.aspx (part 2)
- http://blogs.msdn.com/oldnewthing/archive/2008/08/14/8862242.aspx (part ... |
I'm using a slightly modified version of that plugin so I'm not 100% sure that this will be the same for you, but for me the default is to redirect to the root path, or the page you were trying to get to if there is one. (check your lib/authenticated_system.rb to see your default) If you don't have map.root defined i... |
I really like this program, which approximates pi by looking at its own area :-)
IOCCC 1998 : <a href="http://www0.us.ioccc.org/1988/westley.c">westley.c</a> |
Not sure if this is the same issue?
[JBoss DataSource config](http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configuration_Guide/Connectors_on_JBoss-Configuring_JDBC_DataSources.html)
> DataSource wrappers are not usable outside of the server VM |
Generally the user that you are using to run the SQL Server service will not have access to your personal user folders, that is why you're getting the error. You either need to change the credentials used for the service, or move the database to another folder, which did the trick in your case. |
The problem is your connection string. When using SQLExpress you can set it to run user instances so that each application has its own instance of SQL Server. Just set the option to false on your connections string and the problem should dissappear. |
Minimal Vista Virtual PC-image for Visual Studio-development |
|virtual-pc|windows-vista|visualstudio| |
Using nLite (or any other suggested tool), how small can you get your Windows Vista-image when you remove as many features and services as possible, without braking the environment for Visual Studio?
Which services and features are safe to remove? Maybe it's different for different VS-component?
----------
... |
|virtual-pc|windows-vista| |
Using nLite (or any other suggested tool), how small can you get your Windows Vista-image when you remove as many features and services as possible, without braking the environment for Visual Studio?
Having a couple of 12-18 GB images on the hard-drive doesn't feel too good.
Which services and features are safe t... |
Both 3 and 3.5 still use the [Common Language Runtime of .NET Framework 2.0][1]. So no control panel is needed, as you can still use the 2.0 control panel.
[1]: http://en.wikipedia.org/wiki/Microsoft_.NET#.NET_Framework_3.0 |
The .NET Framework versions 3.0 and 3.5 have been built incrementally on the .NET Framework version 2.0. This version can be used to manage code access security policy for the .NET Framework 3.0, 3.5, and later versions as well. |
A few cons:
- 2 points of failure
- Application logic will have to take into account the delay between writing something and then reading it, since it won't be available immediately from the secondary database
A strategy I have used is to send key reporting data to a secondary database nightly, de-normalizin... |
I would honestly recommend using one of the many libraries available for Ajax. I use [prototype][1] myself, while others prefer [jQuery][2]. I like prototype because it's pretty minimal. The [Prototype Ajax tutorial][3] explains it well. It also allows you to handle errors easily.
new Ajax.Request('/some_url',... |
You can seal individual methods to prevent them from being overridable:
public sealed override void Render()
{
// Prepare the object for rendering
SpecialRender();
// Do some cleanup
}
|
In B, do
protected override sealed void Render() { ... } |
I didn't know about Enumerable.SequenceEqual method (you learn something every day....), but I was going to suggest using an extension method; something like this:
public static bool IsEqual(this List<int> InternalList, List<int> ExternalList)
{
if (InternalList.Count != ExternalList.Co... |
I'm sure this could be of some great help for you :
[deployqt](http://labs.trolltech.com/blogs/2007/08/23/deploying-mac-applications-without-the-hassle/)
Hope this helps ! |
I understand you will serve only static files. In this case, lightweight HTTP servers will give you a higher performance for a given machine. The following are well known:
- [Lighttpd][1]
- [Thttpd][2]
- [Nginx][3]
Many more are listed on [Wikipedia][4]. There's a more recent [article][5] on IBM Developer... |
How can I reverse engineer a DirectShow graph? |
|video|directx|directshow|mpeg| |
I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine.
Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder ... |
What is the best way to connect and use a sqlite database fron C# |
|c#|sqlite| |
I've done this before in C++ by including sqlite.h but is there a similarly easy way in C#? |
What is the best way to connect and use a sqlite database from C# |
You mentioned that you're using NHibernate - are you closing your NHibernate sessions at appropriate points (such as the end of each iteration?)
If not, then the size of the object map loaded into memory will be gradually increasing over time, and each session flush will take increasingly more CPU time.
|
You can declare a "table variable" in SQL Server 2005, like this:
declare @foo table (
Id int,
Name varchar(100)
);
You then refer to it just like a variable:
select * from @foo f
join bar b on b.Id = f.Id
No need to drop it - it goes away when the variable goes out o... |
The syntax you want is:
create table #tablename
The # prefix identifies the table as a temporary table. |