Posts

Showing posts from April, 2012

c# - IndexOf find no element in a List<> while Mock -

i have list of object below public class person { public string name {get; set;} public int age {get; set;} } public class someclass { public int dosomething () { int result; list<person> personlist = new list<person>(); personlist.add(new person { //with 1 object, keep simple name = "someone", age = 18}); person eighteenyearsold = _checkage.findeighteenyearsold (personlist); int index = personlist.indexof (eighteenyearsold); //do return result; } } [testmethod] public void dosomething_test() { //given: //when: call someclass object person eightnneyears = new person { name = "someone", age = 18}; _mockcheckage.setup (x => x.findeighteenyearsold(it.isany<list<person>>())).returns(eightnneyears); _someclass = new someclass (_mockcheckage.object); int result = _someclass.dosomething(); //then: } as have mocked findeighteenyearsold method returns perso...

How to use Microsoft Dynamics CRM in soup UI -

i new microsoft dynamics crm. trying connect demo account through rest api using soup ui. every time getting authorization failed error( error code 401). how should pass login credentials in http header. not using sdk, making rest api call. please me in this. if question broad please let me know. update question. regards not sure how soup ui works sounds need provide login credentials. the msdn has c# sharp example. private httpclient getnewhttpclient(string username,string password,string domainname, string webapibaseaddress) { httpclient client = new httpclient(new httpclienthandler() { credentials = new networkcredential(username, password, domainname) }); client.baseaddress = new uri(webapibaseaddress); client.timeout = new timespan(0, 2, 0); return client; } can u tell me should use argument domainname this depends on type of crm setup (online, on-premise, ifd) trying connect to. have @ this , this demonstrates various connection s...

yii - i want to show data on form fields using id with ajax -

how use ajax in yii show result against id?? public function actionview(){ $model= new viewform(); $model->unsetattributes(); if (isset($_get['viewjob'])) { $model->attributes = $_get['viewjob']; } $this->render('viewjob',array( 'model'=>$model )); } please clarify question.. if looking how use ajax in yii might u. http://www.yiiframework.com/wiki/394/javascript-and-ajax-with-yii/ http://www.yiiframework.com/wiki/49/update-content-in-ajax-with-renderpartial/ http://www.yiiframework.com/wiki/388/ajax-form-submiting-in-yii/

c# - Access listbox from another class? -

hey guys made class when user selects item listbox uninstalls item, except problem can't access list box. tried public aswell, in code of form1.cs thing clostest list box keep in mind name of listbox programslistbox ok guys re edited post; private void button1_click(object sender, eventargs e) { if(programslistbox.selectedindex == -1) { messagebox.show("please select item uninstall!"); } else { programslistbox_selectedindexchanged("",eventargs.empty); } } this code form1.cs class, , have class called uninstallitem.cs want code be, below other class namespace pc_tech_registery_cleaner { class uninstallitem { public void uninstallselecteditem() { form1 c = new form1(); } } } and below still in form1.cs class, experimenting : public void programslistbox_selectedindexchanged(object sender, eventargs e) { //this access uni...

ruby on rails - Change Checkbox return values -

i designing search page in rails using ransack , need check boxes. i have several check boxes. here 1 of them. <%= f.check_box :if_bt_eq %>bt i know when check box ticked returns 1 , 0 when not ticked. is there way in can change non-ticked return value nil ? if not, can suggest sort of alternative this? thanks! update: here's hashes passed when search form submit button clicked: with check box ticked: ...q%5bif_bt_eq%5d=1&... with check box not ticked: ...q%5bif_bt_eq%5d=0&... i want check box not ticked be ...q%5bif_bt_eq%5d=&...

permissions - Android 6 - Writing to external storage fails ON FIRST RUN ONLY -

i know question asked several times problem different. need write data external storage. know need ask permissions @ runtime on android 6 . works fine far. 1 thing weird. granted permission seems work the second time start app . my example looks this: @override public void onrequestpermissionsresult(int requestcode, string[] permissions, int[] grantresults) { super.onrequestpermissionsresult(requestcode, permissions, grantresults); switch (requestcode) { case request_write_storage: { if (grantresults.length > 0 && grantresults[0] == packagemanager.permission_granted) { log.d(tag, "permission granted!"); write(); } else { log.d(tag, "no permission granted!"); } } } } @override public void onclick(view v) { boolean haspermission = (contextcompat.checkselfpermission(this,...

Parsing DateTime to Universal Time C# -

i have xml can return time in format (7/23/2013 4:00pm) question is: how can explain datetime.parseexact i'm in "am" or in "pm"? have piece of code, returns me exception (string can not parsed) i alredy placed example string (7/23/2013 4:00pm) in replace "pm" empty chain "". string pattern = "mm/dd/yyyy h:mm 'utc' zzz"; datetime time = datetime.parseexact(sb.tostring(), pattern, cultureinfo.invariantculture, datetimestyles.assumeuniversal | datetimestyles.adjusttouniversal); thank :) you can pass array cover various formats. use following various time inputs. var formats = new[] { "m/dd/yyyy hh:mm tt", "m/dd/yyyy hh:mmtt", "m/dd/yyyy h:mm tt", "m/dd/yyyy h:mmtt", "m/dd/yyyy hhtt", "m/dd/yyyy...

Error when setting foreign key in SQL Server -

i have following queries run create tables in ms sql server: create table menus ( menu_id int not null primary key, menu_name char, other_details char ) create table bookings ( booking_id int not null primary key, date_booked date, date_of_booking date, other_details char, staff_id int foreign key references staff(staff_id), customer_id int foreign key references customers(customer_id) ) create table menus_booked ( menu_id int not null, booking_id int not null, constraint pk_menus_booked primary key(menu_id,booking_id), foreign key (menu_id) references menus(menu_id), foreign key (booking_id) references bookings(booking_id) ) create table menu_changes ( change_id int not null primary key, menu_id int not null, booking_id int not null, change_details char, foreign key (menu_id) references menus_booked(menu_id), foreign key (booking_id) references menus_booked(booking_id) ) on running last query error: there no primary or candidate ...

c - How should i limit the number of characters interpretted by fscanf? -

i'm writing program read stdin , writes reads stdout , unescaping escaped hex numbers finds. numbers want read 8 bit. have far while((c = fgetc(stdin)) != eof) { if(c == '%') { fscanf(stdin,"%x",&r); printf("%i \n",r); } } this works fine, except fact when write %fff standard input reads 3 digit hex number. how should limit fscanf reading 2 characters? have thought reading next 2 characters buffer , sscanf'ing that, feels rather inelegant me. if want scanf (et al) read 2 characters, tell so: scanf("%2x", &r); see e.g. this reference information scanf formatting.

css - Responsively moving text inside of a div -

my question quite simple i've been struggling quite time. https://jsfiddle.net/txzk0ffm/ body { width:100%; } h1{ margin:0; } .box-wrap { width:70%; background:red; height:350px; } .text-wrap { width:35%; position:relative; top:25%; background:rgba(0,0,0,.5); } <div class="box-wrap"style="background:red url(http://www.saadiyat.ae/admin/content/banner-img-3.jpg) 50% 50% no-repeat;"> <div class="img-wrap" > <div class="text-wrap"> <h1> random text </h1> </div> </div> </div> how move box text use of % using things top:50%; bottom:30%; etc. i tried use position relative, nothing seems happening parent height auto , can't use percentage vertical mesurment inside of it. you need add .img-wrap { height: 100%; } to solve problem: h1{ margin:0; } .box-wrap { width:70%; ...

Google compute machine HAXM install -

Image
i have google virtual server ( microsoft windows server 2012 ) , run avd x86 processor setting . need install haxm when want install error message. haxm install error message: could me how can install haxm on google virtual server? sorry, nested virtualization (specifically, exposure of virtualized vt-x support, haxm looking for) not supported on google compute engine. unfortunately not mentioned anywhere in our documentation see, in fact true. a similar question answered here: does google cloud services support nested virtual machines?

matrix - Eigen: Problems using setFromTriplets() -

i have file in format: 3 5 1 1 1.0 1 3 2.0 2 1 3.0 2 2 4.0 3 3 5.0 10.0 20.0 30.0 where first 2 integers n=3 (dimension of system) , nz=5 (number of non-zero elements) have nz- lines i,j, a(i,j) , n-lines vector b. largest file has n>100000, necessary use sparse matrix. perfect use triplets ( http://eigen.tuxfamily.org/dox/tutorial ... rsefilling) , try this, return error. i post code: #include <eigen/sparse> #include <fstream> #include <iostream> typedef eigen::sparsematrix<double> spmat; typedef eigen::triplet<double> t; using namespace std; int main() { double val; int n, nz, i, j; vector<t> tripletlist; ifstream myfile ("file.dat"); if (myfile.is_open()) { myfile >> n; myfile >> nz; tripletlist.reserve(nz); int index = 0; while (index < nz) { myfile >> i; myfile >> j; myfile >> val; //cout << i-1 << ' '<< j-1 << ' ' ...

javascript - IBM BPM how to handle keypress events in Coach Views -

i familiar html, css , javascript , have written small apps using angular , ionic. now working ibm bpm coach views , tries make simple coach view input field (bound string variable) , button. i have button disabled (in bpm language: read only) long field empty, when user starts type in field, button should become enabled. have bound visibility of button string variable. i have searched around , seems cannot find simple examples of controlling visibility based on keypress events in bpm. all have seen examples dojo components , dijit widgets , bit above head. expect there must (relatively) simple way of doing 20-40 lines of javascript in either “inline javascript” section or in 1 (or more) of “event handlers” on behavior tab in coach view designer in ibm bpm 8.5.6. (it opens in browser window because coach view runs in client side human service). does have such simple example. i suggest following approach. create 1 custom coach view (lets cv1). within cv1 drag...

.htaccess - htaccess redirect to another folder -

i have redirect using htaccess .please me. url :- http://xxx/cckcht/ redirect url :- http://xxx/cckcht/lhc_web/index.php/site_admin/ enable mod_rewrite , .htaccess through httpd.conf , put code in .htaccess under document_root directory: options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /cckcht/ rewriterule (?!^lhc_web/index\.php/site_admin/)^(.*)$ /cckcht/lhc_web/index.php/site_admin/$1 [l,r=301,nc]

javascript - Cannot locate element using recursion after it found it as visible -

Image
my problem: i trying click options in dropdown nightwatch, using sections in page objects. i'm not sure if it's problem section declaration or i'm missing scope-related. problem finds element visible, when tries click throw error cannot locate using recursion. what try fix issue using sections? in test: var mypage = browser.page.searchpageobject(); var mysection = searchpage.section.setresults; // [finding , clicking dropdown opens , displays options] browser.pause (3000); browser.expect.section('@setresults').to.be.visible.before(1000); mypage.myfunction(mysection, '18'); in page object: var searchkeywordcommands = { myfunction: function (section, x) { section.expect.element('@set18').to.be.visible.before(2000); if (x == '18') section.click('@set18'); //[...] }; module.exports = { //[.. other elements , commands..] sections: { setresults: { selector: '.se...

sql - Compare data between two tables with in single database -

my requirement compare 2 table data in 1 database , stored uncommon data in separate table named relation data within same database. how compare tables data? to compare tools , can stored uncommon data in separately table using tool? forgot tell 1 thing 2 tables having same data different column names means example first table having 20 columns , 2 , table having 50 columns in 4 columns matched data different number of rows , different column names in each table.based on these columns data matching need find rows , stored table try query, think work insert relational(r1,r2,r3,....rn) (select s1,s2,s3,...sn information info info.informationcity not in (select customercity customer) , info.informationstate not in (select customerstate customer) )

algorithm - general programming issue on classes -

let's want create movie database software. i need class actor have attribute name, surname, dob, awards, , should have array of "movie" object. i need class movie, have attribute title, duration, year, should have array of "actor" object. represent cast of movie. actor object need list of movie done actor, movie object need list of actors played in it. gets quite messy cause it's class containing 1 , viceversa, compiler stuck. which right way represent situation? in languages concept same. you've observed, can't have "lists of movie objects" embedded in actors , vice versa, instead keep list of each , "reference" other objects in way. might using unique reference value (e.g. incrementing number) can used search other list or associative container (e.g. use key/value "std::map" in c++ rather linked list), or keeping reference or (weak) pointer directly logically linked objects....

java ee - Liferay Service Builder failing -

i'm doing tests on liferay. this, i'm following mvc tutorial, , got stuck in services stuff. i created simple entity testing purposes, "miclase": public class miclase { int id; int num1; string string1; } pretty simple, huh. well, after this, started service builder , created file this, overview pane: <?xml version="1.0" encoding="utf-8"?> <!doctype service-builder public "-//liferay//dtd service builder 6.2.0//en" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd"> <service-builder package-path="asd"> <author>hp</author> <namespace>miservicio</namespace> <entity name="miclase" local-service="true"> <column name="id" type="int"></column> <column name="num1" type="int" primary="false"></column> <column nam...

Execute a Python script post install using distutils / setuptools -

i'm trying add post-install task python distutils described in how extend distutils simple post install script? . task supposed execute python script in installed lib directory . script generates additional python modules installed package requires. my first attempt follows: from distutils.core import setup distutils.command.install import install class post_install(install): def run(self): install.run(self) subprocess import call call(['python', 'scriptname.py'], cwd=self.install_lib + 'packagename') setup( ... cmdclass={'install': post_install}, ) this approach works, far can tell has 2 deficiencies: if user has used python interpreter other 1 picked path , post install script executed different interpreter might cause problem. it's not safe against dry-run etc. might able remedy wrapping in function , calling distutils.cmd.command.execute . how improve solution? there recommended w...

linux - How to store the temperature and corresponding time to a file through Shell? -

my laptop getting heated high temperatures around 60-75 degree celsius. have installed lm_sensors . , have found out few command that.i need generate file following parameters measured @ every 1 minutes. measured value of temperature. can done command sensors >> temperature.txt the time @ temperature has measured. can done date >> temperature.txt the number of running processes ps-aux (but won't give number of processes). i came know task done shell scripts (is ?). can suggest me way have little idea shell scripting? the script like: #!/bin/bash file=/your_home_dir/temp_info temperature=$(sensors | tail -3) when=$(date "+%y%m%d_%h%m%s") working_proc=$(ps -aux | wc -l) echo "$when num_proc: $working_proc" >> $file echo "$temperature" >> $file with output like 20130724_131150 num_proc: xxx temp line1 temp line2 20130724_131250 num_proc: yyy temp line1 temp line2 ... to have calculated every 1 min...

tree - Javascript: Delay drawing on html5 canvas in a loop -

the code use generates picture of tree data structure. if function called adds value tree, searches node new value should attached. done in loop. if correct node found, adds value. after every step, function should draw tree on html5 canvas, node checked (if node attach value) in different color rest of tree. see result, there should delay between drawing 1 step , next. if execute code this, thing see last step, because happens fast. (to more specific, data structure trie tree , added value word. every node letter. if word "cat" exists , add word "care", tree searches root find c, searches find a, searches find nothing , adds r after a, adds e r , adds "end-of-word" node e. don't think can without looping every possible tree.) i have no idea how put settimeout() in there. write delay function myself, stop browser working until delay done? does have idea do? in advance. edit: pseudo thing add function right now. it's not actual code, doe...

core plot - Coreplot annotation clipped -

Image
my annotations clipped 1 can see on picture: i've set custom paddings , set maskstoborder flag: graph.plotareaframe.maskstoborder = no; what should do, not clip annotation or how can frame of annotation move appropriately? thanks. add annotation graph instead of plot. plots , sublayers annotations clipped plot area.

javascript - Undefined Variable When sending via Ajax -

i have form passes forn field values ajx script passes values php , they sent email address. the problem have values not showing , instead word undefined. here ajax code. $(document).ready(function(){ $('form.save').submit(function () { var name = $(this).find('.name').attr('value'); var email = $(this).find('.email').attr('value'); var telephone = $(this).find('.telephone').attr('value'); // ... $.ajax({ type: "post", url: "application.php", data: "name="+ name +"& email="+ email +"& telephone="+ telephone, success: function(){ $('form.save').hide(function(){$('div.success')}); } }); return false; }); }); here form <form action="" method="post" class="save"> <input type="text" name="name" id=...

Python + OpenCV: Enumerate Matrix -

i newbie python. and want access mat (a threshold binary image) element opencv , create histogram according x-axis, , can image segmentation vertically. what have done preprocess image , enumerate twice following. def crack(src): #src binary image src = cv2.resize(src, (0,0), fx=6, fy=6) thresh = preprocessing(src) #create empty histogram print(thresh.shape) height, width = thresh.shape size = height ,255, 3 hist = np.zeros(size, dtype=np.uint8) #enumerate elements y, x in enumerate(thresh): val = 0 x, pix in enumerate(x): val = val+ pix/255 print y,x, val cv2.rectangle(hist, (y, 255-val), (y+val, 255-val+1), (0, 255, 0), 1) cv2.imshow("thresh", thresh) cv2.imshow("hist", hist) and if directly enumerate threshold mat like y, x in enumerate(thresh): i can enumerate outer y axis first enumerate x axis. how can reversely? aim image this: image1 ht...

java - Retrieving the first item from the list and converting it in int -

i have following class shown below public class brokerinvoicelineitem { private int attachmentcount; public int getattachmentcount() { return attachmentcount; } public void setattachmentcount(int attachmentcount) { this.attachmentcount = attachmentcount; } } the named query in xml <sql-query name="attachmentquery"> <![cdata[select count(iilnmp.inv_line_note_id) ioa_inv_line_note_map iilnmp , ioa_invoice_line_notes iiln , ioa_invoice_line iil iilnmp.inv_line_note_id = iiln.id , iiln.inli_id =iil.id , iil.id = ?]]> </sql-query> now below operation doing list @ index 0 retrieving value getting compilation error need cast value stored @ index 0 int type able set please advise how can achieve same query query = session.getnamedquery("attachmentquery"); query.setparameter(0, itrbrokerinvo...

node.js - Facebook Developer Console - App Review -

Image
i submitting app review on facebook developer console. have done required, still telling me need 'test permission in app account listed in roles before can submit review'. i have logged app role have provided. message still appears?

google app engine - Why does BigQuery fail to parse an Avro file that is accepted by avro-tools? -

i'm trying export google cloud datastore data avro files in google cloud storage , load files bigquery. firstly, know big query loads datastore backups. has several disadvantages i'd avoid: backup tool closed source backup tool format undocumented. backup tool format cannot read directly dataflow backup scheduling appengine in (apparently perpetual) alpha. it possible implement own backup handler in appengine, fire , forget. won't know when backup has finished or file name be. with motivation clarified experiment here dataflow pipeline export data avro format: package com.example.dataflow; import com.google.api.services.datastore.datastorev1; import com.google.api.services.datastore.datastorev1.entity; import com.google.cloud.dataflow.sdk.pipeline; import com.google.cloud.dataflow.sdk.coders.avrocoder; import com.google.cloud.dataflow.sdk.io.avroio; import com.google.cloud.dataflow.sdk.io.datastoreio; import com.google.cloud.dataflow.sdk.io.read; import...

mongodb - Mongo new c++ driver error -

when try compile c++ program, error when linking mongodb new c++ driver (mongocxx) there undefined reference. the problem easy reproduce. try compile test example in quickstart guide ( https://github.com/mongodb/mongo-cxx-driver/wiki/quickstart-guide-(new-driver) ). error code: hellomongo.cpp:(.text+0x3f): undefined reference `mongocxx::v_noabi::uri::k_default_uri[abi:cxx11]' i using newest 3.0.1 version of c++ driver. error there 3.0.0. i've replied identical question on mongodb-user list: https://groups.google.com/forum/#!topic/mongodb-user/bqvtonyd9pe

PHP trim function removing last character -

i ran weird issue php trim function. <?php $str = "new multan nagar"; $trimmedstr = trim($str, ' \t\n\r\0\x0b'); var_dump($trimmedstr);// output => string(15) "new multan naga" $str = "new multan nagar"; $trimmedstr = trim($str, " \t\n\r\0\x0b"); var_dump($trimmedstr); // output => string(16) "new multan nagar" ?> second parameter value default value used trim function, difference 1 inside single quotes , other inside double quotes. can explain behavior? php not recognise slash( / ) characters when using single quotes. when wrapped in double quotes seen special characters. so in case single quoted version removing tnrx0b characters.

c# - Conversion failed when converting the varchar value to data type int in SQL Server query Windows Forms -

i add record in database. there code below : private void buttonadd_click(object sender, eventargs e) { con.open(); sqldataadapter sda = new sqldataadapter("insert rdv (iduser,idclient,objet,objectif,daterdv,commentaire)values('"+combobox1.text+"','"+combobox2.text+ "','" + textbox1.text + "','" + textbox2.text + "','" + datetimepicker1.text.tostring() + "','" + textbox4.text + "')", con); sda.selectcommand.executenonquery(); con.close(); messagebox.show("le rdv été ajouté avec succés !"); } but error happens: conversion failed when converting varchar value 'john' data type int. how should convert it? please me. thanks in advance. for information table rdv , problem 2 fields: iduser , idclient . think should: check if combobox1 , combobox2 (namming please) should have value of iduser , idclien...

Powershell command to trim path if ends "\" -

i need trim path if ends "\". c:\ravi\ i need change c:\ravi i have case path not end "\" (then must skip). i tried .endswith("\") . fails when have "\\" instead of "\". is powershell way instead of having conditions. no need overcomplicate "c:\ravi\".trim('\')

How to track when a user views a JIRA issue -

in plugin need track when user views issue using ui. ideally i'd know if opened directly, or viewed in issue navigator detail view. need track , when viewed issue. what's best way this? cheers, oles the straightforward way use servlet filter plugin module , scan requested url corresponding issue views. can distinguish between viewing issue directly , view within issue navigator examining query parameters. alternatively, build web panel plugin module renders no significant ui, invoked when issue viewed. you'd want position web-panel on right side of issue view atl.jira.view.issue.right.context . in either scenario above, can fetch current user injected jiraauthenticationcontext .

mysql - LibreOffice Database: I'm having some trouble with a query, can someone please assist me? -

this query have do: list of how many subjects each academic staff teaching (show first name, last name , number of subjects being taught). these tables , fields provided: (**table**) employees (**fields**) employeeid, firstname, lastname (**table**) approvedunits (**fields**) approvedid, employeeid, unitcode (**table**) units (**fields**) unitcode, unitname i'm not sure how structure query, can please give me pointers on how this? have far: select count(*) approvedunits.employeeid, count(*) employees.firstname, employees.lastname employees, approvedunits ;

php - Magento Category Model not working -

im doing mass category insert iterating on mysqli result set , variables used in code correct reason code not create category: $category = mage::getmodel('catalog/category'); try{ $category->setname($cat['category_name']) ->seturlkey(str_replace(" " , "-" , strtolower($cat['category_name']))) ->setisactive(1) ->setdisplaymode('products') ->setstoreid(0) ->setpath('1/2') ->save(); }catch(exception $e) { die($e->getmessage()); } if($category->getid() == 0): die("category didnt save!"); endif; any ideas?

WPF CustomControl can't inherit from TextBlock control -

i'm making wpf customcontrollibrary customcontrols inherit standard controls label, textbox etc. when try make customcontrol inherit textblock, strange errors. seems customcontrol can't inherit textblock. but why? thanks in advance! i have created custom control inherited textblock: using system.windows.controls; namespace wpfapplication1 { public class customtextblock : textblock { } } and used within same project: <window x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:wpfapplication1"> <grid> <local:customtextblock text="hello" /> </grid> </window> so anser is: you can inherit textblock however, in order t use in xaml, have compile project first. there may other errors in code...

PHP Vars to JavaScript Laravel 5.2 -

i using this package pass variables javascript in laravel 5.2, get: all.js:56uncaught referenceerror: categories not defined in controller trying pass variables this: javascript::put([ 'categories' => $numberofviewsbycategory[0], 'categoryviews' => $numberofviewsbycategory[1], 'chains' => $numberofviewsbychain[0], 'chainviews' => $numberofviewsbychain[1] ]); i have set path in config file: 'bind_js_vars_to_this_view' => 'layouts.partials.foot', and partials.foot blade looks this: @section('foot') <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js" integrity="sha384-i6f5okeclvtk/bl+8isldehowsafuo76zl9+kgagtrdibyinkjaqtph/qvns1vdb" crossorigin="anonymous"></script> <script type="text/javascript" src="{{ asset('js/zurb/zurb.js') }}"></script> <script type="text/javas...

localization - Instaling lang pack on debian circular dependency -

i have problems installing language packs on debian followed https://stackoverflow.com/a/26940856/3202194 (i followed because apt returns e: unable locate package language-pack-sk) downloaded latest packages sk , sk-base tried install them using dpkg but when try install sk unpacking language-pack-sk (1:16.04+20160415) on (1:16.04+20160415) ... dpkg: dependency problems prevent configuration of language-pack-sk: language-pack-sk depends on language-pack-sk-base (>= 1:16.04+20160415); and when sk-base unpacking language-pack-sk-base (1:16.04+20160415) ... dpkg: dependency problems prevent configuration of language-pack-sk-base: language-pack-sk-base depends on language-pack-sk (>= 1:16.04+20160415); how install lang pack when there circular dependency ?? (btw need instal more sk, suppose same) ok, if "apt-get install" after confirmation prompt install both @ once (all downloaded , not packages @ once) solving circular dependencies

objective c - My iOS app should run on lockscreen -

i've got ios project customer app should run on lockscreen mode. please check below link customer shared me. https://itunes.apple.com/us/app/weather-lock-screen-free/id433369569?mt=8 https://itunes.apple.com/us/app/lockscreen+/id437555991?mt=8 i don't want use jailbreaking method. if possible please let me know steps develop app. does customer understand applications not run on lockscreen? examples linked make pictures can set lockscreen background. portion shown on lockscreen cannot have buttons, functions, or ever changes, pictures. if proceed making pictures, create image of appropriate size (whatever device's resolution is) , format contents fits nicely underneath lock screen. save image , instruct user set background.

Excel condition with OR operator -

i learning ms excel formula making. if cell of column a has text sat or sun within respective column b should weekly off following not working. =if(or(search("sun",a:a),search("sat",a:a)),"weeklyoff") =if(or(search("sun",a1),search("sat",a1)),"weeklyoff","") normally place in b1 , copy down. if did series of errors. problem when either search fails located text searching for, generates error. avoid this, need wrap search in error catcher iferror , set return 0 if there error. =if(or(iferror(search("sun",a1),0),iferror(search("sat",a1),0)),"weeklyoff","") now technically speaking search going tell start location of looking within string. if have "xxxxsat2" search "sat" going tell 4. luckily logical part of if statement seems take positive integer true. above formula work is. have changed following: =if(or(isnumber(search(...

visual studio 2015 - How to use a WIndows 10 tablet as an emulator? -

Image
hi developing windows universal application , want use windows 10 tablet connected pc usb testing device app when run it. how can this? you can try out remote debugging. choose remote machine target device in project properties. choose find device -> enter ip of tablet in dialog box shown. install remote debugging tools in target device. you should have remote debugger open in target device connection set up. this link might - https://msdn.microsoft.com/en-us/library/y7f5zaaa.aspx

Reading JSON with multiple dictionaries and arrays into Swift -

i trying separate out before , range , after json below , store them in different arrays/dictionaries. able parse range . can please example? { "before": [ { "segment": 1, "end": 0, "size": 0 }, { "segment": 2, "end": 0.01, "size": 0.1 } ], "range": [ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110 ], "after": [ { "segment": 1, "end": 0, "size": 0 }, { "segment": 2, "end": 0.5, "size": 0.1 }, { "segment": 3, "end": 0.8, "size": 0.3 },...

c# - Add data from two tables in one view MVC 4 -

i trying add data 2 different table in 1 view. here somne code: code of viewmodel public class productindexdata { public ienumerable<order> orders { get; set; } public ienumerable<magnet> magnets { get; set; } public ienumerable<map> maps { get; set; } public ienumerable<portrait> portraits { get; set; } public ienumerable<tablet> tablets { get; set; } public ienumerable<other> others { get; set; } } code of controller: public actionresult index() { productindexdata products = new productindexdata(); products.magnets = (from o in db.magnets select o).tolist(); return view(products); } code of view: @model list<svlaseris.productindexdata> @{ viewbag.title = "product"; } <h2>product</h2> <table> @foreach (var item in model) { foreach(svlaseris.models.magnet magnet in item) { <tr> <td> @html.displayfor(mode...

jquery - Want to append tooltip content in <li> element -

<div> <ul> <li>this first point</li> <li>this second point <a href="http://" title="this more tooltip">more</a></li> </ul> </div> i want append anchor tags title text within li element using jquery plain text no hyperlinks. for example, after processing li element be <li>this second point more tooltip</li> this how (comments in code explain happening): $('li').each(function() { // loop through each li - can change selector match needs var li = $(this), anchors = li.find('a'); // in case there multiple anchors? anchors.each(function() { var anchor = $(this), title = anchor.attr('title'); if (typeof title !== typeof undefined && title !== false) { // if if title attribute exists remove anchor anchor.after(title); // place title after link keeps it's place in li (in case the...

How to get Google All url's from Google Chrome using C# -

how can url's google chrome. example if there 2 different instance running on computer , each instance contain multiple url's. how can list of all.right can 1 active url tab. automationelement elm = automationelement.fromhandle(p.mainwindowhandle); automationelement elmurlbar = null; elmurlbar = elm.findfirst(treescope.descendants, new propertycondition(automationelement.nameproperty, "adresse und suchleiste")); if (elmurlbar != null) { automationpattern[] patterns = elmurlbar.getsupportedpatterns(); if (patterns.length > 0) { valuepattern val = (valuepattern)elmurlbar.getcurrentpattern(patterns[0]); } } is possible url's.source code should c# compatible. i'm not native english speaker. did best ask question. please don't mark negative.

How do I return all Attributes in the VersionOne Rest-1.v1 API for a Given Task -

how return attributes task given task id using versionone rest-1.v1 api. have been able pull given task , subset of attributes, review attributes. kind of "select * ". currently using: ./rest-1.v1/data/task?sel=name,scope.name,createdate&where=owners.name='snowwhite';createdate>'2016-05-01t00:00:00.001' here pattern suggest 1) decide on data important - performing versionone meta queries see "schema" of asset in question. in case asset task . yourv1instance/meta.v1/task?xsl=api.xsl show listing of of attributes associated task. you'll see combination of simple scalars - name (text) , todo (numeric) simple relation - createdby. reference single member asset in versionone. multi-relation - owners. reference 0 or more member assets 2) select data using sel - have seen, versionone returns subset of of stuff found in meta query mentioned above. subset attributes represents highest probability of usefulness....

c# - The codebehind of aspx page is not under the page hierarchy -

Image
when try drag , drop specific asp.net page project , notice code behind n't under page hierarchy in visual studio ! estimatedbalance.cs not under .aspx note : i drag 3 files : estimatedbalance.aspx estimatedbalance.aspx.designer.cs estimatedbalance.cs how fix problem ? the page highlighted class, not codebehind. codebehind should estimatedbalance.aspx.cs, not estimatedbalance.cs

regex - Remove text between comma and dash in R with regular expressions -

i remove text between commas , dashes in long string of variable labels saved comma-separated. here's minimal example of string: myvarlabels <- ("participant number, how following products-green tea, how following products-beer,\"how much, if @ all, willing pay these products if ...-japanese, chinese, , indian green tea\",\"how much, if @ all, willing pay these products if ...-japanese, chinese, , indian beer\"") importantly, variable labels appear in 2 different forms , should shortened in following way: how following products-green tea should reduced to: green tea \"how much, if @ all, willing pay these products if ...-japanese, chinese, , indian green tea\" should reduced to: \"japanese, chinese, , indian green tea\" i tried use gsub , regular expressions identify , delete text between commas , dash (i.e., replacing text ""). has suggestion how use gsub remove text between commas indicate star...

excel - How Dir() works in VBA -

in current vba code generate variable called myfilename , use parameter when checking if file exists error message "runtime error 52, bad file name or number" in line use dir command. interestingly if type the filepath dir command manually instead of using myfilename variable works without issue. (no typo, can use myfilename in reading or writing file, drops error dir command) any ideas how can make dir(myfilename) working? set fs = createobject("scripting.filesystemobject") myfilename = environ("userprofile") & "\application data\myfile.txt" if dir(myfilename) = "" set = fs.createtextfile(myfilename, true) a.write ("0") a.close end if the \application data not folder shortcut. use localappdata or appdata instead: myfilename = environ("localappdata") & "\myfile.txt" myfilename = environ("appdata") & "\myfile.txt...

extjs - Creating a toolbar for a panel with tabs -

i have working code here: var panel = ext.create('ext.tab.panel', { width: 500, height: 300, activetab: 1, //sets active tab (2nd) title: 'specific data', floating: true, // make panel absolutely-positioned floating component items: [{ title: 'tab 1', html: 'data data data' }, { title: 'tab 2', html: 'different data' }] }); i'm trying add toolbar (or buttons, not sure should use) add simple 'close window' command. help? here's example of adding close button panel header. can use tools config property. ext docs this explain many options. there's fiddle saved here: http://jsfiddle.net/cfarmerga/jvmug/1/ var panel = ext.create('ext.tab.panel', { renderto: ext.getbody(), width: 500, height: 300, acti...