Posts

Showing posts from February, 2014

sql - Modify $select to allow for searching in php -

how modify $select function allow searching database when customer types in search text , clicks "search"? i'd able type in form field, , php automatically updates page form data dynamically , able define field search upon in database! this letting me view customers table: $select = $db->query("select * customers order id desc"); <?php if (!$select->num_rows) { echo '<p>', 'no records', '</p>'; }else{ ?> <table border="1" width="100%"> <thead> <tr> <th>first name</th> <th>last name</th> </tr> </thead> <tbody> <?php while ($row = $select->fetch_object()) { ?> <tr> <td><?php ec

python - Matplotlib: use a colormap to show concentration of a process around its mean -

Image
i have pandas dataframe contains 100 realization of given process, observed @ 10 different dates (all realization start same point @ date 0). such dataframe can generated with: import pandas pd import numpy np nbdates = 10 nbpaths = 100 rnd = np.random.normal(loc=0, scale=1, size=nbpaths*nbdates).reshape(nbdates,nbpaths) sim = dict() sim[0] = [100.0] * nbpaths t in range(nbdates): sim[t+1] = sim[t] + rnd[t] sim = pd.dataframe(sim) now know can plot 100 paths contained in dataframe this sim.t.plot(legend=false) and obtain graph this: but plot minimum , maximum of process @ every date, , color area between 2 extremas color map reflect concentration of paths in plot (so instance red around mean , gradually cooler go extremes). i have looked @ using colormaps achieve this, have not managed yet. if knows straightforward way helpful. thank ! you can (albeit not in elegant way) first making contour plot of "concentration" contourf , making line plot

performance - how to add google-play-services_lib to android studio -

i have project needs google play services dependency, security reasons, can not download sdk manager. rather given folder: google-play-services_lib how add project ? in project , creates folder inside app named 'libs' , , copy jar of playservices. android studio. app -libs -src -build in build gradle: dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile filetree(dir: 'libs', include: ['*.so']) compile files('libs/nameofjargoogleplayservices.jar') }

python - avoiding scraping data from pages already scraped -

