Sunday 15 January 2012

php - Give Server Write Access To Folders -



php - Give Server Write Access To Folders -

i'm hosting lamp ec2 instance via amazon aws.

part of website allows users upload files. unfortunately, server not able store permanent copies in "uploads" folder because lacking necessary permissions.

a php script called store file "uploads" folder. upload fail while upload folder has standard 755 , 775 permissions. however, when alter folder permissions 777 (world permissions), works.

for obvious reasons, don't want utilize 777 world permissions. how can create server has permission write files "uploads" folder?

thanks guys.

this might issue ownership of upload folder. ownership of folder can checked next command ls -l sample output: -rw-r--r-- 1 root root 0 aug 31 05:48 demo.txt . here can seen both user of file root , grouping of file root. executing command within directory show permissions , ownership of files , folders in folder. lamp stack need create sure ownership apache user i.e. www-data , apache grouping 1 time again www-data. can done going in root folder of application , and executing command

chown -r www-data:www-data sample output: -rw-r--r-- 1 www-data www-data 0 aug 31 05:48 demo.txt

this recursively alter ownership of files , folders within root directory apache user , group. mutual cause of issue when have downloaded bundle or files , have done local or root user , apache not having permissions it. or have created directory manually. basic thought solve issue, might want consider execute command , alter ownership of "uploads" directory .

php amazon-web-services amazon-ec2 file-permissions folder-permissions

javascript - How can i get the drop point indormation? [drag and drop] -



javascript - How can i get the drop point indormation? [drag and drop] -

now im trying implement drag , drop on html5. i'd know how can grab info drop content. example...

<div id="droppoint"></div><ul> <li draggable="true">1</li> <li draggable="true">2</li> <li draggable="true">3</li> <li draggable="true">4</li> <li draggable="true">5</li> </ul>

when drag li element droppoint , drop this, want grab id attribute(droppoint).

erea.addeventlistener("drop", function(evt) { var droptext = evt.datatransfer.getdata("text"); console.log('============================'); console.log(droptext); console.log('============================'); evt.preventdefault(); }, false);

function drag_over(event) { console.log(event.clientx); console.log(event.clienty); event.preventdefault(); homecoming false; } function drop(event) { console.log(event.clientx); console.log(event.clienty); event.preventdefault(); homecoming false; }

http://jsfiddle.net/robertc/kkuqh/30/

clientx , clienty current client's coordinates (his pointer), if client's coordinates while drops, know dropped item.

found here: html5: dragover(), drop(): how current x,y coordinates?

have day =)

javascript html html5 drag-and-drop draggable

ios - Pass from UIUserNotificationTypeNone to UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound -



ios - Pass from UIUserNotificationTypeNone to UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound -

do know way pass uiusernotificationtypenone uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound (ios8)?

to pass uiusernotificationtypenone works not when user seek switch 1 time again enable ...

this code:

// register force notifications, if running ios 8 if ([application respondstoselector:@selector(registerusernotificationsettings:)]) { uiusernotificationtype usernotificationtypes = (uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound); uiusernotificationsettings * settingsavailable = [uiusernotificationsettings settingsfortypes:usernotificationtypes categories:nil]; [application registerusernotificationsettings:settingsavailable]; [application registerforremotenotifications]; } else { // register force notifications before ios 8 [application registerforremotenotificationtypes:(uiremotenotificationtypebadge | uiremotenotificationtypealert | uiremotenotificationtypesound)]; }

after switch enable method of delegate "didregisterusernotificationsettings"

// register receive notifications [application registerforremotenotifications]; nslog(@"the app registered types: %@", notificationsettings);

returns:

the app registered types: <uiusernotificationsettings: 0x15e9e790; types: (none);>

thanks in advance

that's because notification setting has been turned off in scheme setting.

ios objective-c xcode

php - Find content in specific DIV with Behat/Selenium -



php - Find content in specific DIV with Behat/Selenium -

i creating behat/selenium automated test script. want create statement says:

given on "/" should see <content> in <specific div>

i want create function in featurecontext.php file allow me verify content (text) exists within specified div tag. can please point me in right direction?

if want pointed in right direction, should avoid doing things such – contradict behat ideology. scenario describes actions user performs , assertions makes verify result user looks @ page, not developer looks code. logic of lastly must done behind scenes. in other words, step should read more this:

given on homepage page title should read "hello world" , user list should contain "john doe" , dialogue title should "foo bar"

if want reply initial question, can such:

