Posts

Showing posts from February, 2013

unity3d - Unity: Prefab parenting in code -

Image
let's want multiple prefab object called childtile , parenting single prefab object called parenttile . whenever parenttile rotates, childtiles rotated around parenttile . basically wrote: public gameobject childprefab; public gameobject parentprefab; void update() { for(int = 0; < 10; i++) { gameobject clone = instantiate(childprefab, /*psuedocode: random position*/ , quaternion.identity) clone.transform.parent = parentprefab; } } the expected result during runtime, if rotate parentprefab @ scene, 10 childprefabs should rotate. i've tried many ways failed, unless manually drag childprefabs parentprefab on hierachy bar. are sure want instantiate 10 child prefabs on each frame ( update called once per frame). i think problem is, did not instantiate parent prefab. if take code, , fix it, works charm me. public gameobject childprefab; public gameobject parentprefab; void start() { gameobject parent = instantiate(pa

How to reject or accept an incoming call to my GSM modem using AT commands in Python? -

i've wrote below python program wait incoming calls , accept or reject them. based on this document , this document, appropriate @ commands accept incoming call ata or ats0 or ats0<n> . , appropriate commands reject incoming call ath or at h . i tried above commands, incoming call neither answered nor rejected! my python program : import time import serial phone = serial.serial("com10", 115200, timeout=5) try: time.sleep(1) while(1): x = phone.readline() print(x) if (x == b'ring\r\n'): phone.write(b'at h') # replaced 'at h' above # commands, nothing changed # incoming call. ringing. time.sleep(2) finally: phone.close() results at h : >>> ================================ restart ================================ >>> b'' b'' b'\r\n' b'ring\r\n' b&#

Deploying failed when I am trying to deploying applicaion in mule 3.4.2 server -

deploying failed when trying deploying applicaion the below error getting. please me out on this? warn 2015-06-19 15:02:42,393 [[bmrs_mule_phase2_2.0.12].http.request.dispatch.7051.01] com.mulesoft.mule.throttling.throttlingphase: failure processing throttling phase null error 2015-06-19 15:02:42,394 [[bmrs_mule_phase2_2.0.12].http.request.dispatch.7051.01] org.mule.exception.defaultsystemexceptionstrategy: caught exception in exception strategy: null java.lang.nullpointerexception @ com.mulesoft.mule.throttling.throttlingphase.runphase(throttlingphase.java:76) @ com.mulesoft.mule.throttling.throttlingphase.runphase(throttlingphase.java:1) @ org.mule.execution.phaseexecutionengine$internalphaseexecutionengine.phasesuccessfully(phaseexecutionengine.java:54) @ org.mule.execution.validationphase.runphase(validationphase.java:36) @ org.mule.execution.validationphase.runphase(validationphase.java:15) @ org.mule.execution.phaseexecutionengine$internalphaseexe

QLineEdit Qt in c++ removing QLineEdit -

i'm trying make adress book in qt , using following code: #include "mainwindow.h" #include "ui_mainwindow.h" int counter = 1; mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent) , ui(new ui::mainwindow) { ui->setupui(this); } mainwindow::~mainwindow() { delete ui; } void mainwindow::on_pushbutton_clicked() { qlineedit* voornaam = new qlineedit(this); voornaam->setobjectname(qstring::fromutf8("lineedit_4")); voornaam->setgeometry(qrect(10, 65+ 33*counter, 113, 24)); voornaam->show(); qlineedit* achternaam = new qlineedit(this); achternaam->setobjectname(qstring::fromutf8("lineedit_5")); achternaam->setgeometry(qrect(140, 65+ 33*counter, 113, 24)); achternaam->show(); qlineedit* adres = new qlineedit(this); adres->setobjectname(qstring::fromutf8("lineedit_6")); adres->setgeometry(qrect(270, 65+ 33*counter, 113, 24)); adres->sho

javascript - It is possible to code `if(($(document).onmouseup) && (value_ == 1))`? -

yesterday asked question. fiddle my problem is, values passing function in every mouse event dragging , resizeable not correcty working. so write var value_ = 1; div_mainscale.onmousedown = function(event) { var mousecoords = getcoords(event); startx = mousecoords.x - offset[0]; starty =1 ;//mousecoords.y - offset[1]; rect = mainscale.rect(startx, starty); document.onmousemove = dodraw; rect.attr({fill: 'rgba(255, 6, 6, 0.41)', stroke: 'red'}); value_ = 1; }; if(($(document).onmouseup) && (value_ == 1)) // here make mistake { selectable_area(width,startx); rect.remove(); } instead of code document.onmouseup = function() { if(rect) { selectable_area(width,startx); rect.remove(); } document.onmousemove = null; }; but if(($(document).onmouseup) && (value_ == 1)) condition not satisfied? how can fix problem? $(document).on("mouseup" , function(e) { if (value_ == 1) {

AngularJS watching an expression -

say have expression $scope.showbutton = users.is_admin() && !document.is_provided; and in same controller have button updates value of document.is_provided : <button ng-click="document.is_provided = true;">provide document</button> the problem $scope.showbutton should changed it's not changing. updated: plnkr showing simplified issue: http://plnkr.co/edit/qk2jnhamqsrnxsajdyek?p=preview i'd add on squiroid's answer , explain why works. i'll provide simple way understand, common problem me when started. angular has called digest cycle. series of functions called successively make sure if variable two-way bound variable b (using ng-model example), stay in sync (that is, have same value). functions angular provides (or services, start $, $timeout etc), automatically start digest cycle so let's have variable , you've bound $scope variable b, equal variable c. expect c bound too, right? because think when chan

c# - SQL Server Database not working due to server version issue on testing machine -

my development pc has sql server 2008. have database created , running on sql server 2008. instance name of sql server 2008 sqlexpress default one. connection string like: <add name="db1entities" connectionstring="metadata=res://*/model1.csdl|res://*/model1.ssdl|res://*/model1.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=.\sqlexpress;attachdbfilename=|datadirectory|\db1.mdf;integrated security=true;user instance=true;multipleactiveresultsets=true;app=entityframework&quot;" providername="system.data.entityclient" /> working nicely on development pc. tried run on pc it's not working, instead showing error : system.data.entityexception: underlying provider failed on open. ---> system.data.sqlclient.sqlexception: database '..\db1.mdf' cannot opened because version 655. server supports version 612 , earlier. downgrade path not supported. first test pc has sql server 200

vba - retrieve current path from file saved on server -

how can retrieve current path of current db? i've 1 ac07 program, distribute save 1 copy on intranet server, how copy program our pc , use it? people open file directly on server. when file open 1 form star automatically, in form put code: private sub form_load() on error goto errorhandler dim strserver string strserver = "\\itbgafs01\comune\dashboard\" if getdbpath() = strserver msgbox "you can't open file server" & vbcrlf & _ "save 1 copy on pc, , use those", vbcritical, "dashboard.info" application.quit end if public function getdbpath() string dim strfullpath string dim integer strfullpath = currentdb().name = len(strfullpath) 1 step -1 if mid(strfullpath, i, 1) = "\" getdbpath = left(strfullpath, i) exit end if next end function my problem is: pc mapped on drive h: server directory path result h:\comune\dashboard\ , not \\

uitabbarcontroller - how to close a tabbar swift -

i have login view controller on correct login open tabbar controller following method: self.dismissviewcontrolleranimated(true, completion: { self.loadhomescreen()}) func loadhomescreen() { emailfield.text = "" passwordfield.text = "" self.presentviewcontroller(uistoryboard.tabbarcontroller()!, animated: true, completion: nil) } private extension uistoryboard { class func mainstoryboard() -> uistoryboard { return uistoryboard(name: "main", bundle: nsbundle.mainbundle()) } class func tabbarcontroller() -> uitabbarcontroller? { return mainstoryboard().instantiateviewcontrollerwithidentifier("tabbarcontrollerid") as? uitabbarcontroller } } i think login view controller still in background? have logout button rightbarbutton item on each navbar in tabgroup. want able close tabbar on button press. how can achieve this. can't find examples. using pop command?

Apache cordova please install android target 22 -

Image
i have installed android 22. i have apache ant installed i have sent path android home, java home too. but still below error when try build android app. android manifest file

java - Launch App before sending SMS -

my idea: have hook force android call function of app before sms sent. what want ask user (that wrote sms using arbitrary app or standard app) if wants send sms using gsm (= normal way) or other provider on internet. is possible? found information contentobserver, i'm not sure how can cancel send of "normal gsm send" after sent sms via internet... thanks help! luca there no such hook available call app function before sending sms. may have customise android framework achieve this.

javascript - How do I return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , return one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback ca

javascript - How can I hide ajax search results when input text is cleared? -

i ajax search work, couldn't hide results when clear input text box. also, couldn't select search result should retain in input text box here ajax code : ajax.js $(function () { $('#search').keyup(function () { $.ajax({ type: "post", url: "search", data: { 'search_text': $('#search').val(), 'csrfmiddlewaretoken': $("input[name=csrfmiddlewaretoken]").val() }, success: searchsuccess, datatype: 'html' }); }); }); function searchsuccess(data, textstatus, jqxhr) { $('#search-results').html(data); } here html template template.html <input type="text" id="search" name="search" class="search" value="enter loc" size="35" maxlength="300" style="margin-left:10px;color:#d5caca" onclick="document.getelementbyid('search').value

java - Enter Mutex error for Launch4J -

Image
what following error in launch4j while converting jar file exe : enter mutex name? i using version 3.8 of launch4j . comment if want me elaborate. if chose mutex, allow 1 instance of application. you can chose random mutex name, example: abcmutex0 without mutex: with mutex: if error enter mutex name? , may have tick "allow single instance of application" haven't enter mutex name. it question?

python - Jinja2 for loop in javascript on a list not working but accessing individual elements works -

i working on flask + jinja2 website involves plotting stored markers on map. python code resultroute['checkpointlist'] = checkpoint.query.filter_by(route_id=route.code) return render_template('routes/edit.html',route=resultroute) javascript in edit.html function addexistingmarkers() { //individual access elements var name0 = '{{route.checkpointlist[0].name}}'; var lat0 = {{route.checkpointlist[0].latitude}}; var long0 = {{route.checkpointlist[0].longitude}}; var marker = new google.maps.marker({ position: new google.maps.latlng({{ route.checkpointlist[0].latitude }}, {{ route.checkpointlist[0].longitude }}), map: map, title: '{{ route.checkpointlist[0].name }}' }); //trying iterate on list {% checkpoint in route.checkpointlist %} var lat = checkpoint.latitude; var long = checkpoint.longitude; var cpname = chec

html - How to show the output in textarea when using $('div') and CSS (JavaScript) -

when use codes, prints result in new html page, how can print results in nominated textarea? lets want result shown in: bookform.mytext.value update: please note btitle supposed italic html: <div contenteditable="true"></div> css: span{ font-style: italic; } javascript: btitle = bookform.txttitle.value; bname = bookform.txtname.value; bnumber = bookform.txtnumber.value; var concatbook = "<span>"+btitle+"</span> "+bname+" sold "+bnumber+" copies." $('div').html(concatbook); add textarea in id "mytext" <textarea id="mytext" name="somename"></textarea> add javascript btitle = bookform.txttitle.value; bname = bookform.txtname.value; bnumber = bookform.txtnumber.value; var concatbook = ""+btitle+" "+bname+" sold "+bnumber+" copies."; $('#mytext').va

Unit testing Python Flask Stream -

does have experience/pointers on testing flask content streaming resource? application uses redis pub/sub, when receiving message in channel streams text 'data: {"value":42}' implementation following flask docs at: docs , unit tests done following flask docs too. messages redis pub/sub sent second resource (post). i'm creating thread listen stream while post on main application resource publishes redis. although connection assertions pass (i receive ok 200 , mimetype 'text/event-stream') data object empty. my unit test this: def test_04_receiving_events(self): headers = [('content-type', 'application/json')] data = json.dumps({"value": 42}) headers.append(('content-length', len(data))) def get_stream(): rv_stream = self.app.get('stream/data') rv_stream_object = json.loads(rv_stream.data) #error (empty) self.assertequal(rv_stream.status_code, 200) self.as

R - Conditional Substr from dataframe -

i need substr column based on start , end locations. start , end locations derived character search. for example, single column in dataframe 3 rows: 'bond, mr. :james' 'woman, mrs. :wonder' 'hood, mr. :robin' expected answer in column 2 is: 'mr.' 'mrs.' 'mr.' i want extract strings in between ',' , ':' column 1. try gsub(".*, | :.*", "", myvec)

jasper reports - How can you use JasperReport Viewer in your Web App? -

i've manage use jasperreport viewer in desktop app, curious if can same in web application print properties , buttons available. is possible? there web based print preview jasper reports? for have install jasper server , upload report on jasperserver after can bind report in web application visualize.js.

treeview - how to get selection from a gtk3 combobox with tree model -

i'm new gtk. last gui application wrote used text mode gui in turbo c, have little catching do. i'm using gtk write test harness code in embedded system. i'm using combobox tree model provide 2-level selection. got combobox display wanted, although don't have understaning of cell_renderer parts copied , pasted stack overflow question. gtktreestore* model = gtk_tree_store_new(1,g_type_string) (initilise model hold desired strings using gtk_tree_store_append , gtk_tree_store_set) gtkwidget* combobox = gtk_combo_box_new_with_model(model); gtk_combo_box_set_entry_text_column(combobox, 0); gtkcellrenderer *column = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(gtk_cell_layout(combobox),column,true); gtk_cell_layout_set_attributes(gtk_cell_layout(combobox), column,"text", 0,null); this code worked display combobox. needed selection combobox. tried getting index combobox using gtk_combo_box_get_active (). index returned didn't me. sub-t

php - Modify $this->request->data in model CakePHP? -

how can modify $this->request->data model in cakephp. tried code in model user : public function beforevalidate($options = array()) { unset($this->request->data['user']['birthday']); } but return errors : notice (8): indirect modification of overloaded property user::$request has no effect warning (2): attempt modify property of non-object if use (model user) : public function beforevalidate($options = array()) { unset($this->data[$this->alias]['birthday']); } it's ok, after validate, when tried print_r($this->request->data) in controller, see birthday field still exists in it. anyone can give me solution this, different between $this->data , $this->request->data, !! edit : cakephp version 2.6.7 - newest version. $this->request->data cannot accessed within model. data accessible controller. when attempt save data model controller ( e.g. $this->user->save($this->

segmentation fault in my c code -

i getting segmentation fault in code reason that. think because of while loop in cur = readdir(dr); not entering while loop when trying give wrong entry. int main(char *source) { dir *dr; struct dirent *cur; struct stat fi; long int total_size = 0; dr = opendir(source); char *name=source; size_t sourcelen = strlen(source); printf("\n\n source %s\n\n\n", source); printf("before *path \n"); char *path = malloc(100); strcpy(path,source); printf("before while \n"); while ((cur = readdir(dr)) != null) { if(cur->d_name[0] != '.') { free(path); path = malloc(sourcelen + strlen(cur->d_name) + 2); strcat(path,source); strcat(path,"/"); strcat(path,cur->d_name); if(stat(path, &fi) == -1) {

javascript - Get image URL when click on picture -

i design popup window select imgage. code in index.php <input type="button" value ="browse" onclick="browse_img()" /> <input type="text" id="img_url" name="img_url" value="selected img"/> <script type="text/javascript"> function browse_img(){ window.open("img_browse.php","windows2"); } </script> this code in img_browse.php <img id="img_id_1" src="url/puc1.jpg" onclick="select_img()"/> <img id="img_id_2" src="url/puc2.jpg" onclick="select_img()"/> <input type="text" id="img_url" name="img_url" value="selected img"/> <scrip> function select_img(){ var file_url=$(this).src; alert(file_url); document.getelementbyid("img_id_2").value=file_url; } </scrip> the aler &quo

html - Image filling vertical space in container -

Image
i've got <div> image on left side , text on right side. how can achieve image fills vertical space? this how supposed look: the parent's height change in 3 steps using media queries. this should make images in div reach top bottom. <div id="content"> <img src="source.jpg"> other div contents... </div #content img { height: 100%; }

sql - Remove duplicate rows after joining multiple tables -

i have query eliminate duplicates , shows unique records. select distinct tblpatient.mrn tblpatient output: mrn ------ 15257 15283 15285 15290 15291 15302 however, have additional columns need show want unique mrn s. select v.patientid, p.firstname, p.lastname, p.dob, p.mrn, s.visitid, v.admiteddate tblpatient p join tblpatientvisit v on p.id = v.patientid join tblpatientsmokingscreenorder s on v.id = s.visitid join descriptor t on s.smoking_status_dsc_id = descriptor_id isdate(p.dob) = 1 , convert(date,p.dob) <'12/10/2000' , v.patienttype = 'i' , isdate(v.admiteddate) = 1 , convert(date,v.admiteddate) > '06/16/2013 16:16' output: patientid firstname lastname dob mrn visitid admiteddate --------------------------------------------------------------------------- 1 james

python - Spark DataFrame TimestampType - how to get Year, Month, Day values from field? -

i have spark dataframe take(5) top rows follows: [row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=1, value=638.55), row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=2, value=638.55), row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=3, value=638.55), row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=4, value=638.55), row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=5, value=638.55)] it's schema defined as: elevdf.printschema() root |-- date: timestamp (nullable = true) |-- hour: long (nullable = true) |-- value: double (nullable = true) how year, month, day values 'date' field? you can use simple map other rdd: elevdf = sqlcontext.createdataframe(sc.parallelize([ row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=1, value=638.55), row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=2, value=638.55), row(date=datetime.datetime(1984, 1, 1, 0, 0), hour=3, value=638.55), row(date=datetime.datetime(1984, 1,

meteor - CollectionFS S3 ERROR STREAM images Access Denied -

i'm trying set collectionfs , s3 can upload files s3 autoform. i have images fs.collection defined .allow function living on server, so: // client , server. var imagestore = new fs.store.s3('images', { region: 'us-east-1', accesskeyid: 'mykey', secretaccesskey: 'my/key', bucket: 'buketz', folder: 'images', });

php - Checking for data before sending it -

how validate fields on site before sent other site processed? right still sends user other site. right site processes data shows custom error message on site. inconvenience. exact order how code goes. the php code <?php if(isset($_post['submit'])) { $name = $_post['name']; $email = $_post['email']; $phone = $_post['phone']; $error_message = ""; if(empty($name) || empty($email) || empty($phone) ) { $error_message = "<span class='error-message'>fill fields</span>"; } } ?> the html code comes after <form method="post" action="some other site processes everything" class="big_form" > <input type="hidden" name="redirect" value="http://www.example.com" /> <!-- more form f

html - Angular Material layout-align center doesn't affect text in small mode -

i expect piece of code center content in both vertical , horizontal. that. make window smaller(like mobile), text's (h1 , p) alignment changes left aligned. missing basic? can 'text-center' works don't want add css styling myself. codepen <body layout="column" ng-app="app"> <div layout="row" flex layout-align="center center"> <div layout="column" layout-align="center"> <h1>welcome switzerland</h1> <md-button class="md-hue-2 md-raised md-primary" > <h1 class="md-display-1">login</h1> </md-button> <p class="md-caption">this web site uses membership given email address.</p> </div> </div> </body> for me it's working should in newest version of chrome. browser compatibility issue. angular material has amount of bugs in still new. i've added angula

left/right/inner join on mysql statement -

i have following sql query : select band.id bid, band.name, bandinfo.summary, bandimage.url bandimage, user.username, user.online, userimage.url userimage bands band inner join band_info bandinfo on band.id = bandinfo.bid left join band_images bandimage on band.id = bandimage.bid left join band_followers follower on follower.bid = band.id right join users user on user.id = follower.uid inner join user_info userinfo on userinfo.uid = user.id left join user_images userimage on user.id = userimage.uid ((band.activated = 1) , (user.activated = 1)) , (bandinfo.language = 'fr') order band.name 'users' table contains users (one row = 1 user) 'user_info' table contains info user (one row = 1 user) 'user_images' table contains image users (one row = 1 user) 'bands' table contains music bands (one row = 1 band) 'band_info' table contains info band (multiple row 1 band due language) 'band_images' table contains image bands

c - Valgrind: Invalid write of size 8 with a segfault -

so i'm working on long c code data analysis. when run it, segfaults. couldn't see obvious, ran through valgrind, following: ==7136== memcheck, memory error detector ==7136== copyright (c) 2002-2013, , gnu gpl'd, julian seward et al. ==7136== using valgrind-3.10.0.svn , libvex; rerun -h copyright info ==7136== command: ./exspec table.dat datafile_1 ==7136== reading in table... obtaining rates... loading data file... ==7136== warning: set address range perms: large range [0x3a00e040, 0xaa00e040) (defined) ==7136== warning: set address range perms: large range [0xaa00f040, 0xdc11a5e0) (defined) ==7136== warning: set address range perms: large range [0x3a00e028, 0xaa00e058) (noaccess) converting units... computing fractions... calculating los , particle intersections... ==7136== warning: client switching stacks? sp change: 0xffefffc60 --> 0xffb6c81a0 ==7136== suppress, use: --max-stackframe=59996864 or greater ==7136== invalid write of size 8 ==7136==

ios - EXC_BAD_ACCESS in HealthKit in reading dateOfBirthWithError -

when call following function read dataofbirth, keep receiving bad access error while testing on device. i'm using swift 2.0 in xcode 7 beta func updateusersage(){ do{ var error : nserror! let birthdate = try currenthealthstore.dateofbirthwitherror() let = nsdate() let datecomponents = nscalendar.currentcalendar().components(nscalendarunit.nsyearcalendarunit, fromdate: birthdate, todate: now, options: nscalendaroptions.wrapcomponents) let age = datecomponents.year self.agevaluelabel.text = nsnumberformatter.localizedstringfromnumber(nsnumber(integer: age), numberstyle: nsnumberformatterstyle.nostyle) } catch{ print("not avaialble") } } currenthealthstore defined in appdelegate global variable: let currenthealthstore = hkhealthstore() and error received once line executed: let birthdate = try currenthealthstore.dateofbirthwitherror() this code works me in swift 2, xcode

how to install multiple tables to a mysql database with php pdo -

i creating cms , have created self installer creates tables in database. i using php code works great on wamp script quites after 10 files on server. if (!$db = new pdo('mysql:host='.$dbhost.'; dbname='.$dbname, $dbuser, $dbpass)){$msg = 'e|could not connect.';} elseif ($db = new pdo('mysql:host='.$dbhost.'; dbname='.$dbname, $dbuser, $dbpass)){ $sql = ''; foreach(glob('sql/*') $file) {$sql .= file_get_contents($file);} $db->exec($sql); } there total of 48 txt files in sql/ this: -- -- table structure table `block_grids` -- create table if not exists `block_grids` ( `block_grid_id` int(12) not null auto_increment, `block_grid_name` varchar(25) not null, `row_items_small` tinyint(2) not null, `row_items_medium` tinyint(2) not null, `row_items_large` tinyint(2) not null, `equalize_block_grid` tinyint(1) not null, primary key (`block_g

android - How to upload a bitmap to facebook using BitmapFactory -

i working on project need upload photos android app facebook. have installed facebook sdk , done everything, managed upload status , drawables facebook. however, picture take before uploading facebook saved in bitmap variable, , when write in line of code : "bitmap image = bitmapfactory.decoderesource(getresources(), bitmap);" i error : the method decoderesource(resources, int) in type bitmapfactory not applicable arguments (resources, bitmap) is there anyway solve problem? here entire code "i found on website": public class addrestaurantactivity extends fragmentactivity{ private callbackmanager callbackmanager; private loginmanager loginmanager; private static final int camera_request = 1888; static string str_camera_photo_imagepath = ""; private static file f; private static int take_photo = 2; private static string str_randomnumber = ""; static string str_camera_photo_imagename = &qu

"Windows can't open this file" for .appref-ms extension -

Image
i'm trying run clickonce installer , useless error message windows 7: "windows can't open file". the file extension .appref-ms has seen or have advice? i had issue on client's machine. appears operating system not know correct association file extension, in reality .appref-ms not normal extension , not directly associated program. i found following page eventually: https://social.msdn.microsoft.com/forums/windows/en-us/9ff7867c-7e57-468c-a632-762a76f66f6d/windows-7-64-bit-unable-to-open-apprefms this contains information on restoring potentially damaged registry keys, can cause issue. however, in opinion gives wrong advice associate dfshim.dll .appref-ms. when did this, created association dll in registry, upon checking registry of working machine, no such association exists. association causes .appref-ms files lose application specific icons, , display instead icon: in addition, association did not launch application successfully, o

c++ - Including library in AIR Native Extension causes the error, "The extension context does not have a method with the name..." for all methods -

i working on air native extension (ane) windows desktop. point of extension able call out third-party c library, consists of 2 .h files defining method signatures/typedefs, , .lib file. before including third party library in project, first confirmed set correctly building ane simple "sayhello" function in dll creates , returns string. having verified can call sayhello air application , response, proceeded add function initializes third-party library. things went sideways. dll compiles fine, , i'm able package ane without error, when try call ane function air, following error: " the extension context not have method name ..." in air, call createextensioncontext() succeeds , returns extensioncontext object, i'm not able call native functions. what's more, visual studio's debugger no longer loads symbols dll - dll not appear in modules window , cannot set breakpoints in native code. if comment out line call third-party library's

java - UnsupportedClassVersionError When Running JNI -

i'm getting unsupportedclassversionerror error when calling findclass() when running c++ application on redhat linux. we're c++ shop , we're using jni in order use java library given third party broker interface systems. the program had not been recompiled in couple of years older c++ library program used deprecated had recompile program. when try run program we're getting error. exception in thread "main" java.lang.unsupportedclassversionerror: tradingenginewrapper : unsupported major.minor version 52.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:621) @ java.security.secureclassloader.defineclass(secureclassloader.java:124) @ java.net.urlclassloader.defineclass(urlclassloader.java:260) @ java.net.urlclassloader.access$000(urlclassloader.java:56) @ java.net.urlclassloader$1.run(urlclassloader.java:195) @ java.security.accesscontroll

javascript - jQuery bind on keypress not firing -

i trying bind keypress , change of form values update function end user can see effect of updates real time. reason not firing @ all. html <fieldset class="iops-field"> <legend>iops/bandwidth</legend> <table> <tr> <td> <input type="radio" name="bandwidth" value="iops-block" checked>iops @ block size: </td> <td> <input type="text" name="iops" id="iops" value="500000" size="3"> @ <select id="block-size"> <option value="4096" selected>4k</option> <option value="8192">8k</option> <option value="16384">16k</option> <option value="32786">32k</option>

numpy - Finding the number of values that satisfy something in a matrix, without using loops. Python -

i write function takes 3 arguments: matrix 1, matrix 2, , number p. functions outputs number of entries in difference between matrix 1 , matrix 2 bigger p. instructed not use loops. i advised use x.sum() function x ndarray. i don't know here. the first thing want subtract m2 m1. have entries, 1 of either or not bigger p. i tried find way sum function, afraid can't see how can me. the thing can think going through entries, not allowed to. appreciate in this. no recursion allowed well. import pandas pd # pick value of p p = 20 # instantiate fake frames = pd.dataframe({'foo':[4, 10], 'bar':[34, -12]}) b = pd.dataframe({'foo':[64, 0], 'bar':[21, 354]}) # absolute value of difference c = (b - a).applymap(abs) # boolean slice, sum along each axis total number of "true"s c.applymap(lambda x: x > p).sum().sum()