Posts

Showing posts from March, 2010

asp.net mvc - AngularJS and MVC Calendar Project -

Image
i'm making mvc calendar angularjs, similar calendar outlook's calendar. downloaded example here: http://www.dotnetawesome.com/2017/06/event-calendar-in-aspnet-mvc.html so, have strange problem mvc project. working correctly without problem, able make modifications calendar functions , working couple of days. suddenly, i'm getting error: and interesting thing deleted original project, imported backup working correctly, , backup project since not working either. restarted server, visual studio, cleared cookies various browsers , pc's, , keep getting error. anyone have sugestions happening. there stored cache on iis or that? thank suggestion! wiki

3D Animation in Python: Moving Point and Trajectory -

i switching matlab python, relative beginner. 3d animation of point moving in space, along helix simplicity, , history of trajectory. based on example http://matplotlib.org/examples/animation/simple_3danim.html , have come following code: import numpy np import matplotlib.pyplot plt import mpl_toolkits.mplot3d.axes3d p3 import matplotlib.animation animation ############################################################################### # create helix: def make_helix(n): theta_max = 8 * np.pi theta = np.linspace(0, theta_max, n) x, y, z = theta, np.sin(theta), np.cos(theta) helix = np.vstack((x, y, z)) return helix # update auv position plotting: def update_auv(num, datalines, lines) : line, data in zip(lines, datalines) : line.set_data(data[0:2, num-1:num]) line.set_3d_properties(data[2,num-1:num]) return lines # update trajectory plotting: def update_trj(num, datalines, lines) : line, data in zip(lines, datalines) : l

c++ - Two equivalent if conditions give different results -

i encountered problem when developing project , don't know how proceed debug this. code is (_vtol_status.vtol_in_rw_mode true) bool a; if (_vtol_status.vtol_in_rw_mode == true){ = true; } else { = false; } bool b = true; if (a == b) {/* print */} if (a) {/* block of codes */} i can see "something" printed true. block of codes doesn't give correct result. have made sure enters "if (a)". however if change if condition to if (b) {/* block of codes */} then works well. i have made sure variables "a" , "b" appear else in code. how possible? have been struggling long time. issue might simple couldn't clue. appreciated. wiki

reactjs - Force Enzyme mount() to validate PropTypes -

i trying write jest tests using enzyme's mount() function ensures error thrown when bad data given react component, mount() performs proptypes validation first time mount() called. following test suite using improperly formatted props: it('should throw "failed prop type" error', () => { expect(globalnavigation).tothrow("failed prop type"); }); it('should throw "failed prop type" error', () => { expect(globalnavigation).tothrow("failed prop type"); }); the first test passes, second fails because react not validating props. how can force mount() function validate proptypes? your component receives props parent. therefore, should test parent component make sure passes right props children. should not test child component see if indeed given right props -- responsible faking props. because of that, highly suggest use shallow instead of mount. defining proptype checks way develop

database - PostgreSQL Full Text Search, short query -

i have table here called suggestions store many search terms suggest user in autocomplete feature. i'm using postgresql full text search problem need query work 3 chars. example, if user wanna search iphone 6, when type iph iphone suggestions must appear. query works when user types iphone. and happens words... biggest word more user needs type. this query i'm using: select a.word public.auto_complete to_tsvector(a.word) @@ to_tsquery('iph') order a.word limit 5 how can fix this? wiki

opencv - How to implement .dat file for handwritten recognition using SVM in Python -

i've been trying train hand-written digits using svm based on code on opencv library. training part follow: import cv2 import numpy np sz=20 bin_n = 16 svm_params = dict( kernel_type = cv2.svm_linear, svm_type = cv2.svm_c_svc, c=2.67, gamma=5.383 ) affine_flags = cv2.warp_inverse_map|cv2.inter_linear def deskew(img): m = cv2.moments(img) if abs(m['mu02']) < 1e-2: return img.copy() skew = m['mu11']/m['mu02'] m = np.float32([[1, skew, -0.5*sz*skew], [0, 1, 0]]) img = cv2.warpaffine(img,m,(sz, sz),flags=affine_flags) return img def hog(img): gx = cv2.sobel(img, cv2.cv_32f, 1, 0) gy = cv2.sobel(img, cv2.cv_32f, 0, 1) mag, ang = cv2.carttopolar(gx, gy) bins = np.int32(bin_n*ang/(2*np.pi)) # quantizing binvalues in (0...16) bin_cells = bins[:10,:10], bins[10:,:10], bins[:10,10:], bins[10:,10:] mag_cells = mag[:10,:10], mag[10:,:10], mag[:10,10:], mag[10:,10:]

