input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Java - Statistics Symbols <p>What's the best way to insert statistics symbols in a <code>JLabel</code>'s text? For example, the x-bar? I tried assigning the text field the following with no success:</p>
<pre><code><html>x&#772;
</code></pre>
<p>Thanks.</p>
| <p>Html codes will not work in Java. However, you can use the unicode escape in Java <code>Strings</code>.</p>
<p>For example:</p>
<pre><code>JLabel label = new JLabel(new String("\u0304"));
</code></pre>
<p>Also, here is a <a href="http://www.snible.org/java2/uni2java.html" rel="nofollow">cool website</a> for taki... |
UIWindow and UIView addSubview Question <p>Does the addSubview method actually load the view into the application or not? The reason I am asking is because I have two two views in my application. The application delegate adds the two views as subviews and then brings one of the views up front. Now, I have a print state... | <p>viewDidLoad is actually a method of UIViewController, not UIView. It gets called after the view gets loaded into memory (after your init method, but before the awakeFromNib). You'll notice that addSubview: takes a UIView as a parameter, so the view must have been loaded in order for the view to be added to another... |
Undefined reference error for template method <p>This has been driving me mad for the past hour and a half. I know it's a small thing but cannot find what's wrong (the fact that it's a rainy Friday afternoon, of course, does not help).</p>
<p>I have defined the following class that will hold configuration parameters r... | <p>Templated code implementation should never be in a <code>.cpp</code> file: your compiler has to see them at the same time as it sees the code that calls them (unless you use <a href="http://www.cplusplus.com/articles/1C75fSEw/">explicit instantiation</a> to generate the templated object code, but even then <code>.cp... |
How to prevent HTTP GET for ASP.NET events? or How to check for Request.Type on all events? <p>With the help of fiddler, I did this "replay attack" with the following HTTP GET request</p>
<p><a href="http://svr/Default.aspx" rel="nofollow">http://svr/Default.aspx</a>?<strong>__EVENTTARGET=LinkButton1</strong>&__EV... | <p>You can yes. Attach to application's <a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplication.prerequesthandlerexecute.aspx" rel="nofollow">PreRequestHandlerExecute</a> event. Do it either as a separate <code>HttpModule</code> or in <code>Global.asax</code>.</p>
<p>In event hadler you can either ... |
Cheaper alternative to VS Team Foundation Server <p>Is there a fairly inexpensive source control product on the market that integrates into Visual Studio 2008+ and that has the power and capabilities of Visual Studio 2008 Team Foundation Server?</p>
<p>I have used Dynamsoft, SourceGear, Subversion and Platic SCM and r... | <p>Subversion with Tortoise SVN</p>
<p>Here is an <a href="http://www.west-wind.com/presentations/subversion/#Subversion%5Fand%5FVisual%5FStudio" rel="nofollow">article by Rick Strahl</a> on setting everything up.</p>
<p>I used svn at my last job, and tfs at my current one. I can't say I really like having to deal w... |
How can I tell if a Windows module handle is still valid? <p>A module can be unloaded, so how can I tell for sure if it is still in memory? I have a handle to it, obtained from GetModuleHandle. When I tried calling GetHandleInformation on it I see error 0xc0000008 - "An invalid HANDLE was specified." This happened b... | <p>The term "handle" is a bit overloaded here - lots of different classes of objects in the Win32 API are called "Handles".</p>
<p>GetHandleInformation is used for handles to kernel objects - files, registry keys, mutexes, etc.</p>
<p>The HMODULE returned by GetModuleHandle is used by the loader and is not an actual ... |
TFS as time report and ticketing system <p>So far, I've been using TFS only as task management, but never as an time report nor ticketing system. I've been using third party software for each. I want to use more out of TFS if possible to include these reports too.</p>
<p>Is TFS able to handle ticketing system good? <b... | <p>First of all, any of the work items can be customized. Secondly, in many cases, someone probably has done so already.</p>
<p>I would think it would be good for this. Consider that it already has the ability to have a bug filed against software; have it assigned to a developer; and to record when it's fixed. The Bug... |
IE7 DIV does not stretch with content inside it <p>I'm having an issue with IE7. In IE6, Firefox and other browsers, the DIV containing the content stretches vertically depending on how much content is in it. In IE7 however, the DIV only stretches to the absolute minimum height of the page then it stops... it even cuts... | <p>This might be the same issue, along with tweaks (a couple iterations, so scan the whole thread) to achieve the result you want:</p>
<p><a href="http://www.dreamincode.net/forums/showtopic38765.htm" rel="nofollow">Div Height:100% Messes Up In IE 7</a></p>
|
Best way to handle a typical precondition exception? <p>Which of the following ways of handling this precondition is more desirable and what are the greater implications?</p>
<p>1: </p>
<pre><code>If Not Exists(File) Then
ThrowException
Exit
End If
File.Open
...work on file...
</code></pre>
<p>2:</p>
<pre... | <p>I prefer the first variant so it <strong>better documents</strong> that there are <strong>preconditions</strong></p>
|
Multiple Firefox Versions on Same PC <p>I develop various web apps, use CSS and JavaScript extensively, and need to be able to test them on both FF 3 as well as FF 3.5.</p>
<p>But, installing 3.5 overwrites 3.0, so I was wondering if its possible (and if so, how) to run both Firefox 3.0 and 3.5 on the same system, or ... | <p>Yes. Download and install them in seperate directories. Then, launch each one individually with the -p flag to set up different profiles for each version (or at least one for testing). Then, after you have two seperate profiles, create an icon for each on your desktop. Right click on the icon and select properti... |
How to handle screen orientation change when progress dialog and background thread active? <p>My program does some network activity in a background thread. Before starting, it pops up a progress dialog. The dialog is dismissed on the handler. This all works fine, except when screen orientation changes while the dialog ... | <p><strong>Edit:</strong> Google engineers do not recommend this approach, as described by Dianne Hackborn (a.k.a. <a href="http://stackoverflow.com/users/236398/hackbod">hackbod</a>) in this <a href="http://stackoverflow.com/q/5335665/844882"><strong>StackOverflow post</strong></a>. Check out <a href="http://www.andro... |
.htaccess rewrite of a url [help with rule] <p>I'm trying to rewrite a url of this:
<a href="http://www.foo.com/bar/baz" rel="nofollow">http://www.foo.com/bar/baz</a></p>
<p>to</p>
<p>index.php?q=$1&d=baz</p>
<p>Where bar is not a fixed value, but baz is.</p>
<pre><code> RewriteRule ^(.*)\/baz$ index.php?q=$1... | <p>Conditions only apply to the first rule immediately following. So try duplicating the condition lines.</p>
<pre><code>RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/details index.php?q=$1&details=true [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_F... |
Free plotting control for WinForms? <p>I want to display dots and functions in my dotnet app. Can you recommend a good free plotting control for WinForms?</p>
| <p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=130F7986-BF49-4FE5-9CA8-910AE6EA442C&displaylang=en" rel="nofollow">MicrosoftChartControls</a> is a free and easy to use library.</p>
|
Using Flickr API + CURL to get image URL & Caption <p>How can I make a simple CURL request to that Flickr API that does the following:</p>
<p><strong>Get the X number of most recent photos URLs + captions from collection Y?</strong></p>
<p>Where "X" is the number of photo URLs and "Y" is the collection name.</p>
<p>... | <p>what is the problem of using a <a href="http://phpflickr.com/" rel="nofollow">already tested PHP api</a>, you probably will need care about lot of stuff as authentication, size, etc. doing that by your own</p>
<h2>Edit:</h2>
<p>I will put some simple code using curl. hope helps you. I grabbed the idea from <a href... |
My table cells don't highlight immediately when touched <p>In my app, I have a table view that has about eight cells. There is a navigation bar at the top. When a user touches a cell, nothing happens for about 1/2 second. Then the touched cell highlights blue and immediately the new view slides into position.</p>
<p>T... | <p>are you using a custom-drawn cell (with a drawRect override) or something like that? </p>
<p>if you have a custom drawRect method, you'll need to do something like this (based off the code for tweetie, found <a href="http://blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/" rel="nofollow">here</a... |
Removing obsolete WebProxy.GetDefaultProxy() references <p>I have a bit of code which is annoying me because it is generating obsolete warnings, but I am wary of removing it because:</p>
<p>a) It works</p>
<p>b) I didn't write it </p>
<p>c) I don't currently have a means of testing it. (ie I don't have access to a m... | <p>Yes I <em>think</em> you are right.</p>
<p>A good way to test this is with <a href="http://www.fiddler2.com/fiddler2/" rel="nofollow">Fiddler</a> because one of the things it does (apart from trace http requests) is to automatically set itself up as your IE proxy.</p>
<p>If you run the Fiddler and then the followi... |
How to run function of parent window when child window closes? <p>I have asked this question before and the problem was half solved in the sense I was helped to find out that Javascript has some tough security in place.</p>
<p><strong>What I learnt</strong>: A parent Window opens a child window. The child window redir... | <p>Try this:</p>
<pre><code>var win = window.open(url, name);
win.onunload = afterChildClose; // afterChildClose() is the function.
win.close(); // afterChildClose() should fire now.
</code></pre>
<p>All this code would be located and executed in the parent window's javascript (including afterChildClose()). You are ... |
Anchored control runs off the form by itself <p>I have a control I built with several input controls on it, some text boxes, a combo box and a list box among other things. One text box, a combo box, a list box and a couple of command buttons are anchored so that they resize with the form. The combo box is anchored to t... | <p>Are you sure your misbehaving control isn't parented by something you aren't expecting, like a Panel or something? </p>
|
GIT diff GUI <p>I have a rather large diff of 2 GIT branches and would like to open them in some sort of nice UI side by side.
Something that shows me the diff's easily, and hopefully that I can merge differences
one by one.
git diff is rather hard to work with.</p>
| <p>The answer is <a href="http://www.kernel.org/pub/software/scm/git/docs/git-difftool.html">git difftool</a> (at least for git version 1.6.3 and later). Please remember that it just invokes configured or automatically found graphical diff tool.</p>
|
Saving Large file using GWT + GAE + S3 path <p>I'm building app that will store large video files to the server and then user will be able to view them. For my app I'm using GWT + GAE/J and to store files I would like to use S3 account. But as we know that you can upload max 10mb to GAE. I have <a href="http://stackove... | <p>Why not have your GWT client upload the video directly to S3? You can have your app engine code create the authentication token or password or whatever S3 calls it, and then your GWT client would send the file straight there. If need be, it could pass back whatever meta data that your app engine code needs.(file s... |
Out of dynamic memory in yy_create_buffer() <p>Has anyone seen this error when working with a PHP application "out of dynamic memory in yy_create_buffer()"?</p>
<p>The error message that appears in the php error log is:
Fatal error: out of dynamic memory in yy_create_buffer() in Unknown on line 0</p>
<p>I have not be... | <p>set </p>
<p>memory_limit to -1</p>
<p>in your php.ini, for a workaround</p>
<p>or update your php version</p>
<p>should solve the problem</p>
|
How do you map mac fonts to Windows fonts <p>I need to display a file that comes from a mac on a Windows machine.</p>
<p>The font name in the mac file is "Helvetica". </p>
<p>Windows does not have Helvetica but it has "Arial" which is the close. However, if I pass "Helvetica" to a WPF control the font family is ignor... | <p>They are actually different fonts, though the difference is subtle. Talk to any obsessed graphic designer and he or she will probably start ranting about Arial's inferiority. Hell, they even made a movie out of it.</p>
<p><a href="http://www.helveticafilm.com/" rel="nofollow">http://www.helveticafilm.com/</a></p>... |
Best use of Google code wiki for project documentation <p>I've recently moved my project from sourceforge to Google code. I'm intrigued by the Google code wiki that is integrated with svn, but I'm not sure of the best way to use it to provide project documentation.</p>
<p>For my project, documentation could appear in... | <p>The Wiki files live in Subversion -- just <code>svn checkout <a href="http://yourproject.googlecode.com/svn/wiki" rel="nofollow">http://yourproject.googlecode.com/svn/wiki</a> yourwiki</code> and you get a <code>yourwiki</code> SVN repository that's easy to keep updated (just <code>svn up</code> in it once in a whil... |
Use a wrapper class around an object in flex / actionscript <p>Main Goal : Select a school listed in the first datagrid, and display all the student records /details of that school in the next datagrid. But, since datagrid is editable and requirement mentions : "Use a Wrapper class around the object to get the data, se... | <p>Looks like you're really just starting out with Flex.</p>
<p>Suggestion: read the documentation. There's plenty of examples of the basic thing you're trying to do here which is to have an editable Grid that displays data coming from the server.</p>
<p>Some key concepts:</p>
<p>Make sure you're using an ArrayColle... |
Trouble restarting exe <p>I need to restart the program that im working on after an update has been downloaded except im running into some issues.</p>
<p>If i use CreateProcess nothing happens, if i use ShellExecute i get an 0xC0150002 error and if i use ShellExecute with the command "runas" it works fine. I can start... | <p>CreateProcess() is an arcane beast. I remember unfondly my first frustrations with it. You should look at the <a href="http://msdn.microsoft.com/en-us/library/ms682512%28VS.85%29.aspx" rel="nofollow">Microsoft CreateProcess Example</a> and the <a href="http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.asp... |
how do start/stop services using net stop command in c# <p>how do start/stop services using net stop command in c#
for example</p>
<pre><code>Dim pstart As New ProcessStartInfo
Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.System)
Dim p As New Process
pstart.FileName = path + "\cmd.exe"
psta... | <p>Instead of using a crude method like Process.Start, you can use the <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller%28VS.80%29.aspx">ServiceController</a> class to start/stop a particular service on a local/remote machine.</p>
<pre><code>using System.ServiceProcess;
ServiceC... |
Post Commit Hook with Trac and SVN <p>So I am having a few problems with settings this up. Let me explain.</p>
<p>I have three files in my d:\svn\hooks file (D:\ is not windows drive)</p>
<p>post-commit.bat<br>
trac-post-commit-hook.cmd<br>
trac-post-commit-hook<br></p>
<p><strong>I have setup the post-commit.bat fi... | <p>You might want to check this answer to see if it helps you solve your problem:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/84178/how-do-i-implement-the-post-commit-hook-with-trac-svn-in-a-windows-environment/110241#110241">http://stackoverflow.com/questions/84178/how-do-i-implement-the-post-commit-hook... |
List of installed fonts OS X / C <p>I'm trying to programatically get a list of installed fonts in C or Python. I need to be able to do this on OS X, does anyone know how?</p>
| <p>Python with PyObjC installed (which is the case for Mac OS X 10.5+, so this code will work without having to install anything):</p>
<pre><code>import Cocoa
manager = Cocoa.NSFontManager.sharedFontManager()
font_families = list(manager.availableFontFamilies())
</code></pre>
<p>(based on <a href="#1113072">htw's ans... |
CSS Problem in FireFox 3.5 <p>I am developing an ASP.NET project with C#, and I wrote a page named gs.aspx which just writes resources like JS and CSS to the response according to the request and i's query strings. I have the header like this:</p>
<pre><code><head runat="server">
<title></title>
... | <p>I corrected that, it was because of the ContentType, I changed the ContentType from <code>text/html</code> to <code>text/css</code> and all was correct, but any other things should I know about this approach?</p>
|
js browser detection for IE <p>My question is the folowing</p>
<p>Is there a solid javascript code to detect if a browser is IE(I don't care about others)</p>
<p>I found <a href="http://www.quirksmode.org/js/detect.html" rel="nofollow">some script</a>, but it generates an undefined error in FF.</p>
<p><strong><em>I ... | <p>You can find <a href="http://www.positioniseverything.net/articles/cc-plus.html" rel="nofollow">here</a> very useful technique for IE detection using conditional tags.</p>
<pre><code><!DOCTYPE your favorite doc type>
<html>
<head>...</head>
<body>
<... |
Need advice on selecting a clustered index for a logging table <p>I use SQL Server 2005. I have a simple logging table that my web application uses to track user activities and urls visited.
The table design is very simple </p>
<p>ID (identity value),</p>
<p>LogDate (datetime),</p>
<p>Activity (nvarchar(200)),</p>
... | <p>Yes, your reasoning is correct, provided the rate of inserts is much less than the granularity of <code>datetime</code> (<a href="http://msdn.microsoft.com/en-us/library/ms187819%28SQL.90%29.aspx" rel="nofollow">3.33ms</a>)</p>
<p>SQL Server 2008 has a new datatype, <code>DATETIME2</code>, with higher precision (10... |
Dynamic typing and return values in Objective-C <p>I have run into a very strange behaviour I canât make sense of. I have a <code>Texture</code> class with <code>contentWidth</code> property of type <code>int</code>. This class is wrapped in a <code>Image</code> class that has a <code>width</code> property of type <c... | <p>Oh well. If you are interested in why this situation happens, see the Objective-C Programming Guide, chapter 8, <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocStaticBehavior.html#//apple%5Fref/doc/uid/TP30001163-CH16-TPXREF161">Return and Argument Types</a>:</p>
<blockquote... |
Gathering iPhone 3g status <p>There is a sample code of apple named "reachability" which tells us the network status of the device, wifi or edge/gprs, but I couldn't see any documentation or sample code regarding gathering if the device is on 3g or not while accessing to internet. I also googled, but no hope. Is it pos... | <p>According to Apple representatives, this is not currently possible. See <a href="https://devforums.apple.com/message/94640#94640" rel="nofollow">this message</a> on the Apple forums (registration as an iPhone developer required).</p>
|
Unusual Bug in iPhone Application <p>In my hello world application, i have a button and a text field set up. You enter your name in the text field then press the button, then you're supposed to see "Hello, [name]!". However all i get is "Hello, World!" (the default for when there's no string in the text box), even when... | <p>Double-check your connections in Interface Builder. If <code>textField</code> isn't connected properly, then your method won't be able to read the <code>text</code> property of the field right, which may lead to its having a length of 0.</p>
|
UILabel problem <p>I have two UIViewController classes in my project... Each Viewcontroller has uilabel...
When i click my firstviewcontroller button, i send data to secondviewcontroller and display that data into secondviewcontroller label....But nothing is displayed on the second label.</p>
<p>Can anyone help me?</p... | <p>To display information on a <code>UILabel</code> control you need to set its text property to some string:</p>
<pre><code>NSString *myText = @"Hello";
myLabel.text = myText;
</code></pre>
|
SQL Server 2000 dropping indexes <p>Can anybody know how to remove all the indexes from database ?</p>
| <p>Using this query will create you a list of DROP statements which you can then execute:</p>
<pre><code>SELECT
'DROP INDEX ' + ix.name + ' ON ' + OBJECT_NAME(ID)
FROM
sysindexes ix
WHERE
ix.Name IS NOT null
</code></pre>
<p>That should be pretty fast and take care of dropping all indices :-)</p>
<p... |
CodeIgniter Database Connection Issue <p>I'm using CodeIgniter, and I'm not able to use my database with it. I'm following this <a href="http://www.phpeveryday.com/articles/CodeIgniter-Preparing-Database-P162.html" rel="nofollow">tutorial</a> exactly, but when I open in localhost I receive a 404 page. </p>
| <p>You need to set up your application/config/database.</p>
<p>Here you need to add your information for your database.</p>
<pre><code>$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "yourdbusername";
$db['default']['password'] = "password_for_... |
Application crashing during string related operations in multi threaded and multiprocessor environment <p>The application is developed in VC++ 6.0. When this is run in a multithreaded and multiprocessor environment along with its dependent services one of the dependent services crashes when attempting some string opera... | <p>This is normal when an application that was not developed or tested for a multithreaded environment is suddenly placed into a multithreaded envirohment.</p>
<p>In fact, this is s simple matter of violating assumptions. The code was no doubt written on the assumption that only a single thread at a time would execute... |
PHP for .NET <p>I know there are implementations of Python and of Perl for .NET. Have you ever heard of any similar plans for PHP?</p>
| <p>I recall there's something called <a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=Phalanger">Phalanger</a> which runs PHP on .NET</p>
|
How to create a GPS application on Mobile phone? <p>For a GPS application, </p>
<p>1) If say the GPS application is used inside a building, I would like to know how to define or create the map ourself ? Usually the map is provided by the vendor and the map is showing the roads(big scale) if compare to inside a buildin... | <p>A GPS doesn't work inside a building. <br>
But this is perhaps a place to start if you want to work with gps and windows mobile.</p>
<p>"<a href="http://www.codeproject.com/KB/windows/FindMe.aspx" rel="nofollow">GPS Tracking with Windows Mobile 5.0+</a>"</p>
|
Another C pointer Question <p>The following code : </p>
<pre><code>int *a;
*a = 5;
</code></pre>
<p>will most likely result in a segmentation fault and I know why.</p>
<p>The following code : </p>
<pre><code>int a;
*a = 5;
</code></pre>
<p>won't even compile.
(gcc says : invalid type argument of unary *).</p>
<p>... | <p>A pointer is <em>not</em> an integer. C has data types to</p>
<p>a) prevent certain programming errors, and</p>
<p>b) improve portability of programs</p>
<p>On some systems, pointers may not be integers, because they really consist of two integers (segment and offset). On other systems, the "int" type cannot be u... |
C malloc : inexplicable memory usage <p>When I compile and run the following code :(using gcc on cygwin) </p>
<pre><code>int *a = malloc(1024*1024*100*sizeof(int));
while(1)
;
</code></pre>
<p>The task manager in Windows XP shows
memory usage by this process as 2232K,
which according to me should have been around 400... | <p>You have allocated the memory, making it available, but have not yet used it (reading or writing from/to it). The memory manager may not have actually allocated the physical memory to your program yet, merely said that you can have it. If you write something across the memory you just allocated (e.g. filling it wi... |
PHP Remove URL from string <p>If I have a string that contains a url (for examples sake, we'll call it $url) such as;</p>
<pre><code>$url = "Here is a funny site http://www.tunyurl.com/34934";
</code></pre>
<p>How do i remove the URL from the string?
Difficulty is, urls might also show up without the http://, such as... | <p>I re-read the question, here is a function that would work as intended:</p>
<pre><code>function cleaner($url) {
$U = explode(' ',$url);
$W =array();
foreach ($U as $k => $u) {
if (stristr($u,'http') || (count(explode('.',$u)) > 1)) {
unset($U[$k]);
return cleaner( implode(' ',$U));
... |
TeX: string parsing and whitespace stripping <p>In T<sub>E</sub>X, how is it possible to split a string such as <code>\mana{X1 2W/UB R /G}</code> into parts and to feed them to another macro (in this case, to replace the macro invocation by something like <code>\m{X}\m{12}\m{W/U}\m{B}\m{R/G}</code>), grouping by very s... | <pre><code>\def\m#1{\par$m$({\tt #1})}% Any macros
\def\removespaces{\catcode`\ =9 }% Ignore all spaces`
\let\manaNext\relax % aux def
\let\manaLastChar\relax % aux def
\newtoks\manaToks % aux toks
\newif\ifDigitProcessing
\def\mana#{\afterassignment \manaA \let\next= }% always next = {
\def\manaA{\bgroup \removespac... |
Placing elements into the UITableView footer, when to release them? <pre><code>- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
AViewController * aView = [[AViewController alloc] initWithNibName:@"myNib" bundle:[NSBundle mainBundle]];
return vintagePriceRowView.view... | <p>For efficiency's sake, you should create the view that you'll be using in the footer before it's required. Maybe create it in viewDidLoad in your tableViewController and store it in a member variable.</p>
<p>Then in your viewForFooter method simply return the view you stored earlier.</p>
<p>Then in your tableViewC... |
Java - Working with Date/Time in J2ME <ol>
<li><p>How to extract time portion from a Date-object and use it as a String in J2ME?</p></li>
<li><p>How to convert that time-string back to Date - object in J2ME?</p></li>
</ol>
<p>I have done something to achieve this, but it is not showing correct-time.</p>
| <p>I use the following <strong>code to get time</strong>:</p>
<pre><code>String getDateString(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MO... |
Live video streaming from an IP camera <p>I have around 10 Bosch IP cameras. I need to allow users to see live (around 10 fps) view from the selected cameras. The users will be in a local network. Connecting directly to the camera is not an option, because around 100 users may watch image from one camera. </p>
<p>I ca... | <p>I had a similar need and I used this web site <a href="http://www.Streamby.com" rel="nofollow">www.Streamby.com</a> to just get my 2 IP camera re-streamed.
This way you avoid any computer and encoder. You have to register your cameras to get a flash version stream of it on their site. I think you can also request t... |
Global variables in Objective-C <p>In Actionscript you can have global variables like this:</p>
<pre><code>var number : Number = 15;
</code></pre>
<p>And then use it in a method/function. How do you do that in Objective-c, is it possible?</p>
| <p>Remember that Objective-C is a strict superset of C, so you can declare global variables the same way you would in regular C. First declare them in some file outside of any function, then use the C <code>extern</code> keyword in other files to pull those variables in.</p>
<p>If you want to do this with more than ju... |
Secure static html files using IIS7 in integrated mode and using custom httphandler <p>My asp.net application is not using formsauthentication. Instead we make a call to database, check username//password and save the value in session if user is logged in.</p>
<p>Now i need to secure my html files. I put IIS7 in integ... | <p>Are you actually including the code to write the HTML file in your handler?</p>
<p>A handler is the end point for a request - a request <strong>stops</strong> there. If your handler does nothing but a redirect then it's working as you coded it. You must add the code to read the HTML file and serve it.</p>
<p>In my... |
Is it possible to pass a variable out of a pdb session into the original interactive session? <p>I am using pdb to examine a script having called <code>run -d</code> in an ipython session.
It would be useful to be able to plot some of the variables but I need them in the main ipython environment in order to do that. <... | <p>Per ipython's <a href="http://ipython.scipy.org/moin/Documentation" rel="nofollow">docs</a>, and also a <code>run?</code> command from the ipython prompt,</p>
<blockquote>
<p>after execution, the IPython
interactive namespace gets
updated with all variables defined in the program (except for <code>__name_... |
SQL Statement will not execute in C#? <p>Hey Guys, here is my code for this, the only help i get from VS is that the INSERT INTO statement syntax is incorrect?</p>
<p>I have gone through all of the code and just cannot see where i have gone wrong, can someone gimme a hand please?</p>
<pre><code> public void Ne... | <p>You seem to be using Access - aren't Month and Year reserved words? Try enclosing them in square brackets (is this the correct delimiter for Access?) and trying again.</p>
|
Is it possible to automatically generate Xcode projects? <p>Simple question. Are there any tools for generating Xcode projects from the command line? We use SCons to build our cross-platform application, but that doesn't support intrinsic Xcode project generation. We'd like to avoid creating the project manually, since... | <p>Look at <a href="http://www.cmake.org/" rel="nofollow">CMake</a>. You can generate XCode projects from it automatically. I found a previous StackOverflow question about its usage <a href="http://stackoverflow.com/questions/751837/cmake-xcode-and-unix-makefile">here</a>. To get it to generate an XCode project, you us... |
Best practice creating LINQ-to-SQL classes to deal with the same entity present in 10 different data sources? <p>I was wondering what would be the best way to create <strong>LINQ-to-SQL</strong> classes to deal with a given entity which is present in 10 different data sources. Let's say I've got the same database in 10... | <p>Well, if they truly are the same, I would just go with Option 3 -- use a different connection string when connecting to each of the data sources. </p>
|
How to solve this iGoogle-gadget issue? <p>I want make an 'iGoogle gadgets' that changes the search box on the igoogle page.<br />
Here is my code so far:</p>
<pre><code><script type="text/javascript">
function bing(){
document.getElementById('sfrm').action="http://www.bing.com/search";
}
</script>
<i... | <p>I have a feeling that Google probably designed iGoogle to prevent modifying that stuff...</p>
|
Android Screen Timeout <p>I know its possible to use a wakelock to hold the screen, cpu, ect on but how can I programmatically change the "<strong>Screen Timeout</strong>" setting on an Android phone.</p>
| <pre><code>public class HelloWorld extends Activity
{
private static final int DELAY = 3000;
int defTimeOut = 0;
@Override
protected void onCreate(Bundle savedInstanceState)
{
// Be sure to call the super class.
super.onCreate(savedInstanceState);
// See assets/res/any/la... |
When should I break into GUI/game development? <p>I am a hobbyist console C++ developer. I have worked with pointers, arrays, std::vectors, std::strings, classes, and several data structures, including stacks and binary trees. I have some experience in linear algebra and geometry, and know the basics of physics. I do N... | <p>Caveat: I am a very "learn-by-doing" type of person, so take this with a grain of salt.</p>
<p>Sounds like you know enough programming basics to jump into something more realistic, and have enough background to justify that realistic project being a game.</p>
<p>I'd recommend downloading <a href="http://www.micros... |
Add values of a function to listbox when click on checkbox? <p>I have two checkboxes and one listbox. I assign functions to
both checkboxes. I want to add the items when I click on
checkboxes. I'm working on C#. I tried the following code.
It's working but overwrites the value when I click on
another check box.</p>
<p... | <p>Are you trying to add data from a method to a listbox when the checked state of some checkboxes changes? You will need the appropriate wire-ups in InitializeComponent, but that can be done through the designer.</p>
<pre><code>using System;
using System.Windows.Forms;
namespace CheckBox
{
public partial class ... |
Using generics for arrays <p>Is it possible to use generics for arrays?</p>
| <p>Arrays are already basic objects types, that is to say they're not a class that describes a collection of other objects like ArrayList or HashMap.</p>
<p>You cannot have an array of generified types either. The following is illegal in Java:</p>
<pre><code>List<String>[] lists = new List<String>[ 10 ];
... |
Iphone, objective-c how to make a Jump method for a platformer <p>I have this IBAction that is suppose to make a character onscreen jump, however when its called it just moves the character up once, then each call after that the character just moves down more and more. This function should just be called then the char... | <p>You are fundamentally designing this wrong. You want it to be that pressing the "jump" button sets some sort of flag, and then in your game engine code, process that flag.</p>
|
Trim all chars off file name after first "_" <p>I'd like to trim these purchase order file names (a few examples below) so that everything after the first "_" is omitted.</p>
<p>INCOLOR_fc06_NEW.pdf
Keep: INCOLOR (write this to db as the VendorID) Remove: _fc08_NEW.pdf</p>
<p>NORTHSTAR_sc09.xls
Keep: NORTHSTAR (wri... | <pre><code>String s = "INCOLOR_fc06_NEW.pdf";
int index = s.IndexOf("_");
return index >= 0 ? s.Substring(0,index) : s;
</code></pre>
|
Xcode question: Quickly jump to a particular selector/class/symbol? <p>What is the quickest way to jump to a particular symbol/selector/class in Xcode? (I'm looking for keyboard shortcuts preferably).</p>
<p>Right now, I know two ways of doing this:</p>
<ul>
<li>âOpen Quicklyâ > Click on the Symbols dropdown menu... | <p>In Xcode 3.2, the "Open Quickly" command (Shift-Control-D) lets you type in selectors and class names as well as file names. This would at least get you close to what you wanted.</p>
<p>Your idea about using the "Symbols" drop-down also works. You can use the keystroke Control-2 to bring up the Symbols drop-down me... |
Serializing a generic collection with XMLSerializer in VB.NET <p>Why won't XMLSerializer process my generic list?</p>
<pre><code>Sub Main()
Serializing()
End Sub
<System.Serializable()> _
Public Class User
Public Sub New()
End Sub
Public Sub New(ByVal Username As String, ByVal UserId As Integer... | <p>The problem is that you have included the class User inside of the Module Module1. The error message indicates the accessibility of this module is not public. Hence the actual accessibility of User is not public either since it is nested within the Module.</p>
<p>Change the definition of your outer Module to be Pu... |
Using Yahoo Fire Eagle on Grails / Java <p>Has anyone implemented the Yahoo Fire Eagle API in a Java / Grails application? How did you do it?</p>
<p>I want to poll their REST web service with my Grails application. Yahoo offers some API Kits for various programming languages such as PHP, Ruby, etc. Unfortunately, ther... | <p>Check out <a href="http://code.google.com/p/oauth-signpost/" rel="nofollow">Signpost</a> and the Fire Eagle discussions in the Google group. That should get you started.</p>
|
How to share code & xib files between iPhone apps? <p>I'm in the process of creating an app. I'd like to have a pared down free version and a full paid version. Obviously, they will share a lot of code and some xib files. How to I share these without just duplicating them?</p>
| <p>Create a second target (duplicate the main one) for the light version. You can then remove any files as necessary and define a preprocessor macro if necessary to distinguish between code for the lite vs paid version within a given code file.</p>
|
WiX: Installing Service as LocalService <p>I am trying to get my application an installer via WiX 3.0. The exact code is:</p>
<p></p>
<pre><code><File Id="ServiceComponentMain" Name="$(var.myProgramService.TargetFileName)" Source="$(var.myProgramService.TargetPath)" DiskId="1" Vital="yes"/>
<!-- service wil... | <p>Have you tried ...</p>
<pre><code>NT AUTHORITY\LocalService
</code></pre>
<p>Per this <a href="http://msdn.microsoft.com/en-us/library/ms684188%28VS.85%29.aspx">doc</a> ...</p>
<blockquote>
<p>... but the name of the account must be NT
AUTHORITY\LocalService when you call
CreateService, regardless of the
... |
Software Design Implementation - Issue/Module/Bug/Feature Tracking Solution <p>The company is growing and we're starting to implement more and more complex software designs. I feel a need for some tracking software... I just don't know if it exists. </p>
<p>I currently maintain a Google Doc Folder (shared by our 3 dev... | <p>Take a look at <a href="http://www.fogcreek.com/FogBugz/" rel="nofollow">fogbugz</a>. It looks like it meets all your requirements.</p>
<p>Also, take a look at this other SO question: <a href="http://stackoverflow.com/questions/86394/free-cheap-task-bug-management-software/86722#86722">Free/Cheap Task/Bug Managem... |
How to get user input in Clojure? <p>I'm currently learning clojure, but I was wondering how to get and store user input in a clojure program. I was looking at the clojure api and I found a function called read-line, however I'm not sure how to use it if it's the right function to use...</p>
<p>Anyhow, how do you get... | <p><a href="http://clojuredocs.org/clojure_core/clojure.core/read-line"><code>read-line</code></a> is the correct function..</p>
<pre><code>(println (read-line))
</code></pre>
<p>..would basically echo the users input:</p>
<pre><code>Clojure 1.0.0-
user=> (println (read-line))
this is my input
this is my input
</... |
Documentation on RubyVM::InstructionSequence? <p>With Ruby 1.9, the YARV-VM was merged into Ruby. So <a href="http://www.atdot.net/yarv" rel="nofollow">http://www.atdot.net/yarv</a> seems to be outdated.</p>
<p>Where can I find documentation on <code>RubyVM::InstructionSequence</code>?
Especially on <code>#compile_fil... | <p>The documentation for that part of YARV is rather poor. I'm not sure whether that is because the only developer who truly understands it doesn't speak English or whether it is deliberate, because that part of YARV still is in heavy development.</p>
<p>Your best bet is to use the source, ask questions on the ruby-co... |
Which is the best C++ compiler? <p>Can a C++ compiler produce a not so good binary? You can think here of the output's robustness and performance. Is there such a thing as the "best" C++ compiler to use? If not, what are the strong points, and of course, the not-so-strong (known Bugs and Issues) points, of the well-kno... | <p>G++ seems to be the most popular. It's free, portable and quite good. The Windows port (MinGW) was really dated the last time I used it (maybe one year ago).</p>
<p>The Intel C++ compiler is considered as the one which generates the fastest code (however it's known that it generates bad SIMD code for AMD processors... |
Nhibernate Icriteria Enum flags (BitMask) support <p>[Flags]</p>
<pre><code>public enum ShowProductOn : short
{
HomePage = 1,
SalesPage = 2,
NewsLetter = 4
};
</code></pre>
<p>Valid values for this enum:</p>
<p>1 - HomePage</p>
<p>2 - SalesPage</p>
<p>3 - HomePage, SalesPage</p>
<p>4 - NewsLetter... | <p>this might be useful.</p>
<p><a href="http://stackoverflow.com/questions/2805661/how-to-query-flags-stored-as-enum-in-nhibernate/2806876#2806876">http://stackoverflow.com/questions/2805661/how-to-query-flags-stored-as-enum-in-nhibernate/2806876#2806876</a></p>
|
How can I rewrite query parameters to path parameters in Apache? <p>I currently have a website that I am trying to optimize in terms of SEO.</p>
<p>I've got the site working with URLs such as:</p>
<blockquote>
<p>domain.com/?app=about</p>
</blockquote>
<p>In my app, <code>$_GET[app]</code> is set to 'about', as ex... | <p>These are known as <code>RewriteRule</code>s, and they are fairly straightforward:</p>
<pre><code>RewriteEngine on
RewriteRule ^about$ /index.php?app=about
</code></pre>
<p><a href="http://httpd.apache.org/docs/2.0/mod/mod%5Frewrite.html" rel="nofollow">Here's the documentation</a></p>
<p>As far as making it more... |
JavaScript, stop additional event listeners <p>Imagine I have this code:</p>
<pre><code>var myFunc1 = function(event) {
alert(1);
}
var myFunc2 = function(event) {
alert(2);
}
element.addEventListener('click', myFunc1);
element.addEventListener('click', myFunc2);
</code></pre>
<p>When the click event is fire... | <p>There's a further problem: the order that event listeners are executed is undefined. You'll need to handle event dispatch on your own to get around this, which leads us to some variant of llimllib's suggestion.</p>
<pre><code>function dispatchSleightEvent(evt) {
var listeners = evt.currentTarget.sleightListener... |
Zoom levels in kml files on google maps <p>When I add GMarkers to a google map I can specifiy the min and max zoom levels at which the marker should be displayed using MarkerManager. Is there a way to specifiy this for Placemarks in kml files when they're displayed in Google Maps?</p>
<p>It looks like the region tag i... | <p>Google Maps only supports a limited subset of KML:
<a href="http://code.google.com/apis/kml/documentation/mapsSupport.html" rel="nofollow">Google Maps KML support</a></p>
|
Persisting complex configuration to a file (PHP) <p>I have a fairly large MVC PHP web app (custom, no framework) that uses a several-hundred-line XML file for configuration. The config data has a fairly complex structure, which is very elegantly represented in XML but not so easily read or written using the DOM. All re... | <p>Have you considered <a href="http://www.sqlite.org" rel="nofollow">SQLite</a>?</p>
<p>It is a lightweight standalone database that is essentially a file. The database can be used locally or remotely. If you are able to persist your configuration to a file it should also be possible to persist to a SQLite database.<... |
MOUSE_OUT events not firing on child when parent is mouseEnabled=false, mouseChildren=false <p>I make a sprite, then add a child sprite.</p>
<p>I add a listener to the child for MOUSE_OUT events.</p>
<p>If my mouse is in the child sprite when I set the parent sprite mouseEnabled=false and mouseChildren=false, MOUSE_O... | <p>there must be something wrong with your code ... i have a minimum setup here:</p>
<pre><code>package {
import flash.display.*;
import flash.events.*;
import flash.geom.ColorTransform;
public class Test extends Sprite {
private var child:Sprite
public function Test() {
this.addChild(... |
There is any way to run processes in the background? <p>There is any command line or .NET method that runs a process in the background hiding any window it tries to open?</p>
<p>Already tried:</p>
<pre><code> var process = new Process()
{
StartInfo = new ProcessStartInfo()
{
CreateNoWindow = tr... | <p>I reviewed my code and it looks nearly identical to yours:</p>
<pre><code>ProcessStartInfo psi = new ProcessStartInfo(fileName, arguments)
{
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
RedirectStandardOutput = true ... |
Getting data from the $.getJSON() method <p>I'm writing a web application and need to initialize some parameters that I'm pulling via the $.getJSON() method. </p>
<pre><code>$.getJSON("../config/", function(data)
{
console.debug(data);
}
</code></pre>
<p>Now since these values will be used globally throughout th... | <p>Your best bet is to stick with the callback technique. </p>
<p>There are 2 real ways to make it work, both are essentially the same.</p>
<pre><code>$.getJSON("../config/", function(data) {
SomeObject.config = data;
SomeObject.load(); # assuming load tells some-object that it now has data and to ... |
Saving a Single int into NSdefaults <p>I've been searching around for tutorials on how to save certain things to NSuserdefaults but have only found stuff mostly dealing with arrays and strings. Can anyone lead me to or give some person knowledge about saving and loading a int. For my application I have my int highScore... | <pre><code>int highScore = 0;
// write
[[NSUserDefaults standardUserDefaults] setInteger:highScore forKey:@"someKey"];
// read
highScore = [[NSUserDefaults standardUserDefaults] integerForKey:@"someKey"];
</code></pre>
|
casting Object array to Integer array error <p>What's wrong with the following code?</p>
<pre><code>Object[] a = new Object[1];
Integer b=1;
a[0]=b;
Integer[] c = (Integer[]) a;
</code></pre>
<p>The code has the following error at the last line :
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Ob... | <p>Ross, you can use Arrays.copyof() or Arrays.copyOfRange() too.</p>
<pre><code>Integer[] integerArray = Arrays.copyOf(a, a.length, Integer[].class);
Integer[] integerArray = Arrays.copyOfRange(a, 0, a.length, Integer[].class);
</code></pre>
<p>Here the reason to hitting an <code>ClassCastException</code> is you can... |
How to add a class to DOM element in JavaScript? <p>How to add a class for the <code>div</code>?</p>
<pre><code>var new_row = document.createElement('div');
</code></pre>
| <pre><code>new_row.className = "aClassName";
</code></pre>
<p>Heres more info on MDN: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/className">className</a></p>
|
Static methods and thread safety <p>In python with all this idea of "Everything is an object" where is thread-safety?</p>
<p>I am developing django website with wsgi. Also it would work in linux, and as I know they use effective process management, so we could not think about thread-safety alot. I am not doubt in how ... | <p>Functions in a module are equivalent to static methods in a class. The issue of thread safety arises when multiple threads may be modifying shared data, or even one thread may be modifying such data while others are reading it; it's best avoided by making data be owned by ONE module (accessed via Queue.Queue from ot... |
What changed in the DataGrid that means it won't work anymore? <p>I have a Silverlight app with a DataGrid containing some custom columns and all was working well. Then I updated to Silverlight 3 tools for VS 2008 SP1 and rebuilt it. Now it has the following problems:</p>
<ol>
<li><p>Rows aren't added when the collect... | <p>I had the exact same issue on some of my code. It was wortking well when I was doing </p>
<pre><code>ObservableCollection<MyType> typedObservableCollection = stuff;
myDataGrid.ItemsSource = typedObservableCollection;
</code></pre>
<p>but not when I was doing </p>
<pre><code>ObservableObjectCollection observ... |
Can javax.persistence.Query.getResultList() return null? <p>And if so, under what circumstances?</p>
<p>Javadoc and JPA spec says nothing. </p>
| <p>You are right. JPA specification says nothing about it. But <strong>Java Persistence with Hibernate book, 2nd edition</strong>, says:</p>
<blockquote>
<p>If the query result is empty, a null is returned</p>
</blockquote>
<p>Hibernate JPA implementation (Entity Manager) return null when you call query.getResultLi... |
How to join the two columns that are in separate tables in the third table <p>Please help in solving the following query,</p>
<pre><code>(
f.CURS_AMT, c.C_NAME, s.SID FROM COURSE_FEE_DTL f
JOIN COURSE_MASTER c ON f.C_CODE = c.C_CODE
JOIN STUDEDNT_MASTER s ON s. C_NAME = c.C_NAME
)
</code></... | <p>I would guess this is really the full query you need;</p>
<pre><code> SELECT f.CURS_AMT, c.C_NAME, s.SID
FROM COURSE_FEE_DTL f
JOIN COURSE_MASTER c ON f.C_CODE = c.C_CODE
JOIN STUDENT_MASTER s ON s.C_NAME = c.C_NAME
</code></pre>
<p>There was no SELECT to begin the query, the mistype @nickd pointed out an... |
Drawing Flame Fractals <p>I am looking for information on how to draw flame fractals from googling around I could not find much, either pages explain how to use third party tools or way too complicated for me to grasp. Anyone know how/why they work? or point me in the direction of not overly complicated implementations... | <p>You could read the <a href="http://flam3.com/flame.pdf">original paper</a> by Scott Draves, which details precisely how and why they work, as well as a guide to an implementation in pseudocode.</p>
<p>As long as you have some basic knowledge of maths, it should be relatively straightforward to understand (though it... |
ASP.NET open new IE window and run "find" programatically? <p>Can I use Internet explorer's "find" to find a number (and go to the first result) in a webpage after I open a new IE window through ASP.NET?</p>
<p>Edit : Maybe I should clarify, I am opening a page on a site that is not mine, I cannot embed and run javasc... | <p>Not ASP or IE-specific: most sites use highlighting only, which you could also do on the client side using jQuery, like with the <a href="http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html" rel="nofollow">Text Highlight plugin</a>.</p>
<p>You would then be m... |
Memory-efficient C++ strings (interning, ropes, copy-on-write, etc) <p>My application is having memory problems, including copying lots of strings about, using the same strings as keys in lots of hashtables, etc. I'm looking for a base class for my strings that makes this very efficient.</p>
<p>I'm hoping for:</p>
<u... | <blockquote>
<p>copy-on-write (I think this comes for free in nearly all std::string implementations)</p>
</blockquote>
<p>I don't believe this is the case any longer. Copy-on-write causes problems when you modify the strings through iterators: in particular, this either causes unwanted results (i.e. no copy, and bo... |
Embedding Videos - Various Questions <p>I'm developing a website that will host some videos. The client wants control over the videos, so it will be hosted on the same server as the website. I need to know two things:</p>
<ol>
<li>What is the best video format to use for this purpose? I.e. what is the best compromise ... | <p>probably flv format is one of the most used on the internet because it only requires flash ( which a lot of people have ) for the end user to watch the video, and for that you may use JW flv Media player
<a href="http://www.longtailvideo.com/players/jw-flv-player/" rel="nofollow">http://www.longtailvideo.com/players... |
Calling Marshal.GetHRForException in a partial trust environment (SecurityPermission) <p>I have some IO code that reads a stream within a try..catch. It catches IOException and calls <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.gethrforexception.aspx" rel="nofollow">System.Ru... | <p>The method required is <a href="http://msdn.microsoft.com/en-us/library/system.security.permissions.securitypermission.isunrestricted.aspx" rel="nofollow">SecurityPermission.IsUnrestricted()</a>. It returns a true or false indicating whether the permission is allowed or not. It does not <em>demand</em> a permissi... |
HTML: target="_blank" for a drop-down list <p><strong>Problem:</strong> to open a new window with the select -option</p>
<pre><code><form onsubmit="return handleSubmit()" target="_blank" method="get" name="moduleForm" id="moduleForm">
<font size=2 face = verdana color= #0000ff ><b>Search</b><... | <p>You can open your links by window.open() : </p>
<pre><code><select name="allSelect" id="allSelect">
<optgroup label="Historical">
<option value="http://www.something.com/cse?cx=0000000000000&sa=Search&q=">Open in a new window 1</option>
<option value="http://www.google.com/cse?cx=... |
What is Javascript missing? <p>Javascript is an incredible language and libraries like jQuery make it almost too easy to use.</p>
<p>What should the original designers of Javascript have included in the language, or what should we be pressuring them into adding to future versions?</p>
<p>Things I'd like to see:-</p>
... | <p>One thing I've always longed for and ached for is some <strong>support for hashing</strong>. Specifically, let me track metadata about an object <em>without needing to add an expando property on that object</em>. </p>
<p>Java provides <strong><code>Object.getHashCode()</code></strong> which, by default, uses the un... |
What is DES-X? <p>What is DES-X?</p>
<p>And</p>
<p>DES-X and DES, are they backwards compatible?</p>
| <p>Well, DES-X is a variant of the DES block cipher (as I'm sure you already knew).</p>
<p>The reason for the introduction of the DES-X was an attempt to increase the security of the original DES algorithm (which was limited to a 56bit key). The proposed solution with DEX-X was to use two more 64-bit keys which would ... |
Facebook-connect demo - is "Callback URL" == "Connect Callback URL"? <p>I'm starting to feel stupid. I'm following the Facebook-Connect demo "The Run Around".</p>
<p>At the point when I navigate to http://www.[mysite].com/testing/register_feed_forms.php to register the one-line story, I get the following error:</p>
<... | <p>A "Connect URL" and a "Callback URL" are two different things, though they often contain the same url value. Does that make sense?</p>
<p>And yes, the documentation is BEYOND horrible and completely unacceptable. What's worse is that because it is so outdated, it often suggests things that will BREAK an already w... |
Techniques for writing a scalable website <p>I am new in the website scalability realm. Can you suggest to me some the techniques for making a website scalable to a large number of users?</p>
| <ol>
<li>Test your website under heavy load.</li>
<li>Monitor all statistics</li>
<li>Find bottleneck</li>
<li>Fix bottleneck</li>
<li>Go back to 1</li>
</ol>
<p>good luck</p>
|
How to create a SSL connection in PHP with SO_KEEPALIVE? <p>I have some simple PHP code that creates a SSL connection</p>
<pre><code>$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', $this->sslPem);
stream_context_set_option($streamContext, 'ssl', 'passphrase',... | <p>Have you verified (via network tracing) that you need to set the socket option? </p>
<p>What are you sending over the socket? HTTP/HTTPS introduces its own connection-reuse feature via the "Connection" header, so the option on the socket isn't necessarily what you want to set.</p>
|
Is it possible to build an ASP MVC app without magic strings in views? <p>I'm very new to ASP .Net MVC, I bought the Pro ASP .Net MVC Framework book from Apress last week and it's proving to be very helpful.</p>
<p>The problem that I'm seeing so far is that almost all the example views are riddled with magic strings. ... | <p>By using T4MVC and the MVC Futures, you can easily eliminate 99% of the magic strings. </p>
<p>Both of those projects are available from <a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471">http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471</a></p>
<p>T4MVC will ta... |
What are the limitations of primitive character types in D? <p>I am currently exploring the specification of the <a href="http://www.digitalmars.com/d" rel="nofollow">Digital Mars D</a> language, and am having a little trouble understanding the complete nature of the primitive character types. The book <a href="http://... | <p>A single <code>char</code> or <code>wchar</code> represents an UTF <a href="http://en.wikipedia.org/wiki/Code_unit">code unit</a>. This means that, by its own, a <code>char</code> in can either represent an ASCII symbol (0-127) or be part of an UTF-8 sequence representing an Unicode character (<a href="http://en.wik... |
Getting Rails to play with Hpricot <p>I'm trying to get Hpricot working with Rails on my dev machine.</p>
<p>I've installed Hpricot [0.8.1] using the standard 'gem install hpricot' and confirmed it works fine with my standard Ruby installation [1.8.7]; however when I try the same with my Rails [2.1.0] installation, I ... | <p>If you're free to choose your HTML parsing library, switch it.
Why, the creator of Hpricot, recently posted that you should better use <a href="http://nokogiri.rubyforge.org/nokogiri/" rel="nofollow">Nokogiri</a> instead of HPricot, nowadays.</p>
|
Installing emacs-rails <p>I am new to emacs and I would like to use emacs-rails for editing rhtml files. I have been at it for awhile with no luck. I have followed the directions on this page
<a href="http://developer.idapted.com/2009/1/13/install-and-config-emacs-for-rails" rel="nofollow">http://developer.idapted.com/... | <p>From your error message, my guess is you have something like:</p>
<pre><code>(load /.emacs.d/rails)
</code></pre>
<p>where you should have that in quotes:</p>
<pre><code>(load "~/.emacs.d/rails")
</code></pre>
<p>Or, perhaps you're using <code>require</code>, but either way, you've likely forgotten quotes around... |
Determine file being used by FileHandler <p>I am creating a <code>java.util.logging.FileHandler</code> that is allowed to cycle through files. When multiple instances of my application are run, a new log file is created for each instance of the application. I need to know what file is being used by the application beca... | <p>The easiest way is to put some kind of identifier in the file name itself, i.e. the <code>pattern</code> argument when you create the FileHandler. Since these are instances of the same application, one way to distinguish them is by their process id, so you could make that part of the pattern. A better approach is ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.