Daily Archives

Articles indexed Tuesday April 27 2010

Page 16/121 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • process all links but external ones (ruby + mechanize)

    - by Radek
    I want to process all links but external ones from the whole web site. Is there any easy way how to identify that the link is external and skip it? My code looks so far like (the site url is passed through command line argument require 'mechanize' def process_page(page) puts puts page.title STDIN.gets page.links.each do |link| process_page($agent.get(link.href)) end end $agent = WWW::Mechanize.new $agent.user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4' process_page($agent.get(ARGV[0]))

    Read the article

  • Fancy Box doesnt work please help

    - by JL
    I recently came across fancy box located here, I've followed every step in the instructions perfectly, but it doesn't work, anyone know what might be the problem? Here is a sample of my page source: Included the links to scripts as required, and CSS: <script src="jquery.fancybox-1.2.1/jquery.fancybox/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="jquery.fancybox-1.2.1/jquery.fancybox/jquery.fancybox-1.2.1.js" type="text/javascript"></script> <link href="jquery.fancybox-1.2.1/jquery.fancybox/jquery.fancybox.css" rel="stylesheet" type="text/css" /> <link href="css/main.css" rel="stylesheet" type="text/css" /> Then this should simply work: <a id="single_image" href="images/279641.jpg"><img src="images/279641.jpg" /></a> But it doesn't seem to do anything except open the image in a new window. Any suggestions, and thanks in advance.

    Read the article

  • Sharing session (or cookie) using Grails acegi plugin

    - by firnnauriel
    Is it possible for two different Grails project, also having different domains, to share a session/cookie? Let's say I have 2 sites: www.mycompany.com, and, www.othercompany.com. Assume that both sites are having same domains, and same database and records too. What I want to know is if this code: authenticateService.userDomain() or even the authenticateService.isLoggedIn() will behave and return exactly the same object/result whether it is called in either of the site. Basically, what we need is a solution for sharing/identifying logged in user between two different sites. Need more details on how to implement this using acegi 0.5.2 and grails 1.2.1. Hoping for any leads on this. Thank you.

    Read the article

  • How do I convert a git repository to mercurial?

    - by Spoike
    I've been developing a java application using git as source code repository. I'd like to share the project with other java developers and hg seems to be most used by them. My question is how do I convert a git repository to hg? If I tried googling "convert git to hg" and every search hit is about converting from git to hg. I'm also using TortoiseHg.

    Read the article

  • Free static checker for C99 code

    - by detly
    I am looking for a free static checker for C99 code (including GCC extensions) with the ability to explicitly say "these preprocessor macros are always defined." I need that last part because I am compiling embedded code for a single target processor. The compiler (Microchip's C32, GCC based) sets a macro based on the selected processor, which is then used in the PIC32 header files to select a processor-specific header file to include. cppcheck therefore fails because it detects the 30 different #ifdefs used to select one of the many possible PIC32 processors, tries to analyse all possible combinations of these plus all other #defines, and fails. For example, if splint could process C99 code, I would use splint -D__PIC32_FEATURE_SET__=460 -D__32MX460F512L__ \ -D__LANGUAGE_C__ -I/path/to/my/includes source.c

    Read the article

  • How to create a WebKit browser plugin in C#?

    - by Superior0
    I want to create C# plugin for some 3d + Music editing stuff. I want to be able to run my files inside browsers pages (so to see HTML some Flash content and some content which is rant by my plugin) using something like HTML tag or some JavaScript. (So my plugin will be small, powerfull and i want it to run at least on Windows and Mac firefox and safary and Chrome)(If it'll be runing on Linux itll be grate))) I'ma beginner so any helpfull info will be appriciated

    Read the article

  • Storing a file in the user's directory in cross-platform Java

    - by dalyons
    I have a Java application that runs on Mac and Windows, directly off a CD/DVD with no installation. Now, I need to store a file containing per-user data (think favourites etc.) somewhere on the local file system, so that it can be written to. So, where do you think is a good location for this file? I am thinking something like: <USER_DOCUMENTS_AND_SETTINGS>/application data/myapp/favourites.db for windows <USER_HOME_DIR>/.myapp/favourites.db for mac/nix Thoughts? And does anyone know the best way to determine these paths within Java?

    Read the article

  • How can I declare a pointer structure?

    - by Y_Y
    This probably is one of the easiest questions ever in C programming language... I have the following code: typedef struct node { int data; struct node * after; struct node * before; }node; struct node head = {10,&head,&head}; Is there a way I can make head to be *head [make it a pointer] and still have the availability to use '{ }' [{10,&head,&head}] to declare an instance of head?

    Read the article

  • Cross platform GUI Programming with D

    - by Adam Hawes
    I want to start programming with D. I have a simple application in mind that needs a GUI but I want to make sure it's portable to Linux/Windows/Mac equally well and with minimal (no) change for each platform. wxD is looking like the contender of choice because I know the wx toolkit already. I see fltk4d as a contender and a (unfinished) wrapper around Qt. Are there any other truly cross platform GUI toolkits for D that will go where I want with little effort and what would the the toolkit of choice for people here?

    Read the article

  • Switching to Linux for Windows development, bad idea?

    - by krebstar
    I was contemplating switching to Linux for C++ development, coming from a Windows environment. Is this a bad idea? My workplace uses Windows and Visual Studio for our projects (some C# and java too, but right now I'm only developing in C++). If they decide to put me on a C# project, would development still possible (mono?)? What are the difficulties in this sort of transition? Would I have a problem working on their projects and vice versa? I read somewhere that there'd be problems with precompiled headers and such (we do use them), and encodings (tabs/spaces, line endings, etc).. If it's not too hard to do this switch, how do I get started? IDE? vim+make? Thanks. By the way, we make MOSTLY windows software.. EDIT: Thanks guys, I guess that makes sense..

    Read the article

  • Problem with hash function: hash(1) == hash(1.0)

    - by mtasic
    I have an instance of dict with ints, floats, strings as keys, but the problem is when there are a as int and b as float, and float(a) == b, then their hash values are the same, and thats what I do NOT want to get because I need unique hash vales for this cases in order to get corresponding values. Example: d = {1:'1', 1.0:'1.0', '1':1, '1.0':1.0} d[1] == '1.0' d[1.0] == '1.0' d['1'] == 1 d['1.0'] == 1.0 What I need is: d = {1:'1', 1.0:'1.0', '1':1, '1.0':1.0} d[1] == '1' d[1.0] == '1.0' d['1'] == 1 d['1.0'] == 1.0

    Read the article

  • Crossplatform way to change screen resolution

    - by macropas
    Is there any crossplatform way (Windows, Linux, MacOSX) to change screen resolution? Neither Java nor .Net-Mono can do it. Only through native API invocation. It's very strange situation: there are clear (managed) methods to obtain screen resolution, but method for setting is absent. Is this feature very dangerous or complicated? Does any other crossplatform system (Parrot, RealBasic etc.) do this?

    Read the article

  • is there any cross platform process manager tool

    - by lvlv
    I need a program that is able to launch a set of processes according to a schedule/configuration; the program would run in the background and restart the processes in case they crash. There are standard tools for this kind of task on both windows and unix - what I need is a cross platform program which could run on different operating systems using the same configuration. A portable C/C++ library which implements the basic functionality (i.e. create processes, signal process termination events and all that) would be ok too.

    Read the article

  • Why would Java classloading fail on Linux, but succeed on Windows?

    - by arnsholt
    I've got a Java web application (using Spring), deployed with Jetty. If I try to run it on a Windows machine everything works as expected, but if I try to run the same code on my Linux machine, it fails like this: [normal startup output] 11:16:39.657 INFO [main] org.mortbay.jetty.servlet.ServletHandler$Context.log(ServletHandler.java:1145) 16 Set web app root system property: 'webapp.root' = [/path/to/working/dir] java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.mortbay.start.Main.invokeMain(Main.java:151) at org.mortbay.start.Main.start(Main.java:476) at org.mortbay.start.Main.main(Main.java:94) Caused by: java.lang.ExceptionInInitializerError at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:129) at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:51) at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:495) at org.mortbay.util.Container.start(Container.java:72) at org.mortbay.http.HttpServer.doStart(HttpServer.java:708) at org.mortbay.util.Container.start(Container.java:72) at org.mortbay.jetty.Server.main(Server.java:460) ... 7 more Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@15311bd for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@15311bd for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351) at org.springframework.util.SystemPropertyUtils.(SystemPropertyUtils.java:42) ... 14 more Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@15311bd for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 18 more Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.getConstructor(Class.java:1657) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410) ... 19 more Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Category at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 24 more [shutdown output] I've run the app with java -verbose:class, and according to that output, org.apache.log4j.Category is loaded from the log4j JAR in my /WEB-INF/lib, just before the first exception is thrown. Now, the Java versions on the two machines are slightly different. Both the machines have Sun's java, the Linux machine has 1.6.0_10, while the Windows machine has 1.6.0_08, or maybe 07 or 06, I can't remember the exact number right now, and don't have the machine at hand. But even though the minor versions of the Javas are slightly different, the code shouldn't break like this. Does anyone understand what's wrong here?

    Read the article

  • Funniest code names for software projects

    - by furtelwart
    Developers are creative. Not as they create wonderfull GUIs or proof their sense for art with good color combinations, but with code names. Every project has a code name, sometimes official, sometimes private (with a good reason!). Here are my favourites: Android: 1.6 = Donut 2.0 = Eclaire (picture of Google's eclaire) grml (Live distribution based on Debian GNU/Linux, comes from Austria therefore in German) Hustenstopper (cough stopper) Eierspass (egg fun) Meilenschwein (mile pig, it's a pun with milestone) Lackdose-Allergie (lacquer can allergy, it's a pun with lactose allergy) Hello-Wien (pun with Halloween, Wien being German for Vienna) I really like to see the funniest code names you ever heard of. Aren't there any more funny project names?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >