Posts

Showing posts from May, 2010

objective c - Burn image on image - Xcode -

i know it's possible put text on image, work image. can me or have site, more informations? thanks. you can composite images using blendmode . there several ways go this. here 2 started topic. the quartz 2d programming guide help coregraphics approach. the core image programming guide covers using cifilters blend images.

php - remove an Image programmatically in ezpublish -

i have object in ezpublish has image attribute. attribute has image value want remove programmatically in php. ( image value , not attribute ) any idea how ? for versions of ez publish (legacy) prior oct 15, 2013, or git tag, 'v2014.03.1' including ez publish 4.7 'deletestoredobjectattribute' method - requires - non-null second argument value passed in versions of ez publish legacy before following commit: see: https://github.com/ezsystems/ezpublish-legacy/commit/61aaa002c00ccfb86b3e02856b319f54b3405ef8 this includes ez publish 4.7 , question author's specific use case. why answer more accurate others. without second non-null parameter, aliases image files deleted filesystem ... image aliases information (alias references, meta data, etc) still exist content object attribute content (database storage xml). without second non-parameter image appear still partially existing in content object image preview, (ie: usage of image path, meta data sys...

Regex for leading zeros and exclude normal zeros -

i looking 2 traverse list of alphanumerics this: 0012-0103 i want remove leading zeros keep ones belong given number value. i have gets zeros: /0*([1-9][0-9])?0/ any suggestions. still review regex documentation. you can use following: \b0+ see demo explanation: \b word boundary.. check boundaries separated word , non word (digits part of word) 0+ match more 1 zeros therefore, match zeros not in middle..

Cannot install converseJS properly in Laravel 5 -

i working on application trying chat feature working using conversejs xmpp client on front end , openfire rtc on end. i working laravel 5 on end, , being naive developer am, placed files in public folder , linked js , css file webpage. <link rel="stylesheet" type="text/css" media="screen" href="/converse/css/converse.min.css"> <script src="/converse/builds/converse.min.js"></script> it working in firefox , can see chat pluigin in chrome. error see in console is: uncaught error: see almond readme: incorrect module build, no module name i not sure causing this. placing files in public folder , linking pages, right way? or have in laravel 5 running? you receive error because conversejs uses almond amd loader , cannot handle modules without name. for example trow error mentioned: $(function(){ ... }); so should use instead: jquery(function($){ ... }); more info here try put c...

Android app stops working after moving to using creating the layout with java -

i making app predicts winner of soccer game. new android programming , recyclerview tutorials little confusing, need put information each user prediction cardview, transfered xml code java, when got activity, says shutting down vm right away, , not log messages put in. users data predictions in sqlite database, read information. below java , xml files, not have use xml file, if possible. history activity java file: package com.winansbros.soccerpredictor; import android.app.activity; import android.content.context; import android.content.intent; import android.content.res.typedarray; import android.database.cursor; import android.os.bundle; import android.support.v7.widget.cardview; import android.text.method.scrollingmovementmethod; import android.util.log; import android.view.view; import android.view.viewgroup; import android.widget.button; import android.widget.imageview; import android.widget.relativelayout; import android.widget.textview; import java.util.arraylist; imp...

c++ - efficient way to query similar sentences -

i have task need find similar sentences memory. task read input file containing: a b c c d e f f h g w ............. and then, given new query, ex h g w the return should be f h g w which line in input file containing query words. i know how efficiently store input sentence can used query efficiently. you can store dictionary of words vector of strings: vector<string> dict; so in example, put "a" , "b" , "c" , on inside dictionary. then can represent sentence vector of integers, integer index of word in dictionary: vector<int> sentence; for example first sentence {0, 1, 2} . you can store sentences in vector: vector<vector<int>> sentences; at point, checking if subphrase inside phrase same substring search algorithm (provided convert phrase query vector of integers).

html - CSS: Eliminate gaps between stacked responsive divs? -

learning way through this... i'm working toward setting rows of divs - don't want space between them , not sure properties adjust width changes. i'm getting either 1px gap appearing/disappearing images scale, or getting 1 of divs bumped down next line. the odd thing both rows same, i'm lost here. here's current page: http://www.turnerdesign.com/brackets/ thanks andrew to lose gaps: remove height: auto; , set height. @media screen , (max-width: 959px) #column700 { width: 73%; height: 50px; float: left; } /* same other column */ } for gaps: (i wrote first, re-read question , like, omg did whole answer question didn't understand @ first, incase needs gaps, here's how) html: <div class="column700"> <div id="firstproject"> </div> </div> css: #firstproject { width: 100%; padding: 10px; background: blue; } ...

