Posts

regex - Use wget to crawl specific URLs -

i trying crawl links website use download manager download files. i've tried: wget --wait=20 --limit-rate=20k -r -p -u mozilla "www.mywebsite.com" i can't figure out how use wget or regular expressions save desired links only! wget offers wide variety of options fine tuning files download in recursive crawl. here few options can interest you: --accept-regex urlregex download url matching urlregex . urlregex regular expression matched against complete url. --reject-regex urlregex ignore url matching urlregex . urlregex regular expression matched against complete url. -l tells wget follow relative links. relative links example: <a href="foo.gif"> <a href="foo/bar.gif"> <a href="../foo/bar.gif"> non relative links: <a href="/foo.gif"> <a href="/foo/bar.gif"> <a href="http://www.server.com/foo/bar.gif"> references wget : re...

php - SSO using session -

i have 2 website (www.mainwebsite.com)(community.mainwebsite.com). using 1 server(host) separately in folder , different database, , both have different login form. access both site , add custom code sso. trying using session.save_path on both website. ini_set('session.save_path',realpath(dirname($_server['document_root']) . '/../session')); session_start(); anyone have idea on want do?

Eclipse Kepler: Installing Plugins for Juno -

i downloaded eclipse kepler (version 4.3), , first thing did install google plugin eclipse (android, gwt, etc.). since there isn't version of plugin kepler, how reliable install , use plugin version designed juno (4.2)? it work fine, there no major differences, supported versions preferred eclipse backward compatible , don't see issue there.

android - Xamarin: Any difference between using Java.IO and System.IO -

i wondering if there difference between using java.io , system.io both can achieve same stuff. there difference between java.io , system.io . system.io namespace comes .net bcl. the system.io namespace contains types allow reading , writing files , data streams, , types provide basic file , directory support. whereas java.io package available part of jdk. java.io package provides classes system input , output through data streams, serialization , file system. since system.io part of bcl can use of classes in io operations across platforms each platform has different directory structure, , different filesystem capabilities - example xamarin.ios , xamarin.android support most system.iofunctionality.

python - Nested Template Functions as Parameters -

in python, there way of decorating function such can add additional functionality before and/or after function. in simple form, looks this: from random import systemrandom time import time import functools rdev = systemrandom() def time_function(func): @functools.wraps(func) def run(*args, **kwargs): start = time() ret = func(*args, **kwargs) print("took {:0.5f}s".format(time()-start)) return ret return run @time_function def foo(): x = [rdev.randint(1, 1000) _ in range(10000)] sorted(x) foo() # prints "took 0.04239s" i wanted write similar functionality in c++. pass function arbitrary parameters , return types function , have perform action. came with: #ifndef timeit_h #define timeit_h #include <string> #include <functional> #include <iostream> #if defined(_win32) #include <windows.h> namespace timeit { unsigned long gettime(void) { return gettickcount(); } } ...

java - How to extract a "registration" URL from a mail content -

i successful in reading content of gmail-email using "javamail" , able store in string. want specific registration url content (string). how can this, string contains plenty of tags , href want extract url provided in hyper link on word " click here" exist in below mentioned statement "please <a class="h5" href="https://newstaging.mobilous.com/en/user-register/******" target="_blank">click here</a> complete registration". on hyper link "click here" url href="https://newstaging.mobilous.com/en/user-register/******" target="_blank" i have tried using following code package email; import java.util.arraylist; import java.util.properties; import java.util.regex.matcher; import java.util.regex.pattern; import javax.mail.folder; import javax.mail.message; import javax.mail.messagingexception; import javax.mail.nosuchproviderexception; import javax.mail.session; import javax.m...

java - Testing my program? -

i have class need implement in code. instructions are: code testing program/class. should construct or instantiate objects of class coded in step #1. testing program should call every method make sure work. should construct @ least 2 objects – 1 default constructor , 1 “other” constructor. second scenario, ask user values (radius and) height. may use input , output want this. this have far , i'm stuck: public class cube { private double height; public cube(){ height = 1.0; } public cube(double h){ height = h; } public double getheight(){ return height; } public void setheight(double h){ height = h; } public double calcvolume() { return height*height*height; } public double calcsurface(){ return height*height*6; } public string tostring(){ return this.tostring(); } public boolean equals(cube c){ return (c.getheight() == this.height); } } import java.util.* public c...