Daily Archives

Articles indexed Tuesday May 25 2010

Page 2/118 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How do you implement file drag-and-drop upload in Google Chrome?

    - by Chris R
    I've found several tutorials online about implementing file drag/drop with Firefox 3.6 (they involve using a FileReader object to get the file binary data). However, I cannot create a FileReader object in Chrome on Windows or Mac. Does anyone know what the API is to read and manipulate data from a drag-and-dropped file in Chrome? If I can get the binary data of the file, I already have the rest of the code to perform the upload. Note: I've also tried using the getAsBinary() function call on the file object of the drag event (event.dataTransfer.file) but I believe that is a Mozilla-specific function and not implemented in Chrome. Also, I'm not interested in a solution using google gears or one that requires a user to select files from a dialog. I'm specifically trying to implement a drag-and-drop file upload.

    Read the article

  • How do I program a hyperlink to include a username and password to the target site?

    - by Fred Griffith
    We have a website with a section restricted to members only. They log in and can view the website. Some of the information is stored on another server. We want that information to ONLY be accessible to those who have logged into the main website. What would be the best way to link the two sites, without making members log in again? Seems like there must be some way to send an encrypted username and password along with the URL in the hyperlink. Any ideas? Thank you in advance. Fred G.

    Read the article

  • extract/slice/reorder lists in (emacs) lisp?

    - by Stephen
    In python, you might do something like i = (0, 3, 2) x = [x+1 for x in range(0,5)] operator.itemgetter(*i)(x) to get (1, 4, 3). In (emacs) lisp, I wrote this function called extract which does something similar, (defun extract (elems seq) (mapcar (lambda (x) (nth x seq)) elems)) (extract '(0 3 2) (number-sequence 1 5)) but I feel like there should be something built in? All I know is first, last, rest, nth, car, cdr... What's the way to go? ~ Thanks in advance ~

    Read the article

  • ASP.NET inline code in a server control

    - by John
    Ok, we had a problem come up today at work. It is a strange one that I never would have even thought to try. <form id="form1" runat="server" method="post" action="Default.aspx?id=<%= ID %>" > Ok, it is very ugly and I wouldn't have ever tried it myself. It came up in some code that was written years ago but had been working up until this weekend after a bunch of updates were installed on a client's web server where the code is hosted. The actual result of this is the following html: <form name="form1" method="post" action="Default.aspx?id=&lt;%= ID %>" id="form1"> The url ends up like this: http://localhost:6735/Default.aspx?id=<%= ID %> Which as you can see, demonstrates that the "<" symbol is being encoded before ASP.NET actually processes the page. It seems strange to me as I thought that even though it is not pretty by any means, it should work. I'm confused. To make matters worse, the client insists that it is a bug in IE since it appears to work in Firefox. In fact, it is broken in Firefox as well, except for some reason Firefox treats it as a 0. Any ideas on why this happens and how to fix it easily? Everything I try to render within the server control ends up getting escaped. Edit Ok, I found a "fix" <form id="form1" runat="server" method="post" action='<%# String.Format("Default.aspx?id={0}", 5) %>' > But that requires me to call DataBind which is adding more of a hack to the original hack. Guess if nobody thinks of anything else I'll have to go with that.

    Read the article

  • CakePHP Routing Alias, no prefix

    - by Jason McCreary
    I have a dashboard with a series of widgets. Per specification, the widgets need to be buried under a /widgets/ directory. So I have added the following to my routes.php Router::connect('/widget/:controller/:action/*', array()); But I seem to be running into trouble on widgets/links/ and widgets/links/view/1 I am new to CakePHP, but this doesn't seem all that impressive. I have yet to find anything in the Book or by search. So any help is appreciated. Thanks.

    Read the article

  • com.jcraft.jsch.JSchException: Auth cancel

    - by Dan Fabulich
    I'm trying to write an Ant script to retrieve an URL via port tunnelling. It works great when I use a password (the names xxxx'd out for privacy): <project default="main"> <target name="main"> <sshsession host="xxxx" username="xxxx" password="xxxx"> <LocalTunnel lport="1080" rhost="xxxx" rport="80"/> <sequential> <get src="http://localhost:1080/xxxx" dest="/tmp/xxxx"/> </sequential> </sshsession> </target> </project> But it doesn't work when I use a keyfile, like this: <sshsession host="xxxx" username="xxxx" keyfile="/Users/xxxx/.ssh/id_dsa" passphrase="xxxx"> <LocalTunnel lport="1080" rhost="xxxx" rport="80"/> <sequential> <get src="http://localhost:1080/xxxx" dest="/tmp/xxxx"/> </sequential> </sshsession> I get this exception: /tmp/build.xml:8: com.jcraft.jsch.JSchException: Auth cancel at com.jcraft.jsch.Session.connect(Session.java:451) at com.jcraft.jsch.Session.connect(Session.java:150) at org.apache.tools.ant.taskdefs.optional.ssh.SSHBase.openSession(SSHBase.java:223) I'm sure I'm using the correct keyfile (I've tried using the wrong name, which gives a legitimate FileNotFoundException). I can successfully ssh from the command line without being prompted for a password. I'm sure I'm using the correct passphrase for the keyfile. What's the cause of this error and what can I do about it?

    Read the article

  • Debugging mono assembly load error

    - by Will I Am
    I am running asp.net/mono on Ubuntu with lighthttpd/fastcgi. Somehow I suspect an assembly reference sneaked in that I cannot track down, and it's causing my application to fail (it works fine on windows under MS.NET). When I try it under mono, I get: Failed to create shadow copy (CopyFile). Description: HTTP 500. Error processing request. Stack Trace: System.ExecutionEngineException: Failed to create shadow copy (CopyFile). at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool) at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] at System.Web.Compilation.BuildManager.LoadAssembly (System.String path, System.Collections.Generic.List`1 al) [0x00000] at System.Web.Compilation.BuildManager.GetReferencedAssemblies () [0x00000] at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Collections.Generic.List`1 buildItems, System.Web.VirtualPath virtualPath, BuildKind buildKind) [0x00000] at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00000] Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433 I am at a loss to how to debug this, as it's not giving me a hint of what assembly it's having problem with. Any ideas?

    Read the article

  • Generating Unordered List with PHP + CodeIgniter from a MySQL Database

    - by Tim
    Hello Everyone, I am trying to build a dynamically generated unordered list in the following format using PHP. I am using CodeIgniter but it can just be normal php. This is the end output I need to achieve. <ul id="categories" class="menu"> <li rel="1"> Arts &amp; Humanities <ul> <li rel="2"> Photography <ul> <li rel="3"> 3D </li> <li rel="4"> Digital </li> </ul> </li> <li rel="5"> History </li> <li rel="6"> Literature </li> </ul> </li> <li rel="7"> Business &amp; Economy </li> <li rel="8"> Computers &amp; Internet </li> <li rel="9"> Education </li> <li rel="11"> Entertainment <ul> <li rel="12"> Movies </li> <li rel="13"> TV Shows </li> <li rel="14"> Music </li> <li rel="15"> Humor </li> </ul> </li> <li rel="10"> Health </li> And here is my SQL that I have to work with. -- -- Table structure for table `categories` -- CREATE TABLE IF NOT EXISTS `categories` ( `id` mediumint(8) NOT NULL auto_increment, `dd_id` mediumint(8) NOT NULL, `parent_id` mediumint(8) NOT NULL, `cat_name` varchar(256) NOT NULL, `cat_order` smallint(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; So I know that I am going to need at least 1 foreach loop to generate the first level of categories. What I don't know is how to iterate inside each loop and check for parents and do that in a dynamic way so that there could be an endless tree of children. Thanks for any help you can offer. Tim

    Read the article

  • How do I get AuthLogic to skip Password validation?

    - by ndp
    I think I'm just missing something obvious. I send a user a perishable token embedded in a link. They click on it, and they come back to the site. I want to log them in automatically (I'm not building a banking app). This seems like this should be simple, but all the examples I've found require a password. How do I skip this completely? I just seem to get UserSession.create to work.

    Read the article

  • How to access attributes using Nokogiri

    - by Liz
    I have a simple task of accessing the values of some attributes. Below is a simple script that uses Nokogiri::XML::Builder to create a simple xml doc. require 'nokogiri' builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml| xml.Placement(:messageId => "392847-039820-938777", :system => "MOD", :version => "2.0") { xml.objects { xml.object(:myattribute => "99", :anotherattrib => "333") xml.nextobject_ '9387toot' xml.Entertainment "Last Man Standing" } } end puts builder.to_xml puts builder.root.attributes["messageId"] The results are below: <?xml version="1.0" encoding="UTF-8"?> <Placement messageId="392847-039820-938777" version="2.0" system="MOD"> <objects> <object anotherattrib="333" myattribute="99"/> <nextobject>9387toot</nextobject> <Entertainment>Last Man Standing</Entertainment> </objects> </Placement> C:/Ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-x86-mingw32/lib/nokogiri/xml/document.rb:178:in `add_child': Document already has a root node (RuntimeError) from C:/Ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-x86-mingw32/lib/nokogiri/xml/node.rb:455:in `parent=' from C:/Ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-x86-mingw32/lib/nokogiri/xml/builder.rb:358:in `insert' from C:/Ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.2-x86-mingw32/lib/nokogiri/xml/builder.rb:350:in `method_missing' from C:/Documents and Settings/etrojan/workspace/Lads/tryXPATH2.rb:15 The xml that is generated looks fine. However, my attempts to access attributes cause an error to be generated, "Document already has a root node". I don't understand why a puts statement would cause this error. Any suggestions would be greatly appreciated.

    Read the article

  • Apple Security Isn't a Sure Bet

    <b>Enterprise Networking Planet:</b> "Apple Macs are secure because they don't get computer viruses, and because OS X, the operating system they run, is based on the rock-solid and highly secure BSD UNIX."

    Read the article

  • Intel Puts Mobile CPUs on a Diet for Ultra-Thin Laptops

    <b>Hardware Central:</b> "Intel today broadened its number of ultra-low voltage processors (ULV) to include a complete range, from Celeron to Core i7, for the super-thin laptop market. This announcement builds on Intel's January introduction of laptop processors, which included only a few low-end ULV processors."

    Read the article

  • KWin Can Cause A Performance Hit Too, But It's Different From Compiz

    <b>Phoronix:</b> "This surprised many so we published another article entitled The Cost Of Running Compiz where we showed the performance penalties of a compositing window manager with different hardware and drivers. This led some to ask whether the performance of KWin also causes the OpenGL frame-rate to drop, so here are those KDE benchmarks."

    Read the article

  • MPEG LA Shrugs Off Antitrust Allegations

    <b>Law.com:</b> "MPEG LA, as we've told you here and here, is in the business of issuing licenses for pools of patents related to digital video technology. Companies that want to make consumer technology products can take a license from MPEG LA and not worry about being sued."

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >