Posts

Showing posts from September, 2015

Block Reference Hyperlink property in AutoCAD 2014 with VBA? -

i have .dwg file has hundreds of block references. trying create hyperlink pdf file of block references. pdf on d drive. for example, names of block refernece are: '2:test', '26:test', '234:test' . hyperlink each point be: '2:test' hyperlink d:\reports\file-002.pdf ; '26:test' hyperlink d:\reports\file-026.pdf ; '234:test' hyperlink d:\reports\file-234.pdf . from block references number before ':', , matching pdf 'file-' followed number before ':' in 3 digits. there lot of these hands, , think can program this. i have enough basic programming knowledge manipulate string number , convert in 3 digits. question have and/or need how cycle through each block reference(for loop) on file , able write hyperlink property? possible? before coming here kind of looked @ these links did not prove helpful: link1 ; link2 ; link3 thanks hints update private sub commandbutton1_click() dim readdata string ...

HTML Form with input type 'Image' not responding to click -

in 1 of cells in table, have image. idea when user clicks on image, php script supposed run. image displays (as else), there no response click event. <td id="btn_delete" <form action="delete_item.php"> <input type="image" src="images/delete.png"> </form> </td>" i'm thinking maybe there no onclick event here??? read documentation, seems there is. doing wrong or there using image in form won't allow click event? if so, how can accomplish this? thanks! one issue see missing right arrow on first td: <td id="btn_delete" should be: <td id="btn_delete">

javascript - return highlighted cells to php -

