Daily Archives

Articles indexed Sunday June 6 2010

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

  • ruby 1.9: invalid byte sequence in UTF-8

    - by Marc Seeger
    I'm writing a crawler in ruby (1.9) that consumes lots of HTML from a lot of random sites. When trying to extract links, I decided to just use .scan(/href="(.*?)"/i) instead of nokogiri/hpricot (major speedup). The problem is that I now receive a lot of "invalid byte sequence in UTF-8" errors. From what I understood, the net/http library doesn't have any encoding specific options and the stuff that comes in is basically not properly tagged. What would be the best way to actually work with that incoming data? I tried .encode with the replace and invalid options set, but no success so far...

    Read the article

  • Chrome troubles...

    - by GaVrA
    Take this site for example: http://pms.rs/contact Everything is just fine just by using this css for textarea: #kontakt input, #kontakt textarea{ width:250px; } #kontakt textarea{ height:150px; } But ofc chrome is always smarter and in it user can drag that bottom right corner of textarea and resize it to the size he likes. Call me control freak, but that is very dumb thing to have if no other browser is using that. On sites like this it is not a big deal, but somewhere it can cover the entire content and for me personaly, i like to limit as much as possible what user can do so he does not break my site(like for example adding too large images in posts on forums...). So i have to do something like this: #kontakt input, #kontakt textarea{ width:250px; } #kontakt textarea{ height:150px; max-height:150px; max-width:250px; } Just so i get chrome to play as all other browsers do... While i was typing this i realised that i really dont have any question per se, but i just thought to share this with SO public, so i will mark this as community wiki. Also some other things i noticed are inputs, i always have to put width for input or textarea just because chrome is always not rendering them as he should.

    Read the article

  • Is there any reason why someone would want to create an Core Data model programmatically?

    - by mystify
    I wonder in which cases it would be good to make an NSManagedObjectModel completely programmatically, with NSEntityDescription instances and all this stuff. I'm that kind of person who prefers to code programmatically, rejecting Interface Builder. But when it comes to Core Data, I have a hard time figuring out why I should kill my time NOT using the nice Xcode Data Modeler tool. And since data models are stuck to a given state (except when you want to do some ugly migration operations where thinks probably go wrong and users get mad, really mad), I see no big sense in a data model that's made programmatically for the purpose of changing it all the time. Did I miss something?

    Read the article

  • What font is the jQuery logo?

    - by Yuval
    I'm asking here just because the subject matter is jQuery. Does anybody happen to know what font is used for the jQuery logo? Trying to find out through WhatTheFont failed miserably. Any ideas? Thanks!

    Read the article

  • Memcache localhost connection oddity

    - by MatW
    When I try to connect to memcache using this code: $memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Could not connect"); The call dies with the "Could not connect" error, but if I use localhost's IP: $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211) or die ("Could not connect"); It works! So what's my problem? Well, this new computer is the only development environment I've setup that's been sensitive to that difference. I'm not about to go changing the settings on any code for what seems to be a computer specific issue, but I can't figure out what could be causing this behaviour... Any ideas? I'm running XP, memcached 1.2.4, and wampserver 2. I've checked the hosts file and it does have an entry for localhost.

    Read the article

  • FBML + jquery Validation + Rails

    - by user359467
    Hi all, In my local machine i have a scaffold that uses Jquery Validation plugin for the field's validation. Now i want to add that to a fbml facebook application, but i'm haven't been able to load the jquery javascript and the jquery Validation plugin into the app, does anybody now how to do that? or maybe someone could suggest me a better way of doing validation inside a facebook application. Thanks in Advance Ernesto Carrión

    Read the article

  • Web Deployment Projects tool and Web application project

    - by SourceC
    Hello, Q1 - As far as I know, Visual Studio doesn’t use aspnet_compiler.exe when compiling web application projects. And since Web Deployment Projects (WDP) tool is only used for manipulation the output created by aspnet_compiler.exe, I don’t understand how VS 2008 also has an option for using WDP with web application projects?! Q2 - What is a stock project? thanx EDIT: So I was right about the fact that Visual Studio doesn’t use aspnet_compiler.exe when compiling web application projects? much appreciated

    Read the article

  • Website --> Add Reference also creates files with pdb extensions

    - by SourceC
    Hello, Q1 Any assemblies stored in Bin directory will automatically be referenced by web application. We can add assembly reference via Website -- Add Reference or simply by copying dll into Bin folder. But I noticed that when we add reference via Website -- Add Reference, that additional files with .pdb extension are placed inside Bin. If these files are also needed, then why does reference still work even if we only place referenced dll into Bin, but not pdb files Q2 It appears that if you add a new item to web project, this class will automatically be added to project list and we can reference it from all pages in this project. So are all files added to project list automatically being referenced ? thanx EDIT: On your second question, you are adding a public class to a namespace so will be visible to other classes in that project and in that namespace. I don’t know much about assemblies, but I’d assume the reason why item( class ) added to the project is visible to other classes in that project is for the simple fact that in web project all classes get compiled into single assembly and for the fact that public classes contained in the same assembly are always visible to each other? much appreciated

    Read the article

  • Including FFMPEG with a Java application on Mac

    - by James Skidmore
    I'm writing a Java program that will be used on both Windows and Mac. In the program, I'm using FFMPEG to convert a MOV file to an FLV. On Windows, it's no problem -- simply call the command. But on Mac, I'm not quite sure what to do. Does the user really have to install FFMPEG on their machine, or can it somehow be included in the Java application? Thanks for any help/guidance!

    Read the article

  • VPN networking issue

    - by DuncanDavies
    I have 2 servers hosted in the cloud. One an application server, one a VPN server, both running Win2008. Both have a local IP address assigned by DHCP in different network subnets, 10.227.55.0 (VPN) and 10.231.5.0 (App Server). These servers can ping each other. My VPN client connects in to the VPN server (using a L2TP connection on a Win7 client). It is assigned an IP Address from the VPN server's static pool (the VPN server takes 192.168.100.1, the client is given 192.168.100.2). The client can ping both the 192.168.100.1 address of the VPN server, and its 'local' IP address (10.227.55.X). What the client can't do is ping the App Server. How can I configure routing so that my client can access the App Server, without hard-coding any of the DHCP IP addresses anywhere? thanks Duncan

    Read the article

  • How does the PHP IteratorIterator class work?

    - by WilliamMartin
    Try as I might I cannot get my head around what the IteratorIterator class actually does. I understand that classes can implement Traversable so the engine knows it can loop using foreach and I realise that IteratorIterator is supposed to convert anything that is Traversable into an Iterator but I cannot for the life of me understand how. Take for example, the PDOStatement class; how would the standard Iterator methods (next, key, rewind, etc) be implemented to allow iteration over a PDOStatement? Sorry if my question is unclear, I am just struggling to grasp the exact reason for this class and the documentation on it is scant. Thanks, Will Update: Going through the phpt files, I found one test which uses IteratorIterator: <?php $root = simplexml_load_string('<?xml version="1.0"?> <root> <child>Hello</child> <child>World</child> </root> '); foreach (new IteratorIterator($root->child) as $child) { echo $child."\n"; } ?> The expected output is: Hello World I don't really follow how the IteratorIterator construct takes $root-child as an argument and how it manages to iterate over the child elements.

    Read the article

  • Need a little help with sound in a JApplet

    - by jacob schuschel
    I am working on a solitaire game in Java, and i need to implement sound when the desk is shuffled, card flipped, etc. I used the following sites as reference to try and get it to work, but i am getting Null Pointer Exceptions or mishandled URL exception (depending on what i tweak). here Also, i am using netbeans 6.7.1 as my IDE. I will try to break down the code and explain: package cardgame; import java.applet.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JApplet; import javax.swing.*; import java.io.*; import java.net.*; /** * * @author jacob */ public class Sound extends JApplet { private AudioClip song; // Sound player private String URL = null; private URL songPath; // Sound path /* *sound_1 = shuffling cards *sound_2 = to discard *sound_3 = from discard *sound_4 = cardflip 1 *sound_5 = cardflip 2 */ Sound(String filename) { try { songPath = new URL(getCodeBase(),filename); // Get the Sound URL } catch (MalformedURLException ex) { Logger.getLogger(Sound.class.getName()).log(Level.SEVERE, null, ex); } song = getAudioClip(songPath); // Load the Sound } Sound(int i) { URL = "./sounds/sound_" + i + ".wav"; System.out.println(URL); try { songPath = new URL(URL); // Get the Sound URL song = getAudioClip(songPath); } catch (MalformedURLException ex) { Logger.getLogger(Sound.class.getName()).log(Level.SEVERE, null, ex); } } public void playSound() { song.loop(); // Play } public void stopSound() { song.stop(); // Stop } public void playSoundOnce() { song.play(); // Play only once } } The 2 different construcors are for different ways i tried to implement this. The first one creates the filepath, and passes it in. The second one builds the filepath in the constructor, given a sound # (i made a list of what numbers correspond to what sound for reference). I am getting the followig errors out: ./sounds/sound_1.wav Nov 16, 2009 4:14:13 PM cardgame.Sound ./sounds/sound_2.wav SEVERE: null java.net.MalformedURLException: no protocol: ./sounds/sound_1.wav ./sounds/sound_3.wav at java.net.URL.(URL.java:583) at java.net.URL.(URL.java:480) at java.net.URL.(URL.java:429) ./sounds/sound_4.wav ./sounds/sound_5.wav at cardgame.Sound.(Sound.java:46) at cardgame.Game.loadSounds(Game.java:712) at cardgame.Game.(Game.java:62) at cardgame.Main.main(Main.java:25) Nov 16, 2009 4:14:13 PM cardgame.Sound SEVERE: null java.net.MalformedURLException: no protocol: ./sounds/sound_2.wav at java.net.URL.(URL.java:583) at java.net.URL.(URL.java:480) at java.net.URL.(URL.java:429) at cardgame.Sound.(Sound.java:46) at cardgame.Game.loadSounds(Game.java:712) at cardgame.Game.(Game.java:62) at cardgame.Main.main(Main.java:25) Nov 16, 2009 4:14:13 PM cardgame.Sound SEVERE: null java.net.MalformedURLException: no protocol: ./sounds/sound_3.wav at java.net.URL.(URL.java:583) at java.net.URL.(URL.java:480) at java.net.URL.(URL.java:429) at cardgame.Sound.(Sound.java:46) at cardgame.Game.loadSounds(Game.java:712) at cardgame.Game.(Game.java:62) at cardgame.Main.main(Main.java:25) Nov 16, 2009 4:14:13 PM cardgame.Sound SEVERE: null java.net.MalformedURLException: no protocol: ./sounds/sound_4.wav at java.net.URL.(URL.java:583) at java.net.URL.(URL.java:480) at java.net.URL.(URL.java:429) at cardgame.Sound.(Sound.java:46) at cardgame.Game.loadSounds(Game.java:712) at cardgame.Game.(Game.java:62) at cardgame.Main.main(Main.java:25) Nov 16, 2009 4:14:13 PM cardgame.Sound SEVERE: null java.net.MalformedURLException: no protocol: ./sounds/sound_5.wav at java.net.URL.(URL.java:583) at java.net.URL.(URL.java:480) at java.net.URL.(URL.java:429) at cardgame.Sound.(Sound.java:46) at cardgame.Game.loadSounds(Game.java:712) at cardgame.Game.(Game.java:62) at cardgame.Main.main(Main.java:25) Thanks for those who read and more thanks to those who help. I know it is somewhat long, but i would rather get it all out there, than have 50 questions that come back or have people not answer due to lack of initial info. also only lets me post a single link right now, so the links are given below dreamincode.net/forums/showtopic14083.htm stackoverflow.com/questions/512436/java-playing-wav-sounds deitel.com/articles/java_tutorials/20060422/LoadingPlayingAudioClips/index.html

    Read the article

  • What's the difference between single and double quotes in Objective-C?

    - by Alex Mcp
    I'm working through a book exercise to generate some random serial number, and here's my function: NSString *randomSerialNumber = [NSString stringWithFormat:@"%c%c%c%c%c", '0' + random() % 10, 'A' + random() % 26, '0' + random() % 10, 'A' + random() % 26, '0' + random() % 10]; This works and has an output like: 2J6X7. But before, the 0s and As I had wrapped in double quotes, and an example output was 11764iÒ˜. What did I do wrong my first time around, and why did using single quotes fix it?

    Read the article

  • imagegrabwindow + https = black screen

    - by earls
    I'm doing something stupid and trying to capture thumbnails, snapshots, images of a html webpages. I'm doing something along the lines of: http://stackoverflow.com/questions/443837/how-might-i-obtain-a-snapshot-or-thumbnail-of-a-web-page-using-php DCOM + IE + PHP (imagegrabwindow; example from manual) Everything works PERFECT until I try to capture a HTTPS website... https://mail.google.com for example. imagegrabwindow produces a png, but it only shows the browser. the contents of the browser are black. If I log out of Google, I can capture the browser window and the contents thereof - the second I log in, the contents (not the browser frame) are black screen. Yes, I've increased the timeout (before closing the browser window). IE has clearly loaded the page, it just refuses to render for imagegrabwindow. I've been fighting this long enough I know it's either a permissions problem or a service needs to interact with the desktop. Does anyone have any clue what permissions need to be set or which service needs access? I assumed cryptographic services, but that's run as a network service and trying to change it to interact makes it shout and carry on. This is the last piece of the puzzle, I'd really like to get it working. Thank you!

    Read the article

  • Packaging ejb3 swing client

    - by soontobeared
    Hi, I get the "java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac tory" error while running my packaged ejb3 swing client jar. Here's the stack trace. G:\Courses\OSUMC\Installables\June 5\New>java -jar MetaDB-Client.jar javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: o rg.jnp.interfaces.NamingContextFactory] at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at javax.naming.InitialContext.init(Unknown Source) at javax.naming.InitialContext.<init>(Unknown Source) at net.massmatrix.metadb.ui.facade.BaseEJBFacade.getInitialContext(BaseE JBFacade.java:26) at net.massmatrix.metadb.ui.facade.UserManagerFacade.getUserManager(User ManagerFacade.java:24) at net.massmatrix.metadb.ui.facade.UserManagerFacade.isUserNameAvailable (UserManagerFacade.java:44) at net.massmatrix.metadb.ui.MainFrame.main(MainFrame.java:269) Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac tory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source) ... 8 more Exception in thread "main" java.lang.NullPointerException at net.massmatrix.metadb.ui.facade.UserManagerFacade.isUserNameAvailable (UserManagerFacade.java:44) at net.massmatrix.metadb.ui.MainFrame.main(MainFrame.java:269) Here are my packaged swing client Jar contents:- MetaDB-Client.jar \lib - contains all jboss\client jars \net\.. - contains class files(from both client and server) META-INF MANIFEST.MF jndi.properties Here's my jndi.properties:- java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=localhost:1099 Here's my MANIFEST.MF:- Manifest-Version: 1.0 Main-Class: net.massmatrix.metadb.ui.MainFrame Class-Path: lib/* Command used to create the jar:- jar cfm MetaDB-Client.jar MANIFEST.MF net\* lib\* jndi.properties What else am i missing ? Thanks.

    Read the article

  • How to display the rss version of a News Link

    - by cbrown16
    I'm trying to write a script that will show the rss version of a single url (title, author, image, source, etc..). This should behave much the way that facebook does when you copy paste a link to share and it generates this information automatically. I'm trying to do this with a php script but would also be open to opensource programs that can do this as well. also, if anyone knows of any Joomla/Drupal plugins that can do this that would be great. This may eventually end up on a site run on one of these frameworks. thanks!!

    Read the article

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