Posts

Featured post

bash - How do you programmatically add a bats test? -

i'd have bats test created every file in directory, i'm not sure best way done is. approach below creates single test when there many files in directory. #!/usr/bin/env bats in $(ls) @test "testing $i" { pwd } done to extract ls output not batter solution go wrong on filenames spaces. you can below shopt -s nullglob file in /dir/* //test command on $file done shopt -u nullglob you can using find command also find /some/directory -maxdepth 1 -type f -exec cmd option {} \;

clojure - 'get' replacement that throws exception on not found? -

i'd access values in maps , records, throwing exception when key isn't present. here's i've tried. there better strategy? this doesn't work because throw evaluated every time: (defn get-or-throw-1 [rec key] (get rec key (throw (exception. "no value.")))) maybe there's simple method using macro? well, isn't it; has same problem first definition, if evaluation of throw happens later: (defmacro get-or-throw-2 [rec key] `(get ~rec ~key (throw (exception. "no value.")))) this 1 works letting get return value (in theory) never generated other way: (defn get-or-throw-3 [rec key] (let [not-found-thing :i_would_never_name_some_thing_this_021138465079313 value (get rec key not-found-thing)] (if (= value not-found-thing) (throw (exception. "no value.")) value))) i don't having guess keywords or symbols never occur through other processes. (i use gensym generate special value of

rdbms - what exactly the undo information lives in oracle? -

some docs says, there "undo tablespaces" implies should create tablespace undo imformation. some docs says, there "undo segment" implies undo information lives in normal tablespaces , use of it's segment. so, undo information lives , organized? earlier releases of oracle database used rollback segments store undo. oracle9i introduced automatic undo management, simplifies undo space management eliminating complexities associated rollback segment management. oracle recommends (oracle 9i , on words) use undo tablespace (automatic undo management) manage undo rather rollback segments. when creating undo tablespace, these automatically created: n undo segments (based on sessions parameter value) named _syssmun$ owned public (usable ops configuration) not manually manageable

c# - UPnP and Port Forwarding with Lidgren fails -

Image
i'm new networking , lidgren has made easier me begin adding multiplayer capability xna pc game. i've been testing across network setting laptop right next me , has been working great. problem sent copy of game friend in netherlands , cannot connect me. have set 1 person host , other people clients connect host. the host sets server follows: config = new netpeerconfiguration("game"); config.port = 14242; config.enableupnp = true; config.maximumconnections = 3; config.enablemessagetype(netincomingmessagetype.connectionapproval); server = new netserver(config); server.start(); server.upnp.forwardport(14242, "forlorn forest"); here's exception forwardport throws fails , gives "bad request": and 2 web exceptions thrown: it says connection being closed remote host , unable read data transport connection in exception details: any thoughts might going on here? upnp enabled on router. i've taken @ network traffic wireshark

javascript - IE 10 not event not firing bind() or on() using JQuery -

$('body').unload(function () { }); $('body').on("beforeunload", function () { //if true means logged clicked else page close clicked if (istrue == 0) { btgui.webservices.connectiontoken.getlogoutclientusermethod(logoutclientusermethodsucess); } else { btgui.webservices.connectiontoken.pageclosedxmlmethod(hddclient, hddusername); } bind() or on() events not firing in ie 10,except ie working browsers fine. ie version work i'm using jquery 1.7.0 i'm tested $(window) not working. yes, event handler should bound $(window). beforeunload handler supposed return string displayed in confirmation box. seems me you're doing lot more that.

Linux vanilla kernel on QEMU and networking with eth0 -

i have downloaded , compiled vanilla linux kernel (3.7.1) used busybox ramdisk booted using qemu. qemu command line qemu-system-i386 -kernel bzimage -initrd ramdisk.img -append "root=/dev/ram rw console=ttys0 rdinit=/bin/ash" -nographic -net nic -net user everything goes well. however, can't use networking on vanilla kernel busybox. 'ifup eth0' tells me / # ifup eth0 ip: siocgifflags: no such device i googled internet can' clue... advice nice thank in advance. most there no driver (in example should e1000) loaded or device has name. in /sys/class/net/ should find listing of available net-devices. if there none (besides lo) driver not loaded. in qemu monitor type "info pci" , show pci-address of ethernet card. should this: ... bus 0, device 3, function 0: ethernet controller: pci device 8086:100e ... this device corresponds /sys/devices/pci0000:00/0000:00:03.0/. files "vendor" , "device" must c

java - Getting exception in JDBC thin driver -

i try run query using java , below mentioned program import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.statement; import javax.naming.spi.dirstatefactory.result; public class oracleconn { public static void main(string[] args) { try { class.forname("oracle.jdbc.driver.oracledriver"); connection con = drivermanager.getconnection("jdbc:oracle:thin:@localhost:1521:yglobal","user","user"); statement stmt = con.createstatement(); resultset rs = stmt.executequery("select empid empmaster"); while(rs.next()) system.out.println(rs.getint(1)); con.close(); } catch (exception e) { e.printstacktrace(); }} } but when tried run program getting exception java.sql.sqlexception: ora-01756: quoted string not terminated @ oracle.jdbc.driver.databasee