Sunday, 15 April 2012

asp.net - File count from web folder in C# -



asp.net - File count from web folder in C# -

how count total file website folder?

string uri = "http://company.co.id/folder/" public int counttotalfile(string uri) { ... homecoming total; }

sorry, have no thought , can't provide website url.

thanks in advance.

agree reply "it's not possible list of files via http" here add together comments different method access folder "crawler".

is possible simulate crawler check of links in company's folder shared in website?

if meet file, must contains suffix like: *.exe, *.txt , etc. check string , count it.

i supply methods information, hopes can help prepare issue :).

c# asp.net .net directory

node.js - npm error-npm not found in terminal -



node.js - npm error-npm not found in terminal -

please help me clear error

apples-mac-mini:bin apple$ curl -l http://npmjs.org/install.sh | sh % total % received % xferd average speed time time time current dload upload total spent left speed 100 193 100 193 0 0 244 0 --:--:-- --:--:-- --:--:-- 471 100 6711 100 6711 0 0 431 0 0:00:15 0:00:15 --:--:-- 5456 sh: line 20: npm-install-3294.sh: permission denied sh: npm-install-3294.sh: no such file or directory rm: npm-install-3294.sh: no such file or directory

curl -l http://npmjs.org/install.sh | sudo sh

note sudo in front. errors due installer trying re-create files scheme folders, requiring administrative permissions.

also, not need install npm, included in latest node.js versions. install node.js on macos, refer their official site.

node.js

php - Codeigniter search engine system using multi filter keyword -



php - Codeigniter search engine system using multi filter keyword -

i'm building own book library management scheme using codeigniter. stuck when want buil search engine using filtered keyword. have 4 tables (books, publisher, category, format) , utilize bring together retrieve data. results not excepted. below show codes:

// table construction books |book_id, publisher_id, cat_id, format_id, title, author, ... etc| publisher |publisher_id, publisher, address| category |cat_id, category, description| format |format_id, format| // model public function findbooks ( $keyword, $publisher, $category, $format, $offset, $limit ) { $this->db->select('*'); $this->db->join('publisher p', 'b.publisher_id=p.publisher_id', 'left'); $this->db->join('category c', 'b.cat_id=c.cat_id', 'left'); $this->db->join('format f', 'b.format_id=f.format_id', 'left'); if(!empty($keyword)) { $this->db->like('b.title', $keyword); $this->db->like('p.publisher', $publisher); $this->db->or_like('c.category', $category); $this->db->or_like('f.format', $format); } $this->db->order_by('book_id', 'asc'); $getdata = $this->db->get('books b', $offset, $limit); if($getdata->num_rows() > 0) { homecoming $getdata->result(); } else { homecoming null; } } public function getpublishers() { $query = $this->db->query("select * publisher order publisher_id asc"); homecoming $query; } public function getcategories() { $query = $this->db->query("select * category order cat_id asc"); homecoming $query; } public function getformat() { $query = $this->db->query("select * format order format_id asc"); homecoming $query; } // books controller public function find($keyword='', $offset = '', $limit = 3;) { if($this->uri->segment(3) === false){ $offset = 0; }else{ $offset = ($this->uri->segment(3)-1) * $limit; } $keyword = mysql_real_escape_string($this->input->post('term')); $publisher = $this->input->post('publisher_id'); $category = $this->input->post('cat_id'); $format = $this->input->post('format_id'); $check = $this->adminmodel->findbooks( $keyword, $publisher, $category, $format, $offset, $limit ); if($check) { $data['message'] = ""; $data['res'] = $check; $this->load->view('search_result', $data); } else { $data['message'] = "<div class='alert alert-warning'>no result. please seek keyword.</div>"; $this->load->view('search_result', $data); } } // form view <div> <h4>find books</h4> <form action="<?php base_url(); ?>books/find" method="post" class="form-horizontal" role="form"> <div class="input-group input-group col-md-12"> <label for="term" class="sr-only"></label> <input type="text" class="form-control" name="term" placeholder="enter keyword"> </div> <div class="input-group col-md-12"> <label for="publisher">by publisher</label> <select name="publisher" id="publisher" class="form-control"> <option value="0">all</option> <?php foreach ($pub->result() $p) { ?> <option value="<?php echo $p->publisher_id; ?>"<?php echo set_select('publisher_id', $p->publisher_id, (!empty($data) && $data == $p->publisher_id ? true : false )); ?>><?php echo ucwords($p->publisher); ?></option> <?php ; } ?> </select> </div> <div class="input-group col-md-12"> <label for="category">by category</label> <select name="category" id="category" class="form-control"> <option value="0">all</option> <?php foreach($cats->result() $cat){ ?> <option value="<?php echo $cat->cat_id; ?>"<?php echo set_select('cat_id', $cat->cat_id, (!empty($data) && $data == $cat->cat_id ? true : false )); ?>><?php echo ucwords($cat->category); ?></option> <?php } ?> </select> </div> <div class="input-group col-md-12"> <label for="format">by format</label> <select name="format" id="format" class="form-control"> <option value="0">all</option> <?php foreach ($format->result() $frm) { ?> <option value="<?php echo $frm->format_id; ?>"><?php echo set_select('format', $frm->format_id, (!empty($data) && $data == $frm->format_id ? true : false )); ?><?php echo ucwords($frm->format); ?></option> <?php ; } ?> </select> </div> <div class="input-group col-md-12"> <button type="submit" class="btn btn-success">find</button> </div> </form> </div>

here except is, instance, search term "adam" , might name of person, publisher, or part of title. so, if search keyword "adam" , filtered publisher, show result such adam publishing rather "history of adam , eve" (as book title).

another question, getting wrong in code? if so, give me direction should be.

best regards

php mysql codeigniter relational-database

latex - How to change font size without affecting TOC? -



latex - How to change font size without affecting TOC? -

i'm writing study in latex , made table of contents. in text, increment font size of chapters, , sections. actually, utilize :

\chapter{\large blah blah blah} \section{\normalsize blih blih blih}

but write "blah blah blah" in \large, , "blih blih blih" in \large. if that, changes font size in toc...

use sectsty package. see more details here: change size of section, subsection, subsubsection, paragraph , subparagraph title.

if sectsty doesn't work you, , can't find bundle work, can modify .cls file alter default font size of these elements.

another alternative quick hack setting \def\large{} \def\normalsize{} above \tableofcontents:

{\def\large{} \def\normalsize{} \tableofcontents}

latex toc

pgadmin - PostgreSQL : what are simple quotation marks for? -



pgadmin - PostgreSQL : what are simple quotation marks for? -

how remove simple quotation marks appear in empty cells? see image below

the columns can either text or character varying(), these signs still present. have other tables no quotation marks in empty cells... extract above result of importation of oracle table pgsql database. reason why.

my guess importation process introduced single quotes. if query solves it

select num_position, replace(num_position, '''', '') t;

then replace single quotes

update t set num_position = replace(num_position, '''', ''), num_plan = replace(num_plan, '''', '')

postgresql pgadmin quotation-marks

cabasicanimation - how to repeat animation forever in Swift (HUGE_VALF)? -



cabasicanimation - how to repeat animation forever in Swift (HUGE_VALF)? -

according docs, way repeat cabasicanimation forever set repeatcount huge_valf.

but in swift, huge_valf causes compile error. swift doesn't seem know standard library (or wherever constant resides).

what do now?

set repeatcount float.infinity. compiles , works.

in probability, huge_valf legacy value in case.

still, it's bit of surprise these numeric constant names not seen swift. did seek importing <stdlib.h> in bridging header didn't help.

swift cabasicanimation

URL Rewrite/Mod Rewrite .htaccess on Apache and PHP -



URL Rewrite/Mod Rewrite .htaccess on Apache and PHP -

i have single point of entry on website

mysite.com/admin/index.php?view=list&model=user

all access db/application through index.php file.

i clean url shown above to.

mysite.com/admin/list/user

the thought remove key 'model , 'view'.

i have found link looks similar.

php/apache: rewrite rules .htaccess

in htaccess file insert code :

rewriteengine on rewriterule ^admin/([^/]*)/([^/]*)$ /admin/index.php?view=$1&model=$2 [l]

the rewritten url:

http://mysite.com/admin/list/user

this site useful generate rewrite url

http://www.generateit.net/mod-rewrite/

php apache url-rewriting

bash - how to make a simple if statement is too long? -



bash - how to make a simple if statement is too long? -

this first bash script, info want time each hr of info reduction, created bash script running, think long utilize statement "if ... else", perchance loops for, while , until?

#!/bin/bash x=$(date +"%h") y=$(sed -n "/end_time/=" file.txt) if [ $x = 00 ]; s=$(($y-24)) echo "this time 00:00" elif [ $x = 23 ]; s=$(($y-1)) echo "this time 23:00" elif [ $x = 22 ]; s=$(($y-2)) echo "this time 22:00" elif [ $x = 21 ]; s=$(($y-3)) echo "this time 21:00" elif [ $x = 20 ]; s=$(($y-4)) echo "this time 20:00" . . . elif [ $x = 01 ]; s=$(($y-23)) echo "this time 01:00" else echo "this time not data" fi z=$(awk 'nr=='$s' {print $0}' file.txt) #print echo "time : " $x echo "line end_time : " $y echo "show line info : " $z

this sample info file.txt :

0 3419973 1 2302205 2 1535190 3 1045063 4 895020 5 1275980 . . . . 21 6953924 22 6423911 23 5075690 end_time

if want info in "file.txt" when @ 21:00, print:

time : 21:00 line end_time : 24 show line info : 21 6953924 *(i looking this)*

this run cron. if can help me?

i think can cut down cases to:

case $x in 24) s = $(($y-1)) echo "this time 00:00" ;; 23 | 22 | ... | 01) # or [01][0-9] | 2[0-3]) s = $(($y - 25 + $x)) echo "this time $x:00" ;; *) echo "this time not data" ;; esac

bash shell if-statement

javascript - open multiple links in chrome at once as new tabs -



javascript - open multiple links in chrome at once as new tabs -

i came across in opening multiple links @ 1 time in google chrome in new tab failed.

problems: 1. blocked popup 2. open in new windows instead of tab after user allowed popup

with http://plnkr.co/edit/zvaefssh4o4qdycsungd?p=preview i'm able open multiple links @ 1 time in ff.

i thought of giving came across find way in https://chrome.google.com/webstore/detail/linkclump/lfpjkncokllnfokkgpkobnkbkmelfefj?hl=en

i tried utilize setinterval seek open links 1 1 didn't work.

you can in vanilla javascript:

<html> <head> <script type="text/javascript"> function open_win() { window.open("http://www.java2s.com/") window.open("http://www.java2s.com/") } </script> </head> <body> <form> <input type=button value="open windows" onclick="open_win()"> </form> </body> </html>

here more chrome-specific implementation (if popup blockers giving difficulty):

var linkarray = []; // links (var = 0; < linkarray.length; i++) { // open each link in current window chrome.tabs.create({ url: linkarray[i] }); }

here documentation: https://developer.chrome.com/extensions/tabs

javascript jquery angularjs google-chrome

c - Flow handling in interrupt driven UART - ATMEGA328P -



c - Flow handling in interrupt driven UART - ATMEGA328P -

i'm trying implement interrupt driven uart communication atmega328p. need accomplish sending commands (char arrays) on uart in order extract values variables in main routine can program behaviour in circuit.

the info i'm sending has format: 2 255 0 255 0 0 255 1000 (it's rgb led lamp) describes long int values mode, 2 rgb colors , duration.

so far have in main:

while(1) { if(rxflag==1){ char * pend; mode = strtol(buffer,&pend,10); ri = strtol (pend, &pend,10); gi = strtol (pend, &pend,10); bi = strtol (pend, &pend,10); rf = strtol (pend, &pend,10); gf = strtol (pend, &pend,10); bf = strtol (pend, &pend,10); duration = strtol (pend,null,10); rxflag=0; } switch(mode){ case 1: // fixed color fixed(rf, gf, bf); break; case 2: // yoyo pulse yoyo(ri,gi,bi,rf,gf,bf,duration); break; default:// reddish blinky fixed(0,255,255); _delay_ms(500); fixed(255,255,255); _delay_ms(500); break; } }

and isr (interrupt service routine) handles reception:

isr(usart_rx_vect) { while ( !(ucsr0a & (1<<rxc0)) ); if (rxn==80){ // if buffer_size reached, reset start of buffer. rxn=0; } buffer[rxn++] = udr0; // increment rxn , homecoming new value. if(buffer[rxn]=='\0'){ rxflag=1; // notify main of receipt of data. } }

as can see, i'm trying update variables' values when observe \0 @ end of stream.

it's (in isr):

read incoming byte , store in buffer @ 80 bytes long if \0 comes in, allow main know has new info process

in main:

if there's new data, break buffer long int , store values clear new info flag act according new values.

the problem isn't playing out wanted , i'm kinda lost. know switch statement works correctly given vars have right values. i've narrowed downwards problem either communication/buffer populating phase beingness broken or extraction of variables' values beingness broken, not sure or if both.

can share insight?

edit: had more time think this. ignore previous answer.

make sure buffer declared keyword volatile.

the fact you're wrapping without performing handling worrying. circular buffer, it's much improve maintain track of head, tail, , current size.

#define buff_max_bytes 80 #define true 1 #define false 0 typedef unsigned char boolean; static volatile unsigned char buff[buff_max_bytes]; static volatile unsigned char buffhead = 0; static volatile unsigned char bufftail = 0; static volatile unsigned char buffsize = 0; boolean store_byte(unsigned char b) { boolean success = true; if(buffsize < buff_max_bytes){ buff[bufftail] = b; buffsize++; bufftail = (bufftail + 1) % buff_max_bytes; } else{ success = false; } homecoming success; } boolean eol_received(void) { unsigned char prev_index = (bufftail == 0) ? buff_max_bytes - 1 : bufftail - 1; boolean eol = false; if(buff[prev_index] == '\0'){ eol = true; } homecoming eol; } // because strtol has no conception of buffer ends , wraps, // have create modified version can handle case. // // simple approach calculate length of message, re-create // buffer parsing (advancing buffhead read bytes), // , phone call strtol on new buffer. isr(usart_rx_vect) { while ( !(ucsr0a & (1<<rxc0)) ); if(!store_byte(udr0)){ // utilize flag inform main() of overflow, handle appropriate } rxflag = eol_received() ? 1 : 0; }

c arrays interrupt uart strtol

asp.net web api - How can I add a Dependency that can be used as type parameter 'TImpl' for Castle Windsor? -



asp.net web api - How can I add a Dependency that can be used as type parameter 'TImpl' for Castle Windsor? -

i getting runtime exception particular url:

"missing dependency. component nrbq.web.controllers.deliverycontroller has dependency on seastore.data.legacy.interfaces.inrbqdeliveryrepository, not resolved. create sure dependency correctly registered in container service, or provided inline argument." exceptiontype: "castle.microkernel.resolvers.dependencyresolverexception"

...so added code (based on existing code works) ioc class:

_container.register (component .for<inrbqdeliveryrepository>() .implementedby<deliverycontroller>() .lifestyle.transient);

in context:

private static castle.windsor.iwindsorcontainer _container; _container = new castle.windsor.windsorcontainer(); _container.addfacility<castle.facilities.factorysupport.factorysupportfacility>(); . . . _container.register (component .for<inrbqdeliveryrepository>() .implementedby<deliverycontroller>() .lifestyle.transient);

...but won't compile; get:

the type 'nrbq.api.controllers.deliverycontroller' cannot used type parameter 'timpl' in generic type or method 'castle.microkernel.registration.componentregistration.implementedby()'. there no implicit reference conversion 'nrbq.api.controllers.deliverycontroller' 'seastore.data.legacy.interfaces.inrbqdeliveryrepository'.

i know bit myseterious (i'm omitting of import details in question), i'm not sure additional clues should add.

update

in response whether deliverycontroller implements inrbqdeliveryrepository: actually, there 3 controller-type things; user-facing 1 in nrbq.web:

public class deliverycontroller : apicontroller { private readonly inrbqdeliveryrepository _deliveryrepository; public deliverycontroller(inrbqdeliveryrepository deliveryrepository) { if (deliveryrepository == null) { throw new argumentnullexception("deliveriescontroller"); } _deliveryrepository = deliveryrepository; } [route("api/deliveries/count")] public int getcountofdeliveryrecords() { homecoming _deliveryrepository.getcount(); } . . .

...then middle 1 in nrbq.client:

namespace nrbq.client { public class restnrbqdelivery : inrbqdelivery { inrbqclientsettings nrbqclientsettings; irestapiclient restapiclient; public restnrbqdelivery(irestapiclient restapiclient, inrbqclientsettings nrbqclientsettings) { this.nrbqclientsettings = nrbqclientsettings; this.restapiclient = restapiclient; } public restnrbqdelivery(irestapiclient restapiclient, inrbqclientsettings nrbqclientsettings, authenticationheadervalue authheader) { this.nrbqclientsettings = nrbqclientsettings; this.restapiclient = restapiclient; this.restapiclient.authheader = authheader; } public int getcount() { throw new notimplementedexception(); //todo: implement }

....and 1 behind-the-scenes heavy lifting, in nrbq.api:

namespace nrbq.api.controllers { public class deliverycontroller : apicontroller { ilogger logger; inrbqservice nrbqservice; public deliverycontroller(ilogger logger, inrbqservice nrbqservice) { this.nrbqservice = nrbqservice; this.logger = logger; } [httpget] [route("api/deliveries/count")] public int getcountofdeliveryrecords() { //return _deliveryrepository.getcount(); homecoming nrbqservice.getnrbqentity(); }

that lastly phone call refers here:

public int getnrbqentity() { homecoming 17; // bogus val }

this best effort @ copying existing test/sample code, admit head swimming , don't grok what's happening (how , why).

update 2

although i'm pretty sure it's still not quite nathan's hot dog (it seems chase on creation, calling first abstraction, one, another, first, another, second, etc. etc. advertisement infinitum advertisement nauseum advillium), adding this:

container.register (component .for<inrbqdelivery>() .implementedby<restnrbqdelivery>() .lifestyle.transient);

...in context:

public class nrbqclientinstaller : iwindsorinstaller { public void install(iwindsorcontainer container, iconfigurationstore store) { container.register (component .for<seastore.common.http.irestapiclient>() .implementedby<seastore.common.http.webapiclient>() .lifestyle.transient); container.register (component .for<inrbqclient>() .implementedby<restnrbqclient>() .lifestyle.transient); container.register (component .for<inrbqdelivery>() .implementedby<restnrbqdelivery>() .lifestyle.transient); } }

...got rid of err msg , returned false result expecting (or, rather, hoping for, not expecting).

in iwindsorinstaller unit, register interface , implementer:

container.register (component .for<inrbqdelivery>() .implementedby<restnrbqdelivery>() .lifestyle.transient);

asp.net-web-api dependency-injection castle-windsor ioc-container dependency-resolver

php - Sending a variable to the view which is used in controller with phalconPHP -



php - Sending a variable to the view which is used in controller with phalconPHP -

i have little issue have declared variable of type boolean in controller.

$done=false

now there trigger in controller turn true , @ point send corresponding view controller .. have used following.

$done=true; $this->view->setvar("done", $done);

now when seek phone call in corresponding view not know of varible.

if($done==true) { echo' <div class="alert alert-success"> <a href="addnewskill" class="alert-link">add here!</a> </div> '; }

it gives me following:

notice: undefined variable: done in >c:\xampp\htdocs\blueware\app\views\addnewskill\index.phtml on line 36

now there improve way of sending varible through view or making mistake?

full controller/action code:

<?php class addnewskillcontroller extends \phalcon\mvc\controller{ public function indexaction(){ } public function confirmaction(){ $this->view->disable(); $done=false; if($this->request->ispost()) { $datasent = $this->request->getpost(); $skill = new skills(); $skill->technology = $datasent["technology"]; $skill->skillname = $datasent["skillname"]; $skill->description = $datasent["description"]; $savedsuccessfully = $skill->save(); if($savedsuccessfully) { $done=true; $this->view->setvar("done", $done); } else { $messages = $skill->getmessages(); echo "sorry, next problems generated: "; foreach ($messages $message) { echo "$message <br/>"; } } } else { echo "the request method should post!"; } } }

full view code:

<?php if($done==true) { echo' <div class="alert alert-success"> <a href="addnewskill" class="alert-link">add here!</a> </div> '; } ?>

if($savedsuccessfully) { $done=true; $this->view->setvar("done", $done); } else {

you should setting variable there, setting in view after seems not saving , hence not passing variable on

similar

if($savedsuccessfully) { $done=true; } else { ...later in code ... $this->view->setvar("done", $done);

or just

$this->view->setvar("done", $savedsuccessfully);

php html phalcon

asp.net mvc - Sitecore MVC routing to resolve a hyphenated name -



asp.net mvc - Sitecore MVC routing to resolve a hyphenated name -

i trying sitecore mvc routing give me content path of

/home/test url/with space

from url:

/test-url/with-space

so need sitecore able recognise url has hyphen, can still resolve path without hyphen.

here have far:

routes.maproute( name: "hyphenated url", url: "test-url/{valuename}", defaults: new { scitempath = "/home/test url/{valuename}" });

this works path of:

/test-url/with space

but if add together hyphen in between "with" , "space", can't resolve. i'm guessing need custom route processor. ideas? in advance.

you create custom route.

routes.maphyphenatedroute( name: "hyphenated url", url: "{controller}/{action}", defaults: new { scitempath = "/home/{controller}/{action}" } );

the thought here intercept route values hyphens , translate them desired format. urls without hyphens remain untouched. sitecore still need ability handle scitempath.

public static class routecollectionextensions { public static route maphyphenatedroute(this routecollection routes, string name, string url, object defaults) { var route = new hyphenatedroute(url, defaults); routes.add(name, route); homecoming route; } } public class hyphenatedroute : route { public hyphenatedroute(string url, object defaults) : base(url, new routevaluedictionary(defaults), new mvcroutehandler()) { } public override routedata getroutedata(system.web.httpcontextbase httpcontext) { var routedata = base.getroutedata(httpcontext); if (routedata != null) { routevaluedictionary values = routedata.values; values["controller"] = dehyphenate(values["controller"] string); values["action"] = dehyphenate(values["action"] string); } homecoming routedata; } public override virtualpathdata getvirtualpath(requestcontext ctx, routevaluedictionary values) { values["controller"] = hyphenate((values["controller"] string)); values["action"] = hyphenate(values["action"] string); homecoming base.getvirtualpath(ctx, values); } private static string hyphenate(string value) { if (!string.isnullorempty(value) && value.indexof(' ') >= 0) { homecoming system.globalization.cultureinfo.currentculture.textinfo.tolower(value.replace(' ', '-')); } homecoming value; } private static string dehyphenate(string value) { if (!string.isnullorempty(value) && value.indexof('-') >= 0) { homecoming system.globalization.cultureinfo.currentculture.textinfo.totitlecase(value.replace('-', ' ')); } homecoming value; } }

your scenario may need different handling, code might help if need route translation.

asp.net-mvc sitecore sitecore6

bash - "mv: cannot stat" error when using find to move files via xargs -



bash - "mv: cannot stat" error when using find to move files via xargs -

i'm working on bash script needs (recursively) move files , folders within source folder destination folder.

in trying create robust possible, , address potential argument list long - errors, opted utilize find command (to safely determine files move) piped xargs (to efficiently grouping moves together). i'm using -print0 , -0 address potential problems spaces.

i've written next test script:

#!/bin/bash # create test source file structure, , destination folder mkdir -p sourcedir/{subdir1,subdir\ with\ space\ 2} mkdir -p destdir touch sourcedir/subdir1/{a1.txt,noextension1,file1\ with\ space.txt} touch sourcedir/subdir\ with\ space\ 2/{a2.txt,noextension2,file2\ with\ space.txt} #move files/folders source destination find sourcedir -mindepth 1 -print0 | xargs -0 mv --target-directory=destdir

which seems work (i.e. files moved) but reason numerous errors follows:

mv: cannot stat `sourcedir/subdir space 2/file2 space.txt': no such file or directory mv: cannot stat `sourcedir/subdir space 2/noextension2': no such file or directory mv: cannot stat `sourcedir/subdir space 2/a2.txt': no such file or directory mv: cannot stat `sourcedir/subdir1/file1 space.txt': no such file or directory mv: cannot stat `sourcedir/subdir1/noextension1': no such file or directory mv: cannot stat `sourcedir/subdir1/a1.txt': no such file or directory

should there not way (for source files indicated in script) without generating errors?

why these errors beingness generated (since files , folders in fact beingness moved)?

i've sussed it.

short answer: missing -maxdepth 1 tag. next command works

find sourcedir -mindepth 1 -maxdepth 1 -print0 | xargs -0 mv --target-directory=destdir # find sourcedir -mindepth 1 -maxdepth 1 -exec mv --target-directory=destdir '{}' +

longer answer:

my original find command listing paths each , every file, , trying move each , every 1 of them. 1 time top level folder had been moved, there no need move files/folders underneath - script still trying to!

the script below demonstrates (without performing moves):

#!/bin/bash mkdir -p sourcedir/{subdir1/subsubdir1,subdir\ with\ space\ 2} touch sourcedir/subdir1/{subsubdir1/deeperfile.log,a1.txt,noextension1,file1\ with\ space.txt} touch sourcedir/subdir\ with\ space\ 2/{a2.txt,noextension2,file2\ with\ space.txt} touch sourcedir/rootfile.txt echo -e "\n--- output of 'ls -1: sourcedir':" echo "$(ls -1 sourcedir)" echo -e "\n--- original wrong effort trying move each of following:" find sourcedir -mindepth 1 echo -e "\n--- working effort needs move each of top level files/folders, underneath folders moved automatically" find sourcedir -mindepth 1 -maxdepth 1

giving output:

--- output of 'ls -1: sourcedir': rootfile.txt subdir1 subdir space 2 --- original wrong effort trying move each of following: sourcedir/rootfile.txt sourcedir/subdir space 2 sourcedir/subdir space 2/file2 space.txt sourcedir/subdir space 2/noextension2 sourcedir/subdir space 2/a2.txt sourcedir/subdir1 sourcedir/subdir1/file1 space.txt sourcedir/subdir1/noextension1 sourcedir/subdir1/a1.txt sourcedir/subdir1/subsubdir1 sourcedir/subdir1/subsubdir1/deeperfile.log --- working effort needs move each of top level files/folders, underneath folders moved automatically sourcedir/rootfile.txt sourcedir/subdir space 2 sourcedir/subdir1

bash find xargs stat mv

What IIS version is required to host ASP.NET WebAPI? -



What IIS version is required to host ASP.NET WebAPI? -

we're developing rest service using asp.net webapi.

is there required version of iis deploying web application containing service?

asp.net-mvc-4 iis deployment asp.net-web-api

Empty space in ratio constrained gnuplot -



Empty space in ratio constrained gnuplot -

i trying create density plot constraint axis in gnuplot, have lot of empty space outside plot

reset set term postscript enhanced eps color set output "verif_thetak_60deg.eps" set pm3d map set size ratio -1 set xtics 0.5 set autoscale xfixmax rayon=0.35 set object 1 circle @ 0,5./2 size rayon front end fs empty border lw 3.0 set object 2 circle @ sqrt(3),5./2 size rayon front end fs empty border lw 3.0 set object 3 circle @ sqrt(3),0.5 size rayon front end fs empty border lw 3.0 set object 4 circle @ 0.5*sqrt(3),1 size rayon front end fs empty border lw 3.0 set object 5 circle @ 0.5*sqrt(3),2 size rayon front end fs empty border lw 3.0 set object 6 circle @ 0,0.5 size rayon front end fs empty border lw 3.0 splot "verif_thetak_60deg.dat" u 1:2:3 notitle

i have tried using multiplot set origin, working empty space circles rotated. not understand. help me? here first lines of sample data

0. 0. 1.4897029029511362 0. 0.02857142857142857 1.5198145790443847 0. 0.05714285714285714 1.6051617239962799 0. 0.08571428571428572 1.7477181570182962 0. 0.11428571428571428 1.9508130394308165 0. 0.14285714285714285 2.219107847798675 0. 0.17142857142857143 2.5584267524091646 0. 0.2 2.9078002844476583 0. 0.22857142857142856 3.261016162180486 0. 0.2571428571428571 3.61098658139621 0. 0.2857142857142857 3.9502081600876053 0. 0.3142857142857143 4.271128101449691

i have allow blank line each time first column change.

at moment image looks this:

to margins , size right requires fiddling:

first must set canvas size improve fits shape of plot e.g. set terminal postscript eps size 2in,4in.

then must adjust lmargin and/or bmargin manually. requires iterations right.

as notice: upcoming version 5.0 has alternative set view map scale ... simplifies this.

alternatively can utilize tool epstool right bounding box:

epstool --bbox --copy --output cropped.eps original.eps

for similar question, see gnuplot: how avoid white margin in pdf through adjusting page size , other parameters.

gnuplot

python - Create a serializer for a list of serialized object using django rest -



python - Create a serializer for a list of serialized object using django rest -

i'm using django rest , have these 3 objects :

class object1(): name = "" class object2(): value = 0 class object3(): list = [] # list of object1 , object2

and have serializer :

class object1serializer(serializer.serializer): name = serializer.charfield(max_length=30) class object2serializer(serializer.serializer): value = serializer.integerfield()

how can create serializer object3

edit

in homecoming response want :

{ "object1" : { "name": "name" } "object2": { "value": 12 } }

check out serializer fields documentation — basic thought create field subclass implements to_native homecoming list need.

there's drf_compound_fields bundle provides listfield (and others) — should either give need or @ to the lowest degree provide plenty pointer help implement own solution.

i hope helps

python django django-rest-framework

optimization - Do I need to worry about inlining in Unity/C#? -



optimization - Do I need to worry about inlining in Unity/C#? -

for code clarity create function should inlined, either wrapper, or function called in single point, or short function supposed called , fast.

in c inline without sec thought, in unity/c# there's no way afaik (this appears available @ .net 4.5).

can trust compiler smart plenty inline smartly, or i'd improve sacrifice code clarity performance, mistrusting compiler?

sure depends case case, premature optimization evil, , should profile instead of guessing. general overview of subject might still useful guideline, improve upon.

manually forcing in-lining in c# @ compile time doesn't create much sense. when code run just-in-time compiler can decide in-line code based on these heuristics:

http://blogs.msdn.com/b/ericgu/archive/2004/01/29/64717.aspx

methods greater 32 bytes of il not inlined. virtual functions not inlined. methods have complex flow command not in-lined. complex flow command flow command other if/then/else; in case, switch or while. methods contain exception-handling blocks not inlined, though methods throw exceptions still candidates inlining. if of method's formal arguments structs, method not inlined.

if you're absolutely sure method has in-lined can utilize these above heurstics create method more appealing in-line.

methodimploptions.aggressiveinlining useful inlining across assembly boundaries, not believe just-in-time compiler can (but i'd have check that).

c# optimization unity3d inlining

java - Getting a class not found exception / noclassdeffound error on some Android devices -



java - Getting a class not found exception / noclassdeffound error on some Android devices -

i have class implements parcelable, throwing me noclassdeffounderror class not found exception on devices. have gotten error on samsung android devices. on nexus 5, nexus 4 , android emulators works should not on samsung reason. have tested on samsung remote test lab not have samsung device debugging.

also class in question nil special. simple class longs, string , int written/read parcel. checked order same when reading , writing. additionally, class not referenced library.

error 06-23 09:14:13.578 892 1507 parcel class not found when unmarshalling: path.class error 06-23 09:14:13.578 892 1507 parcel caused by: java.lang.noclassdeffounderror: path/class error 06-23 09:14:13.578 892 1507 parcel caused by: java.lang.classnotfoundexception: didn't find class "path.class" on path: dexpathlist[[directory "."],nativelibrarydirectories=[/vendor/lib, /system/lib]]

code parcelable part of class.

public class sprint implements parcelable { private long mstarttime; private long mendtime; private int mdaysinsprint; private string msprinttitle; private int mid; private sprint(parcel source) { mstarttime = source.readlong(); mendtime = source.readlong(); mdaysinsprint = source.readint(); msprinttitle = source.readstring(); mid = source.readint(); } public static final parcelable.creator<sprint> creator = new parcelable.creator<sprint>() { @override public sprint createfromparcel(parcel source) { homecoming new sprint(source); } @override public sprint[] newarray(int size) { homecoming new sprint[size]; } }; @override public int describecontents() { homecoming hashcode(); } @override public void writetoparcel(parcel dest, int flags) { dest.writelong(mstarttime); dest.writelong(mendtime); dest.writeint(mdaysinsprint); dest.writestring(msprinttitle); dest.writeint(mid); }

this error may cause because of api version compatibility. please check , utilize latest version of api. not sure per knowledge reason

java android samsung-mobile

Receiving values every second from Linux utilities in a Java program -



Receiving values every second from Linux utilities in a Java program -

i want receive in java output linux command line program. need read values line line, because utilities reporting values 1 time per sec , java programme should not need wait until end of execution. should receive values every second. next little programme works fine in case of ping command, not perf stat command.

import java.io.bufferedreader; import java.io.inputstreamreader; import java.io.ioexception; public class main { process p; bufferedreader reader; public main(int number) throws ioexception { if (number == 1) { // not work, blocks on readline() p = runtime.getruntime().exec("sudo perf stat -e cycles -i 1000 -p 9264"); // alter pid 1 monitored } else if (number == 2) { // works! p = runtime.getruntime().exec("ping www.google.com"); } else { system.out.println("either 1 or 2..."); system.exit(0); } reader = new bufferedreader(new inputstreamreader(p.getinputstream())); } public void process() throws ioexception { string res = ""; res = reader.readline(); system.out.println(res); } public static void main (string[] args) throws ioexception, interruptedexception { main mymain = new main(integer.parseint(args[0])); while (true) { mymain.process(); thread.sleep(1000); } } }

so when running java main 2 works correctly, when invoking java main 1 block on reader.readline() call.

what's difference between 2 commands? command 'ls -l' works correctly , receive values line line.

edit: command works fine, when run straight command line. -i alternative introduced in newer kernel versions, did not exist before (i using kernel 3.11, ubuntu).

when using 2>$1 stderr, indeed read value every second, read null.

the problem seems perf stat not utilize stdout default, stderr. see log-fd option.

so can either redirect stderr stdout in command use,

or capture input stream stderr of process

java linux shell

php - Laravel and Thujohn's Twitter Package -



php - Laravel and Thujohn's Twitter Package -

i have implemented thujohn's twitter api bundle laravel (https://github.com/thujohn/twitter-l4). able set , included api credentials.

when go home view view tweets,

stdclass object ( [errors] => array ( [0] => stdclass object ( [message] => bad authentication info [code] => 215 ) ) )

(i printing out info debugging)

i have tried other methods trying users timeline, homecoming same thing.

i have made helper class help behind scenes work retrieval of data. have set laravel , made class folder.

here helper class:

class helpers { public static function twitterfeed($screen_name='mackhankins', $count='3', $include_retweets='false', $exclude_replies='true') { $twitterfeed = cache::remember('twitterfeed', 30, function() utilize ($screen_name, $count, $include_retweets, $exclude_replies) { homecoming twitter::getusertimeline(array('screen_name' => $screen_name, 'count' => $count, 'include_rts' => $include_retweets, 'exclude_replies' => $exclude_replies)); }); if(!empty($twitterfeed)) { homecoming $twitterfeed; } else { homecoming array(); } } }

the homecontroller:

class homecontroller extends basecontroller { public function __construct() { /*get tweets*/ view::share('tweets', helpers::twitterfeed('tjyouschak', '10', false, true)); } public function gethome() { homecoming view::make('home'); } }

the view:

{{ print_r($tweets) }}

any help appreciated, thanks!

code 215 bad authentication data. need auth first, tweets

https://dev.twitter.com/overview/api/response-codes

https://dev.twitter.com/rest/reference/get/search/tweets

php twitter laravel

javascript - If Array.prototype.slice() method returns shallow copy why does changing the value of sliced array does not change the original -



javascript - If Array.prototype.slice() method returns shallow copy why does changing the value of sliced array does not change the original -

the array.prototype.slice() method documentation says

the slice() method returns shallow re-create of portion of array new array object.

if case why modifying array returned array.prototype.slice() not alter original value.

> = [1, 2, 3] [ 1, 2, 3 ] > b = a.slice(0) [ 1, 2, 3 ] > b[0] = 4 4 > b [ 4, 2, 3 ] > // expected output should same output of b if b shallowcopy of a. [ 1, 2, 3 ]

may re-create on write happening while trying modify array a. if technically right array.prototype.slice() homecoming shallow copy.

the result of a.slice new array, it's not pointer initial variable.

javascript

asp.net - Find changes in cloud service configuration screen -



asp.net - Find changes in cloud service configuration screen -

i've cloud service , if go azure portal , click on cloud services ->choose service -> click on configure . see setting set in vs cloud service mvc project following:

this configure settings configured , deployod cloud service in vs when click on cloud service click on mvc project , click on specific role , have screen of cofigure /settings /endpoints etc ,and set setting key val in setting view.

when deploy service azure see in config section in portal mentiond abve...

user can alter config setting values in portal want track it,if go the managment services can see changes in azure cloud service (caller id ,operation id etc , there alternative see detailes not sufficent) ,i want see which property changed , old values, how should ?

i've read next not find how that...

http://msdn.microsoft.com/library/azure/dn186185.aspx

i guess need code illustration helpful!

unfortunately there's no straight forwards way accomplish this. 1 thing should implement proper command mechanisms users not making these kind of changes through portal can maintain tab on changes (may in version command system).

azure service management api provides functionality allows take backup of deployed bundle (cspkg , cscfg files) in blob storage. operation called get package.

what periodically invoke operation , re-create of files in blob storage. @ given point of time, phone call get deployment operation on deployment homecoming current configuration setting (in configuration element, have base64 decode it). can compare these settings configuration file in blob storage.

asp.net asp.net-mvc azure azure-cloud-services

mysql - SQL Entry's Duped -



mysql - SQL Entry's Duped -

i messed when trying create test database , accidently duplicated within of table. there 2 of every entry there 1 time before. there simple way prepare this? (using innodb tables)

yet reason utilize auto incrementing primary keys. way, rows wouldn't total duplicates.

probably fastest way re-create info table, truncate first table, , re-insert it:

create temporary table tmp select distinct * test; truncate table test; insert test select * tmp;

as little note: in cases, recommend using finish column list on insert statement. 1 case optional. after all, putting columns in table , putting them statement later.

mysql duplicates duplicate-removal heidisql

javascript - I need to have my function repeat it self for each item in array -



javascript - I need to have my function repeat it self for each item in array -

i trying create button each item in array (from db). right first button work way suppose ones under nothing. i've tried many different thing can't seem work. if need more code or have question allow me know.

<html> <head> <link rel="shortcut icon" href="photos/favicon.ico" > <link rel="stylesheet" type="text/css" href="css/home.css"> <link rel="stylesheet" type="text/css" href="css/home.css"> <script type="text/javascript" src="js/jquery.js "></script> <head> <link rel="stylesheet" href="css/styles.css" /> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/scripts.js"></script> </head> </head><div id="container" > <head> <link rel="shortcut icon" href="photos/favicon.ico" > <link rel="stylesheet" type="text/css" href="css/home.css"> <link rel="stylesheet" type="text/css" href="css/home.css"> <script type="text/javascript" src="js/jquery.js "></script> <head> <link rel="stylesheet" href="css/styles.css" /> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/scripts.js"></script> </head> </head> <div id='header'> <header > <hr size="50px" color="#ff0000" text-align="right" value="dustin's resume" > <script type="text/javascript" src="js/jquery-1.8.1.js"></script> <script type="text/javascript" src="js/script.js"></script> <link rel='stylesheet' type='text/css' href='css/style.css' /> <div class='menu'> <img class="hover-link" id="logo3" src="photos/logo3.png" height="50px" align="left" alt="logo" > <!--<a class='hover-link'>navigation</a>--> <div class='sub'> <ul class='sub-options'> <li><a href="profile2.php?id=1"><img src="upload/142479139.jpg" width="100px" height="100px" text-align="center"/></a><br></li> <li><a href='default.php' style="text-size:30px;font-weight:bold;"><b>home</b></h3></a></li> <li><a href='about.php' style="text-size:30px;font-weight:bold;"><b>about</b></h3></a></li> <li><a href='members.php' style="text-size:30px;font-weight:bold;"><b>search</b></h3></a></li> <li><a href='contact.php' style="text-size:30px;font-weight:bold;"><b>contact</b></h3></a></li> <li><a href='update.php' style="text-size:30px;font-weight:bold;"><b>update info</b></h3></a></li> <li><a href='updatepic.php' style="text-size:30px;font-weight:bold;"><b>update pic</b></h3></a></li> <li><a href='logout.php' style="text-size:30px;font-weight:bold;"><b>logout</b></h3></a></li> </ul> </div> </div> </div> <style> #welcome { margin-top: 0px; color: #fff; font: bold, 25px; align: right; } </style> <image align="right" position='fixed' id="logo" src="upload/142479139.jpg" width="50px" height="50px"></image> <p id='welcome' align='right'>welcome back,<br></p> </header> <head> <link rel="shortcut icon" href="photos/favicon.ico" > <link rel="stylesheet" type="text/css" href="css/home.css"> <link rel="stylesheet" type="text/css" href="css/home.css"> <script type="text/javascript" src="js/jquery.js "></script> <head> <link rel="stylesheet" href="css/styles.css" /> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/scripts.js"></script> </head> </head><aside > <div > <br> <p align="center"> <head> <link rel="stylesheet" href="css/styles.css" /> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/scripts.js"></script> </head> <form> <div class="label_div">search people</div><br> <div class="input_container"> <input type="text" id="id" onkeyup="autocomplet()" autocomplete="off"> <ul id="list_id"></ul> </div> </form> </p> <a href="updatepic.php" alt="update picture"><image align="center" src="upload/142479139.jpg" width="150px" height="150px"></image></a> <br><br><br> <p><h3>dustin strader</h3></p> </div> </aside><body><div id="content" ><script type="text/javascript"> function setbg(color) { document.getelementbyid("styled").style.background=color }</script> </head> <table align="center" > <tr> <td padding="10px" width="600" height="200" style="background-image: url('photos/post.png'); "> <a href="profile2.php?id=1" ><image align="right" style="margin:0 50 0" src="upload/142479139.jpg" width="75px" height="75px"></a> <div align="center"><label style="margin:0 0" id="px" >damn got shit down!!!</label><br> <label style="margin:0 0; font-size:8px" id="px" >2014-06-19 03:28:36am</label><br></div> <div align="center"> <form method="post" action="default.php" > <label style="margin:0 0"> <textarea maxlength="40" name="comment" id="" onfocus="this.value=''; setbg('#ffffff');" onblur="setbg('white')">comment...</textarea> </label><br><br> <input type="hidden" name="ids" value="101" ></input> <div style=" margin:0 152px 0" align="center"> <input type="image" width="100px" height="35px" name="submits" src="photos/comment.png" alt="submit" /> <a href="vcomments.php?id=101" align="center"></a> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(document).ready(function(){ $( "#dialog" ).dialog({ autoopen: false, show: { effect: "blind", duration: 1000}, hide: { effect: "explode", duration: 1000 }}); $( ".opener" ).live('click',function() { $( "#dialog" ).dialog( "open" ); }); }); </script> </head> <image class="opener" width="100px" height="35px" src="photos/vcomment.png" > <div id="dialog" title="basic dialog"> <p> <label ><p>2014-06-19 03:28:36</p></label><br> <label ><h3>damn got shit down!!!</h3></label><br> <label ><p align="center">2014-06-20 23:59:39</p></label><br> <label ><p align="center">777777777777777</p></label><br> </p> <label ><p align="center">2014-06-20 23:53:36</p></label><br> <label ><p align="center">1111111111</p></label><br> </p> <label ><p align="center">2014-06-21 00:33:10</p></label><br> <label ><p align="center">9999999999999</p></label><br> </p> <label ><p align="center">2014-06-21 00:32:32</p></label><br> <label ><p align="center">44444444444444444</p></label><br> </p> <label ><p align="center">2014-06-20 17:23:11</p></label><br> <label ><p align="center">cccccc</p></label><br> </p> <label ><p align="center">2014-06-20 16:50:51</p></label><br> <label ><p align="center">hgjghjghj</p></label><br> </p> <label ><p align="center">2014-06-20 16:24:43</p></label><br> <label ><p align="center">ffffffff</p></label><br> </p> <label ><p align="center">2014-06-20 14:24:05</p></label><br> <label ><p align="center">jhnfgn</p></label><br> </p> <label ><p align="center">2014-06-20 14:24:00</p></label><br> <label ><p align="center">fgdfg</p></label><br> </p> <label ><p align="center">2014-06-19 04:34:09</p></label><br> <label ><p align="center">comment...</p></label><br> </p> </div> </div> </form> </div > </td> </tr> <table> </head> <table align="center" > <tr> <td padding="10px" width="600" height="200" style="background-image: url('photos/post.png'); "> <a href="profile2.php?id=1" ><image align="right" style="margin:0 50 0" src="upload/142479139.jpg" width="75px" height="75px"></a> <div align="center"><label style="margin:0 0" id="px" >i love site!!!</label><br> <label style="margin:0 0; font-size:8px" id="px" >2014-06-19 02:00:36am</label><br></div> <div align="center"> <form method="post" action="default.php" > <label style="margin:0 0"> <textarea maxlength="40" name="comment" id="" onfocus="this.value=''; setbg('#ffffff');" onblur="setbg('white')">comment...</textarea> </label><br><br> <input type="hidden" name="ids" value="100" ></input> <div style=" margin:0 152px 0" align="center"> <input type="image" width="100px" height="35px" name="submits" src="photos/comment.png" alt="submit" /> <a href="vcomments.php?id=100" align="center"></a> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(document).ready(function(){ $( "#dialog" ).dialog({ autoopen: false, show: { effect: "blind", duration: 1000}, hide: { effect: "explode", duration: 1000 }}); $( ".opener" ).live('click',function() { $( "#dialog" ).dialog( "open" ); }); }); </script> </head> <image class="opener" width="100px" height="35px" src="photos/vcomment.png" > <div id="dialog" title="basic dialog"> <p> <label ><p>2014-06-19 02:00:36</p></label><br> <label ><h3>i love site!!!</h3></label><br> <label ><p align="center">2014-06-20 23:58:13</p></label><br> <label ><p align="center">comment...</p></label><br> </p> <label ><p align="center">2014-06-20 13:44:55</p></label><br> <label ><p align="center">comment...</p></label><br> </p> <label ><p align="center">2014-06-20 13:42:38</p></label><br> <label ><p align="center">comment...</p></label><br> </p> <label ><p align="center">2014-06-19 05:12:37</p></label><br> <label ><p align="center">i kove tis</p></label><br> </p> </div> </div> </form> </div > </td> </tr> <table> </head> <table align="center" > <tr> <td padding="10px" width="600" height="200" style="background-image: url('photos/post.png'); "> <a href="profile2.php?id=25" ><image align="right" style="margin:0 50 0" src="upload/425876911.jpg" width="75px" height="75px"></a> <div align="center"><label style="margin:0 0" id="px" >today cool day.</label><br> <label style="margin:0 0; font-size:8px" id="px" >2014-06-18 03:38:45pm</label><br></div> <div align="center"> <form method="post" action="default.php" > <label style="margin:0 0"> <textarea maxlength="40" name="comment" id="" onfocus="this.value=''; setbg('#ffffff');" onblur="setbg('white')">comment...</textarea> </label><br><br> <input type="hidden" name="ids" value="92" ></input> <div style=" margin:0 152px 0" align="center"> <input type="image" width="100px" height="35px" name="submits" src="photos/comment.png" alt="submit" /> <a href="vcomments.php?id=92" align="center"></a> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(document).ready(function(){ $( "#dialog" ).dialog({ autoopen: false, show: { effect: "blind", duration: 1000}, hide: { effect: "explode", duration: 1000 }}); $( ".opener" ).live('click',function() { $( "#dialog" ).dialog( "open" ); }); }); </script> </head> <image class="opener" width="100px" height="35px" src="photos/vcomment.png" > <div id="dialog" title="basic dialog"> <p> <label ><p>2014-06-18 15:38:45</p></label><br> <label ><h3>today cool day.</h3></label><br> <label ><p align="center">2014-06-20 13:40:09</p></label><br> <label ><p align="center">55555</p></label><br> </p> </div> </div> </form> </div > </td> </tr> <table> </head> <table align="center" > <tr> <td padding="10px" width="600" height="200" style="background-image: url('photos/post.png'); "> <a href="profile2.php?id=25" ><image align="right" style="margin:0 50 0" src="upload/425876911.jpg" width="75px" height="75px"></a> <div align="center"><label style="margin:0 0" id="px" >dustin rocks</label><br> <label style="margin:0 0; font-size:8px" id="px" >2014-06-18 03:38:34pm</label><br></div> <div align="center"> <form method="post" action="default.php" > <label style="margin:0 0"> <textarea maxlength="40" name="comment" id="" onfocus="this.value=''; setbg('#ffffff');" onblur="setbg('white')">comment...</textarea> </label><br><br> <input type="hidden" name="ids" value="91" ></input> <div style=" margin:0 152px 0" align="center"> <input type="image" width="100px" height="35px" name="submits" src="photos/comment.png" alt="submit" /> <a href="vcomments.php?id=91" align="center"></a> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(document).ready(function(){ $( "#dialog" ).dialog({ autoopen: false, show: { effect: "blind", duration: 1000}, hide: { effect: "explode", duration: 1000 }}); $( ".opener" ).live('click',function() { $( "#dialog" ).dialog( "open" ); }); }); </script> </head> <image class="opener" width="100px" height="35px" src="photos/vcomment.png" > <div id="dialog" title="basic dialog"> <p> <label ><p>2014-06-18 15:38:34</p></label><br> <label ><h3>rocks</h3></label><br> <label ><p align="center">2014-06-20 13:40:16</p></label><br> <label ><p align="center">5555</p></label><br> </p> </div> </div> </form> </div > </td> </tr> <table> </div> </body> </div> </html>

as say, seems elements don't have unique id. either utilize unique id each element , declare related click event might long way, or add together class instead of id , add together click event 'live/ on' binding, i.e

$(".buttonclasss").live('click',function(){ //rest of code. });

javascript php jquery html arrays

c# - After download/upload files from MS SQL, the files become unreadable -



c# - After download/upload files from MS SQL, the files become unreadable -

i have asp mvc app, ms sql , c#. download file ms sql, upload file db. after file become unreadable. can't understand happens. below code, returns file client.

public string createfile(httppostedfilebase file) { string stream_id = string.empty; seek { int size = file.contentlength; string name = file.filename; string contenttype = file.contenttype; byte[] bytes = new byte[size]; file.inputstream.read(bytes, 0, size); string constr = configurationmanager.connectionstrings["pokrovconnectionstring"].connectionstring; using (transactionscope ts = new transactionscope()) { using (sqlconnection con = new sqlconnection(constr)) { string query = "declare @mytablevar table (stream_id uniqueidentifier);" + "insert files(name, file_stream) output inserted.stream_id @mytablevar values(@name, @file_stream);" + "select top (1) @identity = stream_id @mytablevar;"; using (sqlcommand cmd = new sqlcommand(query)) { cmd.connection = con; cmd.parameters.add("@name", sqldbtype.varchar).value = path.getfilename(file.filename); cmd.parameters.add("@file_stream", sqldbtype.varbinary).value = bytes; sqlparameter idparam = cmd.parameters.add("@identity", sqldbtype.nvarchar, 1000); idparam.direction = parameterdirection.output; con.open(); cmd.executenonquery(); con.close(); stream_id = (string)idparam.value; } } ts.complete(); } } grab { } homecoming stream_id; } public filecontentresult getfile(guid stream_id, string contenttype = "application/octet-stream") { sqldatareader rdr; byte[] filecontent = null; string mimetype = ""; string filename = ""; string connect = onfigurationmanager.connectionstrings["pokrovconnectionstring"].connectionstring; bool success = false; using (var conn = new sqlconnection(connect)) { var qry = "select file_stream, name, file_type files stream_id = @stream_id"; var cmd = new sqlcommand(qry, conn); cmd.parameters.addwithvalue("@stream_id", stream_id); conn.open(); seek { rdr = cmd.executereader(); if (rdr.hasrows) { rdr.read(); filecontent = (byte[])rdr["file_stream"]; mimetype = rdr["file_type"].tostring(); filename = rdr["name"].tostring(); } success = true; } grab { homecoming null; } } if (success == true) { filecontentresult newfile = new filecontentresult(filecontent, contenttype); newfile.filedownloadname = filename; homecoming newfile; } homecoming null; }

from looking @ code stores posted file database - forgot re-create actual file content, initialized empty byte array length of posted file, , saved db.

.net has class can help save stream sql server without allocating buffer , reading entire stream first - sqlbytes. seek replace line:

byte[] bytes = new byte[file.contentlength];

with this:

sqlbinary bytes = new sqlbinary(file.inputstream);

you can take @ sqlbinary usage in this post.

c# sql

python - Stripping Line Breaks in Tweets via Tweepy -



python - Stripping Line Breaks in Tweets via Tweepy -

i'm looking pull info twitter api , create pipe separated file can farther processing on. code looks this:

auth = tweepy.oauthhandler(consumer_key, consumer_secret) auth.set_access_token(access_key, access_secret) api = tweepy.api(auth) out_file = "tweets.txt" tweets = api.search(q='foo') o = open(out_file, 'a') tweet in tweets: id = str(tweet.id) user = tweet.user.screen_name post = tweet.text post = post.encode('ascii', 'ignore') post = post.strip('|') # pipes in tweets don't create unwanted separators post = post.strip('\r\n') record = id + "|" + user + "|" + post print>>o, record

i have problem when user's tweet includes line breaks makes output info this:

473565810326601730|usera|this tweet 473565810325865901|userb|some other illustration 406478015419876422|userc|line separated tweet 431658790543289758|userd|one more tweet

i want strip out line breaks on 3rd tweet. i've tried post.strip('\n') , post.strip('0x0d 0x0a') in add-on above none seem work. ideas?

that because strip returns "a re-create of string leading , trailing characters removed".

you should utilize replace new line , pipe:

post = post.replace('|', ' ') post = post.replace('\n', ' ')

python twitter tweepy

sharepoint - Programming a Calendar Client on a Raspberry Pi -



sharepoint - Programming a Calendar Client on a Raspberry Pi -

i intern, tasked creating digital calendar office use. budget small, have 21" wall-mounted hdtv, , raspberry pi wifi adapter. problem, team creating for, has grouping calendar, hosted on office365 team site (which have admin access to). calendar used, built-in calendar app, due primary usage of online client outlook, rather desktop client (which has more sharing options). each team fellow member treated overlay, giving them own color events , such maintain calendar readable.this team not technology adept, drastically changing using highly undesirable.

what do, utilize raspberry pi grab calendar info team site, , convert info desktop client build displayed on connected tv, when connection interrupted. farther more, since tv not touch-enabled, able command client company ipad, allow viewers see week or day views, apposed strictly month views.

from poking around calendar, , web appears calendar stored sharepoint list? there not seem other format can export or pull calendar, url visit it, presumably containing sharepoint list. other form of output rss feed calendar.

my background in embedded systems work, , scientific computing. have never worked sharepoint lists, or web based. however, sense comfortable ability build client hold calendar, need help getting info web..

all i'm looking direction or guidance on how might pull info team calendar/sharepoint list can convert client use. if can provide other information, please allow me know.

thanks in advance!

sharepoint online provide rest interfaces, can info via rest. checked online, raspberry-pi supports rest.

calendar list on sharepoint, rest api, can get list title, , and the items in it, can show content in our client.

sharepoint raspberry-pi office365

c# - WebRequest slow even with null proxy -



c# - WebRequest slow even with null proxy -

i have next code :

private string dowebrequest() { webrequest request = webrequest.create("http://thegamesdb.net/scripts/ajax_searchgame.php?searchterm=super+mario+64"); request.proxy = null; webresponse response = request.getresponse(); stream datastream = response.getresponsestream(); streamreader reader = new streamreader(datastream); string responsefromserver = reader.readtoend(); reader.close(); response.close(); homecoming responsefromserver; }

when retreive page webbrowser reply in around 500ms. url homecoming simple json datas. within webrequest method takes around 45seconds.

when @ ants performance profiler hot spot create of webrequest , looks system.net.logging.get_on() cause... can't find way disable it.

do have encouter issue or thought help me ?

c# performance webrequest system.net

r - Reduce size of legend area in barplot -



r - Reduce size of legend area in barplot -

i can't cut down size of legend in plot. help me out? want appear topright, no more 20% of height of plot area

a <- c(3, 2, 2, 2, 1, 2 ) barplot(a, beside = t, col = 1:6, space = c(0, 2)) legend("topright", legend = c("a", "b", "c", "d", "e", "f"), fill = 1:6, ncol = 2)

the cex parameter you.

a <- c(3, 2, 2, 2, 1, 2 ) barplot(a, beside = t, col = 1:6, space = c(0, 2)) legend("topright", legend = c("a", "b", "c", "d", "e", "f"), fill = 1:6, ncol = 2, cex = 0.75)

edit: realize lukea has had answered question, i'll leave reply question appears answered.

r plot legend

html - Inputs vertical-align:middle in td, but not text? -



html - Inputs vertical-align:middle in td, but not text? -

why text , controls within table cells ignore/not inherit vertical-align:middle; style of cell (or row, or both)?

in css stylesheet loaded page:

tr.troptions{ vertical-align:middle; } td.tdoptions{ white-space:nowrap; vertical-align:middle; }

the inspector showing style applied:

but within row not appear aligned vertically @ middle in ie10 beingness developed for:

the checkboxes centered vertically, not text , not textboxes. left text box lower the right.

the controls seem vertically aligned fine in firefox though, still not text:

tried putting style td, tr , table no avail. doing wrong?

edit:

i challenge downvoted "bad" question produce css vertically middle-aligns text, check boxes, radio buttons, text boxes , buttons in table cells ie10. , if cannot - know are: all-hat-no-cattle.

i don't know why happens, in general, can utilize

.troptions { position: relative; top: 50%; -webkit-transform: translatey(-50%); -ms-transform: translatey(-50%); transform: translatey(-50%); }

for text, can utilize line-height: 00px 00 same height.

html css vertical-alignment

JavaScript Duplicate function names when declaring a method -



JavaScript Duplicate function names when declaring a method -

this stupid question, hoping find out knows improve do, there difference between next function declarations within class?

somefunction: function (obj) {};

and

somefunction: function somefunction (obj) {};

setting name on anonymous function allows utilize name inside function.

for example:

var funcs = { somefunction: function somefunction(obj){ // can access 'somefunction' in here }, otherfunction: function(obj){ // cannot access 'otherfunction', // you'd need 'funcs.otherfunction' } };

javascript

javascript - Jquery,Ajax not triggering the right php function -



javascript - Jquery,Ajax not triggering the right php function -

hi have little project in have 2 tabs i.e news , edit-news. news tab show news default when open page. when user switch edit-news tab can select selectbox whether wants news lastly 4 weeks or 6 weeks. , on select , on submit button click can 1 time again switch news tab edited news.till able manage tabs properly. problem facing here when user select news select-box , submit button not able trigger save-news-widget function phone call database query part upadte news.so after submit button triggering get-news-widget function , getting default news not edited news.thanks. here code:

dashboard.php

if($param['aktion'] == 'save-widget-news') { //$param['news'] //update sql... $page['register-news'] = array( 1 => array( 'news','aktiv',$page['script'],'',''), 0 => array( 'edit news','enabled',$page['script'],''), ); //echo $selectvalue=$_post['news']; if(isset($_post['save'])) { if(($selectvalue)==4){ echo $sql=" select distinct ad_news_texte.headline, ad_news.datum_archiv ad_news_texte inner bring together ad_news_oe on ad_news_texte.news_id = ad_news_oe.id_ad_news inner bring together ad_news on ad_news_oe.id_ad_news = ad_news.id ad_news.datum_archiv between curdate( ) - interval dayofweek( curdate( ) ) +28 day , curdate( ) "; $sql_select=mysql_query($sql); } elseif(($selectvalue)==6){ $sql=" select distinct ad_news_texte.headline, ad_news.datum_archiv ad_news_texte inner bring together ad_news_oe on ad_news_texte.news_id = ad_news_oe.id_ad_news inner bring together ad_news on ad_news_oe.id_ad_news = ad_news.id ad_news.datum_archiv between curdate( ) - interval dayofweek( curdate( ) ) +42 day , curdate( ) "; $sql_select=mysql_query($sql); } $html = '<table width="538" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <div>'.createregister($page['register-news']).'</div> '.createmessage().' <div class="cont-liste-verlauf register"> '; while($row = mysql_fetch_array($sql_select)){ $news_result = $row['headline'] . " " .$row['datum_archiv'] ; $html .= '<table id="news"> <div class="welcome-rahmen krz togglenews"> <p class="welcome-subheadline"><input type="hidden" name="type" value="'. $news_result .'" ></p> '; } $html .= '</div></table> </div> </td> </tr> </table>'; $return = array( 'status' => 1, 'html' => $html ); echo json_encode($return); die(); } else{ $param['aktion'] = 'get-widget-news'; } } if($param['aktion'] == 'get-widget-news') { $newsid = 1; $page['register-news'] = array( 1 => array( 'news','aktiv',$page['script'],''), 0 => array( 'edit-news','enabled',$page['script'],'',''), ); $param['aktion'] = 'save-widget-news'; $html = '<table width="538" cellspacing="0" cellpadding="0" border="0" > <tr> <td> <div>'.createregister($page['register-news']).'</div> '.createmessage().' <div class="cont-liste-verlauf register"> <table id="news"> <div class="welcome-rahmen lng togglenews" id="news_269_kurz"> <a href="news.php?id=269" class="tracknews" id="01" target="_blank"> <p class="welcome-breadcrump">montag, 19.05.2014</p> <p class="welcome-subheadline">teilnahme von man top used der samoter 2014</p> </a> </div> <div class="welcome-rahmen lng togglenews" id="news_264_kurz"> <a href="news.php?id=264" class="tracknews" id="02" target="_blank"> <p class="welcome-breadcrump">freitag, 24.01.2014</p> <p class="welcome-subheadline">kaufvertrag: neue porsche-vorlage zum drucken!</p> </a> </div> </table> </div> </td> </tr> </table>'; $return = array( 'status' => 1, 'html' => $html ); echo json_encode($return); die(); } if($param['aktion'] == 'get-widget-news-edit') { $page['register-news'] = array( 0 => array( 'news','enabled',$page['script'],'',''), 1 => array( 'edit news','aktiv',$page['script'],''), ); $html = '<table width="538" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <div>'.createregister($page['register-news']).'</div> '.createmessage().' <div class="cont-liste-verlauf register"> <form name="userinformationform" method="post" > <table id="news"> <select name="news" id="news"> <option value="4">show news lastly 4 weeks</option> <option value="6">show news lastly 6 weeks</option> </select> <br/><br/> </table> '.createbutton($page['button']).' </form> </div> </td> </tr> </table>'; $return = array( 'status' => 1, 'html' => $html ); echo json_encode($return); die(); }

dashboard.js

$(document).ready(function(){ function savenewswidget() { var selectboxvalue = $('select[name="news"]').val(); $.ajax({ type: "post", url: "ajax/dashboard.php", datatype : 'json', cache: false, data: {'aktion' : 'save-widget-news', 'news' : selectboxvalue}, success: function(data) { //getnewswidget(); $('#news').html(data['html']); } }); } function getnewswidget() { $.ajax({ type: "post", url: "ajax/dashboard.php", datatype : 'json', cache: false, data: {'aktion' : 'get-widget-news'}, success: function(data){ //alert(data); $('#news').html(data['html']); }, error: function(data){ alert('error'); //$('#news').html(data.html); } }); } function getnewswidgetedit() { $.ajax({ type: "post", url: "ajax/dashboard.php", datatype : 'json', cache: false, data: {'aktion' : 'get-widget-news-edit'}, success: function(data){ $('#news').html(data.html); } }); } $('#news .butt-rahmen').live('click', function(){ if($(this).attr('id') == 'saveid') { savenewswidget(); } homecoming true; }); getfahrzeugewidget(); getnewswidget(); });

it looks me you're submitting page running ajax call. need stop page submitting this...

$('#news .butt-rahmen').live('click', function(e) { e.preventdefault(); // stop form beingness submitted , reloading page if($(this).attr('id') == 'saveid') { savenewswidget(); } });

notice e beingness passed function parameter well.

also, i'm assuming you're using older version of jquery since live() has been deprecated , replaced on(). if using newer version you'll need alter too. have there, literally alter live on.

javascript php jquery html ajax

unix - search for text in recently created files -



unix - search for text in recently created files -

i'm working on old unix scheme , need search text in files created within lastly 3 hours. here's current command:

grep qual file.txt

i want search qual in files created in lastly 3 hours...help

this can way:

find /your/path -mmin -180 -type f -exec grep "qual" + ^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^ 3 hours files qual in files found

unix grep find

web services - transforming XML to XSL issue -



web services - transforming XML to XSL issue -

i relativity new web services / soap / xml , xslt , close grasping basics of guidance/help stuck @ moment.

i have web service pulls info response (using sharepoint workflow)

response request-

<!-- language: xml --> <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <gethouseholdbyrefresponse xmlns="http://schemas.*****.co.uk/*****/****/**"> <gethouseholdbyrefresult xmlns:i="http://www.w3.org/2001/xmlschema-instance"> <errorcode>0</errorcode> <errormessage i:nil="true" /> <success>true</success> <household> <userfieldlist /> <caseworkercontactname></caseworkercontactname> <caseworkercontacttelno></caseworkercontacttelno> <companycode>001 </companycode> <contactkey>00000</contactkey> <correspondenceaddress /> <correspondencedesignation></correspondencedesignation> <correspondencepostcodevalue i:nil="true" /> <correspondencepreamble></correspondencepreamble> <description>joe bloggs </description> <displaycompanycodes></displaycompanycodes> <emailaddress></emailaddress> <forwardingaddress /> <forwardingdesignation></forwardingdesignation> <forwardingpostcodevalue i:nil="true" /> <forwardingpreamble></forwardingpreamble> <id>000000000</id> <isvulnerable>false</isvulnerable> <nextofkinaddress /> <nextofkindesignation></nextofkindesignation> <nextofkinname></nextofkinname> <nextofkinphone></nextofkinphone> <nextofkinpostcodevalue i:nil="true" /> <nextofkinpreamble></nextofkinpreamble> <numberofchildren>0</numberofchildren> <postcodevalue>ab1 c23 </postcodevalue> <propertyreference i:nil="true" /> <reference>000000000 </reference> <referralcontactname></referralcontactname> <referralcontacttelno></referralcontacttelno> <size>1</size> </household> </gethouseholdbyrefresult> </gethouseholdbyrefresponse> </s:body> </s:envelope>

as can see returns lot of information, don’t need, want pick out element description example

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" encoding="utf- 8" indent="no"/> <xsl:template match="/"> <xsl:value-of select="description"/> </xsl:template> </xsl:stylesheet>

i nil back, there no description. know there description when test next code transforms entire result string, suggests have got of xsl language wrong when trying specify 1 element

<xsl:output method="xml" encoding="utf- 8" indent="no"/> <xsl:template match="/"> <xsl:value-of select="*"/> </xsl:template> </xsl:stylesheet>

any help appreciated

also, if there people out there on subject interested hear if recommend resources larn this. thanks

yes, there is description, (1) not kid of / root node, , (2) , ancestors have namespaces need define , utilize when addressing them, e.g.:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:x="http://schemas.*****.co.uk/*****/****/**" exclude-result-prefixes="s x"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <output> <xsl:value-of select="s:envelope/s:body/x:gethouseholdbyrefresponse/x:gethouseholdbyrefresult/x:household/x:description"/> </output> </xsl:template> </xsl:stylesheet>

xml web-services xslt soap

ruby on rails - Using wisper (pubsub library) with Devise -



ruby on rails - Using wisper (pubsub library) with Devise -

i'm trying figure out how utilize wisper devise.

when new user business relationship registered, want create sample info user.

so in user model have:

include wisper::publisher after_create :notify def notify publish(:user_created, self) end

and listener like:

class sampledatacreator def user_created(user) user.widgets.create!(name: "your first widget") end end

but can't figure out how tie devise. how can configure sampledatacreator hear events devise user model?

update

i've tried attaching listener in devise registration controller follows:

class registrationscontroller < devise::registrationscontroller def create super |resource| resource.subscribe(sampledatacreator.new) end end end

but seems listener never gets triggered.

update 2

i realised above approach wasn't working because record saved before yield called. seems tricky hook devise before point, instead overrode whole method:

def create build_resource(sign_up_params) resource_saved = resource.save yield resource if block_given? resource.subscribe(sampledatacreator.new) # <-------------------- add-on if resource_saved if resource.active_for_authentication? set_flash_message :notice, :signed_up if is_flashing_format? sign_up(resource_name, resource) respond_with resource, location: after_sign_up_path_for(resource) else set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format? expire_data_after_sign_in! respond_with resource, location: after_inactive_sign_up_path_for(resource) end else clean_up_passwords resource respond_with resource end end

this works, although it's not elegant.

update 3

i found much simpler way, can hook build_resource:

class registrationscontroller < devise::registrationscontroller def build_resource(sign_up_params) super.subscribe(sampledatacreator.new) end end

i subscribe sampledatacreator globally.

i saw complex project listeners unsubscribing , subscribing times. chaotic. recommend avoid subscribe/unsubsribe dynamics.

ruby-on-rails ruby devise publish-subscribe wisper

sql - DB2 Stored Procedure parameter "is not valid in the context where it is used" -



sql - DB2 Stored Procedure parameter "is not valid in the context where it is used" -

i trying create next stored procedure:

-- <scriptoptions statementseparator="@"/> -- <scriptoptions errors="off" platform390="off"/> @ drop specific procedure depclh.gettransactionsummarybydaterange@ create procedure depclh.gettransactionsummarybydaterange (in p_dchdsb_id integer,in p_startdate varchar(50),in p_enddate varchar(50)) specific depclh.gettransactionsummarybydaterange language sql result set 1@ begin declare c_output cursor homecoming select sub.dchdsb_id facilityid, sub.dchdsb_code facilitycode, sub.name facilityname, sum(dep.amount) "totalamount", count(*) "transactioncount" depclh.deposit_subscriber sub inner bring together depclh.deposit dep on dep.dchdsb_id=sub.dchdsb_id sub.dchdsb_id=p_dchdsb_id , dep.created_ts between p_startdate , p_enddate grouping sub.dchdsb_id,sub.dchdsb_code,sub.name read only; open c_output; end @ grant execute on specific procedure depclh.gettransactionsummarybydaterange public @ commit @

i receive next error:

db21034e command processed sql statement because not valid command line processor command. during sql processing returned: sql0206n "p_dchdsb_id" not valid in context used. line number=3. sqlstate=42703

typo found in code. give thanks eye!

-- <scriptoptions statementseparator="@"/> -- <scriptoptions errors="off" platform390="off"/> @ drop specific procedure depclh.gettransactionsummarybydaterange@ create procedure depclh.gettransactionsummarybydaterange (in p_dchdsb_id integer,in p_startdate varchar(50),in p_enddate varchar(50)) specific depclh.gettransactionsummarybydaterange language sql result set 1 begin declare c_output cursor homecoming select sub.dchdsb_id facilityid, sub.dchdsb_code facilitycode, sub.name facilityname, sum(dep.amount) "totalamount", count(*) "transactioncount" depclh.deposit_subscriber sub inner bring together depclh.deposit dep on dep.dchdsb_id=sub.dchdsb_id sub.dchdsb_id=p_dchdsb_id , dep.created_ts between p_startdate , p_enddate grouping sub.dchdsb_id,sub.dchdsb_code,sub.name read only; open c_output; end @ grant execute on specific procedure depclh.gettransactionsummarybydaterange public @ commit @

sql db2

jhipster - Injection code is there in spite of ngmin -



jhipster - Injection code is there in spite of ngmin -

why jhipster have these duplicate dependency lists in source files though uses ngmin automatically add together injected dependencies part of build tasks it's safe minification?

for example, there code in services.js,

jhipsterapp.factory('register', ['$resource', function ($resource) { homecoming $resource('app/rest/register', {}, { }); }]);

but since uses ngmin, expect this, without array , "$resource"

jhipsterapp.factory('register', function ($resource) { homecoming $resource('app/rest/register', {}, { }); });

is code before ngmin introduced , hasn't been simplified yet? maybe don't understand properly.

jhipster

The type or namespace pushPin could not be found in Windows Phone 8 -



The type or namespace pushPin could not be found in Windows Phone 8 -

when i'm trying add together pushpin map getting error "the type or namespace pushpin not found in windows phone 8". can tell me reference i'm missing. using default maps windows phone

code i'm using add together pushpin below.

class="lang-cs prettyprint-override">maplayer layer = new maplayer(); pushpin pp = new pushpin(); pp.geocoordinate = mygeoposition; mapoverlay overlay1 = new mapoverlay(); overlay1.content = pp; overlay1.geocoordinate = mygeoposition; layer1.add(overlay1); mymap.layers.add(layer);

thanks in advance !!!

try this

maplayer layer = new maplayer(); ellipse ellipse = new ellipse(); ellipse.width = 25; ellipse.height = 25; ellipse.fill = new solidcolorbrush(color.fromargb(75, 200, 0, 0)); mapoverlay overlay1 = new mapoverlay(); overlay1.content = ellipse; overlay1.geocoordinate = mygeoposition; layer1.add(overlay1); mymap.layers.add(layer);

hope helps.

windows-phone-7 windows-phone-8 maps pushpin

go - How to connect several pipe command in slice -



go - How to connect several pipe command in slice -

i have check link how connect 2 pipe command below code.

func main() { c1 := exec.command("ls") c2 := exec.command("wc", "-l") c2.stdin, _ = c1.stdoutpipe() c2.stdout = os.stdout _ = c2.start() _ = c1.run() _ = c2.wait() }

but have several command more 2. command run c1 | c2 | c3 | c4 | c5, , these commands set in slice([](*exec.cmd)).

question: how can loop piece , execute command sequence , final result? thanks.

you have doing currently, except have loops. here total illustration nil more own illustration case:

package main import ( "os" "os/exec" ) func main() { var err error // store error during processing. should check errors , handle them. that's not option. var commands []*exec.cmd // piece store commands. // own commands commands = append(commands, exec.command("ls")) commands = append(commands, exec.command("wc", "-l")) // connect each command input output of previous command (starting sec command, obviously) := 1; < len(commands); i++ { commands[i].stdin, err = commands[i - 1].stdoutpipe() if err != nil { panic(err) } } commands[len(commands)-1].stdout = os.stdout // lastly command output connected standard output // start each command. note reverse order isn't mandatory, have avoid runing first command := len(commands) - 1; > 0; i-- { err = commands[i].start() if err != nil { panic(err) } } // run first command commands[0].run() // wait each subsequent command finish := 1; < len(commands); i++ { err = commands[i].wait() if err != nil { panic(err) } } }

go