Posts

Showing posts from July, 2013

get - Check whether email is subscribed to list in MailChimp API 3.0 using PHP -

i've read following on mailchimp website: mailchimp api v3.0 live! prior versions no longer supported after 2016, api users should begin transitioning v3.0. as result, move v3.0 of api. please have function, in php, returns boolean, check whether email address subscribed specific mailchimp list. not want subscribe user, merely check whether subscribed or not. looking @ mailchimp documentation , assuming have given list in mind, looks call endpoint get: /lists/{list_id}/members/{subscriber_hash} to in php, found nice script sitting on github . last function trick you: function mc_checklist($email, $debug, $apikey, $listid, $server) { $userid = md5($email); $auth = base64_encode( 'user:'. $apikey ); $data = array( 'apikey' => $apikey, 'email_address' => $email ); $json_data = json_encode($data); $ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://'.$server....

javascript - How do I define an "any" array in an object literal in Typescript? -

this question has answer here: type definition in object literal in typescript 4 answers the following fails error. ts7018: object literal's property 'scopes' implicitly has 'any[]' type. i want define foo array of any . how do in object literal? { foo: [], } if it's array then: let foo: any[] = []; but there's no object literal here. if want foo object array then: let foo: { array: any[] } = { array: [] } foo.array.push(12); foo.array.push("stirng");

ios - pushViewController not working in swift 3 -

i using storyboard , xib in swift 3 (ios 10 , xcode 8). , when load view controller xib, application crashing. here code, using load view controller on button action: let serverviewcontroller = serverviewcontroller(nibname: "serverviewcontroller", bundle: nil) self.navigationcontroller?.pushviewcontroller(serverviewcontroller, animated: true) if serverviewcontroller nibname correct, problem trying push navigation controller. mean serverviewcontroller should uinavigationcontroller subclass in case, can't push navigation controller.

sql server - MS SQL - CONTAINS full-text search w/ variable number of values, not using dynamic sql -

i've created full-text indexed column on table. i have stored procedure may pass value of variable "search text". want search "search", "this" , "text" within full-text column. number of words search variable. i use like where column '%search%' or column list '%this%' or column '%text%' but require me use dynamic sql, i'm trying avoid. how can use full-text search find each of words, presumably using contains, , without converting whole stored procedure dynamic sql? if have sql table full text search enabled, can use query below. select * table contains(columnname,'"text1" or "text2" or "text3"' ) see link below details full-text indexing workbench

haskell - fmap (+1) $ read "[1]" gives error -

when type repl fmap (+1) $ read "[1]" expect [2] instead error : no instance (functor f0) arising use of ‘it’ unfortunately doesn't me. explain me wrong snipped of code. it doesn't know type read value into. specifying type explicitly: fmap (+1) $ (read "[1]" :: [int])

javascript - Binding to arbitrary or nonstandard attributes in Aurelia -

in order use library, need able bind "for" attribute of ul element. this not work: <ul for="${id}"> ... </ul> based on testing assume because ul elements don't have for attribute. how work around this? trivial in durandal / knockout believed like: data-bind="attr: { for: $data.id }" do have create custom attribute? going conflict built in attribute used label ? other obvious workaround? aurelia absolutely supports binding ad-hoc/arbitrary properties on dom element. when write <ul for="${id}"> ... </ul> aurelia going assign value of id property ad-hoc property on ul element. it's equivalent of doing ul.for = id or ul['for'] = id . the part you're missing setting arbitrary property on dom element not automagically create corresponding html attribute . in other words, there's difference between ul.for = id , ul.setattribute('for', id) . easy forget ...

r - Exporting TukeyHSD results -

i'm having trouble exporting tukeyhsd results separated in cells when open results in excel. tried using write.csv() says: cannot coerce class "c("tukeyhsd", "multicomp")" data.frame how can capture tukeyusd results in way can copy , paste them excel sheet? tukeyhsd returns object of class "tukeyhsd". can extract table of results "tukeyhsd" object using $ operator. can export or modify table in way see fit. fm1 <- aov(breaks ~ wool + tension, data = warpbreaks) res <- tukeyhsd(fm1, "tension", ordered = true) as.data.frame(res$tension) # diff lwr upr p adj # m-h 4.722222 -4.6311985 14.07564 0.447421021 # l-h 14.722222 5.3688015 24.07564 0.001121788 # l-m 10.000000 0.6465793 19.35342 0.033626219

css - Nested HTML Lists -

i'm looking put content under accordions built using "ul" each accordion item it's own "li". my issue want content in 1 of accordion items include it's own "ul". what proper way approach this? codepen link : http://codepen.io/steve-jones/pen/pbvokj <ul class="accordion"> <li> <a>faq: vegetarian-friendly diet</a> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit. reprehenderit, ipsum, fuga, in, obcaecati magni ullam nobis voluptas fugiat tenetur voluptatum quas tempora maxime rerum neque deserunt suscipit provident cumque et mollitia ex aspernatur porro minus sapiente voluptatibus eos @ perferendis repellat odit aliquid harum molestias ratione pariatur adipisci. aliquid, iure.</p> </li> <li> <a>faq: snacking @ work</a> <p>what convenient things can snack on while @ work?</p> <p...

sql server - EF6 + SQL 14: The most effective way to upload large number of rows into a table -

using entity framework 6 , sql server 2014: i need upload ~200,000 rows in xml file sql server table. each row has 5 fields in it. data in row not large, have large number of rows. in y c# application, can parse xml file , read data in memory no problem. concern sending 1 tsql stored procedure call per row sql server not efficient. effective way of implementing requirement in ef6? if entity framework not suitable this, can use ado.net directly. you package multiple rows datatable, , pass table valued parameter (tvp) stored proc. stored proc can perform merge statement using tvp source, or insert statement joins tvp. this works using direct ado.net. quick google, looks should work via entity framework. e.g.: http://www.c-sharpcorner.com/uploadfile/78607b/using-table-valued-parameters-in-entity-framework some links related tvps: http://www.sommarskog.se/arrays-in-sql-2008.html http://www.sommarskog.se/arrays-in-sql-perftest-2009.html

git - VS 2015 Team Services Pull action breaks references. Is there a way around this? -

when team runs fetch , pull visual studio 2015 team services, dll references break. path becomes blank. because use cloud storage share our references, path different each local copy. there way map reference paths? there isn't way achieve know. recommend use package management feature in visual studio team service store dll references , use nuget manage reference in project.

java - AspectJ and Spring: Exclude @After method execution when method throws an exception -

i have , aspect in spring based on aspectj: @after("execution(* ...) public void stoptotaltimerandmarksucess(joinpoint joinpoint) {...} @afterthrowing("execution(* c ..) public void markerror(joinpoint joinpoint) {...} i need exclude @after execution when under method throws , exception. when method throws exception executed both (@after , @afterthrowing). you need @afterreturning annotation rather @after. @afterreturning: after returning advice runs when matched method execution returns normally. declared using @afterreturning annotation (...) @after: after (finally) advice runs matched method execution exits. declared using @after annotation. after advice must prepared handle both normal , exception return conditions. typically used releasing resources, etc. http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html

javascript - Add class or style if text in div appears -

i have order form i'm making. right when put coupon code want apply div of old price style or class (line-through) , though had right...here i'm doing.....any suggestion why might not working? warning: new javascript....i've been working css html javascript story. thanks! if ($('#grand_amount_value').length > 1){ $("#total_amount_old_val").attr("style", "text-decoration:line-through"); } here example threw show working: https://jsfiddle.net/pj6xwhcy/3/ function strikeoldamt() { var gav = $("#grand_amount_value"); if (gav.length > 0 && gav.text() != "" ){ // there gav element , not empty, strike out old amount! $("#total_amount_old_val").css("text-decoration", "line-through"); } } note: using "style" attribute wipe out other custom styling may have added. using css() function not interfere if style attribute set...

sql - BeforeDoubleClick to run Macro with the cell value as a variable -

the below code have in sheets ("view code") page , calls macro in module page. double click variable target reason doesn't pull it. private sub gobeforedoubleclick3(byval target range, cancel boolean) if intersect(target, range("a3:a1000")) nothing exit sub lot = target.value cancel = true call lsrpull 'worksheets("lsr").activate end sub my first 2 events work fine simple go page macros. private sub gobeforedoubleclick2(byval target range, cancel boolean) if intersect(target, range("i3:i1000")) nothing exit sub prc = target.value cancel = true worksheets("tools").activate activesheet.range("$a$2:$g$3000").autofilter field:=2, criteria1:=prc end sub private sub worksheet_beforedoubleclick(byval target range, cancel boolean) on error resume next gobeforedoubleclick1 target, cancel gobeforedoubleclick2 target, cancel gobeforedoubleclick3 ...

How to write SSIS expression to append Previous week Monday to filename -

i trying rename file appending previous monday date filename.i using following expression appending today's date @[dest_dir] + "\\" + @[dest_file] + "_" + (dt_wstr,4)datepart("yyyy", getdate()) + right("0" + (dt_wstr,2)datepart("mm", getdate()), 2) + right("0" + (dt_wstr,2)datepart("dd", getdate()), 2) + ".xlsx" which working fine when replacing getdate() getdate()-7 last monday date(i run every monday) getting error. can me expression previous monday. try this: @[dest_dir] + "\\" + @[dest_file] + "_"+ (dt_wstr,4) year(dateadd( "dd", -7, getdate()))+ right( "0" + (dt_wstr,2) month( dateadd( "dd", -7, getdate() ) ), 2) +right( "0" + (dt_wstr,2) day( dateadd( "dd", -7, getdate() ) ), 2) + ".xlsx" the returned format is: dest_dir\dest_file_20160718.xlsx removing 7 days getdate() using dateadd ...

android - Java Bitmap change hue -

here code: public static bitmap processing(bitmap src, float hue) { int width = src.getwidth(); int height = src.getheight(); bitmap bitmap = bitmap.createbitmap(width, height, src.getconfig()); for(int x = 0; x < width; x++) { (int y = 0; y < height; y++) { int newpixel = huechange(src.getpixel(x, y), hue); bitmap.setpixel(x, y, newpixel); } } return bitmap; } private static int huechange(int startpixel, float hue) { float[] hsv = new float[3]; //array store hsv values color.colortohsv(startpixel,hsv); //get original hsv values of pixel hsv[0]=hsv[0]+hue; //add shift hue of hsv array hsv[0]=hsv[0]%360; //confines hue values:[0,360] return color.hsvtocolor(color.alpha(startpixel),hsv); } problem is: processing takes 3300ms if src bitmap size 480x480. , it's long me. what...

html - Centering elements in custom radio button label -

i'm using bootstrap 3 , trying center radio button, icon, , text , having no luck. my form simply stuffing inside label tag seems lot. the skeleton code started below: <form role="form"> <label class="radio-inline"> <input type="radio" name="optradio"> <br/> <div class="iconone"></div> <br/> option 1 </label> <label class="radio-inline"> <input type="radio" name="optradio"> <br/> <div class="icontwo"></div> <br/> option 2 </label> <label class="radio-inline"> <input type="radio" name="optradio"> <br/>...

c# - Refresing data in DataGrid is too "Flashy" -

i have method in dispatchertimer refreshes datagrid's data every 3 seconds. (3 seconds testing purposes) the thing every time datagrid gets refreshed, clears data , loads data again database(obviously). issue creates "flashy" effect each time data loads, because of rows being cleared , re-loaded datagrid. so question is, (after have taken @ code below) there better way of loading data again , again without creating flashing effect in datagrid? my method call data wcf service: public async task loadtrucks() { using (truckserviceclient service = new truckserviceclient()) { list<clientitems> truckitems = new list<clientitems>(); if (dgviewprojects.items.count <= 0) { foreach (var item in await service.gettrucksasync()) { truckitems.add(new clientitems { truckquoteid = item.quoteid, truckchassismanufacturer = item.chassis...

c# - Wrong list pasted via RedirectToAction method in ASP.NET MVC -

i faced following error while using redirecttoaction method in asp.net mvc 5. [httppost] public actionresult uploadorderreport(httppostedfilebase file) { string targetfolder = httpcontext.server.mappath("~/reports"); string targetpath = path.combine(targetfolder, file.filename); file.saveas(targetpath); var currentreports = directory.getfiles(targetfolder).tolist(); return redirecttoaction("currentprofile", new { existreport = new list<string>(currentfiles)}); } however, in currentprofile method got unexpected data [httpget] public actionresult index(list<string> existreports) and debugger shows existsreports argument system.collections.generic.list``1[system.string] i suppose problem related type casting? redirecttoaction method going return 302 response browser new url location header value. browser make new http request new url. if @ redirecttoaction method overloads...

python - Generate XML files based on rows in CSV -

i have csv , generate xml file based on each row in csv . right creates xml file last row in csv . how can modify script generate xml file each row. , ideally have the filename based on column: "file / entity name" . see below have, thanks! # csv module import csv # stuff xml module xml.etree.elementtree import element, subelement, tostring, elementtree import xml.etree.elementtree etree # topmost xml element root = element('root') number = element('number') # open file open(r'u:\projects\technical graphics\book1.csv') f: row in csv.dictreader(f): root = element('gmd:md_metadata') tree = elementtree(root) k, v in row.items(): child = subelement(root, k) child.text = v reader = csv.dictreader(f) tree.write(open(r'u:\projects\technical graphics\test.xml','w')) print tostring(root) you set value of root here: for row in csv.dictreader(f...

c# - Asp.net MVC boilerplate dependency injection not working -

i'm playing asp.net mvc 6 boilerplate project. i'm trying configure dependency injection 1 of services. seems built in ioc container ignoring binding. startup.cs public void configureservices(iservicecollection services){ /*boilerplate's default bindings*/ services.addtransient<idummy, dummy>(p => new dummy() { name = "from injection" }); } homecontroller.cs public iactionresult index(idummy dummy){ var test = dummy.name; return this.view(homecontrolleraction.index); } exception: argumentexception: type 'presentation.webui.controllers.idummy' not have default constructor could please tell me doing wrong? that exception because framework cannot bind action arguments interfaces. you trying injection on action when framework default uses constructor injection. reference: dependency injection , controllers constructor injection asp.net core’s built-in support co...

ruby - cron job generated by whenever/capistrano for a Sinatra app sets the wrong environment variable -

i using whenever gem in sinatra app create cron job. using whenever/capistrano job created/updated on deploy. whenever setup of deploy script: require 'whenever/capistrano' set :environment_variable, 'rack_env' set :whenever_roles, ->{ :app } set :whenever_command, ->{ [:bundle, :exec, :whenever] } set :whenever_command_environment_variables, ->{ { rack_env: fetch(:whenever_environment), rails_env: nil } } set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" } set :whenever_environment, ->{ fetch :rack_env, fetch(:stage, "production") } set :whenever_variables, ->{ "environment=#{fetch :whenever_environment}" } set :whenever_update_flags, ->{ "--update-crontab #{fetch :whenever_identifier} --set #{fetch :whenever_variables}" } set :whenever_clear_flags, ->{ "--clear-crontab #{fetch :whenever_identifier}" } when deploy, can see capistrano runs crontab u...

How to turn off wrapping in a grid in UWP XAML? -

i need template wrapping of grid items should turned off , list them vertically (as listview control would) , stretch items whole width of page. how turn off wrapping of grid without fixing width of items. thanks, soorya if don't want wrapping, don't use wrapgrid anymore. change itemspanel in gridview <stackpanel orientation="horizontal" /> . best of luck!

jQuery on submit for a form not activating, when jQuery loads the form -

i have puzzling error. i loading html file div, contains form, jquery .on(‘submit’) not work. if don’t load html div , instead have in original file, ".on('submit') works. can not see difference. using google chrome on mac view script the reason loading file, have different forms, depending on using script. is timing error or execution order have messed ? html , js <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> </head> <body> <div id="divheader"> <form id="frmlookup" method="post"> <table id="tblhdr"> <tr> <td><img id="logo" src="logo120.jpg" /></td> <td> <input id="inphdr" type="text" name="qrywords" size="23" placeholder="your search word/s, number/s" onfocus="this.pl...

c - Adding a driver to device path UEFI -

i trying add filter driver protocol in uefi, meaning consumes protocol, in hierarchy, pass through me. i understand need add driver relevant device path - though no idea how. more that, how work handles connected device? (if understood correctly, need connect driver device using by_driver | exclusive, , once connect own driver device path , use connectcontroller driver handles, uefi should automatically connect supporting handles me). i hoping if knows how add driver act filter driver (or in different semantic - layer driver?) specific protocol. would really, really appreciate given help, since have not found anywhere else. it's not complicated. thing need reinstall protocols wanna intercept. let's take efi_pci_io_protocol example: collect pci device handles in handle database: locatehandlebuffer() get original pci io interface on each handle handleprotocol() , record somewhere may want call inside new protocol interface. reinstall pci io protocol gbs...

javascript - AngularMaterial Dependancy Giving Errors -

im getting errors when add 'ngmaterial' dependency reason! show files, error. index.html: <!doctype html> <html> <head> <meta id="meta" name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> <link href='https://fonts.googleapis.com/css?family=robotodraft:400,500,700,400italic' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="assets/dist/css/vendor.min.css" type="text/css" /> <script type="text/javascript" src="assets/dist/js/vendor.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs...

c++ - OpenGL Instanced Rendering with multiple attributes -

Image
so i'm quite new opengl , learning instanced rendering. trying render 3 triangles diffrent positions , colors can't work. here's code: glfloat verts[] = { -0.5f, -0.5f, -0.5f, +0.5f, 0.0f, -0.5f }; gluint vertexbufferid; glgenbuffers(1, &vertexbufferid); glbindbuffer(gl_array_buffer, vertexbufferid); glbufferdata(gl_array_buffer, sizeof(verts), verts, gl_static_draw); glenablevertexattribarray(0); glvertexattribpointer(0, 2, gl_float, gl_false, 0, 0); glfloat xoffsets[] = { 0.0f, 0.5f, 1.0f }; gluint offsetsbufferid; glgenbuffers(1, &offsetsbufferid); glbindbuffer(gl_array_buffer, offsetsbufferid); glbufferdata(gl_array_buffer, sizeof(xoffsets), xoffsets, gl_static_draw); glenablevertexattribarray(1); glvertexattribpointer(1, 1, gl_float, gl_false, 0, 0); glvertexattribdivisor(1, 1); unsigned int colors[] = { 0xffff0000, 0xff00ff00, 0xff00ff00 }; gluint colorid; glgenbuffers(1, &colorid); glbindbuffer(gl_array_buffer, colorid); glbufferdata...

ios - I'm having trouble calling a view by code -

i want call view , when black screen . view want call swrevealviewcontroller ( menu), storyboard id "initial " . i'm calling follows: let modal = (self.storyboard?.instantiateviewcontrollerwithidentifier("initial"))! self.presentviewcontroller(modal, animated: true, completion: nil) anyone know wrong ? thank you.

javascript - How do I offset a Google Map Marker? -

i've read few posts on here regarding same thing. have code used, i'm not sure if i'm using correctly. 1 thing didn't how code used other javascript google maps controls parameters, styling, etc. here's snippet other thread : function offsetcenter(latlng, offsetx, offsety) { // latlng apparent centre-point // offsetx distance want point move right, in pixels // offsety distance want point move upwards, in pixels // offset can negative // offsetx , offsety both optional var scale = math.pow(2, map.getzoom()); var worldcoordinatecenter = map.getprojection().fromlatlngtopoint(latlng); var pixeloffset = new google.maps.point((offsetx/scale) || 0,(offsety/scale) ||0) var worldcoordinatenewcenter = new google.maps.point( worldcoordinatecenter.x - pixeloffset.x, worldcoordinatecenter.y + pixeloffset.y ); var newcenter = map.getprojection().frompointtolatlng(worldcoordinatenewcenter); map.setcente...

python - How can i send a flask response in from forked child and not from original handler -

i'm using flask gunicorn. i want stream of response constructed , returned different process, did fork gunicorn , return it. child process commits suicide , parent finish processing returning own response ("", 200). but, "curl localhost/preview -d'{}'" exits error: "problem (2) in chunked-encoded data". as understand it, because parent writes it's own response stream of http1.1 has been written child , break "chunked transfer encoding". can give me advice how can handle this? the simplified code use: https://gist.github.com/worroc/a5a97329cbda4b60941b44939c907868 thanks lot

c# - Foreach loop causing lag? -

in previous question here. found out how read , draw level each frame image. now have inputted player class, player moves choppy despite code not doing so. know because if comment level reading code out, player moves fine. i think it's foreach loop doing this. have no idea , appreciated! just save time clicking, here's successful level-reading code. public void readlevel(string path, graphicsdevice graphics) { //get array of colors texture2d level = content.load<texture2d>(path); color[] colors = new color[level.width * level.height]; level.getdata(colors); //read each pixel , draw level color brickrgb = new color(128, 128, 128); color blankrgb = new color(87, 0, 127); int placex = 0; int placey = 0; foreach (color pixel in colors) { spritebatch spritebatch = new spritebatch(graphics); spritebatch.begin(); if (pixel == brickrgb) { texture2d brick = content.load<tex...

How to receive AJAX type post with PHP -

i have got straightforward html form <form enctype="multipart/form-data" class="mesform"> <textarea maxlength="400" type="text" placeholder="your message" class="messageinp"></textarea> <div class="attach"> <input type="file" id="chatfil" accept="image/*"> <label for="chatfil"> <img src="../img/camera.png" class="addphc"> </label> </form> and jquery $("body").delegate('.messageinp','keydown',function(e) { if (e.which==13 ) { $(".mesform").submit(); } }); that's how submit form $(".mesform").submit(function(){ var val=$(this).children('textarea').val(); var who=$(".headchat").text(); var formdata = new formdata($(this)[0]); alert(formdata); if (val!=...

java - traversing xtext ast from the project code -

i have dsl grammar in xtext using in eclipse plugin. in plugin user manually creates new file (like blog.dmodel file in https://eclipse.org/xtext/documentation/102_domainmodelwalkthrough.html ) in plugin code, when user right clicks in dmodel file, can select right click menu option triggers method called traverseast() method finds iworkspaceroot root = workspace.getroot(); iproject project = root.getproject(projectname); ifolder folder = project.getfolder(path); ifile file = folder.getfile(filename); i understand ifile not can use traverse ast, trying following approach @inject static resourceset resourceset; public traverseast(){ iworkspaceroot root = workspace.getroot(); iproject project = root.getproject(projectname); ifolder folder = project.getfolder(path); ifile file = folder.getfile(filename); org.eclipse.emf.common.util.uri uri = org.eclipse.emf.common.util.uri.createplatformresourceuri(file.getful...

sprite kit - How to get the initial location of a continuous touch in swift -

i'm building first game in swift , want execute code block places sprites @ fingers touch location- if touch started outside of area of display. touch may or may not continuous, , therefore may or may not continuously generating new sprites, logic in touchesmoved . right i'm using for touch : anyobject in touches { let location = touch.locationinnode(self) ... to grab each touch location. however, seems continuously updated , i'm not sure how reference 1 specific touch , starting point (assuming multiple fingers down @ time). looked uitouch phase , touchended , see if work out other way of going problem, can't figure out how access phase of touch using apple docs. (this doesn't seem work: touch.phase == uitouchphase.ended i think i'm fundamentally misunderstanding how handle multiple touch events , how pass information between them ( touchesbegan , touchesmoved , touchesended ). may missing obvious, i'm surprised docs did seemingly-poor ...

jquery - How can I change Javascript Value into percentage instead of pixels -

i want change scrolltop value 50px lets 1% of user's screen. how possibly go doing this. reading js value can percentage, not working me. here codepen made demonstrate effect: [link] ( http://codepen.io/ericshio/pen/zbrbay ) html: <div class="filler"></div> <a href="#introjump"><img class="down-arrow" src="http://www.themainconcept.com/wp-content/uploads/2015/11/down-arrow-wht.png" alt="down arrow wht"/></a> css: .down-arrow { position: fixed; bottom: 1%; left: 50%; max-width: 3.5%; min-width: 3.5%; width: 3.5%; box-shadow: none; opacity: 0.6; } .down-arrow:hover { opacity: 1; } .filler { height: 10000px; } js: $(window).scroll(function() { $(".down-arrow").css("opacity", 1 - $(window).scrolltop() / 50); }); try this. $(window).scroll(function() { $(".down-arrow").css("opacity", 1 - ...

duplicates - Solr Deduplication (dedupe) giving all zeros in signatureField -

i've followed examples listed in documentation here: http://wiki.apache.org/solr/deduplication , https://cwiki.apache.org/confluence/display/solr/de-duplication however, when analyzing results every signaturefield gets returned so: 0000000000000000 i can't seem figure out why unique signature isn't being generated. relevant config sections: solrconfig.xml <requesthandler name="/update" class="solr.xmlupdaterequesthandler"> <!-- see below information on defining updaterequestprocessorchains can used name on each update request --> <lst name="defaults"> <str name="update.chain">dedupe</str> </lst> </requesthandler> ... <!-- deduplication example dedup update processor creates "id" field on fly based on hash code of other fields. example has overwritedupes set false since using id field signaturefield , solr mai...

c - MVAPICH2-GDR has segmentation fault error -

i trying use mvapich2-gdr simple hello world program. although can compile code successfully, has segmentation fault error in runtime. platform has redhat 6.5 , cuda 7.5. downloaded rpm file mvapich2-gdr-cuda7.5-intel-2.2-0.3.rc1.el6.x86_64.rpm. the mpi code simple hello world program: 1 #include <mpi.h> 2 #include <stdio.h> 3 4 int main(int argc, char** argv) { 5 // initialize mpi environment 6 mpi_init(null, null); 7 // number of processes 8 int world_size; 9 mpi_comm_size(mpi_comm_world, &world_size); 10 11 // rank of process 12 int world_rank; 13 mpi_comm_rank(mpi_comm_world, &world_rank); 14 15 // print off hello world message 16 printf("hello world %d out of %d\n", world_rank, world_size); 17 18 // finalize mpi environment. 19 mpi_finalize(); 20 } to compile program, used following command: mpicc hello.c -o hello to run program: mpirun -np 2 ./hello the error message follows: [localh...

vb.net - Line breaks lost when exporting datagrid to excel in CSV format WPF -

Image
this works fine, assuming there no line breaks in cells. dgvresults.selectallcells() dgvresults.clipboardcopymode = datagridclipboardcopymode.includeheader applicationcommands.copy.execute(nothing, dgvresults) dim result [string] = directcast(clipboard.getdata(dataformats.commaseparatedvalue), string) clipboard.clear() dgvresults.unselectallcells() try dim file new system.io.streamwriter("c:\export.csv") file.writeline(result) file.close() process.start("c:\export.csv") catch ex exception messagebox.show(ex.message, "error") end try this how add line breaks dim x new list(of string) each item in res.properties("proxyaddresses") x.add(item) next allsmtpaddresses = string.join(controlchars.lf, x) when export this, doesn't take consideration there line breaks,...

php - How to read a message only once from a queue -

i using activemq store queue of messages. using pecl stomp extension connect it. publishing queue successfully, , reading successfuly. how configure queue delete message after consumed it? in listener, use $c = new stomp($url); $c->subscribe('/queue/something'); echo $c->readframe(); you have acknowledge consumption of message them "deleted" queue. can $stomp->ack($messageid) . if don't want explicitely acknowledge receipt, can set headers of $stomp->subscribe of ack auto . make server auto acknowledge message , assume correctly delivered. $stomp->subscribe('/queue/something', array('ack' => 'auto')); references: http://php.net/manual/en/stomp.ack.php http://php.net/manual/en/stomp.subscribe.php https://stomp.github.io/stomp-specification-1.1.html#subscribe

python - Issue running uWsgi using pid/gid -

i'm trying run uwsgi using uid / gid parameters in wsgi ini file, drops privileged access after starting. note: works fine expected when remove these 2 parameters ini file. also, there no issues socket. however, when run specified uid , gid (nginx user , group), error indicative of having problem virtual env loading, traceback (most recent call last): file "wsgi.py", line 14, in <module> app import app application file "/var/www/wsgi/flask-appbuilder/peds_registry/app/__init__.py", line 1, in <module> import logging importerror: no module named logging again, work fine when running without gid/pid. also, note user , group nginx both exist , both have ownership on python project's directory structure. my nginx config's server/location directives follows: server { listen 80; server_name hostname.domain; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name hostname...

javascript - Possible strict violation one place but not another -

i know there few possible strict violation questions on here, haven't been able come result based on them. trying use var vm = this in controller in 1 class , it's throwing error, have done same thing in other controllers more once no possible strict violation errors. so here first js file. it's angular directive controller in same file. error coming var vm = this in controller below. angular.module('app.monitor').directive('scmodellegacyviewer', scmodellegacyviewer); function scmodellegacyviewer() { return { restrict : 'e', templateurl : 'app/monitor/monitor.html', scope : { config : '=', register : '&?', data : '=?', alloweditingswitch : '=?' }, controller: scmodellegacyviewercontroller, controlleras: 'vm' }; } scmodellegacyviewercontroller.$inject = [ '$q', '$scope', '$timeou...

How to pass a dynamic variable into an Ansible role -

for each of our servers (webs , perls), have different mount points each type of servers. web servers, want use entries "web_mounts" , perls "perl_mounts." if hard code "web_mounts" "with_items," works fine. otherwise, tells me "nfs_group" undefined. top level roles: - { role: webs, nfs_group: "web_mounts" } roles/nfs_mounts/vars/main.yml --- web_mounts: - { source: "nfs.local:/nfs/web1, dest: "/web1", opts: "rw,noatime" } - { source: "nfs.local:/nfs/web2, dest: "/web2", opts: "rw,noatime" } perl_mounts: - { source: "nfs.local:/nfs/perl1, dest: "/perl1", opts: "rw,noatime" } - { source: "nfs.local:/nfs/perl2, dest: "/perl2", opts: "rw,noatime" } roles/nfs_mounts/tasks/main.yml - name: create fstab entries mount: fstab=nfs state=present opts="{{ item.opts }}" src="{{ item.source }}...

ios - Attempt to present UIAlertController on UITabBarController whose view is not in the window hierarchy -

i have timer in app delegate, user choose time interval needed execute selector of timer in viewcontroller not in tab bar; after choosing time interval modal segue used load first viewcontroller in uitabbarcontroller when time interval passes want app present alert gives me this: warning: attempt present uialertcontroller on uitabbarcontroller view not in window hierarchy! here code i'am using : let alert = uialertcontroller(title: "alert", message: "test", preferredstyle: .alert) self.window?.rootviewcontroller?.presentviewcontroller(alert, animated: true, completion: nil) first try visible view controller. can this public extension: public extension uiwindow { public var visibleviewcontroller: uiviewcontroller? { return uiwindow.getvisibleviewcontrollerfrom(self.rootviewcontroller) } public static func getvisibleviewcontrollerfrom(vc: uiviewcontroller?) -> uiviewcontroller? { if let nc = vc as? uinavigation...

python - SFrame from numpy array -

i create sframe numpy array: what want: np.arange(16).reshape(4, 4) => +----+----+----+----+ | 0 | 1 | 2 | 3 | +----+----+----+----+ | 0 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | | 8 | 9 | 10 | 11 | | 12 | 13 | 14 | 15 | +----+----+----+----+ [4 rows x 4 columns] if do: print sframe(np.arange(16).reshape(4, 4)) i get: +--------------------------+ | x1 | +--------------------------+ | [0.0, 1.0, 2.0, 3.0] | | [4.0, 5.0, 6.0, 7.0] | | [8.0, 9.0, 10.0, 11.0] | | [12.0, 13.0, 14.0, 15.0] | +--------------------------+ [4 rows x 1 columns] i can want if convert numpy array pandas dataframe , pandas dataframe sframe: print sframe(pd.dataframe(np.arange(16).reshape(4, 4))) +----+----+----+----+ | 0 | 1 | 2 | 3 | +----+----+----+----+ | 0 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | | 8 | 9 | 10 | 11 | | 12 | 13 | 14 | 15 | +----+----+----+----+ [4 rows x 4 columns] the question is: "how can create sfame numpy array in w...