Posts

Showing posts from August, 2012

ios - How to detect user successfully shared to Facebook with SLComposeViewController -

i created button in app share status on facebook slcomposeviewcontroller . how check whether user click share status? my code below: @ibaction func fbbtn(_ sender: any) { if slcomposeviewcontroller.isavailable(forservicetype: slservicetypefacebook) { let fbshare:slcomposeviewcontroller = slcomposeviewcontroller(forservicetype: slservicetypefacebook) self.present(fbshare, animated: true, completion: nil) } else { let alert = uialertcontroller(title: "accounts", message: "please login facebook account share.", preferredstyle: uialertcontrollerstyle.alert) alert.addaction(uialertaction(title: "ok", style: uialertactionstyle.default, handler: nil)) self.present(alert, animated: true, completion: nil) } } problem solved tq fbshare.completionhandler = { (result:slcomposeviewcontrollerresult) -> void in switch result { case slcomposeviewcontrollerresult.cancel

linux - Find which protocol (binary or ascii) is memcached using? -

currently, memcached (1.4.4) running on our servers (centos 6.7) , no protocol specified -b option means using default (auto-negotiate option). there way find protocol being used? what i've tried far: echo -e '\x80' | nc host 11211 (gives no output message) echo -e 'stats conns\r\n' | nc host 11211 (gives 'error' output) reference: how memcached negotiate protocol? i'm aware of magic byte specifies protocol version. tried reviewing contents on packets through tcpdump no luck far. also, there no log file specified in memcached startup script have no access logs. appreciated.

haskell - How can I branch on the value inside a Reflex Dynamic? -

in simplest case, have dynamic t bool , , when value true, want single empty div exist, , when value false, don't want there dom element. slightly more generally, if have dynamic t (either mya myb) , , have functions know how render given dynamic t mya or dynamic t myb , how call appropriate function render? if need switch widget need 1 of: dyn :: monadwidget t m => dynamic t (m a) -> m (event t a) source or widgethold :: monadwidget t m => m -> event t (m a) -> m (dynamic t a) since you've mentioned you've got dynamic @ hand, we're gonna use dyn : app = switched <- button "alternate!" flag <- folddyn ($) false (not <$ switched) -- have dynamic t bool w <- mapdyn mywidget flag -- in latest reflex can 'fmap' dyn w return () mywidget :: monadwidget t m => bool -> m () mywidget false = blank mywidget true = el "div" $ blank the basic rule that, due higer-order nature of refl

java - Spring Boot with Cassandra 3.x driver -

i use spring boot 1.3.8.release . use cassandra 3.x driver tried below; <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-cassandra</artifactid> <exclusions> <exclusion> <groupid>org.springframework.data</groupid> <artifactid>spring-data-cassandra</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework.data</groupid> <artifactid>spring-data-cassandra</artifactid> <version>1.4.0.release</version> <exclusions> <exclusion> <groupid>com.datastax.cassandra</groupid> <artifactid>cassandra-driver-core</artifactid> </exclusion> <exclusion>

Visual studio will not undo my git changes -

Image
for reason, vs not remove files changes view after "undo changes" : the actual changes gone when view diff, want files not show. know permanent solution this. know can stash or similar outside of vs hide files showing. edit: i have found work-around. when undo, remaining files select stage, disappear!

forms - Autopopulate slug field without using third party app in django -

this model: class child(models.model): child_name = models.charfield(max_length=150, null=true, blank=true) slug = models.slugfield(max_length=150,null=true, blank=true) # slug = autoslugfield(populate_from='child_name') blood_group = models.charfield(max_length=5, blank=true) startup = models.foreignkey(startup) class meta: verbose_name_plural = 'children' unique_together = ('slug', 'startup') def save(self, *args, **kwargs): if self.id none: self.slug = slugify(self.child_name) else: self.slug = slugify(self.child_name) super(child, self).save(*args, **kwargs) but not auto-populate slug field in form. form : class childform(slugcleanmixin, forms.modelform): class meta: model = child fields = '__all__' widgets = {'startup': hiddeninput(), } views.py: class childc

python - Access Handler object to Rollover log -

how can rollover log when i've setup log using logging.config.dictconfig ? can't retrieve logging.handlers.rotatingfilehandler . import logging import logging.config logging.config.dictconfig({ 'version': 1, 'disable_existing_loggers': false, 'handlers': { 'default': { 'class':'logging.handlers.rotatingfilehandler', "level": "debug", "filename": "test.log", 'backupcount': 5, 'maxbytes': 20, }, }, 'loggers': { '': { 'handlers': ['default'], 'level': 'debug', 'propagate': true } } }) # how do rollover?? logging.handler[0].dorollover() logging.info("foo") you can access root handlers using logging.getlogger().handlers , if have 1 might like f

java - Exception while creating PDF file from Asciidoctor -

i getting exception while creating pdf file ascii doc files using following libraries in spring boot application. org.asciidoctor:asciidoctorj:1.6.0-alpha.3 org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11 org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.6 i found similar issues reported earlier tried setting class loader no success. the exception shown org.jruby.exceptions.raiseexception: (loaderror) no such file load -- asciidoctor @ org.jruby.rubykernel.require(org/jruby/rubykernel.java:944) ~[jruby-core-9.1.2.0.jar!/:?] @ ruby.require(uri:classloader:/meta-inf/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55) ~[?:?] @ ruby.<top>(<script>:9) ~[?:?] my code looks this. path directory ascii doc stored. final asciidoctor asciidoctor = create(); asciidoctor.renderdirectory(new asciidocdirectorywalker(path), options().backend("pdf").get()); asciidoctor.shutdown(); i have got solution spring boot team. pl

javascript - Call to a java script function Regular Expression Validator to fail In asp.Net -

i have <asp:regularexpressionvalidator> validates text box have javascript function prevents entering of non numerical values in textbox. when use expression validator works fine add onkeydown="return jsdecimals(event);" text box call jsdecimals() function validator doesn't work. doing wrong?? asp code <asp:textbox id="textbox2" runat="server" cssclass="form-control" causesvalidation="true" maxlength="13" onkeydown="return jsdecimals(event);"></asp:textbox> <asp:button id="button5" runat="server" text="retrieve" cssclass="btn btn-default" onclick="button5_click"/> <asp:regularexpressionvalidator id="regularexpressionvalidator1" runat="server" cssclass="tooltip-arrow" errormessage="id must 13 numeric characters" controltovalidate="textbox2" validationexpression="^

python - where to save the verification code sent to the user for signing up -

i'm somehow new django , it's first time implementing signup form sms verification. i user mobile number , generate random number , send him; want generated code expired after 30 minutes , after don't need them, seems not idea save them in db , after expiration time, delete them. i wonder if can me the question "what best way implement this?" thank in advance save them in redis. redis keys can have ttl(time-to-live), keys ttl deleted automatically after time period. import redis r = redis.strictredis() # create pin r.set("<phone-number>", <sms-pin>) r.expire("<phone-number>", 1800) # 1800 seconds = 1/2 hour # pin if r.exists("<phone-number>"): pin=r.get("<phone-number>") ... validate pin else: ... invalid pin more docs @ http://agiliq.com/blog/2015/03/getting-started-with-redis-py/

Need Something like C# Expression Tree on Javascript -

consider this. const myfunc = (x) => x.property1; let obj = { property1: "value1", property2: "value2" }; console.log(myfunc(obj)); // output: value1 i need this: console.log(whatineed(myfunc, obj)) // output: **property1** is possible achieve requirements ?! what body of "whatineed" function ? if run myfunc.tostring() , give "(x) => x.property1" . can write parser that, shouldn't hard. hard if want full-feature c#.

Video not playing in angularjs -

i have url of video. video not playing properly. tried $sce don't know problem. new in angularjs. $scope.videoapi = function(id) { $http({ method: "post", url: "http://192.168.1.16:8070/courseapi/getpdf", data: { 'id_course': id } }).then(function mysucces(response) { alert("listapi" + json.stringify(response.data)); var videourl = response.data; $scope.trustedurl = $sce.trustasresourceurl(videourl); }, function myerror(response) { $scope.message = response.statustext; console.log(response.statustext); alert("courseenrolled"); }); } the view code <video width="320" height="240" controls> <source ng-src="{{trustedurl}}" type="video/mp4"> <source ng-src="{{trustedurl}}" type="video/ogg"> </video>

javascript - Prevent zooming using a touchscreen in a website (IE 11, Win 10) -

i have website created using jquery mobile. , want disable zoom functionality or prevent user being able zoom in using pinch zoom or tapping 2 fingers simultaneously. i looking answer can't find answer works. i tried using meta tag: <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> also tried: body { -ms-content-zooming: none }, html { -ms-content-zooming: none }, .ui-page { -ms-content-zooming: none } none of solutions work. try user-scalable = no instead of user-scalable = 0 .

android - Customize Navigation Drawer and Drawer items -

Image
how customize navigation drawer menu items picture : and need disable drawer items on login status. if user not login disabled menu items text color grey , background of item color changed. , non disabled items color white how implement navigation drawer please me solve problem. you can edit these files inside project costumize wished: layout/nav_header_main.xml layout/app_bar_main.xml menu/activity_main_drawer.xml

python - Compute forward difference with Dask DataFrame? -

how compute first discrete difference using dask dataframe? or, in "pandas speak", how do pandas.dataframe.diff() in dask? mathematically, operation simple: subtract column vector copy of shifted 1 or more rows. i have tried implementing diff() in dask in following ways, none of works (yet): df - df.shift(periods=1) works in pandas. dask dataframe doesn't have shift() method. df.values[:-1] - df.values[1:] works in pandas. can't see how index dask dataframe position . my current best idea implementing diff wrap custom code in dask.dataframe.rolling.wrap_rolling , suggested in this stack overflow answer (although haven't been able find documentation on how this ). or wrap custom code using dask delayed? other thoughts? the diff method has been added both dataframe , series, in pr: https://github.com/dask/dask/pull/1769 . works same in pandas.

javascript - Ajax request -> request.readyState problems -

i cannot execute php on page, because content stored in mysql database, can put javascript/jquery/ajax. i need few details page can dynamic. built php script output data needs in string this: string=value|string2=value here|string3=value there it on same domain, not cross urls... here ajax i'm trying use, code have on website created few years ago, cannot work, i'll share code , response seeing below. code load on page out of database: function createrequest() { try { request = new xmlhttprequest(); } catch (tryms) { try { request = new activexobject("msxml2.xmlhttp"); } catch (otherms) { try { request = new activexobject("microsoft.xmlhttp"); } catch (failed) { request = null; } } } return request; } function cpf(tpg) { request = createrequest(); if(request == null) { alert("unable create req

mysql - Why I obtain different values calculating distance between two point in the space using this "Great-circle distance" formula and Google Earth tool? -

i not database , gis , have following doubt function used on mysql database calculate distance between 2 points. i started tutorial there function used calculate distance between 2 point field: create function earth_circle_distance(point1 point, point2 point) returns double deterministic begin declare lon1, lon2 double; declare lat1, lat2 double; declare td double; declare d_lat double; declare d_lon double; declare a, c, r double; set lon1 = x(geomfromtext(astext(point1))); set lon2 = x(geomfromtext(astext(point2))); set lat1 = y(geomfromtext(astext(point1))); set lat2 = y(geomfromtext(astext(point2))); set d_lat = radians(lat2 - lat1); set d_lon = radians(lon2 - lon1); set lat1 = radians(lat1); set lat2 = radians(lat2); set r = 6372.8; -- in kilometers set = sin(d_lat / 2.0) * sin(d_lat / 2.0) + sin(d_lon / 2.0) * sin(d_lon / 2.0) * cos(lat1) * cos(lat2); set c = 2 * asin(sqrt(a)); return r * c; end i think should return value

shell - how to calculate the total minutes between two dates? -

this question has answer here: bash script: difference in minutes between 2 times 7 answers can me calculate total minutes between below 2 dates. date1= 2016-07-02 06:20:00 date2= 2016-07-04 15:00:00 the output should in number example date diff 5 hours means need output 5*60=300 minutes. thanks, aaa echo $((($(date -ud "$date2" +'%s') - $(date -ud "$date1" +'%s'))/60)) minutes  

pagination - Dealing with redirects for paginated pages -

i have completed redesigned site client. complete overhaul , of url structure has changed. a large part of site news section contains hundreds of news stories dating many years. news stories have been culled , many have been renamed. i have audited news stories , set 301 redirects relevant news story on new site: example.com/news/alpha => example.com/stories/beta however unsure how handle paginated urls. looking @ current traffic, lot of hits paginated news pages, example: example.com/news/page-6 given there different number of items per page meaning of page 6 no longer same, how should deal these urls. should allow them 404 or there better alternative?

C# HttpClient 4.5 multipart/form-data upload -

does know how use httpclient in .net 4.5 multipart/form-data upload? i couldn't find examples on internet. my result looks this: public static async task<string> upload(byte[] image) { using (var client = new httpclient()) { using (var content = new multipartformdatacontent("upload----" + datetime.now.tostring(cultureinfo.invariantculture))) { content.add(new streamcontent(new memorystream(image)), "bilddatei", "upload.jpg"); using ( var message = await client.postasync("http://www.directupload.net/index.php?mode=upload", content)) { var input = await message.content.readasstringasync(); return !string.isnullorwhitespace(input) ? regex.match(input, @"http://\w*\.directupload\.net/images/\d*/\w*\.[a-z]{3}").value : null; } }

dummy IMAP server for when server has moved -

i'm moving mailserver (imap). in last century, when using pop3, made script allowed login, , fetch message saying "hey, update settings". now, using imap, seems little more complicated... there simple dummy imapd server available that? or script (netcat?) can collect usernames, can contact few remaining users? in theory simplest of scripts do: #!/bin/sh echo '* ok [alert] mail has moved, ask leif' echo '* bye' in practice alert may or may not displayed users. capturing login names more complicated , perhaps not worth trouble.

javascript - Dropzone with custom options not working -

i have html i'm trying use dropzone.js <form id="loaddropzone" method="post" action="" class="dropzone"></form> and javascript dropzone.autodiscover = true; $("div#loaddropzone").dropzone({//loading dropzone options paramname: 'photos', url: '#', dictdefaultmessage: "insert files", clickable: true, enqueueforupload: true, maxfilesize: 2, uploadmultiple: false, addremovelinks: true, init: function(){ this.on("addedfile", handlefileadded); this.on("removedfile", handlefileremoved); this.on("error", function(file){if (!file.accepted) this.removefile(file);}); } }); my intention load simple dropzone form can add files. if put in html, action loads defaults settings (i can see example on dropzone.js website). if leave action in form blank (like posted), dropzone.js not working. any load simpl

Move Toolbar to the bottom in UWP with PlatformConfiguration (Xamarin.Forms 2.3.3) -

trying out new platformconfiguration in xamarin.forms 2.3.3.166-pre4 moving toolbar bottom on uwp doesn't want work. doing wrong? using xamarin.forms; using xamarin.forms.platformconfiguration; using xamarin.forms.platformconfiguration.windowsspecific; namespace formstoolbardemo { public partial class mainpage:contentpage { public mainpage() { initializecomponent(); this.on<windows>().settoolbarplacement(toolbarplacement.bottom); } } } alright, after trying every possible combination of settoolbarplacement(toolbarplacement.bottom) , found out few things: toolbar placement can set application wide, not per page toolbar placement can set on navigationpage so can do, when want place toolbar @ bottom, can set application wide attaching toolbar placement app classes mainpage property. public app() { mainpage = new navigationpage(new mainpage()); mainpage.on<windows>().settoolbarpl

activemq failover using multiple instances in master slave mode on same linux machine -

i have setup activemq mulitple instances achieve failover in master slave mode in windows. while setting same created 3 instances under bin folder without changing port , started 3 instances 1 one. first instance became master , remaining in slave mode until stopped master instance. now trying achieve same in linux environment. first instance starts when start second instance in different window throws below error: error | failed start apache activemq ([instance2, id:132vm6-57227-1478597606120-0:1], java.io.ioexception: transport connector not registered in jmx: java.io.ioexception: failed bind server socket: tcp://0.0.0.0:61616?maximumconnections=1000&wireformat.maxframesize=104857600 due to: java.net.bindexception: address in use) info | apache activemq 5.14.0 (instance2, id:132vm6-57227-1478597606120-0:1) shutting down info | connector openwire stopped info | connector amqp stopped info | connector stomp stopped info | connector mqtt stopped info | connector ws st

Android display images when offline once downloaded using fresco -

i want fresco download , save images sd-card when connected internet. later when offline , if cache cleared, still need fresco show saved images. possible? if yes, how? simply saving images disk cache doesnt seem work when cache cleared. fresco caches images you. if offline, images should still displayed. should not need anything. however, when cache cleared (e.g. when user presses button or when device space low), images deleted cache - desired behavior should not changed. there 2 options: save selected items, move cache save selected items if want persist selected images (e.g. "save" button), can encoded image , save somewhere on device. should not images since on disk 2 times , clearing cache / uninstalling app leave 1 copy on device. something work: datasource<closeablereference<pooledbytebuffer>> datasource = fresco.getimagepipeline().fetchencodedimage(imagerequest, callercontext); datasource.subscribe(new basedatasubscriber&l

c# - BlobCounter unsupported pixel format -

i getting current exception: unsupportedimageformatexception: unsupported pixel format of source image. aforge.imaging.blobcounter.buildobjectsmap (aforge.imaging.unmanagedimage image) aforge.imaging.blobcounterbase.processimage (aforge.imaging.unmanagedimage image) aforge.imaging.blobcounterbase.processimage (system.drawing.imaging.bitmapdata imagedata) aforge.imaging.blobcounterbase.processimage (system.drawing.bitmap image) cam.blobcounter (system.drawing.bitmap videooutput, aforge.imaging.blobcounter bc) (at assets/scripts/cam.cs:127) cam.update () (at assets/scripts/cam.cs:69) which caused blobcounter not accepting current image format. fix used convertion method: bitmap yellowclone = aforge.imaging.image.clone(originalbm, system.drawing.imaging.pixelformat.format32bppargb); but still error(despite trying every format available). for context, here code, originalfeedtexture being webcam feed: byte[] bytes = originalfeedtexture.encodetojpg(); using (var ms = ne

Laravel 5 method does not exist in Controller while used PHP __callStatic method -

i using laravel 5.2 on php 5.5.9 instead of hard coding methods in following controller, used php __callstatic method dynamically add functionality. works fine while tried console while calling methods route, getting following error method app\http\controllers\showcategory::latest() not exist here route route::get('category/{id}', 'showcategory@latest'); here controller class showcategory extends controller { public $methods = [ 'latest' => 'created_at', 'newarrival' => 'created_at', 'mostviewed' => 'views' ]; public function get( $link_or_id, $orderby = 'created_at' ) { } public static function __callstatic($func, $arg) { $category = new self(); if( array_key_exists( $func, $category->methods ) ) { return $category->get( $arg[0], $category->methods[ $func ] ); } } } any point messed ? __callstat

woocommerce - Add custom field woocomerce (variable product) -

i search how can add custom field viriable product in woocomerce. allready this, work simple product. add_action( 'woocommerce_product_options_general_product_data', 'wc_custom_add_custom_fields' ); function wc_custom_add_custom_fields() { // print custom text field woocommerce_wp_text_input( array( 'id' => '_custom_text_field', 'label' => 'custom text field', 'description' => 'this custom field, can write here want.', 'desc_tip' => 'true', 'placeholder' => 'custom text' ) ); } add_action( 'woocommerce_process_product_meta', 'wc_custom_save_custom_fields' ); function wc_custom_save_custom_fields( $post_id ) { if ( ! empty( $_post['_custom_text_field'] ) ) { update_post_meta( $post_id, '_custom_text_field', esc_attr( $_post['_custom_text_field'] ) ); } } how can e

java - Retry logic with CompletableFuture -

i need submit task in async framework i'm working on, need catch exceptions, , retry same task multiple times before "aborting". the code i'm working is: int retries = 0; public completablefuture<result> executeactionasync() { // execute action async , future completablefuture<result> f = executemycustomactionhere(); // if future completes exception: f.exceptionally(ex -> { retries++; // increment retry count if (retries < max_retries) return executeactionasync(); // <--- submit 1 more time // abort null value return null; }); // return future return f; } this doesn't compile because return type of lambda wrong: expects result , executeactionasync returns completablefuture<result> . how can implement async retry logic? i solved similar problem using guava-retrying library. callable<result> callable = new callable<result>(

ios - Swift 3 and Alamofire - Image and data from JSON -

i have project trying bring in data web url using alamofire. trying bring in image , text keep getting build failed. trying add data (image , text) tags = 1 , 2. code below appreciated. new swift. swift import uikit import alamofire struct postinput { let mainimage : uiimage! let name : string! } class tableviewcontroller: uitableviewcontroller { var postsinput = [postinput]() var mainurl = "https://www.testjson.com" typealias jsonstandard = [string : anyobject] override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. callalamo(url: mainurl) } func callalamo(url : string){ alamofire.request(url).responsejson(completionhandler: { response in self.parsedata(jsondata: response.data!) }) } func parsedata(jsondata : data) { { var readablejson = try jsonserialization.jsonobject(with: jsondat

Kafka aggregate single log event lines to a combined log event -

i'm using kafka process log events. have basic knowledge of kafka connect , kafka streams simple connectors , stream transformations. now have log file following structure: timestamp event_id event a log event has multiple log lines connected event_id (for example mail log) example: 1234 1 start 1235 1 info1 1236 1 info2 1237 1 end and in general there multiple events: example: 1234 1 start 1234 2 start 1235 1 info1 1236 1 info2 1236 2 info3 1237 1 end 1237 2 end the time window (between start , end) 5 minutes. as result want topic like event_id combined_log example: 1 start,info1,info2,end 2 start,info2,end what right tools achieve this? tried solve kafka streams can figure out how.. in use case reconstructing sessions or transactions based on message payloads. @ moment there no built-in, ready-to-use support such functionality. however, can use processor api part of kafka's streams api implement functionality yourself. can write cus

Jenkins Job DSL Plugin - Include another Jenkinsfile -

i want build common jenkinsfile couple of build jobs in different languages. , want add specific jenkinsfile depends on parameters. for example: common file should contain information docker hub , nexus repository. it's same. , specific file should contain language specific build steps. is possible "include" file? using pipeline shared groovy libraries plugin possible define own job dsl. this section of plugin's manual explains how this.

Create a Hadoop cluster using cloudera quickstartVM errors -

i want create cloudera cluster using quickstart vm image can directly download cloudera´s web page ( http://www.cloudera.com/downloads/quickstart_vms/5-8.html ). i have 3 virtual machines, have 1 master , 2 slaves. i´ve configured them in order have different hostnames , dns connectivity between 3 virtual machines. when try add new hosts, missing heartbeats other machines or when doesn´t happen version mismatches , hdfs errors. so, there other configuration setting should before trying add new host?

unity3d - Unity 360 viwer user sphere or skybox? -

Image
i have issue need build scene 360 photo-viewer/panorama , put here buttons. firslty, worked skybox , when change user position buttons not on right place, angle of view changed. example can see blue square imagine button. if user change position(move player left), button cover other place. in general, need button should strickly connected particular place. i created 360 sphere images squashed here . can me please improve: sphere appearance or skybox - how can put buttons when change user position buttons keep same position thanks!

reactjs - Call componentWillReceiveProps() after state is getting updated from reducer React/Redux -

i have 2 components 1] parent 2] child i passing parent components action child called on change of dropdown list. parent components method calling stores's function (ajax call) , updating state variable. after updating state want perform few operations in componentwillreceiveprops() not going inside componentwillreceiveprops (). below code in parent component - 1 ] parent componentwillreceiveprops(props) { this._settracktoparams(props) debugger; let livevideolist = this.state.livevideolist if(props.liveracevideos != null && _.isempty(this.state.livevideolist)) { console.log('live race video if') this.state.livevideolist.push(props.liveracevideos) this.setstate(this.state) } else if(props.liveracevideos != null && this.selectedkey) { console.log('live race video else') this.state.livevideolist[this.selectedkey] = props.liveracevideos this.setstate(this.state)

html - php mail does not work with no-gmail adresse -

this question has answer here: php mail function doesn't complete sending of e-mail 22 answers i have part of project when clients reseive mail after many actions, when testing mail function , have problem when adresse "gmail" , reseive mail, when mail no-gmail, mail not reseived !!! :( mail function: function emaildemande($email, $name, $namel){ $subject = 'votre demande '; $headers = "from: xxx <contact@emoovio.com>\r\n"; $headers .= "bcc: abdelkhalek.oumaya@gmail.com, test@domain.com\r\n"; // $headers = 'from: xxx <'. $from. '>\r\n'; $headers .= "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=utf-8\r\n"; $message='htmlmessage'; mail($email, $subject, $message, $headers); }; please !! mail compl

vb.net - Class 'System.DBNull' cannot be indexed because it has no default property -

private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click cn.open() dim arrimage() byte dim ms new memorystream() if (pb1.image isnot nothing) pb1.image.save(ms, pb1.image.rawformat) arrimage = ms.getbuffer ms.close() end if cmd .connection = cn .commandtext = "insert [example]([pname],[pic])values(@a2,@a1)" .parameters.add("a0", oledbtype.varchar).value = tname.text .parameters.add("a1", oledbtype.binary).value = iif(pb1.image isnot nothing, arrimage, dbnull.value()) .dispose() .executenonquery() end cn.close() end sub you have multiple issues in code. in order of appearance: dont use getbuffer() as noted on msdn , buffer can twice size of data in stream. bloat database needlessly nulls. use toarray() instead. since

jquery - How to align divs of different parents? -

i'd have menu has content inside , content align other menu items. currently have: [- someth else] [- else something] [- else some] and want aligned this: [- someth else ] [- else something] [- else ] here code of have now, how may make way want? .menu { width: 100%; } .menu-item { display: flex; justify-content: space-between; align-items: center; } .wrapper2 { display: flex; } <div class="menu"> <div class="menu-item"> <div class="wrapper1">someth</div> <div class="wrapper2"> <p>something else</p> <p></p> </div> </div> <div class="menu-item"> <div class="wrapper1">something</div> <div class="wrapper2"> <p>something else</p&g

serialization - How to send group separator (non printable ascii characters) with RestSharp RestClient from C# -

updated i have reworked question , included complete working example. my succinct question now: how come i'm not seeing individual characters of string "\u001d" when use restsharp restclient , pick json requestformat options send simple object server? send output test server, , see 1d when examine output binary editor. expect 5c 75 30 30 31 64 ('\','u','0','0','1','d') , see if use newtonsoft.json serialize same simple object containing string "\u001d". understanding restsharp serialize object .json (if pick options accordingly) , send server deserialization. using newtonsoft.json; using restsharp; using restsharp.serializers; using system; using system.collections.generic; using system.io; /// <summary> /// test this, /// 1. first serialize string json , print out json string character array show /// '\' 'u' '0' '0' '1' 'd' show in serialized js

ios - Firebase notification not showing banner in background and not called didReceiveRemoteNotification -

added , downloaded certificates created(development:ios app development,distribution: app store, status both active) , double-clicked profiles Сreated 2 .p12 file. press on key , certificate, not care. uploaded 2 .p12 firebase activated push notifications , background modes in xcode. firebaseappdelegateproxyenabled = no 2016-11-08 14:54:05.115350 informator[433:134942] warning: firebase analytics app delegate proxy disabled. log deep link campaigns manually, call methods in firanalytics+appdelegate.h. 2016-11-08 14:54:05.431: firmessaging library version 1.2.0 2016-11-08 14:54:05.553874 informator[433:135005] [firebase/core][i-cor000001] configuring default app. 2016-11-08 14:54:05.555 informator[433] [firebase/core][i-cor000001] configuring default app. 2016-11-08 14:54:05.564098 informator[433:135004] firebase analytics v.3404000 started 2016-11-08 14:54:05.564 informator[433:] firebase analytics v.3404000 started 2016-11-08 14:54:05.577170 informator[433:13500

Android Studio 2.2 Gradle Project Failed -

please resolve issue during android programming, getting error gradle project fail please refer screenshot , provide me solutions. regards hussain enter image description here 1) can try install jdk1.8. 2) in androidstudio file->project structure->sdk location, select directory jkd located, default studio uses embedded jdk reason produces error=216. 3) click ok.

linux - Echo the current file transfer with LFTP -

i'm trying echo $file_name once transfer complete. cannot find reference how create variable in lftp displays file name of downloaded. the code: #!/bin/bash login="myusername" pass="notmypassword" host="my.hosting.server" remote_dir='/path/to/remote/dir/.' local_dir="/path/to/local/dir/" file_name=**the name of file im downloading** base_name="$(basename "$0")" lock_file="/tmp/$base_name.lock" trap "rm -f $lock_file" sigint sigterm if [ -e "$lock_file" ] echo "$base_name running already." exit else touch "$lock_file" lftp -u $login,$pass $host << eof set ftp:ssl-allow no set mirror:use-pget-n 5 mirror -c -x "\.r(a|[0-9])(r|[0-9])$" -p5 --log="/var/log/$base_name.log" "$remote_dir" "$local_dir" echo $file_name quit eof #osascript -e 'display notification "$file_n

javascript - RewriteRule with url params -

i know there's thousand duplicate posts this, nothing has worked me far. i'm trying use rewrite rule transform /articulo.html?id=friendly-url /articulo/friendly-url this i've used in .htaccess without success: rewriteengine on rewriterule ^articulo/(.*)$ /articulo.html?id=$1 [l] edit: this js looks id param: var geturlparameter = function geturlparameter(sparam) { var spageurl = decodeuricomponent(window.location.search.substring(1)), surlvariables = spageurl.split('&'), sparametername, i; console.warn(spageurl); console.warn(surlvariables); (i = 0; < surlvariables.length; i++) { sparametername = surlvariables[i].split('='); if (sparametername[0] === sparam) { return sparametername[1] === undefined ? true : sparametername[1]; } } }; try this, options -multiviews rewriteengine on rewritecond %{request_filename} !-f rewritecond %{reques

How to share variables between Jenkins jobs -

we have few environments (dev1, dev2, tst1,...), , set of jobs each of environments (integration tests, build fe, build be, ...). need change branch, using on 1 environment. it creates confusion, when changing branch in job, we're using, don't want manually change branch on jobs related given environment. set variable shared jobs in set, solution comes mind use system variables, , separate job set them, like: dev1_branch = some_branch dev2_branch = some_other_branch tst1_branch = some_branch the jobs independent, using chain of jobs variable injection no good. if there possiblity run job, change configuration in persistent way of jobs in set, great.

c# - excel nuget package for .net core -

i need library .net core me create excel file (no matter exact file extension). i tried use microsoft.office.interop.excel.dll (windows dll), searched in nuget gallery, tried find other package core support, didnt managed find one. is there library witch can me?

meteor - Trying to build a docker container, start.sh not found -

i'm trying build docker container, doesn't seem find start.sh. copies container, somehow doesnt work. this dockerfile: from ubuntu:16.04 # install meteor run apt-get update run apt-get install -y curl run curl https://install.meteor.com/ | sh run meteor npm install --save highcharts # entypointscript copy start.sh / run chmod u+x /start.sh # copy app copy /app /app # ui expose expose 80 entrypoint /start.sh and start.sh: #!/bin/bash sleep 20 /app/meteor run # don't exit /usr/bin/tail -f /dev/null also i'm not sure meteor run command in start.sh. how tell meteor run executed in specific directory, without being able cd it? i'm using windows 10. have meteor app in \app\ directory , dockerfile , start.sh in same directory app folder. i build container using: docker build -t meteorapp . the error when i'm trying run using: docker run -p 80:80 --net docker-network --name meteorapp meteorapp is: /bin/sh: 1: /start.sh: not fou

java - How do I call a secured page from my own AppEngine web-service? -

to send html email i'd call different url of own app, have comfort of jsp rendering email-content. to execute http-call own app first tried use " http://localhost/emailreport " url, failed dns-error. next tried external url: string appid = apiproxy.getcurrentenvironment().getattributes() .get("com.google.appengine.runtime.default_version_hostname").tostring(); appid = appid.substring(0, appid.indexof('.')); url url = new url("http://" + appid + ".appspot.com/emailreport"); this works, pages without security-constraints in web.xml. emailreport needs secured. any idea how retrieve page? need use service-account-key? isn't there simple trick? added: want secure pages adding web.xml: <security-constraint> <web-resource-collection> <web-resource-name>securename</web-resource-name> <url-pattern>/mytask</url-pattern> </web-resource-collection> <a

How can I sort arrays and data in PHP? -

due enormous , ever repeating amount of "how sort unique snowflake of array?" questions, reference collection of basic sorting methods in php. please close question not markedly differ duplicate of one. how sort array in php? how sort complex array in php? how sort array of objects in php? basic 1 dimensional arrays; incl. multi dimensional arrays, incl. arrays of objects; incl. sorting 1 array based on another sorting spl stable sort for practical answer using php's existing functions see 1., academic in-detail answer on sorting algorithms (which php's functions implement , may need really, complex cases), see 2. well basic methods covered deceze try @ other types of sort sorting spl splheap class simpleheapsort extends splheap { public function compare($a, $b) { return strcmp($a, $b); } } // let's populate our heap here (data of 2009) $heap = new simpleheapsort(); $heap->insert("a"); $heap-&g