Posts

Showing posts from August, 2012

ftp - Ruby Net::SFTP upload hangs -

i using net-sftp gem upload file ftp server. here's code: require "net/sftp" net::sftp.start(url, username, password: password) |sftp| sftp.upload!(file_path, "/") end it hangs @ upload line, , times out error net::ssh::disconnect: connection closed remote host . able connect via sftp using filezilla using same url, username, , password. i tried running non-block version verbose: :debug as well: sftp = net::sftp.start(test.ftphost.com, ftp_username, password: ftp_password, verbose: :debug) ^ produced output shows connection good: i, [2015-04-29t10:32:51.381339 #25769] info -- net.ssh.connection.session[3fc8a502c24c]: channel_success: 0 d, [2015-04-29t10:32:51.381429 #25769] debug -- net.sftp.session[3fc8a5025d70]: sftp subsystem started then entered following: sftp.upload!("/users/marina/desktop/test.png", "/") the output stuck this: i, [2015-04-29t10:32:55.035471 #25769] info -- net.sftp.session[3fc8a5025d70]: se

c# 4.0 - How to get datatable column values in comma separated based on another column which have repeated/duplicated values? -

i need data-table column values in comma separated based on column have repeated/duplicated values. based on first column value need comma separated values of second column each unique value in first column. below current table. <table> <tr> <th>col1</th> <th>col2</th> </tr> <tr> <td>a</td> <td>aaa</td> <tr> <tr> <td>a</td> <td>bbb</td> <tr> <tr> <td>a</td> <td>ccc</td> <tr> <tr> <td>a</td> <td>ddd</td> <tr> <tr> <td>e</td> <td>eee</td> <tr> <tr> <td>f</td> <td>fff</td> <tr> </table> expected output: <table> <tr> <th>col1</th> <th>col2<th> </tr> <tr> <td>a</td> <td>aaa,bbb,ccc,ddd</td> <tr> <

ios - ActionSheet Source View BarButtonItem -

i have bar button item in navigation bar when pressed, present uialertcontroller style .actionsheet . in iphone appears way want. ipad know need add // ipad, set pop on bounds var popover = optionmenu.popoverpresentationcontroller popover?.sourceview = button uiview popover?.sourcerect = (button uiview).bounds popover?.permittedarrowdirections = uipopoverarrowdirection.any does know of way use bar button item sourceview , sourcerect ? popover point bar button item. just use popover?.barbuttonitem = mybarbuttonitem

html - Z-index not working on children within parent -

i know there have been lots of questions z-index, looked through them , still don't see i'm missing here. must simple i'm overlooking. i've had z-index work on other elements. me out here: .parent { width: 100%; position: relative; background: red; display: inline-block; } .bottom1, .bottom2 { width: 40%; position: relative; z-index: 1; background: yellow; } .bottom2 { float: right; } .top { width: 60%; position: relative; z-index: 5; margin: 0 auto; background: blue; } <body> <div class="parent"> <div class="bottom1">hello</div> <div class="top">again</div> <div class="bottom2">bye</div> </div> </body> i have jsfiddle here http://jsfiddle.net/slabicht2/drj0qlt2/ thanks the problem not z-index, it's positioning. if understand correctly want elements have ab

How to create a Swift object in Objective-C? -

if define swift class this @objc class cat { } in swift can do var c = cat() but how make cat instance in objective-c ? subclassing nsobject works because can "alloc-init" can achieve without subclassing objective-c class? the direct way subclass cat nsobject . if can't that, need make class method or function returns cat . @objc class cat { class func create() -> cat { return cat() } } func createcat() -> cat { return cat() } cat *cat = [cat create]; cat *cat = createcat();

javascript - Why does element load with blank opacity? And why does my js cancel the hover effect? -