Gradle-Eclipse- How to ensure Referenced libraries dont get removed on gradle refresh -

i have set gradle project on eclipse when run 'gradle test', jars added in "project , external dependencies" based on entries in build.gradle. referenced libraries added earlier by"add external jars' not present. how ensure not happen. all dependencies should added in build.gradle . makes sense, don't want things working in eclipse , failing gradle command line. anything added via "add external jars" overridden wiki

reactjs - Select2 mulit-select with redux-form -

i using select2 in react. following in code component: <select classname='form-control select-2-currency select2' {...input} value={[input.value]} onblur={ () => input.onblur(input.value) } multiple> { options.map((option, index) => <option key={index} value={option.id}>{option.country}</option> )} </select> my componentdidmount() component is componentdidmount() { $('.select-2-currency').select2({}) .on('select2:select', () => { console.log("value", $('.select-2-currency').val()) this.props.input.onchange($('.select-2-currency').val()); }) .on('select2:unselect', () => { console.log("value ewdfefg", $('.select-2-currency').val()); this.props.input.onchange($('.select-2-currency').val()); }) } following how passing props component <field name='currency_id' component={

python - How do I download NLTK data? -

updated answer:nltk works 2.7 well. had 3.2. uninstalled 3.2 , installed 2.7. works!! i have installed nltk , tried download nltk data. did follow instrution on site: http://www.nltk.org/data.html i downloaded nltk, installed it, , tried run following code: >>> import nltk >>> nltk.download() it gave me error message below: traceback (most recent call last): file "<pyshell#6>", line 1, in <module> nltk.download() attributeerror: 'module' object has no attribute 'download' directory of c:\python32\lib\site-packages tried both nltk.download() , nltk.downloader() , both gave me error messages. then used help(nltk) pull out package, shows following info: name nltk package contents align app (package) book ccg (package) chat (package) chunk (package) classify (package) cluster (package) collocations corpus (package) data decorators downloader draw

php - Laravel Migrations - Dropping columns -

i need drop column userdomainname database table clients . at first installed doctrine/dbal executing composer require doctrine/dbal followed composer update , described in documentation . then created migration want use drop column: php artisan make:migration remove_user_domain_name_from_clients --table=clients i added schema::dropcolumn('userdomainname'); down() method: <?php use illuminate\support\facades\schema; use illuminate\database\schema\blueprint; use illuminate\database\migrations\migration; class removedomainname extends migration { /** * run migrations. * * @return void */ public function up() { schema::table('clients', function (blueprint $table) { // }); } /** * reverse migrations. * * @return void */ public function down() { schema::table('clients', function (blueprint $table) { schema::dropcolumn('userd

how to check telegram developer mode accounts? -

i have used telegram api , create account phone number in developer mode.at first time, sent code me , signed now, when want use sign in method , used sendcode method. doesn't send me verification code. think following scenario happened: when using telegram, @ first time enter our phone number, sends code our phone. when want sign in device @ same time. telegram send code previews device. i think had been happened me right now. have logged in app in developer mode. , when use send code method, sends code telegram account (because didn't logged out, telegram think have access code) in developer mode. have closed app , don't have access code , don't save token. all telegram apps in web in production mode need place check developer mode access code. note: can't use sendsms method unknown reasons, says no method found wiki

c# - Is it possible to have a Dictionary where the value for a given key/value pair is enforced to be of a specific type based on the key? -

specifically trying create dictionary keys of type propertyinfo , value list enforce containing objects of same type associated property described key. in other words, dictionary describes set of properties , values assign them. i know can use list of objects, far can tell, forces me perform check validity of contained list types @ run-time , forces me check every member of list. ideally, i'd instead enforced @ compile time rather run time and/or remove need verifying ever individual member of list. ok getting compile time error if compiler cannot determine property's type @ compile time (my particular use case deals properties known). i suspect may not possible due issue of compiler not having way of type property have prior run time, i'm hoping missed may allow it. you haven't missed anything. it's impossible since there no property type info associated propertyinfo @ compile time. it's not generic type (like list<t> ). wiki

c# - How to update binding based on value being dirty? -

i've datagrid 5 columns. first 3 columns part of parent object , last 2 columns part of child object. i've username column 6th column. when update first 3 columns of parent object, username reflects correctly. when update last 2 columns of child object, doesn't update username. i've tried binding , doing logic in child object , before 'save' username updates correctly last 2 columns after save reverts previous username. my question is, how keep updated username after save? xaml: <datagridtextcolumn header="updated by" isreadonly="true" binding="{binding childobject.updateduser, updatesourcetrigger=propertychanged}"/> child object: public string updateduser { { var parent = this.crawlparentfindtype<parentobject>(); if (column4isdirtybyvalue || column5isdirtybyvalue) return updatedbyusername; else return parent.updatedbyusername; } } public bool column4i

data binding - c# change pictureBox DataBinding on click -

i have picturebox set databindings via properties in visual studio, specific image type field of table. far good, bringing image of database. but need picturebox change image brings depending on button clicked. have 4 image fields on table. if user click button1, need picturebox databinded field image1 of table. if user click button 2, change databing , bring image saved on image2 field of table. how can that? i consider introducing image handler described here: https://www.dotnetperls.com/ashx the imagehandler used determine, image returned client application. example, if button 1 clicked image 1 returned. wiki

bash - Adding Google Chrome to UNIX $PATH -

i got entangled unix file system , playing around terminal. noticed changed $path variable, running "google chrome", executable opening chrome window, gives me error message of -bash: google chrome: command not found here's context: google installed on /applications/google chrome.app/contents/macos executable called "google chrome" (i know because when type /applications/google\ chrome.app/contents/macos/google\ chrome a new chrome window pops out error message saying [12838:35843:0822/170630.283203:error:browser_gpu_channel_host_factory.cc(103)] failed launch gpu process. so i'm pretty sure executable running program) then did little digging on $path variable supposed maintain searching path of find executables everytime type "command" (or exe doesnt matter). therefore, went ~ , find file called .bash_profile $path edited , stored , append file: path="/applications/google\ chrome.app/contents/macos:${path}&

I am using two IN and OUT param in store procedure where I am getting two result, I want the two result in PHP -

create procedure `prev1`(in `page` int(50), out `foundrows` int(255)) begin declare foundrows varchar(255); select sql_calc_found_rows * studentmarks limit page ,6; select found_rows()as foundrows; end this php code $pag=$_get["offset"]; $sql="call prev1($pag,@foundrows)"; $result = mysqli_query($conn,$sql); and response is mysqli_result object ( [current_field] => 0 [field_count] => 13 [lengths] => [num_rows] => 6 [type] => 0 ) but found_rows not getting in php. total found_rows 19 showing [num_rows] => 6 to return value stored procedure: sql : delimiter // create procedure prev1(in `page` int, out `out_val` int) begin select sql_calc_found_rows * studentmarks limit page ,6; select found_rows() out_val; end // delimiter ; php code: <?php error_reporting(-1); ini_set('display_errors', 'on'); ?> <!doctype html> <html> <body> <?php $s

text analysis - How to lemmatize tokens existing as series? -

i haven't performed pos tagging. how tokens - [identification, risky, customers, needs, e... [date, last, contact, critical, data, field... i tried running 3 codes on tokens - nltk.stem.wordnet import wordnetlemmatizer wordnet_lemmatizer = wordnetlemmatizer() lemmatized=tokens.apply(lambda x: wordnet_lemmatizer.lemmatize(x)) def lemword(temp): wordnet_lemmatizer.lemmatize(temp) temp = [wordnet_lemmatizer.lemmatize(word) word in temp.split(" ")] temp = " ".join(temp) return temp tokens=tokens.apply(lambda x: lemword(x)) lemmatized=" ".join([wordnet_lemmatizer.lemmatize(i) in tokens]) but got same error each time - traceback (most recent call last): file "<stdin>", line 1, in <module> file "/opt/cloudera/parcels/anaconda3/lib/python3.5/site- packages/pandas/core/series.py", line 2220, in apply mapped = lib.map_infer(values, f, convert=convert_dtype) file "panda

haskell - How do I cause a WARP server to terminate? -

i have http application server needs exit when handling request under conditions (in order restarted supervisor). given main like: import network.wai.handler.warp (run) main :: io () main = config <- readconfig run (portnumber config) (makeapp config) and handler like: livenessserver1 :: utctime -> filepath -> server livenessprobeapi1 livenessserver1 initialmodificationtime monitorpath = mtime <- liftio $ getmodificationtime monitorpath case mtime == initialmodificationtime of true -> return $ liveness initialmodificationtime mtime false -> throwerror $ err500 { errbody = "file modified." } how cause process end after delivering 500 response? i'm on phone right now, can't type exact code you. basic idea throw warp thread async exception. may sound complicated, easiest way approach use race function async library. this: toexitvar <- newemptymvar race warp (takemvar toexitvar) and in handler, when want wa

android - Set tab's title from fragment on the fly -

i have on activity (mainactivity) , has 5 tabs, each tab contains fragment. each fragment contains edittext widget. i'd set active tab's title when change text of edittext in active fragment's class. how on fly ? here resources: mainactivity: public class mainactivity extends appcompatactivity { private sectionspageradapter msectionspageradapter; private viewpager mviewpager; imageview imageview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); msectionspageradapter = new sectionspageradapter(getsupportfragmentmanager()); mviewpager = (viewpager) findviewbyid(r.id.container); mviewpager.setadapter(msectionspageradapter); tablayout tablayout = (tablayout) findviewbyid(r.id.tabs); tablayout.setupwi

android - why when save image in storage is black? -

i use code set bitmap imageview , image form imageview , save in storage when save it, image black! please solve problem! bitmap bitmap = ink.getbitmap(); img_signature.setimagebitmap(bitmap); bytearrayoutputstream stream = new bytearrayoutputstream(); bitmap.compress(bitmap.compressformat.jpeg, 50, stream); byte[] bytearray = stream.tobytearray(); encodedstring = base64.encodetostring(bytearray, 0); createdirectoryandsavefile(bitmap,"signature.jpg"); and method save image : private void createdirectoryandsavefile(bitmap imagetosave, string filename) { file direct = new file(environment.getexternalstoragedirectory().getabsolutepath() + "/delivery/"); if (!direct.exists()) { direct.mkdirs(); } file file = new file(direct, filename); if (file.exists()) file.delete(); try { fileoutputstream out = new fileoutputstream(file); imagetosave.compress(bitmap.compressformat.jpeg, 100, out); out.

plot - How to implement a timeline in R with start date, end date, and a marker for a "middle date"? -

Image
we have data frame in r of following format: type request id event name first seen update last seen 1 event1 1/29/2017 19:54 4/19/2017 14:16 4/19/2017 15:05 2 event2 2/13/2017 14:20 5/2/2017 12:48 5/2/2017 12:54 3 event3 4/29/2017 16:30 5/12/2017 11:05 5/12/2017 12:08 b 4 event4 5/17/2017 20:23 5/18/2017 12:46 5/18/2017 16:15 the corresponding csv file is: type,request id,event name,first seen,update,last seen a,1,event1,1/29/2017 19:54,4/19/2017 14:16,4/19/2017 15:05 a,2,event2,2/13/2017 14:20,5/2/2017 12:48,5/2/2017 12:54 a,3,event3,4/29/2017 16:30,5/12/2017 11:05,5/12/2017 12:08 b,4,event4,5/17/2017 20:23,5/18/2017 12:46,5/18/2017 16:15 we want visualize each instance on r timeline such can see event on timeline start date, update, , end date. we able close our implementation in r goes this: install.packages("timevis") library("timevis&quo

sdk - In Rally, is it possible to dynamically change script source so that I can load multiple apps? -

i have drop down of app names (or url parameter) , load app on select: like: ext.define('testpage', { extend: 'rally.app.app', items: [{ xtype: 'container', id: "appdiv" }], launch: function () { var me = this; me.add({ xtype: 'box', autoel: { tag: 'iframe', src: 'https://rally-apps.com/test.cfd.html', width: 1020, height: 1000 } }); } }); but error: blocked frame origin https://rally-apps.com " accessing cross-origin frame. there other way can achieve this? that error standard browser security limitation, code in 1 domain cannot access code in one. may able work around instead making ajax request url load app content , injecting current app. hard say. the other idea comes mind adding these apps subscription app catalog, can add them pages lik

php - Rewrite URLs with NGINX -

i running on nginx , trying create blog works this: i create new post title "how create new website" under "business" category i turn title slug how-to-create-a-new-website the final url looks this: http:://www.example.com/ blog / business / how-to-create-a-new-website so trying accomplish this: i have single page searches category , slug in database. retrieves article , displays it. category , slug should able anything. so need nginx rewrite/location rule allow this. have done similar on server apache rewrite rule in .htaccess file (but without category): #clean urls blog rewriterule ^blog/(.*)$ blog/article.php?slug=$1 [l] everything have tried on nginx server not seem work. appreciated! you can try rule: location ~ /blog/ { rewrite "^(/blog)/([\w-]+)/([\w-]+)/?$" $1/article.php?category=$2&slug=$3 last; } wiki

c# - concatenation issue adding static string to dynamic string -

the following code working fine static value "application1" . mailmsg.headers.add("x-smtpapi", "{ \"category\": [ \"application1\" ] }"); but want replace "application1" dynamic value. so implemented following code. dtls.category dynamic value. string xsmtpcategory = "{\"category\":\""+dtls.category +"\" ] }"; mailmsg.headers.add("x-smtpapi", xsmtpcategory); but i'm getting error "not in correct format". how can fix that? you left out part of syntax after colon: string xsmtpcategory = "{\"category\": [ \""+dtls.category +"\" ] }"; i suggest using c# 6.0 string interpolation if possible: mailmsg.headers.add("x-smtpapi", $@"{{ ""category"": [ ""{dtls.category}"" ] }}"); wiki

How to use Python-gsmmodem module to send sms? -

i'm new python. i've installed pyserial & python-gsmmodem module. can find files including sendsms.py don't know how use send sms. i've seen examples folder there's nothing find helpful. should make new file , write (what write?) or have use sendsms.py file if want send sms? note: i've run sendsms.py file, gives me error usage: scratch_2.py [-h] [-i port] [-b baudrate] [-p pin] [-d] destination scratch_2.py: error: following arguments required: destination process finished exit code 2 not sure how provide argument wiki

r - ROracle interrupt long-running queries -

i'm executing sql statements r interface using roracle package. takes lot of time , want interrupt it. i find function "oracle()" in roracle package , function has parameter "interruptible = false" . seems can interrupt using set. and in function document , says : when interruptible set true, allows interrupting long-running queries on server executing query in thread. main thread checks ctrl-c , issues ocibreak/ocireset cancel operation on server. default interruptible false. but try ctrl-c, doesn't work. can help? thanks!! sessioninfo: r version 3.4.1 (2017-06-30) platform: x86_64-w64- mingw32/x64 (64-bit) running under: windows 7 x64 (build 7601) service pack 1 matrix products: default locale: [1] lc_collate=chinese (simplified)_people's republic of china.936 [2] lc_ctype=chinese (simplified)_people's republic of china.936 [3] lc_monetary=chinese (simplified)_people's republic of china.936 [4] lc_n

Kafka Producer Timestamp -

i'm having trouble understanding producerrecord . previously constructing producerrecord this: new producerrecord<string, string>("my-topic", "key", "value") i'd pass in timestamp additionally decided check docs , found out constructor indeed allows passing timestamp. required specifying partition this: new producerrecord(string topic, integer partition, long timestamp, k key, v value) i'm confused pass partition parameter since previous constructor used handling me. you can use still constructor without problem. have pass partition null in constructor , still defaultpartitioner take care partitioner assignment. name sure using new kafkaproducer api. timestamp doesn't work old scala based producer. wiki

How to change date format in Excel -

i unable convert date formats in column2 , column3 shown below. any tips how can change it? i have column 01.01.2018. needs changed 1/1/2018 , other column 01/jan/2018 01.01.2018 1/1/2018 01/jan/2018 01.01.2018 1/1/2018 01/jan/2018 01.12.2017 12/1/2017 01/dec/2017 your col has date in format excel doesn't recognize default. first convert proper date in excel. can following formula: =date(right(a1,4),right(left(a1,5),2),left(a1,2)) where a1 refers 01.01.2018 in example. have converted date, can change format following custom formats: for format 1/1/2018: m/d/yyyy for format 01/jan/2018 [$-409]dd-mmm-yyyy;@ ps: can refer following link setting custom formats in excel: https://www.ablebits.com/office-addins-blog/2016/07/07/custom-excel-number-format/ wiki

jquery - How can i pass javascript addListener function value to change function inside -

i have addlistener function , change function there. how can pass addlistener result change function inside using javascript $(document).ready(function() { // find pincode var input = document.getelementbyid('location_input'); var options = { types: ['address'], componentrestrictions: { country: 'in' } }; autocomplete = new google.maps.places.autocomplete(input, options); var pincode; google.maps.event.addlistener(autocomplete, 'place_changed', function fun1() { var place = autocomplete.getplace(); (var = 0; < place.address_components.length; i++) { (var j = 0; j < place.address_components[i].types.length; j++) { if (place.address_components[i].types[j] === "postal_code") { pincode = place.address_components[i].long_name; fun2(pincode); //alert(pincode); } //return pincode; } } }); $('input[type="checkbox"],#

nsmenuitem - How to add button in NSStatusItem menu? -

i new world of macos developing working visual studio mac (and c# of course) i want develop application running in background. until able create statusitem (with nsstatusitem class) , adding submenu listening , working events (like sending system messages or changing color of icon , on) have no clue, how add button on of nsmenuitem objects, have added (only in code) popupmenu. what try reach functionality in postgres app mac postgres start/stop button is possible , if ... how? :) wiki

python - strange result when removing item from a list -

this question has answer here: remove items list while iterating 18 answers i've got piece of code : numbers = range(1,50) in numbers : if < 20 : print "do something" numbers.remove(i) print numbers but result i`m getting : [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49] of course i'm expecting numbers below 20 not appear in results, i'm assuming i`m doing wrong remove you're modifying list while iterate on it. means first time through loop, i == 1 , 1 removed list. for loop goes second item in list, not 2, 3! that's removed list, , for loop goes on third item in list, 5. , on. perhaps it's easier visualize so, ^ pointing value of i : [1, 2, 3, 4, 5, 6...] ^ that's

laravel - Array in PHP foreach -

basically trying make array work foreach of mine. array contains data each device (about 10000 devices), of them empty due data being old. need use array in foreach below make sure $newfault gets created if has wrong software. super stuck , cant work. any clues? note array has able use relationships of devicelogs here below. public function createviacameras() { set_time_limit(120); //this part removes entire existing firmwarefault database new info go in. firmwarefault::truncate(); cameraunlinked::truncate(); //this part imports cameras today. $today = (new \datetime); $today->modify('-3 day'); $tomorrow = (new \datetime); $tomorrow->modify('+1 day'); $devices = device::take(10)->get(); foreach ($devices $device) { $logs[$device->id] = devicelog::wherenotin('model', ['test', 'test2'])->wheredeviceid($device->id)->wherebetween('created_at', [$toda

ios - how to set delegate while passing from one view controller to previous in swift 3? -

here trying pass selected data table view previous view controller unable , code mentioned below , set delegate in case can me how resolve ? protocol arraytopass: class { func selectedarraytopass(selectedstrings: [string]) } class filterselectionviewcontroller: uiviewcontroller,uitableviewdatasource,uitableviewdelegate { var values = [string]() var delegate: arraytopass? override func viewdidload() { super.viewdidload() self.downloadjsonwithurl() tabledetails.separatorinset = uiedgeinsets.zero activityindicator.startanimating() tabledetails.ishidden = true tabledetails.datasource = self tabledetails.delegate = self let rightbarbutton = uibarbuttonitem(title: "apply", style: uibarbuttonitemstyle.plain, target: self, action: #selector(applybarbuttonactiontapped(_:))) self.navigationitem.rightbarbuttonitem = rightbarbutton tabledetails.estimatedrowheight = uitableviewautomaticdimension

python 2.7 - Robot-Framework-Test-Automation selenium -

i need use syntax similar driver.switchto().parentframe() in python 2.7. syntax work fine in c# can tell me how parent frame child frame ? thanks in advance you cannot parent child frame, can child frame main frame calling selenium2library keyword unselect frame wiki

python - OpenCV install directory only has one .so file? -

Image
i installed opencv in docker container can upload linux binaries support git project isn't mine. need run python 3.6 , opencv 3.x, seems working fine. however, directory containing cv2 folder has 1 .so file: cv2.cpython-36m-x86_64-linux-gnu.so . project i'm trying contribute has build opencv py2.7, , folder has dozens of .so files many relevant opencv packages, feel wrong. can help? and here's link project trying add support to. https://github.com/miserlou/lambda-packages/tree/master/lambda_packages/opencv assuming don't want unpack tar, here's how inside looks python 2.7 package there nothing wrong long can import in python , utilize it's functionality. i'm using ros kinetic research, comes built in release of opencv. has 1 cv2.so file , it's working fine. wiki

Iterating an array backward in C using an unsigned index -

is following code, safe iterate array backward? for (size_t s = array_size - 1; s != -1; s--) array[s] = <do something>; note i'm comparing s , unsigned , against -1 ; is there better way? this code surprisingly tricky. if reading of c standard correct, code safe if size_t @ least big int . case because size_t implemented unsigned long int . in case -1 converted size_t (the type of s ). -1 can't represented unsigned type, apply modulo arithmetic bring in range. gives size_max (the largest possible value of type size_t ). similarly, decrementing s when 0 done modulo size_max+1 , results in size_max . therefore loop ends want end, after processing s = 0 case. on other hand, if size_t unsigned short (and int bigger short ), int represent possible size_t values , s converted int . in other words, comparison done (int)size_max != -1 , return false , breaking code. i've never seen system happen. you can avoid potential problems

html - Applying style to binding formula -

i'm trying apply style bound formula in viewmodel. my viewmodel is: viewmodel: { formulas: { firstteststorerecord: { bind: '{teststore}', get: function(teststore) { return teststore.getat(0); } } }, stores:{ teststore: { //fields: [{ name: 'test', type: 'string' }], data: [{ test: 'foo', style: { 'font-size': '22px', 'color':'red', } }] } } }, and reference bound formula is: items: [{ xtype: 'form', t

hsqldb - How to insert a hex string to a longvarbinary column in hsql? -

how make work in hsql insert script? image column datatype longvarbinary . insert item (id, image) values (1, '0xffd8ffe000104a464'); the binary literal format in sql language has x prefix outside quoted string. note string must have number of characters. example work if add 1 character make string length even. insert item (id, image) values (1, x'ffd8ffe000104a4640'); see http://www.hsqldb.org/doc/guide/dataaccess-chapt.html#dac_literals wiki

c++ - boost ssl connection procedure fails -

i trying combine famous boost ssl client/server connection examples single program. kind reference, base classes this: #include <cstdlib> #include <iostream> #include <boost/bind.hpp> #include <boost/asio.hpp> #include <boost/asio/ssl.hpp> namespace bt { // // client.cpp // ~~~~~~~~~~ // // copyright (c) 2003-2011 christopher m. kohlhoff (chris @ kohlhoff dot com) // // distributed under boost software license, version 1.0. (see accompanying // file license_1_0.txt or copy @ http://www.boost.org/license_1_0.txt) // enum { max_length = 1024 }; class client { public: client(boost::asio::io_service& io_service, boost::asio::ssl::context& context, boost::asio::ip::tcp::resolver::iterator endpoint_iterator) : socket_(io_service, context) { boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator; socket_.lowest_layer().async_connect(endpoint, boost::bind(&client::handle_connect, this, boost::asi