input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How should I load native libraries for JNI to avoid an UnsatisfiedLinkError? <p>I want to use JNI on Ubuntu 8.10, using Eclipse and gcc (the standard one with Ubuntu if there are flavours).</p>
<p>I can't seem to load my library despite the make file creating it successfully.</p>
<p>The main Java class is as follows:... | <p>As per Pax you should set the library path to where ever Java should look for the library. Your library name should be libhello.so. The call to load the library should then be:</p>
<pre><code>System.loadLibrary("hello");
</code></pre>
<p>Linux libraries are referenced by the convention lib**name**.so and loaded ... |
properly disabling the submit button <p>this is the code that I use to disable the button</p>
<pre><code> $("#btnSubmit").attr('disabled', 'disabled')
$("#btnSubmit").disabled = true;
</code></pre>
<p>and this is my submit button</p>
<pre><code><input id="btnSubmit" class="grayButtonBlueTex... | <p>If it's a <em>real</em> form, ie <strong>not javascript event handled</strong>, this should work.</p>
<p>If you're handling the button with an onClick event, you'll find it probably still triggers. If you are doing that, you'll do better just to set a variable in your JS like buttonDisabled and check that var when ... |
batch file which checks an entered text with text from a .txt file <p>I like to have a batch file which checks if an entered text in a .txt file is the same.</p>
<p>Something like this...:</p>
<pre><code>@echo off
Set pass=
set /p pass=Enter your password:
......
......
</code></pre>
<p>the .txt file is pass.txt an... | <p>This will require a combination of a for loop and simple if:</p>
<pre><code>@echo off
:begin
set pass=
set /p pass=Enter your password:
if {%pass%}=={} goto :begin
set authenticated=
for /f "tokens=*" %%a in (pass.txt) do (
if {%%a}=={%pass%} set authenticated=true
)
if not defined authenticated (echo Invalid... |
Which is the better of the django event apps? <p>I've been looking at <a href="http://code.google.com/p/django-swingtime/">django-swingtime</a>, <a href="http://thauber.com/blog/post/django-schedule/">django-schedule</a> and <a href="http://github.com/dokterbob/django-agenda">django-agenda</a>.</p>
<p>Any recommendati... | <p>I don't know if you already checked django-packages but it has a small grid about these: <a href="http://www.djangopackages.com/grids/g/calendar/">http://www.djangopackages.com/grids/g/calendar/</a></p>
|
Java 2D Game engine for tile-based Game <p>Can anyone recommend a good Java game engine for developing simple tile-based games?
I'm looking for an engine that will allow me to build maps using something like Tiled www.mapeditor.org</p>
<p>Slick is exactly what I'm looking for, slick.cokeandcode.com but I can't get ... | <p>checkout this <a href="http://www.interactivepulp.com/pulpcore/" rel="nofollow">http://www.interactivepulp.com/pulpcore/</a></p>
|
In Memory INI File Writer <p>I have an MFC app which is wizard based. The App asks a user a variable number of questions which are then written to an INI file which is later encrypted when the user clicks Finish. </p>
<p>All the INI file parsers I have seen so far seen read or write to a physical file on Disk. I don... | <p>I have an IniFile C++ class which allows you to work with Ini files in memory:
<a href="http://www.lemonteam.com/downloads/inifile.h" rel="nofollow">http://www.lemonteam.com/downloads/inifile.h</a></p>
<p>It's a short, well documented single .h file. Sample usage:</p>
<pre><code>IniFile if ( "myinifile.ini" );
if... |
Batch file which deletes a file which last modification was not today <p>I just want to know:</p>
<p>How can I delete 'log.txt' if the last modification was not today?</p>
<p>With a batch file.</p>
<p>I'm just talking here about 1 FILE!</p>
| <p>PowerShell must replace batch.</p>
<p><PRE>
if ((dir log.txt).LastWriteTime -lt [datetime]::today) { del log.txt }
</PRE></p>
|
strange border spacing in html/css <p>I'm trying to create a horizontal menu with a thick border bar that shows over the hovered item. However, for some reason there's a small gap at the right end of the bar in Firefox and Chrome. Strangely, IE displays it without the gap. Firebug doesn't show any reason for this gap.<... | <p>I floated the inner div left which fixed the weird spacing and the outer div left which forced the inner div to be inside of it. You can adjust the styles more to fit your needs. </p>
<pre><code>div.outer{border-top: 1px dotted lime;margin: 10px;float:left;}
div.outer div
{
float:left;
margin: 0;
paddin... |
How to run an OSGi framework within usual java-code? <p>Can anybody give me an example how to use the osgi framework classes? I haven't a clue how to use those classes ...</p>
<p>BR,</p>
<p>Markus</p>
| <p>It dependes on which OSGi implementation you are using. I use Eclipse Equinox and start the framework from within a regular java class. The Eclipse jar (called org.eclipse.osgi_longversion.jar) has a class called org.eclipse.core.runtime.adaptor.EclipseStarter. This will boot your OSGi framework.</p>
<pre><code>Pro... |
How to detect Media Services are installed on Windows server 2003? <p>I've been trying to find some information on this. So far I've been using the version Key presence to do it, is there a better way ? </p>
| <p>What's installed on a box is noted in several places, none of which reports everything, so you'll have to look at each to find where Media services install info is.</p>
<p>WMI classes:</p>
<p>Win32_ApplicationService</p>
<p>Win32_QuickFixEngineering</p>
<p>Win32_SoftwareFeature</p>
<p>Also MsPIDinfo:
<a href="... |
Are groups in Linq to Sql already sorted by Count() descending? <p>It appears so, but I can't find any definitive documentation on the subject.</p>
<p>What I'm asking is if the result of this query:</p>
<pre><code>from x
in Db.Items
join y in Db.Sales on x.Id equals y.ItemId
group x by x.Id into g
orderby g.Count() d... | <p>You're likely seeing this because the query result returned from the sqlserver is always in the same order in your tests. However, this is a fallacy: by definition, sets in SQL have no order unless it's explicitly specified with an ORDER BY. So if your queries don't have an order by statement, your sets might look ... |
Why are these default parameters defined as they are? <p>I'm currently learning Ruby and RoR and I stumbled across this declaration:</p>
<pre><code>link_to_remote(name, options = {}, html_options = nil)
</code></pre>
<p>I discovered that this pattern is used on several other Rails functions. </p>
<p>Why are the defa... | <p>The method is defined like this:</p>
<pre><code>link_to_function(name, remote_function(options), html_options || options.delete(:html))
</code></pre>
<p>This allows you to specify the <code>html_options</code> as part of the <code>options</code> hash instead of as a separate parameter. On the other hand, the <code... |
The wrong python interpreter is called <p>I updated my python interpreter, but I think the old one is still called. When I check for the version I get:</p>
<pre><code>$ python -V
Python 3.0.1
</code></pre>
<p>But I believe the old interpreter is still being called. When I run the command:</p>
<pre><code>python myPro... | <p>According to the first line of the script, <code>#!/usr/bin/python</code>, you are calling the Python interpreter at <code>/usr/bin/python</code> (which is most likely the one that ships with Mac OS X). You have to change that path to the path where you installed your Python 3 interpreter (likely <code>/usr/local/bi... |
How to get the screen brightness of iphone <p>I did some searches and found that if want to adjust the brightness, I need to use private framework and apple will reject it.</p>
<p>If I just want to get the value of brightness(just get that value to display, not adjust it), is there a way which apple accept?</p>
| <p>Using a undocumented API of a public framework is not necessarily bad. I know many people, including myself who use undocumented methods here and there, for example to check for connectivity or add text fields to UIAlertViews.</p>
<p>On the other hand, linking to a private framework is much worse, because those ten... |
Basic help with SQLite in C# needed - returning strings or ints from a query <p>I'm using Microsoft Visual C# 2008 Express Edition with SqlLite. I'm successfully able to open my database and with C# code, add entries to my tables.</p>
<p>When it comes to retriving data, I'm having some issues and have been searching ... | <p>First, remove the hurtful trailing semicolon from the line <code>while (reader.Read());</code>...!</p>
|
Which files shoud only be at Root? <p>My Mac saves my Vim's temporary files, my Scanner's log files and mach_kernel -files to my Root. I did not set this procedure up.</p>
<p>I am at the moment removing files at my root, since many of them seem to be just swap files.
I have the idea that only folders and system's syml... | <p><a href="http://en.wikipedia.org/wiki/Filesystem%5FHierarchy%5FStandard" rel="nofollow">File System Hierarchy Standard</a> might be useful.</p>
<p>It states <a href="http://www.pathname.com/fhs/pub/fhs-2.3.html#THEROOTFILESYSTEM" rel="nofollow">in the section about the root file system</a> that:</p>
<blockquote>
... |
Spring + Hibernate Dynamic Mapping <p>Apologies if this is a repost, I could not find the search terms to locate a similar question.</p>
<p>The application that I work on has support for plugins that can be loaded or unloaded at runtime. There are several API hooks that allow these plugins, among other things, to regi... | <p>If you don't need to retain prior session data, you can just destroy / recreate your SessionFactory with a new configuration and a new list of classes. Changing configuration of a session factory mid-app seems unlikely to me, but maybe someone with better Hibernate-Fu can prove me wrong.</p>
|
Animating a texture across a surface in OpenGL <p>I'm working with the iPhone OpenGLES implementation and I wish to endlessly scroll a texture across a simple surface (two triangles making up a rectangle). This should be straightforward, but it's not something I've done before and I must be missing something. I can r... | <p>You're incrementing your texture offset by <code>1.0f</code>; but textures coordinates are considered in the range <code>[0, 1]</code>, so you're not actually changing the texture coordinates (assuming you've enabled some sort of wrapping).</p>
<p>Try changing that increment (try <code>.01f</code>, or maybe somethi... |
Rails Voting Site <p>I'm getting started building a site with Rails and I would like people to be able to vote certain things with the options of "yes" or "no" or "right" or "wrong". I would also like there to be a running tally computed by percent (maybe below). Could someone tell me how I can add this functionality?... | <p>Remember to build it in such a way that enforces: "one vote for one IP address". Other than that, it is straight forward and plain Mathematics.</p>
|
how can i add a right click menu to finder <p>how can i add a custom view to the right click menu of every file in os x finder?</p>
<p>e.g. i want to display the image if it is an image type and do some custom action etc.</p>
<p>is this possible with c or objective-c? if yes how? (without using any available tool)</... | <p>You need to write a <a href="http://developer.apple.com/documentation/Carbon/reference/Menu%5FManager/Reference/reference.html">Menu Manager</a> plugin based on CFPlugin. Unfortunately, this involves some really dated Carbon stuff. There is a tutorial from a few years ago at <a href="http://www.mactech.com/articles/... |
image gallery loop JS <pre><code> var thumbs = document.getElementsByTagName("img");
for (var i=0; i<thumbs.length; i++)
{
Core.addEventListener(thumbs[i], "click", function() {alert(i);});
}
</code></pre>
<p>In the above code, the alert always shows18. that is the number of image thumbnails. i want it to sho... | <p>This is because the inner anonymous function closes the variable i, therefore it will show you always the last value of iteration. You do next: </p>
<pre><code>Core.addEventListener(thumbs[i], "click", (function( j)
{
retur... |
What can be the reason that my UIImageView subclass doesn't receive any touch events? <p>I have made sure that all superviews of my customized UIImageView and the UIImageView itself have userInteractionEnabled = YES;</p>
<p>Also in the nib all views and subviews have userInteractionEnabled = YES;</p>
<p>But for some ... | <p>This is just a guess -- is there a UIScrollView somewhere in the view hierarchy? UIScrollViews don't pass touch events like normal views, you have to subclass it and implement a custom touchesBegan method. You can find information about that <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/6686-uisc... |
Delete where record field < getdate() <p>I'm having trouble figuring out how to delete a set of records when a particular field is less than the date <strong>on the sql server</strong> without using tables or field names.</p>
<p>Since I'm using MSSQL the query would look something like this:</p>
<pre><code>DELETE FRO... | <p>I believe you can use query.substitutions configuration. Take a look at this post and links in the answer:</p>
<p><a href="http://stackoverflow.com/questions/435645/getting-datepart-in-hql-or-criteria/435720">http://stackoverflow.com/questions/435645/getting-datepart-in-hql-or-criteria/435720</a></p>
|
Adding stackless threading to BSD Kernel? <p><a href="http://www.ironport.com/" rel="nofollow">IronPort</a> developed a stackless threading model that allows the IronPort appliance to support more than 10,000 simultaneous connections in contrast to the 100 connections supported on a traditional OS. </p>
<p>If one want... | <p>There are some implementations already available. Just do some digging around and you can find them. One of the most prevalent implementations is available under a BSD license: <a href="http://www.sics.se/~adam/pt/" rel="nofollow">Protothreads</a></p>
|
Hyperlink in DataGridView - how to have text and links? <p>Is it possible to have a Windows Forms DataGridView in which one of the columns will display standard text with some words of it as clickable links? Here's what I'd like to do: whenever I get a certain regex pattern in the text, I want to make that match a hype... | <p>Well, to do what you want to do I think you would need a custom control that derives from the IDataGridViewEditingControl interface, which you could then plug into your DataGridView. <a href="http://www.codeproject.com/KB/grid/RtfInDataGridView.aspx" rel="nofollow">This article</a> shows how to do this with a RichT... |
Vulnerability with encrypting cookie info for authentication (stack overflow podcast) <p>I was listening to the stackoverflow podcast (i think it was episode 52). Jeff was talking how they came up with some type of authorization mechanism where they were encrypting credentials in the cookie they sent to the client. App... | <p>In my implementation I use random string (16 bytes) followed by the important information. The whole thing is then encrypted with AES using cyclic block chaining. </p>
<p>This avoids the need to store the information in a session state or to get it from a database. Anyway, it's no super high security site, but I th... |
Divide problem <p>I was very surprised when I found out my code wasn't working so I created a console application to see where the problem lies and I've got even more surprised when I saw the code below returns 0</p>
<pre><code> static void Main(string[] args)
{
float test = 140 / 1058;
Console.... | <p>You are using integer arithmetic and then converting the result to a float. Use floating-point arithmetic instead:</p>
<pre><code>float test = 140f / 1058f;
</code></pre>
|
How to always show program tray icons in Windows by *default*? <p>If a program is executed for the first time in Windows 7, it automatically hides the icon. Is there any manifest setting or option to force Windows 7 to always show the icon by default?</p>
| <p>In .NET Rocks podcast, not long time ago, Kate Gregory from Microsoft was saying that it is impossible.</p>
<p>She said something like: "If user wants it (tray icon) he/she will put it there".
Reason for this is to prevent mess in the tray area.</p>
|
Loading a model in a cron file, in Rails <p>I have a directory called cron, inside my app directory. In the cron directory, I have put my cron file. How do I access the model inside my cron file?</p>
<p>Which is the best place to put my cron file?</p>
<p>edit:
I'm trying to execute the cron file, directly like ruby... | <p>I'm assuming what you want to do is run a script (which you have saved in the <code>cron</code> folder) as a cronjob, but you want it to load the Rails environment, including access to your ActiveRecord models, before it runs.</p>
<p>If this is the case, what you want to use is the <code>script/runner</code> script... |
Manual DAL & BLL vs. ORM <p>Which approach is better: <strong>1)</strong> to use a <strong>third-party ORM</strong> system or <strong>2)</strong> <strong>manually write DAL and BLL code</strong> to work with the database?</p>
<p><strong>1)</strong> In one of our projects, we decided using the DevExpress XPO ORM system... | <p>My personal experience has been that ORM is usually a complete waste of time.</p>
<p>First, consider the history behind this. Back in the 60s and early 70s, we had these DBMSes using the hierarchical and network models. These were a bit of a pain to use, since when querying them you had to deal with all of the mech... |
How do I round a float up to the nearest int in C#? <p>In C#, how do I round a float to the nearest int?</p>
<p>I see Math.Ceiling and Math.Round, but these returns a decimal. Do I use one of these then cast to an Int?</p>
| <p>If you want to round to the <strong>nearest</strong> int:</p>
<pre><code>int rounded = (int)Math.Round(precise, 0);
</code></pre>
<p>You can also use:</p>
<pre><code>int rounded = Convert.ToInt32(precise);
</code></pre>
<p>Which will use <code>Math.Round(x, 0);</code> to round and cast for you. It looks neater b... |
How short can a GUID be? <p>I know the standard GUIDs. Can they be made shorter? What is the theory behind it?</p>
| <p>Greg Dean's answer is correct but in order to understand how a GUID is generated and why it ought not to be shortened I would highly suggest you read the article below.</p>
<p><a href="http://blogs.msdn.com/oldnewthing/archive/2008/06/27/8659071.aspx"><strong>The Old New Thing : GUIDs are globally unique, but subst... |
Can I load files from my computer in an iPhone app? <p>As part of the development phase of my iPhone app it would be really useful to load a file from my local machine, i.e. not from the application bundle. Is that possible?</p>
<p>The purpose of this is so that I can build a version of our game, and then give it to o... | <p>I believe iPhone app can only access files from within it's own bundle. I don't think that you can upload separate file into a bundle.</p>
<p>However, you can access data over network, so maybe you can build in a module for development where you download the data file over network and your app will then initialize ... |
mod-rewrite URL Change <p>I had an issue playing with Gallery when I changed a setting. However, I noticed there is a pattern to the error:</p>
<p>The URLs look as such:<br>
main.php/d/number/name.jpg</p>
<p><strong>"number" is dynamic (ie "9496-2") <br>
"name" is dynamic (ie "all+clad+7pc+b")</strong></p>
<p>Everyt... | <p>This should do it.</p>
<pre><code>RewriteEngine On
RewriteBase /
RewriteRule ^photos/ebay/main.php/d/([0-9]*)6-([0-9]*)/(.*).jpg /photos/ebay/main.php/d/$1\5-$2/$3.jpg [QSA,L]
</code></pre>
<p>I know you said you already got it but here is a solution without an additional script. (And I actually tested this one to... |
Resources concerning Python scripting in Vim <p>I'm trying to learn a little about python scripting in GVim, but I'm having trouble with starting. Elementary things, really.</p>
<p>Are there any resources / tutorials concerting python scripting in Vim out there ? Simple examples which show the basic principles, would ... | <p>Here is all I know of in terms of such docs:</p>
<ul>
<li><a href="http://www.tummy.com/Community/Presentations/vimpython-20070225/vim.html" rel="nofollow">A nice presentation by Sean Reifschneider</a></li>
<li><a href="http://vimdoc.sourceforge.net/htmldoc/if_pyth.html" rel="nofollow">The "official" VIM Python Int... |
Removing index.php from website URLs <p>I am using the Kohana framework (but I think it's irrelevant for this question) and pages can be accessed like so</p>
<pre><code>http://www.example.com/articles/
http://www.example.com/index.php/articles/
</code></pre>
<p>Now, as a rule of thumb, I generally try and tweak my .h... | <p>Try this:</p>
<pre><code>RewriteRule ^index\.php/(.*) $1 [NS,NC,L,R=301]
</code></pre>
<p>What you're not processing is that <em>all</em> requests are subject to rewriting, and when you do a rewrite it generate a subrequest -- which is also subject to rewriting. So you wind up rewriting /articles to /index.php/a... |
Non-blocking getch(), ncurses <p>I'm having some problems getting ncurses' getch() to block. Default operation seems to be non-blocking (or have I missed some initialization)? I would like it to work like getch() in Windows. I have tried various versions of</p>
<pre><code>timeout(3000000);
nocbreak();
cbreak();
noraw(... | <p>The curses library is a package deal. You can't just pull out one routine and hope for the best without properly initializing the library. Here's a code that correctly blocks on <code>getch()</code>:</p>
<pre><code>#include <curses.h>
int main(void) {
initscr();
timeout(-1);
int c = getch();
endwi... |
How do I sort into a dynamically generated specific order in mySQL? <p>I've been beating my brains in over this and I'm making no progress. I'm not very good with SQL so I'm hoping the answer is something simple that I just don't know.</p>
<p>I have 2 tables: One called "images" that contains the data I want, organize... | <pre><code>SELECT images.*
FROM images
INNER JOIN productPhotos ON images.imageID = productPhotos.imageID
WHERE productID in (5, 2, 4)
ORDER BY FIELD(specificProductUID, 5,2,4);
</code></pre>
|
In VB.NET/C#, how do I copy a SQL table schema from on DB to another? <p>I want to move a table schema from one database to another using vb.net or c#. How can I do that?</p>
<p>Thanks in advance</p>
| <p><a href="http://www.codeproject.com/Articles/26459/Copy-Database-Schema-and-Data-Using-SQL-Server-Man" rel="nofollow">This article</a> show how to use SQL Server Management Objects (SMO), C# to Script, Copy Database Schema with or without data. </p>
<pre><code>public class DBHelper
{
#region Private Variables
... |
How to find text within [] in Sed? <p>This is similar to a question that has already been asked. However, I am looking for a Sed specific answer. I have text similar to the following:</p>
<p>Some sample text [with some extra text].foo</p>
<p>I need to grab just the text inside the brackets. My attempts thus far ha... | <p>Something like this?</p>
<pre><code>$ echo Some sample text [with some extra text].foo | sed -e 's/.*\[\([^]]*\)\].*/\1/g'
with some extra text
$ echo Some sample text [with some extra text].foo | sed -e 's/.*\[\([^]]*\)\].*/Your text was: "\1", okay?/g'
Your text was: "with some extra text", okay?
</code></pre>
|
creating an internal opensource type system <p>so I am looking to create an open source type environment to allow our international partners to view and contribute to our code. </p>
<p>currently we use SVN for source control and fogbugz for defect tracking. This manages most of our requirements however. with Fogbugz e... | <p>HTTP access to Subversion runs over Apache. You can run both IIS and Apache on a windows server, you just have to set one of them to use a different port like 81 or 8080.</p>
<p>Chapter 6 of <a href="http://svnbook.red-bean.com/" rel="nofollow">Version Control with Subversion</a> is all about configuring your serv... |
What good resources can you suggest to learn advanced WCF? <p>I'm looking for any beyond basic resources that can help me to be proficient with WCF.</p>
<p>I found <a href="http://msdn.microsoft.com/en-us/netframework/wcf-resources.aspx#training" rel="nofollow">Microsoft Virtual Labs</a> that are pretty good but I'm l... | <p>There's a really good book my Michele Leroux Bustamante called <a href="http://rads.stackoverflow.com/amzn/click/0596101627" rel="nofollow">Learning WCF</a> (something like a pre-cursor to Juwal Lowy's more advanced book). She goes into great detail on all topics of WCF, even some very advanced ones (like federated ... |
How to escape a meta character in a regular expression <p>Language: asp</p>
<p>This is sample of my code:</p>
<pre><code>str = "www.example.com/gotobuy.aspx?id=1234"
key_word = ".obuy."
Dim regEx
Set regEx = New RegExp
regEx.Pattern = key_word
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(st... | <p>In addition to escaping the <code>.</code> with <code>\</code>, many people like to use a character class with only <code>.</code> in it: <code>[.]</code>, they find it more aesthetically pleasing. You also don't run into the problem of multiple levels of escaping. With <code>\</code>, you may have to use many lev... |
.NET or Java based small desktop app <p>I had posted a question a few days ago and thanks a lot to those who already responded. I am reposting the question because it seemed like I needed to clarify our requirements. So here it goes in more detail.</p>
<p>I am trying to get a very small desktop app built - something t... | <p>If you go the route of .NET Framework, the issue will probably be which version of the framework you'll be targeting.</p>
<p>For example, if you want to target for .NET Framework 3.5, although many people may have it installed via automatic updates, but some probably won't. In my case, <em>when I purchased my Eee P... |
What use is Reflection in .NET? <blockquote>
<p><strong>Possible Duplicates:</strong><br />
<a href="http://stackoverflow.com/questions/429962/when-do-you-use-reflection-patterns-anti-patterns">When do you use reflection? Patterns/anti-patterns</a><br />
<a href="http://stackoverflow.com/questions/864332/what-exa... | <p>Let's say you're writing a basic serialization routine, that will serialize any object to XML. How would you make it generic enough, so that it can work for any object? If you have a class where you know all the properties, then you can easily write a "ToXml()" function, where you manually write out all the properti... |
Fastest way to delete a tree of directories in batch file <p>I need to write a batch file that received a directory that contains a huge number of empty sub-directories and deletes them all.</p>
<p>What's the fastest way of doing this? (by fast I mean not like what Windows Explorer does when you try to delete such a d... | <pre><code>rd yourdirname /s/q
</code></pre>
<p>Will do the job regardless of whether they are empty or not.</p>
|
Google Map Search with City/state or Zip <p>i would like to make a search with city/state or Zip within a 'X' distance . The corresponding results will be viewed in google map. </p>
<p>is there any help regarding this?? i need it very urgent. Please help!!!!</p>
| <p>Have a look at the <a href="http://code.google.com/apis/maps/articles/phpsqlsearch.html" rel="nofollow">Creating a Store Locator with PHP, MySQL & Google Maps</a> article. </p>
<blockquote>
<p>This tutorial is intended for
developers who are familiar with
PHP/MySQL, and want to learn how to
use Google M... |
How can you use ASP.NET MVC build from source rather than the GAC? <p>I've installed the ASP.NET MVC locally, but I want to be able to use the code that is in the SVN repository on CodePlex rather than the released 1.0 version. However if I remove the reference to the GAC assembly in my solution and add the reference ... | <p>There are a lot of modifications in both web.config and ~/Views/web.config configuration files that need to be made for working with ASP.NET MVC source. You should read this - <a href="http://blog.codeville.net/2009/02/03/using-the-aspnet-mvc-source-code-to-debug-your-app/">Steve Sandersonâs blog - Using the ASP.N... |
How to handle membership in an ASP.NET MVC application? <p>How would you handle membership in an ASP.NET MVC application? Using any external libraries? How would you do OpenID log in? username log in? email log in? any other that is worth looking into? Maybe all of them mixed into the application?</p>
<p>It seems ASP.... | <p>Membership Providers are not new to ASP.Net MVC, they were introduced with ASP.Net 2.0.
The Membership Provider model is simply an abstraction layer between your application and whatever source you are authenticating your users against. You can switch providers easily by simply changing your web.config file.</p>
<... |
ASP.NET linkbutton visible property issue <p>Hi
I'm using a public variable called IsAdmin in the code behind of an aspx page.</p>
<pre><code> public partial class _news : System.Web.UI.Page
{
public bool IsAdmin = false;
protected void Page_Load(object sender, EventArgs e)
{
if (User.Identity.Name.Co... | <p><code><%# %></code> is the syntax used for accessing databound fields. Since you are likely databinding the Repeater control at some point, these expressions will be evaluated.</p>
<p>Since you are likely <em>not</em> calling databind on the Panel and the Linkbuttons outside of the Repeater, these expression... |
How to open SharePoint designer from command-line with a SharePoint site <p>I'm working on a Visual Studio Add-in to edit files in SharePoint. From this Add-in I would like to be able to open SharePoint Designer with a specific SharePoint site.
Finding the application is no problem, its folder is in registry key HKEY_L... | <p>I think to open a site, you just pass in the URL of the site with with no switch. </p>
<p>spdesign.exe <a href="http://My_server/My_site">http://My_server/My_site</a> </p>
|
All of a sudden dynamic created imagebutton's click event wont fire. <p>I have a page that dynamic create a table of contacts, if the contact got an email I also create an image button with a click event.I have a similar function in the rest of the page that works perfectly. And I used this before without any problems:... | <p>Where are you calling your Create method? You need to do it before the other event handlers run, ideally in the Page.Init. Otherwise, the data posted back to the page are indicated an event firing for a control that doesn't yet exist.</p>
<p>I would also make sure that you give your ImageButton an ID. It will make ... |
Run one instance from the application <p>I have a windows application (C#) and i need to configure it to run one instance from the application at the time , It means that one user clicked the .exe file and the application is run and the user didn't close the first instance of the application that is being run and need ... | <p>I often solve this by checking for other processes with the same name. The advantage/disadvantage with this is that you (or the user) can "step aside" from the check by renaming the exe. If you do not want that you could probably use the Process-object that is returned.</p>
<pre><code> string procName = Process.Ge... |
Algorithm faster than BMH (BoyerâMooreâHorspool) Search <p>Which algorithm would you use to search short substrings in short texts? By short I mean 5-10 characters for substring and 255 for the string. I'm thinking about choosing algorithm depending on input data length. Which algorithm is better for longer inputs?... | <p>Try <a href="http://www-igm.univ-mlv.fr/~lecroq/string/node15.html" rel="nofollow">Turbo-BM</a>. However, IMO, with such short strings usual linear scan will suffice.</p>
|
Javascript validation: Block special characters <p>How can I restrict users from entering special characters in the text box. I want only numbers and alphabets to be entered ( Typed / Pasted ).</p>
<p>Any samples?</p>
| <p>Try this one, this function allows alphanumeric and spaces:</p>
<pre><code>function alpha(e) {
var k;
document.all ? k = e.keyCode : k = e.which;
return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 32 || (k >= 48 && k <= 57));
}
</code></pre>
<p... |
Java Security Exception <p>I am trying to integrate a Hibernate application into a proprietary framework. My problem is that this framework somehow checks the signature of packages. When I try to call my Hibernate application I get the following error: </p>
<blockquote>
<pre><code>Caused by: java.lang.SecurityExcepti... | <p>Ok, I think I solved it.
The provider of the framework repackaged all used libraries into a "thirdparty.jar". After getting access to this JAR, I realized that they are using "org.hibernate.dialect" as well, but theirs does not contain "Oracle10gDialect".
So whenever I called my Hibernate application it would use t... |
Change an SQL server express table name <p>Hi I am using Visual Studio 2008 and I have an .mdf in the app_data of my ASP.NET MVC project.. I was trying to change the name of a table through the properties in the server explorer but it is greyed out. Is it possible to change the name?</p>
<p>I can see that you can copy... | <p>Double click the .mdf file. Then it will be opened in the Server Explorer. Right-click your table and choose "Open Table Definition". Then open the "Properties" window - the first property is "(Name)" - change it and save the table - That's it! </p>
|
2 questions. IDO mode not caching properly / forcing buffers to named windows <h1>1</h1>
<p>My ido mode does not properly cache filenames / folders. It will list files inside a folder, but from a while ago without any of the newer files showing. Any suggestions ?</p>
<h1>2</h1>
<p>In jde, when I have multiple window... | <p>1 ) I'm not sure why youa re having this issue, but add the following to your .emacs:</p>
<blockquote>
<p>(defadvice ido-find-file (before auto-refresh-ido nil activate)<br>
(setq ido-rescan t))</p>
</blockquote>
<p>This will let ido know to update your files whenever you try and open a file with it - Alt... |
Installing/registering win32 OpenSSL libraries (distributed with my app) <p>My application depends on OpenSSL libraries (through Qt networking modules; you can't compile it into Qt statically, because of legal issues)</p>
<p>There's this project -
<a href="http://www.slproweb.com/products/Win32OpenSSL.html">Win32 Ope... | <p>Maybe there are further dependencies that these two DLLs have that SVN has installed for you...</p>
<p>Trying using depends to see which DLLs the OpenSSL DLLs use, and make sure those are installed on your clean VMware.</p>
|
What caused a Private Bytes on SQL Server 2005? <p>My Server is Windows 2003 and SQL Server 2005 Standard. 3 GB of RAM. After run my client program for a while a Private Bytes up to 1.7 GB and never come down.</p>
<p>only process 51 with status "runnable". Click details.</p>
<pre><code>create table #tmpDBCCinputbuffe... | <p>1.7GB is the 2GB (default) user mode address space less 384MB. SQL Server leaves the 384 MB by default.</p>
<p>If you had /3GB set and 3GB RAM, it would use 2.7GB.</p>
<p>See this article, <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;316749" rel="nofollow">KB 316749</a> which applies to SQL 7 t... |
Referencing a nib file in a subfolder of an Xcode compiled Cocoa app bundle <p>If I have a directory in my Xcode project (not a Group), which is added to the main target, and compile it, how do I instruct an NSViewController to <code>initWithNibName:bundle:</code> a nib file inside that directory?</p>
<p>I've tried <c... | <p>You're best off not using folders like this. Many Cocoa conveniences like -[NSImage imageNamed:], or the view controller init method expect to find a file in the Resources folder of the bundle.</p>
<p>If you'd really like to keep a folder of NIB files anyway, you can, but you won't be able to use the convenience me... |
what is the best way to emulate XAML code inheritance? <p>I have a number of UserControl classes:</p>
<ul>
<li>DataTypeWholeNumber</li>
<li>DataTypeLine</li>
<li>DataTypeDate</li>
<li>DateTypeDuration</li>
<li>etc.</li>
</ul>
<p>They all inherit from a plain C# class which inherits from UserControl which has no XAML ... | <p>Use a Style that applies to the base class:</p>
<pre><code><Style TargetType="BaseClass">
<Setter Property="Control.Template">
<Control.Value>
<StackPanel Margin="{Binding Margin}">
<!-- Rest of code here -->
</Control.Value>
... |
Confirmation on switching between tabs <p>I have two tabitems. User will enter some data and save it on the first tab. The second tab lists the saved data. What I need is when the user select the second tab before saving data in first tab a confirmation message box with Yes, No and Cancel should be shown. If the user c... | <p>Although I disagree with the way you interrupt the user's flow from tab to tab I'm going to humor you and answer the question:</p>
<p>You'll need two things to get this done:</p>
<ol>
<li>The event that occurs when a tab was clicked</li>
<li>The previous tab that was selected (the one you came from)</li>
</ol>
<p... |
ASP.Net-MVC sample code to retrieve selected item from html dropdownlist <p>Can somebody give me an sample code to retreive the item from html.dropdownlist?</p>
| <p>Suppose that you have this DropDown in the view:</p>
<pre><code><p><label for="ProductType">Product Type:</label>
<br /><%=Html.DropDownList("ProductTypeDropDown",
New SelectList(ViewData("ProductTypes"),
"ProductTypeID", "Name"))%>
</p>
</code></pre>
... |
Why my eclipse [on vista] shows incorrect file modification timestamp? <p>When I right-click on a recently modified file (like a jar generated by Java Builder) and view the file properties, the modification timestamp is always off by 2.5 hrs. Windows explorer, on the other hand, is showing correct timestamp. </p>
<p>I... | <p>Since Eclipse support <a href="http://wiki.eclipse.org/JAR%5FSigning" rel="nofollow"><strong>jar signing</strong></a>, it may be possible it does display the timestamp stored in the signature as opposed to the one associated with the file. Maybe that timestamp is computed on a GMT-base as opposed to a local-time bas... |
Using JSON to return a Java Map <p>What's the best way to return a Java Map using the JSON format?
My specific need is a key -> value association between a date and a number.</p>
<p>My concern is this: My structure basically contains N elements of the same type (a mapping between a date and a number), and I want to be... | <p>Although I haven't tried it myself, the <a href="http://www.json.org/javadoc/org/json/JSONObject.html"><code>JSONObject</code></a> of the <a href="http://www.json.org/java/index.html">Java implementation of JSON from json.org</a> has a <a href="http://www.json.org/javadoc/org/json/JSONObject.html#JSONObject%28java.u... |
echo --version doesn't works <p>how can i know version of echo command
as specified in the man page for echo
echo --version should output version of echo command
is it a bug in echo command or its documentation..
plz explain..
same is the case with echo help!!</p>
| <p>You are probably hitting the shell builtin <code>echo</code>. Try using the real program</p>
<pre><code>/bin/echo --version
</code></pre>
<p>For a help section of the builtin echo, try </p>
<pre><code>help echo
</code></pre>
<p>And for its manpage, try</p>
<pre><code>man bash
</code></pre>
<p>If you are using ... |
Jstack and Not enough storage is available to process this command <p>I'm trying to run jstack command on my java application. Application is rather big, running inside jboss AS occupying about 4gb of memory. OS is Windows Server 2003 Standard edition. Every time i get an error "Not enough storage is available to proce... | <p>I ran into this recently on Win2008r2 and thought I'd share my solution since it took a while to figure out. <a href="http://stackoverflow.com/questions/906620/jstack-and-not-enough-storage-is-available-to-process-this-command/1677263#1677263">Rob's comment about psexec -s</a> is what did it for me. </p>
<p>It appe... |
Alternative to innerhtml that includes header? <p>I'm trying to extract data from the following page:</p>
<p><a href="http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet?param1=&param2=&param3=&param4=&param5=2009-04-22&param6=37#" rel="nofollow">http://www.bmreports.com/servlet/c... | <p><strong>Untested:</strong> Did you try looking at what <a href="http://msdn.microsoft.com/en-us/library/aa752604%28VS.85%29.aspx" rel="nofollow">Document.scripts</a> contains?</p>
<p><strong>UPDATE:</strong></p>
<p>For some reason, I am having immense difficulty getting this to work using the Windows Scripting Hos... |
Winforms BringToBack Option? <p>In winforms there is a function "BringToFront" that moves a form to the top of the Z-Order. Is there a way to do the opposite--push a form to the back?</p>
| <p>Use: <code>Form.SendToBack()</code></p>
|
How to implement an Audit Interceptor using iBATIS? <p>I want to log all changes in my database for auditing purposes, using a table called AuditEvent that stores the modified row ID (primary key), table name, column name, previous value, new value, date of change (timestamp), operation type (insert / update / delete) ... | <p>If you're using spring, you might be able to use SqlMapClientDaoSupport to write template Dao objects that wrap auditing up with whatever transaction support you are using. If not, there is an iBatis Doa template option, iBatis DAO. That has been depreciated so you might be better off with Spring.</p>
|
What is the best way to do application data exchange in Delphi without sockets? <p>I need a few of my related applications to communicate to each other (exchange data and initiate actions). Requirements are without packages and no sockets. So I guess that leaves named pipes, WM_CopyData (like Skype does it) and command... | <p>You probably have a couple of options.</p>
<p>Beyond what you already have:<br>
DDE<br>
Memory Mapped Files (MMF)<br>
MailSlots</p>
<p>I would probably go with either the Pipes or the MMF.</p>
<p>There are a couple of free MMF components that you can download,
Deborah Pate has a set of freeware classes you can us... |
Batch problem in MySQL? <p>I have a script in MySQL that creates two tables, the second table references a field in the first table, now when I try to run this script in one batch it returns an error. My guess is that it checks the referenced table in the second table definition before creating the tables.</p>
<p>Any ... | <p>the simple thing , to create first the 2 tables,
after that do alter table and add the reference.</p>
|
addProximityAlert doesn't work (neither does requestLocationUpdates) - Android <p>Hi
I'm trying to get and update when the phone gets near a location.
I've both tried using addProximityAlert and requestLocationUpdates</p>
<pre><code> LocationManager lm =(LocationManager) getSystemService(Context.LOCATION_SERVICE);... | <p>I think the problem is how you define you Intent / PendingIntent. There are two ways to start an Activity using an Intent, and the code you've included looks like a cross between the two.</p>
<p>The standard way of starting an Activity is to use the Intent constructor that takes the current context and the Activity... |
Why is JavaScript considered bad by some? <p>Why is JavaScript allowed to be disabled in the browser? (i.e. Why is it considered bad?)</p>
| <pre><code><body onload="for(i=0; i<1000000; i++){window.open(
'samplesite.com?pageid=' + i);}">
</code></pre>
|
Grid security in grid frameworks <p>Recently, I've become quite involved experimenting with lightweight grid frameworks (Hazelcast, Gigaspaces, Infinispan).</p>
<p>However, I've been somewhat surprised than none of the free frameworks I tried has any ACL or role based security features built in (Gigaspaces does have s... | <p>This is my opinion on current state of open source distributed cache solutions (e.g. JBoss Cache and Infinispan). As a baseline I am using GigaSpaces commercial caching product. Let me know what you think about open source and proprietary cache products.</p>
<p>read more at: <a href="http://bigdatamatters.com/bigd... |
exec statement with/without prior compile <p>These weekend I've been tearing down to pieces Michele Simionato's <a href="http://pypi.python.org/pypi/decorator/3.0.1" rel="nofollow">decorator module</a>, that builds signature-preserving decorators. At the heart of it all there is a dynamically generated function, which ... | <p>There are a few differences that I see. Firstly, <a href="http://www.python.org/doc/2.6.2/library/functions.html#compile" rel="nofollow"><code>compile</code></a> has slightly better semantics in the face of syntax errors than <a href="http://www.python.org/doc/2.6.2/reference/simple%5Fstmts.html#the-exec-statement" ... |
Expression Engine: OpenID support? <p>Is there a way to use OpenID with EE?</p>
| <p>You can try <a href="http://eeopenid.com/" rel="nofollow">EE Open ID</a>. There is currently not a supported way of using this, but <a href="http://expressionengine.com/forums/viewthread/24441/" rel="nofollow">this thread</a> suggests that the devs are aware of the desire in the community.</p>
|
prototype: Element.remove.bind(foo) doesn't work as expected <p>I have this snippet:</p>
<pre><code>self.puff({duration: 0, queue: 'end',
afterFinish: Element.remove.bindAsEventListener(self)
});
</code></pre>
<p>Self is an element; it is supposed to remove an element from document when all effects on it ... | <pre><code>self.puff({duration: 0, queue: 'end',
afterFinish: function () { self.remove(); }
});
</code></pre>
<p>What's wrong with this way of putting it? You even suggest it yourself. In any case, you don't need to bind it as an event listener, since it is only a Prototype syntatic sugar version of bind to ensur... |
Win32 Message Pump vs MFC Message Maps, which is faster? C++ <p>not from the ease of use, but from the performance point of view. are MFC message maps faster than a typical message pump?</p>
| <p>MFC wraps the Win32 messaging, so if anything the MFC will be slightly slower. That said, if you're dealing with UI widgets performance is not a concern.</p>
|
log4net: Logging two messages in one row in the database? <p>I'm trying to log the input and output of a particular method to the database. I'd like to have this information in separate columns. I've investigated the PatternLayout and it seems that it only caters for a single %message parameter, meaning that if you d... | <p>Your PatternConverter way is a step in the right direction, though the use of the static Input and Output properties makes it all a bit shaky (thread-safety wise). </p>
<p>The trick here is to realize that the message parameter on logger.Debug(...) is object and that you can pass in whatever you like.</p>
<p>You c... |
tabbing in C# resource file <p>Hi
How do i add a TAB (\t) to a string resource ?</p>
<p>"\tText" doesn't work</p>
| <p>You have to explicitly add the tab in. The easiest way of doing this is probably to type out your string in notepad (with the tab explicitly set in place rather then using an escape character) and copy and paste the text into the resource editor.</p>
<p>You will have a similar problem with newlines, the easiest way... |
Java: getMinutes and getHours <p>How do you get Hours and Minutes since <code>Date.getHours</code> and <code>Date.getMinutes</code> got deprecated? The examples that I found on Google search used the deprecated methods.</p>
| <p>Try using <a href="http://www.joda.org/joda-time/">Joda Time</a> instead of standard java.util.Date classes. Joda Time library has much better API for handling dates.</p>
<pre><code>DateTime dt = new DateTime(); // current time
int month = dt.getMonth(); // gets the current month
int hours = dt.getHourOfDay();... |
Is this a full binary tree? <p>Here's the binary tree in question. The leaves are a, b, c, d and the edges are labelled 0 or 1.</p>
<pre><code> .
/ \
a .
/ \
b .
/ \
c d
</code></pre>
<p>It seems to me that it is a full binary tree, as every node is either a leaf or has two child n... | <p>You are confusing a perfect binary tree with a full binary tree. A perfect binary tree is a full binary tree with all leaf nodes at the same level. So yes, the picture is a full binary tree.</p>
<p>A leaf is defined as a node without a child node.<br />
Thus, a full binary tree is a binary tree in which each node h... |
Simultaneously stream and save a video? <p>I'm writing an app, part of which allows the user stream/play videos. I want to restrict the functionality so that they can only stream videos if they have a WiFi connection. I will then save the video so that when they have a 3G only (or lesser) connection they can't stream v... | <p>Two solutions come to mind.
Both this solutions require that the file is in a format that can be played progressive, e.g. that you don't need the whole file to be able to play it (but that would be a prerequisite anyway).</p>
<ol>
<li>use a thread to download the data and append it to a file, and play the file fro... |
3-tiers pattern and large amounts of data <p>Here is my situation: I am trying to follow as hard as I can the 3-tier pattern (i.e. Presentation, Business and Data layer). When I need data from the DB, the Business layer calls the Data layer which returns the information. The Data layer never return a SqlDataReader or D... | <p>I assume you're not displaying 500,000 records to the front end at once? You're probably doing some pagination, right? So, only return one page worth of data from the database at one time.</p>
|
MVC Ajax not posting a dropdownlist value <p>Using the following form in a view </p>
<pre><code><% using (Ajax.BeginForm("PatientSearch", new {}, new AjaxOptions()
{
HttpMethod = "POST",
UpdateTargetId = "searchResults",
OnBegin = "BeginRequest",
... | <p>Does the patientType List have a .Value</p>
<p>By the looks of things, theres no <code>value</code> being rendered for the PatientType DDL <code><option></code>'s so essentially every option has a value="" so it is actually post back the correct value.</p>
<p>The problem is with what's being rendered in the ... |
How to design scalable applications? <p>How do you design/architect a scalable application? Any suggestion of books or websites that could help to understand how to scale out applications?</p>
<p>Thanks</p>
| <p>Over the past year I've had to come up to speed on this question for a project my company's working on, and I've found these resources extremely helpful: Todd Hoff's <a href="http://www.highscalability.com">highscalability.com</a>; <a href="http://rads.stackoverflow.com/amzn/click/067232699X">Scalable Internet Archi... |
compiling project with jdk1.5 using maven2 <p>i managed to create my project structure using maven2.
but when am compiling my project using mvn install
getting error
generics are not supported in -source 1.3</p>
<p>googled to build my project using jdk1.5 and added build tag</p>
<pre><code><project>
<model... | <p>Add the maven-compiler-plugin to your build: </p>
<pre><code><build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
&l... |
Can someone explain "ClassCastException" in Java? <p>I read some articles written on "ClassCastException" but I couldn't get a good idea on that. Can someone direct me to a good article or explain it briefly.</p>
| <p>Straight from the API Specifications for the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassCastException.html"><code>ClassCastException</code></a>:</p>
<blockquote>
<p>Thrown to indicate that the code has
attempted to cast an object to a
subclass of which it is not an
instance.</p>
</block... |
How can I tell if a point belongs to a certain line? <p>How can I tell if a point belongs to a certain line?</p>
<p>Examples are appreciated, if possible.</p>
| <p>In the simplest form, just plug the coordinates into the line equation and check for equality.</p>
<p>Given:</p>
<pre><code>Point p (X=4, Y=5)
Line l (Slope=1, YIntersect=1)
</code></pre>
<p>Plug in X and Y:</p>
<pre><code> Y = Slope * X + YIntersect
=> 5 = 1 * 4 + 1
=> 5 = 5
</code></pre>
<p>So yes, th... |
Any Html control libraries - a visual counterpart to jQuery/Prototype <p>jQuery provides a browser neutral library for accessing and manipulating the DOM. This is good.</p>
<p>However I'm looking for a counterpart for the visual side of things - I need to build pixel measured interfaces, without wasting so much time t... | <p>Also check out <a href="http://www.extjs.com/" rel="nofollow">ExtJS</a>. I've used this one extensively and I can vouch for how good it is. Originally it was a fork of the <a href="http://developer.yahoo.com/yui/" rel="nofollow">Yahoo UI Library</a> (YUI), which Soviut mentioned. Personally, I think it's much better... |
How to define class-specific << operator in C++ <p>Given a class such as:</p>
<pre><code>class Person
{
private:
char *name;
public:
Person()
{
name = new char[20];
}
~Person()
{
delete [] name;
}
}
</code></pre>
<p>I want to print to print the name from an instance of thi... | <p>add this in the class:</p>
<pre><code>friend std::ostream& operator<< (std::ostream& out, const Person& P);
</code></pre>
<p>and then define the operator<< something like this:</p>
<pre><code>std::ostream& operator<< (std::ostream& out, const Person& P) {
out <<... |
How to bind DataGridView with List<T> or BindingList<T> <p>I've done it one thousand of times and it works but now .... not :(</p>
<p>Am I doing something wrong here because nothing is shown in grid ?</p>
<pre><code>namespace theGridIsNotWorking
{
using System;
using System.Collections.Generic;
using System.Windows.F... | <p>I think the problem is that TheName is a member variable, but you need a property.
Try the following for the Item class:</p>
<pre><code>
public class Item
{
public string TheName;
public string TheNameProperty
{
get
{
return TheName;
... |
Gather all Python modules used into one folder? <p>I don't think this has been asked before-I have a folder that has lots of different .py files. The script I've made only uses some-but some call others & I don't know all the ones being used. Is there a program that will get everything needed to make that script ... | <pre><code># zipmod.py - make a zip archive consisting of Python modules and their dependencies as reported by modulefinder
# To use: cd to the directory containing your Python module tree and type
# $ python zipmod.py archive.zip mod1.py mod2.py ...
# Only modules in the current working directory and its subdirectorie... |
CSS Printing: Avoiding cut-in-half DIVs between pages? <p>I'm writing a plug-in for a piece of software that takes a big collection of items and pops them into HTML in a WebView in Cocoa (which uses WebKit as its renderer, so basically you can assume this HTML file is being opened in Safari).</p>
<p>The DIVs it makes ... | <p>This should work:</p>
<pre><code>@media print
{
div{
page-break-inside: avoid;
}
}
</code></pre>
<p>Please note <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-inside">current browser support (12-03-2014)</a>:</p>
<ul>
<li>Chrome - 1.0+</li>
<li>Firefox (Gecko) - 19.0+</li>
... |
Ignore question mark in .bat batch scripts <p>The thing is that I need to pass one parameter with question marks in it to a .bat batch file. If I use the question mark the parameter is not well passed. How can I solve this?</p>
<p>I'm having troubles with this line:</p>
<pre><code>script.bat /n"output.owl" /r"http://... | <p>I suspect the issue here is the original batch file is using a for loop to
process the command line options, and the question mark is being used for
filename wildcard expansion.</p>
<pre><code>> type fortest.bat
@echo off
for %%a in (%*) do (
echo arg is %%a
)
> fortest a b c/?d
arg is a
arg is b
</code></... |
How do you prevent a windows from being moved? <p>How would i go about stopping a form from being moved. I have the form border style set as FixedSingle and would like to keep it this way because it looks good in vista :)</p>
| <p>Take a look at this <a href="http://vaibhavgaikwad.wordpress.com/2006/06/05/creating-a-immovable-windows-form-in-c/">link</a>. You might be interested in option #3. It will require you to wrap some native code, but should work. There's also a comment at the bottom of the link that shows an easier way to do it. Taken... |
How do I PUT data to Rails using JQuery <p>I am trying to send a jquery ajax PUT request that looks like this:</p>
<pre><code>$.ajax({
type: "PUT",
url: '/admin/pages/1.json',
data: { page : {...} },
dataType: 'json',
success: function(msg) {
alert( "Data S... | <p>PUT and DELETE are not supported by all browsers, RubyOnRails supports passing an extra parameter with your data called <strong>_method</strong> which will indicate how RoR will treat the request.</p>
<pre><code>$.ajax({
type: "POST",
url: '/admin/pages/1.json',
data: { _method:'PUT', ... |
Optimizing Lookups: Dictionary key lookups vs. Array index lookups <p>I'm writing a 7 card poker hand evaluator as one of my pet projects. While trying to optimize its speed (I like the challenge), I was shocked to find that the performance of Dictionary key lookups was quite slow compared to array index lookups.</p>
... | <p>Don't forget that Big-O notations only says how the complexity grows with respect to the size (etc) - it doesn't give any indication of the constant factors involved. That's why sometimes even a linear <em>search</em> for keys is faster than a dictionary lookup, when there are sufficiently few keys. In this case you... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.