Posts

Showing posts from August, 2012

ios - How to wait until webViewDidFinishLoad is called? -

i'm creating ios app. i separated pdf has multi page each pages, and create uiwebviews show each pages. the code this. for( int = 0; < _pagenumbers; i++) { _webview = [[uiwebview alloc]init]; _webview.delegate = self; _webview.frame = imageviewframe; _webview.scalespagetofit = yes; _webview.autoresizingmask = uiviewautoresizingflexibleleftmargin | uiviewautoresizingflexiblewidth | uiviewautoresizingflexiblerightmargin | uiviewautoresizingflexibletopmargin | uiviewautoresizingflexibleheight | uiviewautoresizingflexiblebottommargin; [self setimageatindex:i toscrollview:imagescrollview]; } - (void)setimageatindex:(nsinteger)index toscrollview:(imagescrollview*)scrollview { uiwebview *thewebview = (scrollview.subviews)[0]; if (index < 0 || [webviews count] <= index) { thewebview = nil; return; } dispatch_queue_t queueloadpdf = dispatch_get_global_queue(dispatch_queue_p...

regex - preg_match(): No ending delimiter '/' found -

$this->form_validation->set_rules('ttime','time', 'required|regex_match[/^(0?[1-9]|1[012])(:[0-5]\d)$/]'); my regex correct still shows , error severity: warning message: preg_match(): no ending delimiter '/' found filename: libraries/form_validation.php line number: 911 ran problem well. issue indeed pipe | character codeigniter uses, adding single quotes didn't me. try: 1) passing array of rules instead of piped string: $this->form_validation->set_rules('field', 'field name', array('required','regex_match[/your-regex/]')) 2) creating custom callback use rules pointed out here : function my_func ($field) { return (bool)preg_match('/your-regex-here/', $field); } $this->form_validation->set_rules('field','field name', 'required|my_func'); 3) can ...

batch script to display file names in a directory older than 30 days? -

@echo off set dir_path="<path>" rem *********set min age of files , folders displayed********** set max_days= 30 rem *********display file names %dir_path%********* dir %dir_path% -m *.* -d -%max_days% /-p /o:gn > "c:\users\desktop\dircontents.txt" exit ************************************************************************************************** here above script able display entire list of files , folders in particular directory. not files or folders older 30 days. please help forfiles /d -30 /c "cmd /c echo @path older 30 days."

DVSC connector with GitHub done but not able to create branch from Jira -

i have been able create dvsc connector github , repositories have got synced in jira following link: https://confluence.atlassian.com/display/bitbucket/linking+bitbucket+and+github+accounts+to+jira . want create branch in 1 of repositories in github jira. think can done using development tools option github. not able see development tools option of issues. have checked permissions , fine. using jira server(on premise version). unfortunately branch creation github still not supported, although, have improvement request opened matter (refer url below). suggest vote on request in order expedite resolution. https://jira.atlassian.com/browse/jra-35175

mysql - PRIMARY KEY for MERGE engine don't working? -

my code : mysql> create table super (id int primary key not null auto_increment); mysql> create table super2 (id int primary key not null auto_increment); mysql> insert super values(1),(2); mysql> insert super2 values(1),(3); mysql> alter table super engine='myisam'; mysql> alter table super2 engine='myisam' then created merge engine table : mysql> create table super_merge (id int primary key not null auto_increment) e ine='merge' union=(super,super2); query ok, 0 rows affected (0.00 sec) mysql> select * super_merge; +----+ | id | +----+ | 1 | | 1 | | 2 | | 3 | +----+ will not rule of uniqueness?maybe normal . why, then, create structure of table fields if not work? when truncate tables super,super2 table super_merge empty too! truncate table super2; mysql> select * super_merge; empty set (0.00 sec) mysql> insert super values(1),(2); mysql> insert super2 values(1),(3); mysql> select * super_merge; ...

Why is my Java "if" statement only being triggered if I have a watch on it in Netbeans? -

