Posts

Showing posts from January, 2014

URLLib2.URL Error: Reading Server Response Codes (Python) -

i have list of urls. i'd see server response code of each , find out if broken. can read server errors (500) , broken links (404) okay, code breaks once non-website read (e.g. "notawebsite_broken.com"). i've searched around , not found answer... hope can help. here's code: import urllib2 #list of urls. third url not website urls = ["http://www.google.com","http://www.ebay.com/broken-link", "http://notawebsite_broken"] #empty list store output response_codes = [] # run "for" loop: server response code , save results response_codes url in urls: try: connection = urllib2.urlopen(url) response_codes.append(connection.getcode()) connection.close() print url, ' - ', connection.getcode() except urllib2.httperror, e: response_codes.append(e.getcode()) print url, ' - ', e.getcode() print response_codes this gives output of... http://www.google.com

python - Accessing Django Modules from a Django subdirectory -

i'm setting documentation django project. documentation lives in folder called docs within project root: project-root/ doc/ app1/ app2/ app3/ urls/ the problem i'm writing extension documentation lives in doc/ folder. when generate documentation, run extension outside of context of django (just script). in extension, need access object in project's url's file. but when try import project.urls, import error. how can access project-root/urls when i'm running script in project-root/doc/extension.py isn't run through django? you can setup django environment this: import os, sys sys.path.append("/path/to/your_project/") os.environ["django_settings_module"] = "yourproject.settings"

spring - Url getting modified after request is received at the server -

i trying develop restful web service using spring framework apache tomcat. added 2 controller classes had 5-6 endpoints working fine. since yesterday when trying add endpoint getting strange error. @controller @requestmapping("/test") public class textcontroller { @requestmapping(method=requestmethod.post) public void test() { system.out.println("hello world"); } } when try url browser(using rest client) getting following output: hello world jun 25, 2014 7:05:55 pm org.springframework.web.servlet.pagenotfound nohandlerfound warning: no mapping found http request uri [/chitchatapp/rest/test/test] in dispatcherservlet name 'chitchat-dispatcher' the url showing "/test" appended. other apis still working fine. new ones adding giving error. my web.xml looks this: <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="

java - How to mock a class throughout the system using Mockito -

