Posts

Showing posts from August, 2012

compiler construction - Why Bison gives Conflict: 2 Shift Reduce error -

i'm trying below yacc grammar part gives me, wrong this? , how can solve it? there rules define grammar in bison/ yacc ? c:\users\dilan\documents\lexprogram\miniproject>bison -dy videostore.y conflicts: 1 shift/reduce and yacc code : %start videostore %token title %token type %token name %token days %% videostore : movies customers | customers movies | movies | customers ; movies : movies movie | movie ; movie : title type rentals2 ; rentals2 : rentals2 rental2 | rental2 ; rental2 : customer1 ; customer1 : name days ; customers : customers customer | customer ; customer : name days rentals ; rentals : rentals rental | rental ; rental : movie1 ; movie1 : title type ; %% int trace=0; my problem videostore.y: conflicts: 2 shift/reduce , how

multithreading - Node.js data processing distribution -

i'm in need of strategy distribute data processing using node.js. i'm trying figure out if using worker pool , isolate groups of tasks in these workers best way, or using pipe/node-based system http://strawjs.com/ way go. the steps have following (for single job): extract zip-file containing gis shapefiles convert files geojson using ogr2ogr denormalize data in geojson file transform data format use in mongodb upsert data mongodb collection the main problem don't know how merge data different geojson files when using pipe/node-based system straw. i understand how work in worker pools. don't know how distribute workers on several machines. i've tried naive way of doing in single thread on single machine using async module. works small sets of data. in production i'm need able support millions of documents on pretty frequent interval. the reasons behind using node.js have solid infrastructure scaling node.js processes , use node.js every as

c# - Store difference between two dates recursively and calculate time spent on web site -

i have find time spent on site choose maintain 2 datetimes , time in database can save difference between login time , logout time , store in table column timespent . the time stored {00:16:58.413785200} have add amount of time recursively after each logout if spent 10 minutes in first login , 5 minutes in 2nd login have store 15 min timspent on site. but problem not able guess happens if want add 2 minutes after 23:59:59.000000000. know max time value 23:59:59 can stored time datatype in sql. so how achieve this? have tried var _user = db.users.singleordefault(t => t.id == id); _user.endtime = datetime.now; var _starttime = _user.starttime; if (_user.timespent != null) { _user.timespent = _user.timespent + (_user.endtime - _starttime); } else { _user.timespent = (_user.endtime - _starttime); } db.savechanges(); you need switch datatype on timespent column bigint . should have default value of 0 timespent column aswell or handle in code. var

android - How can i send images available in asset folder using intent -

i'm trying send images available in asset folder using intent providing error says shared failed try again later please provide me suggestion. here i'm doing intent share = new intent(intent.action_send); share.settype("image/*"); share.putextra(intent.extra_stream, uri.parse("file:///android_asset/1.jpg")); startactivity(intent.createchooser(share, "share image!")); i trying using this intent share = new intent(intent.action_send); share.settype("image/*"); share.putextra(intent.extra_stream, uri.parse("android.resource://com.example.whatsappshare/asset/1.jpg")); startactivity(intent.createchooser(share, "share image!")); both ways providing same result. once created bitmap said earlier, use following snippet send attachment. string path = images.media.insertimage(getcontentresolver(), your_bitmap, "title", null); uri screenshoturi = uri.parse(path); final intent emailintent = new

lua - Parse rest api query with OR condition -

i having difficulties working out how perform or type query using parse rest api. i have 2 classes set below. there 1 - many relationship between , b classa -> objectid -> player1 -> player2 classb -> objectid -> classaid (pointer) -> somedata1 -> somedata2 what trying classb records current user id either in player1 or player2 field if classa. i can query working when looking see if player1 field current user i.e. lua table looks (then encoded json , sent parse). send query classb rest url. local querytable = { ["where"] = { ["classaid"] = { ["$inquery"] = {["where"] = { ["player1"] = settings.userid} , ["classname"] = "classa" } } } } could point how can include player2 field. if sql i'd on sonic parse different beast!

Objective-c string not working -