/** * @then /^(?:|i )should see "(?p<text>.+)" in "(?p<selector>\w+)" element$/ */ public function assertelementtext($text, $selector) { $page = $this->getsession()->getpage(); $element = $page->findall('css', $selector); foreach($this->getsession()->getpage()->findall() $element) { if (strpos(strtolower($text), strtolower($element->gettext()) !== false) { return; } } throw exception("text '{$text}' not found in '{$selector}' element."); }

and utilize this:

then should see "hello world" in "div#title" element should see "john doe" in "ul#users > li" element

php html xpath behat mink

google app engine - gae cloud sql active connections not closing (keeping the instance running) -



google app engine - gae cloud sql active connections not closing (keeping the instance running) -

i stopped instance running in app still cloud sql have 1 active connection, have no thought why.. keeping cloud sql instance running.. , i'm getting charged hours used.. please help

there few places flag set maintain cloud sql instance alive.

go dev console project -> cloud sql -> sql instance -> edit -> "show advanced options..." -> activation policy create sure set "on demand".

if still seeing then:

go here , fill out information. under fields select 'settings' click execute , scroll down. 'activationpolicy' , see whats set to. can utilize api browser alter setting or gcloud

google-app-engine google-cloud-sql

Loading JSON into Hbase and modelling the database -



Loading JSON into Hbase and modelling the database -

i have more 600gb of data. want load info hbase , build restful service serving data.

the info have of next format

file1:

{key1:value1, key2:value2 .......} {key1:value3, key2:value4 .......} ................................. (arbitary number of entries) .................................

file2:

{key1:value5, key2:value6 .......} {key1:value7, key2:value8 .......} ................................. (arbitary number of entries) .................................

..............................................................................

(large number of files this)

..............................................................................

one of keys id key , 1 more timestamp key. in restful service, request should take in id , timestamp , homecoming entries(in of 600gb info set).

i confused couple of things

i have worked postgres , mysql (rdbms databases), have worked couchdb(not proficient). confused how should model hbase database considering requirements.

what procedure load hbase given in format mentioned above.

json hbase

Change colors for accumulation curve in R? -



Change colors for accumulation curve in R? -

i using biodiversityr bundle generate species accumulation curves pooled individuals per plot in habitat type. have 3 different habitat types , each habitat type has 3 different sites (as rows). species presented columns. want each site of specific habitat represented in same color, different habitat types in different colors. now, rainbow. how alter color scheme?

here how did it.

library(biodiversityr) com.honey <- sub.honey[, 5:ncol(sub.honey)] env.frame.honey <- data.frame(env.honey) env.frame.honey$site.totals <- apply(com.honey,1,sum) accum.honey1 <- accumcomp(com.honey, y=env.frame.honey, factor="env.honey",scale="site.totals",ci=1,ci.type ="line", ci.lty= 3, conditioned=false, method="exact", ylab= "",xlab="", col=1,legend= f)

i added test dataset here. help highly appreciated.

i looking other possibilities accumulation curve biodiversityr bundle doesn't work new mac update.

https://www.dropbox.com/s/6stfg3ouqa399d5/test%20data.csv?dl=0

r

How do i pass an id as a parameter for a function using the click eventListener in jquery? -



How do i pass an id as a parameter for a function using the click eventListener in jquery? -

<script> $( document ).ready(function() { //for illustration item button clicked , panelcontent panel shown $('#item').click({param1: '#panelcontent'}, toggleobjects); // tried , doesn't work $('#item').click(toggleobjects('#panelcontent')); }); var currentobject; function toggleobjects(theobject) { //theobject id of panel if(currentobject===null) { currentobject=theobject; $(currentobject).show(); } if(currentobject===theobject) { $(theobject).toggle(); } if(currentobject!==theobject) { $(currentobject).hide(); currentobject=theobject; $(currentobject).show(); } console.log( 'executed!' ); } </script>

if set onclick="toggleobjects('#panelcontent')" on button in html works fine, utilize jquery event listener.

how should utilize .click event passing function , parameter? or there solution besides html onclick version ?

please excuse poor english! give thanks in advance attending matter.

what appears want either in-line function--

$('#item').click(function() { toggleobjects('#panelcontent'); } );

or define new function calls toggleobjects function specific parameter --

var toggleobjectswithpanelcontent = function() { toggleobjects('#panelcontent'); }; $('#item').click(toggleobjectswithpanelcontent);

.

you got close $('#item').click(toggleobjects('#panelcontent'));,

but toggleobjects('#panelcontent') bit function phone call there, not reference function, you're passing homecoming value of toggleobjects click() fn. (the homecoming value in case beingness undefined).

jquery parameters

c# - When hiding one fullscreen form and showing another fulscreen one there is unwanted flickering -



c# - When hiding one fullscreen form and showing another fulscreen one there is unwanted flickering -

i utilize simple lines...:

char_creation_1 game = new char_creation_1(); game.show(); this.hide();

...to alter forms in our project group's text game. however, while when changing forms, shows desktop or whatever other window below forms @ time (thus flickering). both forms meant maximized , working without task bar shown , other windows visible, game ones. how remove flickering?

yes, when closes shows homescreen opens forms flicker happen. improve can utilize mdi forms avoid flicker , professional look

set form's

formborderstyle = none

and

pass form parameter

createmdichild(new game());

also set main form

ismdicontainer = true

public void createmdichild(form child) { if (this.activemdichild != null) { this.activemdichild.close(); } child.mdiparent = this; child.dock = dockstyle.fill; child.show(); }

c# forms visual-studio-2013 flicker

symfony2 - Symfony 2.5.5 & FOSUserBundle: the class ... was not found in the chain configured namespaces -



symfony2 - Symfony 2.5.5 & FOSUserBundle: the class ... was not found in the chain configured namespaces -

recently, started working symfony2. want add together user management engine site.

but i'm facing problem. i'm doing:

in terms of creating/installing basic symfony2 project:

$ composer create-project symfony/framework-standard-edition path/ "2.5.*" $ mv path/* ./ $ rm -r path/

ok, much symfony 2.5.5. next, download fosuserbundle , create custom bundle:

$ composer require friendsofsymfony/user-bundle '~2.0@dev' $ php app/console generate:bundle --namespace=meiblorn/corebundle --format=yml

create user class in meiblorn\corebundle\framework\domain namespace

/** * user: meiblorn * date: 15/10/14 * time: 20:17 */ namespace meiblorn\corebundle\framework\domain; utilize fos\userbundle\model\user fosuserbundleuser; utilize doctrine\orm\mapping orm; /** * @orm\entity * @orm\table( * name = "users" * ) */ class user extends fosuserbundleuser { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id; public function __construct() { parent::__construct(); // own logic } } ?>

configure security.yml , config.yml. finally, got this:

appkernel.php $bundles = array( new symfony\bundle\frameworkbundle\frameworkbundle(), new symfony\bundle\securitybundle\securitybundle(), new symfony\bundle\twigbundle\twigbundle(), new symfony\bundle\monologbundle\monologbundle(), new symfony\bundle\swiftmailerbundle\swiftmailerbundle(), new symfony\bundle\asseticbundle\asseticbundle(), new doctrine\bundle\doctrinebundle\doctrinebundle(), new fos\userbundle\fosuserbundle(), new meiblorn\corebundle\meiblorncorebundle(), ); config.yml imports: - { resource: parameters.yml } - { resource: security.yml } framework: #esi: ~ translator: { fallback: "%locale%" } secret: "%secret%" router: resource: "%kernel.root_dir%/config/routing.yml" strict_requirements: ~ form: ~ csrf_protection: ~ validation: { enable_annotations: true } templating: engines: ['twig'] #assets_version: someversionscheme default_locale: "%locale%" trusted_hosts: ~ trusted_proxies: ~ session: # handler_id set null utilize default session handler php.ini handler_id: ~ fragments: ~ http_method_override: true # twig configuration twig: debug: "%kernel.debug%" strict_variables: "%kernel.debug%" # assetic configuration assetic: debug: "%kernel.debug%" use_controller: false bundles: [ ] #java: /usr/bin/java filters: cssrewrite: ~ #closure: # jar: "%kernel.root_dir%/resources/java/compiler.jar" #yui_css: # jar: "%kernel.root_dir%/resources/java/yuicompressor-2.4.7.jar" # doctrine configuration doctrine: dbal: driver: "%database_driver%" host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: utf8 orm: auto_generate_proxy_classes: "%kernel.debug%" auto_mapping: true # swiftmailer configuration swiftmailer: transport: "%mailer_transport%" host: "%mailer_host%" username: "%mailer_user%" password: "%mailer_password%" spool: { type: memory } fos_user: db_driver: orm firewall_name: prod user_class: meiblorn\corebundle\framework\domain\user security.yml security: encoders: fos\userbundle\model\userinterface: sha512 role_hierarchy: role_admin: role_user role_super_admin: role_admin providers: fos_userbundle: id: fos_user.user_provider.username firewalls: prod: pattern: ^/ form_login: provider: fos_userbundle csrf_provider: form.csrf_provider logout: true anonymous: true dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false access_control: - { path: ^/login$, role: is_authenticated_anonymously } - { path: ^/register, role: is_authenticated_anonymously } - { path: ^/resetting, role: is_authenticated_anonymously } - { path: ^/admin/, role: role_admin } this problem in browser: http://localhost/test.meiblorn.com/web/app_dev.php/ mappingexception: class 'meiblorn\corebundle\framework\domain\user' not found in chain configured namespaces fos\userbundle\model in /library/webserver/documents/test.meiblorn.com/vendor/doctrine/common/lib/doctrine/common/persistence/mapping/mappingexception.php line 37 @ mappingexception::classnotfoundinnamespaces('meiblorn\corebundle\framework\domain\user', array('fos\userbundle\model')) in /library/webserver/documents/test.meiblorn.com/vendor/doctrine/common/lib/doctrine/common/persistence/mapping/driver/mappingdriverchain.php line 113 @ mappingdriverchain->loadmetadataforclass('meiblorn\corebundle\framework\domain\user', object(classmetadata)) in /library/webserver/documents/test.meiblorn.com/vendor/doctrine/orm/lib/doctrine/orm/mapping/classmetadatafactory.php line 117 @ classmetadatafactory->doloadmetadata(object(classmetadata), object(classmetadata), false, array()) in /library/webserver/documents/test.meiblorn.com/vendor/doctrine/common/lib/doctrine/common/persistence/mapping/abstractclassmetadatafactory.php line 318 also doctrine doesn't create tables mapping when calling doctrine:schema:update please, help me prepare exception update! how fix

final configuration namespace

orm: auto_generate_proxy_classes: "%kernel.debug%" auto_mapping: false mappings: fosuserbundle: ~ meiblorncorebundle: type: annotation dir: %kernel.root_dir%/../src/meiblorn/corebundle/framework/entity prefix: meiblorn\corebundle\framework\entity # alias: mymodels # is_bundle: true

first need configure psr-4 autoload in composer.js, example

"autoload": { "psr-4": { "meiblorn\\corebundle\\": "src/meiblorn/corebundle/" } },

then phone call composer dumpautoload.

secondly, believe doctrine expects entities live in folder entity/, seek move model: src/meiblorn/corebundle/framework/domain/user.php src/meiblorn/corebundle/entity/user.php or how alter symfony 2 doctrine mapper utilize custom directory instead of entity directory under bunle

symfony2 doctrine mapping fosuserbundle mappingexception

java - Dynamodb new item notification/trigger -



java - Dynamodb new item notification/trigger -

is there function in amazon java sdk notifies when new item added table?

i believe should synchronous function hold programme execution, until there new item.

latency should low, less second.

java amazon-dynamodb

java - Getting illegal request to write non-integral number of frames exception ONLY when running with jar -



java - Getting illegal request to write non-integral number of frames exception ONLY when running with jar -

i'm getting exception when programme run jar file. when run through intellij don't exception. here's code:

opening sourcedataline (clip inputstream):

frmt = new audioformat(44100, 16, 2, true, false); info = new dataline.info(sourcedataline.class, frmt); bfr = new byte[409600]; nbtoread = 409600; seek { linein = (sourcedataline) audiosystem.getline(info); linein.open(frmt); totaltoread = clip.available(); } grab (lineunavailableexception e) { e.printstacktrace(); } grab (filenotfoundexception e) { e.printstacktrace(); } grab (ioexception e) { e.printstacktrace(); }

playing audio:

linein.start(); seek { while (total < totaltoread && !stopped) { nbread = clip.read(bfr, 0, nbtoread); if (nbread == -1) { break; } total += nbread; linein.write(bfr, 0, nbread); } } grab (ioexception e) { e.printstacktrace(); } linein.stop();

i'm getting illegalargumentexception on line:

linein.write(bfr, 0, nbread);

java audio intellij-idea

networking - What do Network In and Network Out mean in Amazon? -



networking - What do Network In and Network Out mean in Amazon? -

if got instance 10 gigabit ethernet. mean? how much bytes have in network in , how much in network out maximum?

in reports of cloud watch can see 80,000,000 in network in, , 800,000,000 in network out. when coming close 120,000,000 in network in site starts load slow , pictures or assets don't load. maximum?

10 gigabit ethernet, assume total duplex, maximum network in=max network out = 10 gbps / 8 = 1.25 gb/second.

gbps: gigabit per second; gb: giga byte; mb: mega byte

cloud watch, 80,000,000 in network in means 80mb per 60 seconds. 120,000,000 in network in => 120mb / 60s => 2 mb/s => 16 mbps, far maxium 100 mbps. still depend on instance type use.

http://docs.aws.amazon.com/awsec2/latest/userguide/viewing_metrics_with_cloudwatch.html https://www.datadoghq.com/blog/why-do-aws-cloudwatch-and-datadog-seem-to-disagree/

networking amazon-web-services amazon-ec2 amazon-cloudwatch

c# - How does Binary Insertion Sort Work? -



c# - How does Binary Insertion Sort Work? -

i know how binary search works, , know how insertion sort works code binary insertion sort , have problem in understanding how works.

static void main(string[] args) { int[] b = binarysort(new[] { 4, 3, 7, 1, 9, 6, 2 }); foreach (var in b) console.writeline(i); } public static int[] binarysort(int[] list) { (int = 1; < list.length; i++) { int low = 0; int high = - 1; int temp = list[i]; //find while (low <= high) { int mid = (low + high) / 2; if (temp < list[mid]) high = mid - 1; else low = mid + 1; } //backward shift (int j = - 1; j >= low; j--) list[j + 1] = list[j]; list[low] = temp; } homecoming list; }

i don't understand part do:

//backward shift (int j = - 1; j >= low; j--) list[j + 1] = list[j]; list[low] = temp;

and purpose of using binary search here? can tell me how binary insertion sort works? (c# console)

code source:http://w3mentor.com/learn/asp-dot-net-c-sharp/asp-dot-net-language-basics/binary-insertion-sort-in-c-net/

binary insertion sort works insertion sort, separates locating insertion point actual insertion.

insertion sort implemented array move items @ same time locating insertion point. while looping through items find insertion point, shift items create room insertion.

binary insertion sort create utilize of fact items sorted sorted, can utilize binary search find insertion point. binary search can't shift items create room insertion, has done in separate step after insertion point has been found.

the code wanted explained code shifts items create room insertion.

c# sorting search

MYSQL view without using variables -



MYSQL view without using variables -

i want convert query view. need eliminate utilize of variables. sql code this:

set @runningtotal = 0; select feescollected.datepaid, feescollected.termpaidfor, feescollected.feespaid, @runningtotal := @runningtotal + feescollected.feespaid runningtotal feescollected;

expected output:

datepaid termpaidfor feespaid runningtotal ---------------------------------------------------- 2014-02-06 150000 150000 2014-03-24 70000 220000 2014-04-08 80000 300000

like this?

select feescollected.datepaid, feescollected.termpaidfor, feescollected.feespaid, (feescollected.feespaid + 0) runningtotal feescollected;

mysql variables views

javascript - ZeroClipboard - Check if it wasn't loaded -



javascript - ZeroClipboard - Check if it wasn't loaded -

really simple question here, couldn't find in documentation, hoping here point me in right direction.

https://github.com/zeroclipboard/zeroclipboard

in zeroclipboard there's callback when swf loaded, there way can observe if hasn't been loaded?

here's how works when it's loaded:

client.on( "ready", function( readyevent ) { // alert( "zeroclipboard swf ready!" ); client.on( "aftercopy", function( event ) { // `this` === `client` // `event.target` === element clicked event.target.style.display = "none"; alert("copied text clipboard: " + event.data["text/plain"] ); } ); } );

simply check whether zeroclipboard object exist in window

window.onload = function() { if (!('zeroclipboard' in window)) { //your code } }

javascript jquery zeroclipboard

android position estimator through GPS -



android position estimator through GPS -

i'm engineering science pupil , i'm developing quadrotor android nexus 5 flight controller.

in order perform autonomous flight need implement suitable position controller , position estimator, here question: been proven cheaper hardware possible obtain position estimation through gps , imu mesuraments battery saving policy android compute gps update @ low frequency (1hz) possible obtain higher frequency (20hz like)? if has improve solution please tell me?

edit:

my problem not how fast can prepare (before deployment can wait solid fix). issue accuracy of position estimation and, alredy sad, alredy been proven cheeper hardware (like ardupilot utilize arduino mega, same imu nexus 5 , ublox gps) possible obtain accuracy allow safe flight , precise hovering.

even requestlocationupdate() min time set 0 gps info updated 1 time every 1000ms

thanks in advance lorenzo

i think frequency mean how many times in period location updated.

if case can command somewhat. more request location updates heavier strain on battery there be. functions getlastknownlocation() , requestlocationupdates() can used in conjunction update lat/long coordinates pretty fast. read on location manager.

however gps locking take time. in experience location in open ground (no obstruction) can provided every 10secs. faster estimates can provided if have leeway in accuracy. using locations provided network towers instead of gps can location in under 10secs/location. expect atleast 200ft error magnitude @ least.

lastly fastest way update location via wifi. if can provide solid wifi connection location can update definite accuracy within 5secs.

also google maps api. have cool functionality can utilize location faster , add together google map application.

android gps position estimation

With vb.net, how can I split this filename/string? -



With vb.net, how can I split this filename/string? -

dim suffix string = "_version"

i have file called "something_version1.jpg"

i need split "something_version"

the next gets me "1.jpg"

filename = filename.split(new string() {suffix}, stringsplitoptions.none)(1)

and next gets me "something"

filename = filename.split(new string() {suffix}, stringsplitoptions.none)(0)

but need "something_version"

the suffix dynamic, , can change.

hope easier i'm making it.

thank you.

if don't care "1.jpg" part @ all, , want suffix , part before suffix, can have above (the sec one) prefix, , concatenate prefix , suffix reply you're looking for.

the split phone call might overkill job.

vb.net

c# - inteface issue in MVC 5 'Cannot create an instance of an interface' -



c# - inteface issue in MVC 5 'Cannot create an instance of an interface' -

hi i'm trying utilize interfaces in mvc 5 project code below:

public actionresult index(iaccountcontroller accountinterface) { var dynamicid_ddl = accountinterface.idmethod(); var model = new loggedinviewmodel { bidlistitems = new selectlist(dynamicid_ddl) }; viewbag.dynamicid_ddl = new list<id>(dynamicid_ddl); homecoming view(model); }

&

interface

public interface iaccountcontroller { languagesetting[] languagesettingmethod(); id[] idmethod(); }

however error:

cannot create instance of interface.

why happening , how can prepare ?

when mvc controllers called via route, model binder attempts find null ctor of parameter , initialize object prior entering controller action method. interfaces cannot instantiated... alter parameter type class implements interface if not concerned tight coupling.

or here's illustration on custom model binding

public class homecustombinder : imodelbinder { public object bindmodel(controllercontext controllercontext, modelbindingcontext bindingcontext) { httprequestbase request = controllercontext.httpcontext.request; string title = request.form.get("title"); string day = request.form.get("day"); string month = request.form.get("month"); string year = request.form.get("year"); homecoming new homepagemodels { title = title, date = day + "/" + month + "/" + year }; } public class homepagemodels { public string title { get; set; } public string date { get; set; } } }

c# asp.net-mvc

Does weka filter keep the order of the instances -



Does weka filter keep the order of the instances -

in weka, when applying filter on instances, next

// filter non-numeric attribute instances data; instances newdata; remove remove = new remove(); ...... newdata = filter.usefilter(data, remove);

will order of instances in newdata same order of instances in data?

i think 'remove' filter wipes away attribute instead of instances, order still preserved.

as instance filters, should retain order (unless specific filters reorder dataset according documentation).

i tried on removewithvalues instance filter , order preserved after applied.

filter weka

Javascript Class, var undefined in event listener -



Javascript Class, var undefined in event listener -

this question has reply here:

preserve 'this' reference in javascript prototype event handler 3 answers var foo = (function(){ function foo(){ this._s="string"; this.setbutton(); }; foo.prototype.setbutton = function(){ document.getelementbyid('id').addeventlistener('click', function(event) { alert(this._s); }); }; foo.prototype.method = function(){ alert(this._s); }; homecoming foo; })(); var fo = new foo(); fo.method();

i want bind event button, , execute function whic utilize 'private' var, when click button function correctly called can't see var this._s (it writes 'undefined'). if write fo.method() string correctly printed. here jsfiddle: http://jsfiddle.net/wlm1v4la/1/

you have set context(this) of function manually before passing it.

foo.prototype.setbutton = function () { var tmpfunc = function(evt){ alert(this._s); } //store function var boundfunction = tmpfunc.bind(this); //set context manually //pass function eventlistener document.getelementbyid('id').addeventlistener('click',boundfunction); };

javascript class oop

amazon s3 - Correct permissions for AWS remote copy -



amazon s3 - Correct permissions for AWS remote copy -

i'm using s3tools sync files on server , s3 bucket. specifically, i'm using sync command. this, however, not working correctly because can't find right permissions assign user i've setup. seems working constanlty error s3cmd sync command "remote re-create failed."

here's current policy:

{ "version": "2012-10-17", "statement": [ { "sid": "somesid", "effect": "allow", "action": [ "s3:listbucket" ], "resource": [ "arn:aws:s3:::mybucket" ] }, { "effect": "allow", "action": [ "s3:listbucket", "s3:putobject", "s3:putobjectacl", "s3:deleteobject" ], "resource": [ "arn:aws:s3:::mybucket/some/path", "arn:aws:s3:::mybucket/some/path/*" ] } ] }

does know permissions should add together create remote re-create possible?

i tested permissions using sync command provided part of aws command line interface.

this policy worked successfully:

{ "version": "2012-10-17", "statement": [ { "sid": "somesid", "effect": "allow", "action": [ "s3:getobject", "s3:listbucket", "s3:putobject" ], "resource": [ "arn:aws:s3:::mybucket", "arn:aws:s3:::mybucket/*" ] } ] }

note: s3:listbucket operation works on bucket, while other api calls operate on object.

amazon-s3 amazon-iam s3cmd

Loopj Android Asynchronous Http Client Cookies not save in signed apk -



Loopj Android Asynchronous Http Client Cookies not save in signed apk -

why cookies not saved when app exported signed certificate upload google play store?

when run app in eclipse works fine , cookies saved.

i utilize http connection library:

http://loopj.com/android-async-http/

and method:

mclient = new asynchttpclient(); mclient.setcookiestore(new persistentcookiestore(context));

it's loopj bug !!

i had comment line in project.properties file: proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

also read at: https://github.com/loopj/android-async-http/issues/688

android cookies google-play loopj

project server - Set baseline programmatically in ProjectServer -



project server - Set baseline programmatically in ProjectServer -

how can set baseline programmatic-ally in microsoft project server? there blogs this?

i not sure in context working. if in vsto, seek this: application.baselinesave

as far know psi not offer method set baseline what psi , not

project-server ms-project-server-2010

boot2docker - Can't run any docker commands - timeout -



boot2docker - Can't run any docker commands - timeout -

i sure extremely stupid, , overlooking something, cannot run docker command. illustration when run

docker info

i (replaced numbers x)

get https://192.16x.5x.1x3:2376/v1.15/version: dial tcp 192.1x8.59.x03x2376: i/o timeout

restarting computer fixed issue

docker boot2docker

multithreading - stdin, stdout and stderr are shared between? -



multithreading - stdin, stdout and stderr are shared between? -

i trying understand behavior of 3 streams - stdout, stdin , stderr. couldn't reply textbook, came here.

i know these 3 stored in file descriptor table file descriptors 0 (stdin), 1 (stdout) , 2 (stderr). aware these not simply file descriptors i/o streams can redirected. ok, how sharing?

consider 3 cases:

when fork() called : kid process , parent process shares file descriptors, have same stdin, stdout , stderr ? when thread created : threads share file descriptors, i/o streams? when execl() called : in case nowadays process image overwritten new process image. if execl("./a.out", "a.out", null); , new executable freshcopy of stdin, stderr , stdout?

all wise answers welcome.

in order understand what's going on, consider these communication channels across process boundaries. i'll avoid calling them streams, because used in different contexts, related.

now, firstly, filedescriptor index process-specific table represents these channels, kind of opaque handle. however, here first answer: since threads part of process, share these descriptors, if write 2 threads same channel, leaves through same channel, outside of process, 2 threads indistinguishable.

then, when fork() called, process copied. done copy-on-write optimizations, still, means have different tables representing these communication channels. entry index 2 in 1 process not same 1 index 2 in fork. same construction within process, if created c file* or c++ std::stream on top of one, gets copied, too, along other data.

when execl() called, process still "owns" channels outside. these assigned os manages processes. means index 2 can still used communicate outside world. on startup, runtime library create e.g. file* utilize in c 3 well-known channels stdin, stdout , stderr.

the question remains happens when process forked channels outside. here, reply simple, either channel closed or inherited, can configured on per-channel base. if inherited, remains usable in kid process. written inherited channel end wherever output parent process have ended up, too.

concerning stdin of forked process, i'm not sure, think input default 1 of closed, because sending input multiple targets doesn't create sense. also, never found need process input stdin in kid process, unless input provided parent process (similar pipes in shell, although siblings rather parent , child).

note: i'm not sure if description clear, please don't hesitate inquire , seek improve things understanding.

multithreading exec stdout stdin stderr

Fibonacci sequence inconsistency -



Fibonacci sequence inconsistency -

i've made short programme generate fibonacci sequence in length specified user. @ moment when run code , input digit 6, display sequence follows:

1 , 1,2,3,5,8,

how rid of initial spaces while string stays on 1 line? below code

#user intiger input print("\n") f = int(input("enter length of sequence: ")) print("\n") f1 = 1 f2 = 1 multiply = 2 if f <=0: print("enter positive integer length: ") elif f == 1: print("the fibonacci sequence: ") print("\n") print(f1,end=',') else: print("the fibonacci sequence: ") print(f1,",",f2,end=",") while multiply < f: f3 = f1 + f2 print(f3,end=",") f1 = f2 f2 = f3 multiply += 1 print("\n")

else: print("the fibonacci sequence: ") print(f1,end=",") print(f2,end=",")

this simplest solution per perspective.. seeing code seems output should rid of initial spce seek per suggetion & allow me know output

fibonacci

Proper way to access usersinfo using mongodb driver for .net/c# -



Proper way to access usersinfo using mongodb driver for .net/c# -

when write line of code (c# using mongodb driver):

var mongodb = ... var result = mongodb.finduser("ruprecht");

i warning should "use new user management command "usersinfo". can find no illustration of how this.

i'll utilize deprecated commands now, i'd know right way it.

you utilize mongodatabase's runcommand method , usersinfo command documented here: http://docs.mongodb.org/manual/reference/command/usersinfo/#dbcmd.usersinfo.

c# mongodb

OSError: [Errno 7] Argument list too long on ubuntu, python calling bitcoind-cli with popen -



OSError: [Errno 7] Argument list too long on ubuntu, python calling bitcoind-cli with popen -

running python script calling bitcoind-cli using popen on ubuntu, on big blocks many trasactions, when calling getrawtransaction error oserror: [errno 7] argument list long

i understand it's buffer issue between shell , python script? there's single argument, guess it's long 1

need check else? can create buffer larger somehow or should alter method interact bitcoind rpc?

tried on local , aws ubuntu machines

thanks

since using python, best thing can utilize rpc, such as:

import base64 import requests response = requests.post( bitcoind_url, data=json.dumps( { 'method': method, 'params': params, 'jsonrpc': '2.0', 'id': 0, } ), headers={'content-type': 'application/json', 'authorization': b'basic ' + base64.b64encode(rpcuser + b':' + rpcpassword)})

where params list of arguments specific method.

you can rpcuser , rpcpassword bitcoind configuration file.

python popen bitcoind

c# - Sorting with the Entity Framework in an ASP.NET MVC Application -



c# - Sorting with the Entity Framework in an ASP.NET MVC Application -

i have index action method passing result , , want sort table through same index action method how can pass both value view. here index action method

public actionresult index(string sortorder) { var usercount = db.countuser(); homecoming view(usercount.tolist()); }

and here sorting code:

viewbag.namesortparm = string.isnullorempty(sortorder) ? "name_desc" : ""; var teams = t in db.teams select t; switch (sortorder) { case "name_desc": teams = teams.orderbydescending(t => t.teamname); break; default: teams = teams.orderby(t => t.teamname); break; }

you can accomplish by:

public actionresult index(string sortorder) { var usercount = db.countuser(); viewbag.namesortparm = string.isnullorempty(sortorder) ? "name_desc" : sortorder; var teams = t in db.teams select t; switch ((string)viewbag.namesortparm) { case "name_desc": teams = teams.orderbydescending(t => t.teamname); break; default: teams = teams.orderby(t => t.teamname); break; } viewbag.teams = teams.tolist(); homecoming view(usercount.tolist()); }

and utilize viewbag.teams in view.

however, proper solution think creating proper model contains both collections:

public class myindexviewmodel { public list<countuser> countusers { get; set; } public list<team> teams { get; set; } } public actionresult index(string sortorder) { var usercount = db.countuser(); viewbag.namesortparm = string.isnullorempty(sortorder) ? "name_desc" : sortorder; var teams = t in db.teams select t; switch ((string)viewbag.namesortparm) { case "name_desc": teams = teams.orderbydescending(t => t.teamname); break; default: teams = teams.orderby(t => t.teamname); break; } homecoming view(new myindexviewmodel { countusers = usercount.tolist(), teams = teams.tolist() }); }

and need alter model type in view myindexviewmodel

c# asp.net-mvc

java - A Sorted Integer List -



java - A Sorted Integer List -

so original code

// (unsorted) integer list class method add together // integer list , tostring method returns contents // of list indices. // // **************************************************************** public class intlist { private int[] list; private int numelements = 0; //------------------------------------------------------------- // constructor -- creates integer list of given size. //------------------------------------------------------------- public intlist(int size) { list = new int[size]; } //------------------------------------------------------------ // adds integer list. if list full, // prints message , nothing. //------------------------------------------------------------ public void add(int value) { if (numelements == list.length) { system.out.println("can't add, list full"); } else { list[numelements] = value; numelements++; } } //------------------------------------------------------------- // returns string containing elements of list // indices. //------------------------------------------------------------- public string tostring() { string returnstring = ""; (int = 0; < numelements; i++) { returnstring += + ": " + list[i] + "\n"; } homecoming returnstring; } }

and

// *************************************************************** // listtest.java // // simple test programme creates intlist, puts // ints in it, , prints list. // // *************************************************************** import java.util.scanner ; public class listtest { public static void main(string[] args) { scanner scan = new scanner(system.in); intlist mylist = new intlist(10); int count = 0; int num; while (count < 10) { system.out.println("please come in number, come in 0 quit:"); num = scan.nextint(); if (num != 0) { mylist.add(num); count++; } else { break; } } system.out.println(mylist); } }

i need alter add together method sort lowest highest. tried doing.

// (unsorted) integer list class method add together // integer list , tostring method returns contents // of list indices. // // **************************************************************** public class intlist { private int[] list; private int numelements = 0; //------------------------------------------------------------- // constructor -- creates integer list of given size. //------------------------------------------------------------- public intlist(int size) { list = new int[size]; } //------------------------------------------------------------ // adds integer list. if list full, // prints message , nothing. //------------------------------------------------------------ public void add(int value) { if (numelements == list.length) { system.out.println("can't add, list full"); } else { list[numelements] = value; numelements++; (int = 0; < list.length; i++) { if (list[i] > value) { (int j = list.length - 1; j > i; j--) { list[j] = list[j - 1]; list[i] = value; break; } } } (in = 0; < list.length; i++) { } } } //------------------------------------------------------------- // returns string containing elements of list // indices. //------------------------------------------------------------- public string tostring() { string returnstring = ""; (int = 0; < numelements; i++) { returnstring += + ": " + list[i] + "\n"; } homecoming returnstring; } }

the outcome wrong. 1 able steer me in right direction? can sort of see why have doesn't work, can't see plenty prepare it.

so realize not descriptive here first time. exception of add together method modifications code not doing. assignment touch add together method sort array print out smallest largest. beginners class , little no practice tools basic understandings of loops , arrays.

i tried redoing 1 time again , came this:

if(list[numelements-1] > value){ for(int i=0; i<numelements; i++){ if(list[i]>value){ for(int j = numelements; j>i; j-- ){ list[j] = list[j-1]; } list[i] = value; break; } } numelements++; } else { list[numelements] = value; numelements++; }

my input was:8,6,5,4,3,7,1,2,9,10 output was: 1,10,1,9,10,1,1,2,9,10

this thing kicking butt. understand want check input number array , move numbers higher 1 space , come in behind sorted on entry, doing proving hard me. apologize if code on here hard follow formatting little odd on here me , time allows me best. think break not breaking loop thought would. maybe problem.

the biggest bug see using list.length in for loop,

for(int = 0; <list.length; i++)

you have numelements. also, think it's i needs stop 1 before like,

for(int = 0; < numelements - 1; i++)

and

for (int j = numelements; j > i; j--)

java

javascript - Get subtotal of inputs and then add -



javascript - Get subtotal of inputs and then add -

i have fiddle adds total of inputs , changes inputs change. need take business relationship quantity of each item.

so current total $105 should should $235, taking business relationship qty of 3 items $65.

checking out fiddle show mean.

http://jsfiddle.net/4n7k012b/1/

$(document).ready(function () { var sum = 0; //iterate through each textboxes , add together values $("input[class='cmb_text_money']").each(function () { //add if value number if (!isnan(this.value) && this.value.length != 0) { sum += parsefloat(this.value); } }); $("#sum").html(sum.tofixed(2)); $(document).on('keyup',"input[class='cmb_text_money']", function () { var sum = 0; //iterate through each textboxes , add together values $("input[class='cmb_text_money']").each(function () { //add if value number if (!isnan(this.value) && this.value.length != 0) { sum += parsefloat(this.value); } }); $("#sum").html(sum.tofixed(2)); console.log(sum); }); });

here's 1 way that, traversing quantity , multiplying price, storing each sum in array summed @ end

$(document).on('keyup', 'input.cmb_text_money, input.cmb_text_small', function () { var sum = $.map($('input.cmb_text_money'), function(item) { homecoming $(item).closest('tr').prev('tr').find('input').val() * item.value; }).reduce(function(a, b) { homecoming + b; }, 0); $("#sum").html(sum.tofixed(2)); });

fiddle

javascript jquery

javascript - Does node.js memory usage increase as the number of simultaneous requests increase, or is this a leak? -



javascript - Does node.js memory usage increase as the number of simultaneous requests increase, or is this a leak? -

i have next node.js code running:

var http = require('http'); http.createserver(function(req,res){ res.writehead(200,{'content-type': 'text/plain'}); res.write("hello"); res.end(); }).listen(8888);

when start server (by typing node myfile.js), node process using 9mb of memory.

then created next webpage open in several tabs in web browser, simultaneously create requests node:

<html> <head> <script> var ajax = {}; var questions = []; var questionsresponses = []; ajax.x = function() { if (typeof xmlhttprequest !== 'undefined') { homecoming new xmlhttprequest(); } var versions = [ "msxml2.xmlhttp.5.0", "msxml2.xmlhttp.4.0", "msxml2.xmlhttp.3.0", "msxml2.xmlhttp.2.0", "microsoft.xmlhttp" ]; var xhr; (var = 0; < versions.length; i++) { seek { xhr = new activexobject(versions[i]); break; } grab (e) {} } homecoming xhr; }; ajax.send = function(url, callback, method, data, async) { var x = ajax.x(); x.open(method, url, async); x.onreadystatechange = function() { if (x.readystate == 4) { if (x.status == 200) { callback(x.responsetext) } else { //todo } } }; if (method == 'post') { x.setrequestheader('content-type', 'application/x-www-form-urlencoded'); } x.send(data) }; ajax.get = function(url, data, callback, async) { var query = []; (var key in data) { query.push(encodeuricomponent(key) + '=' + encodeuricomponent(data[key])); } ajax.send(url + '?' + query.join('&'), callback, 'get', null, async) }; ajax.post = function(url, data, callback, async) { var query = []; (var key in data) { query.push(encodeuricomponent(key) + '=' + encodeuricomponent(data[key])); } ajax.send(url, callback, 'post', query.join('&'), async) }; var count = 0; function sayhello(){ ajax.get("http://localhost:8888", {}, sayhello, true); var heading = document.getelementbyid("c"); while (heading.firstchild) { heading.removechild(heading.firstchild); } var counttext = document.createtextnode(""+count++); heading.appendchild(counttext); } </script> </head> <body> <h1 id="c"></h1> <script> sayhello();</script> </body> </html>

the memory node using 46.2 mb. increases. every 1 time in while there jump, , continues increase. normal behavior of node when getting many simultaneous requests, or leak ?

edit: seems stable @ 46.4 mb. don't know whether stable because number of requests create limited (since i'm opening multiple tabs in web browser), limitation of laptop. xd

edit: memory increment seems happen if create 1 request @ time (ie. opening 1 tab in web browser). also, after closing windows, memory used doesn't decrease (it remains @ 46.4 mb).

of course of study there proportionality between number of requests , memory usage: every request needs objects (ex.: req, res, ...) handled , every object takes memory. in nodejs applications noted increasing of requests memory increases falls downwards under action of google v8 engine garbage collector efficient. anyway, memory leaks behind corner sure it's not possible speak memory leak memory usage around 50 mb 1 speaking about.

javascript node.js memory-leaks

php - Magento Product and Category page is not working -



php - Magento Product and Category page is not working -

i have hosted magento on windows server, when accessing working fine url anzonline when click menu, category or products home page not working. check url category link when check page working or not check url enter link description here working fine.

i had set configuration -> web -> search engines optimization -> utilize web server rewrites = 'no'.

if have magento on window in case .htaccess file not work. in case url rewrite not work.

try go through document(http://www.magentocommerce.com/boards%20/viewthread/225273/), if want create url rewrite working on windows/iis.

php magento

javascript - Can an event be triggered on a click on a item marker on an html unoredered list? -



javascript - Can an event be triggered on a click on a item marker on an html unoredered list? -

is there way trigger action when user clicks on the icon of item in unordered list? (in javascript and/or jquery)

yes, can target list item marker if wish, requires wrapping contents of each item in tag.

this works because when assign event handler <li> element, element or kid elements trigger handler. within handler can check nodename , tell if <li> clicked or if kid element. since contents wrapped <span> or <div>, list item marker trigger event target beingness <li>.

the next runnable illustration trigger alert when list item markers clicked, otherwise click event ignored.

class="snippet-code-js lang-js prettyprint-override">$("li").on('click', function(e) { if (e.target.nodename === "li") { alert('you clicked list item marker'); } else { e.preventdefault(); //a kid element clicked } }); class="snippet-code-html lang-html prettyprint-override"><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <ul> <li><span>one</span></li> <li><span>two</span></li> <li><span>three</span></li> </ul>

javascript jquery

Java/JavaFX: Set Swing Icon for JavaFX label -



Java/JavaFX: Set Swing Icon for JavaFX label -

i'm trying read thumbnail (icon; 32x32px) file (.ico/.exe) , set javafx label.

my first try:

public icon getlargeicon(string exefile) { if (exefile != null) { file file = new file(exefile); seek { shellfolder sf = shellfolder.getshellfolder(file); homecoming new imageicon(sf.geticon(true), sf.getfoldertype()); } grab (filenotfoundexception e) { e.printstacktrace(); } } homecoming null; }

after i'm doing this:

icon largeicon = getlargeicon(file.getabsolutepath()); imageicon swingimageicon = (imageicon) largeicon; java.awt.image awtimage = swingimageicon.getimage(); image fximage = javafx.scene.image.image.impl_fromplatformimage(awtimage); lblappiconvalue.setgraphic(new imageview(fximage));

i've searched trough several sites , found this, gives me exception: java.lang.unsupportedoperationexception: unsupported class loadplatformimage

my sec try:

url url = file.touri().tourl(); image image = new image(url.tostring()); lblappiconvalue.setgraphic(new imageview(image));

also not working ...

my question: how can set javax.swing.icon javafx label? possible? if it's not possible, how can read thumbnail file , set icon/graphic javafx label?

thanks!

never utilize impl_ methods: these not part of public api.

to convert awt image fx image, swingfxutils class in javafx.embed.swing has tofximage(...) method converts bufferedimage javafx image. it's not clear whether image have icon bufferedimage, you'll need couple of steps create work:

bufferedimage bimg ; if (awtimage instanceof bufferedimage) { bimg = (bufferedimage) awtimage ; } else { bimg = new bufferedimage(awtimage.getwidth(null), awtimage.getheight(null), bufferedimage.type_int_argb); graphics2d graphics = bimg.creategraphics(); graphics.drawimage(awtimage, 0, 0, null); graphics.dispose(); } image fximage = swingfxutils.tofximage(bimg, null);

this inefficient approach, first creating awt image file, converting fx image, perchance via intermediate buffered image. if have access source code shellfolder class, might see how implements geticon() method , follow same process. @ point, must inputstream image data; 1 time have can pass javafx.scene.image.image constructor.

java javafx icons label

Why I'm not recovering in python variables the same counts as SQL from table -



Why I'm not recovering in python variables the same counts as SQL from table -

this first post in stack overflow , i'm trying concise can. have experience in sql i'm starting code python. have weird result getting sql info in python variables , seems i'm doing wrong can't find.

my sqlite table got 26244 row sql query shows:

table = 'datoslaboratorio' sqlquery = "select count(*) %s" % table rows = cursor.execute(sqlquery).fetchone()[0] print(rows) 26244

however when seek summarize table, python not recovering same figures:

sqlquery = "select familia, count(*) num %s grouping familia order familia" % table rows = cursor.execute(sqlquery).fetchall() conn.commit() # sum totals grouped in field 1 (num) count=0 row in rows: count=count+row[1] print(count) 8862

i have verified direct sql query against sqlite gives right figures:

select sum(num) total (select familia, count (*) num datoslaboratorio grouping familia) total 26244

worse, when seek info in dataframe using pandas, don't same counts, seems pandas reads in 33 valid rows, have values in 26244 records:

sqlquery = "select * %s" % table df = pd.read_sql (sqlquery,conn) conn.commit() df.count() id 33 seccion 0 fecha 33 familia 33 codigo 33 extractoseco 33 materiagrasa 33 sal 33 ph 33 observaciones 33 phsalmuera 0 temperaturasalmuera 4 densidadsalmuera 4

what missing? give thanks in advance help!

@hrabal: adding output

this sql output of query on sqlite:

select familia, count (*) num datoslaboratorio grouping familia recno familia num 1 cabra barra tierno 297 2 cabra madurado 3 kg 29 3 cabra madurado mini 44 4 cabra tierno 3 kgs 140 5 cabra tierno barra 4,2 50 6 cabra tierno mini 258 7 gran capitan 3 kgs 2 8 madurado 3 kg sl 2588 9 madurado 3 kgs iqm 315 10 madurado 3 kgs s/lis 308 11 madurado 3kg cl 1229 12 madurado barra 1585 13 madurado barra 4,2 523 14 madurado barra iqm 60 15 madurado barra iqm 4,2 41 16 madurado mini 1393 ... 50 tierno mini iqm 142 51 tierno mini lite 572 52 tierno pÑo 323 53 tierno pÑo iqm 2124 54 tierno soja 3 kgs 3 55 tierno soja barra 14 56 tierno soja mini 4

so result 56 rows info grouped "familia", , sum("num") = 26244

when print python, doesn't seems read data:

sqlquery = "select familia, count(*) num %s grouping familia order familia" % table rows = cursor.execute(sqlquery).fetchall() conn.commit() columns = [column[0] column in cursor.description] print(columns) row in rows: print (row[0],row[1]) ['familia', 'num'] cabra barra tierno 297 cabra madurado 3 kg 29 cabra madurado mini 44 cabra tierno 3 kgs 140 cabra tierno barra 4,2 50 cabra tierno mini 258 gran capitan 3 kgs 2 madurado 3 kg sl 2588 madurado 3 kgs iqm 315 madurado 3 kgs s/lis 308 madurado 3kg cl 1229 madurado barra 1585 madurado barra 4,2 523 madurado barra iqm 60 madurado barra iqm 4,2 41 madurado mini 1393

that's info python reading in, apparently: 16 first lines, or @ to the lowest degree not able rest of info in. should reading 56 rows. , pandas doesn't read info neither.

all can think problem in .fetchall().. since python giving first 16 rows, fetchall() not working seek using .fetchone() (if have little dataset) or generator .fetchmany():

def resultgenerator(cursor, arraysize=8): while true: results = cursor.fetchmany(arraysize) if not results: break result in results: yield result cursor = con.cursor() sqlquery = "select familia, count(*) num %s grouping familia order familia" % table cursor.execute(sqlquery) row in resultgenerator(cursor): print (row[0],row[1])

this way python fetch 8 rows @ time, consuming less memory (maybe it's here problem?).

try play arraysize variable see if change.

resources: python generators fun

python sql pandas

loops - How can I make a checkerboard with variable size out of text in C++? -



loops - How can I make a checkerboard with variable size out of text in C++? -

how can create checkerboard variable size out of text? can create checkerboard consisting of single characters using code:

#include <iostream> using namespace std; int main() { char c; int length; int width; int count = 0; int n; int row = 0; int col = 0; cout << "input c" << endl; cin >> c; cout << "input length" << endl; cin >> length; cout << "input width" << endl; cin >> width; cout << "input n" << endl; cin >> n; (row = 0; row < n; ++row) { if (row % 2 == 1) { (count = 0; count < length; count++) { { cout << "-"; } cout << ""; } } (col = 0; col < n; ++col) { (count = 0; count < length; count++) { { cout << c; } cout << ""; } if (col != n) { (count = 0; count < length; count++) { { cout << "-"; } cout << ""; } } } cout << endl; } printf("\n"); }

but gives me output of single characters, how added varying "block" sizes equation?

for examaple, given character (c), length (l), width (w), , size (n), write c++ programme draw board of size (2n x 2n) consisting of cells filled character c, length of l, , width of w. board cells have painted chess board

assume c = ‘&’, l = 4, w = 6, , n = 3

the output (without border lines)

honestly, tried through code , find mistakes, ended rewriting problem scratch. it's nested loops, , need quite of them fine-grained control.

the code did trick me (i hope comments helpful):

#include <iostream> int main(){ // our variables char c; int l, w, n; // take parameters standard input std::cin >> c >> l >> w >> n; // loop on coarse rows for(int row = 0; row < 2*n; row++){ // loop on fine rows for(int smallrow = 0; smallrow < l; smallrow++){ // loop on coarse columns for(int col = 0; col < 2*n; col++){ // loop on fine columns for(int smallcol = 0; smallcol < w; smallcol++){ // if col , row both or uneven, color if(row % 2 == col % 2){ std::cout << c; }else{ std::cout << " "; } } } // end of little row, need new line std::cout << std::endl; } } homecoming 0; }

compiling g++ -o main main.cpp , executing parameters, illustration echo "x 3 5 2" | ./main gives me nice result:

xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx

c++ loops text

asp.net mvc - Ignore "Display" attributes in Razor View -



asp.net mvc - Ignore "Display" attributes in Razor View -

i'm trying acheive dry principle using oop view models:

public class itembase { [display(name = "description - displayed in list (so create meaningful)")] [required] public string description { get; set; } [display(name = "username")] [required] public string username { get; set; } [display(name = "optional secondary credential")] public string secondcredential { get; set; } [display(name = "location - ideally url")] [required] public string location { get; set; } [display(name = "additional notes")] public string notes { get; set; } } public class itemdisplay : itembase { [required] public int32 itemid { get; set; } public applicationuser creator { get; set; } } public class itemedit : itembase { [required] public int32 itemid { get; set; } } public class itemadd : itemase { [required] public int32 parent_categoryid { get; set; } }

this work great... however, when want utilize itemdisplay class display info in view, displays display attribute data. how view ignore these without putting of members itemdisplay class without display attrbute?

view code

<article class="first"> <h2>details</h2> <div class="form-horizontal toppaddding"> <div class="form-group"> @html.labelfor(model => model.viewitem.description, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.raw(model.viewitem.description) </div> </div> <div class="form-group"> @html.labelfor(model => model.viewitem.username, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.raw(model.viewitem.username) </div> </div> <div class="form-group"> @html.labelfor(model => model.viewitem.secondcredential, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.raw(model.viewitem.secondcredential) </div> </div> <div class="form-group"> @html.labelfor(model => model.viewitem.password, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.raw(model.viewitem.password) </div> </div> <div class="form-group"> @html.labelfor(model => model.viewitem.location, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.raw(model.viewitem.location) </div> </div> <div class="form-group"> @html.labelfor(model => model.viewitem.notes, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.raw(model.viewitem.notes) </div> </div> </div> </article>

the html.labelfor helper first looks display dataannotation , if there not one, default outputting name of property in class.

if not want utilize display info annotation in particular view, don't utilize html.labelfor helper , instead either create own label tag or output whatever before <div> containing model data.

<div class="form-group"> <label class = "control-label col-md-2">alternate description label text</label> <div class="col-md-10"> @html.raw(model.viewitem.description) </div> </div>

in case, not creating input form, may think using span instead of label.

asp.net-mvc razor

python - Create scrollbar only when text length greater than text area -



python - Create scrollbar only when text length greater than text area -

here simple code:

from tkinter import * tkinter import ttk rootwin = tk() roomtext = text(rootwin) roomtext.pack(side = 'left', fill = "both", expand = true) rtas = ttk.scrollbar(roomtext, orient = "vertical", command = roomtext.yview) rtas.pack(side = "right" , fill = "both") roomtext.config(yscrollcommand = rtas.set) rootwin.mainloop()

as such, default scrollbar appears straight away. how possible create scrollbar appear 1 time text entered greater text area?

so when run code, first, scrollbar must not show. when plenty text entered scrollbar shows (i.e. text in roomtext longer roomtext area).

maybe code looking (changed pack grid i'm more familiar it... should able revert if want):

from tkinter import * tkinter import ttk rootwin = tk() roomtext = text(rootwin) roomtext.grid(column=0, row=0) def create_scrollbar(): if roomtext.cget('height') < int(roomtext.index('end-1c').split('.')[0]): rtas = ttk.scrollbar(rootwin, orient = "vertical", command = roomtext.yview) rtas.grid(column=1, row=0, sticky=n+s) roomtext.config(yscrollcommand = rtas.set) else: rootwin.after(100, create_scrollbar) create_scrollbar() rootwin.mainloop()

it checks if needs create scrollbar 10 times every second. additional changes can create remove scrollbar when no longer needed (text short):

from tkinter import * tkinter import ttk rootwin = tk() roomtext = text(rootwin) roomtext.grid(column=0, row=0) rtas = ttk.scrollbar(rootwin, orient = "vertical", command = roomtext.yview) def show_scrollbar(): if roomtext.cget('height') < int(roomtext.index('end-1c').split('.')[0]): rtas.grid(column=1, row=0, sticky=n+s) roomtext.config(yscrollcommand = rtas.set) rootwin.after(100, hide_scrollbar) else: rootwin.after(100, show_scrollbar) def hide_scrollbar(): if roomtext.cget('height') >= int(roomtext.index('end-1c').split('.')[0]): rtas.grid_forget() roomtext.config(yscrollcommand = none) rootwin.after(100, show_scrollbar) else: rootwin.after(100, hide_scrollbar) show_scrollbar() rootwin.mainloop()

python python-3.x tkinter

RSpec can't see Rails models -



RSpec can't see Rails models -

i have rspec specification:

require 'spec_helper' describe 'session_project' before(:each) @user = user.create( username: 'user', password: 'test', password_confirmation: 'test', email: 'user@example.com' ) @project = project.create(name: 'project 1', active: true, user_id: @user.id) end context 'when on project page project 1' 'knows current project project 1' pending end end end # , on.

user , project models of course of study - want test current project beingness saved , cleared session @ right times. when run rspec, complains:

failure/error: @user = user.create( nameerror: uninitialized constant user

if cut-and-paste user.create rails console creates user fine.

previous people have asked similar problems needed add together require 'spec_helper', i've done that. how create rails models available rspec?

under rspec 3.x need rails_helper if want rails classes loaded up.

https://www.relishapp.com/rspec/rspec-rails/docs/upgrade#default-helper-files

ruby-on-rails-4 rspec

java - Issue with XSLT Transformation using WSO2 ESB -



java - Issue with XSLT Transformation using WSO2 ESB -

i struggling xslt transformer mediator using xslt mediator in wso2 esb 4.8.1. xslt :

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:ns="http://ep.service.ims.com" xmlns:ax21="http://ep.service.ims.com/xsd" exclude-result-prefixes="ns fn"> <xsl:param name="amount"/> <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/> <xsl:template match="/"> <xsl:apply-templates select="//ns:getresponse" /> </xsl:template> <xsl:template match="ns:getresponse" xmlns:ns="http://ep.service.ims.com"> <ep:credit xmlns:ep="http://ep.service.ims.com" xmlns:xsd="http://ep.service.ims.com/xsd"> <ep:info> <xsd:amount> <xsl:value-of select="$amount"/> </xsd:amount> <xsd:personinfo> <xsd:address> <xsl:value-of select="ns:return/ax21:address"/> </xsd:address> <xsd:id> <xsl:value-of select="ns:return/ax21:id"/> </xsd:id> <xsd:name> <xsl:value-of select="ns:return/ax21:name"/> </xsd:name> </xsd:personinfo> </ep:info> </ep:credit> </xsl:template> </xsl:stylesheet>

and request xml :

<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:body> <ns:getresponse xmlns:ns="http://ep.service.ims.com"> <ns:return xsi:type="ax23:personinfo" xmlns:ax23="http://ep.service.ims.com/xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <ax23:address>ims heath, omega c, india, bnag</ax23:address> <ax23:id>100</ax23:id> <ax23:name>wso2</ax23:name> </ns:return> </ns:getresponse> </soapenv:body> </soapenv:envelope>

i tried xslt transformation in eclipse , online tool (http://xslt.online-toolz.com/tools/xslt-transformation.php ) , working fine. when trying same in wso2 esb, facing next exception.....

org.apache.synapse.mediators.transform.xsltmediator} - fatal error occurred in stylesheet parsing : net.sf.saxon.trans.xpathexception: supplied file not appear stylesheet value {name ='null', keyvalue ='xslt1'} {org.apache.synapse.mediators.transform.xsltmediator} javax.xml.transform.transformerconfigurationexception: failed compile stylesheet. 1 error detected. @ net.sf.saxon.preparedstylesheet.prepare(preparedstylesheet.java:220) org.apache.synapse.core.axis2.synapsecallbackreceiver.receive(synapsecallbackreceiver.java:170) @ org.apache.axis2.engine.axisengine.receive(axisengine.java:180) @ org.apache.synapse.transport.passthru.clientworker.run(clientworker.java:225) tid: [0] [esb] [2014-10-08 13:53:20,705] error {org.apache.synapse.mediators.transform.xsltmediator} - unable perform xslt transformation using : value {name ='null', keyvalue ='xslt1'} against source xpath : s11:body/child::*[position()=1] | s12:body/child::*[position()=1] reason : error creating xslt transformer using : value {name ='null', keyvalue ='xslt1'} {org.apache.synapse.mediators.transform.xsltmediator} org.apache.synapse.synapseexception: error creating xslt transformer using : value {name ='null', keyvalue ='xslt1'} @ org.apache.synapse.mediators.abstractmediator.handleexception(abstractmediator.java:313) caused by: javax.xml.transform.transformerconfigurationexception: failed compile stylesheet. 1 error detected.

the synapse proxy xml is:

<?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="creditproxy" transports="https http" startonload="true" trace="disable"> <target> <insequence> <log level="full"> <property name="sequence" value="insequence - request creditproxy"/> </log> <property xmlns:pep="http://com.ims.proxy" name="org_id" expression="//pep:credit/pep:id"/> <property xmlns:pep="http://com.ims.proxy" name="org_amount" expression="//pep:credit/pep:amount"/> <enrich> <source type="inline" clone="true"> <pep:get xmlns:pep="http://ep.service.ims.com"> <pep:id>?</pep:id> </pep:get> </source> <target type="body"/> </enrich> <enrich> <source type="property" property="org_id"/> <target xmlns:pep="http://ep.service.ims.com" xpath="//pep:get/pep:id"/> </enrich> <log level="full"> <property name="sequence" value="insequence - request personinfoservice"/> </log> <property name="state" value="person_info_request"/> <send> <endpoint key="personinfoepr"/> </send> </insequence> <outsequence> <switch source="get-property('state')"> <case regex="person_info_request"> <log level="full"> <property name="sequence" value="outsequence - state 01 - response personinfoservice"/> </log> <xslt key="xslt"> <property name="amount" expression="get-property('org_amount')"/> </xslt> <log level="full"> <property name="sequence" value="outsequence - state 01 - request creditservice"/> </log> <property name="state" value="credit_request"/> <send> <endpoint key="creditepr"/> </send> </case> <case regex="credit_request"> <log level="full"> <property name="sequence" value="outsequence - state 02 - response creditservice"/> </log> <send/> </case> </switch> </outsequence> </target> <publishwsdl uri="file:resources/creditproxy.wsdl"/> </proxy>

what may cause of exception if xslt transformation working fine in other tool ?

the key in proxy correct. might have pasted wrong xml proxy,

here proxy:

<?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="creditproxy" transports="https,http" statistics="disable" trace="disable" startonload="true"> <target> <insequence> <log level="full"> <property name="sequence" value="insequence - request creditproxy"/> </log> <property xmlns:pep="http://com.ims.proxy" name="org_id" expression="//pep:credit/pep:id"/> <property xmlns:pep="http://com.ims.proxy" name="org_amount" expression="//pep:credit/pep:amount"/> <enrich> <source type="inline" clone="true"> <pep:get xmlns:pep="http://ep.service.ims.com"> <pep:id>?</pep:id> </pep:get> </source> <target type="body"/> </enrich> <enrich> <source type="property" clone="true" property="org_id"/> <target xmlns:pep="http://ep.service.ims.com" xpath="//pep:get/pep:id"/> </enrich> <log level="full"> <property name="sequence" value="insequence - request personinfoservice"/> </log> <property name="state" value="person_info_request"/> <send> <endpoint key="personinfoepr"/> </send> </insequence> <outsequence> <switch source="get-property('state')"> <case regex="person_info_request"> <log level="full"> <property name="sequence" value="outsequence - state 01 - response personinfoservice"/> </log> <xslt key="xslt1"> <property name="amount" expression="get-property('org_amount')"/> </xslt> <log level="full"> <property name="sequence" value="outsequence - state 01 - request creditservice"/> </log> <property name="state" value="credit_request"/> <send> <endpoint key="creditepr"/> </send> </case> <case regex="credit_request"> <log level="full"> <property name="sequence" value="outsequence - state 02 - response creditservice"/> </log> <send/> </case> </switch> </outsequence> </target> <publishwsdl uri="file:resources/creditproxy/creditproxy.wsdl"/> <description/> </proxy>

local entry:

<localentry xmlns="http://ws.apache.org/ns/synapse" key="xslt1" src="file:resources/creditproxy/persontocredit.xslt"></localentry>

java xml xslt wso2

uinavigationcontroller - iOS navigation best practice for adding items -



uinavigationcontroller - iOS navigation best practice for adding items -

i cannot find reply although have implemented rather few times already, maybe wrong way.

say have app ios, has main screen, goes list, list has < (to main) , add together button. when click < back, go main that's pop() stack. no issues far.

now when click add together button, added stack well; when click on screen go list fine.

the problem is; when save new item, want go detail screen, don't want have add together screen on stack anymore while there. want < button detail item pointing list.

i know how this, best implement navigation stack?

well adding elements best practice nowadays modalviewcontroller. in way not added stack.

update

let's take examples simple apps apple provide ios, contacts app. when want add together new contact vc presented. you'll need implement "done" or "save" button dismiss modalviewcontroller , if want take user detail screen post notification or other mechanism on dismissviewcontroller method's completion block force detail page list. careful on animations if dismiss modal vc animated , force detail page animated unexpected behaviour. proposal dismiss modal vc animated , force detail page without animation.

ios uinavigationcontroller

Android adb shell command to play sound from the command line -



Android adb shell command to play sound from the command line -

i have set of rooted android devices can access through adb on tcp/ip. trying identify specific 1 playing sound command line (one of .ogg files /system/media/audio).

i know build app feels overkill utilize apk, , i'm hoping there more native way. know how start intents command line.

things have tried :

investigated using service phone call media.player not find useful reference syntax. can see dumpsys media.player references awesomeplayer couln't going. tried find compiled version of "/system/bin/media" android source code, missing device, without luck far. tried build command line java app phone call android.media.mediaplayer dalvikvm knowledge of android , java limited (class compiled complained missing dependencies @ runtime)

any ideas?

after trial , error, reply working me.

based on other threads, found next java code bare minimum play sound through speaker. mediaplayer class seems 1 play no user interaction, others need real activity context...

class="lang-java prettyprint-override">public class beep { public static void main(string[] a) { mediaplayer mp = new mediaplayer(); seek { mp.setdatasource("/system/media/audio/alarms/ticktac.ogg"); mp.prepare(); mp.start(); } grab (ioexception e) { log.w("beep", "ioexception", e); } }

(actual working illustration here)

this must compiled dex file, linked android.jar, , can run adb shell command line using app_process (not dalvikvm) :

class="lang-sh prettyprint-override">export classpath=./beep.dex app_process /system/bin beep /system/media/audio/ringtones/beep-beep.ogg

it not one-liner hoping needed...

android adb

c++ - Catch exception in boost::property_tree::read_xml -



c++ - Catch exception in boost::property_tree::read_xml -

i'm trying grab exceptions raised boost::property_tree::xml_parser::read_xml. here illustration program:

#include <iostream> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xml_parser.hpp> int main(int argc, char** argv){ boost::property_tree::ptree pt; std::cout<<"123123"<<std::endl; try{ std::cout<<"reading "<<argv[1]<<std::endl; read_xml(argv[1], pt); } catch(const boost::property_tree::xml_parser::xml_parser_error& ex){ std::cout<<argv[1]<<" failed, reading "<<argv[2]<<std::endl; read_xml(argv[2], pt); } }

the output is:

123123 reading 123.xml [1] 97028 abort ./a.out 123.xml 345.xml

what doing wrong? exception isn't caught. tried grab every thing via (...) , grab std::exception boost::exception. in cases result same. according boost documentation xml_parser_error should thrown. boost version 1.54.

a little update: when don't seek execute read_xml("notavalidfilepath",pt), get

terminate called after throwing instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::property_tree::xml_parser::xml_parser_error> >' what(): 123.xml: cannot open file

and when run gdb get:

reading terminate called after throwing instance of 'boost::exception_detail::clone_impl< boost::exception_detail::error_info_injector< boost::property_tree::xml_parser::xml_parser_error> >' what(): path=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/x11/bin:/usr/local/macgpg2/bin:/opt/local/bin:/usr/texbin:/users/weidenka/bin: cannot open file programme received signal sigabrt, aborted. 0x00007fff8a31b866 in __pthread_kill () #0 0x00007fff8a31b866 in __pthread_kill () #1 0x00007fff86c9f35c in pthread_kill () #2 0x00007fff86240b1a in abort () #3 0x00000001005547d5 in __gnu_cxx::__verbose_terminate_handler ()

thanks in advance!

best wishes, peter

this problem:

read_xml(argv[2], pt);

the fallback read operation not guarded against throwing exception, when exception occurs @ point programme terminates without flushing iostreams buffers.

c++ boost

android - how do i make a timer continue counting down after the app stopped? -



android - how do i make a timer continue counting down after the app stopped? -

i have class has method has timer within it. when method called timer starts , goes on forever when app closed stops , not count downwards when app reopened. there way check if timer ticking before , create tick shared preferences or something? dont know.

so how create timer go on counting downwards after app stopped?

method below

public int shipadd() { if (counter >= addspend) {

counter -= addspend; addspend += addspend; counterpersec +=addamount; addclick += addclick; test++; // count downwards timer below new timerclass(addtime, 1000) { public void onfinish() { counter += addamount; this.start(); } }.start(); } else if (counter < addspend) { } homecoming addspend;

}

a great way using service.

public class countdowntimer extends service{ @override public ibinder onbind(intent intent) { // todo auto-generated method stub homecoming null; } @override public void oncreate() { //enter timer code here } }

in class want start service,use start service.

in activity:

startservice(new intent(getapplicationcontext(), countdowntimer.class));

in fragment

getactivity().startservice(new intent(getactivity(), countdowntimer.class));

update manifest line

<service android:name=".countdowntimer" ></service>

android timer

java - Android- Dexopt error -



java - Android- Dexopt error -

i create project in android studio utilize .so files. made error , changed .so files in project. have similar project in eclipse , re-create .so files android studio lib jnilib , meseege get:

installation failed since device perchance has stale dexed jars don't match current version (dexopt error) in order procceed, hava uninstall existing application

i remmember when import project android studio them maybe related..

if knows helpful.

i tried wipe thing.. dont related in case.

thanks

the solution import .so file tools of android studio , dont re-create file. think when imported android studio tools added lines gradle file.

java android android-ndk android-studio

How to modify the default button state in Android Studio using selector tag? -



How to modify the default button state in Android Studio using selector tag? -

android studio show me: element selector must declared,why?

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/rd_btn_press" android:state_pressed="true" /> <item android:drawable="@drawable/rd_btn" android:state_focused="true" /> <item android:drawable="@drawable/rd_btn" /> </selector>

make sure have file in res/drawable folder. seems me have in other folder in android project. please comment if that's not case.

android

firefox os - Unable to build gaia from git in windows. Getting "Makefile:671: recipe for target 'preferences' failed" -



firefox os - Unable to build gaia from git in windows. Getting "Makefile:671: recipe for target 'preferences' failed" -

i trying build , deploy gaia build git repo in windows. trying deploy in অ flame. trying in windows 7 cygwin installed. after installing error getting

this works fine in linux machine, need in windows since right have access only.

any pointers doing wrong here?

i'm afraid it's not going work without important effort several reasons. much improve utilize vm linux on if did work really slow. windows slow @ handling lots of file access , cygwin slows downwards more.

for illustration in making simple alter config.sh (full stack build) works on cygwin found took hours run (on decent pc). , had couple of corrupt git repos had hand fix.

i looked @ getting gaia's create work, stopped after problem got bigger.

here's found future reference

the build not portable, expects linux environment while cygwin gives linux emulation of tools run win32 native , handling path conversion them requires not trivial changes due assumptions. illustration can switch win32 xpcshell , hack command line paths utilize cygpath, environment variable source of dependency in js scripts , unix paths. ( did manage part). these path , environment dependencies magnified c build chain , other tools. you need alter mount utilize noacl or else cygwin attaches acls simulate file properties, breaking things. it's might little faster without acls i tried mingw provides native versions without emulation should faster. falls short of requirements , automatic path conversion heuristics in way. you need turn of antivirus prog slow down. in fact first time used old firefox windows build crash after long time. turned out mem leak in av :(

so all-in-all it's much hassle in terms of dev time convert , maintain. true windows build improve it's easy these days run vm. can share directories between invitee , host flash windows.

makefile firefox-os gaia