Posts

Showing posts from April, 2011

Cannot use msn.marginal {sn} in R -

i have try many ways, still cannot use msn.marginal research. when try install package sn in latest r software (ri386 3.2.0), msn.marginal not in there msn.marginal error: object 'msn.marginal' not found i tried install package of sn version 0.4-18, still cannot use msn.marginal so, tried install sn package of version 0.4-14, got install.packages(" http://cran.r-project.org/src/contrib/archive/sn/sn_0.4-14.tar.gz ", repo=null, type="source") installing package ‘c:/users/owner/documents/r/win-library/3.2’ (as ‘lib’ unspecified) trying url ' http://cran.r-project.org/src/contrib/archive/sn/sn_0.4-14.tar.gz ' content type 'application/x-gzip' length 60084 bytes (58 kb) downloaded 58 kb installing source package 'sn' ... ** r ** data ** inst ** preparing package lazy loading ** help warning: c:/users/owner/appdata/local/temp/rtmpclmzuh/r...

javascript - $.ajax, complete function (no more data to get) -

im new .ajax , far good. i've run issue of, want run function once i've used data. for example have following, run on 'click': $.ajax({ url: "url.modal.tothegoods" + (nextpage), success: function (data) { //keeps appending data on click }, error: function () { alert('balls'); } }) i've tried ajaxcomplete function runs everytime load data onto screen. it runs everytime appened data .ajaxcomplete runs. guess questions is, how run function once have no more data consume. done any tips/tricks appreciated the response depends on behaviour of server part. if have hand on it, simple solution returns nothing when there no more data send. may simple this: $.ajax({ url: "url.modal.tothegoods" + (nextpage), success: function (data) { if (!!data) { //keeps appending data on click } }, ...

python 2.7 - After writing formulae into excel sheet with xlwt, reading cells with formulae by xlrd returns blank -

i have first created pivot table using pandas. saved worksheet. wrote data & formulae in worksheet using xlwt further processing. trying read value cell had written formula. book = xlrd.open_workbook(fname) sheet = book.sheet_by_name('pivot table') print 'spare',sheet.cell(11,10).value this code works fine , returns proper values when pointing cell without formula (that depends on other cells). cells formulae return nothing. i need way read cell value. excel sheet has lot of formulae written , cell trying read final cell. not want back-track process value (compute through script). i using ubuntu , have libreoffice. (fyi, in case there no direct way , need open excel , fetch data) this can't done. after writing excel xlwt package, need open excel , save it. opening excel file populate cells containing formulae calculated values. saving excel save these values cells along formulae. some things observed- the above true cells ...

ruby on rails - undefined method `location' for #<Event::ActiveRecord_Associations_CollectionProxy:0x007f834658ea50> -

i have 2 models: event , location. location has_many events , event belongs_to location. location has attribute called "city". in controller, have following code: @locations = location.all.includes(:events) @events = @locations.collect{|l| l.events} @events.each |event| puts "event #{event.inspect}" puts "event location #{event.location}" end i getting following error: undefined method `location' #<event::activerecord_associations_collectionproxy:0x007f834658ea50> i know events have location, should work. how work? this fail if of locations has no events associated it. can try ensure have no nil elements in array: @locations = location.all.includes(:events) @events = @locations.collect{|l| l.events}. flatten. reject{|e| e.nil?} @events.each |event| puts "event #{event.inspect}" puts "event location #{event.location}" end

javascript - Angular directives not showing in the source HTML -

i have filter turns hashtags links: app.filter('hashtags', function($filter) { return function(text, target) { if (!text) return text; var replacedtext = text.replace(/#(\w*[a-za-z_]+\w*)/gim, '<a ng-href="/posts?q=%23$1">#$1</a>'); return replacedtext; }; }); however, when displayed on page, hashtag clickable , surrounded in anchor tags, ng-href no found. looks this. <a>#hashtag</a> why angular directive not showing up? it may worth noting classes show up. if change line read: var replacedtext = text.replace(/#(\w*[a-za-z_]+\w*)/gim, '<a class="test" ng-href="/posts?q=%23$1">#$1</a>'); the output in html be: <a class="test">#hashtag</a> ng-href need pulled out of filter , put template in used. <div ng-repeat="tag in tags"> <a class="test" ng-href="{{tag | hashtag}}">{{tag}}</a...

c# - Best way to read single byte from array of bytes -

i have array of bytes , want read bytes 1 one , convert int. getting date in byte of array need create datatime object that. using following code. should best approach same performance perspective. byte[] date = {25, 10, 13, 04, 16, 26} //day month year hour minute second capturetime = new datetime( (int)(new arraysegment<byte>(date, 2, 1).toarray()[0]), // year (int)(new arraysegment<byte>(date, 1, 1).toarray()[0]), // month (int)(new arraysegment<byte>(date, 0, 1).toarray()[0]), // day (int)(new arraysegment<byte>(date, 3, 1).toarray()[0]), //hours (int)(new arraysegment<byte>(date, 4, 1).toarray()[0]), //minutes (int)(new arraysegment<byte>(date, 5, 1).toarray()[0])); //seconds above code working fine performance point of view fine or there more approach handle this? byte 8-bit unsigned ...

adal - Can You Grant Admin Access to an Azure Application through PowerShell -

is there way grant administrative consent application using powershell? imagine have done connect-msolservice , provided credentials of account tenant admin; there way provide tenant-wide consent based on application client id? to clarify, mean granting application ability access directory admin? if case, can this: # using windows azure active directory module windows powershell # # connect tenant modify connect-msolservice # => login # service principal add role $serviceprincipal = get-msolserviceprincipal -serviceprincipalname principal.name # role object id # alternatively, can list roles (in order different role name) using `get-msolrole` $roleid = (get-msolrole -rolename "directory readers").objectid # add role service principal add-msolrolemember -roleobjectid $roleid -rolememberobjectid $serviceprincipal.objectid -rolemembertype serviceprincipal # check our work get-msolrolemember -roleobjectid $roleid # => should include principal.name ...

polymer - How to access shadowRoot for css styling (Polymer1.0) -

in polymer0.5 like: domready: function(){ print(this.shadowroot); } which print out html in shadowroot. when same thing in polymer1.0: ready: function(){ print(this.shadowroot); } the output null . more specifically, used access elements css attributes doing: $(this.shadowroot).find('.some-class').css('height', amount + 'px'); but struggling find out how in polymer1.0, since shadowroot null. thanks jdepypere hint. turns out of style attributes in style property of node property. so adjust height: polymer.dom(this.$.scrollarea).node.style.height = '100px';

ios - Retrieving Custom Parse User Variables -

i creating app uses parse. have set user sign , login. have username , password options figured out, want third option. going string called "school" user["school"] = "your school here" and created. having trouble accessing current user in class. i need have string, can have pfquery similar query.wherekey("pfobject.school", equalto: currentuser["school"]) but not sure syntax choose. if other information needed, let me know. thanks. cast object string below: query.wherekey("school", equalto: currentuser!["school"] as! string)

getParcelableArrayList returns a Parcelable but i need it to return my object. (java android) -

i got error below: error:(133, 15) error: method setmonkeybuisness in class quotebank cannot applied given types; required: arraylist<quotequestion> found: arraylist<parcelable> reason: actual argument arraylist<parcelable> cannot converted arraylist<quotequestion> method invocation conversion both quotequestion , quotebank implement parcelable , methods. cannot type cast parcelable either. am using parcelable array list correctly? here part of code quotebank : public class quotebank implements parcelable{ public static final string array_list_key = "arraylistkey"; private arraylist<quotequestion> monkeybuisness; public quotebank(){ } @override public void writetoparcel(parcel dest, int flags) { bundle bundle = new bundle(); bundle.putparcelablearraylist(array_list_key, monkeybuisness); dest.writebundle(bundle); } public static final parcelable.creator<quoteba...

Google Apps Script (Javascript) - findText returns location relative to inline image, not start of paragraph -

i trying insert image in middle of paragraph results of findtext, when there other images before in paragraph doesn't work planned. currently, code(partially based on the responses question ) works finding place needs inserted, getting child index of paragraph findtext() returned. however, if there inline image, chid index returned start of paragraph, offset findtext characters end of image, not start of paragraph. here relevant part of script: function placeimage(start, end) { var d = documentapp.getactivedocument() var s = d.getbody(); var logoresult = s.findtext(start); var placeholderstart = logoresult.getstartoffset(); //position of image insertion var logoresult2 = s.findtext(end, logoresult); var placeholderend = logoresult2.getstartoffset(); //text between placeholderstart , placeholderend permanently deleted var textelement = logoresult.getelement(); var paragraph= textelement.getparent(); var childindex = paragraph.getparent().getchildindex(p...

Can't find aws.yml or paperclip.rb files to configure Amazon S3 to use with Paperclip? Rails 4 -

i trying connect amazon s3 services can't seem find files need configure in order make happen. installed these gems in gemfile : gem 'paperclip' gem 'aws-sdk' and ran bundle install , , restarted server. when run rails g paperclip pictures image , command works , create migration file it's supposed to, paperclip appear working correctly in sense. rake db:migrate creates columns expected well. according these 2 tutorials uploading files s3 in ruby paperclip , rubydoc.info , should have these 2 files available me: aws.yml paperclip.rb but no found. have searched entire directory , down , i've looked multiple times on google , , seems no 1 else having problem. am forgetting or there alternative way configure paperclip s3 in rails app? note: not using heroku, prefer learn way not implement heroku.

javascript - Snake Game with Controller Buttons for Mobile Use **UPDATED** -

** note: i've edited javascript below , linked new jsfiddle still not getting buttons control snake's movement arrow keys on keyboard ** i’m trying create real easy snake game project need have buttons game work on mobile. there except need have buttons control movement of snake on screen: html: <div class="game-container"> <div class="container"> <div class="splashscreen"> <h1> snake </h1> <h2> click start. </h2> <input class="startbutton" type="button" value="start" /> </div> <div class="finishscreen" style="display:none"> <h1> game on </h1> <p> score was: <span id="score"></span> </p> <input class="startbutton" type="button...

symfony - Override homepage controller in Sylius -

i using http://docs.sylius.org/en/latest/bundles/general/overriding_controllers.html reference when trying override homepage controller. i tried following in config.yml: sylius_web: driver: doctrine/orm classes: frontend: homepage: controller: spacedice\webbundle\controller\frontend\homepagecontroller and doesn't seem working. what put in config.yml specify controller homepage? in: vendor/sylius/src/sylius/bundle/webbundle/resources/config/routing/main.yml see: sylius_homepage: path: / defaults: { _controller: sylius.controller.frontend.homepage:mainaction } but i'm not sure how override/set sylius.controller.frontend.homepage. thanks i able figure out couple ways this. first, can set parameter in config.yml: parameters: sylius.controller.frontend.homepage.class: my\controller\here another option set homepage route of / in appbundle/resources/config/routing.yml homepage: path: ...

php - Automaticly make a profile when user registers (Laravel 5) -

i'm trying make profile page registered users. on page auth\user data displayed (name, email) profile information (city, country, phone number, ..). i've made 1 one relationship i'm having 1 issue. when user gets created, automaticly have profile created specific user. at moment added profile first user through tinker, made second user & went profile page, gave error (seeing profile had not been made yet). in profile.php have: <?php namespace app; use illuminate\database\eloquent\model; class profile extends model { protected $table = 'profiles'; protected $fillable = ['city', 'country', 'telephone']; public function user() { return $this->belongsto('app\user'); } } in user.php added: <?php namespace app; ... class user extends model implements authenticatablecontract, canresetpasswordcontract { use authenticatable, canresetpassword; ... protected $table = ...

jquery - PHP ActiveRecord: How do I add multiple conditions for a query? -

i'm trying search more 1 condition in php activerecord the code bellow searches globally items. have column named mailin_order_status , search based on value. i tried code below. works still searching globally , not "new" bags. in advance!! $app->get( '/bag/search', function () use ($app) { $query = $app->request()->get('query'); $data['datacount'] = sizeof(bag::find('all', array('conditions' => array('mailin_order_status = ?', 'new')), array('conditions' => "first_name '%$query%' or last_name '%$query%' or post_title '%$query%'"))); $data['searchconditions'] = "first_name '%$query%' or last_name '%$query%'"; $data['bags']=bag::find('all', array('conditions' => array('mailin_order_status = ?', 'new')), array('limit' => 10, 'conditions' =...

Fortran READ(*,*), WRITE(*,*) arguments -

this question has been covered in previous questions. however, previous discussions seem incomplete. fortran has several i/o statements. there read(*,*) , write(*,*) , etc. first asterisk (*) standard asterisk designating input or output keyboard to/from screen. question second asterisk: the second asterisk designates format of i/o elements, data type being used. if asterisk left unchanged, fortran complier uses default format (whatever may be, based on compiler). users must use number of format descriptors designate data type, precision, , forth. (1) these format descriptors universal fortran compilers , versions of fortran? (2) can find standard list of these format descriptors? example, f8.3 means number should printed using fixed point notation field width 8 , 3 decimal places. edit: reference edit descriptors can found here: http://fortranwiki.org/fortran/show/edit+descriptors first, clarification, 1st asterisk in read/write statement has different meaning...

python - Setting colorbar to show values outside of data range in matplotlib -

Image
i trying create figure in colorbar extend beyond data range (go higher max value of data). ultimate purpose need plot series of images (as time progresses) of model output, , each hour stored in separate file. colorbar figures same, can joined animation. here sample script: import matplotlib.pyplot plt import numpy np x = np.arange(0, 360, 1.5) y = np.arange(-90, 90, 1.5) lon, lat = np.meshgrid(x, y) noise = np.random.random(lon.shape) # values in range [0, 1) fig = plt.figure() ax = fig.add_subplot(111) plt.hold(true) plt.contourf(lon, lat, noise) plt.colorbar() this produces following figure: i've been trying set limits of colorbar values outside data range (for example, -1. 2.) using 2 methods i've found online: setting vmin=-1 , vmax=2 inside plotting line: fig = plt.figure() ax = fig.add_subplot(111) plt.hold(true) plt.contourf(lon, lat, noise, vmin=-1., vmax=2.) plt.colorbar() this seems change colors displayed, first color in colormap correspond -1 ...

assembly - Using gas, how can I get the offset to a particular label? -

i'm using pwnlib write small shellcode challenge. shellcode needs modify pass application filters. first wrote nasm, , did that: sub edx, edx mov dl, 0x82 add al, do_mov_rdi_rax sub dword [rax], edx mov dh, 0x82 add al, do_syscall - do_mov_rdi_rax sub dword [rax], edx shr edi, 31 do_mov_rdi_rax: ; mov rsi, rax ; (with 0x82 added first byte pass validation) db 0xca, 0x89, 0xc6 sub eax, eax do_syscall: ; syscall ; (with 0x82 added both bytes pass validation) db 0x91, 0x87 pwnlib uses gas , however, assembly code has conform syntax. besides obvious ( // instead of ; , .byte instead of db ), i'm stuck 1 last problem: while nasm happily converted labels integers (for add al, do_mov_rdi_rax , add al, do_syscall - do_mov_rdi_rax ), gas keeps telling me can't ...

android - How to solve 'sdk manager path not recognized as an internal or external command' error? -

Image
why sdk not opening , telling me sdk not recognized internal or external command , need update sdk? but keeps telling me sdk manager opening won't show up. to solve problem have check 2 things: your sdk location path your java environment variable no. 1 solution: window -> preferences -> android , under sdk location browse folder containing sdk , click apply. make sure in selected folder file named sdk manager. no 2. solution: just reset java path in environment variables .

bluetooth - Send intent withing a piece of Java code -

here's piece of code of bluetooth chat: public void run() { byte[] buffer; arraylist<integer> arr_byte = new arraylist<integer>(); // keep listening inputstream while connected while (true) { try { int data = mminstream.read(); if(data == 0x0a) { } else if(data == 0x0d) { buffer = new byte[arr_byte.size()]; for(int = 0 ; < arr_byte.size() ; i++) { buffer[i] = arr_byte.get(i).bytevalue(); } // send obtained bytes ui activity mhandler.obtainmessage(bluetoothstate.message_read , buffer.length, -1, buffer).sendtotarget(); arr_byte = new arraylist<integer>(); } else { arr_byte.add(data); } } catch (ioexception e) { ...

c# - ShowDialog not showing WPF -

current.shutdownmode = shutdownmode.onexplicitshutdown; var dialog = new login(); dialog.showdialog(); var mainwindow = new mainwindow(dialog.success, dbinteraction.getpid(dialog.txtloginuser.text)); mainwindow.showdialog(); this.mainwindow = mainwindow; if (mainwindow.showdialog() == true) { } strange thing window never gets shown if debug jumps on showdialog points , not show them @ all. login shown fine. as can see tried various recommend in other threads regarding topic this.mainwindow = mainwindow , setting shutdownmode explicit. full call: /// <summary> /// interaktionslogik für "app.xaml" /// </summary> public partial class app : application { private void applicationstart(object sender, startupeventargs e) { current.shutdownmode = shutdownmode.onexplicitshutdown; var dialog = new login(); dialog.showdialog(); var mainwindow = new mainwindow(dialog.success, dbinteraction.getpid(dialog.txtloginuse...

Count data per day in a specific month in Postgresql -

i have table create date called created_at , delete date called delete_at each record. if record deleted, field save date; it's logic delete. i need count active records in specific month. understand active record me, let's see example: for example we'll use hypothetical record: id | created_at | deleted_at 1 | 23-01-2014 | 05-06-2014 this record active every days between creation date , delete date. including last. if need count active record march, in case, record must counted in every days of month. i have query (really easy do) show actives records specific month, principal problem how count actives each day in month. select date_trunc('day', created_at) dia_creacion, date_trunc('day', deleted_at) dia_eliminacion mytable created_at < to_date('01-04-2014', 'dd-mm-yyyy') , (deleted_at null or deleted_at >= to_date('01-03-2014', 'dd-mm-yyyy')) here are: select to_date('01...

javascript - check changed value of a DOM element -

is possible see whether element has been changed in dom? in case, have table content editable , id access each table rows. want know content has been changed. <table id="mytable"> … <td id=“name:1" contenteditable=“true"></td> <td id=“phone:1” contenteditable="true"></td> <td id=“address:1” contenteditable=“true"></td> <td id=“name:2" contenteditable=“true"></td> <td id=“phone:2” contenteditable="true"></td> <td id=“address:2” contenteditable=“true"></td> … </table> <input type="hidden" id="inputmytable" name="inputmytable"> so far using dom method value of each cell , send server. on server side, each row in database check if value has been changed db upgrade db. is there better way of doing this? p.s. when submit form send table values server-side code script var data = []; $("#m...

c# - Unity Camera panning when zoomed in/out -

i have method pans camera forward/back , left/right. not sure why, causing camera move nice when zoomed in close terrain move slow when zoomed out? here how panning camera: void camerapan(){ if(input.getmousebutton(2)){ transform.rotation = transform.rotation; transform.translate(vector3.right * -input.getaxis("mouse x") * 20f, space.world); transform.translate(vector3.forward * -input.getaxis("mouse y") * 20f, space.world); } } here how zooming: void camerazoom(){ float scroll = input.getaxis("mouse scrollwheel"); if(scroll < 0){ transform.translate(0, 0, scroll * scrollspeed); }else if(scroll > 0){ transform.translate(0, 0, scroll * scrollspeed); } } what can pan camera @ same speed no matter if zoomed in or out? calculate zoom factor - number can represents zoom (for example, can distance camera object in center of view) use zoom factor multiply translate para...

C++: socket encoding (working with TeamSpeak) -

as i'm working on program teamspeak server, need retrieve names of online users i'm doing sockets - that's working fine far. in ui i'm displaying clients in listbox working. nevertheless i'm having problems wrong displayed characters , symbols in listbox. i'm using following code: //... auto getclientlist() -> void{ = 0; querystring.str(""); querystring.clear(); querystring << clientlist << " \n"; send(sock, querystring.str().c_str(), strlen(querystring.str().c_str()), null); teamspeak::getanswer(1); while(p_1 != -1){ p_1 = lastlog.find(l"client_nickname=", spos + 1); if(p_1 != -1){ spos = p_1; p_2 = lastlog.find(l" ", p_1); temporary = lastlog.substr(p_1 + 16, p_2 - (p_1 + 16)); users[i].assign(temporary.begin(), temporary.end()); sendmessage(hwnd_2, lb_addstring, (wparam)null, (lparam)(lptstr)(user...

Java: Bitwise operations on booleans that are returned from Methods -

this question has answer here: what “|=” mean? (pipe equal operator) 6 answers i'm looking @ following code snippet bresult |= purgedatafordig(protocol); the variable bresult of type boolean. am correct in assuming return of method purgedatafordig or'd bresult , result written bresult ? thanks paul. that correct, the above code snippet functionally same as: res = purgedatafordig(protocol); bresult = bresult | res;

java - Access Mac's live sound output data -

i'm trying create program accesses mac's live sound output data used display live graphic waveform of current sound/song (aka play song through youtube/itunes/etc , program shows waveform of song while playing). understand using java sound api , need use fft algorithm data frequency domain, can't find way access live sound output data? suggestions?

Excel VBA activate worksheet -

i need activate specific worksheet. code meant create worksheets specif name. need paste worksheet these newly created worksheets. code i'm using below. i'm having hard time activating newly created worksheet paste want. sub octo() 'dim ws worksheet dim ki range dim listsh range workbooks.open ("c:\users\dash\dropbox\randika\misc\emmash timesheets\timesheet.xlsx") worksheets("ppe 05-17-15") set listsh = .range("b4:b" & .cells(.rows.count, "b").end(xlup).row) end on error resume next each ki in listsh if len(trim(ki.value)) > 0 if len(worksheets(ki.value).name) = 0 worksheets.add(after:=worksheets(worksheets.count)).name = ki.value 'open template workbooks.open ("c:\users\dash\dropbox\randika\misc\emmash timesheets\octo_template.xls") range("a1:l31").select selection.copy worksheets(ki.value).activate ...

Apache Virtual Hosts direct IP Access -

i have various virtual hosts running. know people access these adding entry hosts file, possible access 1 specific virtual using ip + else? e.g. http:// <server_ip> / <host> / try along line of: <location /> <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} ! -s [or] rewritecond %{request_filename} ! -l [or] rewritecond %{request_filename} ! -d rewriterule ^([^/)+(.*)$ /srv/http/$1/public/$2 [nc,l] </ifmodule> </location> this placed in default virtualhost

ios - Can't schedule an UILocalNotification x days from now -

i've been trying way many hours without finding problem/solution. code supposed schedule notification x days comparing wd(the selected weekday) , item.itemdayname(int of current weekday). right code works when wd == 7, wd == 7 --> weekdays selected (wd 0-6 = sun-sat). appreciate feedback given, thank you. - (void)schedulenotificationwithitem:(todoitem *)item andweekday:(int)wd{ nscalendar *calendar = [nscalendar autoupdatingcurrentcalendar]; nsdatecomponents *datecomps = [[nsdatecomponents alloc] init]; if (wd < 7) { [datecomps setyear:item.itemyear]; [datecomps setmonth:item.itemmonth]; if (item.itemdayname != (wd + 1)) { int result = (wd + 1) - item.itemdayname; result = result + item.itemday; [datecomps setday:result]; } else{ [datecomps setday:item.itemday]; } } else { [datecomps setyear:item.itemyear]; [datecomps setmonth:item.itemmon...

qt - Using QSettings in a global static class -

my task create qsettings wrapper class (wrapping needed qml) can reach everywhere model, too. the obvious choice static global instance of class. problem approach it's destroyed after main , after qapplication destroyed, giving me following warning: qapplication::qappname: please instantiate qapplication object first here simplified, sample code showing simple wrapper, , destruction phases: #include <qcoreapplication> #include <qdebug> #include <qglobalstatic> #include <qsettings> #include <qtimer> class settings: public qobject { public: ~settings() { qdebug() << "~settings"; } qsettings settings; }; q_global_static(settings, globalsettings) int main(int argc, char *argv[]) { qcoreapplication app(argc, argv); qobject::connect(&app, &qcoreapplication::abouttoquit, [](){qdebug() << "~qcoreapplication abouttoquit";}); qobject::connect(&app, &qcoreapplication::abouttoqui...

IOS Swift Call Web Service using SOAP -

i have looked through answers how call web service via soap form swift on internet , found answers. have tried implement code have found in answers continually http 400 status code. trying figure our doing wrong. i have distilled problem down few lines of code in view controller seen below code called when button on ui pressed. web service trying call can found @ http://www.cgsapi.com/cgswebservice.asmx . (to view wsdl file append ?wsdl end of url.) import uikit class viewcontroller: uiviewcontroller { var is_soapmessage: string = "<soapenv:envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cgs=\"http://www.cgsapi.com/\"><soapenv:header/><soapenv:body><cgs:getsystemstatus/></soapenv:body></soapenv:envelope>" override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didrecei...

php - Laravel 4.2 big file upload -

i'm using laravel 4.2 , have problems uploading big files. if upload small files working good. i changed php.ini , stop/start wamp server. post_max_size = 128m upload_max_filesize = 64m on html file: <form role="form" method="post" action="{{ url::route('post-admin-cat-princ') }}" enctype="multipart/form-data"> <div class="form-group"> <label for="picture1">catalogue</label> <input id="picture1" name="picture1" type="file" multiple class="form-control" /> @if($errors->has('picture1')) {{ $errors->first('picture1') }} @endif </div> <input class="btn btn-success" type="submit" value="add catalogue" /> </form> on routes: route::post('/catalogprinc', array('us...

Javascript onclick display multiple SVGs -

i trying display multiple svg paths after clicking on svg polygon. able , individual path appear onclick using document.getelementbyid(id).style.display = "block"; getelementbyid() on works 1 path though. how can onlclick work multiple paths? i tried using loop getelementsbyname(id) plunker here: http://plnkr.co/edit/5u16eptq1ymsleuvlya5?p=preview thanks help! all id attributes in document must unique , can't use name attributes in svg leaves classes. replacing id attributes class <path class ="test-arrow" d="m 1020 290 c1020,40 825,40 765,100" style="display: none; stroke: black; stroke-width: 5px; fill: none; marker-end: url(#markerarrow);"/> <path class ="test-arrow" d="m 960 385 c920,450 775,550 775,370" style="display: none; stroke: black; stroke-width: 5px; fill: none; marker-end: url(#markerarrow);"/> and using getelementsbyclassname name fixes things. here's u...

c - Merging two Makefiles to build one output -

i have simple os has own makefile build floppy output , picoc (a tiny c compiler) has own makefile built own executable output file. now want move "picoc" os means should move files os , build app inside os files , make os , 1 output floppy has picoc included. have no idea how merge these 2 makefiles together? (i'm not @ make files @ all). now question is: there anyway can merge these 2 apps merging makefiles? i've read related topics problem none of them case. it along lines: floppy: picoc command make floppy picoc: make -c directory/of/picoc .phony : picoc this more guidelines full solution, because i'm not sure if understood project structure.

r - Exclude a Specific Value from a Unique Value Counter -

i trying count how many different responses person gives during trial of experiment, there catch. there supposed 6 possible responses (1,2,3,4,5,6) 0 recorded response (it's glitch / flaw in design). i need count number of different responses give, counting unique values within range 1-6. helps calculate accuracy. is there way exclude value 0 contributing unique value counter? other work-arounds? currently trying method below, includes 0, na, , think other entry in cell in unique value counter column (i have named "span6"), makes me sad. # span6 calculator: asiximagetrials <- data.frame(esopt_831$t8.resp, esopt_831$t9.resp, esopt_831$t10.resp, esopt_831$t11.resp, esopt_831$t12.resp, esopt_831$t13.resp) asiximagetrials$span6 = apply(asiximagetrials, 1, function(x) length(unique(x))) use na.omit inside unique , sum logic vector below df$res = apply(df, 1, function(x) sum(unique(na.omit(x)) > 0)) df output: x1 x2 x3 x4 x5 res 1 2 1 ...

Nslookup or dig in Google App Script -

Image
is there way run nslookup / dig in google app script? m looking results of command in google spreadsheet. thanks find web service let use or post anonymously query dns info using restful api, , you'll able use urlfetchapp.fetch() access it. for example, statdns has simple api . here's custom function resolve domain name ipv4 address. code /** * peform network service lookup, using statdns api. * * @param {"google.com"} dn well-formed domain name resolve. * @return {string} resolved ip address * @customfunction */ function nslookup(dn) { var url = "http://api.statdns.com/%fqdn%/a".replace("%fqdn%",dn); var result = urlfetchapp.fetch(url,{mutehttpexceptions:true}); var rc = result.getresponsecode(); var response = json.parse(result.getcontenttext()); if (rc !== 200) { throw new error( response.message ); } var ip = response.answer[0].rdata; return ip; }

c++ - Can I have a COM interface in a service to be called from Windows Script Host? -

my goal create com interface in windows local service, written c++/mfc, methods called windows script host jscript code running under logged in interactive user account. for instance, if have test.js can started credentials of logged in user, following: var obj = new activexobject("myservice.somename"); var result = obj.mymethod("some data"); and have mymethod function processed in service & return value. i know it's general concept. @ stage i'm curious if such possible (from windows security stand-point, i.e. calling system service user process) , if so, if there's sample code can use basis this? i'm assuming must com interface, right? go dll. i've never tried put them in service. thank you! i'm posting own future reference, in despite of treatment got in comments original post. would've saved me day of search if pointed me article... this codeguru article, " com in plain c, part 2 " explains h...

Java classes in JMeter with Beanshell sampler -

i have java project need run load test in jmeter. found examples indicated make jar file , put in jmeter lib/ext folder , run it. works simple example program wrote. tried scale up, made jar of larger project, placed in lib/ext folder, did following in beanshell sampler following example program. import package.jhelper; jhelper x = new jhelper(); x.test(); i have tried import class using full path of import cast.sa.vsp.package.jhelper; import cast.sa.vsp.package.*; both return me following response code response message: org.apache.jorphan.util.jmeterexception: error invoking bsh method: eval sourced file: inline evaluation of: ``import cast.sa.vsp.package.jhelper; jhelper x = new jhelper(); . . . '' : typed variable declaration : class: jhelper not found in namespace the answer have seen work if moved /lib/ext /lib. have done well, jmeter being unable run until remove jar directory. does have advice on how working? your jars should go /lib folde...

javascript - Node passport-local strategy always fails -

i'm using node.js passport module build authentication process, , i'm unable figure out why verification fails, when return success every time verification callback. keep example simple, i'm using passport-local strategy no persistent storage: var passport = require('passport'); var localstrategy = require('passport-local').strategy; var express = require('express'); var server = express(); passport.serializeuser(function (user, done) { done(null, user); }); passport.deserializeuser(function (id, done) { done(null, id); }); passport.use(new localstrategy( function (username, password, done) { // perform lookup , verification here. // instead return valid user object every time. var user = { username: username }; return done(null, user); } )); server.post('/login', passport.authenticate('local', { failureredirect: '/failure' }), function (req, res) { res.send('access granted'); }); ...

ruby on rails - Multiple Views Same Model -

i have course model goes controller , views in restful way. for course show, featured. want course show have simplify page , original course show. how can implement this? want restful, in controller there should show, update, index, etc. should create controller have different name model? e.g. course2? if admin view vs. public view, have entirely different namespaces 2 different restful controllers. or if think you're going have summary vs. full view thing lot, create namespaces based on distinction. another option encoded differences in single erb template. or have show action render different templates same action using conditional logic. without more context though, can't what's best option. against creating non-restful actions unless it's going one-off thing. non-restful actions tend out of hand in experience , controllers can ugly , unintuitive.

ruby on rails - How to Edit Polymorphic Comments? -

since comments being posted in multiple locations: habits, goals, etc. path use edit comment in comments/_comments? i tried: <%= link_to edit_comment_path(comment) %> #or should use conditionals target: edit_habit_comment_path, edit_goal_comment_path, etc? <%= comment.content %> <% end %> but upon clicking on error: activerecord::recordnotfound (couldn't find comment 'id'=2 [where "comments"."commentable_id" = ? , "comments"."commentable_type" = ?]) i played around put in def edit here: comments_controller class commentscontroller < applicationcontroller before_action :load_commentable before_action :set_comment, only: [:show, :edit, :update, :destroy, :like] before_action :logged_in_user, only: [:create, :destroy] def index @comments = @commentable.comments end def new @comment = @commentable.comments.new end def create @comment = @co...