python - Efficient & Pythonic way of finding all possible sublists of a list in given range and the minimum product after multipying all elements in them? -

i've achived these 2 things. find possible sublists of list in given range (i ,j) . a = [ 44, 55, 66, 77, 88, 99, 11, 22, 33 ] let, = 2 , j = 4 then, possible sublists of list "a" in given range (2,4) : [66], [66,77], [66,77,88], [77], [77,88], [88] and, minimum of resultant product after multipying elements of sublists: so, resultant list after multiplying elements in above sublists become x = [66, 5082, 447216, 77, 6776, 88]` now, minimum of above list, min(x) i.e 66 my code : i, j = 2, 4 = [ 44, 55, 66, 77, 88, 99, 11, 22, 33 ] o, p = i, mini = a[o] while o <= j , p <= j: if o == p: mini = min(mini, reduce(lambda x, y: x * y, [a[o]])) else: mini = min(mini, reduce(lambda x, y: x * y, a[o:p + 1])) p += 1 if p > j: o += 1 p = o print(mini) my question: this code taking more time executed larger lists , larger ranges ! there possible "pythonic" way of reducing time c...

r - Tips for reducing the size of an ID field -

i have dataset 30m rows. of columns include id fields large integers. e.g. library(data.table) dt <- data.table(someid = c(8762438732197823423, 1236487432893428732, 290234987238237842)) i suspect reducing size of these ids speed joins , other process on data. what's method doing this? example, map unique id's {1, 2, 3...} or {a, b, c, ...}. not sure datatype (integer or character?) best storing these id fields. the maximum size of integer in r 2^31 - 1 2147483647. integers larger can stored in doubles, @roland points out above, there limit of precision significand of 53 bits, maximum integer can stored accurately 2^53 . try 2^53 - (2^53 - 1) , you'll 1. try (2^53 + 1) - 2^53 , you'll 0. for original question, there's not in if you're talking using data.table joins: library("data.table") library("microbenchmark") f <- d <- <- data.table(x = runif(100...

upload file by ajax, javascript,php -

please want upload file ajax , javascript,php without refresh page : idea send file ajax xmlhttp.send(file); , file in script php, don't know how uing function record function record(elem){ } <td style='font-size:11px;'><span id='confirm1 $id'>confirm : <input id='confirm1' onchange='record(this.id);' style='font-size:9px; height:27px; width:134px;' type='file' name='confirm1' /></td> you're looking formdata api: https://developer.mozilla.org/en-us/docs/web/api/xmlhttprequest/using_xmlhttprequest#submitting_forms_and_uploading_files an easier method may use iframe.

hadoop - start-dfs.sh: command not found -

i have installed hadoop 2.7.0. on ubuntu 14.04. code start-dfs.sh not working. when run code returns start-dfs.sh: command not found . start-dfs.sh , start-all.sh , stop-dfs.sh , stop-all.sh in sbin directory. have installed , set paths of java , hadoop correctly. codes hadoop version , ssh localhost working. might problem? does file start-dfs.sh exists in directory ${hadoop_home}/bin ? if not, please try run commond sbin/start-dfs.sh .

Java Constructor Injection -

let's have class resources instantiates of opengl / java game objects , pass these via constructor scene class (which requires them), (simplified example)..... public class resources { hero hero; enemy enemy; menubuttons mainmenubuttons; background background; scene mainmenu; public void createobjects(){ hero = new hero(); enemy = new enemy(); mainmenubuttons = new menubuttons(); background = new background(); mainmenu = new scene(hero, enemy, mainmenubuttons, background); } } obviously scene's constructor need take 4 arguments so: public class mainmenu implements scene { hero hero; enemy enemy; mainmenubuttons menubuttons; background background; public mainmenu(hero hero, enemy enemy, mainmenubuttons mainmenubuttons, background background){ this.hero = hero; this.enemy = enemy; this.mainmenubuttons = mainmenubuttons; this.background = backgro...

Programatically get latest stable R release version number -

how can use r recent release of r? know gtools::checkrversion hoping base solution, better 1 doesn't rely on scraping/regex. the desired result of today (2015-06-13) be: 3.2.0 using metrcan api (@roland comment): library(rjsonio) fromjson("http://rversions.r-pkg.org/r-release")[[1]][['version']] [1] "3.2.0"

c++ - Why doesn't a left fold expression invert the output of a right fold expression? -

i'm taking @ c++17 fold expressions , i'm wondering why following program outputs 4 5 6 4 5 6 for both of for_each calls template<typename f, typename... t> void for_each1(f fun, t&&... args) { (fun (std::forward<t>(args)), ...); } template<typename f, typename... t> void for_each2(f fun, t&&... args) { (..., fun (std::forward<t>(args))); } int main() { for_each1([](auto i) { std::cout << << std::endl; }, 4, 5, 6); std::cout << "-" << std::endl; for_each2([](auto i) { std::cout << << std::endl; }, 4, 5, 6); } live example i thought second fold expression meant output numbers in reverse order 6 5 4 how come results same? according § 14.5.3/9 the instantiation of fold-expression produces: (9.1) — ((e1 op e2) op · · · ) op en unary left fold, (9.2) — e1 op (· · · op (en-1 op en )) unary right fold, (9.3) — (((e op e1...

jquery - how we make image file dynamic in javascript -

var file = $("#imgstep"+id)[0].files[0]; var filename = file.name; var filesize = file.size; i have problem multile files name in 1 function. first time file name other time error on var file = $("#imgstep"+id)[0].files[0]; and show cannot read property 'files' of undefined.

format and informat in sas -

i have following data: data d; input date1 $ date2 $; cards; 5oct10 11nov11 6jul12 12oct13 1jan08 4may10 4may04 8jul06 1mar07 5aug07 18may04 1oug09 7aug05 8jul09 1feb03 5apr06 3feb01 15jul08 4apr07 16apr07 run; *i need read in date7.informat , present data on date9.format. *how do read data begin on width format, , how convert date's width 7 9 while cars not numeric? when trying that: proc print data=d; format date1 date2 date9.;; run; it fails since use numeric format on none-completely numeric var if use informat statement tell sas how read variables not not need list format in input statement. informat , format variable not need same, in case can because date9 informat recognize value 2 digit year. informat date1 date2 date9.; format date1 date2 date9.; input date1 date2 ;

VirtualBox machine - Set to access LAN only -

i've got virtualbox machine set , runs fine. want limit it's network access computers on lan (192.168.2.x). not want have type of incoming or outgoing access internet @ all. just remove default gateway in it's ip settings. or modify operating systems hosts file. if serious blocking though should block via firewall.

c# - Dealing with TargetWithLayout in XUNIT -

i have class, public class createloggingrulefactory : iloggingrulefactory { public loggingrule createdefaultloggingrule(string rulename , loglevel minimumlevel, loglevel maximumlevelname,targetwithlayout targetwithoutstacktrace) { // blah blah var defaultloggerrule = new loggingrule(rulename, minimumlevel targetwithoutstacktrace); return defaultloggerrule; } targetwithlayout nlog api. i want make integration test it. have uncompleted code public class createloggingrulefactorintegrationtests { [theory] [inlinedata(new object[] {"consoleloggerfactory.myconsolelogger", loglevel.trace,loglevel.debug,classdata(typeof(targetwithlayout)})] public void createloggingrulefactory_createdefaultlogger_should_create_loggingrule_class() { // arrange var createloggingrulefactory = new createloggingrulefactory(); var defaultloggerrule = createloggingrulefactory.createdefaultloggingrule ...

node.js - One to Many relationship in Express Models using mongoDB -

this doctors.js model: var mongoose = require('mongoose'), schema = mongoose.schema; var patient = require('./patient.js'); var doctorschema = mongoose.schema({ firstname: string, lastname: string, qualifications: string, photo: buffer, _patients: [{ type: schema.types.objectid, ref: 'patient' }] }); var doctor = mongoose.model('doctor', doctorschema); module.exports = doctor; this patients.js model: var mongoose = require('mongoose'); var doctor = require('./doctor.js'); var patientschema = mongoose.schema({ firstname: string, lastname: string, dob: string, gender: string, primarydiagnosis: string, duration: string, _doctorincharge: {type: number, ref: 'doctor'}, hospitalnumber: string, photo: buffer }); var patient = mongoose.model('patient', patientschema); module.exports = patient; is way make 1 many relationship work?

split - In R: get multiple rows by splitting a column using tidyr and reshape2 -

this question has answer here: split comma-separated column separate rows 4 answers what simpel way using tidyr or reshape2 turn data: data <- data.frame( a=c(1,2,3), b=c("b,g","g","b,g,q")) into (e.g. make row each comma separated value in variable b ): b 1 1 b 2 1 g 3 2 g 4 3 b 5 3 g 6 3 q try library(splitstackshape) csplit(data, 'b', ',', 'long') or using base r lst <- setnames(strsplit(as.character(data$b), ','), data$a) stack(lst) or library(tidyr) unnest(lst,a)

c# - entity saveChanges not updating database -

i following tutorial using entity framework in c# , having number of issues. my first issue not access .load() or addobject() methods through entity. after searching found far has seemed help: .net framework 4.5 addobject() not appear after continuing on tutorial having issue when trying save new record database. using (northwndentities ctx = new northwndentities()) { var customers = c in ctx.customers.include("orders") c.city == "london" select c; //adds customer customer newcustomer = new customer { customerid = "joen", city = "london", contactname = "joe n", companyname = "acme" }; ctx.customers.addobject(newcustomer); ctx.savechanges(); foreach (customer customer in customers) { //customer.orders.load(); console.writelin...

c - Why do I get a still reachable block after mallocing a char*? -

i have following code: #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> #include <sys/stat.h> void print_usage() { printf("%s\n", "usage"); } int file_exist (char *filename) { struct stat buffer; return (stat (filename, &buffer) == 0); } int parse_parameters(int argc, char *argv[], char** in) { unsigned int i1 = 1; // 0 filename (; i1 < argc; ++i1) { if( 0 == strcmp("-h", argv[i1]) ) { print_usage(); return 0; } else if( 0 == strcmp("-i", argv[i1]) ) { *in = malloc( sizeof(char) * strlen(argv[++i1]) + 1 ); strcpy(*in, argv[i1]); continue; } else { print_usage(); return 1; } } return 0; } int main(int argc, char *argv[]) { if( argc != 3 ) { print_usage(); return 0; } char* in = null; int parse = parse_parameters(argc, argv, &in); if ( 0 != parse ) ...

signal processing - How can I find process noise and measurement noise in a Kalman filter if I have a set of RSSI readings? -

im have rssi readings no idea how find measurement , process noise. way find values? not @ all. rssi stands "received signal strength indicator" , says absolutely nothing signal-to-noise ratio related kalman filter. rssi not "well-defined" things; can mean million things: defining "strength" of signal tricky thing. imagine you're sitting in car fm radio. rssi bars on radio's display mean? maybe: the amount of energy passing through antenna port (including noise, because @ point no 1 knows noise , signal are)? the amount of energy passing through selected bandpass whole ultra shortwave band (78-108 mhz, depending on region) (incl. noise)? energy coming out of preamplifier (incl. noise , noise generated amplifier)? energy passing through if filter, selects individual station (is signal strength want define it?)? rms of voltage observed adc (the adc samples higher channel bandwidth) (is signal strength want define it?)? rms of d...

Google Places API (Android) Autocomplete just like on Google Maps -

i working on app in there autocompletetextview returns suggestions when user types in. working fine have noted there difference in suggestions comparing maps.google.com. example when search "bakery near" in google maps returns suggestions, when search same text on test app (which uses google places api autocomplete) returns nothing. please tell me how can achieve suggestions maps.google.com. note: don't want show google maps in app. google maps example: http://i.imgur.com/biwzxod.jpg , google places api autocomplete example: http://i.imgur.com/t4lqe7x.png your highly appreciated. for query like, "bakery near ...", believe want use query autocomplete web service. though notice differences between results on google maps , web service. suspect google maps has custom logic moulds input/results bit more intuitive.

liferay - How to land users to different page as per their roles -

i using liferay , want show different landing pages after users log in: if admin of portal try login-in, land page , if guest login portal login page b. @today15 have done this.. package com.landing.page.pagetwo; import java.util.arraylist; import java.util.list; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import javax.servlet.http.httpsession; import com.liferay.portal.kernel.log.logfactoryutil; import com.liferay.portal.kernel.events.action; import com.liferay.portal.kernel.events.actionexception; import com.liferay.portal.kernel.exception.portalexception; import com.liferay.portal.kernel.exception.systemexception; import com.liferay.portal.kernel.log.log; import com.liferay.portal.kernel.struts.lastpath; import com.liferay.portal.kernel.util.prefspropsutil; import com.liferay.portal.kernel.util.propskeys; import com.liferay.portal.kernel.util.stringpool; import com.liferay.portal.kernel.util.validator; import com.liferay.p...

ios - Setting the major and minor value of iBeacon -

i want set major , minor value correctly enter in region.for example,i have different queues different kinds of customer. premium , silver categories. if customer goes in lane of premium, should broadcast major value value of lane standing i.e. premium , number minor. how set these values correctly according current position of customer? premium = 1; silver = 2; self.mybeaconregion = [[clbeaconregion alloc] initwithproximityuuid:uuid major:premium minor:2 identifier:@"com.example.beacon"]; the major , minor values set on beacon - these values received app indicate region device located. so, in case have have 2 beacons, 1 configured 'premium' value , 1 'silver' values same uuid. in app can define region uuid , examine major/minor in didenterregion determine specific beacon detected. however, unless queues fair distance apart may have difficulty locating user accurately

datepicker - Datetimepicker slowness in jquery: set date and time format -

i have drop down list , when changing value displaying date , other fields. executing 1s in 8gb , other pc 2g or 4g takes 4s execute code. my code : obj ="2015-06-13 11:47:27" var str = $.trim(obj).substr (0,$.trim(obj).lastindexof (" ") + 1); var date = str.split("-"); var str1 = $.trim(obj).substr ($.trim(obj).lastindexof (" ") + 1,$.trim(obj).length); var time = str1.split(":"); $("#date").datetimepicker ({ dateformat: 'yy-mm-dd h:i' }).datetimepicker("setdate",new date(date[0],date[1]-1,date[2],time[0],time[1] )); i try refine code below code faster need value in date , time $("#date").val($.datepicker.formatdate('yy-mm-dd ', $mydate)); im expecting like $("#date").val($.datepicker.formatdate('yy-mm-dd hh:mm', $mydate)); please me improve code. i'll in here, it's easier set example. code below is, parses date simplified...

amazon web services - SES in AWS, don't send my email -

i have account in ses, in aws, can send email localhost, have limits increase, web, ses doesn't send emails. do need configuration else, web? i solved it. problem have several freemarker, , depends of locale send kind of freemarker, file ftl english wrong, , locale of aws en_us, , did not know.

scala - Exceeded configured max-open-requests -

recently started build small web processing service using akka streams. it's quite simple, i'm pulling urls redis, i'm downloading urls(they images) later i'm processing images, , pushing them s3 , json redis. i'm downloading lot of different kinds of images multiple sites, i'm getting whole bunch of errors 404, unexpected disconnect , response content-length 17951202 exceeds configured limit of 8388608, entitystreamexception: entity stream truncation , redirects. redirects i'm invoking requestwithredirects address founded in location header of response. part responsible downloading pretty this: override lazy val http: httpext = http() def requestwithredirects(request: httprequest, retries: int = 10)(implicit akkasystem: actorsystem, materializer: flowmaterializer): future[httpresponse] = { timeoutfuture(timeout, msg = "download timed out!") { http.singlerequest(request) }.flatmap { response => handleresponse(req...

kibana - Search for parse errors in logstash/grok -

i´m using elk stack analyze log data , have handle large volumes of log data. looks logs can parsed logstash/grok. is there way search kibana loglines couldn´t parsed? if grok{} fails match 1 of patterns you've provided, set tag called "_grokparsefailure". can search this: tags:_grokparsefailure if have multiple grok{} filters, it's recommended use tag_on_failure parameter set different tag each grok, can more identify stanza causing problem.

Button click in ASP.NET invoke Windows Form method C# -

i working on finger , face identify machines use zkemkeeper.dll class library. works on desktop application. have synchronized faces between devices on desktop. need invoke method in asp.net button click. kindly suggest me have in scenario? public zkemkeeper.czkem zkemkeeper = new zkemkeeper.czkem();//initializing dll private bool bisconnected = false;//the boolean value identifies whether device connected //initializing bisconnected connect device bool bisconnected = zkemkeeper.connect_net(txtip.text, convert.toint32(txtport.text)); private void btndownloadface_click(object sender, eventargs e) { string suserid = ""; string sname = ""; string spassword = ""; int iprivilege = 0; bool benabled = false; int ifaceindex = 50;//the possible parameter value string stmpdata = ""; int ilength = 0; zkemkeeper.enabledevice(imachinenumber, false); zkemkeeper.readalluserid(imachinenumber);//read ...

html - How can I show icon with transparent background and white border? -

Image
i have psd has icon but tried here here css .box_bg_org i{ background-color: #e98b39; /*background: transparent;*/ font-size: 30px; color: #fff; padding: 30px; } .box_bg_org i.fa-phone{ color: transparent; -moz-text-shadow: 2px 2px 0px #fff; text-shadow: 2px 2px 0px #fff; } please me first make sure have transparent background image. next save image "png" file extension , can on photoshop going file menu , selct "save as" options , make sure select png file extension while saving. the rest easy have include png image in our html , change container div background using css. good luck.

node.js - Npm package upgrade notification availlable? -

i wrote node package contains breaking changes in next release. there exist way notify developers via console while upgrading via npm? i don't think there solution inform via console, if new version given new "major" number, should not break code. breaking example client dependency: ~1.2.2 your old version: 1.2.2 your new version: 1. 2 .3 the client upgrade version 1.2.3. not breaking example user dependency: ~1.2.2 your old version: 1.2.2 your new version: 1. 3 .0 the client not upgrade.

java - Shorter code so fill arrays with same Value -

for "memory" game, i'm using gridview display 12 cards. @ beginning, cards same. in examples found, see similar code add picture ids imageadapter: private integer[] mthumbids = { r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back, r.drawable.card_back }; is there shorter,cleaner, nicer way? this: private integer[] mthumbids = new integer[11]; arrays.fill(mthumbids, r.drawable.card_back); full class: import android.content.context; import android.view.view; import android.view.viewgroup; import android.widget.baseadapter; import android.widget.gridview; import android.widget.imageview; import java.util.arrays; public class imageadapter extends baseadapter { private context mcontext; public imageadapter(...

Replacing characters within a text with regex in c# -

i trying replace few characters text. these characters maybe start or end or may in middle. problem hasn't white space @ starting or ending. example want replace "text" text with, instance, "abc". input: thisisatextbox output: thisisaabcbox i tried code far. regex.replace(textbox.text, @"\w[text]", "abc"); any appreciated. thanks! use following.. [ ] has special meaning (character class) in regex: regex.replace(textbox.text, @"text", "abc");

ios - how to define constraint for equal width & height with aspect ratio? -

i want add square in app height & width. height & width should vary screen size. same time should in center of screen. please tell me constraint should use? i have sued equal height(0.7 multiplier), equal width(0.5) multiplier & aspect ratio & have aligned view in center. error conflicting constraints. please suggest how it?

javascript - Get index of a table cell relative to the row -

i have checkbox inside table's cells. i'm binding click event on each of them. on click, want index of current cell relative parent row. for example: <tr> <td>...</td> <td><input type='checkbox'>....</td> </tr> i want 1 click event of checkbox . this javascript code i'm using: grid.tbody.find("input[type='checkbox']").each(function () { $(this).click(function () { var ischecked = $(this).prop('checked'); var dataitem = tablesgrid.dataitem($(this).closest('tr')); var = $(this).index(); alert(i); }); }); in javascript code, want have current cell's index, i variable doesn't work. $(this) in $(this).index() refers checkbox , not cell td . to cell index use, $(this).closest('td').index(); //or $(this).parent().index() if there no further nesting. grid.tbody.find("input[type='checkbox']...

When I type the name of a character vector in R, how can I print without unnecessary lines? -

i working character vector, size of each elements ranging 4 855. let's assume name of such vector y. when type "y", r prints out whole vector, , problem each element takes same number of lines. thus, if takes 8 lines print elements 855 character, r give 8 lines elements 4 character, , way shows lot of unnecessary lines i want remove unnecessary lines. example, want [1] "a" [2]"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" to printed as [1] "a" [2]"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" when type name of vector. how can change setting? note behavior describe lines being added printed output not universal. instance, r console on mac (3.1.2) not print lines described, lines when runni...

c# - Two Way Binding Path=. Will Not Save -

public datacontext { public observerablecollection<int> integers; } <datagrid itemssource={binding integers, mode=twoway}> <datagrid.columns> <datagridtextcolumn binding="{binding path=., updatesourcetrigger=propertychanged, mode=twoway}"/> </datagrid.columns> </datagrid> shows numbers fine. but, if modify something, values never save. can enter 999999 , collection never update index corresponding row. if made silly wrapper class called integermodel , give integer called "value" , set, change binding path=. binding path=value, works fine. this site mentions in answer, doesn't know why. i'd know why myself. if inotifypropertychanged event issue, why work normal getter , setter wrapper? i'm basing on know .net framework's internals. educated guess. the "silly wrapper class" mention "boxes" integers, value types, object types. permits add implementation of inoti...

excel - Macro/VBA: Clear cells in a row based on values in a column, and loop through entire column -

i'm trying write macro in excel identify first value in row (a2) , search rest of row clear cell greater value (c2:dga2). i'd set such program loops through every row in column (a2:a400), , clears corresponding values. i tried using following code, modified post: sub clear_cell() dim v v = excel.thisworkbook.sheets("top line").range("b2").value dim arr() variant arr = sheet1.range("c2:dgj2") dim r, c long r = 1 ubound(arr, 1) c = 1 ubound(arr, 2) if arr(r, c) > v arr(r, c) = "" end if next c next r sheet1.range("c2:dgj2") = arr end sub i modified fit needs, works first row. need getting loop through every row in first column. thank help. i'm trying write macro in excel identify first value in row (a2) , search rest of row clear cell greater value (c2:dga2). from above statement, assuming ranges in same sheet. code works me if make few changes. see this ...

converting/porting Xamarin.Android project to Xamarin.iOS -

i'm in process of converting/porting on xamarin.android project xamarin.ios , have run wall entirely different architecture of ios - how uis designed (axml layouts in android storyboards in ios) how backend code works ui (activity in android viewcontrollers in ios). event names different - onclick in android touchupinside in ios. controls called subviews , control properties 'outlets' - there's learning curve here. does here have success - or @ least experience - in porting xamarin.android project xamarin.ios? there tools out there used convert android axml layouts ios storyboards or android activity ios viewcontrollers? how book or online resource/website of has done this? i have 20-25 android axml layouts , activities in project , thought writing code build tool can automate translation of these ios equivalents. i've checked out storyboard code , see textview 'label' while edittext 'textfield'. there list maps android controls storyboard eq...

Correct way to unpack a 32 bit vector in Perl to read a uint32 written in C -

i parsing photoshop raw, 16 bit/channel, rgb file in c , trying keep log of exceptional data points. need fast c analysis of 36 mpix images 16 bit quanta or 216 mb photoshop .raw files. <1% of points have weird skin tones , want graph them perlmagick or perl gd see coming from. the first 4 bytes of c data file contain unsigned image width uint32_t. in perl, read whole file in binary mode , extract first 32 bits: xres=1779105792l = 0x6a0b0000 it looks lot c log file: da: color anomalies=14177=0.229%: da: ii=1) raw pidx=0x10000b25, xcols=[0]=0x00000b6a dec(0x00000b6a) = 2922, exact x_columns_width of small test file. clearly case of intel's 1972 8008 nuxi architecture. how hard possibly translate 0x6a0b0000 0x6a0b0000; swap 2 bytes , 2 nibbles , you're done. slicing 8 characters , rearranging them done kind of ugly hack trying avoid. grab same 32 bit vector file offset 0 , unpack "vax" unsigned long. $xres = vec($bdat, 0, 32); # vec expr,offse...

php - yii2 disable page cache on post request -

i have page submit form want cache requests. cannot figure out if there way yii2 guide seems hint @ http://www.yiiframework.com/doc-2.0/yii-filters-pagecache.html#$enabled-detail , says can enable requests. know how filter won't cache page when form submitted. right when submits page goes redirect loop. 'pagecache' => [ 'class' => 'yii\filters\pagecache', 'only' => ['nba'], 'dependency' => [ 'class' => 'yii\caching\dbdependency', 'sql' => 'select timestamp e_nbapicks user_id = '.yii::$app->user->id, ], ], since enabled boolean pass isget variable \yii\web\request : 'pagecache' => [ ... 'enabled' => yii::$app->request->isget ] the request class represents http request. read more on api page

python - Is it possible to alter an external variable in a list comprehension? -

for instance: n = 0 = [n=n+1 x in range(1,(12*8)+1) if x % 2 == 0] this silly question, don't have real use this. use or while loop achieve similar. i'm interested if possible. (which assume it's not haha.) you cannot make assignments within list comprehension bodies. language specification allows expressions . however, means can call methods have side effects. example, call list.append modify different list, e.g. >>> lst = [] >>> [lst.append(i) in range(5)] [none, none, none, none, none] >>> lst [0, 1, 2, 3, 4] but useful, , of times ends in more confusing expression. it’s far more recommended split standard loop then; avoids overhead of generated list.

dom - Compiling dynamic HTML strings from database -

the situation nested within our angular app directive called page, backed controller, contains div ng-bind-html-unsafe attribute. assigned $scope var called 'pagecontent'. var gets assigned dynamically generated html database. when user flips next page, called db made, , pagecontent var set new html, gets rendered onscreen through ng-bind-html-unsafe. here's code: page directive angular.module('myapp.directives') .directive('mypage', function ($compile) { return { templateurl: 'page.html', restrict: 'e', compile: function compile(element, attrs, transclude) { // nothing return { pre: function prelink(scope, element, attrs, controller) { // nothing }, post: function postlink(scope, element, attrs, controller) { // nothing } ...

php - MySQLnd not loading -

i have enabled mysqlnd module in backend of webspace, doesn't work. so write code shows mysqlnd status: if (function_exists('mysqli_fetch_all')) { echo "mysqlnd enabled!"."<br>"; } else { echo "not enabled"."<br>"; } if(extension_loaded("mysqlnd")) { echo "loaded"."<br>"; } else { echo "not loaded"."<br>"; } strangely returns: not enabled loaded so module loaded, functions aren't present. know why?

node.js - Ever multiple socket connections for one HTTP request? -

i'm working on zero-downtime update/clustering server. essentially, server listening on port 80 , 443. when gets request, request piped child node instance listening on other ports (may or may not on same server). when update, spin more children new code , start piping new requests those. when old children done handling requests, close themselves. my question is: there ever http(s) request broken on multiple connections? maybe large file broken chunks each chunk closing previous connection , creating new 1 new chunk? potentially end going different servers , never joined together. i'm talking standard get/post/put/delete , file upload. understanding, these requests take 1 connection. maybe information sent on multiple packets, information sent on 1 connection, yes? thanks!

Form Validation on Group of items -

here page: http://hawaiianoptics.com/visa customer can select on product , needs select color of product. can select 1 product , 1 color. what's easiest way this? use radio on of products separate validation on dropdowns? thanks!

javascript - Angular nvd3 donut chart - how to add a static or dynamic title? - -

i using angular nvd3-pie-chart. idea or suggestion how add static or dynamic title @ center of donut chart? here code block. <nvd3-pie-chart data="exampledata" id="exampleid" showlabels="true" x="xfunction()" y="yfunction()" donut="true" donutratio=".5" donutlabelsoutside="true"> </nvd3-pie-chart> function examplectrl($scope){ $scope.exampledata = [ { key: "one", y: 5 }, { key: "two", y: 2 } ]; $scope.xfunction = function(){ return function(d) { return d.key; }; } $scope.yfunction = function(){ return function(d) { return d.y; }; } }...

chess - Eight Queens Puzzle in CLIPS -

i'm trying develop solver 8 queens problem ( https://en.wikipedia.org/wiki/eight_queens_puzzle ) in clips, i'm newbie in language. first of all, trying make rule verify new assertion comparing column/line of previous assertions. working when inserted duplicated line, when inserted duplicated column, doesn't detect it. what's wrong code? (defrule verificaassercaodamas ; verifica se atende regras ?novaposicao <- (d ?line ?column) ?posicao <- (d ?line2 ?column2) (test (neq ?posicao ?novaposicao)) (test (or (eq ?line2 ?line) (eq ?column column2)) ) => (retract ?novaposicao) (if (< (+ ?column 1) 9) (assert (d ?line (+ ?column 1) )) ) clips> (assert(d 0 0)) <fact-1> clips> (assert(d 1 0)) <fact-2> clips> (assert(d 0 1)) <fact-3> clips> (agenda) 0 cerificaassercaodamas: f-3, f-1 0 cerificaassercaodamas: f-1, f-3 total of 2 activations. clips> you're using expression (eq ?...