Posts

Showing posts from January, 2011

excel - VBA autofilter with multiple criteria -

excel - VBA autofilter with multiple criteria - i wondering whether help prepare next vba code. want filter rows containing entire string "color_name" , rows containing "keyword" , "size" partial string. if run macro see "color_name" , if run operator:=xland see values containing "size". thanks! activesheet.range("$a$1:$a$10000").autofilter field:=1, criteria1:=array( _ "color_name", "=*keyword*", "=*size*"), _ operator:=xlfiltervalues end sub excel vba autofilter

sql - Store "greater than or equal to" symbol in Oracle varchar2 column -

sql - Store "greater than or equal to" symbol in Oracle varchar2 column - i have varchar2(255) column i'd store string like: 1 ≤ 2 however, when run next sql ≤ symbol gets turned "=". update my_table set my_column = '1 ≤ 2'; this results in next value in table: 1 = 2 how store ≤ or ≥ in database? use unistr store utf8 data. it's not convenient plain string, avoids errors caused clients not interpreting utf8 correctly. --≥ select unistr('1 \2265 2') dual; --≤ select unistr('1 \2264 2') dual; sql oracle oracle11g

Lookup hour on DateTimeField Django -

Lookup hour on DateTimeField Django - i have model class item(models.model): inicio = models.datetimefield() when seek create query: itens = item.objects.filter(inicio__hour__gte=6) it returns me: fielderror unsupported lookup 'hour' datetimefield or bring together on field not permitted. how can create query? you need filter using timedelta: from datetime import datetime, timedelta five_hours_ago = datetime.now() - timedelta(hours=5) items = item.objects.filter(inicio__lt=five_hours_ago) you can specify exact datetime , subtract 5 hours if don't want 5 hours current datetime. to best of knowledge, , according documentation, can exact lookup on hour, min or second. django django-models django-queryset

winforms - VS 2013 Cheking for updates -

winforms - VS 2013 Cheking for updates - i developing windows forms application visual studio 2013 , want publish in web site. utilize vs 2013 publish funcionality using ftp service, publish correctly see not setup.exe uploaded, manifest, , application carpets... 1.- posible publish application under .msi file?, if please allow me know how. 2.- when publish check page, illustration mypage.com, updates, ¿what should in mypage.com when publish new version? when user using app , new version si avaliable he/she noticed it. sorry english language , thx in advance. if add together installer, can create msi. used extension vs2013 vsi bundle. https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d the publish functionality didn't seek that. see stackoverflow item: http://stackoverflow.com/a/23339652/200824 winforms visual-studio-2013 publish

web services - How to call Alfresco (repository) webscript from Share in Java -

web services - How to call Alfresco (repository) webscript from Share in Java - i know may down-voted trivial question... in javascript easy (even magical): remote.call("/api/...") how in java? i read lots of posts this one, alfresco (repository) url either hard coded http://localhost:8080/alfresco , either undefined (exemple : repo_web_service_url ). is there helper give me url of repository? there class same remote javascript root object? i’m sorry if reply obvious, can’t see it, i’m searching hours , i'm starting going crazy should no-brainer... in order create remote available in share script need inject remote using spring. set context file set remote variable: <bean id="myevaluator" class="org.me.myevaluator"> <property name="remote" ref="webframework.webscripts.scriptremote" /> </bean> then need create variable in java class. given can utilize like: public class myeva

c# - How to create a fake FtpWebResponse -

c# - How to create a fake FtpWebResponse - i trying false ftpwebrequest.getresponse() integration test, without using server. have been trying simple homecoming false ftpwebresponse but, not allowed access constructor ftpwebresponse because internal. here code: production code: using (ftpwebresponse response = (ftpwebresponse) ftpwebrequest.getresponse()) { ftpresponse = new ftpresponse(response.statusdescription, false); } test false trying utilize homecoming false ftpwebresponse: shimftpwebrequest.allinstances.getresponse = request => { ftpwebresponse ftpwebresponse= new ftpwebresponse(/*parameters*/); // not allowed because internal ftpwebresponse.statusdescription="blah blah blah"; homecoming ftpwebresponse; }; in end, want homecoming false ftpwebresponse assertion in test. ideas? thanks found ans

java - Constraints on core libraries in sbt -

java - Constraints on core libraries in sbt - is there way create constraints on core libraries in sbt? for example: i don't want utilize java date class, there way create compilation errors/warnings direct imports these? use wart remover. adapting illustration readme, should (untested) import org.brianmckenna.wartremover.{warttraverser, wartuniverse} object javadate extends warttraverser { def apply(u: wartuniverse): u.traverser = { import u.universe._ val javadate: type = typeof[java.util.date] val javacal: type = typeof[java.util.calendar] new traverser { override def traverse(tree: tree) { tree.tpe match { case javadate => u.error(tree.pos, "java.util.date not allowed") case javacal => u.error(tree.pos, "java.util.calendar not allowed") case _ => } super.traverse(tree) } } } } java scala sbt