i doing work ties in apache batik ( don't think relevant never know ) , running weird behaviour can't figure out reason for. the following bit of code calculating height of line of text, can start next line in correct position: protected double painttextrun(textrun textrun, double x, double y, int linecount, emfgraphics2d g2d) throws ioexception { attributedcharacteriterator runaci = textrun.getaci(); char c = runaci.first(); textpaintinfo tpi = (textpaintinfo) runaci.getattribute(paint_info); if ( tpi == null || !tpi.visible ) { return y; } setfont(runaci, g2d); g2d.setpaint(tpi.fillpaint); g2d.writestring(gettextfromaci(runaci, x, y); if ( runaci.getattribute(textattribute.size) != null ) { y+= (float)runaci.getattribute(textattribute.size); } else if ( textrun.getlayout().getbounds2d() != null ) { double height = textrun.getlayout().getbounds2d().getheight(); i...

c++ - Member function overload based on namespaced typedefed primitif types -

the following code fails compile g++ 4.8, in both c++03 , c++11 namespace n {typedef int a;} namespace nn {typedef int a;} struct z { void foo(n::a){} void foo(nn::a){} }; the error d.cpp:7:10: erreur: ‘void z::foo(nn::a)’ cannot overloaded void foo(nn::a){}}; ^ d.cpp:6:6: erreur: ‘void z::foo(n::a)’ void foo(n::a){} i have thought types in different namespaces different types, no matter what. seems not. feel @ end compiler gets rid off namespace/typedef , focus on underlying type , clashes. am right ? have workaround ? types don't live in namespaces. names do. overload on types, not on names.

apache spark - What is the difference between cache and persist? -

in terms of rdd persistence, differences between cache() , persist() in spark ? with cache() , use default storage level memory_only . persist() , can specify storage level want,( rdd-persistence ). use persist() if want assign storage level memory_only rdd ( which storage level choose )

How to get python unit test results in SonarQube? -

i'm using sonarqube 4.5. i've run nosetests run python unit tests , create xunit xml file called nosetests.xml. i'm running sonar runner via sonar jenkins plugin. i've set following sonar properties: sonar.projectkey=yauis sonar.projectname=yauis sonar.projectversion=1.0 sonar.sources=src sonar.language=py sonar.python.xunit.reportpath=nosetests.xml sonar.python.pylint=/usr/bin/pylint sonar.python.coverage.reportpath=coverage.xml sonar.python.coverageplugin=cobertura i'm seeing following in sonarqube runner log: ... 15:31:20.355 info - sensor pythonxunitsensor... 15:31:20.363 info - processing report '/var/lib/jenkins/jobs/yauis/workspace/nosetests.xml' 15:31:20.363 info - parsing report '/var/lib/jenkins/jobs/yauis/workspace/nosetests.xml' 15:31:20.480 info - sensor pythonxunitsensor done: 125 ms ... here snippet nosetests.xml: <?xml version="1.0" encoding="utf-8"?> <testsuite name="nosetests...

In SQL Server Management Studio 2014, the New Trigger menu option is disabled -

Image
i want add new trigger table. seen in picture, new trigger button not active. new index, new column, new contraints, new statics active. i not understand problem. you don't need use menu item create trigger. open query window , write create trigger statement there. to syntax can use snippet in editor. right click on surface of query editor , select insert snippet , select trigger , create trigger following code snippet inserted editor. create trigger triggername on [dbo].[tablename] delete, insert, update begin set nocount on end the menu item (if work) same thing use template looks this: -- ================================================ -- template generated template explorer using: -- create trigger (new menu).sql -- -- use specify values template parameters -- command (ctrl-shift-m) fill in parameter -- values below. -- -- see additional create trigger templates more -- examples of different trigger statements. -- -- block of...

ajax send with jquery to php file doesn't work -

i want send information of contact form server , send contact info mail. normal contact form. but error jquery.js on line 9631 part: //do send request //this may raise exception //handled in jquery.ajax (so no try/catch here) xhr.send( ( options.hascontent && options.data ) || null ); can explain me error? don't find mistake , don't know how debug it. <fieldset id="contactform"> <p>wünschen sie eine abholung von schrott oder edelmetallen<br> geben sie bitte <b>genaue angaben über die art und menge</b> um weitere rückfragen zu ersparen. </p> <hr> <div class="contactfield"> <div id="result"></div> <label for="name"><span>ihr name</span> <input class="frm-name email required" type="text" name="name" id="name"> </label> ...

Python rounding error with float numbers -

this question has answer here: is floating point math broken? 20 answers i don't know if obvious bug, while running python script varying parameters of simulation, realized results delta = 0.29 , delta = 0.58 missing. on investigation, noticed following python code: for i_delta in range(0, 101, 1): delta = float(i_delta) / 100 (...) filename = 'foo' + str(int(delta * 100)) + '.dat' generated identical files delta = 0.28 , 0.29, same .57 , .58, reason being python returns float(29)/100 0.28999999999999998. isn't systematic error, not in sense happens every integer. created following python script: import sys n = int(sys.argv[1]) in range(0, n + 1): = int(100 * (float(i) / 100)) if != a: print i, and can't see pattern in numbers rounding error happens. why happen particular numbers? any number can't built exa...

VHDL: issues with adding and subtracting -

what issues run code? thinking there issue if result addition bigger 15 bits can represent (32767), or if negative number in subtraction. library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; use ieee.numeric_std.all; entity test port( input: in std_logic_vector(14 downto 0); sel : out boolean; output: out std_logic_vector(14 downto 0)); end test; architecture test of test constant first : integer := 1050; constant second : integer := 33611; begin output <= input - first; output <= input + second; sel <= input < first; end test; the primary issue have design intent not communicated impossible distinguish correct incorrect results - in sense, whatever must right! i differ david's opinion in 1 respect : says "std_logic_vector unsigned representation" suggest std_logic_vector neither signed nor unsigned; bag of bits. if happens follow unsigned rules, t...

ElasticSearch and NEST - How do I construct a simple OR query? -

i'm developing building repository query. here query trying write. (exact match on zipcode ) , ((case-insensitive exact match on address1 ) or (case-insensitive exact match on sitename )) in repository, have document looks following: address1 : 4 myrtle street sitename : myrtle street zipcode : 90210 and keep getting matches on: address1 : 4 5 myrtle street sitename : myrtle zipcode : 90210 here attempts have not worked: { "query": { "bool": { "must": [ { "bool": { "should": [ { "term": { "address1": { "value": "45 myrtle street" } } }, { "term": { "sitename": { "value": "myrtle" ...

Bash script for POST request https xml-rpc on Gravatar -

i have project collect user information html local file. project aiming cross-platform , portable (require have bash git bash of github). collected data sent bash script custom protocol set previously. now, want use bash sign in gravatar using xml-rpc. found script #! /bin/bash # ping technorati # configuration address="http://www.acooke.org/cute" name="c[omp]ute" # (end of configuration) export path="$path:$cute_dir/scripts" tmp=`mktemp` echo "<?xml version=\"1.0\"?> <methodcall> <methodname>weblogupdates.ping</methodname> <params> <param> <value>$name</value> </param> <param> <value>$address</value> </param> </params> </methodcall>" > "$tmp" size=`cat "$tmp" | wc -c` msg=`mktemp` echo "post /rpc/ping http/1.0 user -agent: bash script across netcat - andrew@... host: rpc.tec...

iOS Framework Added In Xcode -

is adding framework in xcode necessary? for using multipeerconnectivity. i add #import header file, on .h or .m file, instead of adding multipeerconnectivity.framework in link binary libraries or adding framework in project. is there drawback behavior? thank precious time on question. best, if need framework header #defined constant, might not need link framework. otherwise, necessary tell xcode framework use linker can complete job. also, there may more 1 framework provides same symbols, provides different implementations of them. necessary specify framework use.

javascript - Xpages phone number -

in application have field have store phone number. field must not allow characters numbers. problem format like: 0752344234 and if add this, xpages save field as: 752344234 without 0. question: method can use add 0 in front of numbers withouth using string type field? use validateconstraint validator: <xp:inputtext id="inputtext1" value="..." disableclientsidevalidation="true"> <xp:this.validators> <xp:validateconstraint message="please enter digits phone number"> <xp:this.regex><![cdata[^[0-9]*$]]></xp:this.regex> </xp:validateconstraint> </xp:this.validators> </xp:inputtext> the regular expression ^[0-9]*$ accepts number of digits , empty string. if want @ least 1 digit replace * + . you don't need set input text field required. you can decide you'd validation message appear. set option disableclientsidev...

How to use facebook appid to work with multiple domains (not sub domains) -

This summary is not available. Please click here to view the post.

html - jQuery Mobile grids not working as expected -

i've made simple page test jquery mobile grids. copied/pasted jquery mobile demo website nothing seems work. the blocks not align properly, as can see test page i've made . if (magically) see them aligned, this screenshot of see . what's driving me crazy the same exact code works in jsfiddle !!! <div class="ui-grid-a"> <div class="ui-block-a"><div class="ui-bar ui-bar-a" style="height:60px">block a</div></div> <div class="ui-block-b"><div class="ui-bar ui-bar-a" style="height:60px">block b</div></div> </div><!-- /grid-a --> any idea? i found problem! in the examples on jquery mobile website don't use tabs, use spaces, converted &nbsp; browser , make last block go down. therefore, copying , pasting website got issue. very tricky find

python - Fails to build OpenCV 3 with Python2 support -

i tried build opencv 3 python support (with cuda, too) ubuntu 14.04 using cmake-gui. the compilation seems work fine until python console: >>> import cv2 traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named cv2 i tried both python3 enabled or disabled without change. cmakecache.txt is here. any idea fix problem? i had same problem since yesterday, , solved follows: download opencv 3(beta, rc1) , install necessary dependencies, including python dev package. open cmake gui. activate grouped checkbox. select opencv source , build directories (or delete cache if configured). press configure . select preferred generator. check/uncheck options need (opengl support, tbb, etc.) if want, can press configure after every option modification see if fails or not. ignore python2 options now. once have configured other options, select python2 group , delete remove entry . press configur...

Git - Make local HEAD the new master -

Image
i decided go few commits because path followed wrong. checked out added cordova .gitignore commit, , made modifications. illustrated below : now when push new modifications, error message shows : error: src refspec (detached aad6423) not match any. how can tell git discard previous commits (in purple) , continue local head master ? even though don't want old branch anymore, git doesn't rewriting history or discarding changes. revert , merge. git branch new_master # name current detached head git checkout master # switch master git revert --no-edit head~4..head # create commits reverting history split git merge new_master # merge git branch -d new_master # don't need anymore

parsing - how do I parse an iso 8601 date (with optional milliseconds) to a struct tm in C++? -

i have string should specify date , time in iso 8601 format, may or may not have milliseconds in it, , wanting struct tm millisecond value may have been specified (which can assumed 0 if not present in string). what involved in detecting whether string in correct format, converting user-specified string struct tm , millisecond values? if weren't millisconds issue, use c function strptime() , not know defined behavior of function supposed when seconds contain decimal point. as 1 final caveat, if @ possible, prefer solution not have dependency on functions found in boost (but i'm happy accept c++11 prerequisite). the input going like: 2014-11-12t19:12:14.505z or 2014-11-12t12:12:14.505-5:00 z , in case, indicates utc, time zone might used, , expressed + or - hours/minutes offset gmt. decimal portion of seconds field optional, fact may there @ why cannot use strptime() or std::get_time() , not describe particular defined behavior if such character found i...

javascript - How to place month, date, year of f.date_select on single line? -

Image
i have view new.html.erb <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4"> . . <%= f.label :date_of_birth %><br /> <%= f.date_select :date_of_birth, { :start_year => 1920, :end_year => 2010 }, :class => 'form-control date-select' %> . . </div> </div> </div> the view new.html.erb gets displayed follows i using twitter bootstrap , not using devise gem. there way can display 3 listboxes on same line? your selectboxes have form-control class defines width: 100% , display: block . means makes them take same line should wrap selectboxes 1 more container , make them inline/inline-block , set width: <div class="col-md-4 col-md-offset-4"> ... <label>date of birth</label> <div> <select name="date_of_birth" class="form-control date-select"></select> ...

sql server - Trouble returning MSSQL query results from PHP function -

i'm getting strange error when attempting return results of working sqlsrv_query function call. i have set up: function test($someinput, &$someoutput) { //set $dbc , $dbcoptions //generate tsql $params = array(); $stmt = sqlsrv_query($dbc, $tsql, $params, $dbcoptions); $someoutput = $stmt; return $stmt; } $outputvar; $results = test($inputvar, $outputvar); //---error being thrown here $rows = sqlsrv_num_rows($results); //$rows2 = sqlsrv_num_rows($outputvar); //---error being thrown here in both lines (doesn't matter use), i'm getting error in php-errors.log file saying php warning: sqlsrv_num_rows(): 2 not valid ss_sqlsrv_stmt resource in e:\inetpub\wwwroot\directory\searchtest.php on line 58 which searchtest.php file i'm working on , line 58 have error-producing code. why can not pass query results function this? as per op's wish mark answered, comment ( slightly modified ) answer: this sounds scope issue. try pass...

image - ImagePicker removing views when dismissed iOS 8 -

my app structured central view controller adds 3 4 subviews main view. in 1 of added view controllers present camera user. when dismiss image picker, every subview except 1 in present camera (the view controller) disappears. think might related how app structured , view stack. app works fine when running ios 8 on iphone , ios 7 on ipad. having issue when running ios 8 on ipad. made sure code followed apple documentation on how present , dismiss image picker. here code used present image picker. -(ibaction)photobuttonpressed:(id)sender { // prompt camera or photo library // retrieve image , set button's default image if ([uiimagepickercontroller issourcetypeavailable:uiimagepickercontrollersourcetypecamera]) { uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init]; imagepicker.delegate = self; imagepicker.sourcetype = uiimagepickercontrollersourcetypecamera; imagepicker.mediatypes = [nsarray ar...

java - Cannot find component with expression? -

this question has answer here: how find out client id of component ajax update/render? cannot find component expression “foo” referenced “bar” 4 answers i used datatable - row selection prime faces display list of users , when run page faced error cannot find component expression ":dialog1:employes" referenced "dialog1:j_idt43:j_idt51" <h:form id="dialog1"> <p:accordionpanel> <p:tab title="nouveau groupe"> <h:panelgrid columns="2"> <h:outputlabel value="nom groupe" /> <p:inputtext value="#{calculjobsbean.libelle}" /> </h:panelgrid> <p:commandbutton value="submit" ...

c# - Await or Task.FromResult -

i have 1 service lets say, public interface isomeservice { task<bool> dosomeexpensivecheckasync(string parameter); } and have class consume service. needs simple null checks , return service response back. public class someserviceconsumer { private readonly isomeservice _serviceclient; public someserviceconsumer(isomeservice serviceclient) { _serviceclient = serviceclient; } public async task<bool> dosomething1async(string someparameter) { if (string.isnullorwhitespace(someparameter)) { return false; } return await _serviceclient.dosomeexpensivecheckasync(someparameter); } //no async or await keywords public task<bool> dosomething2async(string someparameter) { if (string.isnullorwhitespace(someparameter)) { return task.fromresult(false); } return _serviceclient.dosomeexpensivecheckasync(someparameter); } } ...

C++ Random Access Files -

its first time experiment random access files in c++ however, i've tried before in java can't work in c++. idea want create 100 empty records, , store record @ particular record number in file. here code, kept simple possible. i have here structure named tool: struct tool { int number; char name[20]; int quantity; double cost; }; and here have in main function: fstream outfile; outfile.open("inventory.dat"); // create 100 empty tool records tool tool; tool.number = 0; tool.name[0] = '\0'; tool.quantity = 0; tool.cost = 0; (int = 0; < 100; i++) { outfile.write(reinterpret_cast<char *>(&tool.number), sizeof(int)); outfile.write(tool.name, sizeof(char)* 20); outfile.write(reinterpret_cast<char *>(&tool.quantity), sizeof(int)); outfile.write(reinterpret_cast<char *>(&tool.cost), sizeof(double)); } // insert tool record tool t; t.number = 3; t.quantity = 7; t.cost = 57; strcpy(tool.na...

How to Assign an object to the hastable value in C# -

here code class program { public static iadxvoice adxvoice1 = new envox.adxvoice.adxvoice(); static void main(string[] args) { hashtable objhashmap = new hashtable(); objhashmap.add(8533, adxvoice1); icollection keytest = objhashmap.values; icollection keytest1 = objhashmap.keys; foreach (int key in objhashmap.keys) { console.writeline("{0}, {1}", key, objhashmap[key]); //console.writeline("{0}, {1}", key, objhashmap[key]); adxvoice obj = objhashmap[key];// getting convert type error cannot implicitly convert type 'object' 'envox.adxvoice.adxvoice'. explicit conversion exists (are missing cast?) console.readkey(); } } } in above code not able assign hashtable value new object created dll used in code. my requirement taking objects in hashtable , @ needed time want assign in other places example shown in above code. ...

PHP: Why is not a good practice using global and what can be used to replace it? -

the answers have read matter have left me more confused anything. instance: if name of variable changed, 1 has change every comparison of variable global inside functions. if pass variable parameter, still have change every comparison. var $myvar = 5; //this var before $myvariable function myfunc(){ global $myvariable; //it needs changed } function myfunc($mypar){ } var $something = myfunc($myvariable); //it needs changed renaming isn't primary benefit easier because function , function call in different files. if have global using variable set in different file can confusing quickly. if it's used in single file better approach put function in class , use class property store variable. class example { private $variable; public function examplemethod() { $this->variable; // instead of global } } as general rule, try think of each function/method isolated component takes (its para...

add in - How to group different ribbons together? -

i have different excel add-in's (*.xlam) , have same “tab id” , same labels. when load them same excel file, each “add-in” creates separate ribbon same name. there way group them under same ribbon when loaded separately? two of xml codes ribbons below: <customui xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon> <tabs> <tab id="companyfunctions" label="company functions "> <group id="grplogon" label="int_functions"> <button id="calculatex" label=" calculate x" imagemso="tabledrawtable" onaction="startcalculatex " size="large" /> </group> </tab> </tabs> </ribbon> <customui xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon> <tabs> <tab id="companyfunctions" label="company functi...

selenium - How to locate elements of table with dynamic ids using findElements? -

i have xpath dynamic ids of table. trying table ids have 'sometext' list using findelements. issue have similar pattern except digits in id attribute vary <tr> <td> <a id="text-132" </a> </td> <a id="text-125" </a> </td> <td> <a id="test-122"</a> </td> i wrote following code, doesn't show error locating xpath prints nothing , list size 0 list<webelement> my_list = driver.findelements(by.xpath("//*[starts-with(@id, 'text')]")); system.out.println("size: " + my_list.size()); (int i=0; i<my_list.size(); i++) { system.out.println(my_list.get(i).gettext()); } i prefer (probably matter of habbit) - alternative- css selectors : selector : [attribute*=value] example : a[href*="w3schools"] description: selects every element href attribute value contains substring "w3schools...

android - Error in MainActivity when implementing TabActivity -

i want page text on top(edittext) image (in fragmentlayout) , 2 tabs below image. output not showing tab in output have written code implement tabs. code notshowing error , in output mam not getting tab in output i not getting correct output , not showing error tried without extending tabactivity (only extens activity) still output same image loaded above code of activity_main.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".mainactivity" > <textview android:id="@+id/tbol" android:layout_width="250dp" android:layout_height="30dp" android:text="@string/heading" android:textappearance="?android:attr/texta...

tkinter - Python threads and global variables -

i have class variables declared globals in first method. subsequent method starts thread, , problem python doesn't recognize global variables after t.start(). here how program works: 1) user can click "yes"-button on tkinter window 2) program starts upload data database. step takes while (2-5 minutes) , prevent ui freezing during upload, program starts thread performs sql stuff. @ same time, program clears widgets window , replaces them new widgets (a progress bar , text field). 3) after upload completed, program again refresh tkinter window new buttons , scrollbox. here code snippet: class application(tk.frame): def __init__(self, parent): #do init here.. def initui(self): global text1, text2, button_no, button_yes, progress_bar #here globals frame1 = tk.frame(self) frame1.pack() text1 = tk.label(self, text="do want upload new log file?", background="white") button_yes = tk.button(self, t...

c# - Unable to navigate to another page on button click in windows phone 8.1 -

i have button & upon clicking it, need go xaml page. this button resides in page1.xaml <button content="button name" horizontalalignment="center" verticalalignment="center" click="button_click" foreground="#ff119ff0"/> private void button_click(object sender, routedeventargs e) { framebody.navigate(typeof(homepage)); } but not able navigate homepage.xaml. what can reason?? these libraries included: using system; using system.collections.generic; using system.io; using system.linq; using system.runtime.interopservices.windowsruntime; using windows.foundation; using windows.foundation.collections; using windows.ui.xaml; using windows.ui.xaml.controls; using windows.ui.xaml.controls.primitives; using windows.ui.xaml.data; using windows.ui.xaml.input; using windows.ui.xaml.media; using windows.ui.xaml.navigation; the function button_click() defined in page1.xaml.cs. this code use in...

Convert VBScript code to javascript (i.e. JScript) code -

how convert following vbscript javascript? <script type="text/vbscript"> function sayhello() msgbox "hello" hkey_local_machine = "&h80000002" uninstallregkey = "software\\microsoft\\windows\\currentversion\\uninstall" stdregpro = "winmgmts:{impersonationlevel=impersonate}!\\\\.\\root\\default:stdregprov" set objreg=getobject(stdregpro) objreg.enumkey hkey_local_machine, uninstallregkey, arrsubkeys msgbox arrsubkeys end function </script> any appreciated. thanks, lok. you can, if use jscript (microsoft's implementation of javascript windows) , information e.g. calling wmi methods jscript troubles wmi in jscript (found googling "jscript wmi"). evidence: function showuninstall() { var hkey_local_machine = 0x80000002; var uninstallregkey = "software\\microsoft\\windows\\currentversion\\uninstall"; var stdregpro = "winmgmts:{impersonationleve...

pypi - How can I safely check if a python package is outdated? -

i want include kind of self-update mechanism on python package , not want call pip update before script run slow, looking smart mechanism. every time used make http call, pypi , if detect new version output warning on stderr. obviously, part of process want cache result of last call, library not check updates more once day, let say. does has implemented? have example can used cache results http calls, between different executions, not impose signifiant delays? to show outdated packages can run pip list -o , doesn't involve caching itself. although trivial add pip list -o > outdated.txt cronjob automatically updates daily :) here's example code use pip library: def get_outdated(): import pip list_command = pip.commands.list.listcommand() options, args = list_command.parse_args([]) packages = pip.utils.get_installed_distributions() return list_command.get_outdated(packages, options) print(get_outdated())

database - MySQL making a relationship table for different objects -

so, i'm in dilema. wich best approach solve problem: i deal dozens of diferent tables, each 1 representing different entity , having @ least 1 unique primary key. (unique in context of table itself, means it's not guaranteed 1 unique value in 1 table doesn't exists in another) my mission create intermediate table(s) establish relationship of 1 'object' in table another. (something similar parent/child relationship). some of these tables may have hundreds or thousands rows main 1 may around 1 million. in of cases relation between 2 'objects' one-to-one. there's special cases 1 object may linked 2 or more objects. so come 2 different approaches: table1) create table know there's single child/parent(s) relationship ----------------------------------------------------- | child | parentida | parentidb | ... | parentidn | ----------------------------------------------------- table 2) create table represent relation of children/pare...

ios - SKSpriteNode : Handling Collision during SKAction -

i'm making little game, , i'm stuck following problem. i'm running action (followpath type) on particular node : let followtrack: skaction = skaction.followpath(ballpath!.cgpath, duration: action_speed) movingball.runaction(followtrack) but during animation, if node collide 1 (like wall exemple), animation stops , there no collision animation. i tried things : func didbegincontact(contact: skphysicscontact) { var firstbody: skphysicsbody = contact.bodya var secondbody: skphysicsbody = contact.bodyb firstbody.node?.removeallactions() secondbody.node?.removeallactions() } but there no collision either (i guess that's because velocity (0,0)) is there anyway handle case ? (i don't need swift answer, objective-c or generic answer great !)

dependency injection not behaving in spring -

simply have 2 classes. questions.java , answers.java trying inject answers object questions. beans.xml file <bean id="questions" class="main.questions"> <constructor-arg value="0000"></constructor-arg> <constructor-arg value="what question?"></constructor-arg> <constructor-arg value="threading"></constructor-arg> <property name="correctanswer" value="deadlock"></property> <property name="answers" ref="answers"></property> </bean> <bean id="answers" class="main.answers"> <constructor-arg value="0000"></constructor-arg> <constructor-arg value="livelock"></constructor-arg> </bean> when output console in netbeans line question [questionid=0, question=what question?, category=threading, correctanswer=deadlock] when surely...

aggregate - MySQL - make a weekly report that includes starting day (twist: week starting wednesday) -

i have kind of table time based data: | entity_id | ttime | value | ------------------------------------------- | 1 | 2014-11-01 00:00:04 | 553 | | 1 | ... | 600 | | 2 | ... | 234 | i want average of value grouped week , entity_id. starting day of week appear in results. additional complexity week starts on wednesday. i can group year(ttime + interval 3 day), week(ttime + interval 3 day) possible print first day of group (wednesday) in results? thanks maybe this: select `entity_id`, date_sub(ttime, interval weekday(ttime)-2 day), sum(`value`) `table` group `entity_id`, yearweek(ttime + interval 4 day) sqlfiddle

xcode - Implement Yosemite Reminders/Notes/Messages/Contacts style windows -

Image
how create yosemite reminders/notes/messages/contacts style window? specifically, traffic lights on left pane of split view, while right pane takes whole space including title bar area. see attached screenshots. this combination of 2 new nswindow options. include nsfullsizecontentviewwindowmask in window's stylemask make content view of window stretch behind title/toolbar. enable titlebarappearstransparent property disable rendering of translucent title/toolbar material content view shows in title/toolbar area without getting blurred.

html - Text Overlap on Image with CSS -

Image
i have image want overlap piece of text @ bottom transparent black background. whats easiest way achieve , <img src="http://assets3.parliament.uk/iv/main-large//imagevault/images/id_7382/scope_0/imagevaulthandler.aspx.jpg" alt=""> <div> <p class="description_content">example</p> </div> wrap img , p tag in div , apply position property , style want. something example... html <div> <img src="http://assets3.parliament.uk/iv/main-large//imagevault/images/id_7382/scope_0/imagevaulthandler.aspx.jpg" alt="" /> <p class="description_content">example</p> </div> css div { position: relative; width: 460px; height: 230px; } img, p { position: absolute; width: 100%; } p { background-color: rgba(0, 0, 0, 0.5); padding: 10px; bottom: 0; left: 0; box-sizing: border-box; color: #fff; margi...