hi im new objective c , have question. here code... ccscene *restartscene = [ccbreader loadasscene:@"levels/level%d",_currentlevel]; basically when level loads want load ever level value of _currentlevel is, getting error saying "too many arguments method call, expected 1,have 2". making noob mistake in advance. loadasscence needs string argument. have construct string: ccscene *restartscene = [ccbreader loadasscene: [nsstring stringwithformat:@"levels/level%d",_currentlevel];

java - canvas bitmap animations without using a sprite sheet -

bitmap[] planeframes = new bitmap[4]; protected void ondraw(canvas canvas) { for(int = 0 ; < planeframes.length;i++) canvas.drawbitmap(planeframes[i], plane.getcenterx(), 0, null); // planeframes array of bitmaps } im trying animate plane swapping images not working don't know if method simple work with you can not animate way. ondraw called per draw iteration meaning whatever draw on canvas @ return what's going drawn on screen. you're doing here drawing bitmaps on canvas @ same spot , plastered on top of each other. what need call invalidate() method of view. make things more efficient, can use rect or define areas around bitmaps. @override protected void ondraw(canvas canvas) { canvas.drawbitmap(planeframes[i], plane.getcenterx(), 0, null); if(++i >= planeframes.length) { = 0; } invalidate(bmprect); } this consistently draw through bitmaps while repeatedly drawing new bitmaps. last forever long v

WinRT XAML Toolkit: can we use it in windows phone 8.1 and windows 8.1 universal app -

i developing charting app , want use winrt xaml toolkit data visualization in both (windows phone 8.1 , windows 8.1) of projects in universal app. how can this? unfortuatly winrt xaml toolkit ( https://winrtxamltoolkit.codeplex.com/ ) work windows runtime xaml applications. recommendation create 2 pages (sadly) or usercontrols , use winrtxamltoolkit windows 8.1 app , data visualization toolkit telerik maybe windows phone 8.1 ( http://www.telerik.com/products/windows-phone/overview/all-controls/chart.aspx ). with bit of luck able bind same property on both controls, best of luck!

How to get values from arraylist Hashmap -

how value according comparison. new in android , comparison working fine m not able value displaying in arraylist. below code , log- for (entry<integer, list<string>> entry : abbre.entryset()) { log.d("abbrevations values- ", entry.getkey() + " " + entry.getvalue()); if(tid.equals(string.valueof(entry.getkey()))){ //string avalue = string.valueof(entry.getvalue()); log.d("abbrkey value: ", string.valueof(entry.getvalue())); } else{ log.d("abbrkey key: ", string.valueof(entry.getkey())); } } the log - 06-27 11:27:39.375: d/abbrkey tid:(13602): 27 06-27 11:27:39.375: d/abbrevations values-(13602): 23 [8+, 4+, 2-] 06-27 11:27:39.375: d/abbrkey key:(13602): 23 06-27 11:27:39.375: d/abbrevations values-(13602): 27 [8+, 4+, 2-] 06-27 11:27:39.375: d/abbrkey value:(13602): [8+, 4+, 2-] 06-27 11:27:39.375: d/abbrevations values-(13602):

html5 - Zurb Foundation 5 - Row padding/margin -

Image
i trying create background color row, yet when set background color extends on regular width of columns. tried making row smaller padding, works, makes columns smaller. need somehow remove pink area, keep red background, , keep columns even. any ideas? <!-- when applying padding, columns background turns ok. however, columns aren't "normal" columns without padding --> <div class="row" style="background-color: pink; padding-right: 15px; padding-left: 15px; "> <div class="large-3 columns" style="background-color: red;"> text1 </div> <div class="large-3 columns" style="background-color: red;"> text2 </div> <div class="large-3 columns" style="background-color: red;"> text3 </div> <div class="large-3 columns" style="background-color: red;&qu

android - Increase the line border of chartView aChartEngine -

Image
i need increase border width of chart (at x- axis, parallel line opposite x-axis, y-axis, , line parallel y-axis ). how can go it? there doesn't seem direct function that.

memory - JavaScript- properties and variables -

in code deleting custom-objects. realized, can not delete objects declared using 'var'. (after reading documentation delete operator ). most of objects declared , initialized using 'var'. can't deleted in single delete statement(unless loop through , delete each property.) can set them 'null'. my custom objects relatively bigger in size (may block considerable chunk of memory. for better memory management , performance should use 'properties' or 'variables' store objects? make difference? please provide references better insight on 'properties' , 'variables' in javascript. globalprop = {//can deleted, 'property' global object. 'name': 'mia', 'age': 34, 'sex': 'f' }; var globalvar = {//can not deleted delete statement, variable of global object 'name': 'lia', 'age': 25, 'sex': 'f' }; (in above code, can refer globalprop 

php - How do i get rid of methods for view in model class -

in models create methods used in views this: <?php $this->widget('cgridview', [ 'id' => 'sales-list', 'columns' => [ [ 'header' => 'id', 'name' => 'id', 'type' => 'raw', 'value' => '$data->getviewid()' ], [ 'header' => 'int id', 'name' => 'int_id', 'value' => '$data->getinternalid()', ], in model have code public function getinternalid() { ... } public function getviewid() { ... } by creating methods model rapidly rises , don't this. want devide view methods other model methods, best practice this? your models becoming large , unwieldy because following recommended way of "fat model , thin controller" design. have noticed models in medium-sized project on time become obese quickly! first

php - iframe created twice with jquery -

i using 2 links on page create iframe each. problem is creating iframe twice. i did use each link id check weather loading 1 iframe each link iframe loads twice has same id. <a id="mylink12" href="anyurl">my link one</a> <a id="mylink13" href="somedifferenturl"> link two</a> jquery(".editme").click(function(event) { event.preventdefault(); var editid = 'frame-'+jquery(this).attr('id'); var url = jquery(this).attr('href'); if(jquery(editid).size() == 0) { jquery('<iframe />', { name: 'frame', id: editid, src: url }).appendto('#here'); };

javascript - AngularJS: validation in model -

how validate data inside model in angularjs? i have form alters (live) output of javascript code, , in general there sets of input data reason invalid (but not single fields being invalid on own). unfortunately angularjs docs point defining custom validator directives, makes no sense me. requires lot of coda , not wan't define logic in html (it not place it).

c# - How to disable focus changes by arrow keys -

i have wpf window few controls (buttons, groupboxes, etc) , 1 big viewport3d within border . the viewport shows 3d scene , want arrow keys move camera around. problem: arrow keys change focus uielement . how can disable focus changes arrow keys , have them change camera position instead? it difficult answer without having code test, because without it, guessing really. either way, can't comment on particular situation, in general, if want stop pre-defined action happening in event, typically handle event , set e.handled property true . seeing want handle keydown event detect use of arrow keys, set e.handled property true @ same time. however, should handle previewkeydown event instead, because occurs before keydown event , more have effect want. try this: private void textbox_previewkeydown(object sender, keyeventargs e) { if (e.key == key.left || e.key == key.right) { // move camera here e.handled = true; } }

Using CIFaceFeature detection, can I determine the Confidence of the Face detected in an Image -

i'm starting take @ cidetector detect faces in image wondering whether has had luck determining confidence level detector has when detected face. i know can set detector threshold choosing different detector accuracies, there way tell how detected feature has surpassed requested accuracy? cicontext *context = [cicontext contextwithoptions:nil]; nsdictionary *opts = @{ cidetectoraccuracy : cidetectoraccuracyhigh }; cidetector *detector = [cidetector detectoroftype:cidetectortypeface context:context options:opts]; essentially, if have image has 2 faces in - how can determine of 2 more face assuming both detected using cidirectoraccuracyhigh option? thanks mustafa the lower index in nsarray of cifeatures more face according documentation in coreimage /** returns array of cifeature instances in given image. array sorted confidence, highest confidence first. */ - (nsarray *)featuresin

android - EditText with attribute singline="true" doesn't moves up when keyboard appears -

Image
reproduced on nexus 7 android 4.3 workflow: set focus edit text first time - keyboard appears, edittext visible; hide keyboard; set focdus edit text second time - keyboard appears, edittext doesn't moving up. (edittext aligned on bottom of screen) <?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <edittext android:id="@+id/edit_text" android:layout_gravity="bottom" android:gravity="center" android:singleline="true" android:imeoptions="actionsearch" android:layout_width="match_parent" android:layout_height="wrap_content"/> </framelayout> public class myactivity extends activit

How can I add the different blocks in footer for each store in Magento -

Image
hello new in magento.i want add different blocks in footer each store. have created cms block adding telephone number in footer , add block in local.xml , telephone number cms block showing in footer problem have multiple store , want add different telephone number according store. how can .is there way use different block different store in footer admin section. appreciated. instead of creating static block display telephone number, you can store telephone number form system configuration(admin panel). system > configuration > general > store information in can give telephone number each store and can telephone number following code mage::getstoreconfig('general/store_information/phone'); get value in cms page {{config path="general/store_information/phone"}}

Python syntax error when I use if on same line -

i must doing stupid don't see it. not following simple code work. >>> def a_bigger_than_b(a,b): ... 'yes' if > b file "<stdin>", line 2 'yes' if > b ^ syntaxerror: invalid syntax def a_bigger_than_b(a,b): ... return 'yes' if > b else 'no!' actually using ternary operator in such case need else i think must give else can understood by first c='yes' if > b what value if smaller b case ambiguous else must correct syntax c='yes' if > b else 'no!' a detailed explanation given here *on 9/29/2005, guido decided add conditional expressions in form of "x if c else y". motivating use case prevalance of error-prone attempts achieve same effect using "and" , "or". previous community efforts add conditional expression stymied lack of consensus on best syntax. issue resolved deferring

html - Responsive layout & column float issue -

Image
i'm trying achieve layout series of tiled divs in single row using bootstrap 3.2.0, screens > 768px wide. div heights either single or double, in sample i've set 50px , 100px , div widths controlled class col-sm-x : my best attempt far uses below markup & css: css .red{ background-color: red; } .blue{ background-color: blue; } .green{ background-color: green; } .yellow{ background-color: yellow; } .purple{ background-color: purple; } .home-height-single{ min-height: 50px; } .home-height-double{ min-height: 100px; } @media (min-width: 768px) { .b-col { float: right; } } markup: <div class="row"> <div class="col-sm-6 home-height-double green"> <p>1</p> </div> <div class="col-sm-4 home-height-single blue b-col"> <p>3</p> </div> <div class="col-sm-2 home-height-single purple b-col"> <p>2<

Extracting numeric part from string - SYBASE ASE -

i trying extract 7658 string xyz.abc7658@yahoo.co.in . below query trying , output shown. query doesn't server purpose. can please on this? (running query on sybase ase) select substring('xyz.abc7658@yahoo.co.in', patindex('%[0-9]%', 'xyz.abc7658@yahoo.co.in'), len('xyz.abc7658@yahoo.co.in')) number go number -------------- 85@yahoo.co.in you did not mention end poistion declare @str varchar(100) select @str='xyz.abc7658@yahoo.co.in' select substring(@str, patindex('%[^0-9][0-9]%', @str) + 1, patindex('%[0-9][^0-9]%', @str) - patindex('%[^0-9][0-9]%', @str))

java - Modify the .jsp argument in Struts -

i trying create interceptor in struts modify .jsp page name. reason being want each page wrapped in container page, include of defaults (css, scripts, etc). have created basic interceptor can't see (a) how .jsp page url (b) how return modified .jsp url. <action name="myaction" method="{1}" class="actionclass"> <result name="dosomthing">mypage.jsp</result> </action> in above want create interceptor take "mypage.jsp", , allow me return modified string - ie "container.jsp?content=myjsp.jsp". actual modified string vary depending on other parameters. i have working - interceptor being called - don't know put in intercept method! thanks

javascript - Remove specific storage from indexeddb -

i wondering if it's possible remove specific storage , indexeddb or, in case not possible, how clean records inside storage. thanks use delete(id); function in indexeddb var request = store.delete(id); request.onsuccess = function(e) { console.log("deleted") }; request.onerror = function(e) { console.log("error--"+e); }; yes delete entire store db.deleteobjectstore("storename"); refer more

angularjs - Apply CSS to button when form is invalid -

Image
html <div class="filterbutt"> <input type="hidden" name="reportparams"> <span class="pull-right"> <button type="submit" ng-disabled="!filter.$valid" ng-click='filtercomponents()' data-toggle="modal" id="filterclose" class="btn-flat default" href="#mymodal1"><i class="icon-ok-sign">save</i></button> </span> </div><!--#filterbutt--> css .btn-flat { display: inline-block; margin: 0; line-height: 15px; vertical-align: middle; font-size: 12px; text-shadow: none; box-shadow: none; background-image: none; border: 0 none; color: #fff; font-weight: 500; border-radius: 4px; background: #2b73b0; border: 1px solid #3883c0; cursor: pointer; padding: 7px 14px; -webkit-transition: .1s linear; -moz-transition: .1s linear; transition: .1s linear; } but

java - How get ALL url pictures of post with Facebook4J? -

i'm getting url picture of post below: responselist<post> feeds = facebookclient.getfeed("*******",new reading().limit(20)); post post = feeds.get(i); url imageurl= post.getpicture(); if there post more 1 pictures first.. possible pictures facebook4j ?

php - highlight active page option value in select element using "option selected value" -

i'm using custom wp-query on website display pages parent page inside list style select, when selecting page i'm redirected right page. works fine : here code : <?php $args = array( 'post_type' => 'page', 'posts_per_page' => -1, 'post_parent' => '22', 'order' => 'asc', 'orderby'=>'meta_value', 'meta_key'=>'nom_de_loeuvre' ); $parent = new wp_query( $args ); if ( $parent->have_posts() ) : ?> <span class="styled-select"> <select name="" onchange="location = this.options[this.selectedindex].value;"> <option>a - z</option> <?php while ( $parent->have_posts() ) : $parent->the_post(); ?>

java - Border around an applet -

are there methods have border around applet such components enclosed within border? this.getcontentpane().setborder() method not present try using jlabel on form design , set border using properties

asp.net - What's causing "Windows Security" login prompt to occur for just one user? -

Image
details: asp.net webforms .net 4.0 windows authentication iis 6 windows server 2003 sp2 only 1 user having issue connecting 1 virtual directory. says sees login form in ie, chrome, , firefox. uses windows credentials , unable login. able access other websites hosted in other virtual directories on same domain. no others experiencing issue. says able access site fine few weeks ago. causing dialog box appear user site no matter browser he's using? since it's of user's web browsers, points user's permissions on server particular website. if worked before user states, perhaps can ask server admins if changed regarding user permissions on server few weeks ago. another path go down see if user (or desktop admins) has installed software on his/her machine disallow or alter windows authentication in browser site. far more unlikely simple user permissions issue on server since he/she can still access other protected websites windows authentic

apache - htaccess - make public directory accessible -

yes, has been asked here lot, none of solutions provided worked me. folder structure / +-- _projects | +-- includes | | |-- main.class.php | +-- scripts | | |-- saveitems.php | +-- view | | |-- layout.php | |-- index.php | |-- .htaccess | +-- _pub | +-- img | | |-- webicon_facebook.png | | |-- webicon_twitter.png | +-- view +-- includes |-- index.php |-- .htaccess .htaccess file in root: options -indexes +followsymlinks rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([a-z]+)\/(.+)$ index.php?page=$1&item=$2 [l,qsa] rewriterule ^([a-z]+)$ index.php?page=$1 [l,qsa] the mission: enable browsers access folder or file in _pub what i've tried: using .htaccess file satisfy any allow all in _pub disabling rewriteengine inside _pub folder change root htaccess file include rewriterule ^_pub/$ _pub/ [l] right below rewritebase \ the curious thing when br

java - Eliminate default zeros while creating string from byte array -

i getting bytes iostream , converting string. string extracting sequence using substring api. size of bytearray 128 bytes. if stream contains 10 bytes , remaining filled zero[initially filled]. converting byte array string passing string constructor new string(byte[]) , checking length. length 128. why showing 128? should show 10 byte character length. how eliminate 0 while converting string. there api's eliminate default zeros in byte array. it's creating problem while creating substring constructed string. byte[] b = { 99, 116, 101, 100, 46, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

actionscript 3 - Away3d move camera in viewing direction? -

i have away3d camera looking @ object aerial view. now, want closer object rotate mouse wheel. i did using camera lens adjusting binocular , not getting closer object, private function onmousewheelevent(e:mouseevent):void { perspectivelens(view.camera.lens).fieldofview -= e.delta; } is there easy solution or have write such controller of own? i did using camera.forwardvector so, private function onmousewheelevent(e:mouseevent):void { view.camera.x = view.camera.x + (e.delta * view.camera.forwardvector.x); view.camera.y = view.camera.y + (e.delta * view.camera.forwardvector.y); view.camera.z = view.camera.z + (e.delta * view.camera.forwardvector.z); }

Dynamic Extractors in Scala -

one of things don't extractors cannot have parameters. cannot have extractors param in: req match { case param("foo")(foo) => … } dynamic extractors? that's unfortunate, , hope change day, morning figured fix using dynamic trait. object params extends dynamic { def selectdynamic(name: string) = new { def unapply(params: map[string, string]): option[string] = params.get(name) } } … hoping allow me use params in pattern matching statement this: req match { case params.foo(value) => // matching map("foo" -> "bar"), extracting "bar" in value it doesn't work … doesn't work. seems compiler still getting confused. scala> map("foo" -> "bar") match { case params.foo(value) => value } <console>:10: error: value applydynamic not member of object params error after rewriting params.<applydynamic: error>("foo") possible cause: maybe wrong dynamic meth

java - offsetting Simplex noise return values -

i planning on project uses simplex noise algorithm generate map. i want generate more terrain move , explore. know simplex generates noise seed, , generate same map if seed re-used. want load map chunk chunk. my question this: would possible pass offset parameters modified noise function, without iterating through values have? for example receiving data (0,0)-(100,100) values , separate call using same seed receiving (0,100)-(100,200) values, without having loop through first 100x100 values. i haven't worked noise before, , interested know if approach feasible? what other efficient methods there of generating similar results. , if works able save map data seeds used? minimizing io functions? simplex noise form of value noise. if have set seed, mathematical calculation performs noise value same. means generate noise value passed location. so if generate 100,100; noise value get. dont calculate 0-100, 0-100; unless loop it.

c# - Disable Esc key on Kendo Window Popup -

i using kendoui controls javascript mvc. have popup window create "kendowindow". working fine, when press esc key automatically close. want disable esc key window popup can closed cancel button or close button. here kendo window code. var wndeditclient= $("#diveditclient") .kendowindow({ title: "edit client", modal: true, visible: false, resizable: false, width: 450, actions: ["close"] }).data("kendowindow"); wndeditclient.open(); please suggest. i tried javascript keypress event , not work. $(document).bind("keypress", function (e) { if (e.keycode == 27) { e.preventdefault(); } }); tried not working. put before including first kendo window directive: $(function () { kendo.ui.window.fn._keydown = function (originalfn) { var key_esc = 27; return functio

android - Exception raised during rendering: java.lang.System.arraycopy -

Image
i have strange problem new adt version. have downloaded new eclipse eclipse.org install adt on it. works fine; can create project android , thing work well, except: when trying create 1 xml layout, following error: exception raised during rendering: java.lang.system.arraycopy and in error log see: failed render set of icons analogclock, autoncompletetextview, button, smallbutton , .... ff change edittext textview , error disappears. can run program warning, want see layout in graphical section. my layout is: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/settingback" android:orientation="vertical" android:weightsum="480" > <linearlayout android:layout_width="match_parent

python - How to make Tkinter button to not disappear when option in OptionMenu is selected? -

i have code: def type(): variable=var.get() if variable=="text caps": import caps_main.py tkinter import * t = tk() t.geometry("500x300") p = photoimage(file="c:\users\indrek\downloads\desert.gif") l = label(t, image=p) t.wm_title("school test") var = stringvar(l) var.set("select test type.") # initial value option = optionmenu(l, var, "text caps", "text mistakes") option.pack(expand=y) b = button(l, text="start", command = lambda:type()) b.configure(background='peachpuff') b.pack(expand=y) l.pack_propagate(0) l.pack() t.mainloop() the problem is, when run code , select option optionmenu, button "start" disappears. how make button not disappear? when change code to:(widgets in main frame(t) not in label(l) in code) def type(): variable=var.get() if variable=="text caps": import caps_main.py tkinter import * t = tk() t.geometr

php - GET - get the value and append to a link? -

i have query string in url: ?search=whatever i need append paginated links: example.com/articles/p3/?search=whatever i can value using: $_get['search'] //whatever but what's best way build string can append url. there proper way or case of appending string: '?search='.$_get['search'] for building url's should use propper urlbuilder. for php can use parse-url , http-build-query .

extjs4 - Grid.reconfigure not working in extjs -

i have reset button grid supposed reset columns. code looks : function (response) { if (response == 'yes') { ext.state.manager.clear(grid.stateid); var cols = grid.initialconfig.columns grid.reconfigure(grid.getstore(), cols); } }); grid.reconfigure(..) supposed reset how table looks, nothing happens when run code above. i noticed grid.initialconfig.columns undefined. why undefined? there kind of initial configuration needs set first? (i notice when using constructor can define initialconfiguration . used initcomponent instead.) try following: initcomponent : function (){ var me = this; // can expect extjs wan't change config // sure clone array. // (you may check this, because think don't need this) me.columnscfg = me.columns.slice(0); .... } and reconfigure function

asp.net mvc - How to create, not edit, an object with a list of objects in C# MVC 4 using model binding? -

say had website users create (and edit) video game consoles. has following model. videogameconsole: string name datetime released list<videogames> games videogame: string name datetime released httppostedfilebase image (i hope example simple enough.) i'm wondering how create such object using model binding (not edit, i've seen lot of solutions rendering or editing existing dynamic list). current way seems model binding allows create videogameconsole no games, go on edit screen , add games. i'm looking solution user can see total object before creation. @ least, there name i'm trying make easier continue own research on this? thanks. edit 1: two important notes makes more... fun (in dwarf fortress sense). first, i've changed model include httppostedfilebase each videogame represents image. need able upload multiple files. doesn't make more fun on own. second, needs work without javascript (part of userbase of our app

How to creat an interactive email in outlook? -

hi have task create interactive email in outlook. mail contains couple questions survey yes or no answers. wanted use checkboxes or radio buttons...etc. , if 1st & 2nd questions answered yes following questions should visible. i have done 1st part of checkboxes using msword, have no clue on how hide n show questions depending upon given condition. outlook not run scripts or forms in html emails both security purposes , because html rendered word, not internet explorer.

Eclipse Luna (R): no content assist for Java 8 method references -

Image
eclipse java ee ide web developers. version: luna release (4.4.0) build id: 20140612-0600 i'm using release version of eclipse luna java (java ee), , seems there's no content assist new java 8-style method references . in example below, hit ctrl-space after '::', expecting see list of methods available on class match . instead generic template assist, if cycle through assist menus. normal content assist on methods work fine, it's java 8 method references (::) don't work. is supposed work? if not, why not? design? bug? looks might eclipse bug 430656 . method reference content assist work in places not in 'invocation contexts'.

java - javafx getting error in string.equals() -

during working on project met problem . i have added item in combobox: @fxml private combobox schedule; i had added value schedule.getitems().add("create new schedule"); now comparing value: string p= (string) schedule.getselectionmodel().getselecteditem(); system.out.println(p); if(p.equals("create new schedule")){ system.out.println("got it); } i getting error on line if(p.equals("create new schedule")){ error: exception in thread "javafx application thread" java.lang.runtimeexception: java.lang.reflect.invocationtargetexception @ javafx.fxml.fxmlloader$methodhandler.invoke(fxmlloader.java:1768) @ javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1651) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:86) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:238) null

java - How can I enhance a legacy system without the legacy environment? -

i updating legacy application company , runs on websphere v6.1. however, since company has upgraded websphere v8.5 company standard, have gotten rid of websphere v6 instances development. ideally project should upgraded v6.1 v8.5 before fix isn't in current quarter's budget, , enhancements high priority. have enhancements coded, stuck being unable run , test v6.1 application without proper application server instance. is there way enhance , run application on current version of websphere or web application server (tomcat, jetty, etc) , still have compatible websphere v6.1? you can run app on v8.5. websphere backward compatible , able run 6.1 apps. don't migrate project, when import rad/eclipse , make sure project facets unchanged , point j2ee 1.4 , java 1.5. its safer test on higher version on other application server. , can download v8.5 development free, if dont have it.

powershell - Search network PCs for user SID -

i have been looking how find location of sid on network computers far nothing. i need search our network, , query pc's find if specific sid present , give me resulting pcs user sid appears. any ideas drawing blank. try this. takes username, converts sid, searches computers in domain sid in registry (user has logged on otherwise registry key doesn't exist). $user = "username" $sid = get-aduser -identity $user | select -expandproperty sid $computerlist = get-adcomputer -filter * | select -expandproperty dnshostname foreach ($computer in $computerlist){ if (test-connection -computername $computer -quiet -count 1) { $reg = [microsoft.win32.registrykey]::openremotebasekey('users', $computer) if ($reg.opensubkey("$sid")) { write-output "$user found on $computer." } else { write-output "$user not found on $computer." } } else { write-o

c# - WPF nested ListBox control does not update the list it is bound to -

i have following 2 classes (with altered names), used populate listview nested listbox private class objectname //for listview { public int id { get; set; } public string field1 { get; set; } public string field2 { get; set; } public list<babyobject> field3 { get; set; } } private class babyobject //for nested listbox { public string field1 { get; set; } public bool field2 { get; set; } } i populate observable collection objects , set itemssource of listview. my listview correctly displays objects in each listviewitem, , nested listbox in each item correctly displays each babyobject. the problem: if edit id, field1 or field2 values using ui, observable collection in memory updates - of course does, because of binding. if edit of babyobject's values, list in memory doesn't change. therefore, when change controltemplate of listview (so values displayed in labels instead of textboxes), babyobject values change original. i know people

cordova - phonegap inappbrowser IOS not working -

i created project in phonegap ios , want open ulr in ios browser not inside app. tried use inappbrowser plugin seems doesn't working. use .html, .css, .js files , config.xml , on windows , build project online tool adobe phonegap builder if right, according link https: build.phonegap.com/plugins/658 there no need install plugin want use, suggest command cordova plugin add... . can have job done reffering plugin inside config.xml file. right? config.xml file: <?xml version="1.0" encoding="utf-8"?> <widget xmlns = " www.w3.org/ns/widgets" xmlns:gap = " phonegap.com/ns/1.0" id = "com.test.testingapp" version = "1.0.0"> <name>test</name> <!-- app icons , splashscreen --> <icon src="icon.png" /> <gap:splash src="splash.png" /> <platform name="android"> <icon density="mdpi&qu

jquery - Dynamic class for Meteor Event Map -

i trying create wizard package , can't seem able setup click event on element. i want person using package able define next , previous buttons class values , apply event when element classes clicked. it works fine when use static class values if try use ones define when initialize wizard fails unexpected token value. have tried printing classes console within events function , printing out fine. this works fine uses static class name template.wizard.events({ "click .btn-prev": function (event) { event.preventdefault(); this.wizard.previous(); } }); this won't work unexpected token + error template.wizard.events({ "click ." + this.wizard.prevclass: function (event) { event.preventdefault(); this.wizard.prev(); } }); i tried around doing if statement seems return false. template.wizard.events({ 'click': function (event) { event.preventdefault(); if ($(this).hasclass(this.wizard.nextclass)){ t