good evening all, i still working on spider scrape data news sites have run problem, original question posted here: scrapy outputs [ .json file has been solved. i have managed little further, having had make allowances empty items , adding search functionality trying scrape articles have not yet scraped, (baring in mind may still want extract links them). can't figure out put code will: a.) define when last crawl done b.) compare date of article date of last crawl. i may struggling logic , turn you. my spider: # tabbing in python apparently important aware , make sure # things should line # import crawlspider class, along it's rules, (this lets recursively # crawl pages) scrapy.contrib.spiders import crawlspider, rule #import link extractor, extracts links pages scrapy.contrib.linkextractors import linkextractor # import our items defined in items.py basic.items import basicitem # import datetime can current date , time import time # import re allows

plt.bar (matplotlib in python) does not make bars -

i trying make bar plot. have count data have distributed bins of size 1000 (say). on x-axis, have bin coordinate, i.e., -3000, -2000, ..., 0, 1000, 2000, 3000 (in form). now when plt.bar(x-coord, y-coord), vertical lines. how make sure bars? did try playing around width coordinate, had no luck. thank in advance answering question. your barwidth small. because x values large, bar appears line. try this: import numpy np import matplotlib.pyplot plt values = (20, 35, 30, 35, 27, 12, 38) index = np.array((-3000, -2000, -1000, 0, 1000, 2000, 3000)) barwidth = 400 plt.bar(index, values, barwidth) plt.xticks(index + barwidth/2) plt.show()

c# - Convert jbyte* to array<Byte>^ -

my c# code using system; using system.collections.generic; using system.linq; using system.text; using sourceafis.simple; using system.windows.media.imaging; namespace tempsample { public class templetextractorsample { // inherit fingerprint in order add filename field [serializable] class myfingerprint : fingerprint { public string filename; } // inherit person in order add name field [serializable] class myperson : person { public string name; } static afisengine afis; // take fingerprint image file , create person object image public static string gettemplate(byte[] bytearray, string name) { console.writeline("enrolling {0}...", name); // initialize empty fingerprint object , set properties myfingerprint fp = new myfingerprint(); //bitmapimage image = new bitmapimage(new

javascript - magnific-popup generates "file not found" error for YouTube videos -

i trying make popup containing youtube video. code have $(document).ready(function() { $('#vid1').magnificpopup({ items:{ src: 'http://www.youtube.com/watch?v=0o2ah4xlbto' }, type:'iframe' }); }); i popup says the file or directory not found. missing or doing wrong? have tried multiple types of youtube links; result in same error. are trying view video local file? youtube player blocks that. (file:///) have test videos web server. (http(s)://)

ios - Get PHAssets based on "Face" metadata -

using photos in mac users able tag people in photos. data synced cloud can preform face searches in photos on ios. type of metadata seems "face". possible assets associated 1 of these faces? i'd grab images person in it. able in photos search in ios hope is open other developers. does have ideas? thanks in advance. there no api kind of stuff on ios @ moment.

python - Flash event ceases upon input -

Image
i attempting add victory event causes screen flash blue , yellow rapidly, there have been problems. initially, tried wait function issue froze else during time. tried recall color 4 times before switching worked, issue on faster or slower computer behave differently. currently, use pygame.time.set_timer issue if apply other input such arrow key, cease flashing until stop inputting. ideally, continue flash until v = 0. should flash blue , yellow v = 2, , v = 1 make flash red , else have not yet decided. using flashing if v == 2: if event.type == event_500ms: if blue == 1: d.fill(blue) blue = 2 elif blue == 2: d.fill(yellow) blue = 1 this of code. code shown above located @ bottom of entire code. import pygame, sys, random pygame.locals import * pygame.init() black = ( 0, 0, 0) abino = ( 34, 45, 102) pindler = (255, 123, 90) mexon = (200

java - NoSuchMethodError: com.google.common.base.Platform.systemNanoTime() In GWT project -

i exception in gwt project i'm using systemnanotime() ... threw unexpected exception: java.lang.nosuchmethoderror: com.google.common.base.platform.systemnanotime()j @ com.google.gwt.user.server.rpc.rpc.encoderesponseforfailure(rpc.java:389) @ com.google.gwt.user.server.rpc.rpc.invokeandencoderesponse(rpc.java:579) ........ i'm using guava-18. jar in java build path. the problem i'm using google-collect-1.0-rc1.jar , guava-18.0.jar in java build path same project had removed google-collect

java - is it possible to use @transactional annotation with a transaction opened by hand (spring/hibernate) -

i have spring application works hibernate , annotations. open session hand done in how manually open hibernate session? stack overflow answer. now want use method of service in method opens session itself. service annotated transactional statement. possible tell method use transaction opened hand? e.g. @transactional("transactionmanager") class service1 { public lazyobject somemethod(); } class metaservice { @autowired sessionfactory sf; service1 s1; public somemethod() { session s = sf.opensession(); s.begintransaction(); // tell method use s's transaction // without annotating somemethod() @transactional lazyobject lo = s1.somemethod(); ( lazyatt la : lo.getlazyatt() ) { la.dosomething(); } s.flush(); s.gettransaction().commit(); s.close(); } } for wondering why want it, check question: https://stackoverflow.com/questions/29363634/how-to-o

mysql - More nested while loops in PHP -

i tried pull data database need 2 while loops nest (fetch_assoc). problem inner loop doesn't loop gives me first element of array, array length times. <?php $al_num = $_get['album']; $photo_query = "select photo album album_number={$al_num}"; $thumbnail_query = "select thumbnail album album_number={$al_num}"; $photo_result = mysqli_query($connection, $photo_query); $thumbnail_result = mysqli_query($connection, $thumbnail_query); ?> <?php while($photo = mysqli_fetch_assoc($photo_result)): ?> <?php while($thumb = mysqli_fetch_assoc($thumbnail_result)): ?> <li> <a href="images/<?php echo $photo['photo'] ?>" class="highslide" onclick="return hs.expand(this, config1 )"> <img src="images/<?php echo $thumb['thumbnail'] ?>" alt=""/> </a> </li> <?php

excel - Found a reference to "Local" Error but no definition of what it is -

i found reference on local error goto class_initialize_err in ms article . when add local keyword excel vba code, compiler accepts it. however, cannot find reference keyword either in documentation nor on web. does know local refers and/or does? hansv windows secrets : on local error remnant older versions of basic (before visual basic applications). in current versions acts same on error , there no particular reason use more.

More addresses per customer from admin panel is not getting saved in Magento -

i trying add more 50 addresses 1 customer after 55 addresses not getting saved. page getting crashed, after time page gets load shows success message customer saving address not getting saved. tried way not luck. 1 please suggest on ? thanks, jen

python - Running fig = plt.figure() in pandas opens two figures -

pretty says in title.. pandas examples suggest doing fig = plt.figure() before df.plot(..) . if that, 2 figures pop after plt.show() - first empty , second actual pandas figure.. ideas why? on dataframe, df.plot(..) create new figure, unless provide axes object ax keyword argument. correct plt.figure() not needed in case. plt.figure() calls in pandas documentation should removed, indeed not needed. there issue this: https://github.com/pydata/pandas/issues/8776 what can ax keyword eg: fig, ax = plt.subplots() df.plot(..., ax=ax) note when plotting series, default plot on 'current' axis ( plt.gca() ) if don't provide ax .

c# - System.DivideByZeroException without division -

i using code capture short bursts of video connected camera: private void show() { if (videodevice != null) { videodevice.videoresolution = capabilities[combobox1.selectedindex]; size = ((size) combobox1.selecteditem); videodevice.newframe += new aforge.video.newframeeventhandler(frame); videodevice.start(); } } private void frame(object sender, newframeeventargs e) { if (count > 7 && !motion) { urame = 0; b = ((bitmap) e.frame.clone()); if (detector.processframe(b) > 0.02) { motion = true; writer.open(@"c:\users\home\documents\visual studio 2013\projects\cctv\cctv\bin\wesdgzufjw3.mp4", size.width, size.height, 30, videocodec.msmpeg4v3); } } else if (motion) { b = ((bitmap) e.frame.clone()); writer.writevideoframe(b); if (detector.processframe(b) < 0.02) { motion = false; writer.close(); }

java - @jsonRootName not working with spring boot starter hateoas -

i developing rest application using spring-boot , using spring-hateoas . , dto have written is: bill.java @jsonignoreproperties(ignoreunknown = true) @jsonrootname("bills") public class bill{ depedencies: dependencies { compile "org.springframework.boot:spring-boot-starter-hateoas" compile "org.springframework.boot:spring-boot-starter-ws" compile "org.springframework.boot:spring-boot-starter-actuator" compile "org.springframework.cloud:spring-cloud-starter-eureka:${springcloudversion}" testcompile("org.springframework.boot:spring-boot-starter-test") } application.java: @configuration @import(billserviceconfig.class) @enableautoconfiguration @enableeurekaclient @componentscan({"com.billing"}) @enablewebmvc @enablehypermediasupport(type = enablehypermediasupport.hypermediatype.hal) public class application { billcontroller.java: @requestmapping(method = requestmethod.get, value = "") pu

java - Open a Treeview as a new Tab in eclipse via. plugin -

i have tried find answere myself, didn't one... i need open treeview creat dynamicly via. eclips-plugin, embetet tab in eclipse editor. atm. open treeview in new window, creating jframe. my thoughts are, need creat treeview in jpanel , link eclipse ide? don't find how that.

objective c - Difference between NSDate and NSDateComponent value for the same date -

i created simple function first , last day of week day in it. looking @ nslog output found different values returned nsdate descriptor , component day same date, why ? here nslog outputs: nsdate: 2011-04-03 22:00:00 +0000, day component: 4 nsdate: 2011-04-09 22:00:00 +0000, day component: 10 as can see, nsdate 3 of april , day component 4 first row, , respectively 9 , 10 second one. here code: nsdate *date = [nsdate date]; //today april 5th 2011 nscalendar *cal =[[nscalendar alloc]initwithcalendaridentifier:nsgregoriancalendar]; [cal setfirstweekday:2]; //my week starts monday //define beginning of week nsdate *beginningofweek = nil; [cal rangeofunit:nsweekcalendarunit startdate:&beginningofweek interval:nil fordate:date]; nsdatecomponents *begincomponents = [cal components:(nsyearcalendarunit | nsmonthcalendarunit | nsdaycalendarunit | nsweekcalendarunit | nsweekdaycalendarunit) fromdate:beginningofweek]; //define end of week, 6 days offset beginning nsdatecom

javascript - Clear browser cache with query string approach -

i need clear browser cache when push updated javascript file on server. simple answer use below technique of query string. <script type="text/javascript" src="/js/myjsfile.js?{my file version}"></script> it work do need on every single script tag of every single page of application? can @ main screen login loads @ beginning , assume clear cached file new one, work? "do need on every single script tag of every single page of application?" yes do. cache based on file's url, including parameters. adding parameters doesn't remove file browser's cache, more or less sees new, different file. this answers point 2, since having on pages means can't on 1 page.

c# - Fluent Nhibernate and sql script -

i want execute script variables in order create new database. @ first, tried command line want execute script server have errors access rights. is possible execute sql script fluent nhibernate in application code? i've found answer on link doesn't execute script, loads queries. link thanks help. just note: fluent nhibernate third party library mapping. execute script need just nhibernate. and in fact, answer you've found, answer. point of write scripts call executeupdate() @ end var query = session.createsqlquery("your sql string insert, update..."); // execute query.executeupdate();

html - Display flattened list items with count of more items that fit in a div -

Image
i have few list items want display in flattened order on website. items not fit on same line, trying show count of 'how many more items' available. 8 items: screen size 1: ============================== item1, item2, item3 +5 items ============================== screen size 2: ==================================================== item1, item2, item3, item4, item5, item6 +2 items ==================================================== the skeleton of code have is: <div class="col-md-10"> <span ng-repeat="item in items | canfit"> <span class="itemname">{{item}}</span> </span> </div> <div class="col-md-2" ngshow="n>0"> <span>+{{n}} items</span> </div> i implemented using algorithm calculate character count, font-size, padding, screen size may change in future , trying have more agnostic of changes less perf impact. is there simpler way achieve

javascript - float's not returing to position after mobile view end -

on menu when in mobile view not float correct. problem being when come out of mobile view class "menu-right" floats left until reload page. is possible when comes out of mobile view "menu-right" class automatically go float right out me reloading page. i not sure if it's css or java script. live code example: http://codepen.io/riwakawebsitedesigns/pen/ggljml live code full view: http://codepen.io/riwakawebsitedesigns/full/ggljml/ java script var ww = document.body.clientwidth; $(document).ready(function() { $("#menu li a").each(function() { if ($(this).next().length > 0) { $(this).addclass("parent"); }; }) $(".menu-toggle").click(function(e) { e.preventdefault(); $(this).toggleclass("menu-button"); $("#menu").toggle(); }); adjustmenu(); }) $(window).bind('resize orientationchange', function() { ww = documen

Can I restrict Amazon S3 Browser-Based Uploads by URL in my bucket policy -

based on: http://s3.amazonaws.com/doc/s3-example-code/post/post_sample.html is there way limit browser based upload amazon s3 such rejected if not originate secure url (i.e. https://www.someurl.com )? thanks! i want absolutely guarantee post coming website that impossible. the web stateless , post coming "from" specific domain not valid concept, because referer: header trivial spoof, , malicious user knows this. running through ec2 server gain nothing, because tell nothing new , meaningful. the post policy document not expires, can constrain object key prefix or exact match. how malicious user going defeat this? can't. in client form have encrypted/hashed versions of credentials.  no, not. what have signature attests authorization s3 honor form post. can't feasibly reverse-engineered such policy can modified, , that's point. form has match policy, can't edited , still remain valid. you generate signature using in

javascript - Cant get server control's id using document.getElementById() -

i trying pass asp panel id button onclientclick method , intend show panel document.getelementbyid fetching null value. why not able fetch control's id. here's mark up: <asp:panel id="pnl1stdurationwaiverform" style="display: none" runat="server"></asp:panel> <asp:linkbutton id="lbtnyes" runat="server" onclientclick="showdurationwaiver(document.getelementbyid('<%= pnl1stdurationwaiverform.clientid %>'))" text="yes"></asp:linkbutton> here's javascript method: function showdurationwaiver(pnlctrl) { debugger; if (pnlctrl != null) { pnlctrl.style.display = 'block'; } return false; }

excel - RegEx to extract email -

i need extract email spreadsheet in excel. i've found example vb code here on stackoverflow link , courtesy of portland runner . i created excel module , seems working fine, except. return first uppercase character of address in cell , ignoring email. for example: text | result ----------------------------------------|------------------------------ email address address@gmail.com | email address yes address@gmail.com | yes below code i'm using: function simplecellregex(myrange range) string dim regex new regexp dim strpattern string dim strinput string dim strreplace string dim stroutput string strpattern = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" if strpattern <> "" strinput = myrange.value strreplace = ""

javascript - Expected response to contain an object but got an array for GET action -

i'm getting error " error: [$resource:badcfg] error in resource configuration action 'get'. expected response contain object got array " and don't know how fix it. have service angular.module('messages').factory('messages', ['$resource', function ($resource) { return $resource('api/messages/:username', { username: '@username' }); }]); and in controller: $scope.findone = function () { $scope.messages = messages.get({ username: $routeparams.username }); console.log($scope.messages); }; for route have in api controller this exports.read = function (req, res) { res.json(req.message); }; i know have use $resource action isarray = true, don't know put it. tried this: angular.module('messages').factory('messages', ['$resource', function ($resource) { return $resource('api/messages/

python - Do groups in h5py preserve the order in which its members were added? -

the h5py docs that group.keys() returns group's members list in python 2, , set-like view in python3. in either case, can assume when iterating through group.keys() , i'll iterate through them in order in members added group? my advice is: unless documentation explicitely states returned collection ordered, don't rely on it. fact set returned in python3 indicates keys not ordered — or order accidental.

php - Foreach returned $variable[] select from database and combine values -

i have tried around couple of ways , different manners no luck. (also searched different solutions) sure i'm missing something. i have following code: $variable = returned array eg. 7, 8, 9; foreach($variable $entry_id){ $query = mysql_query("select * table entry_id=$entry_id") or die (mysql_error()); while($row = mysql_fethc_array($query)){ $qty = $row['quantity']; $combination = array_combine($qty); } } everything works , correct quantities returned (on testing) combinations not correct. combinations - of each entry_id - combined next one. instead of receiveing eg. $entry_id(7) = 15; $entry_id(8) = 26; $entry_id(9) = 58; i getting: $entry_id(7) = 15; $entry_id(8) = 41; $entry_id(9) = 99; the table structure this: entry_id | quantity 7 | 5 7 | 5 9 | 29 8 | 26 7 | 5 9 | 29

jquery - javascript not working on struts html tag -

i have following codes in jsp page in struts2 project <select id="amountselect"> <s:iterator value="ratecarddetailslist" status="liststatusamount"> <option value="<s:property value='#liststatusamount.index'/>"><s:property value="rechargeamount"/></option> </s:iterator> </select> and corresponding script $(document).ready(function() { $("#amountselect").change(function(){ var v= $("#amountselect").val(); var r= "<s:property value='ratecarddetailslist["+ v +"].mobilerate'/>"; alert(r); }); }); where ratecarddetailslist array of particular bean(object) contain variable mobilerate . i'm getting null @ position of 'r' whil alerting (alert(r);). on inspecting element following $(document).ready(function() { $("#amountselect").change(function(){

python - Plot Polar Gridded Sea Ice Concentrations using Cartopy -

i trying make plots of polar gridded sea ice concentrations nsidc. data delivered in polar stereographic projection , grid, example file (binary,arctic,25 km resolution) can downloaded at: http://nsidc.org/data/nsidc-0081 when read data using numpy, , plot using matplotlib's imshow function, works. import numpy np import matplotlib.pyplot plt infile='c:\\nt_20150326_f17_nrt_n.bin' fr=open(infile,'rb') hdr=fr.read(300) ice=np.fromfile(fr,dtype=np.uint8) ice=ice.reshape(448,304) #convert fractional parameter range of 0.0 1.0 ice = ice/250. #mask land , missing values ice=np.ma.masked_greater(ice,1.0) fr.close() #show ice concentration plt.imshow(ice) when try plot using cartopy, runs without errors returns empty coastline. import matplotlib.pyplot plt import cartopy.crs ccrs fig=plt.figure(figsize=(3, 3)) ax = plt.axes(projection=ccrs.northpolarstereo()) ax.coastlines(resolution='110m',linewidth=0.5) ax.set_extent([-180,180,50,90],crs=ccrs.platec

hadoop - Oozie error when trying to run a workflow in Hue -

im having trouble getting oozie work on hadoop install. input appreciated i`m complete beginner in of this. use: hadoop 2.6.0 (with yarn), oozie 4.0.1, hive 1.0.0, hue 3.7.1, pig 0.12 local install run in pseudo distributed. installed tars , configured manually because sadly one-click install cloudera doesnt work in os x. hadoop+hive seem work fine far can tell, both in cli , hue. pig editor hue doesnt quite work yet, can access , use files hdfs error when try access hive tables hcatalog (error 2245: cannot schema loadfunc org.apache.hcatalog.pig.hcatloader). but right more important oozie scheduler works, doesn`t. when try run example shellscript in oozie workflow error: cannot run program "testscript.sh" (in directory "/volumes/ws2data/hadoop_hdfs/tmp/nm-local-dir/usercache/admin/appcache/application_1427878722813_0003/container_1427878722813_0003_01_000002"): error=2, no such file or directory now im trying understand what`s happening here:

sql - select Details fro where condition sub query getting error -

i having 2 tables. app_reviewreplay , app_userreview . using sub query different table condition , in sub query returning double values , getting error. error is subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. select * app_reviewreplay rid=(select rid app_userreview hallid=7095) either use join select r.* app_reviewreplay r join app_userreview u on u.rid = r.rid u.hallid=7095 or in clause select * app_reviewreplay rid in (select rid app_userreview hallid=7095)

asp.net - Displayng javascript pop up from VB code -

using vs 2013 , asp.net vb. i using javascript display pop user if data missing form need complete. code below passing string sub notification("alert('please complete fields in section.')") the sub public sub notification(byval text string) dim script string = text if not page.clientscript.isstartupscriptregistered(me.gettype(), "alertscript") page.clientscript.registerstartupscript(me.gettype(), "alertscript", script, true) end if end sub i following error javascript critical error @ line 500, column 53 in http://localhost:61157/newncr.aspx \n\nscript1004: expected ';' the thing have used same piece of code in previous application , works fine. missing something?

javascript - is(':visible') not working -

hey guys new jquery , going throught modal.js code , found below code: $target.one('show.bs.modal', function (showevent) { if (showevent.isdefaultprevented()) return // register focus restorer if modal shown $target.one('hidden.bs.modal', function () { $this.is(':visible') && $this.trigger('focus') }) }) i tried understand above code , made fiddle . now if see if conditional in code : if ($this.is(':visible')) { $('input').trigger('focus'); console.log($this + ' ' + 'is visible'); } else { console.log($this + ' ' + 'invisible'); } now if have following display rule i.e. input { display:none; } the if condition still passes , thats 1st difficulty . why if condition pass ?? my secound difficulty line inside if condition i.e. $this.trigger('focus'); now though if condition passes input does't focus . why ?? th

android - Dual sided DrawerLayout, Left side works - Right doesn't -

i using drawerlayout. have 2 listview both side. left side working clicking left-top corner button on actionbar. right side working too.but right side working sliding left right swipe. want put button right-top corner of actionbar open right side (just left-top button on actionbar). how can that? here actionbardrawertoggle codes using; public class mainactivity extends actionbaractivity { private actionbardrawertoggle mdrawertoggle; //.... protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //.... getsupportactionbar().setdisplayhomeasupenabled(true); mdrawertoggle = new actionbardrawertoggle(this, mdrawerlayout, r.drawable.sidebar, r.string.drawer_open, r.string.drawer_close) { public void ondrawerclosed(view view) { invalidateoptionsmenu(); toast.maketext(getapplicationcontext(),&

how to link from one module to another using DXL in DOORs? -

i have link 2 modules: ex: have information in module 'a' , information in module 'b' similar module 'a' , module 'c' has same information. linking present between 'a' 'b' , 'b' 'c'. target link 'c' 'a'. creating link doors object resides in different module not differ creating link objects of same module. have retrieve object handle module. consider this: object sourceobj = ... // have object handle object targetobj = null const string targetmodulename = "/my/doors/module" // open module module mod = edit(targetmodulename, true, false) if (null(mod)) ack("error!") // depends on how can identify target object targetobj in mod { // example: if object identifier matches ... if (... == identifier(targetobj)) { sourceobj -> targetobj break } } additionally, have @ this question steve explains scenario well.

SSH issue when connection MySQL workbench to vagrant -

Image
i'm trying connect vagrant mysql server using mysql workbench. shows error shown in image. the workbench error log pasted below. 17:34:50 [inf][ ssh tunnel]: existing ssh tunnel not found, opening new 1 17:34:50 [inf][ ssh tunnel]: opening ssh tunnel 127.0.0.1:2222 17:34:50 [err][ sshtunnel.py]: traceback (most recent call last): file "/usr/share/mysql-workbench/sshtunnel.py", line 231, in _connect_ssh look_for_keys=has_key, allow_agent=has_key) file "/usr/lib/python2.7/dist-packages/paramiko/client.py", line 337, in connect self._auth(username, password, pkey, key_filenames, allow_agent, look_for_keys) file "/usr/lib/python2.7/dist-packages/paramiko/client.py", line 528, in _auth raise saved_exception authenticationexception: authentication failed. 17:34:50 [err][ ssh tunnel]: authentication error opening ssh tunnel: authentication error. please check username , password correct , try again. vagrant up comm

c# - Timer to show seconds, minutes and hours in iOS Xamarin -

i working on ios application in xamarin. timer1 = new system.timers.timer(); timer1.interval = 1000; //play.touchupinside += (sender,e)=> //{ timer1.enabled = true; console.writeline("timer started"); timer1.elapsed += new elapsedeventhandler(ontimeevent); //} this have written in viewdidload(); public void ontimeevent(object source, elapsedeventargs e) { count++; console.writeline("timer tick"); if (count == 30) { timer1.enabled = false; console.writeline("timer finished"); new system.threading.thread(new system.threading.threadstart(() => { invokeonmainthread(() => { starttimer.text = convert.tostring(e.signaltime.timeofday); // works! }); })).start(); } else { //adjust ui new system.threading.thread(new system.threading.threadstart(() => { invokeonmainthr

sql server - How to Query 2 SQL databases and compare results -

i have 2 separate sql server databases i'd query , compare results. for example: db1 select * customers dtcreated > @startdate this query give me list of customers created after specific date. i take results above, , query database (db2) tell me of above query customers still active. something like: db2 select * customers bactive = 'true' (and exists in db1 query) is there way this? output: number of records db1 number active in db2 155 67 you can cross-database queries specifying databasename , schema + table name. select * customers b bactive = 'true' , exists (select 'x' database1.dbo.customers a.dtcreated > @startdate , a.key = b.key) i'm sorry i'm bit confused example querys , example output. using technique can count way like