Unexpected results printing array of int pointers in C -

Unexpected results printing array of int pointers in C - i have simple c programme uses varying number of pthreads find first n prime numbers, adding candidates found prime array. array passed arg each thread, each thread executing of code in critical section. have no issue prime checking, , printing screen of prime numbers , result_number variable found works. however, when n primes found, , array printed, find (roughly) every sec time programme executes, (variably 1 5) of prime number array elements (generally restricted < 17) printed out extremely big or negative numbers, bulk of primes printing fine. code of thread function below (not checkprime or main), else seems work fine. also, if programme executed single thread (i.e. no sharing of array between multiple threads updating), peculiarity never occurs. result_number, candidate, n global vars. void *primenums(void *arg) { pthread_mutex_lock(&mutex); int *array = (int *) arg; int is_prime = 0;

c# - ColorAnimation to animate the listviewItem color on Swipe - WP8.1 -

c# - ColorAnimation to animate the listviewItem color on Swipe - WP8.1 - i'm trying alter color of listview item on swipe right using next story board, throws exception says winrt information: coloranimation cannot used animate property background due incompatible type. additional information: no installed components detected. this code i've used. written in manipulationdelta event grid channelgrid = (grid)sender; grid deletegrid = (grid)((grid)(channelgrid.parent)).children[1]; the grids item template listviewitem , manipulation events wired. else if (e.position.x - initialpoint.x > 30 && channelgrid.width == 380) // swipe right { e.complete(); storyboard swiperight = new storyboard(); coloranimation changecoloranimation = new coloranimation(); changecoloranimation.enabledependentanimation = true; changecoloranimation.to = colors.green; changecoloranimation.dur

testing - How to run all project's tests from REPL? -

testing - How to run all project's tests from REPL? - how run leiningen project's tests repl? leiningen's lein test this. how repl? you can run loaded tests calling (clojure.test/run-all-tests) . note that not automatically load tests want run. if tests can run via "lein test" should able require test namespaces other namespace. if you're using emacs cider, should able c-c , in namespace run tests (this will load test if wasn't loaded before). testing clojure leiningen

Matlab - Callback Function of a serial port that dont know the reference -

Matlab - Callback Function of a serial port that dont know the reference - hello i'm using library of thinkgear connect bluetooth mindwave matlab need stablish callback function of serial port dont have reference of port.is there anyway it? dont want loop code: code portnum1 = 5; %com port # comportname1 = sprintf('\\\\.\\com%d', portnum1); % baud rate utilize tg_connect() , tg_setbaudrate(). tg_baud_57600 = 57600; % info format utilize tg_connect() , tg_setdataformat(). tg_stream_packets = 0; % info type can requested tg_getvalue(). tg_data_raw = 4; %load thinkgear dll loadlibrary('thinkgear.dll'); fprintf('thinkgear.dll loaded\n'); %get dll version dllversion = calllib('thinkgear', 'tg_getdriverversion'); fprintf('thinkgear dll version: %d\n', dllversion ); %% % connection id handle thinkgear connectionid1 = calllib('thinkgear', 'tg_getnewconnectionid'); if ( connectionid1 &

html - Mobile Safari: How to implement a fixed position, scrollable iframe? -

html - Mobile Safari: How to implement a fixed position, scrollable iframe? - is there way implement fixed position, scrollable iframe in mobile safari? have spent quite few hours on problem , can't seem find solution it. for non-fixed iframes, possible work around bugs using combo of -webkit-overflow-scrolling: touch; , overflow: auto; , can't find way create fixed iframes scrollable in mobile safari. here's jsbin problem. tested against ios 8 on ipad 4 , iphone 5s. you should add together positions (top,bottom,left,right) fixed iframe: .iframe-wrap { background: #ddd; position: fixed; right: 0; bottom: 0; left: 0; top: 0; width: 100%; height: 100%; padding: 25px; box-sizing: border-box; -webkit-overflow-scrolling: touch; overflow: auto; } i tried in iphome simulator , works. html css iframe webkit mobile-safari

java - Why is my output null everytime? -

java - Why is my output null everytime? - hello have class opens jframe , takes in text. when seek getting text says null. everytime click button want system.out print text entered in textarea. this first class : public class filereader { filebrowser x = new filebrowser(); private string filepath = x.filepath; public string getfilepath(){ homecoming this.filepath; } public static void main(string[] args) { filereader x = new filereader(); if(x.getfilepath() == null){ system.out.println("string null."); } else { system.out.println(x.getfilepath()); } } } this jframe takes in input , stores in static string. /* * class used read location * of file user. */ import java.awt.*; import java.awt.event.*; import java.awt.event.*; import javax.swing.*; public class filebrowser extends jframe{ private jtextarea textarea; private jbutton button;

codeigniter - Why is my http authentication not working? -

codeigniter - Why is my http authentication not working? - i set http authentication 1 of sites. web app built using code igniter , custom uri routing. after changing .conf file site, got 404 not found errors when trying access of pages besides homepage. example, navigating /about , worked before http authentication, not gives 404 message: the requested url /about not found on server. apache/2.4.7 (ubuntu) server @ example.com port 80 why apache sending request '/` directory? .conf file(slightly adapted security) under sites-enabled following: <virtualhost *:80> # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used lastly resort host regardless. # however, must set farther virtual host explicitly. serv

web services - Kerberos Authentication header for JAX-WS clin -

web services - Kerberos Authentication header for JAX-WS clin - i generating webservice using ws-import connect aspx service have secured kerberos on iis. able connect , authenticate fine when connect service using soapconnection final soapconnection conn = soapconnectionfactory.newinstance().createconnection(); seek { final messagefactory msgfactory = messagefactory.newinstance(); final soapmessage message = msgfactory.createmessage(); final mimeheaders headers = message.getmimeheaders(); if (spnegotoken != null) { headers.addheader("soapaction", "http://tempuri.org/helloworld"); headers.addheader("authorization", "negotiate " + base64.encode(spnegotoken)); } message.getsoapbody().addbodyelement(new qname("http://tempuri.org/", "helloworld", "tem")); final soapmessage response = conn.call( message, "http://server:9994/webservice/sampleservice.asmx"

html - I cant find my link on the home page -

html - I cant find my link on the home page - i having problem finding link. when open html , css in file, cannot visibly see (i believe stuck under div, though z-index higher?) not exclusively sure why, help appreciated! html: <!doctype html> <html> <head> <link type="text/css" rel="stylesheet" href="stylesheet.css" /> <title>derpycats.com</title> </head> <body> <!--background (carbon fibre)--> <body background="background.jpg" alt="background" /> <!--header--> <h1 id="header">derpycats.com</h1> <div id="headerdiv"></div> <!---links--> <a href="http://www.youtube.com">home</a> </body> </html> css: /* sets pixel density "fill browser" */ * { width: 100%; height: 100%; } /* heading */ #header { float:left; margin-

apache - PHP not creating session -

apache - PHP not creating session - i able create sessions on 3 days ago. code remained unchanged. can't create session. error message: warning: unknown: failed write session info (files). please verify current setting of session.save_path right (c:\web\dev\session) in unknown on line 0 . if re-create path c:\web\dev\session windows run command, opens path have verified path exists. error: warning: session_start(): session id long or contains illegal characters, valid characters a-z, a-z, 0-9 , '-,' in c:\web\dev\backdoor\request.php on line 10 don't specify php id. my code looks this: $user_row array users info session in it. session_save_path('c:\web\dev\session'); session_start(); $_session['user'] = $user_row; $_session['security']['ip'] = $_server['remote_addr']; if (isset($_server['http_x_forwarded_for'])) { $_session['forwarded_for'] = $_server['http_x_forwarded_for'];

javascript - How to change the current link color in navigation bar -

javascript - How to change the current link color in navigation bar - how can specify background color link "block" in navigation bar selected (clicked)? the thought navigation bar positioned top of page , because links targeted iframe, main index html doesn't refresh. can't find way solve this. can done css or need javascript or else that? thanks in advance! html: <table> <tr> <td> <div class="menuint"> <ul> <li><a href="page1.html" target="ifrm"><h1>link 1</h1></a></li> <li><a href="page2.html" target="ifrm"><h1>link 2</h1></a></li> <li><a href="page3.html" target="ifrm"><h1>link 3</h1></a></li> <li><a href="page4.html" target="ifrm"><h1>link 4</h1></a></li>

javascript - Bootstrap3: Firefox bug - Cannot set div height -

javascript - Bootstrap3: Firefox bug - Cannot set div height - firstly here link: http://isotopethemes.com/extenso/home9.html everything fine in chrome.in firefox slider pushed right side, happens because 'nav.navbar.navigation-9' height 50px. i've set height 40px, while page loads shows 40px after loads height 50px, hence slider pushed right side. i've tried possible solutions know, help appreciated. set main-nav height 38px. .header-9-navigation .main-nav { height: 38px; position: static; } your main-nav have equal header-9-form slider appear below. javascript jquery html css firefox

jruby - What is (was) "wrong" with Tomcat? -

jruby - What is (was) "wrong" with Tomcat? - i've been using tomcat quite while, understand it's embeding (introduced in tomcat 7) apis quite well, maintained trinidad jruby (e.g. suitable deployinh ruby on rails applications) server built upon tomcat. every 1 time in while, there's kind of "myth" (for me) recommendation not utilize tomcat , instead of alternatives such jetty. it's somehow never explained , i'd know more seems coming experienced java-ists e.g. first heard square talk how deploy (jruby) applications: http://vimeo.com/45719570 not sure how , if still relevant going few years i'd know background of "stay away tomcat" ... esp. seems still pop-up , still not want utilize tomcat "based solution" : jruby deployment options back upwards multiple versions of jruby tomcat jruby

asp.net - How to get the data of a specific row on a GridView on behind code and pass it to another webform -

asp.net - How to get the data of a specific row on a GridView on behind code and pass it to another webform - i have code show below. click edit button , in code behind row number how values of fields? want pass info of fields page ? , best way pass values of fields webform : "secondpage.aspx?id=" + id or using session or there improve way? .aspx code <asp:gridview id="gridview1" runat="server" allowpaging="true" autogeneratecolumns="false" pagesize="100"> <columns> <asp:templatefield headertext="edit"> <itemtemplate> <asp:hyperlink id="hyperlink1" runat="server" navigateurl='<%# "vformreport2.aspx?id=" & ctype(databinder.eval(container.dataitem, "fldemployeeid"), string)%>' text="edit" /> </itemtemplate> </asp:templatefield> <asp:boundfield datafield="fl

php - Send echo before sleep not working, any alternatives? -

php - Send echo before sleep not working, any alternatives? - i'm confused do. want send echo, ajax read , react to. problem php script executed before echoes. tried flushing , other methods found on sof still didn't work. think it's because free host server 000webhost - may have conflicts sleep function. is there way delay execution of php script, before completion send echo client (which alerts user), , afterwards script execute while submit button disabled , time delay displayed? please excuse noviceness on ajax, i've started learning it. if ($failed_attempts_ip_user >= $first_throttle_limit) { foreach ($throttle $attempts => $delay) { if ($failed_attempts_ip_user > $attempts) { if (is_numeric($delay)) { $next_login_minimum_time = $latest_attempt + $delay; if (time() < $next_login_minimum_time) {

HTML form submit automated email using PHP -

HTML form submit automated email using PHP - i have created html form, without difficulty (i relatively new html , css comfortable them). problem want submit button send info inputted in form user email address. my php knowledge almost non-existent, , totally stuck. if has patience help, appreciated. here code form... <!doctype html> <html> <head> <meta charset="utf-8"> <title>life academy | pre-course questionnaire</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="pcq.css"> <link href='http://fonts.googleapis.com/css?family=open+sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div id="formbg"> <div

Installed android app with eclipse working but install app with apk failed when launch? -

Installed android app with eclipse working but install app with apk failed when launch? - i have next code runs fine when run straight using eclipse. when export apk , install it, cant launch it. keeps crashing. public class mydatabase extends sqliteopenhelper{ private static final string db_name = "db"; sqlitedatabase db; /** create table sql */ private static final string create_table_sql = "";/*create table statement*/ public mydatabase(context context) { super(context, db_name, null, 1); db = getwritabledatabase(); } @override public void oncreate(sqlitedatabase db) { db.begintransaction(); seek { db.execsql(create_table_sql); log.d("t", "database:"+db_name+" created"); db.settransactionsuccessful(); } grab (exception e) { e.printstacktrace(); } { db.endtransaction(); db.close(); super.close(); } } @override public void onupgrade(sql

jquery - Three different onclick events should show three different sets of slides of the same slider -

jquery - Three different onclick events should show three different sets of slides of the same slider - i have slider becomes visible when user clicks on image map. have 3 different image maps on page , each should show different grouping of slides when activated. slider shows same slides each of image maps. how can accomplish without having create 3 different sliders. hoping utilize 1 slider picks out right slides when 1 of image maps clicked on. enclosed html , js file. $(document).ready(function () { $('#slider_option').click(function(){ $('#slider').css('visibility','hidden'); $('#slider_option').css('visibility','hidden'); $('#gallery1').fadeto( 1200, 1,function(){ }); }); var slidecount = $('#slider ul li').length; var slidewidth = $('#slider ul li').width(); var slideheight = $('#slider ul li').height(); var sliderulwidth

opencv - Detecting irregular lines/polyline in matlab -

opencv - Detecting irregular lines/polyline in matlab - i quite new matlab , image processing what trying accomplish observe irregular lines in image. example, in next image, there 4 polylines: my goal set of pixel points representing these 4 irregular lines/poly line . this. i have read through topics border detection (canny) , hough line detection. applied them not know how tune them purpose, , not sure whether going right direction. appreciate if can give me advices or point me useful resources/articles/algorithms/libraries. -------------------edit ------------------------------------ thank input, think gets me right direction. question simpler might think. not trying observe whether lines irregular or not, pixels of detected lines. in matlab, followed routes: rgb2gray -> 2bw -> bwmorgh(skeletonize) -> bwconncomp(get connected components) the result looks me @ moment, thanks. for scenario after simple binary thresholding, skeletonize im

c++ - Qt5 build failing -

c++ - Qt5 build failing - i'm trying compile phantomjs 2, uses qt5. running failure: make[2]: entering directory `/app/phantomjs/src/qt/qtbase/src/platformsupport' g++ -c -include .pch/qt5platformsupport -pipe -o2 -fpic -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -wall -w -d_reentrant -dqt_no_mtdev -dqt_no_libudev -dqt_no_evdev -dqt_no_graphicsview -dqt_no_graphicseffect -dqt_no_stylesheet -dqt_no_style_cde -dqt_no_style_cleanlooks -dqt_no_style_motif -dqt_no_style_plastique -dqt_no_cast_from_ascii -dqt_no_fontconfig -dqt_build_platformsupport_lib -dqt_building_qt -dqt_no_cast_to_ascii -dqt_ascii_cast_warnings -dqt_moc_compat -dqt_use_qstringbuilder -dqt_deprecated_warnings -dqt_disable_deprecated_before=0x050000 -dqt_no_exceptions -d_largefile64_source -d_largefile_source -dqt_no_debug -dqt_gui_lib -dqt_core_lib -i../../mkspecs/linux-g++ -i. -i../../include -i../../include/qtplatformsupport -i../../include/qtplatformsupport/5.3.0 -i../../

oracle - SQL UPPERCASE UPDATE STATEMENT -

oracle - SQL UPPERCASE UPDATE STATEMENT - update name_surname_dictionary set name=upper("helen") seq='1'; i have problem . wanna create upper this; result:"helen" try update name_surname_dictionary set name=upper('"helen"') seq='1'; and don't forget create commit statement. sql oracle

webfonts - How to include Google Font in JSFiddle? -

webfonts - How to include Google Font in JSFiddle? - i'm trying include google font in jsfiddle without success. added url "external resources" included script. this font want include: <link href='http://fonts.googleapis.com/css?family=oswald:400,700,300' rel='stylesheet' type='text/css'> webfonts must included in css quadrant, using @import: @import url(//fonts.googleapis.com/css?family=oswald:400,700,300); jsfiddle webfonts

c++ - pack any data type into vector -

c++ - pack any data type into vector <uint8_t> - this question resembles serialize info type vector<uint8_t> - utilize reinterpret_cast? template <typename t> inline void pack (std::vector< uint8_t >& dst, t& data) { uint8_t * src = static_cast < uint8_t* >(static_cast < void * >(&data)); dst.insert (dst.end (), src, src + sizeof (t)); } to unpack template <typename t> inline void unpack (vector <uint8_t >& src, int index, t& data) { re-create (&src[index], &src[index + sizeof (t)], &data); } i trying pack type of info byte array . q1 :i have existing tedious implementation using uint8_t* , hope selection of vector best. q2 : not able pack std::string above function . please allow me know how comfortable above function in packing types of info types please allow me know how incorprate std::string above soluntion e pack , std::string vector types of info w

ssh - How to chain SOCKS proxies? -

ssh - How to chain SOCKS proxies? - i have working socks proxy laptop (machine a) machine b: [a]$ ssh -nd 8888 b i can set firefox utilize socks proxy on local port 8888, , browsing works. far good. but have socks proxy between machines b , c: [b]$ ssh -nd 8157 c so can browse on b if on c. is there way chain 2 proxies i'm able utilize firefox locally (on a) while using connection c? is, somehow forwards firefox's socks requests way c. , c cannot see each other directly, have total root ssh access everywhere. machines debian. note don't want forwards single port (like 80), want total chained socks proxy. on machine b set dynamic proxy machine c ssh -nd 8888 user@c then on machine ssh -l 8888:localhost:8888 user@b this makes socks connection on machine b , makes machine b's port 8888 connect-able localhost port 8888 on machine a. this may need 3 ssh connections open if can not straight connect machine b. if can connect mac

java - get all attributes in html string in jsoup -

java - get all attributes in html string in jsoup - i have string in html format , trying attributes , values using jsoup. string is string string= "<button class=submit btn primary-btn flex-table-btn js-submit type=submit>sign in</button>"; document doc = jsoup.parse(string); seek { org.jsoup.nodes.attributes attrs = doc.attributes(); for( org.jsoup.nodes.element element : doc.getallelements() ) { for( attribute attribute : element.attributes() ) { system.out.println( attribute.getkey() + " --::-- "+attribute.getvalue() ); } } } grab (exception e) { e.printstacktrace(); } my desired output :: key: **class** , value is: **submit btn primary-btn flex-table-btn js-submit** key: **type** , value is: **submit** but this key: class , value is: submit key: btn , value is: key: primary-btn , value is: key: flex-table-

javascript - jquery mousover target each element -

javascript - jquery mousover target each element - i want when hover on .project, want p tag appear. code have written shows of p tag every project @ same time. how can when have on project p under project appears. without adding classes? $(document).ready(function() { $('.project').hover( function () { $('.project p').css({"visibility":"visible"}); }, function () { $('.project p').css({"visibility":"hidden"}); } ); }); you need utilize this keyword, , need utilize find() ? $(document).ready(function() { $('.project').hover( function () { $(this).find('p').css({"visibility":"visible"}); }, function () { $(this).find('p').css({"visibility":"hidden"}); } ); }); here's way it $('.project').on('mouseenter mouseleave'

linux - Bash script to Edit all -

linux - Bash script to Edit all - i haven't been able find i'm looking for, figured i'd ask. i'm looking way following: scan directory containing numbered directories (25-109) scan directories within of numbered directories find line in files named "map.inp" containing text: "map_93= 93 a" change occurrences "map_93= 93 v" normally manually, there 1 one thousand files edit each within own directory. found linux scheme accomplish this, i'm not sure how utilize bash script has same functionality. files modified have same name, map.inp. the pathways within directory jan10, in subdirectories this: /user/jan10/100/100a/map.inp /user/jan10/99/99a/map.inp etc. the linux scheme found work this: find /user/jan10/ \ name map.inp \ exec sed -i~ 's/map_93= 93 a\+/map_93= 93 v/' {} \; the desired input be: map_89= 93 and output: map_93= 93 v does have thought on how thi

Temporary Variable Assistance (Scheme) -

Temporary Variable Assistance (Scheme) - i'm making random sentence generator using scheme (pretty big), , i'm having problem defining temporary variables. want create this: <noun1> <verb1> <noun2> <but> <noun2> <verb1> <noun2> <also> example: sharks eat fish, fish eat fish also. have word lists, , functions take word said list. then, utilize append create function. able do: (define (sentence) (append (getnoun) '(and) (getnoun) (getverb))) however, unable figure out way temporarily define variable. have far: (define (sentence1) (append (getnoun) (lambda (verb getverb) (noun getnoun)) (verb) (noun) '(but) (noun) (verb) (noun))) hints/help please? you looking let . http://docs.racket-lang.org/reference/let.html here illustration usage: (define (my-proc age) (let ([age-plus-10 (+ age 10)]) (printf "age ~a" age) (printf "

Get Time From String - Perl -

Get Time From String - Perl - in php do strtotime("+1 days"); and machine time next day. i want seek same perl, i'm going doing sort of cron job execute methods. i know utilize str2time module http://search.cpan.org/~gaas/http-date-6.02/lib/http/date.pm can't seem figure out. i tried following, i'm unsure if did right use http::date qw(str2time); utilize time::piece; utilize time::seconds; $lol = localtime(); $time = $lol - one_hour*($lol->hour + 24); print "time: " . str2time($time); use time::piece; utilize time::seconds; $t1 = localtime() + one_day; print $t1->epoch; perl

objective c - OS X Storyboard Segue dismissController -

objective c - OS X Storyboard Segue dismissController - i user os x storyboard , have created segue viewcontroller style sheet. inside sheet view button close it. connected button dismisscontroller ibaction. if run function dismisscontroller without user interaction viewcontroller gone sheet not go away. does 1 know how dismiss viewcontroller correctly within sheet ? here short illustration i'am trying. function viewcontroller within sheet. override func viewdidappear() { allow chooessourcedirectorydialog: nsopenpanel = nsopenpanel() chooessourcedirectorydialog.canchoosedirectories = true chooessourcedirectorydialog.canchoosefiles = false if chooessourcedirectorydialog.runmodal() == nsokbutton { // stuff selected directory } else { // here close sheet self.dismisscontroller(nil) } } thanks help a sheet view "view", hence should utilize self.dismissviewcontroller(#the controller name#) inste

android - Can't work on my java projects in Eclipse Juno -

android - Can't work on my java projects in Eclipse Juno - i used work in eclipse luna , had many projects in workspace. decided start coding android , downloaded adt bundle here. imported luna workspace , worked fine. however, whenever open class cannot resolved errors everywhere on used flawless code. difference in packages causing this? why can't write , compile java in juno? note don't see errors in bundle explorer on left: your jdk missing or incorrect. check in ur build path of project. jre still referencing old location. java android eclipse

python - django import a variable from server specific settings file -

python - django import a variable from server specific settings file - i have next settings structure. placement of settings folder per autogenerated config. instead of having settings.py, have created settings folder, , contents below. local.py local machine, , production.py production server. both local.py , production.py inherit _base.py . ├── _base.py ├── __init__.py ├── local.py ├── production.py └── secrets.py earlier, there 1 settings file, happily in views write - the some_variable different production , local. from settings import some_variable , worked well. this how validate - python manage.py validate --settings=settings.local throws import error. importerror: cannot import name some_variable any ways go importing things in views file, , avoid import error. thanks! there few different patterns handling settings across different installations. perhaps simplest needs the 1 true way. if want bit more complicated (in opinion) better:

r - Creating a read() command in a custom function -

r - Creating a read() command in a custom function - i'm still rookie r world, in accelerated class limited/no guidance. assignment build custom function reads in specific .csv, , take specific columns out analyzed. please offer advice? "sample code" given looks this: annualleksurvey=function(data.in,stat.year){ d1=subset(data.in,year==stat.year) d2=d1[c("year","complex","tot_male")] attach(d2)} so when it's finish , run it, should able say: annualleksurvey(gsg_lek,2006) where "gsg_lek" name of file want import, , 2006 values "year" column want subset. "complex" , "tot_male" variable analyzed "year", i'm not worried code right now. what i'm confused is; how tell r gsg_lek .csv file, , tell in proper directory when run custom function? i saw 1 other vaguely similar illustration on here, , had utilize if() , paste() commands build string of file name

How to upload RDF into same Graph IRI using Virtuoso 7.1 -

How to upload RDF into same Graph IRI using Virtuoso 7.1 - i have 2 files. 1 aaa.nt , , 1 bbb.ttl . i trying upload triples in 2 files 1 graph iri ( http://xxx.xxx.xxx.xxx ). actually tried twice. first, failed, sec time, got it. first way below. in isql , ld_dir('/home/temp','*.nt','http://xxx.xxx.xxx.xxx'); rdf_loader_run(); ld_dir('/home/temp','*.ttl','http://xxx.xxx.xxx.xxx'); rdf_loader_run(); second way below. in isql , delete load_list; # <-- making load_list clear... ld_dir('/home/temp','*.nt','http://xxx.xxx.xxx.xxx'); ld_dir('/home/temp','*.ttl','http://xxx.xxx.xxx.xxx'); rdf_loader_run(); anyway, succeeded sec way above, don't understand mechanism. using first way, triples both files ( aaa.nt , bbb.ttl ). don't remember exactly, triples got 1 of files. using sec way, triples in 2 files. what if have situation add together mo

testing - How to write a verilog testbench to loop through 4 inputs? -

testing - How to write a verilog testbench to loop through 4 inputs? - i have create verilog code , testbench schematic. i have design here. module prob1(input wire a,b,c,d, output wire out); assign out = (a||d)&&(!d&&b&&c); endmodule here have testbench far. module prob1_tb(); reg a,b,c,d; wire out; prob1 prob1_test(a,b,c,d, out); initial begin for(i=0; i=16; i=i+1) <loop code here> end end endmodule now guess part having issue how can convert number 4 inputs beingness used in schematic. or there improve way go doing this? here simple way using concatenation operator: module prob1(input wire a,b,c,d, output wire out); assign out = (a||d)&&(!d&&b&&c); endmodule module prob1_tb(); reg a,b,c,d; wire out; prob1 prob1_test(a,b,c,d, out); initial begin $monitor(a,b,c,d,out); (int i=0; i<16; i=i+1) begin

Grails 2.2.3 : Logging - Log from Java Classes from All Packages into a log file -

Grails 2.2.3 : Logging - Log from Java Classes from All Packages into a log file - i have configured logging in grails 2.2.3 log file has logs grails artifacts. but trying to logs java classes. have defined private static final logger log = logger.getlogger(getclass()); with logging info on console, not log logging file. using java classes external jar. note groovy , java classes under package structure example:- com.example.fileupload com.example.imagedownload com.example.datacapturing com.example.videoprocess etc. my config.groovy configuration follows info , error related logs groovy , java classes info 'com.example' error 'com.example' i able groovy classes log informations in logging file not java classes. please allow me know how prepare it. thanks in advance. java logging log4j grails-2.2

php - Class MailerPHP strange behaviour (looping array of address) -

php - Class MailerPHP strange behaviour (looping array of address) - i using class mailerphp send emails on website. working perfect have work there unusual stuff can not figure out why this. 1. have array of address sending emails, array this: $email = new sendemail(); $_admin_email = array('first_email', 'second_email', 'third_email'); $email->setemail($_admin_email); the problem when sending emails, sending 3 emails: 1. sending first_email 2. after sending first_email , second_email 3. , @ end sending first_email, second_email , third_email i send 1 3 , not send 3 times email, not understand why sending this. 2. , sec problem using google business relationship connect smtp send emails, , not know why in field of email showing gmail address connect smtp, setup address show there , showing + gmail account: i have configuration , didn't set anywhere else gmail business relationship smtp connection: public $userna

java - maven: exclude jar from JDK -

java - maven: exclude jar from JDK - so, i've been searching hours , hours , i'm running brick wall here. my problem's quite simply: i've got (pretty big) project i'd beingness built maven (so can automate bit). works fine far except 1 major problem. i've got dependency called "java-plugin" - don't know origin or author, in dependencies of dependency of mine - added our own nexus 3rd party repository name original jar given. this plugin gets added nexus without problems, has next structure: - netscape -- javascript jsexception.class jsobject.class jsutil.class -- security forbiddentargetexception.class parameterizedtarget.class principal.class privilege.class privilegemanager.class privilegetable.class target.class userdialoghelper.class usertarget.class - sun -- plugin ... -- plugin2 ... - com.sun.java.b

regex - What is differerent between using $subject and substr($subject,3) in example preg_match() in php.net -

regex - What is differerent between using $subject and substr($subject,3) in example preg_match() in php.net - i read how utilize function preg_match in http://php.net/manual/en/function.preg-match.php, don't know differerent between using $subject , substr($subject,3) in preg_match($pattern, $subject, $matches, preg_offset_capture, 3) , preg_match($pattern, substr($subject,3), $matches, preg_offset_capture). please help me understand , check below function why homecoming empty array? <?php $ch=curl_init(); curl_setopt($ch,curlopt_url,"http://www.1gom.us/ti-le-keo-malaysia.html"); curl_setopt($ch,curlopt_returntransfer,true); $content = curl_exec($ch); curl_close($ch); $regex = '/<div class="tabbox" id="tabbox">(.*)<\/div>/'; preg_match($regex, $content, $matches, preg_offset_capture, 3); $table = $matches[1]; print_r($table); ?> you obtain same result. if utilize substr,

Outputting correct prime numbers in Java -

Outputting correct prime numbers in Java - this question has reply here: boolean , == vs = 3 answers i have little issue java programme doing @ moment: public class primenumbers { public static void computeprimenumbers(boolean[] prime, int n) { (int = 2; < n; i++) { if (prime[i] == true) { (int j = 2; j < n; j++) { if ((j%i == 0) && (j != i)) { prime[j] = false; //system.out.println(j + " = " + prime[j]); } } } } } public static void main(string[] args) { int n = 13; boolean[] prime = new boolean[n]; prime[0] = false; prime[1] = false; (int = 2; < n; i++) { prime[i] = true; } computeprimenumbers(p

groovy - grails: approaches to importing data from an external schema -

groovy - grails: approaches to importing data from an external schema - need periodically read ~20k records external database (schema not under control), , update/create respective instances in local schema (grails' main datasource ). target single domain class. i've mapped external database datasource. i'm thinking utilize groovy.sql.sql + raw sql bring-in records, , generate domain instances as-required. reasonable path? should alternatively model-out external schema, , utilize gorm end-to-end? assuming first approach, considering testing: there useful tools should setting-up test info (i.e. equivalent of build-test-data/fixtures non-domain data)? thanks yes. think reasonable given info size , how going this. dont forget execute sql batch save on resources. grails groovy gorm

file permissions - Setting Metadata in Google Cloud Storage (Export from BigQuery) -

file permissions - Setting Metadata in Google Cloud Storage (Export from BigQuery) - i trying update metadata (programatically, python) of several csv/json files exported bigquery. application exports info same 1 modifying files (thus using same server certificate). export goes well, until seek utilize objects.patch() method set metadata want. problem maintain getting next error: apiclient.errors.httperror: <httperror 403 when requesting https://www.googleapis.com/storage/v1/b/<bucket>/<file>?alt=json returned "forbidden"> obviously, has bucket or file permissions, can't manage around it. how come if same certificate beingness used in writing files , updating file metadata, i'm unable update it? bucket created same certificate. if that's exact url you're using, it's url problem: you're missing /o/ between bucket name , object name. file-permissions google-bigquery google-cloud-storage

C# MDI: How to change parent status label to active child form name -

C# MDI: How to change parent status label to active child form name - i working on windows forms mdi application can create new kid forms within itself. parent form has statuslabel in statusstrip. trying figure out how alter statuslabel text value of parent form name of active kid form. have created "activated" event in kid form don't know how alter parents form statuslabel child's forms "activated" code block. basically want alter label in parent form to kid forms name property. any help appreciated. try subscribing activated event of kid form: protected override void onload(eventargs e) { base.onload(e); (int = 0; < 3; ++i) { form f = new form(); f.activated += f_activated; f.mdiparent = this; f.text = "form #" + i.tostring(); f.show(); } } void f_activated(object sender, eventargs e) { toolstripstatuslabel1.text = ((form)sender).text; } c# forms parent-child mdi toolstripst

php - Eventbrite API not returning Events -

php - Eventbrite API not returning Events - so site working on client, http://atasteofartistry.com, needs have eventbrite integration. wordpress install running genesis theme. right now, in functions.php, have this: //* eventbrite require 'eventbrite.php'; $eb_client = new eventbrite( array('app_key'=>'(redacted)', 'user_key'=>'(redacted)')); $arr = array('user'=>'atasteofartistry@gmail.com', 'event_statuses'=>'live,started' ); e$events = $eb_client->user_list_events($arr); and have phone call in widget listed this: <h1>my event list:</h1> <?= eventbrite::eventlist( $events, 'eventlistrow'); ?> </div> on site, not getting events. eventbrite.php api client initializing, because "no events" message, cannot pass through it. i've been staring @ 8 hours , need help. help! i'm using ev