instruction stringlengths 0 30k ⌀ |
|---|
If you're using jQuery it has a callback function to overcome this:
<http://docs.jquery.com/Ajax/jQuery.ajax#options>
> As of jQuery 1.2, you can load JSON
> data located on another domain if you
> specify a JSONP callback, which can be
> done like so: "myurl?callback=?".
> jQuery automatically replaces the ?... |
Here is a list of web related blog posts about Haskell:
[http://haskell.org/haskellwiki/Blog_articles/Web][1].
Furthermore, the next big Haskell web framework is WASH:
[http://www.informatik.uni-freiburg.de/~thiemann/haskell/WASH/][2].
And there is an Apple webobjects based domain specific language: [http://www... |
Some more details would be nice: which AJAX library are you using, what would you like to achive, how you do it.
For example it can be a cross-domain Ajax request, which is not allowed. In this case use [JSON][1].
[1]: http://www.json.org/ |
Memory performance or CPU performance? Or are they the same these days?
My only evidence is anecdotal and on a different platform: after porting a bunch of CPU-hungry apps to C# (.NET 2.0), I did not notice substantial loss in performance (I do not consider 10% substantial). Well written code seems to perform well o... |
I find it best to treat Stored Procedures just like any other compilable code: Code lives in the repository, you check it out to make changes and load it in your development tool to compile or deploy the code. |
Html.RenderPartial call from masterpage |
|asp.net|asp.net-mvc|renterpartial|master-pages| |
Here is a scenario: Let's say I have site with two controllers responsible for displaying different type of content - Pages and Articles. I need to embed Partial View into my masterpage that will list pages and articles filtered with some criteria, and be displayed on each page. I cannot set Model on my masterpage (am ... |
Here is a scenario: Let's say I have site with two controllers responsible for displaying different type of content - Pages and Articles. I need to embed Partial View into my masterpage that will list pages and articles filtered with some criteria, and be displayed on each page. I cannot set Model on my masterpage (am ... |
|asp.net|asp.net-mvc|master-pages|html-helper|renderpartial| |
`egrep "(([0-9]{1,2}.)?[0-9]{3}.[0-9]{3}.[0-9]{4})" -R *.html` |
yes, this is correct. but let's look at this scenario:
on views that are related to articles, I'd have ViewData["article"], and on views related to pages, I have ViewData["pages"], but I don't have both articles and pages available all time. So, if I add:
Html.RenderPartial("articlesView", ViewData["articles"])
... |
If you're looking for more than just code refactoring, you might find Scott Ambler's book quite useful: http://www.ambysoft.com/books/refactoringDatabases.html |
I've never used Xinha, but I can vouch for TinyMCE. It's fast, scales well, and is infinitely customizable. |
I've never used Xinha, but I can vouch for TinyMCE. It's fast, scales well, and is infinitely customizable. I particularly like the dynamic loading of functionality, which means you only take the performance hit for the stuff you use.
It also includes language-specific [compressors][1] to further increase performanc... |
hmmmm, it seems you would need to find some sort of JavaScript to check for html input or a client side validator. |
In C++ on **Windows**, you just escape \ and " where needed, quote the argument and ShellExecute it. Then, everything inside the quotes should be treated as text.
This should illustrate:
<pre><code>
#include <iostream>
#include <string>
#include <windows.h>
#include <cstdlib>
using na... |
Can anyone recommend a good library for generating an audio file, such as mp3, wav, or even midi, from python?
I've seen recommendations for working with the id tags (song name, artist, etc) in mp3 files, but this is not my goal.
Thank you very much! |
Accessible controls for ASP.NET |
|asp.net|ajax|accessibility| |
In my last job we ended up rewriting the complete ASP.NET stack (forms, controls, validation, postback handling, ajax library etc...) - the reason I was given was that the ASP.NET controls were not accessible enough, not were any of the third party controls that were assessed for the project.
Can anyone point me to ... |
To quote Captain Barbossa:
"..And secondly, you must be a pirate for the pirate's code to apply and you're not.
And thirdly, the code is more what you'd call "guidelines" than actual rules...."
To quote Jack Sparrow & Gibbs.
"I thought you were supposed to keep to the code."
Mr. Gibbs: "We figured they were ... |
See <http://wiki.python.org/moin/Audio/> and <http://wiki.python.org/moin/PythonInMusic>, maybe some of the projects listed there can be of help.
Also, [Google is your friend](http://www.google.com/search?q=python+audio+library). |
You could take a look at the 'App_Browsers' feature in .NET.
It gives you the opportunity to hook into the rendering engine for each control. The original intention for this was to be able to alter the HTML output of controls depending on the user's browser - but you can also do it for all browsers.
You could al... |
Advantages and disadvantages of GUID / UUID database keys |
|database| |
I've worked on a number of database systems in the past where moving entries between databases would have been made a lot easier if all the database keys had been [GUID / UUID][1] values. I've considered going down this path a few times, but there's always a bit of uncertainty, especially around performance and un-read... |
I dont see why the fact that your one developer changes anything on the source control issue. I would follow the same system (in fact I do on my solo projects). I use [wush.net][1] (svn and trac) in those cases. It's fast to set up and dont require that you yourself do or know any server issues. I recommend you use so... |
Sounds like you're not wanting to use Revision Control properly, to me.
> Obviously one solution is to have the
> script files for all the different
> components in a directory or more
> somewhere and simply using TortoiseSVN
> or the like to keep them in SVN
This is what should be done. You would have your l... |
Well you learn something new every day, aparantly I lied:
> What isn’t generally realised is that
> you can change attribute values fairly
> easily at runtime. The reason is, of
> course, that the instances of the
> attribute classes that are created are
> perfectly normal objects and can be
> used without res... |
Well you learn something new every day, apparently I lied:
> What isn’t generally realised is that
> you can change attribute values fairly
> easily at runtime. The reason is, of
> course, that the instances of the
> attribute classes that are created are
> perfectly normal objects and can be
> used without re... |
Well you learn something new every day, apparently I lied:
> What isn’t generally realised is that
> you can change attribute values fairly
> easily at runtime. The reason is, of
> course, that the instances of the
> attribute classes that are created are
> perfectly normal objects and can be
> used without re... |
What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)?
No legacy browser compatibility required, Safari, Opera and Firefox will do.
**Update**: Thanks @Brian, the following is working (in Opera and FF3 at lea... |
GWT is very high quality with a great community. However you do need to know CSS if you want to adjust the look of things (you will) - CSS can do a lot of the layout, just like regular web if you want it to. Libraries like GWT-ext or ExtGWT can help a bit as they have stunning "out of the box" looks but for a price (ex... |
Ctrl-J starts an incremental find.
Hit Ctrl-J, then start typing. Use up/down to find previous/next instances of what you typed.
Ctrl-Shift-J searches backwards. |
Ctrl-Shift-L will show you all the currently available keyboard shortcuts |
Have you tried the iframe trick (i.e. floating an iframe behind the menu, thus putting hte flash layers behind.)
|
How to test a WPF user interface? |
|.net|wpf|testing| |
Using win forms with an [MVC][1]/[MVP][2] architecture, I would normally use a class to wrap a view to test the UI while using mocks for the model and controller/presenter. The wrapper class would make most everything in the UI an observable property for the test runner through properties and events.
Would this be ... |
A non-keyboard shortcut trick is to use commit sets in your Team->Synchronise view to organise your changes before committing.
Set a change set to be the default, and all changes you make on files will be put in that set, making it easy to see what you have changed while working on a specific defect/feature, and oth... |
The [Google Perftools][1] are extremely useful in this regard.
[1]: http://code.google.com/p/google-perftools/
|
Here's a thought off the top of my head:
1. Find one connection. (Depth-first search is probably a good algorithm for this, since the path length doesn't matter.)
1. Disable the last segment.
1. Try to find another connection from the last node before the previously disabled connection.
1. Goto 2 until there are ... |
I suggest jquery tree view plugins for making it function like a tree, but as for render, just put it in a recursive lambda helper to do the nesting. |
Here's switch.js:
function slide_for_switch(sw) {
slide_id = $(sw).attr('id').substring('switch'.length);
return $('#slide' + slide_id);
}
$(document).ready(function() {
$('#switches li').each(function() {
this.slide = slide_for_switch(this);
}).hov... |
Here's switch.js:
function slide_for_switch(sw) {
slide_id = $(sw).attr('id').substring('switch'.length);
return $('#slide' + slide_id);
}
$(document).ready(function() {
$('#switches li').each(function() {
this.slide = slide_for_switch(this);
}).hov... |
Found this on reddit: http://tirania.org/blog/archive/2008/Sep-08.html
Quote from the site:
> The idea was simple: create an interactive C# shell by altering the compiler to generate and execute code dynamically as opposed to merely generating static code. |
Check out the documentation on [`mx.controls.Label`][1] and [`flash.text.TextField`][2] (which is what displays the text in a `Text` or `Label` control in Flex). The `TextField` documentation states that
> The <img> tag lets you embed external image files (JPEG, GIF, PNG), SWF files, and movie clips inside tex... |
Not sure on your price range, however [DB Ghost](http://www.innovartis.co.uk/) could be an option for you.
I don't work for this company (or own the product) but in my researching of the same issue, this product looked quite promising.
|
Others have commented on hashes vs hashrefs. One other thing that I feel should be mentioned is your DBQuery function - it seems you're trying to do something that's already built into the DBI? If I understand your question correctly, you're trying to replicate something like [selectall_arrayref][1]:
>This utility... |
Nope.
But it doesn't hurt to add `equals` methods to your own classes. I try to never use `==` when comparing objects (the same goes for `===`, which is the same thing for objects) since it only checks _identity_ .
Sadly all the collections in Flash and Flex assume that identity is the only measure of equality t... |
We would all be remiss not to mention that dynamic XML element names are generally a bad idea. The whole point of XML is to create a store a data structure in a form that is readily:
1. Verifiable
2. Extendable
Dynamic element names fail that first condition. Why not simply use a standard XML format for storing ... |
@Matt David,
Please read documentation and take a look at the code samples for Microsoft [CompositeWPF][1] (aka Prism). It's a project created specifically to teach how to deal with MVP/MVC architecture in test-driven manner. Their sample application contains unit tests for presenters\controllers and very cool accep... |
'Break' equivalent keyword for VB |
|vb.net|vb6|loop| |
Just moved over to the 'vb team' here at work.
Quick easy one for my 1st question.
What is the 'Break' equivalent keyword for VB ie to exit a loop early but not the method.
Cheers. |
|vb6|loop| |
|vb6|loop|vb.net| |
Just moved over to the VB team here at work.
Quick easy one for my 1st question.
What is the equivalent keyword to `break` in VB, i.e., to exit a loop early but not the method?
Cheers! |
|vb.net|vb6|loop|breaks|exit| |
|vb.net|vb6|loops|breaks|exit| |
C# loop - break vs. continue |
|c#|language-agnostic|loop|foreach| |
In a C# (feel free to answer for other languages) loop, what's the difference between break and continue as a means to leave the structure of the loop, and go to the next iteration?
Example:
foreach (DataRow row in myTable.Rows)
{
if (someConditionEvalsToTrue)
{
break; //wh... |
|c#|language-agnostic|loops|foreach| |
Replacement for for... if array iteration |
|python|.net|arrays|iteration|loop| |
I love list comprehensions in Python, because they concisely represent a transformation of a list.
However, in other languages, I frequently find myself writing something along the lines of:
foreach (int x in intArray)
if (x > 3) //generic condition on x
x++
//do other processing
... |
|.net|python|arrays|iteration|loop| |
|.net|python|arrays|loops|iteration| |
Continue Considered Harmful? |
|continue|.net|c#|goto|loop| |
Should developers avoid using [continue][1] in C# or its equivalent in other languages to force the next iteration of a loop? Would arguments for or against overlap with arguments about [Goto][2]?
[1]: http://msdn.microsoft.com/en-us/library/923ahwt1.aspx
[2]: http://stackoverflow.com/questions/46586/goto-st... |
Linking two Office documents |
|microsoft|office2007|office2003| |
**Problem:**
I have two spreadsheets that each serve different purposes but contain one particular piece of data that needs to be the same in both spreadsheets. This piece of data (one of the columns) gets updated in spreadsheet A but needs to also be updated in spreadsheet B.
**Goal:**
A solution that would... |
|microsoft|office-2007|office-2003| |
Office 2007 File Type, Mime Types and Identifying Characters |
|office2007|file-type| |
Where could I find a list of mime types and identifying characters for office 2007 files. I have an upload form that is restricting uploads based on extension and identifying characters but I cannot seem to find the office 2007 mime types.
Thanks!
Matt |
|file-type|office2007| |
|office-2007|file-type| |
Metanet Software has published [some relevant tutorials](http://www.harveycartel.org/metanet/tutorials.html). Metanet develops [N](http://www.thewayoftheninja.org/n.html) (Flash-based, for Windows, Mac, Linux) and [N+](http://www.thewayoftheninja.org/n_future.html) (for the X360, DS, and PSP). |
Advice on how to be graphically creative |
|creativity|graphics| |
I've always felt that my graphic design skills have lacked, but I do have a desire to improve them. Even though I'm not the worlds worst artist, it's discouraging to see the results from a professional designer, who can do an amazing mockup from a simple spec in just a few hours. I always wonder how they came up with... |
|creativity|graphics|off-topic| |
|graphics|off-topic|creativity| |
I think WPF can greatly improve user experience.
However there are not much business oriented controls out there which means you need to do a lot by yourself.
As for designers I think it's really hard to find WPF designer now days, it still would be a dedicated programmer rather then design-only guy.
I h... |
What you can do is wire up to the init event of the [Sys.Application](http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys/ApplicationClass/default.aspx) class. then set a global variable to specify that the first load is done. then you'll know if it's a post back or initial load. |
What you can do is wire up to the load event of the [Sys.Application](http://msdn.microsoft.com/en-us/library/bb310856.aspx) class. you can then use the isPartialLoad property of the [Sys.ApplicationLoadEventArgs](http://msdn.microsoft.com/en-us/library/bb397457.aspx) class. I believe that would let you know if you are... |
Woe is me. I ended up doing this:
mre = mobile_number && ('%' + mobile_number.gsub(/\D/, '').scan(/./m).join('%'))
find(:first, :conditions => ['trim(mobile_phone) like ?', mre]) |
TicketDesk- C# issue tracking system and support system
http://www.codeplex.com/TicketDesk
TicketDesk is efficient and designed to do only one thing, facilitate communications between help desk staff and end users. The overriding design goal is to be as simple and frictionless for both users and help desk staff... |
There was a palm based C compiler. I had some trouble finding it though, but it's called [OnBoard-C](http://sourceforge.net/projects/onboardc/). It didn't exactly have an IDE, it compiled notes. Considering there's a lack of embedded compilers, I'd be surprised to find full embedded IDEs.
This maybe premature but, ... |
There was a palm based C compiler. I had some trouble finding it though, but it's called [OnBoard-C](http://sourceforge.net/projects/onboardc/). It didn't exactly have an IDE, it compiled notes. Considering there's a lack of embedded compilers, I'd be surprised to find full embedded IDEs. Oh... I recall there being a ... |
I would store it in an Xml object and then use its methods to search for the node value you need.
var returnedXml:Xml = new Xml(event.result.toString());
_edit: hold on, finding the right method..._
|
I would store it in an Xml object and then use its methods to search for the node value you need.
var returnedXml:Xml = new Xml(event.result.toString()); |
I would definitely recommend [git][1]
Works great for both big and small teams. Only drawback is poor native windows support. Although it works fine for me in Cygwin.
[1]: http://git.or.cz/ "git" |
Is there any difference between the box models of IE8 and Firefox3? |
|firefox|browser|internet-explorer-8| |