instruction stringlengths 0 30k ⌀ |
|---|
The exact answers have already been given, however I do feel I should add this warning:
This might be one of those situations where _if you have to ask, you can't afford it_.
So if you find yourself approaching the limits posted earlier, think long and hard about what you are trying to do, and make sure you're no... |
Why does sed fail with International characters and how to fix? |
|linux|sed|character|international| |
GNU sed version 4.1.5 seems to fail with International chars. Here is my input file:
Gras Och Stenar Trad - From Moja to Minneapolis DVD [G2007DVD] 7812 | X
<br>
Gras Och Stenar Trad - From Möja to Minneapolis DVD [G2007DVD] 7812 | Y
(Note the umlaut in second line.)
And when I do
sed 's/.*| //' < in
I... |
Microsoft has an [official set of Guidelines][1] for getting the "Designed for Windows Mobile" logo. These are a reasonable start as they not only cover one-handed (no touchscreen) operation, they also help your app to maintain familiarity for users.
Some other resources discussing the topic:
- The [WinMo team... |
I do serious work using the Express editions. I'm not a professional programmer since I moved into management, but I still keep my hand in writing the occasional utility or web page. The only thing I've missed from the professional versions is remote web debugging. |
Chapter 6.3 in the book Deploying Rails Applications (A Step by Step Guide) has a good section on installing and configuring the Monitoring utility Monit on Linux and using it to monitor your mongrels. It can restart your mongrels when they fail.
Older versions of Mongrel had trouble re-starting because of a duplica... |
Chapter 6.3 in the book Deploying Rails Applications (A Step by Step Guide) has a good section on installing and configuring the Monitoring utility Monit on Linux and using it to monitor your mongrels. It can restart your mongrels when they fail.
Older versions of Mongrel had trouble re-starting because of a duplica... |
I don't think there is as `Dictionary<>` itself isn't XML serializable, when I had need to send a dictionary object via a web service I ended up wrapping the `Dictionary<>` object myself and adding support for `IXMLSerializable`.
/// <summary>
/// Represents an XML serializable collection of keys and values... |
Unfortunately this is because the WebBrowser control is a wrapper around the Internet Explorer COM control. This means that it gets its own HWND and does not allow WPF to draw anything over it. It has the same restrictions as hosting any other Win32 or WinForms control in WPF.
[MSDN][1] has more information about ... |
I have to go with the tables approach here. The reason for this comes simply down to cost. Until a well supported CSS-centric approach to layout comes out, and I am talking about at the macro level...not micro within containers, trying to shoehorn CSS positioning into a generalized approach to layout is inefficient. ... |
Or to see all constaints use SYS.DBA_CONSTRAINTS (If you have the privileges)
|
Is there a Functional Programming library for C# .NET? |
|c#|.net|functional-programming| |
For example, in Java there is [Functional Java](http://functionaljava.org/) and [Higher-Order Java](http://www.cs.chalmers.se/~bringert/hoj/). Both essentially give a small API for manipulating higher-order, curried functions, and perhaps a few new data types (tuples, immutable lists). |
Home key go to start of line in Visual Studio? |
|visual|studio|home|navigation|key| |
Where is the option in Visual Studio to make the Home key go to the start of the line?
Right now you have to do
Home, Home
or
Home, Ctrl+Left Arrow
i'd prefer that home goes to the start of the line. i saw it before, but now i cannot find it. |
|visual-studio|navigation|key|home| |
The key seems to be in the question.
'**Managing** feature creep'... you do this by implementing a management process that needs to be followed. You can't avoid it (after all, it's frequently the customers requesting it and shouting no at them all the time tends to drive the poor creatures away)... but that doesn't ... |
I use this metadata library: http://www.drewnoakes.com/code/exif/
Seems to work pretty well, although bear in mind that not all JPEG images have this information, so it can't be 100% fool-proof.
If the EXIF metadata doesn't contain the created date, then you'll probably have to make do with Java's lastUpdated - u... |
In Tools/Customize/Keyboard, Reassign the "Home" key from Edit.LineStart" to "Edit.LineFirstColumn" |
For every class that you use this with, you're going to have to look up the Logger anyway, so you might as well just use a static Logger in those classes.
private static final Logger logger = Logger.getLogger(MyClass.class.getName());
Then you just reference that logger when you need to do your log messages. ... |
I think you want [F#][1]
Also, the more recent versions of C# have a lot of functional concepts included in the base langauge.
[1]: http://research.microsoft.com/fsharp/fsharp.aspx |
One solution is to append a query string with a timestamp in it to the URL when fetching the resource. This takes advantage of the fact that a browser will not cache resources fetched from URLs with query strings in them.
You probably don't want the browser not to cache these resources at all though; it's more likel... |
From time to time am I working in a completely disconnected environment with a Macbook Pro. For testing purposes I need to run a local DNS server in a VMWare session. I've configured the lookup system to use the DNS server (/etc/resolve.conf and through the network configuration panel, which is using configd underneath... |
nvarchar with preprocessing to standardize them as much as possible. You'll probably want to extract extensions and store them in another field. |
This is a bit of a Unix vs Linux battle. Most if not all Linux distributions have bash installed and ksh optional. Most Unix systems, like Solaris, AIX and HPUX have ksh as default.
Personally I always use ksh, I love the vi completion and I pretty much use Solaris for everything. |
I use the command line as a console:
$ perl -e 'print "JAPH\n"'
Then I can use my **bash** history to get back old commands. This does not preserve state, however.
|
I use the command line as a console:
$ perl -e 'print "JAPH\n"'
Then I can use my _bash_ history to get back old commands. This does not preserve state, however.
This form is most useful when you want to test "one little thing" (like when answering Perl questions). Often, I find these commands get scrape... |
Normalise the data then store as a varchar. Normalising could be tricky.
That should be a one-time hit. Then as a new record comes in, you're comparing it to normalised data. Should be very fast. |
If by .rsrc file you mean a standard Mac resource file, you can use the [Resource Manager][1] to save the image in a file of the appropriate format.
[1]: http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-9.html#HEADING9-0
|
This explains it better than I can: http://blogs.msdn.com/andreww/archive/2006/02/21/536179.aspx
Given the fact that the license for VSTA comes with InfoPath, I'd probably run with that. |
It's <a href="http://wiki.openid.net/Relying_Party_Best_Practices#Many-to-one_relationship_between_Identity_URLs_and_.22user_accounts.22">an OpenID relying party best practice</a> to allow multiple OpenIDs to be associated with a single account.
It's also <a href="http://wiki.openid.net/Relying_Party_Best_Practices#... |
Short answer: No, they're different.
Long answer: It's the same sort of certificate and it uses the same crypto software, but the certificate has flags indicating what it is allowed to be used for. Code signing and web server are different uses. |
I wrote up a [fairly complete answer][1] to this elsewhere, with code showing how to do it. A summary:
1. You probably don't want to do this. Using `git describe` is a reasonable alternative.
2. If you do need to do this, `$Id$` and `$Format$` are fairly easy.
3. Anything more advanced will require using `gitat... |
This assembly function (based off my previous post here, but I had to modify the concept a bit to get it to actually work) processes 3.3 billion input characters per second (6.6 billion output characters) on one core of a Core 2 Conroe 3Ghz. Penryn is probably faster.
%include "x86inc.asm"
SECTION_RODATA... |
Best technology for developing an app that runs on DESKTOP and in BROWSER? |
|c++|distributed|client| |
Microsoft WPF? Adobe AIR/Flex? Adobe Flash? Curl programming language?
How does AJAX fit in?
Given a server written in C++ .NET. |
I would recommend to use RoutedEvent instead of your IsBusy property. Just fire OnBusyStarted and OnBusyStopped event and use Event trigger on the appropriate elements.
|
I believe your problem is that in VBA string indexes start at 1 and not at 0. Try the following:
For iter = 1 To Len(cell_val)
If Asc(Mid(cell_val, iter, 1)) > 127 Then
addlog "Export contains ascii character > 127"
End If
Next |
I'd say that generally every fundamentalism leads to hell.
You certainly wouldn't want to end up with exception driven flow, but avoiding exceptions altogether is also a bad idea. You have to find a balance between both approaches. What I would not do is to create an exception type for every exceptional situation. ... |
Did you debug it? ;) Are you sure the cell_val is not empty? Also you don't need the 'Step 1' in the For loop since it's default. Also what do you expect to acomplish with your code? It logs if any ascii values are above 127? But that's it - there is no branching depending on the result? |
You could use 'vi' and then the following command:
:16224,16482w!/tmp/some-file
Alternatively:
cat file | head -n 16482 | tail -n 258 |
What's wrong with foreign keys? |
|database|database-design| |
I remember hearing Joel mention in the podcast that he'd barely ever used a foreign key (if I remember correctly). However, to me they seem pretty vital to avoid duplication and subsequent data integrity problems throughout your database.
Do people have some solid reasons as to why (to avoid a discussion in lines wi... |
|database|database-design| |
I remember hearing Joel mention in the podcast that he'd barely ever used a foreign key (if I remember correctly). However, to me they seem pretty vital to avoid duplication and subsequent data integrity problems throughout your database.
Do people have some solid reasons as to why (to avoid a discussion in lines wi... |
sed -n 16224,16482p filename > newfile
|
# print section of file based on line numbers
sed -n '16224 ,16482p' # method 1
sed '16224,16482!d' # method 2
|
It should be noted that without [further hacks][1] position fixed does not work for IE6, which is still managing to hold on to 15-30% of the market, depending on your site.
[1]: http://www.howtocreate.co.uk/fixedPosition.html |
You can use the Linq to objects Enumerable.Reverse() function in .net 2.0 using [LinqBridge][1].
[1]: http://www.albahari.com/nutshell/linqbridge.html |
Although for some layouts using tables may seem simpler at first, when maintenance time comes using css pays off. Especially if you ever want to change the position of something, or if you want to use the same layout in several places.
IMHO, tables should be used only when presenting tables. Never for layout purpose... |
Your best bet is probably to grab a good c book (K&R: The C Progranmming language) a cup of tea and start translating! I would be skeptical about trusting a translation program, more often then not the best translator is yourself! If you do this one, then its done and you don't need to keep re-doing it. There might be ... |
I'm probably missing the obvious here, but wouldn't a varchar just long enough for your longest expected phone number work well?
If I *am* missing something obvious, I'd love it if someone would point it out... |
Remove columns from DataTable in C# |
|c#|asp.net| |
I have a DataSet which I get a DataTable from that I am being passed back from a function call. It has 15-20 columns, however I only want 10 columns of the data.
Is there a way to remove those columns that I don't want, copy the DataTable to another that has only the columns defined that I want or is it just better ... |
varchar with length restriction. |
How to make a web app appear at the root of the site? |
|mod-rewrite|.htaccess|punbb| |
I have a bulletin board (punBB based) that I was running out of the root directory for a couple of years. I foolishly decided to do a little gardening and in the process moved the punbb code into it's own subdirectory. The code works great; as long as you point the browser at the new subdirectory. The issue is that... |
JMX, The MXBeans (ThreadMXBean, etc) provided will give you Memory and CPU usages. |
I would use a varchar(22). Big enough to hold a north american phone number with extension. You would want to strip out all the nasty '(', ')', '-' characters, or just parse them all into one uniform format.
Alex |
The standard `CTRL-N` and `CTRL-P` work even better if you add the following to your ~/.vim/ftplugin/perl.vim file:
> set iskeyword+=:
It will then auto-complete module names, etc. |
Try your commands in doublequotes, like so:
ssh remotehost "command" 2>~/stderr
Tested on my local system using a nonexistant file on the remote host.
$ ssh remotehost "tail x;head x" 2>~/stderr
$ cat stderr
tail: cannot open `x' for reading: No such file or directory
head: cannot open ... |
I'm currently using the CuTest unit test framework:
[http://cutest.sourceforge.net/][1]
It's ideal for embedded systems as it's very lightweight and simple. I had no problems getting it to work on the target platform as well as on the desktop. In addition to writing the unit tests, all that's required is:
... |
Certainly replication is possible, as is [Sync Services][1] if you're not afraid to get your hands dirty. It depends on the details of what you need:
- Sometimes-connected application wanting to have a read-only cache: Sync Services
- Sometimes-connected application wanting to have part or full update ability: ... |
Try this download: [Creating and Customizing TFS Reports][1], it includes a few samples and some guidance. [More here][2].
Also try the [TFS Reporting Samples.zip][3] linked from this site.
This site links to a large number of TFS reporting resources:
http://blogs.msdn.com/teams_wit_tools/archive/2007/03/26/tfs... |
One thing to keep in mind about using the same **TDataSet** between multiple threads is you can only read the current record at any given time. So if you are reading the record in one thread and then the other thread calls **Next** then you are in trouble. |
Instead of trying to figure out how many functions were called, and in what order, find a set of inputs that can only produce an expected output if you call things in the right order. |
You could use ACE (or similar) debug frameworks, and in your test, configure the debug object to stream to a file. Then you just need to check the file. |
How do I make a component in Joomla display as an article? |
|joomla|article|components|mailto| |
More specifically I am trying to make the mailto component show within my template; the same way as an article does.
By default the mailto component opens in a new window. So far I changed the code so it opens on the same window, but that way the whole template is gone.
Any suggestions? |
A weird "solution" for complaints on long response time is to have a more interesting progress bar. Meaning, work on the user's feeling. One example is the Vista wait icon. That fast rotating circle, gives the feeling things are going faster. Google uses the same trick on Android (at least the version I've seen).
Ho... |
To answer the original question, there is no way to compile FLAs without using the Flash IDEs.
The only partial solution to to use a command line script that automates opening Flash Authoring and compiling the FLA. You can find one such example here:
<http://www.mikechambers.com/blog/2004/02/20/flashcommand-flas... |
Every industry expert I've heard on podcasts, blogs and interviews recommend learning **Silverlight first** and then gradually moving to WPF which is a huge UI framework.
Silverlight is light and allows you to work on smaller subset of controls and features such that you get your head around this new UI building pa... |
Every industry expert I've heard on podcasts, blogs and interviews recommend learning **Silverlight first** and then gradually moving to WPF which is a huge UI framework.
Silverlight is light and allows you to work on smaller subset of controls and features such that you get your head around this new UI building pa... |
You can try something like this. Note, I believe 3 is EXECUTE.
SELECT
grantee_principal.name AS [Grantee],
CASE grantee_principal.type WHEN 'R' THEN 3 WHEN 'A' THEN 4 ELSE 2 END - CASE 'database' WHEN 'database' THEN 0 ELSE 2 END AS [GranteeType]
FROM
sys.all_objects AS sp
INNER JOIN s... |
Passing hierarchy into a Verilog module |
|verilog| |
I have a "watcher" module that is currently using global hierarchies inside it. I need to instantiate a second instance of this with a second global hierarchy.
Currently:
module watcher;
wire sig = `HIER.sig;
wire bar = `HIER.foo.bar;
...
endmodule
watcher w; // instantiation
De... |
|windows|windows-vista|uac|cmd|shortcut| |
It looks like you're asking about 1.5 merge tracking. Here's a quick overview for doing merges to/from trunk (or another branch): <http://blog.red-bean.com/sussman/?p=92>
|
<code><pre>
$('#message').load('index.php?pg=ajaxFlashcard', null, showResponse);
showLoad();
function showResponse() {
hideLoad();
...
}
</pre></code>
http://docs.jquery.com/Ajax/load#urldatacallback
|
Just point it at an aspx file and have that file spit out whatever javascript you need. I did this recently with TinyMCE in PHP and it worked like a charm.
external_link_list_url : "example_link_list.aspx"
In your aspx file:
<pre><%@ Page Language="C#" AutoEventWireup="false" CodeFile="Default.aspx.cs" Inh... |
I think this will work in Java (untried):
enum A{B.values()}
enum B{A.values()}
Should overflow in static initialization before it even gets the chance to fail due to a lack of main(String[]). |
Check out this link as it helped me install the tools in one of my vms. [http://diamondsw.dyndns.org/Home/Et_Cetera/Entries/2008/4/25_Linux_2.6.24_and_VMWare.html][1]
[1]: http://diamondsw.dyndns.org/Home/Et_Cetera/Entries/2008/4/25_Linux_2.6.24_and_VMWare.html |
You could also try looking at [gmail for domains][1]. It's what I use and so far I haven't had a problem withany spam filters. Also make sure that you are not writing the content of the message to where a spam filter could flag it as spam. There's some guides on the net somewhere. I found out that by removing the word ... |
Should I use EJB3 or Spring for my business layer? |
|java|performance|spring|scalability|ejb-3.0| |
My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interface the client and server.
We've reache... |
I wouldnt call it bad practice (some would disagree, but why did they give us that option in the first place?), but I would say that you'll improve overall readability and maintainability if you do not submit to this practice. You already conveyed out a good point, and that is IDE feature limitation (i.e., design time ... |
I believe you are correct in your assumption. It has been my experience that the only difference is that published files are compiled. [Visual Studio® 2008 Web Deployment Projects][1] is a nice enhancement for customizing your build scripts for both your Websites and Web Applications.
[1]: http://www.microsoft.c... |
You don't specify one thing: What binding are you exposing your service as? If you're using WsHttpBinding or BasicHttpBinding, then there's no simple "http post" you can do, because you need to include at the very least the entire SOAP envelope (with the right SOAP version and potentially security headers and so forth)... |
JScript debugging |
|javascript| |