i have method trying test using mockito: public class miscutil{ public int getvalue(string key){ properties properties = new helper().getproperties() //this method //i need mock return properties.get(key) } here test class : public class miscutiltest{ public void testgetbooleanvalue() { properties properties = new properties(); properties.setproperty(my_special_int_property, 10); // mock helper helper mock = mockito.mock(helper.class); // mock method getproperties() mockito.when(mock.getproperties()).thenreturn(properties); // assert getvalue() method assert.assertequals(10,miscutil.getvalue(my_special_int_property)); however, method doesn't mocked. have pass actual mocked instance miscutil class in order mocking take effect? miscutil class doesn't let me pass helper object it. easy mock particular method of class in jmockit though upper classes

angularjs - Handling trailing slashes in angularUI router -

it's been hours since started working on problem , can't seem head around solution. i have app may result in users typing in url. in such cases not hard believe user might enter trailing slash. example, www.example.com/users/2 , www.example.com/edit/company/123 should treated same as www.example.com/users/2/ , www.example.com/edit/company/123/ this needs done handling url routing on client side. not interested in handling trailing slashes in resource/api calls. interested in handling trailing slashed in browser. so researched , found not many answers on net. of them led me faq section of angular-ui router. https://github.com/angular-ui/ui-router/wiki/frequently-asked-questions here tell write rule, want do, doesn't seem working, or maybe doing wrong. here's plunkr have added code. http://plnkr.co/edit/fd9q7l?p=preview i have added config, rest of code pretty basic stuff. $urlrouterprovider.rule(function($injector, $location) { /

android - Getting error with SmackAndroid.init(context) -

Image
i trying create room using asmack muc. have connect() method connects xmpp server no problem (below). public void connect() { connectionconfiguration connconfig = new connectionconfiguration(host, port, service); xmppconnection connection = new xmppconnection(connconfig); try { connection.connect(); log.i("xmppchatdemoactivity", "connected " + connection.gethost()); } catch (xmppexception ex) { log.e("xmppchatdemoactivity", "failed connect " + connection.gethost()); log.e("xmppchatdemoactivity", ex.tostring()); setconnection(null); } try { connection.login(username, password); log.i("xmppchatdemoactivity", "logged in " + connection.getuser()); presence presence = new presence(presence.type.ava

int - MySql user input restriction -

i new mysql, trying create table store scores ranging 0 5. keep reading constraint check fails, allows me input numbers greater 5. here sample of script create table part2( p2_q1 int(1) check (p2_q1 >= 0 , p2_q1 < 6), //this 1 way i've read p2_q2 int(1) check (p2_q2 >= 0 , p2_q2 < 6), p2_q3 int(1) check (p2_q3 between 0 , 5), //and other way p2_q4 int(1) check (p2_q4 between 0 , 5) ); thanks ahead of time can get! you can define check constraints in mysql has no effect. engine ignores whatever define. may supported in future version of mysql. but instead can define 2 triggers called on every update , insert. insert trigger: delimiter | create trigger `ins_p2` before insert on `part2` each row begin if new.p2_q1 not between 0 , 5 , new.p2_q2 not between 0 , 5 , new.p2_q3 not between 0 , 5 , new.p2_q4 not between 0 , 5 signal sqlstate '45000' set message_text = 'o

Ruby Cipher If statements not working -

i wondering if correct things have done wrong in code. attempting make 1 time pad ruby. every time run code, , provide input put cipher, returns nil or doesn't return exact amount of characters (i enter in 4 character word , returns 2 characters). h = {} v = 0 ('a'..'z').each |c| v+=1 h[c] = v end puts "provide input:" input = gets input.downcase! if input.include?("a") n = h["a"] + rand(26) puts h.index(n) end if input.include?("b") n = h["b"] + rand(26) puts h.index(n) end if input.include?("c") n = h["c"] + rand(26) puts h.index(n) end if input.include?("d") n = h["d"] + rand(26) puts h.index(n) end if input.include?("e") n = h["e"] + rand(26) puts h.index(n) end if input.include?("f") n = h["f"] + rand(26) puts h.index(n) end if input.incl

Creating a matrix subset in R -

i have big single row matrix (n=20000): v1 col1 col2 col3 ... coln abc 1 3 5 2 i want subset keep columns value >= 3: v1 col2 col3 abc 3 5 i have searched everywhere cannot come proper solution. suppose can transpose it, subset , transpose back? appreciated. logical indexing works on either i or j arguments "[" mtx[ , mtx > 3] # ............... read , study ?[ carefully. there power in function takes 10 readings gather of capacities , subtleties. (this may eve work on dataframe of appropriate construction , workings of "[" quite similar 2 structure=types.

jquery - How to capture contents of a label to be exact header of the table -

i have 2 <ul> <li> structures , table in middle of them, way <ul> <li> text <label>1#</label> <input type="text" value="" /> </li> <li> text <label>2#</label> <input type="text" value="" /> </li> <li> text <label>3#</label> <input type="text" value="" /> </li> <li> text <label>4#</label> <input type="text" value="" /> </li> <li> text <label>5#</label> <input type="text" value="" /> </li> <li> <!-- first read contains label inside --> <label>6#</label> </li> </ul> <table> <tbody> <tr> <td>#1</td> <t

java - How to get the time interval a ping request is sent and received -

i need run tests emulator using, , need test specified rtt delay. rtt delay 10x more, , @ times, need test if in reality correct. instance if emulator's log says @ time x rtt set 400ms, can see verify using real application connected emulator's network. best way using ping timestamps. there ways specify when ping request has been sent, , delay is? or feel free suggest other methods test case. i have java implementation send ping requests! public static void main(string[] args) throws unknownhostexception, ioexception { string ipaddress = "127.0.0.1"; inetaddress inet = inetaddress.getbyname(ipaddress); system.out.println("sending ping request " + ipaddress); system.out.println(inet.isreachable(5000)); } string ipaddress = "127.0.0.1"; inetaddress inet = inetaddress.getbyname(ipaddress); system.out.println("sending ping request " + ipaddress); int uptime = (int) system.currenttimemillis(); system.out.pr

ojdbc - JDBC ARRAY(ORACLE CollectionTYPE) use String Value Encoding in JAVA -

i'm not @ english and english grammar wrong wish understanding i using array class in ojdbc6. use it(array class) send data oracle database(procedure). data of number type , date type in oracle. howerver data of varchar2 type null in oracle (array) i see diffrent solution (java path setup orai18n.jar file) have error of java.lang.nosuchmethoderror: oracle.i18n.text.converter.characterconverterogs.getinstance(i)loracle/i18n/text/converter/characterconverter; i don't found solution problem please how solve problem ~~ ~~ i use jdk1.7,ojdbc6.jar ----------------------------------------------orclae code---------------------------------- create or replace type xxxxxxxx_type object( nnnnnnn1 number ,nnnnnnn2 number ,nnnnnnn3 number ,vvvvvvv1 varchar2(150) ,nnnnnnn4 number ,dddddddd1 date ,vvvvvvv2 varchar2(250) ,nnnnnnn5 number ,dddddd

java - Table model unable to retrieve the data from database -

i coded tablemodel table. successful add table column name unable retrieve data database. if 1 have questions post comment. error unable retrieve data database. code import java.awt.borderlayout; import java.awt.eventqueue; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.sql.*; import java.util.vector; import java.util.logging.level; import java.util.logging.logger; import javax.swing.*; import javax.swing.table.defaulttablemodel; public class customer_bills { public static void main(string[] args) { customer_bills testtable = new customer_bills(); } public customer_bills() { eventqueue.invokelater(new runnable() { @override public void run() { try { uimanager.setlookandfeel(uimanager.getsystemlookandfeelclassname()); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | un

html5 - HTML 5 native validation is not working in JQuery UI model box but Jquery validation using plugin is working -

i using jquery model box html 5 native validation not working. my code here also adding code below. <!doctype html> <html> <head> <title>jquery ui dialog: open dialog </title> <link rel="stylesheet" href="../css/jquery-ui.css" /> <link rel="stylesheet" href="../css/style.css" /> <script type="text/javascript" src="../scripts/jquery.js"></script> <script type="text/javascript" src="../scripts/jquery-ui.js"></script> <script type="text/javascript" src="../scripts/jquery.validate.js"></script> <script type="text/javascript"> $(function(){ //$('#pop_up_form').validate(); $("#popup").dialog({ autoopen: true, title : "view/edit screen", dialogclass : "pop-content pop-header-colr pop-button pop-float", width:400, height:450, modal: true

java - How to relate images in a folder to its metadata stored in mysql in perl? -

i able store uploaded image in folder(named category) , related data uploaders info,its category in mysql using code below. use strict; use warnings; use dbi; use dbd::mysql; use cgi; $query = new cgi; $uploader_name = $query->param("name"); $filename = $query->param("file"); $category = $query->param("cat"); $uploaded_dir = $category; print $query->header(); $filename =~ s/.*[\/\\](.*)/$1/; $filename =~ s/ /_/g; $upload_filehandle = $query->upload("file"); $directory_filename = "$upload_dir/$filename"; # upload file server open uploadfile, ">$directory_filename"; binmode uploadfile; while ( <$upload_filehandle> ) { print uploadfile; } close uploadfile; # open file # open myfile, $directory_filename || print "cannot open file"; # $blob_file; # read in contents # while (<myfile>) # { # $blob_file .= $_; # } # close myfile; # make database connection $dbh=dbi->c

ios - Submit the app for FB review -

my ios application required publish_actions permission fb, have submitted app fb review creating simulator build per instructions create simulator build submit fb review but fb team reported issue "your app downloads successfully, crashes upon opening. please resolve technical issues prevent testing app." when try install app in iphone or simulator, working fine, not sure issue fb team facing exactly. could suggest went wrong while testing fb team. can test simulator build (.app) uploaded in fb installing in simulator? facebook using ios-sim test simulator build of applocation. if build works ios-sim, submit simulator build review facebook.

javascript - CSS transition cutting off early -

i'm having issue css transitions being cut off , i'm not sure why it's happening. think has transition on child element because if remove code makes child elements transition, container's transition fine. the code kind of long , i'm using library called baraja that's supposed allow me transition between elements if cards. this structure of relevant html: <ul id="cards" class="baraja-container"> <li id="usa-germany" class="card"> <div id="room-info"> <h1 id="room-name">usa vs. germany</h1> <p class="room-description"> live game discussion berkeley alumni. let's go america! </p> </div> <div id="thumbnails-container"> <div id="thumb-0" class="thumb"> <div id="message-0" class="message-popup first"> <s

visual studio 2010 - How to set a specific solution configuration by default upon startup? -

Image
in solution, have several solution configurations. upon start-up ,debug set default. is possible set specific configuration default? i've tried rename solutions begin "." ,for instance - .mysqldebug . still debug remains default configuration. renaming "debug" me?

RSA encryption from java and decryption using php -

i trying rsa encrypt of user email id using java , trying decrypt using php. not successful below details source in java: package ia; import java.io.file; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import java.io.objectinputstream; import java.io.objectoutputstream; import java.security.keypair; import java.security.keypairgenerator; import java.security.nosuchalgorithmexception; import java.security.privatekey; import java.security.publickey; import java.util.date; import javax.crypto.cipher; import org.apache.commons.codec.binary.base64; public class encryptionuntil { /** * string hold name of encryption algorithm. */ public static final string algorithm = "rsa"; /** * string hold name of private key file. */ public static final string private_key_file = "c:/keys/private/private.key"; /** * string hold name of public key file. */ public static final string pu

c# - check for same user name in database 3 -

i want check whether user exist or not , if not save in database else show error message user exist before used command works perfectly sqlcommand cmd = new sqlcommand("select count(*) cntc_employee emp_alias= @alias", con); cmd.parameters.addwithvalue("@alias", this.alias.text); con.open(); if(convert.toint32(cmd.executescalar()) > 0) { errorprovider1.seterror(alias,"alias exist"); return true; } else { return false; } but in 3 tier dont know how use executescalar in bll class in if ()section in bll class private bool usernamecheck(string alias) { if (??) throw new exception("alias exist"); else return true; } in dal class public void usernamecheck(string alias) { string query6; try { opencnn(); query6 = "select count(*) cntc_employee emp_alias= '" + alias + "' "; cmd = new sqlcommand(query6, con); cmd.exec

How to extract Json data and get all the values in java? -

i trying display values below json,but using below code can able show 1 loop value @ time. say if key, "name" i getting in console ##-- name : abcd but need show data belongs keys " name " , " e_id " can me solve issue? thanks precious time!.. sample.java string strjson = "[\n {\n \"samplelist\": [\n {\n \"name\": \"abcd\",\n \"e_id\": \"123\"\n }\n ]\n },\n {\n \"samplelist\": [\n {\n \"name\": \"efgh\",\n \"e_id\": \"456\"\n }\n ]\n }\n]"; jsonarray jarr = new jsonarray(strjson); (int = 0; < jarr.length(); i++) { string str_alldata = jarr.getjsonobject(i).getstring("samplelist"); jsonarray newjarr = new jso

java - How do I insert data from mysql into the combobox? -

what's wrong code here? i'm trying insert data mysql combobox in netbean private void btnsandoghmousepressed(java.awt.event.mouseevent evt) { try { string query = "select `accounttype` `account`"; con = connect.connectdb(); preparedstatement stm = con.preparestatement(query); pst = con.preparestatement(query); resultset rs = pst.executequery(query); arraylist<string> groupnames = new arraylist<string>(); while (rs.next()) { string groupname = rs.getstring(4); groupnames.add(groupname); } defaultcomboboxmodel model = new defaultcomboboxmodel(groupnames.toarray()); cmbsemetarid.setmodel(model); rs.close(); } catch (sqlexception e) { system.err.println("connection error! it's date"); } } you problems try use model way or using vector . be

java - Couldn't get the values from jsp to servlet -

if run jsp, while exporting contents excel, not getting values in downloaded excel file. empty. here tried.. how pass table values servlet? excel.jsp <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@ page import ="javax.swing.joptionpane"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>export excel - demo</title> </head> <body> <table align="left" border="2"> <thead> <tr bgcolor="lightgreen"> <th>sr. no.</th> <th>text data</th> <th>number data</th> </tr>

ios - How to fix Apple Mach -O-linker warning Directory is not found error -

Image
i handling warning error in xcode 5.1. need fix error here error showing like... ld /users/riz/library/developer/xcode/deriveddata/sedioios-dfvlolozvfewogempmjncnwobvbw/build/products/debug-iphonesimulator/sedioios.app/sedioios normal i386 cd /users/riz/desktop/vine-clone-iphone/sedioios export iphoneos_deployment_target=6.1 export path="/applications/xcode 2.app/contents/developer/platforms/iphonesimulator.platform/developer/usr/bin:/applications/xcode 2.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode\ 2.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /applications/xcode\ 2.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator7.1.sdk -l/users/riz/library/developer/xcode/deriveddata/sedioios-dfvlolozvfewogempmjncnwobvbw/build/products/debug-iphonesimulator -f/users/riz/library/developer/xcode/deriveddata/sedioios-dfvlolozvfewogempmjncnwo

plsql - oracle datatype for multiple periods in number -

i looking if there number type datatype available storing number hierarchy like 1.0 1.0.1 1.0.2 2.0 2.0.1 etc in oracle table. varchar2 option? this question little old, here's take: since you're looking combine both storage of multiple bits of data (the component portions of version number) along behavior (knowing how sort), user-defined type may need: create or replace type version_num object ( major_version integer, minor_version integer, fix_version integer, order member function compare (other version_num) return integer ); / create or replace type body version_num order member function compare (other version_num) return integer begin if (self.major_version > other.major_version) return 1; elsif (self.major_version < other.major_version) return -1; else if (self.minor_version > other.minor_version) return 1; elsif (self.minor_version < other.minor_version) return -1;

c++ - Switch Statement Not Allowing First User Input -

this function checks two-dimensional char array , goes through each word in array, using size, searching > take switch statement searching cases. i having problem in switch statement, user input first time switch statement goes through default case. void parseword(char story[][256], int size) { (int = 0; < size; i++) { char prompt[256][32]; if (story[i][0] == '<') { switch (story[i][1]) { case '#': story[i][0] = '\n'; story[i][1] = 0; break; case '{': story[i][0] = ' '; story[i][1] = '\"'; story[i][2] = 0; break; case '}': story[i][0] = '\"'; story[i][1] = ' '; story[i][2] = 0; break; case '[': story[i][0] = '

php - conditionally change array used in foreach loop -

i want conditionally change array looped though foreach loop , send var in url = domain.com/myphppage.php?myarray=$array1 script has 2 arrays. $_get used var url , foreach loop uses 1 of 2 arrays output array content on page. <?php $array1 = array(1,2,3,4) $array2 = array(5,6,7,8) ?> <?php $arrayused = $_get['myarray']; echo $arrayused; ?> <?php foreach($arrayused $item): ?> html code show loop values <?php endforeach; ?> the var passed url shown on page output echo $arrayused . i expecting $arrayused variable picked foreach , looped through whichever of 2 arrays in variable. however, doesn't pick variable , not go foreach loop. if hardcode either of 2 array names foreach statement, foreach loop works fine. why doesn't foreach statement appear 'recognize' variable retrieved url? prints on page before loop available? if understand correctly - $arrayused str

Translate a vector based on a matrix on R -

i have indicate matrix, this: john 1 ann 2 ruby 3 clair 4 so want translate vector number keep order, this: (john,ann,john,clair,john,ruby,ann,john,ruby)->(1,2,1,4,1,3,2,1,3) i don't know how r(without loop). please me. thks even in updated example, can use ?match @pascal describes. don't match letters . # generate example df <- data.frame(input=c("john", "ann", "ruby", "clair"), output=1:4) x <- c("john", "ann", "john", "clair", "john", "ruby", "ann", "john", "ruby") # # if output indeed 1:nrow(df) match(x, df[, "input"]) # if output different df[match(x, df[, "input"]), "output"]

java - Playing musics with ImageButton android -

i have list of music (.mp3) want played imagebutton , want play each sound id first, have database has field _id. then, tried final string ambil = kata.get(3) for retrieving _id query used. then, used speaker.settag(ambil); speaker imagebutton want tag each button _id make sound different each other. then, ordered of sound file have this int names[] = {r.raw.a,r.raw.a,r.raw.c}; finally, want create mediaplayer this mediaplayer mp = mediaplayer.create(lazyadapter.this, r.raw.names[ambil]); is algorithm right ? for now, give hint how done in simple way. can create array raw resources: int names[] = new int {r.raw.a,r.raw.b,r.raw.c}; don´t make string array have done it, not work. use example above , create mediaplayer this: mediaplayer mp = mediaplayer.create(lazyadapter.this, names[0]); edit from example above, see wrong things. first, can´t pass string identify number of array. did this: final string ambil = kata.get(3) and tryin

c++ - Visual Studio debugger visualizer for Qt image types? -

is there vs 2010 debugger visualizer qt's image types ( qimage , qpixmap , etc), similar this 1 system.drawing.image ? glanced through this article detailing steps required write such visualizer, can't figure out if it's possible make 1 qimage et al. no, there isn't any. there isn't in qtcreator, neither in qt vs add-in.

c++ - Is-braces-constructible type trait -

how can check whether specific type typename t constructible arguments typename ...args in manner t{args...} ? aware of std::is_constructible< t, args... > type trait <type_traits> , works parentheses, not curly braces. not have experience in writing of type traits, cannot provide initial example. simplification can accept reasonable assertions, if leads not significant loss of generality. template<class t, typename... args> decltype(void(t{std::declval<args>()...}), std::true_type()) test(int); template<class t, typename... args> std::false_type test(...); template<class t, typename... args> struct is_braces_constructible : decltype(test<t, args...>(0)) { };

osclass - PHP - Logical operator with IF/Else statement test not working correctly -

code from: oc-content/themes/realestate/item.php i have piece of php code part of 'framework' called osclass . basically, trying 'hide' user (the publisher of advert) name non-logged in users. in other words, if user logged in, can see if publisher users advert. i found out need add piece of code osc_is_web_user_logged_in() , has worked section, however, due else statement, publishers name still displaying... how can amend else statement? remove else statement, i'm worried 'break' , unsure osc_item_user_id() does... add if statement within else statement (complete php newbie here). <div class="ico-author ico"></div> <?php if( osc_item_user_id() != null && osc_is_web_user_logged_in() ){ ?> <?php echo osc_item_contact_name(); ?> <?php } else { ?> <?php echo osc_item_contact_name(); ?> <?php } ?> thanks! in opinion should si

python - Import sparse matrix from csv file -

i have csv file headers like: given test.csv file contains sparse matrix : "a","b","c","d","e","f","timestamp" 611.88243,0,0,0,0,0,0 0,9089.5601,0,864.07514,0,0,0 0,0,5133.0,0,0,0,0 i want load sparse matrix/ndarray 3 rows , 7 columns. if, use load.txt array 3 rows , 7 columns. numpy.loadtxt(open("test.csv","rb"),delimiter=",",skiprows=1) now, file huge 10,000 columns , 7000 rows. so, taking lot of time load. there efficient method in scipy/numpy load matrix sparse matrix or array, takes less amount of time in loading taking advantage of sparse feature? i tested bare bones loadtxt on data (replicated produce (39,7) array): def my_loadtxt(file): # barebones loadtxt f = open(file) h = f.readline() ll = [] l in f: y = [float(x) x in l.split(',')] ll.append(y) x = np.array(ll) f.close() return x it 2x fas

c# - How to open process on dual monitor? -

i have c# application should open process on second screen if there more 1 screen. cannot working. ideas? array screens = screen.allscreens; if (screens.length > 1) { // open in second monitor } else { system.diagnostics.process.start(inputdata); } it should same data in else , open on second monitor in empty if . there no standard way specify on screen application appear when launch it. however, either: handle in started app (if have code of course) find handle of main window after process has started, , move second screen using win32 interop

osx - Unattended (no-prompt) Homebrew installation using expect -

according homebrew installation instructions, following command can used install: ruby -e "$(curl -fssl https://raw.github.com/homebrew/homebrew/go/install)" this works, needs user input 2 times; confirm install , in sudo prompt invoked script: $ ruby -e "$(curl -fssl https://raw.github.com/homebrew/homebrew/go/install)" ==> script install: /usr/local/bin/brew /usr/local/library/... /usr/local/share/man/man1/brew.1 press return continue or other key abort ==> /usr/bin/sudo /bin/mkdir /usr/local password: homebrew doesn't have arguments unattended installations, option can think of programatically input expected data. tried using expect , can't quite syntax right: $ expect -c 'spawn ruby -e \"\$(curl -fssl https://raw.github.com/homebrew/homebrew/go/install)\";expect "return";send "\n"' ruby: invalid option -f (-h show valid options) (runtimeerror) send: spawn id exp7 not open while executing &qu

eclipse - Bundle JRE with PDE headless build -

i have build script (pde headless build) building rcp application. , work's expected. have 2 tasks not able close it. am trying bundle jre along rcp application, , followed steps provided in url . still not able bundle jre built application. tried in build.properties file: root=absolute:c:/java/jre. - c:/java/jre root directory jre resides. has faced problem? my application uses db2 database saving/reading data. possible bundle database along application using pde headless build? if so, please throw light on topic too. using db2-expressc latest version thanks

if we execute a update statement and a delete statement parallel in sql server 2008 having isolation level at Read committed. What will be the output -

if transaction having multiple select statements feteching data table , parallel query runs deleting set of records fetched in previoius transaction. result of select statement within transaction executes after delete query. isolation level set read committed. begin trans select * mytable id >100 , id <1000 //while loop //some time taking operation. here parallel delete query executes select * mytable id >100 , id <1000 //**what output of query ?** commit trans -------- //some other delete query delete mytable id > 500 , id <1000 since rci holds locks duration of statement it's going depend on timing. assuming order have , delete happens in rci , in own transaction first select bring of data, delete starts , other select starts. deadlock (depending) 1 of statements going locks granted first , other wait until can acquire locks. it's timing problem @ point. if run these in tight enough loop you'll hit interesting results. if wanted