i have element should fade out when clicked , fade in when it's space clicked again. additionally, opacity should 0.9 (rather 1) when visible. there's 2 problems code. hover selector seems break click element , js executes. (once unfades element loses hover effect.) second weird, js accounts it: element has opacity == "" reason! think might because hover effect confusing js actual value of opacity should be. function giterdone(element){ var op = element.style.opacity; if(op != 0){ fade(element); return; } else if(op == "" || op == null){ element.style.opacity = 1; giterdone(element); return; } else { unfade(element); return; } } function fade(element) { //works fine :) } function unfade(element) { //works fine :) } here relevant css: .sm-box{ float:left; width: 100px; height: 100px; margin: 0px; background-repeat:no-repeat !important; background-position:center !important; }

c# - Cannot implicitly convert type 'int' to 'string' on 2 intergers -

i making program calculating cost of 3d printing stuff. came on question. private void button1_click(object sender, eventargs e) { double getal1 = int32.parse(textbox1.text); double getal2 = int32.parse(textbox2.text); double volume = 0.002405281875; double volume1 = 0; int dichtheidpla = int32.parse("1,24"); if (combobox1.text == "pla") { //volume berekenen volume1 = volume * getal1; v.text = volume1.tostring("n2"); //gewicht berekenen int volumeberekend = convert.toint32(volume1); gewicht1.text = volumeberekend * dichtheidpla; } else if (combobox1.text == "abs") { } } } when want calculate gewicht1 error shows me: cannot implicitly convert type 'int' 'string'. there red line under 'volumeberekend * dichtheidpla'. gewicht1.text

ajax - The right way to send some data alongside with form -

i have page of user oders, displayed products in cart , form fields like: address , mobile number etc. catch submit jquery, , need send next data server: form , dictionary {id_of_product:choosen_ammount} . need send dictionary, because check whether there such ammount of product user choose. if not, send error. use ajax. send data looks: data = { form : $(this).serialize(), products: somedict } in django next: from urlparse import parse_qs form = parse_qs(request.post['form']) if request.post: order_form = orderform(data=form) but faced problem: saves not correct data database. example saves text string like: [u'\xd0\x9a\xd0\xb8\xd1\x97\xd0\xb2'] . tried check returns order_form.cleaned_data['address_city'] , returns same. so, how solve problem? use django's querydict . from django.http import querydict # encode form data byte string. form_data = querydict(request.post['form'].e

mysql - Php does not execute sql query and time out -

i'm trying delete rows of 'occupation_data' (table) there foreign constraint, did small php script delete data linked in others tables , after delete in occupation_data. when run script see loading in browser nothing appear, tools should use debug this? thank you goldiman here code: <?php error_reporting(e_all); set_time_limit(60000); // there more 30 tables , 380 primary key delete, may take time ini_set("display_errors", 1); $tupleasup = array( '13-1199.05', '13-1023.00', '13-1022.00', '53-6031.00' ); //contain primary key of row $table = array( 'abilities', 'education_training_experience', 'green_occupations', 'occupation_data' ); try { $valeur_hote = '**********'; $valeur_port = '******'; $valeur_nom_bd = '********'; $valeur_user = '*******'; $valeur_mot_de_passe

Laravel Form Request Validation Error Issue -

i'm using form request validation (laravel 5) validate input. validates form, when doesn't through validation laravel should return automatically in-built error. stays on same page (without refreshing) , without showing error, neither putting input database //controller public function store(storeprojectpostrequest $request) { $input = $request->all(); project::create($input); return redirect::route('projects.index')->with('message', 'project created'); } //request public function rules() { return [ 'name' => 'required|max:15|alpha_num', 'slug' => 'alpha_dash|required|max:10', ]; }

javascript - how to pass the query parameter with the othwerwise function -

given following javascript: $stateprovider .state('search', { url: '/search?query', }) ; $urlrouterprovider.otherwise("search"); when access page base_url?query=x i redirected base_url/search but query parameter gets lost. is there way pass query parameter otherwise function? there a working plunker the ui-router has native solution here. the otherwise not have "url" string, function. check in action in q & a: how not change url when show 404 error page ui-router the code this: $urlrouterprovider.otherwise(function($injector, $location){ var state = $injector.get('$state'); state.go("search", $location.search()); // here { query: ... } return $location.path(); }); the $location.search() give params object, like: { query: ... } . take , redirect state search params... check here

android - Send POST request over Mobile Data -

i developing android app sends , receives data python server hosted in pythonanywhere using http requests , json. the application working perfect via wifi problem occurs when use via mobile data. data coming server requests works post , delete request not appear send or otherwise work. i don't know whether problem is free server untrusted app permissions postrequest.java import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import org.apache.http.httpresponse; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httppost; import org.apache.http.entity.stringentity; import org.apache.http.impl.client.defaulthttpclient; import android.os.asynctask; import android.util.log; public abstract class postrequest extends asynctask<string,void,string> { private static string convertinputstreamtostring(inputstream inputstream) throws ioexception{ bufferedread

java - Problems with detecting mouseClick in a JPanel and preventing circle from painting in JPanel -

Image
my current program lets user move circle around jframe , change color pressing 1 of colors presented in jpanel @ bottom of jframe. my code: import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jbutton; import javax.swing.border.border; import javax.swing.borderfactory; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; import java.awt.color; import java.awt.graphics; import java.awt.flowlayout; import java.awt.borderlayout; import java.awt.gridlayout; public class sixthprogram { public static void main(string[] args) { gui prog=new gui("sixthprogram"); prog.setbounds(350,250,500,250); prog.setvisible(true); } } class gui extends jframe implements mouselistener, mousemotionlistener { jbutton button; jpanel colorpan, color1, color2, color3 ,color4 ,color5; color color=color.black; int x=3,y=30; public gui(string header) {

android - Espresso How to access views without using R.id.viewid as we do in robotium? -

i switching robotium espresso, writing tests using apk , dont have access code. in robotium using solo.getview("view-id") can access view not geting how in espresso? espresso witid() method needs r.id.viewid dont have access. public class aaespressotest { private static final string launcher_activity_full_classname = "com.tri.re.cordactivity"; private static class<?> launcheractivityclass; static { try { launcheractivityclass = class.forname(launcher_activity_full_classname); } catch (classnotfoundexception e) { throw new runtimeexception(e); } } @rule public activitytestrule<?> mactivityrule = new activitytestrule(launcheractivityclass); @test public void testhello() throws exception{ onview(withtext("browse older recordings")).perform(click()); //id not accessible shows red onview(withid(r.id.button)).perform(click()); } } you can use helper function id: private static int geti

Difference in dates in SAS by group -

consider data set test in following form: group date 1 05jan2014 1 08jan2014 1 14jan2014 2 05jan2013 2 10feb2015 2 27feb2015 i want calculate difference in dates based on group. code below takes difference between every 2 dates: data test; datediff = dif(date); run; how take difference between dates in 1 group? moreover, there way take difference between last , first dates in each group? starting this: data test; datediff = dif(date); run; let's address isues 1 @ time. first, adding set statement , by statement, can add first , last allow determine in group. assumes it's sorted by group . data test2; set test; group; datediff=dif(date); run; this doesn't work differently (assuming had set statement originally, anyway). now, have new options. first, while can use dif , recommend retain method this. can more see it's doing, , avoid common pitfalls: particularly, lag ,

HTML+CSS template, please explain -

can explain how create html+css template responsive. in image. mby generator or something. don't know css or html. need template list in summer. http://postimg.org/image/70vjuu013/ p.s. - grey sidebars backgroung image. thanks help, gurkis. learning html , css long process, has pass on experimenting, failing, trying, searching ... i don't recommand links, should tutorial, trying quite simple , should take few hours. don't think make sense use give working solution if not understand how use :d i liked open classroom html5 css3 tutorial because free , quite accessible 1 more time, there many alternative feel free google such ressource. you love @ beginning, hate because of limitation, pass , love again luck , don't loose faith :d

ios - UIActivityViewController Not Showing Facebook if Facebook App Installed -

Image
i having issue uiactivityviewcontroller on apps since updated ios 8.3. twitter, mail, , messages displays fine, facebook not there. have checked code ensure didn't accidentally list in excluded activity, , made sure signed in on facebook within phone settings. can verify works on simulator, not in phone. ideas may going on here? update somehow, related facebook app itself. if remove facebook iphone, option share via facebook comes back. if reinstall facebook app, can no longer share facebook. ideas why doing it? -(ibaction) invite { nscalendar* gregorian = [[[nscalendar alloc] initwithcalendaridentifier: nsgregoriancalendar] autorelease]; nsdatecomponents* thedatecomponents = [gregorian components: nsweekdaycalendarunit fromdate: [nsdate date]]; nsinteger weekday = thedatecomponents.weekday; if ( weekday == 1 || weekday >= 5 ) { nsstring *invitation = @"join me @ fritch church of christ sunday! bible class @9:45am worship @10:45am &

regex - How to get rid of weird characters in python string? -

Image
i have lines contains pesky control characters: when tried read file , str.replace() , these control characters didn't replaced. i've tried it's still sticking around. with io.open('infile', 'r', encoding='utf8') fin: line in fin: line = line.replace(u'\u0094', '"').replace(u'\u0093', '"').replace(u'\u0092', "'").replace(u'\u0096', '"').replace(u'\u0084', '"') how these strings replaces? there cannonical way replace these strings (they quotation marks / whitespaces of various kind)? what these characters anyway? u'\u0084' ? last time had problem, happened because getting characters outside ascii range, had wrong bounds.

c# - Identity creates additional foreign key without relationship -

i've implemented identity 2.0 in app unable logins , claims tie in application user class. i'm using following generate tables (and keys): modelbuilder.entity<applicationuser>().totable("user"); modelbuilder.entity<applicationuser>().property(p => p.id).hascolumnname("userid"); modelbuilder.entity<identityuserlogin>().totable("userlogin"); modelbuilder.entity<identityuserlogin>().haskey<string>(l => l.userid); modelbuilder.entity<identityuserclaim>().totable("userclaim"); modelbuilder.entity<identityuserclaim>().haskey<int>(l => l.id); modelbuilder.entity<identityrole>().totable("role"); modelbuilder.entity<identityrole>().haskey<string>(r => r.id); modelbuilder.entity<identityuserrole>().totable("userrole"); modelbuilder.entity<identityuserrole

qt creator - Change radio button text color in Qt -

i have tried stylesheet, html format , palette change color of radio button white did not work. is there way change ? in documantation of qradiobutton there no function text color. that sound strange. both qtcreator , qtdesigner setting stylesheet property of qradiobutton to color: white; background-color: red; give qradiobutton white text on red background (if understand question)

javascript - Minimize only one Webpack chunk -

i want minimize javascript code production. don't want minimize vendors' code because have minimize version. my current webpack.config.js splits output code in 2 chunks. module.exports = { entry: { vendor: ['jquery','angular'], app: ['./client/app.start.js'] }, output: { filename: 'bundle.js', path: __dirname }, resolve : { alias : { 'angular' : 'angular/angular.min.js', 'jquery' : 'jquery/dist/jquery.min.js' } }, plugins: [ new webpack.optimize.commonschunkplugin("vendor", "vendor.bundle.js"), new webpack.optimize.uglifyjsplugin({minimize: true}) ] } when run >> webpack, both chunks ("bundle.js" , "vendor.bundle.js") minimized. how can configure webpack minimize "bundle.js"? thanks usually, have different configs (on

Add a one day to datetime field in mysql table -

i need update , add 1 day dates have in bse data, table carts , ocurred rows choi_id = 1030; carts - id - name - choi_id; - inserted i tried for: update carts set inserted = inserted + 1 choi_id = 1030; you try this: update carts set `inserted` = date_add(`inserted` , interval 1 day) `choi_id` = 1030; the date_add mysql function adds specified time interval date, seconds, minutes, months, years, etc... input datetime field, not integer +1 not working that. see here doc: date_add

android - Social Network Plugin doesn't login -

i use socialnetwork plugin android prime31 (here) in project facebook. if use demo scene - work good. if in single window create 3 buttons (init, login, share) work good. if use facebookandroid.init() in first update (or awake or start ) , login in window of game - after login fb window session isn't valid , can't share anything. list of facebook controller: public class facebookcontroller : monobehaviour { public static facebookcontroller instance; void awake () { instance = this; } private bool isfirst = true; void update () { if (isfirst) { isfirst = false; #if unity_android facebookandroid.init(); #endif } } public void login() { #if unity_android var permissions = new string[] { "publish_actions", "publish_stream" }; facebookandroid.setsessionloginbehavior(facebooksessionloginbehavior.suppress_sso); facebookandroid.loginwithpu

swing - Java GUI to accept only certain names -

i'm working on gui enter name , tells whether or not has been accepted. if names "john" or "jane" entered "verified" message or "unverified" message if type other name. here's have far, unsure how add if statement detecting names. thanks. nameprompt.java import java.awt.borderlayout; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jtextfield; public class nameprompt extends jframe{ private static final long serialversionuid = 1l; string name; public nameprompt(){ setlayout(new borderlayout()); jlabel enteryourname = new jlabel("enter name here:"); jtextfield textboxtoentername = new jtextfield(21); jpanel paneltop = new jpanel(); paneltop.add(enteryourname); paneltop.add(textboxtoentername); jbutton submit = new jbutton("submit"); submit.addactionlis

google spreadsheet - Using ARRAYFORMULA with COUNTIFS? -

i wondering if there way not have manually drag equation out across whole spreadsheet. currently, have in cell: =countifs(actorsofmovies, $k2,helpercolumns,l$1) actorsofmovies , helpercolumns both 291x3 arrays. right dragging formula b2 s32 in final_chart spreadsheet. wondering if there way using arrayformula so not have drag it? here document: https://docs.google.com/spreadsheets/d/1ilfbnxwioh4psz-6yfxpqhgukry8ag5-m3wybofbhzu/edit?usp=sharing in spreadsheet shared, on new sheet (tab), try formula (making use of helper column created on sheet "question_3": =query(arrayformula({transpose(split(concatenate(moviestats_med!e2:g&char(10)),char(10))),transpose(split(concatenate(rept(moviestats_med!d2:d&char(9), 3)),char(9)))&{"",""}}), "select col1, count(col2) col1 matches '"&join("|", question_3!f2:f)&"' , col2<>'' group col1 pivot col3") if want same result, wit

Bind rails server to 127.0.0.1 by default -

i'd bind rails server 127.0.0.1, instead of 0.0.0.0 not accessible when i'm working coffee shops. is there configuration file can specify option don't have pass command line switch: rails server -b 127.0.0.1 ? if searching rails 5 : answer in rails ~> 4.0 can customize boot section of server class: in /config/boot.rb add lines: require 'rails/commands/server' module rails class server def default_options super.merge({port: 10524, host: '127.0.0.1'}) end end end as answered on questions: how change rails 3 server default port in develoment? how change default binding ip of rails 4.2 development server?

sql - How do I know which table is left and right mysql -

i know first select query left table, still confused when use right , left join: ex: select chann.name investments inv right join channels chann on chann.id = inv.channel_id; select chann.name channels chann left join investments inv on chann.id = inv.channel_id; they both return same result, why in first query used right , why left on second one, have foreign key something? thanks in example both query same, because when change right left change tables order. simple understanding this, consider follow example: select a.* table1 left join table2 b on a.key=b.key in case, left join means records table1, because table in left. if use right means records table 2

NSIS. Force quit installer -

i defined custom abort functio , want quit installer in it. !define mui_abortwarning !define mui_customfunction_abort customonuserabort function customonuserabort quit (or abort) #no matter functionend also have custom page executes long live procedures in background in mycustomleave (when leaving page) function function mycustomleave showwindow $undertoplabel 0 showwindow $undertoplabel2 1 enablewindow $customnext.button 0 enablewindow $radio1 0 enablewindow $radio_label1 0 enablewindow $radio2 0 enablewindow $radio_label2 0 showwindow $group1 ${sw_hide} ${nsd_lv_getcheckstate} $group1 $unpackindex $checkbox_stateunpackindex ${nsd_lv_getcheckstate} $group1 $hpindex $checkbox_statesetuphomepage ${if} $checkbox_statesetuphomepage == 1 strcpy $changehomepage 1 ${else} strcpy $changehomepage 0 ${endif} ${nsd_lv_getcheckstate} $group1 $searchindex $checkbox_statesetupsearch ${if} $checkbox_

sql - Update with Priority -

here request: update top (1) innerportal.feedback.queuefeedback set busy = 1, busyby = @uid output inserted.* ( accountcode = @account , (done null or done = 0) , (busy null or busy = 0) , ((datepart(hour, dateadd(hour, utc, @utcnow)) >= 9 ) , (datepart(hour, dateadd(hour, utc, @utcnow)) <= 20)) ) it gets first founded "non busy" record key field accountcode . if record not found request returns nothing. next have ordered list of accountcode , target release special logic: need create loop in request. first accountcode list , try update. if success - stop , return output inserted.* if update not successful request second entry accounts list , try update again. if loop on , nothing updated - output inserted.* returns nothing (like now). possible release in single request? thanks! update top (1) innerportal.feedback.queuefeedback set busy = 1, busyby = @uid output inserted.* innerportal.f

php - Convert unicode to characters -

i try build tagging system in vbulletin forum , works fine. but have 1 problem in quick edit of post (using ajax). if write characters in hebrew, replace characters in unicode. example write in post: חחחחח לא?test!! this makes this: %u05d7%u05d7%u05d7%u05d7%u05d7 %u05dc%u05d0?test!! it looks though deprecated javascipt function escape() being used encode string. if you're echoing out in webpage via javascript, use unescape() - see this fiddle . mentioned above however, deprecated. the functions should instead used encodeuricomponent() in place of escape() , , decodeuricomponent() in place of unescape() . then, can use urldecode() inside php result want, if necessary step. given current setup, convert unicode characters html entities appropriate rendering in browser, following should want: $str = preg_replace_callback('/%u([0-9a-fa-f]{4})/', function ($match) { return mb_convert_encoding(pack('h*', $match[1]), 'html-entit

javascript - Best way to make Jaws read a page element -

i'm trying change content of iframe in webpage , want jaws screen reader read content. for this, have used jquery("#vn_space").focus(); but doesn't seems work in browsers. ie9, jaws not reading links 'links' , in ff not reading iframe content @ all. what should make jaws read changed content? have try using attribute tabindex in html? may worthwhile give aria-label , role try see if issue.

.htaccess - PHP Slim API 404 not found -

i'm trying create api using php , php slim. my folder structure: api: app -> app.js libs -> slim v1 -> .htaccess , index.php htaccess rewriteengine on rewritecond %{request_filename} !-f rewriterule ^(.*)$ %{env:base}index.php [qsa,l] index.php require '.././libs/slim/slim.php'; \slim\slim::registerautoloader(); $app = new \slim\slim(); $app = \slim\slim::getinstance(); $app->get('/orderoverview/:customerid', function ($customerid) { echo "hello " . $customerid; }); $app->run(); this should easy every time go http://localhost/api/v1/orderoverview/2 404 page not found. but when go http://localhost/api/v1/index.php/orderoverview/2 result want become! any remarks or solutions? you need add rewritebase htaccess. noticed don't have grouping, assume placing in subdirectory of /api/v1 rewritebase /localsites/serf/weap/api/v1

Connect to Amazon AWS with GFTP (SSH uses key authentication .pem) -

how connect amazon aws , use key.pem file authentication? gftp doesn't have option authenticating through file. similar question on ubuntuforums " how can use gftp connect ssh server uses key authentication " answers users of filezilla instead of gftp. you need open gftp , go "options" -> "ssh" -> "extra parameters ssh" , add -i /home/user/aws_keypair.pem

Can I generate a Preview for a Google Drive (custom Realtime) file for use in Drive? -

how generate preview of documents saved in google drive? asks same question this. however... the answer 'no' its old question , google drive sdk has changed lot since then. it doesn't (explicitly) relate realtime files. i have found nothing in google's documentation. so reasonable question: can generate preview of custom realtime file google show when "preview" selected right-click menu in drive? show option edit file using app, it's ugly , discouraging screen user find looking at. (and if method in way use thumbnail, when , how should generated , passed? note, client-side.) there no built in support in realtime api, should act other shortcut file. believe right answer thumbnails. see uploading thumbnails here: https://developers.google.com/drive/web/file

Properly passing values between windows c# wpf without binding -

i have window window1 window1 posta= new window1(); posta.showdialog(); i proceed work variables in posta . return resulting variables / entire method mainwindow . know have global variables in posta , retrieve them trough if(posta.dialogresult()==true){ int wantedvalue = posta.varresult; // varresult being global variable of window1 }; but seems bad , inefficient approach. tried following having button in window1 called mybutton window1 posta= new window1(); posta.mybutton.mouserightbuttondown += mybutton_rmbdown; posta.showdialog(); public void mybutton_rmbdown(object sender, mousebuttoneventargs e){ // can access mainwindow variables cant window1 variables } would 1 kind help? edit: without use of databinding if follow mvvm approach, create viewmodel, invoke dialog setting it's datacontext property viewmodel query viewmodel instance after showdialog completes. dialog view bind view model via xaml window1 posta = new window1(); var viewm

ms dos - How to list files in particular order using command prompt? -

i need list file of folder in below pattern [filename] [size in gb] [date] (eg: 29 apr) [time](eg: 02:08) using command prompt. if need use properties sorting criteria, , don't need output formatted in particular way, dir /o:nsd work. more information, type dir /? .

javascript - Jssor slider does not start automatically -

Image
here code; slider not start automatically: <div id="slider" style="position: relative; margin: 0px; top: 0px; left: 0px; width: 100%; height: 300px; overflow: hidden;"> <div u="slides" style="cursor: default; width: 960px; height: 300px;overflow: hidden;"> i think because of width=100% in parent div. when change width 960px i.e. px value ( width=960px ) works fine width reduces. screenshot reference edit: http://pixelcreations.in/parking/ link reference autoplay set true error in console when width set 100% uncaught error: cannot scale jssor slider, 'width' of 'outer container' not specified. please specify 'width' in pixel. e.g. 'width: 600px;' jssor.slider.js:1952 uncaught typeerror: cannot read property '$enableplayer' of undefined you setting width of slider 70% of available width. //calculate slider width 70% of available width var slide

java - Fill Form in Play Framework (Scala) -

i'm making checkboxes , using scala, found nice example in java. couldn't convert scala. java code: form<studentformdata> formdata = form.form(studentformdata.class).fill(studentdata); scala's play.api.data.form class doesn't have "fill" , "form" methods java's play.data.form. how can create form in scala? here function use data form , generate object location. def add = dbaction { implicit rs => val data = locationform.form.bindfromrequest.get locations.create(some(data.venuename), data.lat, data.lon) redirect(routes.locationcontroller.all) }

How can I associate an SSL certificate with Bluemix custom domains? -

when try upload ssl certificate bluemix custom domain, receive error message: bxnui2072e: intended host name, *.<custom_domain>, not subject within certificate. how can go getting certificate uploaded , avoid error? thanks! i learned problem here due certificate using, single, specific domain. bluemix supports wildcard certificates, that's key point. i got around replacing single domain certificate wildcard certificate. to generate wildcard certificate, needed specify wildcard domain adding asterisk (*) , period (.) in front of custom domain name. in example follows used openssl generate self-signed wildcard certificate. i've generalized example specify wildcard domain common name field. common name (e.g. server fqdn or name) []:*.<custom_domain> i tested , succesfully got work both self-signed certificate , certificate signed certificate authority.

search - Elasticsearch Completion Suggester field contains comma separated values -

i have field contains comma separated values want perform suggestion on. { "description" : "breakfast,sandwich,maker" } is possible applicable token while performing suggest type?? ex: when break , how can breakfast , not breakfast,sandwich,maker ? i have tried using commatokenizer seems not help as said in documentation , can provide multiple possible inputs indexing this: curl -x put 'localhost:9200/music/song/1?refresh=true' -d '{ "description" : "breakfast,sandwich,maker", "suggest" : { "input": [ "breakfast", "sandwitch", "maker" ], "output": "breakfast,sandwich,maker" } }' this way, suggest word of list input. obtaining corresponding word suggestion elasticsearch not possible workaround use tokenizer outside elasticsearch split suggested string , choose 1 has input prefix. edit: bett

javascript - jExpand.js Expandable tables -

in head have these files only: <script src="expand.js"></script> <link href="style.css" rel="stylesheet" /> ... expand.js has got inside: (function ($) { $.fn.jexpand = function () { var element = this; $(element).find("tr:odd").addclass("odd"); $(element).find("tr:not(.odd)").hide(); $(element).find("tr:first-child").show(); $(element).find("tr.odd").click(function () { $(this).next("tr").toggle(); }); } })(jquery); and css file has got styles table: #example_table { border-collapse: collapse; font-family: "lucida sans unicode","lucida grande",sans-serif; font-size: 12px; margin: 20px; text-align: left; width: 100%; } #example_table th { color: #339; font-size: 15px; font-weight: normal; padding: 12px; } #example_table td { background-color: #e8e8e8; bord

perl - Check specific value not in array -

i have array 2 values , need perform operations if input not in array. i tried like if ($a ne ('value1' || 'value2') if (($a ne 'value1' ) || ($a ne 'value2' )) both methods didn't work. can please help? you use none function list::moreutils . if have array subject line says code this use list::moreutils 'none'; if ( none { $_ eq $a } @array ) { # stuff } or if have 2 constants use this if ( none { $_ eq $a } 'value1', 'value2' ) { # stuff } but in case prefer see just if ( $a ne 'value1' , $a ne 'value2' ) { # stuff }

ios - else if expected expression c++ / Xcode -

i have seen problem around forum have not been able fix issue. after "else if" xcode can't compile, tells me "parse issue" , requieres "expected expression". i know beginner's question want understand wrong code, why keeps telling me expected expression after each esle if... if (typestrat == 1) { cout << "quel est le prix d'exercice du long call ?" << endl; cin >> k1; cout << "quel est le prix d'exercice du long put ?" << endl; cin >> k2; cout << "prix de la stratégie " << (bsprixcall(s,k,t,r,v) + bsprixput(s,k,t,r,v)) << endl; cout << "delta " << (bsdeltacall(s,k,t,r,v) + bsdeltaput(s,k,t,r,v)) << endl; cout << "vega " << (2*bsvega(s,k,t,r,v)) << endl; cout << "rho " << (bsrhocall(s,k,t,r,v)

angularjs - two way data binding between ng-model and directive -

case : i trying watch change of select list through directive add html based on selected value reason unable watch change in link function . idea ? thanks html <select ng-model="selected" ng-options="item item.type item in itemslist"></select> <d-input type="selected.type"></d-input> js app.directive('dinput', function($compile) { return { restrict: 'e', scope : { type : '=', } , template : '<div></div>', link : function (scope, element, attrs) { scope.$watch(scope.type, function() { var tmplt = '' ; if (scope.type == 'input') tmplt = '<input type ="text" name="inputname" value="0">'; if (scope.type== 'select') tmplt = '<select ><option> option1</option&g

python - Tell PyCharm code generated fields of class -

as minimal case have class example works in abstract capacity range of other classes. class example(object): def __init__(self, **kwargs): key, value in kwargs.items(): setattr(self, key, value) class test(example): def __init__(self, foo='bar'): super(test, self).__init__(foo=foo) in real case, example more things. is there way on test inform pycharm test have 1 field test.foo , better, let know foo expected string? to clear, consider delegating setting of fields example test not possible. the closest i've gotten @ivar of epydoc, can't work as others have mentioned, can't. however, can tell pycharm accept missing attributes @dynamicattrs : class example(object): """ @dynamicattrs """ def __init__(self, **kwargs): key, value in kwargs.items(): setattr(self, key, value) update: if python3.5 option, see this question using typ

configuration - How to get the checkout directory of project dependencies in TeamCity? -

i using teamcity build server , have little trouble when configuring projects , dependencies. eventually want checkout directory of project dependencies configure build steps. have variable %teamcity.build.checkoutdir% checkout directory of project itself. however, did not find %dep.<dependencyid>.teamcity.build.checkoutdir% . is there way checkout directory of dependency? you can add parameter (say checkoutdir ) in first build value equal %teamcity.build.checkoutdir% . can fetch value in dependent build (either through snapshot or artefact dependency)

spring - What is passed from parameter userId in SocialUserDetailsService? and how to override it? -

i'm trying use spring social authentication , fetch user according facebook user id stored in user entity. to i'm doing this. @component("socialuserdetailsservice") public class secsocialuserdetailservice implements socialuserdetailsservice { @autowired private secuserdetailsservice userdetailsservice; @override public socialuserdetails loaduserbyuserid(string userid) throws usernamenotfoundexception, dataaccessexception { return userdetailsservice.loaduserbyfacebookid(userid); } } but i have no idea passed in userid parameter facebook profile? if need override value email of facebook profile. how can it?

c - How to get ELF executable binaries in Android 5.0 ART -

we working on elf mining. unable find path of elf executable in android 5.0 art architecture. found .so , .oat files via xplore, these not elf executable binaries. more detail: after android 4.4.4 dalvik vm replaced art. in android 5.0 dvm's app's dex code converted odex executed. in art converted elf executable code. i working on malware detection software works mining elf files cluster patterns of anomalies. art works on aot compilation executable binary file (elf) should exist against each app in internal storage. my question: want know path of elf file of apps or method obtain elf .apk or .dex file.

angularjs - using resolve in app.config -

i'm using angularjs's resolve in config load values needed controller, before controller loaded. code i'm using test logic (function () { "use strict"; var app = angular.module("lab1app", ["ngroute"]); app.config(["$routeprovider", function ($routeprovider) { $routeprovider.when("/", { templateurl: "/views/view1.html" }).when("/view2", { templateurl: "views/view2.html", controller: "secondcontroller", resolve: { name: ["dropdownservice", function (dropdownsvc) { return dropdownsvc.loadname(5); }] } }).otherwise({ template: "don't have routes associated this" }); }]); app.controller("maincontroller", [ "$scope", function ($scope) { }]); app.controller

angularjs - Using ngCordova plugins without calling them in app.js? -

my app looking good, ionic. core info there , i'm adding frills - email, sharing, media (one of functions metronome) , on. i can't plugins work. i've had success previous ionic app plugins called within .run(function($ionicplatform) { $ionicplatform.ready(function() { } } and indeed statusbar plugin seems working fine , called within there. i'm using side menu starter tabs built in btw. my issue, suppose, i've 3 controller files. main_ctrls.js - main app menu_ctrls.js - menu pages feedback , email, analytics extras_ctrls.js - "extra" section metronome , on. i've put 'ngcordova' dependency in each module , called plugin within controller ready function. here email controller. angular.module('menu.controllers', ['ngcordova']) .controller('feedctrl', function($ionicplatform, $scope, $cordovaemailcomposer) { $ionicplatform.ready(function() { $cordovaemailcomposer.isavailable().then(function