Daily Archives

Articles indexed Saturday July 7 2012

Page 8/15 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to compile jsoup through Ant?

    - by JackWM
    I tried to use Ant to compile the jsoup source. I can compile successfully, but cannot pass the test. Here is the process: jsoup version: 1.6.3 ; Ant version: 1.8.2 the source of jsoup is in the directory src/ I made a build file src/build.xml This file contains <project name="jsoup"> <target name="compile"> <mkdir dir="build/classes"/> <javac srcdir="src" destdir="build/classes" includeantruntime="false"/> </target> <target name="jar"> <mkdir dir="build/jar"/> <jar destfile="build/jar/jsoup.jar" basedir="build/classes"> <manifest> <attribute name="Main-Class" value="StateTrace"/> </manifest> </jar> </target> <target name="run"> <!--<java jar="build/jar/jsoup.jar" input="htmls/index.html" fork="true"/>--> <exec executable="java"> <arg value="-jar"/> <arg value="build/jar/jsoup.jar"/> <arg value="htmls/index.html"/> </exec> </target> </project> Note: 1. StateTrace.java is my own test program; 2. htmls/index.html is the input to StateTrace.java. Then I compile and run it with Ant: > ant compile > ant jar > ant run After this, I got err like: run: [exec] Exception in thread "main" java.lang.ExceptionInInitializerError [exec] at org.jsoup.nodes.Entities$EscapeMode.<clinit>(Unknown Source) [exec] at org.jsoup.nodes.Document$OutputSettings.<init>(Unknown Source) [exec] at org.jsoup.nodes.Document.<init>(Unknown Source) [exec] at org.jsoup.parser.TreeBuilder.initialiseParse(Unknown Source) [exec] at org.jsoup.parser.TreeBuilder.parse(Unknown Source) [exec] at org.jsoup.parser.HtmlTreeBuilder.parse(Unknown Source) [exec] at org.jsoup.parser.Parser.parse(Unknown Source) [exec] at org.jsoup.Jsoup.parse(Unknown Source) [exec] at StateTrace.main(Unknown Source) [exec] Caused by: java.lang.NullPointerException [exec] at java.util.Properties$LineReader.readLine(Properties.java:418) [exec] at java.util.Properties.load0(Properties.java:337) [exec] at java.util.Properties.load(Properties.java:325) [exec] at org.jsoup.nodes.Entities.loadEntities(Unknown Source) [exec] at org.jsoup.nodes.Entities.<clinit>(Unknown Source) [exec] ... 9 more [exec] Result: 1 BUILD SUCCESSFUL Total time: 0 seconds However, if I manually compiled all the java source, like javac src/org/jsoup/*.java src/org/jsoup/parser/*.java src/org/jsoup/examples/*.java src/org/jsoup/nodes/*.java src/org/jsoup/safety/*.java src/org/jsoup/select/*.java src/org/jsoup/helper/*.java I could compile successfully and pass my test. Any clue? Thanks!

    Read the article

  • Pseudo-quicksort time complexity

    - by Ord
    I know that quicksort has O(n log n) average time complexity. A pseudo-quicksort (which is only a quicksort when you look at it from far enough away, with a suitably high level of abstraction) that is often used to demonstrate the conciseness of functional languages is as follows (given in Haskell): quicksort :: Ord a => [a] -> [a] quicksort [] = [] quicksort (p:xs) = quicksort [y | y<-xs, y<p] ++ [p] ++ quicksort [y | y<-xs, y>=p] Okay, so I know this thing has problems. The biggest problem with this is that it does not sort in place, which is normally a big advantage of quicksort. Even if that didn't matter, it would still take longer than a typical quicksort because it has to do two passes of the list when it partitions it, and it does costly append operations to splice it back together afterwards. Further, the choice of the first element as the pivot is not the best choice. But even considering all of that, isn't the average time complexity of this quicksort the same as the standard quicksort? Namely, O(n log n)? Because the appends and the partition still have linear time complexity, even if they are inefficient.

    Read the article

  • Ubuntu: Graphics freeze

    - by Phil
    We have recently updated a java application which runs on an Ubuntu PC, and are now experiencing a graphics problem that we didn't encounter before. The system is running constantly, and randomly maybe twice a month but sometimes within a few days the systems graphics will freeze, and the gnome panels are frozen. Here is an extract from the syslog; Jun 28 05:41:53 swimtag-NM10 kernel: [34802.970021] [drm:i915_hangcheck_elapsed] ERROR Hangcheck timer elapsed... GPU hung Jun 28 05:41:53 swimtag-NM10 kernel: [34802.970177] [drm:i915_do_wait_request] ERROR i915_do_wait_request returns -5 (awaiting 937626 at 937625)

    Read the article

  • Mocking digest authentication in RestEasy

    - by Ralph
    I am using RestEasy to develop a REST server and using the mock dispatcher (org.jboss.resteasy.mockMockDispatcherFactory) for testing the service in my unit tests. My service requires digest authentication and I would to make that part of my testing. Each of my services accepts a @Context SecurityContext securityContext parameter. Is there any way is inject a fake SecurityContext in the dispatcher so that I can test that my security methods function properly?

    Read the article

  • String concatenation produces incorrect output in Python?

    - by Brian
    I have this code: filenames=["file1","FILE2","file3","fiLe4"] def alignfilenames(): #build a string that can be used to add labels to the R variables. #format goal: suffixes=c(".fileA",".fileB") filestring='suffixes=c(".' for filename in filenames: filestring=filestring+str(filename)+'",".' print filestring[:-3] #now delete the extra characters filestring=filestring[-1:-4] filestring=filestring+')' print "New String" print str(filestring) alignfilenames() I'm trying to get the string variable to look like this format: suffixes=c(".fileA",".fileB".....) but adding on the final parenthesis is not working. When I run this code as is, I get: suffixes=c(".file1",".FILE2",".file3",".fiLe4" New String ) Any idea what's going on or how to fix it?

    Read the article

  • NHibernate Pitfalls: Cascades

    - by Ricardo Peres
    This is part of a series of posts about NHibernate Pitfalls. See the entire collection here. For entities that have associations – one-to-one, one-to-many, many-to-one or many-to-many –, NHibernate needs to know what to do with their related entities, in three particular moments: when saving, updating or deleting. In particular, there are two possible behaviors: either ignore these related entities or cascade changes to them. NHibernate allows setting the cascade behavior for each association, and the default behavior is not to cascade (ignore). The possible cascade options are: None Ignore, this is the default Save-Update If the entity is being saved or updated, also save any related entities that are either not saved or have been modified and associate these related entities to the root entity. Generally safe Delete If the entity is being deleted, also delete the related entities. This is only useful for parent-child relations Delete-Orphan Identical to Delete, with the addition that if once related entity is removed from the association – orphaned –, also delete it. Also only for parent-child All Combination of Save-Update and Delete, usually that’s what we want (for parent-child relations, of course) All-Delete-Orphan Same as All plus delete any related entities who lose their relationship In summary, Save-Update is generally what you want in most cases. As for the Delete variations, they should only be used if the related entities depend on the root entity (parent-child), so that deleting the root entity and not their related entities would result in a constraint violation on the database.

    Read the article

  • IIS7.5 is only resolving to the Default Web Site

    - by Dennis Burnham
    I am able to access only the Default Web Site on a Windows 2008 R2 Server which is running IIS 7.5 The Default Web Site's binding is to "All Unassigned", same way as I have done it on a different machine running IIS6 under Windows 2003 Server. The bindings of the desired Web Site have the IP address of the server and the correct home directory. Regardless what I do, the only page content I can see is the default index page in the wwwroot directory which is the Default Web Site. What must I do to deliver the correct content from the Web Sites that are configured in IIS7.5?

    Read the article

  • Is it a good idea to run Redmine using Webrick through Nginx?

    - by Rohit
    The task here is to get Redmine setup for a small (<20) team. There may be a few users who would access the setup as business clients. I am familiar with setting up PHP for Apache, and recently, Nginx. I am not familiar with Ruby, Ruby-On-Rails, etc. I prefer to use the OS's (Ubuntu Linux LTS) package manager to install the different components as it takes care of dependencies and updates. I have setup Nginx with PHP-FPM successfully and am struggling with Redmine. As suggested here, I got Redmine running on port 3000. # /etc/init/redmine.conf # Redmine description "Redmine" start on runlevel [2345] stop on runlevel [!2345] expect daemon exec ruby /usr/share/redmine/script/server webrick -e production -b 0.0.0.0 -d And using the Nginx config on this page, I used Nginx to proxy requests to Webrick. server { listen 80; server_name myredmine.example.com; location / { proxy_pass http://127.0.0.1:3000; } } This works well locally. I wanted some opinions before trying this out on the live box (a 256 MB VPS). Further, should I use something like monit to monitor webrick for failure?

    Read the article

  • 2 identical PCs - can I swap a single hard drive between and expect Windows 7 to work? [closed]

    - by rgvcorley
    I currently work in 2 different locations, traveling between the 2 every few weeks or so. I currently have screens, kb, mouse etc... in both locations, so I just pick up my tower case when I want to move to the other location. However to make moving easier I was thinking of buying 2 tower cases with hot swappable drive bays on the front and installing identical hardware in each one. This would allow me to pull the drives out and just take them with me and plug them into the PC at the other location. Would windows 7 complain? I'm not fussed about buying licenses for both PCs, but would I have any problems with drivers due to the different serial numbers of the components?

    Read the article

  • CentOS: eth0 not starting on boot

    - by Cameron Aziz
    Whenever I reboot a CentOS Hyper-V VM, eth0 does not start automatically. All I need to do is perform ifup eth0 and all is fixed, but that isn't feasible from ssh! I am starting in runlevel 3. After I perform ifup eth0 on the console: [root@localhost ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:15:5D:2B:2B:07 inet addr:10.10.0.3 Bcast:10.10.0.255 Mask:255.255.255.0 inet6 addr: fe80::215:5dff:fe2b:2b07/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:34 errors:0 dropped:0 overruns:0 frame:0 TX packets:49 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4656 (4.5 KiB) TX bytes:6399 (6.2 KiB) Interrupt:9 Base address:0xa000 [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none IPADDR=10.10.0.3 NETMASK=255.255.255.0 GATEWAY=10.10.0.1 USERCTL=no ONBOOT=yes [root@localhost ~]# chkconfig --list | grep network network 0:off 1:off 2:on 3:on 4:on 5:on 6:off

    Read the article

  • svnserve accepts only local connection

    - by stiv
    I've installed svnserve in linux box konrad. On konrad I can checkout from svn: steve@konrad:~$ svn co svn://konrad A konrad/build.xml On my local Windows pc i can ping konrad, but checkout doesn work: C:\Projects>svn co svn://konrad svn: E730061: Unable to connect to a repository at URL 'svn://konrad' svn: E730061: Can't connect to host 'konrad': ??????????? ?? ???????????, ?.?. ???????? ????????? ?????? ?????? ?? ???????????. My linux firewall is disabled: konrad# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination and windows firewall is also off (I can't send screen shot here, so believe me). How can I fix that? Any ideas?

    Read the article

  • Unable to access site over HTTPS using self signed certificate

    - by James
    I am developing a REST API which I want to secure with SSL/TLS. I have implemented a large part of the API which I have tested over HTTP, however, I am now at the stage where I want to switch it over to use HTTPS. At the moment the API is hosted on a Windows XP professional SP2 box running IIS 5.1 (development environment only) and I used the SelfSSL.exe tool from the IIS 6.0 Resource Kit Tools to generate a server certificate. I then configured my API to use this certificate which all appeared to work fine as I attempted to connect to my API using HTTP and I get a 403 response saying "... must be accessed over a secure channel...". However, the problem is when I attempt to access the same the API over HTTPS it just appears to hang! As this is a development environment at the moment I don't have a domain name (just a static IP address) and the API is running on port 81. Also (incase it matters) the API is the default site (I replaced it). Any ideas why I can't connect using HTTPS?

    Read the article

  • Sending bulkmail from different server?

    - by Omer Gencay
    I want to send bulk domains from my vps for a domain(cagetur.com) hosted in another company. The company(cagetur) will go on using the old hosting account for its mailing operations. The vps will just be used for smtp for once a week. I created an A record "vps.cagetur.com". directed it to the IP adress of vps then created a mx record with bigger preference number "50 vps.cagetur.com." on the domain control panel. When I trace the "vps.cagetur.com" i can reach my vps now. I installed hMail on the vps. Configure it (created domain, accounts). I have no information about "system" so i couldn't get further from this point. I can connect to the mail server with Outlook without errors. I can send an email from the account on the vps but it doesn't reaches. No errors, no emails. What do i have to do for getting it work? Thank you.

    Read the article

  • Domain pointing to wrong subscription in Plesk 10

    - by Michal Gow
    I recently moved a domain name in the Plesk 10 control panel from one subscription to another. DNS is managed by another server so there is no change in DNS at all. The IP address is shared and remains the same so there is really no need for a DNS change. But the domain is still managed by its former subscription (where it should have been removed from) and is pointing to exactly the same folder as in the past, even when is not in the list of domains there. Subsequently, the new subscription do not have the domain under its control. Even this domain is in list of domains here and points to another folder.

    Read the article

  • .htaccess working on remote server but does not work on localhost. Getting 404 errors on localhost

    - by Afsheen Khosravian
    MY PROBLEM: When I visit localhost the site does not work. It shows some text from the site but it seems the server can not locate any other files. Here is a snippet of the errors from firebug: "NetworkError: 404 Not Found - localhost/css/popup.css" "NetworkError: 404 Not Found - localhost/css/style.css" "NetworkError: 404 Not Found - localhost/css/player.css" "NetworkError: 404 Not Found - localhost/css/ui-lightness/jquery-ui-1.8.11.custom.css" "NetworkError: 404 Not Found - localhost/js/jquery.js" It seems my server is looking for the files in the wrong places. For example, localhost/css/popup.css is actually located at localhost/app/webroot/css/popup.css. I have my site setup on a remote server with the same exact configurations and it works perfectly fine. I am just having this issue trying to run the site on my laptop at localhost. I edited my VirtualHosts file DocumentRoot and to /home/user/public_html/site.com/public/app/webroot/ and this reduces some errors but I feel that this is wrong and sort of hacking it since I didn't use these setting on my production server which works. The last note I want to make is that the website uses dynamic URLs. I dont know if that has anything to do with it. For example, on the production server the URLS are: site.com/#hello/12321. HERES WHAT I AM WORKING WITH: I have a LAMP server setup on my laptop which runs on Ubuntu 11.10. I have enabled mod_rewrite: sudo a2enmod rewrite Then I edited my Virtual Hosts file: <VirtualHost *:80> ServerName localhost DirectoryIndex index.php DocumentRoot /home/user/public_html/site.com/public <Directory /home/user/public_html/site.com/public/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> Then I restarted apache. My website is using cakePHP. This is the directory structure of the website: "/home/user/public_html/site.com/public" contains: index.php app cake plugins vendors These are my .htaccess files: /home/user/public_html/site.com/public/app/.htaccess: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule> /home/user/public_html/site.com/public/app/webroot/.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule>

    Read the article

  • Would NetBSD be a good choice for a web server?

    - by Alexander
    I've the choice of crafting a NetBSD image for a Xen VPS host, and was just wanting to play around as I like BSD and wished to use it for my general web hosting. I will be hosting a low-mid traffic website and maybe a few other simple services. Do you think NetBSD would be a sufficient choice, in terms of general performance of multiple system users and fair amount of traffic to Apache compared to what Linux could normally handle? I am concerned if I do start to really like it and keep it, I may be limiting myself if I am to move further with my web host and get more traffic (and maybe a lot of FTP access and user shell accounts) Ken

    Read the article

  • Campus VLAN Segmentation - By OS?

    - by Moduspwnens
    We've been thinking through re-arranging our network and VLAN configuration. Here's the situation. We already have our servers, VoIP phones, and printers on their own VLANs, but our problem lies with end user devices. There are just too many to lump on the same VLAN without being hammered with broadcasts! Our current segmentation strategy has them split into VLANs like this: Student iPads Staff iPads Student Macbooks Staff Macbooks Gaming devices Staff (Other) Student (Other) *Note that our network has many more iPads and MacBooks than most. Since the primary reason we're splitting them is just to put them in smaller groups, this has been working for us (for the most part). However, this required our staff to maintain access control lists (MAC addresses) of all devices belonging in these groups. It also has the unfortunate side effect of illogically grouping broadcast traffic. For example, using this setup, students on opposite ends of campus using iPads will share broadcasts, but two devices belonging to the same user (in the same room) will likely be on completely separate VLANs. I feel like there must be a better way of doing this. I've done a lot of research and I'm having trouble finding instances of this kind of segmentation being recommended. The feedback on the most relevant SO question seems to point toward VLAN segmentation by building/physical location. I feel like that makes sense because logically, at least among miscellaneous end users, broadcasts will typically be intended for nearby devices. Are there other campuses/large-scale networks out there segmenting VLANs based on end-system OS? Is this a typical configuration? Would VLAN segmentation based on physical location (or some other criteria) be more effective? EDIT: I've been told that we will soon be able to dynamically determine device OS without maintaining access lists, although I'm not sure how much that affects the answers to the questions.

    Read the article

  • create vmware virtual machine via command line on linux system

    - by tom smith
    evaluating/investigating vmware, and how you create a "virtual machine" using the command line for rhel/centos. basically, i want to be able to create a test virtual machine and then be able to run the VM on another system using the virtual player. so, i'm looking for pointers/articles/instructions that detail what i need (in terms of tools/apps) and the steps needed to accomplish this. i've seen a few articles/sites that discuss creating virtual machines, but they all involve using the GUI. thanks update:: while vmware is the company. there are different tools/apps provided to create a Virtual Machine. Basically, I want to do a test, to ultimately have a Virtual Machine/Image that can be run on a separate server using the vmplayer app I've seen docs that discuss using the GUI to create the VM, but haven't found any (yet) that discuss how to accomplish this using the command line approach. thanks...

    Read the article

  • Coldfusion:-Firefox can't establish a connection to the server at localhost

    - by Fransis
    I installed Coldfusion 8 trial version on my system (XP Professional sp3). I created an Folder in the “C:/Coldfusion8/wwwroot” called “buildProject” containing an Index.cfm and some other .cfm files. But I am unable to access the Neither my project files or CFIDE/Administrator I tried the following URLS http://localhost:8500/wwwroot/buildProject/ http://localhost:8500/CFIDE/administrator/index.cfm http:// 127.0.0.1:8500/wwwroot/buildProject/ http:// 127.0.0.1:8500/CFIDE/administrator/index.cfm http://localhost /wwwroot/buildProject/index.cfm http://localhost /CFIDE/administrator/index.cfm http://localhost /wwwroot/buildProject/ http://localhost /CFIDE/administrator/index.cfm Firefox can't establish a connection to the server at 127.0.0.1:8500. The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web. • I cleared the browsing “History” from both IE and FF. • I have restarted the CF server in the Control Panel Administrative Tools Services • Even restarted the IIS Getting the same error. Further I was trying to access IE/FF via CFbuilder But still I am getting the error “The connection was refused when attempting to contact [URL].” My inetpub is in the D rive where as CF8 is in C drive Also when i check IIS-5 Control Panel Admin tools Services I do not find the Localhost under web sites or FTP sites. Kindly help me with a fix.

    Read the article

  • Problem accessing MICROSOFT##SSEE database (Error: 18456, Severity: 14, State: 16.)

    - by Philipp Schmid
    After an unexpected server shutdown due to a power failure, I can no longer connect to the internal windows database MICROSOFT##SSEE which is hosting Central Admin for my SBS 2008 server. The log shows: Error: 18456, Severity: 14, State: 16. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. [CLIENT: <named pipe>] I've tried to connect using the SQL Management studio (connecting to .pipemssql$microsoft##sseesqlquery) but no luck. The SQL Server Configuration Manager doesn't show a entry for 'Protocols for MICROSOFT##SSEE' (but shows it for 2 other database hosted on the same SQL server 2005 Express edition. I have tried to restore the master.ldf and mastlog.log files from a backup, but the issue persists.

    Read the article

  • Smart backup software

    - by gisek
    I use a laptop on daily basis. As I have a lot of important data there it would be nice to do backups of some directories every day. Can you recommend a specific application that would take care of it? Maybe there is an app that would instantly commit changes I make in a directory on my laptop to the backup folder? The important thing is that I have some big files (a few GB's) that have some minor changes very often. I'm talking about VirtualBox disk images. It would be nice if the software could handle it smartly. Also notice that I'd like to store it on an external usb HDD, which sometimes isn't plugged in.

    Read the article

  • Can't open my messages in facebook?

    - by Ehsan Mamakani
    I was up to sending a very long message, about 90,000 characters, to a friend, I tried several times but I got error sending the message. Finally, I think part of my message was sent because I could see the characters in my message list under my friend's name, but when I clicked the name to see my whole message it wouldn't load the message. And NOW I can't access any of my messages and I get this message from facebook how can I get access to my messages and conversations again?

    Read the article

  • Is there a limit of max. number of files in external hard drive folder?

    - by tfs
    I have a FAT32 external hard drive where I keep backups downloaded from webserver. I have a directory with 30 subdirectories. One of the subdirectories contains 21381 files and when I try to copy more files into this directory I get 0x80070052 error. However,it's possible to copy one more file in this directory (only one) if I make it's name shorter (8 characters instead of 22 as it's original name). How do I solve this problem? Now I can not synchronize external hard disk files with server files which is very important for me.

    Read the article

  • How can I pair two bluetooth dongles together?

    - by techaddict
    I want to hack a device which connects via USB, and plug a bluetooth USB dongle to the end of the USB cable (using a female to female adapter), and then connect to that device from another USB bluetooth dongle connected to my computer. How can I do this? It is straightforward? I don't want to spend $30 before I know how to do this. Also I think another concern is that the USB cable is providing power to the device. So I think that means I would also have to hack it for power. I have created this diagram in Photoshop to illustrate my intent: (NOTE: it won't be a USB mouse, as that would be pointless because there are already wireless mice in existence. The mouse is displayed for illustrative purposes) Don't tell me "it won't work". Because I KNOW it WILL work. Think for example, PS3 controller. That works, and in fact I was able to get it working with my laptop, over bluetooth. I just want to know HOW to make it work.

    Read the article

  • Firefox keyboard shortcuts to menu items / add-on functions

    - by Cel
    At the moment I'm using context menus a lot to access commands in Firefox, but I would like to replace this repetitive clicking and searching with keyboard shortcuts for the common tasks that I perform. How to assign keys to add-on functionality? E.g. I use Close Other Tabs from Tab Mix Plus a lot - but I could not find any add-on that allows me to create a key combination for it e.g. Ctrl Alt Shift F4? My search did yield Key config, but this extension does not allow mapping to add-on functions I thought Menu Editor might be relevant, as you can change menus with it, and re-arrange even add-on items A rather demanding solution here, which seems to require re-compiling some jar files Customizing menu shortcuts in Firefox

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >