Search Results

Search found 1032 results on 42 pages for 'jon b'.

Page 26/42 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • An Ideal Keyboard Layout for Programming

    - by Jon Purdy
    I often hear complaints that programming languages that make heavy use of symbols for brevity, most notably C and C++ (I'm not going to touch APL), are difficult to type because they require frequent use of the shift key. A year or two ago, I got tired of it myself, downloaded Microsoft's Keyboard Layout Creator, made a few changes to my layout, and have not once looked back. The speed difference is astounding; with these few simple changes I am able to type C++ code around 30% faster, depending of course on how hairy it is; best of all, my typing speed in ordinary running text is not compromised. My questions are these: what alternate keyboard layouts have existed for programming, which have gained popularity, are any of them still in modern use, do you personally use any altered layout, and how can my layout be further optimised? I made the following changes to a standard QWERTY layout. (I don't use Dvorak, but there is a programmer Dvorak layout worth mentioning.) Swap numbers with symbols in the top row, because long or repeated literal numbers are typically replaced with named constants; Swap backquote with tilde, because backquotes are rare in many languages but destructors are common in C++; Swap minus with underscore, because underscores are common in identifiers; Swap curly braces with square brackets, because blocks are more common than subscripts; and Swap double quote with single quote, because strings are more common than character literals. I suspect this last is probably going to be the most controversial, as it interferes the most with running text by requiring use of shift to type common contractions. This layout has significantly increased my typing speed in C++, C, Java, and Perl, and somewhat increased it in LISP and Python.

    Read the article

  • Drag drop open file in Macvim split window?

    - by Jon
    Hello. I like to use the split window feature in Vim. However I cannot seem to drag drop new files into the different sections. Doing so will just open a new tab. I don't like using tabs as I still need to flick between them and not much different to using separate windows. Is there anyway I can change this behaviour? It works fine on Windows gVim and Im using the same vimrc file.

    Read the article

  • Preserving order when copying elements using Deliverance / XPath

    - by Jon Hadley
    How would I, using Deliverance & XPath (or CSS) selectors, select and copy list items .one and .three from each list below, but display them in the order of their parent list? <ul id="a-wrapper"> <li class="one"></li> <li class="two"></li> <li class="three"></li> <li class="four"></li> </li> <ul id="b-wrapper"> <li class="one"></li> <li class="two"></li> <li class="three"></li> <li class="four"></li> </ul> c,d,e,f,g etc.... The catch is it needs to use a href rule, eg: <prepend href="/blah/deblah" content="#x" theme="#y" /> Using the following just lists all the .one elements, then all the .three elements. <prepend href="/blah/deblah" content=".one" theme="#y" /> <prepend href="/blah/deblah" content=".three" theme="#y" />

    Read the article

  • How do you sort php and sql arrays?

    - by Jon
    How can I sort this array by city or by id in descending order? if ($num > 0 ) { $i=0; while ($i < $num) { $city = mysql_result($result,$i,"city"); $state = mysql_result($result,$i,"state"); $id = mysql_result($result,$i,"id"); echo "$city"; echo "$state"; ++$i; } } else { echo "No results."; } ?>

    Read the article

  • need an empty string, but getting an exception in ruby on rails

    - by Jon
    controller @articles = current_user.articles view <% @articles.each do |article| %> <%= link_to "#{article.title} , #{article.author.name}" articles_path%> <% end %> Sometimes the article has no author, so is null in the database, which results in the following error You have a nil object when you didn't expect it! The error occurred while evaluating nil.name I still want to output the article title in this scenario, whats the best way to do this please?

    Read the article

  • ASCII Diagram Tool

    - by Jon
    I'm looking for an ASCII diagram tool for producing diagrams from text. I only really need sequence and state type diagrams for now, but I'm curious as to what people would recommend? I need something which is standalone, not a web based tool that works on Linux, OSX and Windows.

    Read the article

  • Converting LDAP from Tomcat to GlassFish

    - by Jon
    Hi, I have a simple web-app that is developed in Netbeans(6.8) and works fine in Tomcat(6) using LDAP(Active Directory). I need to convert this to an EE (JSF2), so I am moving from Tomcat to GlassFish(v3). I have changed the web files to xhtml and configured the xml files. However, I cannot get the GlassFish LDAP configuration to authenticate. I am attaching my old web.xml and server.xml (from Tomcat) snippets and the portions of the new web.xml, sun-web.xml, and the GlassFish configuration. If anyone can help me figure out where I am missing the piece that will allow a user to be authenticated, I would appreciate it. (btw, I am not using roles, just authenticating against the LDAP db is good enought.) As it is right now, my app will prompt me to enter a user when I try to access a file in the 'protected' area and the GlassFish server throws an exception when it fails to authenticate. Because it works under Tomcat, I know I have the right information, I just don't know how to format it to get GlassFish to pass it along. Thanks. TOMCAT FILES: - Tomcat server.xml: web.xml: <web-resource-collection> <web-resource-name>Protected Area</web-resource-name> <description>Authentication Required</description> <url-pattern>/faces/protected/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>*</role-name> </auth-constraint> * BASIC Please enter your user name and password: GLASSFISH FILES: (I enabled the Security Manager on the Security panel, set the Default Realm to 'LDAPRealm', and added "-Djava.naming.referral=follow" JVM options.) - domain.xml: <auth-realm name="certificate" classname="com.sun.enterprise.security.auth.realm.certificate.CertificateRealm" /> <auth-realm classname="com.sun.enterprise.security.auth.realm.ldap.LDAPRealm" name="LdapRealm"> <property description="()" name="search-bind-password" value="xxxxxxxx" /> <property description="()" name="search-bind-dn" value="cn=xxxxxxxx,ou=Administrators,ou=Information Technology,ou=ITTS,ou=Administrative,ou=xxx,dc=xxxxxx,dc=xxx" /> <property name="jaas-context" value="ldapRealm" /> <property name="base-dn" value="ou=xxx,dc=xxxxxx,dc=xxx" /> <property name="directory" value="ldap://xxxx.xxxxxx.xxx:389" /> <property name="search-filter" value="(&amp;(objectClass=user)(sAMAccountName=%s))" /> </auth-realm> -web.xml: <security-constraint> <display-name>protected</display-name> <web-resource-collection> <web-resource-name>ProtectedArea</web-resource-name> <description/> <url-pattern>/faces/protected/*</url-pattern> </web-resource-collection> <auth-constraint> <description/> <role-name>*</role-name> </auth-constraint> </security-constraint> <security-role> <description/> <role-name>*</role-name> </security-role> <login-config> <auth-method>FORM</auth-method> <realm-name>LDAPRealm</realm-name> <form-login-config> <form-login-page>/faces/login.xhtml</form-login-page> <form-error-page>/faces/loginError.xhtml</form-error-page> </form-login-config> </login-config> sun-web.xml: Here is the exception that it throws: SEVERE: SEC1113: Exception in LdapRealm when trying to authenticate user. javax.security.auth.login.LoginException: javax.security.auth.login.LoginException: User yyyyyyy not found. at com.sun.enterprise.security.auth.realm.ldap.LDAPRealm.findAndBind(LDAPRealm.java:450)

    Read the article

  • Robocopy for Windows 2003 doesn't support /DST option

    - by Jon
    Does anyone know if it is possible to download the latest robocopy for Windows 2003. The latest version provides the /DST option which ignores time stamps changed due to BST (British Summer Time). Every time we do a build and sync our servers when we go +1/-1 hour it takes hours instead of minutes because it sees everything as changed. I noticed it is included automatically with Vista/Win7 but the Resource toolkit that I downloaded doesn't include a new version of robocopy for Win Server 2003. If there is a place to download it from & will it also work on Windows Server 2003? Thanks.

    Read the article

  • Windows Structured Exception Handling: simple test program will not compile.

    - by Jon
    #include <windows.h> int main() { int* i = (int*)malloc(sizeof(int)); *i = 5; __try { free(i); free(i); } __except { return -1; } return 0; } I am trying to learn more about windows SEH. My first test program is giving me some real trouble. I have looked at the msdn documentation and I am still not really sure what I have wrong. I am getting the following errors when I try to compile this program: error C2059: syntax error : '{' error C2143: syntax error : missing ';' before '{' both on line 15. Thanks.

    Read the article

  • AI testing framework

    - by Jon
    I am looking at developing an AI player for a simple game I have created in C#. I will be creating a population of the bots and evolving them over generations. What I was wondering is there any frameworks out there that could be good for this sort of testing / development. Ideally I would like something that I could plug any / some type of games into and say, OK so have a population of X run it over Y generations and chart the results for me. I was having a think about how I would create something that would do this for me and allow me to reuse this later for different AI projects and all I could think of was to have some sort of core code and some interface contracts that the game and AI would use so that the server can script it. What are your thoughts, does anyone have any practical experience of this sort of thing?

    Read the article

  • Caffeine and Stimulant Usage

    - by Jon Purdy
    Let's see how many of us fit the old stereotype, shall we? Do you typically use caffeine when programming? During the day or at night? How frequently do you pull all-nighters? Do you use caffeine when you do stay up late? Do you prefer to have a large amount of caffeine all at once, or small amounts over a longer period of time? Do you use energy drinks, 5-hour energy shots, coffee, tea, or caffeine pills? How about other stimulants such as amphetamines? For instance, I've known a programmer who dabbled in speed because they believed it increased their ability to focus on programming, though happily they're clean now and quite honest about the whole experience. Share, discuss, find the Ballmer Peak of caffeine, enjoy. Happy Easter.

    Read the article

  • How do I use .htaccess to redirect to a URL containing HTTP_HOST?

    - by Jon Cram
    Problem I need to redirect some short convenience URLs to longer actual URLs. The site in question uses a set of subdomains to identify a set of development or live versions. I would like the URL to which certain requests are redirected to include the HTTP_HOST such that I don't have to create a custom .htaccess file for each host. Host-specific Example (snipped from .htaccess file) Redirect /terms http://support.dev01.example.com/articles/terms/ This example works fine for the development version running at dev01.example.com. If I use the same line in the main .htaccess file for the development version running under dev02.example.com I'd end up being redirected to the wrong place. Ideal rule (not sure of the correct syntax) Redirect /terms http://support.{HTTP_HOST}/articles/terms/ This rule does not work and merely serves as an example of what I'd like to achieve. I could then use the exact same rule under many different hosts and get the correct result. Answers? Can this be done with mod_alias or does it require the more complex mod_rewrite? How can this be achieved using mod_alias or mod_rewrite? I'd prefer a mod_alias solution if possible. Clarifications I'm not staying on the same server. I'd like: http://example.com/terms/ - http://support.example.com/articles/terms/ https://secure.example.com/terms/ - http://support.example.com/articles/terms/ http://dev.example.com/terms/ - http://support.dev.example.com/articles/terms/ https://secure.dev.example.com/terms/ - http://support.dev.example.com/articles/terms/ I'd like to be able to use the same rule in the .htaccess file on both example.com and dev.example.com. In this situation I'd need to be able to refer to the HTTP_HOST as a variable rather than specifying it literally in the URL to which requests are redirected. I'll investigate the HTTP_HOST parameter as suggested but was hoping for a working example.

    Read the article

  • Rails & Twilio: Receiving nil when storing texts received from Twilio

    - by Jon Smooth
    I have set up the request URL in my Twilio account to have it POST to: myurl.com/receivetext. It appears to be successfully posting because when I check the database using the Heroku console I see the following: Post id: 5, body: nil, from: nil, created_at: "2012-06-14 17:28:01", updated_at: "2012-06-14 17:28:01" Why is it receiving nil for the body and from attributes? I can't figure out what I'm doing wrong! The created and updated at are storing successfully but the two attributes that I care about continue to be stored as nil. Here's the Receive Text controller which is receiving the Post request from Twilio: class ReceiveTextController < ApplicationController def index @post=Post.create!(body: params[:Body], from: params[:From]) end end EDIT: When I dump the params I receive the following: "{\"controller\"=\"receive_text\", \"action\"=\"index\"}" I attained this by inserting the following into my ReceiveText controller. @params = Post.create!(body: params.inspect, from: "Dumping Params") and then opening up the Heroku console to find the database entry with from = "Dumping Params". I simulated a Twilio request with a curl with the following command curl -X POST myurl.com/receivetext route -d 'AccountSid=AC123&From=%2B19252411234' I checked the production database again and noticed that the curl request did work when obtaining the FROM atribute. It stored the following: params.inspect returned "{\"AccountSid\"=\"AC123\", \"From\"=\"+19252411234\", \"co..." I received a comment stating: "As long as twilio is hitting the same URL with the same method (GET/POST) it should be filling the params array as well" I have no idea how to make this comment actionable. Any help would be greatly appreciated! I'm very new to rails. Here's my database migration (I have both attributes set to string. I have tried setting it to text and that didn't work either) : class CreatePosts < ActiveRecord::Migration def change create_table :posts do |t| t.string :body t.string :from t.timestamps end end end Here is my Post model: class Post < ActiveRecord::Base attr_accessible :body, :from end Routes (everything appears to be routing just fine) : MovieApp::Application.routes.draw do get "receive_text/index" get "pages/home" get "send_text/send_text_message" root to: 'pages#home' match '/receivetext', to: 'receive_text#index' match '/pages/home', to: 'pages#home' match '/sendtext', to: 'send_text#send_text_message' end Here's my gemfile (incase it helps) source 'https://rubygems.org' gem 'rails', '3.2.3' gem 'badfruit' gem 'twilio-ruby' gem 'logger' gem 'jquery-rails' group :production do gem 'pg' end group :development, :test do gem 'sqlite3' end group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' end

    Read the article

  • how to pass arguments into function within a function in r

    - by jon
    I am writing function that involve other function from base R with alot of arguments. For example (real function is much longer): myfunction <- function (dataframe, Colv = NA) { matrix <- as.matrix (dataframe) out <- heatmap(matrix, Colv = Colv) return(out) } data(mtcars) myfunction (mtcars, Colv = NA) The heatmap has many arguments that can be passed to: heatmap(x, Rowv=NULL, Colv=if(symm)"Rowv" else NULL, distfun = dist, hclustfun = hclust, reorderfun = function(d,w) reorder(d,w), add.expr, symm = FALSE, revC = identical(Colv, "Rowv"), scale=c("row", "column", "none"), na.rm = TRUE, margins = c(5, 5), ColSideColors, RowSideColors, cexRow = 0.2 + 1/log10(nr), cexCol = 0.2 + 1/log10(nc), labRow = NULL, labCol = NULL, main = NULL, xlab = NULL, ylab = NULL, keep.dendro = FALSE, verbose = getOption("verbose"), ...) I want to use these arguments without listing them inside myfun. myfunction (mtcars, Colv = NA, col = topo.colors(16)) Error in myfunction(mtcars, Colv = NA, col = topo.colors(16)) : unused argument(s) (col = topo.colors(16)) I tried the following but do not work: myfunction <- function (dataframe, Colv = NA) { matrix <- as.matrix (dataframe) out <- heatmap(matrix, Colv = Colv, ....) return(out) } data(mtcars) myfunction (mtcars, Colv = NA, col = topo.colors(16))

    Read the article

  • Making a jQuery plugin work on all objects

    - by Jon Winstanley
    I am using the jQuery physics plugin for a pet project I am working on. The plugin enables the moving of DOM objects in realistic ways using velocity, gravity, wind etc. However I want to use the plugin to calculate where objects are to be placed inside a canvas element, not DOM objects. How do I change the plugin script functions to work on any object with 'top' and 'left' properties rather than only working with DOM objects: Currently the script functions look like this: jQuery.fn.funname = function() { return this; };

    Read the article

  • iPhone Mobile Safari File System Access

    - by Jon Smallberries
    Is it possible to write to a file in a native iPhone application and have a Safari browser read from that file after having the browser opened from the native app? Alternatively (and this would be great!), would it be possible to launch a mobile Safari webapp from a native iPhone app, and have that application access the OS 3.0 External Accessory Framework? My assumption is no... Basically, I have a functioning iPhone app that wraps a simple mobile Safari webapp, but I'd like to utilize the external accessory framework once I have launched the Safari webapp from the iPhone app...

    Read the article

  • recursive_directory_iterator exception

    - by Jon
    I'm writing a simple program which moves files on my desktop to new location. I don't understand why it crashes after the file has been moved. for(recursive_directory_iterator it(desktop), end; it != end; ++it) { if(it->path().leaf() == fileToMove) { rename(*it, newPath); } } A point in the right direction would be appropriated. Thanks!

    Read the article

  • Tying PyQt4 QAction triggered() to local class callable doesn't seem to work. How to debug this?

    - by Jon Watte
    I create this object when I want to create a QAction. I then add this QAction to a menu: class ActionObject(object): def __init__(self, owner, command): action = QtGui.QAction(command.name, owner) self.action = action self.command = command action.setShortcut(command.shortcut) action.setStatusTip(command.name) QtCore.QObject.connect(action, QtCore.SIGNAL('triggered()'), self.triggered) def triggered(self): print("got triggered " + self.command.id + " " + repr(checked)) Unfortunately, when the menu item is selected, the 'triggered' function is not called. QtCore.QObject.connect() returns True. Nothing is printed on the console to indicate that anything is wrong, and no exception is thrown. How can I debug this? (or, what am I doing wrong?)

    Read the article

  • writing XML with Xerces 3.0.1 and C++ on windows

    - by Jon
    Hi, i have the following function i wrote to create an XML file using Xerces 3.0.1, if i call this function with a filePath of "foo.xml" or "../foo.xml" it works great, but if i pass in "c:/foo.xml" then i get an exception on this line XMLFormatTarget *formatTarget = new LocalFileFormatTarget(targetPath); can someone explain why my code works for relative paths, but not absolute paths please? many thanks. const int ABSOLUTE_PATH_FILENAME_PREFIX_SIZE = 9; void OutputXML(xercesc::DOMDocument* pmyDOMDocument, std::string filePath) { //Return the first registered implementation that has the desired features. In this case, we are after a DOM implementation that has the LS feature... or Load/Save. DOMImplementation *implementation = DOMImplementationRegistry::getDOMImplementation(L"LS"); // Create a DOMLSSerializer which is used to serialize a DOM tree into an XML document. DOMLSSerializer *serializer = ((DOMImplementationLS*)implementation)->createLSSerializer(); // Make the output more human readable by inserting line feeds. if (serializer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true)) serializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); // The end-of-line sequence of characters to be used in the XML being written out. serializer->setNewLine(XMLString::transcode("\r\n")); // Convert the path into Xerces compatible XMLCh*. XMLCh *tempFilePath = XMLString::transcode(filePath.c_str()); // Calculate the length of the string. const int pathLen = XMLString::stringLen(tempFilePath); // Allocate memory for a Xerces string sufficent to hold the path. XMLCh *targetPath = (XMLCh*)XMLPlatformUtils::fgMemoryManager->allocate((pathLen + ABSOLUTE_PATH_FILENAME_PREFIX_SIZE) * sizeof(XMLCh)); // Fixes a platform dependent absolute path filename to standard URI form. XMLString::fixURI(tempFilePath, targetPath); // Specify the target for the XML output. XMLFormatTarget *formatTarget = new LocalFileFormatTarget(targetPath); //XMLFormatTarget *myFormTarget = new StdOutFormatTarget(); // Create a new empty output destination object. DOMLSOutput *output = ((DOMImplementationLS*)implementation)->createLSOutput(); // Set the stream to our target. output->setByteStream(formatTarget); // Write the serialized output to the destination. serializer->write(pmyDOMDocument, output); // Cleanup. serializer->release(); XMLString::release(&tempFilePath); delete formatTarget; output->release(); }

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >