Posts

Showing posts from April, 2011

Powershell magnling ascii text -

i'm getting characters , lines when trying modify hosts files. example, select string not take out, 2 files different: get-content -encoding ascii c:\windows\system32\drivers\etc\hosts | select-string -encoding ascii -notmatch "thereisnolinelikethis" | out-file -encoding ascii c:\temp\testfile ps c:\temp> (get-filehash c:\windows\system32\drivers\etc\hosts).hash c54c246d2941f02083b85ce2774d271bd574f905babe030cc1bb41a479a9420e ps c:\temp> (get-filehash c:\temp\testfile).hash ac6a1134c0892ad3c5530e58759a09c73d8e0e818ec867c9203b9b54e4b83566 i can confirm commands inexplicably result in line breaks in output file, in start , in end. powershell converts tabs in original file 4 spaces instead. while cannot explain why, these commands same thing without these issues: try code instead: get-content -path c:\windows\system32\drivers\etc\hosts -encoding ascii | where-object { -not $_.contains("thereisnolinelikethis") } | out-file -fil...

html - Why is the text being transparent? -

html: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <script src="script.js"></script> <title>cool effect</title> </head> <body> <div class="imageholder"> <span class="note">hello!</span> <img src="picture1.jpeg"> </div> </body> </html> css: .imageholder { position: relative; border: 1px solid black; width: 300px; height: 250px; text-align: center; overflow: hidden; background-color: black; } .note { position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); border: 2px solid white; padding: 8px; color: white; opacity: 1; font-size: 24px; display: inline-block; } img { width: 300; opacity: 0.4...

css - Remove Blue highlighting of option -

i've got select options: <select style="display: inline-block;" class="shs-select form-select shs-select-level-1" size="10" id="edit-shs-term-node-tid-depth-select-1"> <option value="0">- none -</option> <option value="87">a</option> <option value="88">b</option> <option value="89">c</option> <option value="95">d</option> <option value="90">e</option> </select> hohe can remote blue highlighting of option, in 1 selected? thanks answers. some browsers chrome use outline default. can disable removing it. select { outline: none; } .no-outline { outline: none; } <div> <strong> outline </strong> <select> <option> </option> <option> b </option> <option> c </option>...

android - Phonegap- Facebook connect. Api calls doesn't fire any callback -

i'm using phonegap build. first of all, need error doesn't happen if try administrator account of app. happen if normal user tries login in app. this code far. var facebookpermissions = ['public_profile', 'email', 'user_about_me', 'user_website']; $(document).on('click', '#btnfacebook', function() { //click facebookconnectplugin.login(facebookpermissions, onfacebookloginsuccess, onfacebookloginerror) }); function onfacebookloginsuccess(userdata) { alert("userdata: " + json.stringify(userdata)); facebookconnectplugin.api('me', facebookpermissions, function(result) { alert("result: " + json.stringify(result)); }); }; i'm app's administrator , every work expected... no trouble @ all. if user tries login, login works well, there no response api request. first alert displayed i tried parameters facebookconnectplugin.api("/?fields=id,email...

javascript - How to get dynamic value from URL -

Image
i studying on angularjs there want load content mysql in reference url value. the angularjs routeprovider used this: $routeprovider.when('/page/pages=:pages', { templateurl: 'page.html', reloadonsearch: false }); my dynamic url is: "<a class='list-group-item' href='#/page/pages=" + slug + "'>" + title + " <i class='fa fa-chevron-right pull-right'></i>" + "</a>" after that, tried alert url location on phonegap (screenshot attached) now, want pass pages value ajax result query mysql. $(function () { //----------------------------------------------------------------------- // 2) send http request ajax http://api.jquery.com/jquery.ajax/ //----------------------------------------------------------------------- jquery.ajax({ url: 'http://keralapsctuts.com/app/index.php', //the script call data data: ...

jquery post() response not comparing to string -

in advance help, i'm having problem response of post(), when trying compare string, code is: $.post( "cand.php?id=<?php echo $user_id; ?>", { accion: "eliminar"}) .done(function(data) { console.log ($.type(data)); console.log (data); console.log (data === 'ok'); }); and console answers are: string ok false as cas see data var string value of "ok" when compare string, it's false

escaping - Removing new lines and escape characters introduced when reading file in PHP -

{ "elements": [ { "cardtype": "textcard", "title": "final fantasy", "titlesize": "medium" } ] } the above content of file. want return in response. use file_get_contents read contents, however, this: {\n \"elements\": [\n {\n \"cardtype\": \"textcard\",\n \"title\": \"final fantasy\",\n \"titlesize\": \"medium\",\n ... the new lines , escaping not want. there way avoid that? use following code removing \n data. $filedata = str_replace(array("\r", "\n"), '', file_get_contents($filename));

android - How do i use a custom font in a fragment layout? -

*edit i think has android 5.0.2. tried activity, , gives me same error. so i'm new navigation drawer , fragments. works fine , want have textview custom font. works method below, doesn't. public class homefragment extends fragment { public homefragment(){} @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // use everytime normal layouts, fragment layout doesnt work textview txt = (textview) findviewbyid(r.id.textviewhome); typeface font = typeface.createfromasset(getassets(), "impact.ttf"); txt.settypeface(font); view rootview = inflater.inflate(r.layout.fragment_home, container, false); return rootview; } } the errors are: the method getassets() undefined type homefragment method findviewbyid(int) undefined type homefragment as i'm new android programming, want solution , want understand why it's wrong. highly appreciated! you ne...

php - How to prevent escaping of a Twig Node Expression? -

i'm trying implement spread attributes in twig . i've got it, i'm not sure how prevent ouput being html-escaped. i've registered new operator in twig_extension : public function getoperators() { return [ [/* unary operators */ '...' => array('precedence' => 10, 'class' => spreadattributes::class), ], [/* binary operators */ // ... ] ]; } my class looks this: class spreadattributes extends twig_node_expression_unary { public function compile(twig_compiler $compiler) { $compiler ->raw(\wxutility::class . '::html_attrs(') ->subcompile($this->getnode('node')) ->raw(')'); } public function operator(twig_compiler $compiler) { throw new \exception("unused"); } } usage: <label{{ ...label_attrs }}> but compiled output looks this: echo twig_esc...

ios - How to write this Objective-C Code into Swift -

Image
i have method in objective-c i'm trying call in swift. [testobjectloader loadobject:summarymetrics fromjsonfile:@"summarymetrics" withmapping:[mappingprovider summarymetricsmapping]]; this method loads json file, , when try use loadobject method, approach testobjectloader.loadobject(summarymetrics, fromjsonfile:"summarymetrics", withmapping:mappingprovider.summarymetricsmapping()) but auto-complete not come up. have bridging file working, i'm not sure i'm doing wrong.. error message: testobjectloader.type not have member named loadobject any appreciated. in general, equivalent swift syntax be: testobjectloader.loadobject(summarymetrics, fromjsonfile:"summarymetrics", withmapping:mappingprovider.summarymetricsmapping())

android - ImageView Only Appears When Setting Background in XML - Not Using Picasso -

i have strange situation. have imageview (imageview1) should populated image using picasso: imageview imageitem = (imageview) findviewbyid(r.id.imageview1); picasso.with(this).load(boxart) .fit().centerinside().into(imageitem); for strange reason - imageview not populate when using picasso - add background via xml: android:background="@drawable/boxart" both show - don't understand. xml: http://pastebin.com/yuxxaxql screenshot: with android:background="@drawable/boxart" - http://imgur.com/7nmvdct without android:background="@drawable/boxart" - http://imgur.com/unqowhp any suggestions appreciated. it looks similar other issues: https://github.com/square/picasso/issues/457 since using wrap_content , , don't have content on imageview, renders height=0 when loading image picasso, set fit() , adjusts new image imageview size. since height 0, nothing renders. some things can do: if using older version, up...

Determine whether a string contains an Integer or a Float in Ruby -

let's input string, , know whether contains integer or float . for example: input_1 = "100" input_2 = "100.0123" now, let's take account following: input_1.respond_to?(:to_f) # => true input_1.is_a?(float) # => false input_1.is_a?(fixnum) # => false input_1.to_f? # => 100.0 input_2.respond_to?(:to_i) # => true input_2.is_a?(integer) # => false input_2.is_a?(fixnum) # => false input_2.to_i # => 100 in cases above, can't determine whether string contains integer or float . there way in ruby determine whether string contains fixnum or float ? you use regular expressions: n = '100.0' if n =~ /\a\d+\z/ puts 'integer' elsif n =~ /\a\d+\.\d+\z/ puts 'float' else puts 'not integer or float' end edit regular expressions taste.

c# - MVC controller being loaded multiple times -

my goal: the user session keep track of guid's stored in session.add(guid.tostring()). when partial refreshed inside div, controller check existing guids. let me track notifications need displayed, being displayed avoid duplicates ..etc. the problem: when notification should displayed again, isn't though see in model being passed view what think cause for reason when debug controller start of method load partial, it's being loaded many times believe why when notification should displayed, isn't. main index view refreshes partial. #overview. interval every 15 seconds. function intervaltrigger() { $('#overview').load('/home/overview'); }; <div id="overview"> @{html.renderpartial("overview", "home");} </div> code inside overview partial displays alerts @for (int = 0; < model.displayalerts.count(); i++) { @:$(function () { @:$.notify({ ...

c# - How to display variable length array using DebuggerDisplay? -

this question has answer here: how make [debuggerdisplay] respect inherited classes or @ least work collections? 3 answers in c# .net see system.diagnostics.debuggerdisplayattribute can display customized information during debugging session. useful, , easy display single values. but arrays? take below snippet example. switching between 2 attributes commenting/uncommenting because have usage scenario mqueue 5 elements long, , 2. there way debuggerdisplay attribute handle arrays don't have hard-code display statements? //[debuggerdisplay("[{mqueue[0]} {mqueue[1]} {mqueue[2]} {mqueue[3]} {mqueue[4]}]")] //[debuggerdisplay("[{mqueue[0]} {mqueue[1]}]")] internal class state { internal list<int> mqueue { get; set; } } my apologies, duplicate of: how make [debuggerdisplay] respect inherited classes or...

pointers - How does Rust know which types own resources? -

when 1 has box pointer heap-allocated memory, assume rust has 'hardcoded' knowledge of ownership, when ownership transferred calling function, resources moved , argument in function new owner. however, how happen vectors example? 'own' resources, , ownership mechanics apply box pointers -- yet regular values stored in variables themselves , , not pointers. how rust (know to) apply ownership mechanics in situation? can make own type owns resources? tl;dr: "owning" types in rust not magic , not hardcoded compiler or language. types written in way (do not implement copy , have destructor) , have semantics enforced through non-copyability , destructor. in core rust's ownership mechanism simple , has simple rules. first of all, let's define move is. simple - value said moved when becomes available under new name , stops being available under old name: struct x(u32); let x1 = x(12); let x2 = x1; // x1 no longer accessible here, try...

how to configure Firefox to only allow certain iframe access -

in order modernize our old web application changed our frames iframes. the web application runs ok change, errors occur. today had chance users desktop , firefox (he has problems) via teamviewer (it's remote troubleshooting tool, it's similar having vnc session on remote desktop). i installed firebug on remote firefox , tried log our web application. in console found error line: permission denied access property "document". after googling found out has iframes , sameorigin policy: http://davidwalsh.name/iframe-permission-denied https://developer.mozilla.org/en-us/docs/web/http/x-frame-options my question is: the user has current firefox (version 38 or 39). did not have time ask him possible changes in settings. in short time had chance being @ firefox saw has lot of addons. i have firefox 39 , not have problems iframes. there must setting or addon change. can tell me change in firefox in order tighten security policies error?

javascript - Install plugin cordova -

i have develop app check if gps enabled or disabled. if gps disabled, have send users on device's settings. i find this plugin that. so, installed plugin using node.js using command line (cordova plugin add com.dataforpeople.plugins.gpssettings). i use code in javascript file go device's settings : var gpsdetect = cordova.require('cordova/plugin/gpsdetectionplugin'); phonegapready().then(function () { gpsdetect.checkgps(onsuccess, onerror); }); but in logcat have error: 07-22 15:36:59.555: e/web console(2230): uncaught module cordova/plugin/gpsdetectionplugin not found @ file:///android_asset/www/cordova.js:59 anyone know how can fix problem?

building jQuery plugin , Object is not passing to 'each' function -

i'm building jquery plugin . initial code : if (typeof object.create !== 'function') { object.create = function(obj) { function f() {}; f.prototype = obj; return new f(); }; }(function($, window, document, undefined) { var datatable = { init: function(options, elem) { console.log(options); var self = this; self.elem = elem; self.$elem = $(elem); // if (typeof options !== 'string') { self.options = $.extend({}, $.fn.sonaldatatable.options, options); // } console.log(self.options); self.cycle(); }, cycle: function() { var self = this; self.buildtable(); }, buildtable: function() { var self = this; self.gettableinfo(); }, gettableinfo: function() { var self = this; $.getjson(self.options.url + 'initiate', function(data) { // this.options.table = data; console.log(self.op...

c# - Is there a way to crop and deskew a quadrilateral from an image in a Windows Store (WinRT) application? -

i'm writing application windows store uses canny edge detection find borders of document on image. need able crop image once corners found. can use writeablebitmapextension methods crop rectangle, problem rectangle, rather quadrilateral. i read called aforge may able it, doesn't support silverlight/winrt looks like. know should possible opengl, require change large portion of application. there alternatives? you implement writeablebitmapex using blit , n alpha mask region want crop. create mask dynamically result canny edge detection. make sure pixels want keep have alpha value of 255 , ones want crop have alpha value of 0 in mask bitmap. use blit method on original image, supply generated alpha mask bitmap parameter , blendmode.alpha well. won't reduce size of original image @ least unwanted pixels gone. before alpha masking crop rectangular using min, max of x , y edge detection result. way size reduced , alpha masking should faster bonus.

html - What am I doing wrong with trying to get my Disqus plugin to work? -

i'm building website , it's saved on desktop right now. i'm trying place disqus on 1 of pages , pasted code in html document , i'm not getting on page. able twitter widget work on different page pasting code given me , same type of instruction given disqus paste universal code site nothing showing up. do have css file showing? searching through settings in disqus , 1 of settings allows me set website url website not live , located in folder in desktop containing html , css files. i created test html document in folder containing html documents sentence contained in paragraph tag. <! doctype html> <html> <head> <title>test-disqus</title> </head> <body> <p> testing disqus.</p.> <div id="disqus_thread"></div> <script type="text/javascript"> /* * * configuration variables * * */ ...

Combine two dataframe columns in R -

this question has answer here: paste elements of 2 columns [duplicate] 2 answers suppose have dataframe such as: b c a b b d e and want create new column in dataframe b , c combined (call d). a b c d aa b b bb d e ea you can use paste . df1$d <- do.call(paste0, df1[c('b', 'c')]) or df1 <- transform(df1, d= paste0(b,c))

c++ - Swig: SWIG_NewPointerObj and Typemaps -

i'm working on qt-application , use swig generate python bindings public api. i trying implement signal/slots in swig , embedding python final app. in end boils down simple function, swig seems miss or haven't found yet: pyobject* createpyobject(qstring typename, bool passownership, void* obj) requirements the function should create pyobject passed obj . whereas typename type of instance obj points , passownership specifies whether or not object should owned python interpreter afterwards. function should: apply out -typemap passed type, if exists otherwise wrap object "swig proxy object of type ..." if possible and if that's not possible should return "swig object of type ..." example let's have 3 classes: class a1 have out -typemap convert instances of class python-integers . class a2 have out -typemap convert instances of class python-tuples . class b have wrapped using swig interface file class c unknown swig....

ruby - How can I install Jekyll on OSX 10.11? -

error: while executing gem ... (errno::eperm) operation not permitted - /usr/bin/jekyll i'm getting permission error on trying install jekyll. i'm running osx 10.11 (el capitan). have xcode 7 , have installed developer tools. there workaround or os specific issue? this side effect of apple's new rootless (aka system integrity protection or sip) feature in os x el capitan, not affect /usr/local/bin . you might try following: sudo gem install -n /usr/local/bin/ jekyll this tells gem install jekyll folder isn't protected sip, rather default protected location under /library/ruby/gems . this solution suggested jekyll's developers .

image - Python - rgb2gray not working on my photo -

Image
it's bit complicated, i'll try explain. i have photo on computer, photo of face. want read image matrix x , operations won't go detail it's rather complex, in end should x=as here code import numpy np import skimage.io io skimage import color import sklearn.decomposition dc x=color.rgb2gray(io.imread('/home/oria/desktop/1.ppm')) ica=dc.fastica() s=ica.fit(np.matrix.transpose(x)) a=ica.mixing_ b=np.linalg.pinv(a) s=np.dot(b,x) y=np.dot(a,s) the expected end result, y approximately equal x. not case, , think reason why isn't case x in graylevel image (this io.imshow(x) ) while y not ( io.imshow(y) ): you can see same person, same picture, good,but colors distorted. thought maybe if transfer y graylevel, x=y. but whenever io.imshow(color.rgb2gray(y)) , nothing changes. , check myself further, y-color.rgb2gray(y) indeed 0 matrix. it's if rgb2gray didn't anything. why isn't working?

Check if the user when log out from facebook in android facebook sdk 4 -

my problem hav app can connects facebook using facebook sdk new version(4.0) , want when user logs facebook , textview appears , show it's name , when log out clicked textview disappears . the first part done , can data want: btnloginbutton.registercallback(callbackmanager, new facebookcallback<loginresult>() { @override public void onsuccess(loginresult loginresult) { fbloginclicked = true; graphrequest.newmerequest(loginresult.getaccesstoken(), new graphrequest.graphjsonobjectcallback() { @override public void oncompleted(jsonobject object, graphresponse response) { try { string jsonresult = string ....

javascript - JS and SyntaxError: identifier starts immediately after numeric literal -

looking here, getting error script: error: syntaxerror: identifier starts after numeric literal call_logs(140213fs01) script: "aocolumndefs": [ { "atargets": [ 3 ], // column target "mrender": function ( data, type, full ) { //alert (json.stringify(full)); //************show contents of object var str = full[2]; return '<a href="#;" onclick="call_logs('+str+')"; >' + data + '</a>'; } } ] ...... function call_logs(id){ alert("call logs funct :"+id); }

export - Is there a way to bulk download files in Jive via API or script? -

we have extract 1,000 documents divestiture. doing clicking going take long time. know jive has api, can find let download multiple files multiple groups. any ideas appreciated. thanks! sure. use /contents/{contentid} grab document. there's more detail in document entity section of jive rest api documentation . you might find list of documents retrieve using search methods of api . here's curl example: curl -v -u <username:password> https://<url>/api/core/v3/search/contents?filter=search(<search term>) also, know, there active jive developer community questions more eyeballs. and, start development jive in general, check out https://developer.jivesoftware.com/

cuda - Thrust Histogram with weights -

Image
i want compute density of particles on grid. therefore, have vector contains cellid of each particle, vector given mass not have uniform. i have taken non-sparse example thrust compute histogram of particles. however, compute density, need include weight of each particle, instead of summing number of particles per cell, i.e. i'm interested in rho[i] = sum w[j] j satify cellid[j]=i (probably unnecessary explain, since knows that). implementing thrust has not worked me. tried use cuda kernel , thrust_raw_pointer_cast , did not succeed either. edit: here minimal working example should compile via nvcc file.cu under cuda 6.5 , thrust installed. #include <thrust/device_vector.h> #include <thrust/sort.h> #include <thrust/copy.h> #include <thrust/binary_search.h> #include <thrust/adjacent_difference.h> // predicate struct is_out_of_bounds { __host__ __device__ bool operator()(int i) { return (i < 0); // out of bounds e...

R - installing FFTW3 package on Windows machine -

i trying build cartogram r following algorithm of gastner & newman on diffusion-based methods producing density-equalizing maps i have found recipe on how of getcartr , rcartogram packages; however, requires installation of fast fourier transform libraries fftw3 , fftw . i installed fftw cran, have problem fftw3 , find archived file here . i following error message when trying install package .zip file: install.packages(choose.files(), type="source", repos=null) installing package ‘h:/r.shiny.tutorial/libraries’ (as lib unspecified) warning in read.dcf(file.path(pkgname, "description"), c("package", "type")) : cannot open compressed file 'fftw-3.3.4/description', probable reason 'no such file or directory' error in read.dcf(file.path(pkgname, "description"), c("package", "type")) : cannot open connection warning in install.packages :...

c# - Error publish in Win2003 Server MVC project -

i'm trying publish application in win 2003 server iis6. and i'm debugging on other pc , works ok win 2007 professional , iis7. this project uses .net 4.0 , asp.net mvc 4. if in pc try open: http://localhost/chat/home/index http://localhost/chat it works ok. but on server, if type this http://localhost/chat i have list of folders in project if navigate http://localhost/chat/views/home/index.cshtml i error: server error in '/chat' application. the resource cannot found. description: http 404. resource looking for... if try http://localhost/chat/home/index i other error: the page cannot found the page looking might have been removed, had name changed, or temporarily unavailable. this default routeconfig : public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( name: "default", ur...

angularjs - How to access multiple HTTP GET actions in same controller? -

here web api controller: [httpget] public httpresponsemessage sensordata(string id) { try { responds data = accessremote.getdatafromdevice(id); dataresponds dataresponds = data.returndatrequest[0]; return request.createresponse(httpstatuscode.ok, dataresponds); } catch (exception ex) { return request.createresponse(httpstatuscode.forbidden, ex.message); } } [httpget] public httpresponsemessage getlogs(string getrecordsbyid) { try { iqueryable<sensorinfo> data = sensorresultsrepos.get(); httpresponsemessage response = request.createresponse(httpstatuscode.ok, data); return response; } catch (exception) { throw; } } here resource angularjs definition: (function () { "use strict"; angular.module("sensormanagement").factor...

linux kernel - using the same rootfs for different ARM SOCs -

i'm trying use userspace built i.mx53 on identical board i.mx6. i.mx6 board differs in cpu used. built new kernel , appropriate dtb, can load uboot , starts fine. however, when try use rootfs had i.mx53 board following jffs error: jffs2: inconsistent device description which has flash oob not containing valid information. write rootfs flash partition nand write.trimffs command. need initialize oob somehow? don't remember doing on old board. can error come from? turns out i.mx6 nand controller (gpmi driver) uses entire oob space ecc , jffs2 cannot fit it's markers there. possible communicate kernel weaker requirements ecc based on nand chip specification , use fsl,use-minimum-ecc device tree option save oob. however, u-boot not seem have support such ecc reconfiguration , becomes impossible use nand in both bootloader , linux. best way forward in situation ditch jffs2 , use ubifs instead. note: i've seen jffs2 patches make not use oob, haven't t...

pyspark - What is spark.python.worker.memory? -

could give me more precise description of spark parameter , how effects program execution? cannot tell parameter "under hood" documentation. the parameter influences memory limit python workers. if rss of python worker process larger memory limit, spill data memory disk, reduce memory utilization expensive operation. note value applies per python worker, , there multiple workers per executor. if want take under hood, @ python/pyspark directory in spark source tree, e.g. externalmerger implementation: https://github.com/apache/spark/blob/41afa16500e682475eaa80e31c0434b7ab66abcb/python/pyspark/shuffle.py#l280

How to expose types generated by an F# Type Provider to C# and XAML -

so, i'm using xml type provider create types xml document. one of elements in xml file has date property: <edit date="06/30/2015 16:57:46" ... /> which of course results in type this: type edit = inherit xmlelement member date: datetime ... is there way can add following code: member this.localtime get() = this.date.tolocaltime() to resulting edit type? the reason i'm binding instances of edit xaml , don't want write ivalueconverter that. edit: so, realized these types not make xaml. instead, instances of fsharp.data.runtime.basetypes.xmlelement of course not contain properties see in f# code. need consume these types c# code, , there xmlelement s without properties i know use xpath in xaml navigate xelements inside this, still need way access resulting object model in typed way, both c# , xaml. edit2: so wrote type extension this: type catalog.edit member this.localtime get() = t...

Website showing old versions - Git or Laravel? -

i've been attempting move website's filesystem new server, , i'm running issue i'm baffled by. when view filesystem through server, ftp client, , ssh, can see files date , match have on recent development version. when try , access through page, see version of front page months old , doesn't exist in filesystem anymore. the thing think of causing behavior git, server doesn't have installed. .git repository in filesystem got moved along file transfer - can git repository go far superimpose old versions of filesystem on existing files without git being installed or instantiated? what i'm using laravel ubuntu server git on development server (not installed on production) filezilla uploads when check routes artisan, checks out, , can't access of old version's routes i've since deleted - shows 404. think it's views directory that's being superimposed these old files. don't know what's causing or how stop it. ...

php - AJAX FormData Post - 503 Service Unavailable -

i've searched extensively on problem without avail or maybe i'm missing issue. please, relay me improve on explanation. i have 'file' input calls php file using ajax on 'change' so: $(document).on('change', 'input[name="photo"]', function(){ var file = this.files[0]; var formdata = new formdata(); var user = localstorage.getitem("user"); formdata.append('_file', file); formdata.append('_user', user); $.ajax({ type: "post", cache: false, url: ip + "php/insert_img.php", data: formdata, contenttype: false, processdata: false, success: function (e) { // }, error: function (jqxhr, textstatus, errorthrown) { alert(textstatus, errorthrown); } }); }); this supposed phonegap...

amazon web services - AWS S3 - No 'Access-Control-Allow-Origin' header is present on the requested resource -

i have client static website on s3 (app.foo.org) sending http requests web application running on elastic beanstalk (www.foo.org). the s3 web application configuration is: <?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>*</allowedorigin> <allowedmethod>get</allowedmethod> <allowedheader>*</allowedheader> </corsrule> </corsconfiguration> on s3 application set http headers cors. on server set response headers following: httpresponse.setheader("access-control-allow-origin", "*"); httpresponse.setheader("access-control-allow-methods", "get, post, delete, put"); httpresponse.setheader("access-control-allow-headers", "x-requested-with, content-type"); everything working fine, when upload new version of stati...

sql server - Replacement for scalar function by inline function -

i have proc uses scalar function, in select statement twice described below.is better performance wise replace inline function when deal millions of records.if should it create function getcategory ( @shopping_store char(4), @cart_type char(2), @category_type int, @index_cat_type int ) returns int begin if @shopping_store in ('1111','1222','3222') , @cart_type in ('120') return -@category_type else if @shopping_store in ('4333','54322') , @cart_type in ('120') return @index_cat_type else begin if @shopping_store in ('32214','5432','5654') return @category_type else return -@index_cat_type end return @category_type end all if elses can converted single case expression. lets convert scalar function inline table valued function. performance benefit of should substantial state have millions of ...

c++ - How to create re-usable libraries based on qmake? -

i have multiple applications use 1 or more common libraries. libraries depend on each other. here files tree: libaries/ library1/ library1.pro library1.cpp library1.h library2/ library2.pro library2.cpp library2.h applications/ app1/ app1.pro main.cpp app2/ app2.pro main.cpp app1 depends on library1. app2 depends on library1 , library2. i'd able develop in qt creator in easy way, when open application1 have following behavior: application1 code available in qt creator library1 code available in qt creator compiling application1 automatically compiles library1 , puts output .dll/.so file in same directory application1 .exe. this visual studio able years , seems such basic thing me don't understand i'm 1 having problem. do have clue on how ? tried different solutions based on subdirs, never reach 3 points above. edit:to clarify little, able like: application1.pro incl...

scala - Using v. Not Using the `self` Type -

given following traits: scala> trait foo { self => | def f: string = self.getclass.getname | } defined trait foo scala> trait bar { | def f: string = this.getclass.getname | } defined trait bar and making classes extend them: scala> class fooimpl extends foo {} defined class fooimpl scala> class barimpl extends bar {} defined class barimpl and calling f methods on new instances: scala> (new fooimpl).f res1: string = fooimpl scala> (new barimpl).f res4: string = barimpl the repl shows print out same values - class's name. perhaps isn't example. what's difference of using self in above foo compared bar , uses this ? in case there's no difference—you're using name this . self types useful when need disambiguate between different this s. example: abstract class foo { self => def bar: int def qux = new foo { def bar = self.bar } } if wrote def bar = this.bar here, compiler c...

d3.js - How to remove or clear data of dc.dataTable? -

we have added line chart, time slider , data table in our html page. when users click on 'clear all' button want remove our line chart, time slider , data table. the line chart , time slider removed using d3.selectall("svg").remove(); how remove / clear data table? using jquery do $("#clearbutton").click(function() { $("#datatable").css("display", "none"); }); where "clearbutton" id of button , "datatable" id of data table html element.

Simple Filename/Path Regex -

i need create regex expression use in redirect plugin in wordpress. i have bunch of legacy url's this: /article.php/281/19/0 /article.php/383/20 /article.php/28/2/1 etc... essentially want create regex strip off beyond first set of numbers. e.g. /article.php/281/19/0 transforms /article.php/281 for yoast, can use regex: /(article\.php\/[0-9]+)/ newurl: /$1/ based on: https://yoast.com/wordpress-seo-premium-1-1/

eclipse plugin - Gradle excludes self when excluding all transitive dependencies -

i've com across particular problem have been unable solve , grateful help. included jar dependencies artifact dependencies in java project. looked following: compile "com.example:projecta:1.0.0@jar" so far good. let's call project 'a'. have included project in java project b, again gradle. i've noticed published maven-publish did not exclude transitive dependencies, in pom file, when using in b. so started using transitive flag: dependency("com.example:projecta:1.0.0") { transitive = false } this makes sure in project b, excluded transitive deps of when using eclipse plugin , gradle itself. however problem missing exclusion in published pom.xml remained. found issue seems solved @ time of writing , gradle version: gradle-2945 so tried following: dependency("com.example:projecta:1.0.0") { exclude group: '*' } the pom file correctly has desired exclude rules transitive dependencies in accordance...

2-Dimensional Minimization without Derivatives and Ignoring certain Input Parameters on the go -

i have function v depends on 2 variables v1 , v2 , parameter-array p containing 15 parameters. want minimize function v regarding v1 , v2, there no closed expression function, can't build , use derivatives. the problem following : caluclating value of function need eigenvalues of 2 4x4 matrices (which should symmetric , real concept, eigensolver not real eigenvalues). these eigenvalues calculate eigen package. entries of matrices given v1,v2 , p. there input sets of these eigenvalues become negative. these input sets want ignore calculation lead complex function value , function allowed have real values. is there way include this? first attempt nelder-mead-simplex algorithm using gsl-library , way high output value function if 1 of eigenvalues becomes negative, doesn't work. thanks suggestions. for nelder-mead simplex, reject new points vertices simplex, unless have desired properties. your method artificially increase function value forbidden points cal...

Scala Quasiquotes Destructuring a Type -

context: i'm working on library working jmx in scala. 1 of objectives have strong typed interface managed beans. guess akin to spring framework jmx library. objective: macro deserialise tabulardata case class: // interface i'd generate implementation using macro trait jmxtabularassembler[t <: product] { def assemble(data: tabulardata): t } object jmxannotations { case class attribute(name: string) extends staticannotation } case class example( @attribute("name") name: string, @attribute("age") age: int, unmarked: string ) problem: there plenty of examples of composing tree's using q"" interpolators. can't figure out how use tq"" interpolator extract fields out of case class type context. private def mkassembler[t <: product : c.weaktypetag](c: context): c.universe.tree = { import c.universe._ val tt = weaktypeof[t] } question: how use quasiquote machinery destructure fields of case class ...

python - Pandas dataframe: how to create columns from values? -

i have pandas dataframe looks like: day payment_method actuals 0 2015-03-31 dcash_t3m 32 1 2015-03-31 dcash_t3m_3d 90 2 2015-03-31 paypal 34 4 2015-04-01 dcash_t3m 16 5 2015-04-01 dcash_t3m_3d 54 6 2015-04-01 paypal 33 7 2015-04-02 dcash_t3m 7 8 2015-04-02 dcash_t3m_3d 80 9 2015-04-02 paypal 38 what want perform time series analysis on them. advantageous if had column each payment method reporting corresponding actuals , order total values , times series. day dcash_t3m dcash_t3m_3d paypal 2015-03-31 32 90 34 2015-04-01 16 54 33 2015-04-02 7 80 38 datatime object new column distinct date each roe. values of column payment_method 3 new columns each of them containing values in actuals. you wa...

php - How to get an output from exec? -

i tried different variations of exec : exec('which ffmpeg', $output, $e); exec("which ffmpeg", $output); exec('which ffmpeg 2>&1', $output, $e); exec('echo "which ffmpeg" 2>&1', $output, $e); $output = exec('which ffmpeg'); but no luck. in console: [root@gs01]# ffmpeg /usr/local/bin/ffmpeg pass array second argument exec() method: $output = array(); exec('which ffmpeg', $output); var_dump($output); if output argument present, specified array filled every line of output command. trailing whitespace, such \n, not included in array. note if array contains elements, exec() append end of array. if not want function append elements, call unset() on array before passing exec(). for more information check manual . php > $a = array(); exec('which ffmpeg', $a); var_dump($a); returns: array(1) { [0] => string(15) "/usr/bin/ffmpeg" }

javascript - TinyMCE: Generate dynamic listbox options list -

i'm developping plugin tinymce , want have listbox on user can select option insert in editor. this option list not same, depends on actions made on website. values stored in array pass plugin. i process array format options list: object.keys(variablesarray).foreach(function (key) { parameterstext = parameterstext + "{text: '" + variablesarray[key] + "', value: '{{" + key + "}}'},"; }); the result good. want declare in listbox: editor.windowmanager.open({ title: 'insérer variable', body: [ { type: 'listbox', name: 'list_variables', label: 'sélectionnez une variable', 'values': [ {text: 'numéro de dossier', value: '{{id}}'}, {text: 'date de l\'accident', value: '{{da...

jquery - Triggering an animation on a div by clicking a button using addClass/removeClass with Javascript -

so i'm trying trigger animation clicking on button using addclass , removeclass javascript. i'm not bad @ html/css strating learn javascript editing snipets. so here's mine can tell me why div won't rotate when click black button ? thanks in advance ! <button class="menu-circle"></button> <img class='imgblock' src="http://lorempixel.com/400/200/" alt="" /> .menu-circle { height: 100px; width: 100px; background-color: #000000; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translatex(-50%) translatey(-50%); transition: .1s; z-index: 100; border: none; } .menu-circle:hover { height: 115px; width: 115px; } .menu-circle:active { height: 100px; width: 100px; } .imgblock { display: block; margin: 20px; -webkit-transition-duration: 1s; -moz-transition-duration: 1s; -o-transition-duration: 1s; transition-duration: 1s; } .rotate { -webkit-transform: rotate(45deg); -moz-transform: r...