Posts

scripting - Categorize the output of ec2-describe-images or ec2-describe-instances -

scripting - Categorize the output of ec2-describe-images or ec2-describe-instances - is there command/tool/script categorize bulky output of ec2-describe-images or ec2-describe-instances . i have list of around 100 servers each , every detail. want categorize them under suitable headings - reservation , instance , blockdevice , tag (whatever category available on output). did sorted? if not... run ec2-describe-images alternative --headers give categories ec2-describe-images --private-key ~/private.key --cert ~/my.crt --region us-west-1 --headers if want fields pipe output of above through linux command cut picking fields (columns) after. want imageid, name , architecture these fields 2,3 , 8 of output above. example. ec2-describe-images --private-key ~/private.key --cert ~/my.crt --region us-west-1 --headers | cutting -f2,3,8 -s doing same ec2-describe-instances similar. scripting data-processing

php - Rewrite URL for hyphens on URL -

php - Rewrite URL for hyphens on URL - i trying enable mod_write's rewrite url , not able work hyphens in url format. please assist me on this. www.domain.com/username/lord-voldermort redirect www.domain.com/user.php?username=lord voldermort this should work: rewriterule ^username/([a-z0-9\-]+)$ /user.php?username=$1 [qsa,nc,l] php mod-rewrite

c# - Using objects from one class in another class -

c# - Using objects from one class in another class - i have 2 classes teacher , student . trying teacher utilize class functions in students. problem having need number of pupil object beingness used in teacher random. thought figured out in constructor, had declare new pupil object in every function of teacher utilize student. creates new pupil object me no good. here code class teacher { private bool absence; private bool level; private static int uniqueid = 0; private arraylist arraylist = new arraylist(); private arraylist arraylist1 = new arraylist(); private int id = 0; private int numpages; private char present; random random = new random(); int randomlevel = random.next(20, 30);//this line not work, if utilize randomlevel in in line below creating pupil objects pupil student = new student(); int maybe; public teacher() { int randomlevel = random.next(1, 3); id = uniqueid; ab...

c++ - C server socket accepts clients with no request -

c++ - C server socket accepts clients with no request - i'll maintain simple. code: #include "stdafx.h" #include <winsock2.h> #include <conio.h> #include <iostream> #include <stdio.h> #include <tchar.h> int _tmain(int argc, _tchar* argv[]) { wsadata wsadata; int error = wsastartup(0x0202, &wsadata); if(error) printf("winsock error!"); socket server; struct sockaddr_in server_addr; server_addr.sin_family = af_inet; server_addr.sin_port = htons(5657); server_addr.sin_addr.s_addr = htonl (inaddr_any); server = socket(af_inet, sock_stream, 0); if (server == invalid_socket) printf("invalid socket!"); error = bind(server, (lpsockaddr)&server_addr, sizeof(server_addr)); if(error) printf("connect error!"); listen(server, somaxconn); printf("server established! listening...\n"); sockaddr_in client_addr; soc...

c# - Winforms Notification Icon duplicates in the System Tray -

c# - Winforms Notification Icon duplicates in the System Tray - i working on winforms application , have show application icon(notification icon) in scheme tray. things working fine. when go sub page main page , come , check scheme tray has 2 notification items in scheme tray. 1 time again when go page , see, duplicate icon appears in scheme tray. number of notification icons gets increment when go page , come back. if can guide me have gone wrong, appreciate. in advance... since you're not giving code, i'm gonna go on hunches , lucky guesses: the logic implemented generate notification icon gets executed on event occurs when alter page in app. (likely) there chipmunk lives within computer, , felt mon messing-with-da-master day. (not likely) c# windows winforms visual-studio

windows - Hide logical construct in batch file, but show commands actually executed -

windows - Hide logical construct in batch file, but show commands actually executed - i have batch file in have if/else if block. not want block "echoed" user, doing prints total screen of complex logic hard understand what's executing out of it. however, commands executed within block echoed user. putting @ in front end of first if hides entire statement , there doesn't seem way "unhide" portions. attempting utilize @echo off , @echo on turn screen reporting off main statement , on logic branches doesn't seem either. help? it's not pretty, works: @echo off if 1==1 ( echo on %%a in (1) echo command 1 %%a in (1) echo command 2 ) you can lessen amount of typing little macro. illustration shows how handle embedded command. @ in front end of () results echo off commands within do() clause. without it, whole (...) echoed each command within. @echo off setlocal set show=for %%a in (1) if 1==1 ( echo on %show% echo com...

haskell - How are the Haddock module fields Portability, Stability and Maintainer used? -

haskell - How are the Haddock module fields Portability, Stability and Maintainer used? - in lots of haddock-generated module documentation (e.g. prelude ), little box in top-right can seen, containing portability, stability , maintainer information: from looking @ source code such modules , experimentation, confirmed info generated lines next in module description: -- maintainer : libraries@haskell.org -- stability : stable -- portability : portable there several unusual things this: the fields only seem work in order — fields set out of order treat part of module description itself. despite fact order in source file opposite of order in generated documentation! i have been unable find official documentation of these fields. there cabal bundle property named stability , illustration values of match values i've seen in equivalent haddock fields, beyond that, i've found nothing. so: how these fields intended used, , documented anywhere? in pa...