so using example code link select cells on table dragging build grid of numbers 1-192 part works great, curious how return "highlighted" cells php? <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title></title> <style type="text/css" media="screen"> table td { width:50px; height:50px; text-align:center; vertical-align:middle; background-color:#ccc; } table td.highlighted { background-color:#999; } </style> </head> <body> <form action='test.php' method='post'> <table cellpadding="0" cellspacing="1" ...

java - Creating a room by reading from a file (for a game) -

basically have make game , need create room reading file, one: # # 0 d room0.txt 0 # 1 e room1.txt 0 # wwww0wwwww w w w w w w w w w w w w w w w w w w w 1 wwwwwwwwww the "#" means can skip lines(they're information) , "w" places need put wall, numbers doors , blank spaces floor. i figured best way create room create method receives file , reads , put "information" string[10][10], , create method(or in main) receives string[10][10] created , creates room(adds images room), having difficulties reading file if guys me part thankful. the error when run program on line: if(r[x][y].equals("w")) if guys need class, image of game should or else forgot show please let me know , help. public void generateroom(file file){ if(file.exists()){ scanner sc = null; string[][] r = new string[10][]; int row = 0; try { sc = new scanner(fi...

css - Cherry Framework 4 - Change footer bootstrap settings -

i have wordpress website uses cherry framework 4 , wonder how theme works. in footer see this: <footer id="footer" class="site-footer wide" role="contentinfo"> <div id="static-area-footer-top" class="footer-top static-area"> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-5 col-md-5 col-lg-5 static-footer-menu"></div> <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 static-footer-logo"></div> </div> </div> </div> <div id="static-area-footer-bottom" class="footer-bottom static-area"> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-5 col-md-5 col-lg-5 static-footer-info"></div> ...

bash - exit code from ssh command -

i'm trying retrieve code return script: #!/bin/bash echo "cm 1" ssh -i key/keyid.ppk user@x.x.x.x " grep blabla ddd if [ ! $? -eq 0 ]; exit 1; fi " echo $? but last command echo $? returns 0 instead of 1. and if try run separately (not script) : the ssh command: ssh -i key/keyid.ppk user@x.x.x.x grep blabla ddd => msg "grep: ddd: no such file or directory" then: if [ ! $? -eq 0 ]; exit 1; fi then: echo $? => returns 1 expected do have idea why doesn't work in script ? thank you this code ssh -i key/keyid.ppk user@x.x.x.x " grep blabla ddd if [ ! $? -eq 0 ]; exit 1; fi " evaluates $? in shell , not in remote one, because $ not escaped in single quotes. should escape reach desired behaviour. once avoid evaluation in local shell, second time avoid evaluation when passed bash on remote side. or rather put command single quotes: ssh -i key/keyid.ppk user@x.x.x.x ' grep blabla ddd if [ ! $? -eq ...

c++ - cocos2d-x: writing words on screen in multiple lines -

in cocos2d-x when use cclabelttf writes words in consecutive order. there class in cocos2d-x gets place,width, height , string inscribe in rectangle on screen , if string's length bigger rectangle's size, breaks in multiple lines? what method of cclabelttf class? bool initwithstring (const char *string, const char *fontname, float fontsize, const ccsize &dimensions, cctextalignment halignment, ccverticaltextalignment valignment)

jquery - I'm trying to add a small javascript piece to a web page, but it just displays the code on the page -

like title says, i'm trying add small javascript piece web page, keeps glitching , shows code, can help? (for want know, here's javascript piece): var draw = function() { background(0,0,0); strokeweight(10); stroke(0,255,0); ellipse(mousex,mousey,350,350); strokeweight(5); fill(0,0,0); stroke(0,255,0); ellipse(mousex,mousey,300,300); strokeweight(1); stroke(0,255, 0); fill(0,0,0); ellipse(mousex,mousey,250,250); ellipse(mousex,mousey,155,155); ellipse(mousex,mousey,145,145); ellipse(mousex,mousey,135,135); ellipse(mousex,mousey,125,125); ellipse(mousex,mousey,115,115); ellipse(mousex,mousey,105,105); ellipse(mousex,mousey,95,95); ellipse(mousex,mousey,85,85); ellipse(mousex,mousey,75,75); ellipse(mousex,mousey,65,65); ellipse(mousex,mousey,55,55); ellipse(mousex,mousey,45,45); ellipse(mousex,mousey,35,35); ellipse(mousex,mousey,25,25); ellipse(mousex,mousey,15,15); ellipse(mousex,mousey,5,5); line(200,0,mousex,mousey-150); line(0,200,mousex-150,mousey); l...

node.js - How can i see my mongodb datebase content in browser using NodeJS -

i have database created mongodb, have connected wiht nodejs, works, donn't know how can see database content in web browser. can me thanks here nodejs code: var url = 'mongodb://localhost:27017/mydb'; var mongodb = require('mongodb'); var mongoclient = mongodb.mongoclient; mongoclient.connect(url, function(err, db) { if (err) { console.log('unable connect.error: ',err); } else {console.log('connection established to',url); } }) have @ mongo-express . it's full-blown mongodb web ui, written in node.js

PHP/MySql Determining age/Elapsed Time of inserted data -

i have no idea on how explain this, if @ http://www.gw2lfg.com , elapsed time column trying do, determine if minute old, 2 minutes old, etc. help your looking time elapse can following. unix_timestamp('2012-12-01 12:12:12') - unix_timestamp(curtime()); you can convert seconds , minutes.

android - Persistent error -Execution failed for task ':app:transformClassesWithJarMergingForDebug' -

i trying add microsoft azure mobile services existing android app. after adding .jar files in folder. getting error: execution failed task ':app:transformclasseswithjarmergingfordebug. for various file annotation.class , gson$5.class , can see in error file shows apijsonoperationcallback.class . have tired lot of things(such ./gradlew clean , ./gradlew clean assemble) have been running deadends everywhere. this gradle file apply plugin: 'com.android.application' android {compilesdkversion 23 buildtoolsversion "23.0.2" defaultconfig { applicationid "com.example.jino.navigationplacepicker" minsdkversion 17 targetsdkversion 23 versioncode 1 versionname "1.0" } defaultconfig { multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } buildscript { repositories...

git - Intellij IDE can't import project from gitHub -

i can't seem import project github. error message saying: "clone failed: unable access ' https://github.com/mygithubusername/projectname.git/ ': error setting certificate verify locations:" i've heard people have error before, key difference intellij doesn't specify locations. console pasted above ctrl+a, i'm 100% sure didn't miss text. doesn't problem is. when try checkout vcs on intellij start screen, test url , response "repository test has failed". what's causing problem? i have git installed , email set in git-bash. i'm running intellij 2016.1.1 your certificate outdated, that's why. the easiest solution switch ssh protocol ( git:// ) after setting ssh keys. once setup keys , after adding them github account change clone protocol , able clone , work.

asp.net mvc - routing issue in mvc4 -

i have issue in routing in mvc 4 my url goes http://localhost:portnumber/session/view?id=918&pid=186 i want url this http://localhost:portnumber/session/view/918/186 i have view @html.routelink("more..", "default", new {controller="session",action="view",id=e.id,pid=e.pid }) routes.maproute( name: "sessionview", url: "{controller}/{action}/{id}/{pid}", defaults: new { controller = "session", action = "view", id = urlparameter.optional, pid = urlparameter.optional } ); the problem you're not referring correct route. in routing table, you've added route name "sessionview", in @html.routelink, refer route called "default". the correct call should be: @html.routelink("more..", "sessionview", new {controller="session",action="view",id=e.id,pid=e.pid })

javascript - Iframe border issue in IE8 -

i trying add iframe in page. working fine in browser except ie8. i have checkout stackoverflow.com . many of suggestion frameborder="0" . scenario dont have access edit line . tried using java script setattribute unfortunately not working in ie8 . function removeborder() { document.getelementbyid("myframe").frameborder="0"; } is there possibility create dynamic attribute ? could please me ? in advance. this proper way create attribute in js var att=document.createattribute("frameborder"); att.value = "0"; document.getelementbyid("myframe").setattributenode(att); source : w3s advice : read more dom elements , how manipulate them

python - Bilinear upsample in tensorflow? -

i want simple bilinear resize (not integer factor) in tensorflow. example, starting (32,3,64,64) tensor, (32,3,96,96) tensor, each 64x64 has been rescaled factor of 1.5 using bilinear interpolation. best way that? i support arbitrary factors > 1, not 1.5 specifically. note: operation on each 64x64 same skimage.transform.rescale (scale=1.5, order=1) does. tf.image.resize_images should need. accepts both 3d (single image) , 4d (batch of images) tensors, arbitrary depth (number of channels). should work: # it's height, width in tf - not width, height new_height = int(round(old_height * scale)) new_width = int(round(old_width * scale)) resized = tf.image.resize_images(input_tensor, [new_height, new_width]) bilinear interpolation default don't need specify it. use resize_bilinear directly.

surfaceview - Android: Application lost the surface when recording to dynamic object -

i in bit of pickle. trying display camera feed while view launched background service. getting runtime error 04-19 15:00:31.872 31125-31442/csce483.vbox e/recorder: starting prepare 04-19 15:00:31.872 31125-31442/csce483.vbox e/mediarecorderjni: application lost surface 04-19 15:00:31.872 31125-31442/csce483.vbox e/recorder: starting record 04-19 15:00:31.872 31125-31442/csce483.vbox e/mediarecorder: start called in invalid state: 4 when use dynamically created view. , static view not compatible window manager. in oncreate(): try { mcamera = camera.open(); } catch (exception e) { e.printstacktrace(); } msurfaceview = (surfaceview) view.inflate(getbasecontext(),r.layout.camera,null); //msurfaceview = (surfaceview) findviewbyid(r.id.surfaceview); mholder = msurfaceview.getholder(); mholder.addcallback(this); mholder.settype(surfaceholder.surface_type_push_buffers); msurfaceview.setvisibility(view.invisible); yourbr = new myreceiver(); yourbr.setmainactivityhandler(t...

Natural deduction for predicate logic -

i've been stuck on particular predicate logic problem (using coq) long time. i've solved 30-40 predicate logic problems 1 can't figure out. this problem: ~all x, (p(x) / (q(x) -> t(x))) -> ~all x, t(x). or in box form can send me in right direction? thanks! edit: this coq code problem: variables p q t : d -> prop. theorem pred_015 : ~all x, (p(x) \/ (q(x) -> t(x))) -> ~all x, t(x). proof. imp_i h. qed. it looks me using old version of coq. after adding missing declaration d , , replacing all forall , statement not provable. however, if had set of parentheses, goal provable. see following code: variable d : set. variables p q t : d -> prop. theorem pred_015 : (~forall x, (p(x) \/ (q(x) -> t(x)))) -> ~forall x, t(x). proof. now, don't think should giving solution here, in public, it's quite easy if remember ~h defined h -> false .

android - Disable ActionBarDrawerToggle's drawer indicator, but keep the hamburger icon -

in main activity i'm getting references drawerlayout , toolbars this: //set toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); //set navigation drawer drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); hamburger = new actionbardrawertoggle( this, drawer, toolbar, r.string.navigation_drawer_open, r.string.navigation_drawer_close); drawer.setdrawerlistener(hamburger); hamburger.syncstate(); in 1 of fragments, want disable 1) swiping open nav drawer , 2) hamburger/toggle button toggle nav drawer opening currently, i'm doing this: mainactivity = (mainactivity)getactivity(); mainactivity.drawer.setdrawerlockmode(drawerlayout.lock_mode_locked_closed); mainactivity.hamburger.setdrawerindicatorenabled(false); mainactivity.hamburger.syncstate(); swiping correctly handled - no longer opens drawer. the hamburger icon has disappeared though. ideally, want hamburger icon remain on screen, ...

C# regex to find all spaces which are not behind a specified word -

i'm having trouble create .net-regex finds spaces not behind word pi. this given string "y + pi + s + 1 = x" i tried "(?!pi\s)\s" finds every space , didn't exclude 1 after "pi". used .net regey tester any appreciated the issue regex it's looking double-space*: \s in look-behind makes "a space preceded 'p' , 'i' , '' , not space preceded 'p' , 'i' the fix straightforward - remove \s lookbehind: (?<!pi)\s note regex skip spaces preceded longer words ending in pi well, such principi . if not want these matches, add \b in front of pi : (?<!\bpi)\s * note syntax lookbehind wasn't correct because of missing < . assume typo.

metaprogramming - Remove a const qualifier from a variable in D -

i want create non-const copy of variable. doing inside templated function, has in ref input, type ( t ) has const set. see constof function in https://dlang.org/phobos/std_traits.html cannot find inverse can non-const type t . you might interested in std.traits.unqual . note gives type all qualifiers removed, not const .

angularjs - ng-model not working with radio buttons in angular -

i have simple form radio buttons pulls values server , loops through them provide radio buttons: <form ng-submit="createsubcategory(subcategory)"> <div ng-repeat="sub_category in event_sub_categories" > <label class="item item-radio"> <input type="radio" ng-model="subcategory" ng-value="'{{sub_category}}'" > <div class="radio-content"> <div class="item-content"> {{sub_category}} </div> <i class="radio-icon ion-checkmark"></i> </div> </label> </div> <div class="padding"> <button type="submit" class="button button-block button-positive">continue</button> </div> </form> the form di...

Spring Security - Custom PreAuthorize Annotation? -

i'm guessing answer no here, wondering if there way create custom annotation this: @documented @inherited @retention(retentionpolicy.runtime) @target({elementtype.type, elementtype.method}) @preauthorize("hasauthority('" + permissionrequired.value() + "')") //doesn't work public @interface permissionrequired { string value(); } so can this: @permissionrequired("create_user") public user createuser(user newuser){ //.. } but there doesn't seem way refer composing annotation, i'm doing above. doesn't @aliasfor solve, i'm not using field directly, i'm concatenating string. my goal here create security annotations not require spel. jsr-250 rescue! enable on application class: @enableglobalmethodsecurity(prepostenabled = true, jsr250enabled = true) public class myapplication { //.. } use annotation: @rolesallowed({"role_create_user"}) public user createuser(user newuser){ //.. } it...

html - CSS - How do I float one element to the right inside the other div? -

i have div, inside div have 2 smaller ones, 1 of them left, , other 1 right, width of parent div not increase, how can make does? i want red div increased height when div's inside bigger. <div class="wrap"> <div class="left"></div> <div class="right"></div> <div class="footer"> </div> </div> .wrap{ margin:auto; width:960px; min-height:50px; background:red; } .left{ width:450px; height:100px; background:blue; float:left; } .right{ width:450px; height:100px; background:green; float:right; } .footer{ width:100%; height:100px; background:#000; } fiddle . you can add after second div: <div style="clear: both;"></div> or read clearfix

javascript - recursive method making issue in events -

if call test(3) i'm getting alert message 1. function test(param) { var tt = [ "a", "b", "c" ]; ( var = 0; < param; i++) { if (tt[i] == "b") { test(1); alert(i); } } } but it's not working in success event. if call below method test(3) , pls consider it's success request. getting alert message 3. function test(param) { var tt = [ "a", "b", "c" ]; ( var = 0; < param; i++) { if (tt[i] == "b") { ext.ajax.request( { url : 'test.do', method : 'post', success : function(response) { test(1); alert(i); } }); } } } you need put i in closure around asynchronous function call. can realize using iife, creates scope inside for-loop, in value of i preserved: ...

java - Missing artifact org.springframework:spring-context:jar:${org.springframework-version} -

please why getting error in pom.xml file missing artifact org.springframework:spring-context:jar:${org.springframework-version} xml file <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context</artifactid> <version>${org.springframework-version}</version> <exclusions> <exclusion> <groupid>commons-logging</groupid> <artifactid>commons-logging</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid> <version>${org.springframework-version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-tx</artifactid> <version>${org.springframework-version}</version> </d...

javascript - How to access class variable in callback in Typescript? -

here current code: import {page} 'ionic-angular'; import {ble} 'ionic-native'; @page({ templateurl: 'build/pages/list/list.html' }) export class listpage { devices: array<{name:string, id: string}>; constructor() { this.devices=[]; } startscan (){ this.devices = []; // "this" exists , works fine ble.scan([],5).subscribe( (device)=>{ if(device.name){ this.devices.push({name:device.name,id:device.id}); // this.devices not exists } }, (err) => { console.log(json.stringify(err)); } ); } connecttodevice(device){ ble.connect(device.id).subscribe(success=>{ console.log(json.stringify(success)); }); } } when calling startscan function trying push returned device array, however, this.devices not available. have tried saving (self=this), still no luck. can me understand missing? update: setting ...

python - Data preparation for scikit learn decision tree -

i'm trying prepare dataset scikit learn, planning build pandas dataframe feed decision tree classifier. the data represents different companies varying criteria, criteria can have multiple values - such "customer segment" - which, given company, any, or of: smb, midmarket, enterprise, etc. there other criteria/columns multiple possible values. need decisions made upon individual values, not aggregate - company smb, company midmarket, , not "grouping" of customer smb , midmarket. is there guidance on how handle this? need generate rows every variant given company fed learning routine? such input of: company,segment a,smb:mm:ent becomes: a, smb a, mm a, ent as other variants may come additional criteria/columns - example "customer vertical" include multiple values? seems increase dataset size. there better way structure data and/or handle scenario? my ultimate goal let users complete short survey simple questions, , map responses values...

TypeError with Python regex package -

installed regex using pip , typeerror when trying import regex pip3 install regex python3.4 >>> import regex traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/local/lib/python3.4/site-packages/regex.py", line 683, in <module> _pattern_type = type(_compile("", 0, {})) file "/usr/local/lib/python3.4/site-packages/regex.py", line 545, in _compile parsed = parsed.optimise(info, reverse) typeerror: optimise() takes 2 positional arguments 3 given why happen ?

c# - Newtonsoft.Json Custom Root Name for Deserialization -

i have class defines json format: public class resulttype { public bool status { get; set; } public string message { get; set; } } the actual json looks this: {"result":{"status":true,"message":"success"}} how can override root attribute when de-serializing json "result" jobject jsonresponse = jobject.parse(jsonstring); resulttype _data = newtonsoft.json.jsonconvert.deserializeobject<resulttype>(jsonresponse["result"].tostring()); console.writeline(_data.status); fiddle: https://dotnetfiddle.net/gjys2p

java - How do I debug my Android app on Samsung -

i trying debug first app. have samsung galaxy s3 android jelly bean (i'm windows user) , have installed latest version of kies , have installed required drivers device. following steps debug in android getting started tutorial, have not been able debug app on phone or in emulator. actually don't care fo emulator @ point since app hello world app. need see on device can't , don't know i'm doing wrong, if anythin. when hit debug button in android studio , , select device device debug on popup dialog, android studio displays following error: installing myapplication device shell command: pm install -r "/data/local/tmp/myapplication" pkg: /data/local/tmp/myapplication failure [install_failed_invalid_apk] i have searched error solutionts have seen telling me things i've done! how can debug app on samsung gs3 using android studio? whats package name ? must have 1 "." @ least

php - preg_replace - adding a protocol to href and src elements -

is possible add protocol urls (href & src) don't contain protocols ? for example, replace url: <a href="/page/image.png" target="_blank">text</a> to: <a href="http://my-webpage.com/page/image.png" target="_blank">text</a> but important 2 things: if original url in href/src starting slash "/", protocol domain should add without slash on end when original url isn't starting slash - protocol domain should add slash, if original url starting "../" or "./" etc. - should remove , then, protocol domain should add slash. is possible in 1 regex ? thanks. edit: there code: $url = 'http://my-page.com/'; $html = file_get_contents($url); preg_match('"charset=([a-za-z0-9\-]+)"si', $html, $charset); $charset = strlen($charset[1]) > 3 ? $charset[1] : 'utf-8'; $html = mb_convert_encoding($html, 'html-entities', $charset); pr...

objective c - Cant stub a method using OCMock -

i using ocmock on objc project. i have following code: db_account *lena = [[db_account alloc] init]; lena.nicename = @"lena"; lena.userid = @"lena"; id mockstoragemanager = ocmclassmock([v4_storagemanager class]); [[[mockstoragemanager stub] andreturn:lena] getaccountbydbid:@1]; id mockdbnotificationmanager = ocmclassmock([dbnotificationmanager class]); id partialv4dbnotificationmanagermock = ocmpartialmock([v4_dbnotificationmanager manager]); [[[mockdbnotificationmanager stub] andreturn:(notificationpolicy *)[notificationpolicy never]] getnotificationpolicy]; [[[partialv4dbnotificationmanagermock stub] andreturn:mockdbnotificationmanager] dbnotificationmanager]; bool shouldshow = [[v4_dbnotificationmanager manager] showonloginexpired:lena]; assertthatbool(shouldshow,is(isfalse())); this code fails compile on following line: [[[mockdbnotificationmanager stub] andreturn:(notificationpolicy *)[notificationpoli...

403 permission denied for google drive api PHP -

i'm having trouble authenticating both calendar api , google drive api. had calendar api working, , wanted add google drive attachment functionality it, can't work. it's giving me error error occurred: error calling https://www.googleapis.com/drive/v2/files : (403) insufficient permission here code: define('client_secret_path', __dir__ . '/client_secret.json'); $client->setauthconfigfile(client_secret_path); $client->addscope("https://www.googleapis.com/auth/drive"); $client->addscope("https://www.googleapis.com/auth/calendar"); $googleservice = new google_service_calendar($client); $drive_service = new google_service_drive($client);*/ define('scopes', implode(' ', array( google_service_drive::drive_metadata_readonly) )); // setup google calendar class $googleclient = new google_client(); $googleclient->setapplicationname('test'); $googleclient->setscopes(scopes); $googleclient->ad...

php - PHPMailer working in browser but not working in command prompt -

i write code send mail using phpmailer include 'class.phpmailer.php'; $mail = new phpmailer(); $mail->issmtp(); $mail->smtpauth = true; $mail->smtpsecure = 'ssl'; $mail->smtpdebug = 1; $mail->host = 'smtp.gmail.com'; $mail->port = 465; $mail->username = 'example1@gmail.com'; $mail->password = 'password'; $mail->setfrom('example2@gmail.com', 'admin'); $mail->addreplyto('example@yahoo.com', 'name'); $mail->addaddress('xample3@gmail.com'); $mail->subject = 'active email'; $mail->msghtml('click link active'); $mail->send(); when use browser can send mail, in command prompt, php path_to_file it not working,the error is: smtp -> error: failed connect server: unable find socket transport ssl".... i'd guess it's php configuration. http server , command line aren't using same file, , 1 used command line missing incl...

mysql - PHP: How to make browser to download file on click -

php beginner. file uploading successful browser doesn't download files, instead reads file. referred other threads , found below code not working. want download files when click on hyperlink download . selected path mysql database. $rows = mysqli_num_rows($result); if($rows>0) { while($row = mysqli_fetch_assoc($result)) { ?> <div> <?php echo $row['object_name'];?> <a href="<?php $file_url = $row['object_path']; header('content-type: application/octet-stream'); header("content-disposition: attachment; filename=\"".$row['object_name']. "\""); readfile($file_url); ?>">download</a><br> ...

open video file with opencv java -

so there opencv java now... ! can tell me how open videofiles ? i tryed , on internet, found nothing. documentation of videocapture class not helpfull, becaus gives c# example , show how capture webcam. the q&a of opencv doesnt either, because there no (public) method whom can give filename string. but should work written in api. doesn't there privte method in videocapture class sting parameter. please answer if have solution, or if have same problem. garyee update: (may 2017) since version 3.0.0 there constructor videocapture class takes string argument. there easy solution problem now! to me mystery why called automatically generated java wrapper opencv lacking functionality. first created new videocapture class videocapture(string filename) constructor , called private native method. lead an unsatisfied link error: exception in thread "main" java.lang.unsatisfiedlinkerror: org.opencv.highgui.videocapture.n_videocapture(ljava/lang/...

LRU algorithm to determine which block to be replaced -

for on-chip cache, 80486 uses replacement algorithm called pseudo least used. associated each of 128 sets of 4 lines (labeled l0, l1, l2, , l3) 3 bits b0, b1, , b2. replacement algorithm works follows: when line must replaced, cache first determine whether recent use pair l0/l1 or pair l2/l3. cache determine of pair of blocks least used , mark replacement. specify how bits b0, b1, , b2 used in replacement algorithm , demonstrate approximates true lru algorithm through example of line useage order algorithm differ lru algorithm. i confused on how go answering question. didn't hardly talk lru @ let alone algorithms implement it. run this: if b0 0, l0/l1 used. if b0 1, l2/ l3 used. there though don't know b1 , b2. can explain me?

How do I update a single record from an spl server 2012 datatable using a c# datareader and a stored procedure? -

i need know how update single record sql server 2012 datatable using c# datareader , stored procedure. have stored procedure allows me update single record in datatable. can't figure out how use c# data reader update record in datatable. example, have female student in college class i'm teaching , gets married, need select record student info datatable , change last name new married name. in advance help. a datareader disconnected, read-only. that's why there aren't methods updating values. you said have stored procedure updating. execute create sqlconnection , sqlcommand , add parameters when execute command generates sqldatareader . instead of calling executereader() typically call executenonquery() . that's used executing query doesn't return results. returns number of updated rows.

objective c - viewForAnnotation didn't get called (iOS noob) -

Image
i know question has been asked others before , have read them in forum previously, have tried proposed approach without luck far decided post question. i have piece of code below meant change pin icon on mkmapview. viewforannotation function doesn't seem called mkmapview. people said got problems delegating function file's owner can done dragging map view in .xib file file owner or defining mymap.delegate = self. have done both ways still nothing. really appreciate problem, thanks. code: - (mkpinannotationview*)mymap:(mkmapview*)mymap viewforannotation:(id<mkannotation>)annotation{ mkpinannotationview *pin = [[mkpinannotationview alloc]initwithannotation:annotation reuseidentifier:@"custompin"]; uiimage *icon = [uiimage imagenamed:@"bustour.png"]; uiimageview *iconview = [[uiimageview alloc] initwithframe:cgrectmake(8,0,32,37)]; if(icon == nil) nslog(@"image: "); else nslog(@"image: %@...

node.js - Any way for Mongoose to continue save if validation fails for some changes? -

in schema i've set minimum length requirements keys. mphone: {type: string, minlength: 1}, hphone: {type: string, minlength: 1}, wphone: {type: string, minlength: 1}, the information above populated through form user submits. when user submits form, following runs save information db. var query = sample.where({'sample.email' : username}); query.findone(function(err, sample) { if(err) { console.error(err); } else { sample.mphone = req.body.mphone; sample.hphone = req.body.hphone; sample.wphone = req.body.wphone; sample.save(function(err) { if(err) console.error(err); }); } however, if user fills out 1 of fields in form , submits (for instance, fill out mphone), because of validation on schema, whole save operation rejected. there setting allow mongoose reject invalid fields , save, say, mphone? guess test , save each 1 individually, i'd know if there more efficient way. so...

javascript - input blur doesn't get fired -

$('.newbill').find('input').focus(function(){ if($(this).hasclass('roomnumber')){ return false; }else{ $('.roomnumber').change(function(){ if($('.roomnumber').val() != null && $('.roomnumber').val() != ""){ roomnumberfocusout(".roomnumber"); }else{ getsystemmessage('please enter room number proceed.'); } }) } }) i use above code fire method if user changes focus out .roomnumber input. check whether input on .roomnumber element changed if not changed not fire function. doesn't fired when focus changed using mouse. instead if use tab go next element gets fired. can make function fire in mouse click on input. you may use blur event of input http://api.jquery.com/blur/

The value of the parameter must be from -180.0 to 180.0 when getting current geocoordinates in windows phone 8 application -

here code geocoordinatewatcher geowatcher = new geocoordinatewatcher(); geowatcher.start(); geoposition item = new geoposition(); if (double.isnan(geowatcher.position.location.altitude)) item.altitude = 0; else item.altitude = geowatcher.position.location.altitude; item.longitude = geowatcher.position.location.longitude; item.latitude = geowatcher.position.location.latitude; geowatcher.stop(); geocoordinate=new geocoordinate(item.latitude, item.longitude, item.altitude); at last line getting following exception. type argumentoutofrangeexception exceptionmessage value of parameter must -180.0 180.0. parameter name value why getting wrong coordinates? what problem?

Docker Swarm + Docker Compose: running linked containers on different nodes? -

i have application i'm running on single host via docker compose file. containers communicate 1 via rabbitmq container (so they're linked). app starting require more resources single host able provide, thought docker swarm ideal since should able spin same set of containers via same compose file on distributed nodes. however, appears linked containers constrained reside on same node, setting docker swarm on multiple nodes won't lead container distribution i'm looking for. the ambassador pattern seems recommended way separate linked containers (by setting proxies linked containers on each node), i'm having trouble using in docker-compose file since examples i've seen show setting each node docker run, using ip of node running shared service (rmq in case) set environment variable tell client's ambassador container route data linked service (as in https://docs.docker.com/engine/admin/ambassador_pattern_linking/ ). how can translated compose file such do...

svn - Subversion checkout restriction -

i working on subversion & tortoise client, every thing working fine users restriction except checkout, when user checkout or use repo browser folders viewable & copy while not able write on of directories per restriction, want can able checkout or repo-browser folder he/she has access. this has nothing client. has server. subversion has several standard methods of server running. can use own simple server called svnserve or use apache via several modules, or can use combination of svnserve , sshd . the question how server being executed. possible setup repository restrict parts of repository user can or cannot checkout, depends upon system. check out subversion online manual on server management -- section on access controls . it'll give idea how can restrict access repository.

rails 4.2 capistrano 3 unbuntu nginx puma, geting routing error/no assets shows up -

after following tutorial , tried able set rails application on ec2 unbuntu instance, running nginx web server , puma app server, deployed capistrano 3. however, none of assets showing up, , i'm getting routing errors basic functions of devise gem such logging out. chrome dev tool console shows 404 errors compiled application.css , application.js files. i think assets there because if ssh instance , go folder app is, can see bunch of files under public/assets. also, if check capistrano logs, can find line bundle exec rake assets:precompile , , status successful. tried things going production.rb file , changing c onfig.serve_static_files = env['rails_serve_static_files'].present? config.serve_static_files = true but still no assets. think biggest suspect there sort of routing error, because don't understand how web servers, app servers, , aws instances interact each other. point me in right direction on debugging this? if need see specific config file please comm...

java - Overflowing issue when allocating tree nodes -

i'm working on problem requires me generate n-ary tree based on given vertex pairs, read in input file. current node class: public class node<t> { private int idx; private int data; private node<t> parent; private list<node<t>> children; // template new nodes public node() { this.idx = 1; this.data = 0; this.parent = null; this.children = new arraylist<node<t>>(); } public void insertnode(node<t> currnode, int leftidx, int rightidx) { if (currnode.idx == leftidx) { node<t> childnode = new node<t>(); childnode.idx = rightidx; childnode.parent = currnode; currnode.children.add(childnode); return; } (int = 0; < currnode.children.size(); i++) { node<t> tempnode = currnode.children.get(i); if (tempnode.idx == leftidx ) { ...

memory - Does a ds_map destroy sub-maps? -

i trying make lighting system in game maker , structure system want contain of lights in ds_map. want ds_map held inside second ds_map contains of lights in system lights { "l-01": {"x":20, "y":40, "radius":15}, ... } the question have regards cleaning system: have iterate through map destroying of sub-maps , destroy map, game maker automatically destroy sub-maps when light map gets destroyed? ds_map_destroy(lights); // sub maps ("l-01") destroyed? or have this: var k = ds_map_find_first(lights); repeat(ds_map_size(lights)){ ds_map_destroy(lights[? k]); k = ds_map_find_next(lights, k); } following along first question, if delete key game maker destroy sub-map ds_map_delete(lights, "l-01") // destroy map indexed under "l-01" you may ask: "why using ds_map hold bunch of ds_maps, why not create list of maps? answer comes second question. if held maps in list, , need delete 1 of maps l...

ios - Async method testing using XCTest -

i new xctest , started writing test cases. have written couple of functional test cases, got stuck in below async method call. read xctestexpectation class reference not able mock properly. it helpful if know how test below method. here details of method want test, - (void)getstudentinfo:(void (^)(bool))success failure:(void (^)(nserror *error))failure { // request formation code // here have post call afnetworking [httpsessionmanager post:uri parameters:para success:^(nsurlsessiondatatask *task, id responseobject) { failure:^(nsurlsessiondatatask *task, nserror *error) { }] } you need xctest expectations provide support async testing. here simplified example (in swift, same applies objective-c) func testasync() { let expectation = expectationwithdescription("waiting something") let someobject = ... someobject.dosomethingwithcompletion({ () in expectation.fulfill() }) waitfore...

responsive design - how to add a nav spacer in bootstrap -

Image
i creating nav menu using twitter bootstrap. in design there spacers between menus. if add border-right looks ok! when viewing in phone or smaller viewport want border-right become border-bottom in collapsed menu. how can achieve using boostrap? bigger viewport: smaller viewport: the divider-horizontal , divider-vertical classes used create separation/spacers between menus. you can either use these or customise these classes requirements. see examples usage @ - http://twitter.github.io/bootstrap/components.html#navs . note: requires additional markup, li element required class.

php - OneNote API fails to get any notes from shared notebook for sharing user -

as developer, i'm able (using php via rest api) notes notebook shared client. see, search me returns 25 notes within accessed section: { "@odata.context":" https://www.onenote.com/api/v1.0/ $metadata#me/notes/sections('0-240bd74c83900c17%21128584')/pages(title,id,links,contenturl)","@odata.count":25,"value":[ { ... but logged in (duly authenticated) client (and using same code), 0 notes: { "@odata.context":" https://www.onenote.com/api/v1.0/ $metadata#me/notes/sections('0-240bd74c83900c17%21128584')/pages(title,id,links,contenturl)","@odata.count":0,"value":[ ] } what needs done client not section in shared notebook (more importantly!) notes in section? first off apologies shared pages not being returned api. i've tracked issue down regional incident in our partner service. (user impact estimated <1% of total active users). ...

reactjs - Action not being called - flux react -

builder action positionrcomponent not called. doing wrong? check out commentline inside movebox function in buildview.js expecting output: printed in console. position r component below code snippets of buildview.js , builder-actions.js. buildview.js import react, {proptypes} 'react'; import builderstore '../stores/builder-store'; import builderactions '../actions/builder-actions' import update 'react/lib/update'; import itemtypes './itemtypes'; import rcomponent './rcomponent'; import { droptarget } 'react-dnd'; import html5backend 'react-dnd-html5-backend'; function getviewrcomponents(){ return( {components: builderstore.getviewrcomponents()}) } const rcomponenttarget = { drop(props, monitor, component) { const item = monitor.getitem(); const delta = monitor.getdifferencefrominitialoffset(); const left = math.round(item.left + delta.x); const top = math.round(item.top + delta.y); c...

Logstash relative filepath error when referencing Windows file -

i trying read local .jsonlines file on windows machine , keep getting following error: file paths must absolute, relative path specified: path => "c:\users[rest of filepath].jsonlines" here config file: input { file { path => "c:\users\[rest of filepath].jsonlines" start_position => "beginning" sincedb_path => "nul" } } filter { json{ source => "message" } } output { csv { fields => ["myfield1","myfield2","myfield3"] path => "c:\users\ [rest of filepath].csv" } } here's have tried: changing filepath linux-style (e.g. c:/users/[rest of filepath].jsonlines) lower-casing c (e.g. "c:\ users[rest of filepath].jsonlines") using double \ \ (e.g. "c: \ \users[rest of filepath].jsonlines" used double \ \ directories (e.g. "c: \ \users \ \ restof \ \ [filepath].jsonlines") what deal? ...

javascript - addEventListener() to my class with loop -

// color pattern function function colorpattern(color_pattern_box) { var color_board = $("#colorboard"); var rtrnval = ""; //default standard syntax var color_temp = (""); for(var c = 0; c < color_pattern_box.length; c++){ var color_split = color_pattern_box[c].split(":"); var color_name = color_split[0]; var color_value = color_split[1]; color_temp += "<div id="+color_value+"; data-title="+color_name+" onclick='' class='mycolor_warpper'; style='background: "+color_value+";'></div>"; var color_inset = $(".mycolor_warpper"); colorpattern_attachevent(color_inset, "click", updatenumbertext, jsonsave); } // //input option parent color_board.html(color_temp); } function colorpattern_attachevent(element, event, callbackfunction1, callbackfunction2) { if(typeof(element.ad...

node.js - NodeJS - Will TCP Net and HTTP Server Both Crash on Error? -

i running nodejs server uses both: net tcp server on 1 port (connection telematics hardware devices send data messages server) and http server on port (to run web app platform) these both running through 1 server.js file. if there error on 1 side, both crash , go down, or other still run independently? running on aws ec2 ubuntu, using forever module keep alive. if they're both started under same process (and not have appropriate error handling in place), answer yes. can have code structured want (e.g. tcp server in 1 file , http in another), if servers both started same node process, both go down if process dies due unhandled error events, uncaught exceptions, stack overflow, out of memory errors, etc.

python - Formatting Numbers Inside of a String -

currently i'm working api of online game play build tool, , in doing i've encountered problem. api returns json files user. while working on creating class parses these json files me i've realized i'd able format number inside of 1 of them instead of being "585677088.5" it's "585,677,088". easy enough if string contained number string contains bunch of other text well. here's block of text loan:0 unpaidfees:-3510000 total:585677088.5 i'm using python this. the existing code have in place is: import urllib2 data = urllib2.urlopen("url") like this: >>> my_str = """loan:0 ... unpaidfees:-3510000 ... total:585677088.5""" >>> map(lambda x: (x.split(":")[0], int(float(x.split(":")[-1]))), my_str.split("\n")) [('loan', 0), ('unpaidfees', -3510000), ('total', 585677088)]