Posts

Showing posts from February, 2014

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...

java - How to develop Tomcat applications with SpringSource Tool Suit? -

java - How to develop Tomcat applications with SpringSource Tool Suit? - i want objects of tomcat web application controlled maven's pom , spring's ioc, including session scoped beans. application consists of several objects accessed jsp files. what best way design such application suit tools? should utilize spring mvc project template though don't want implement mvc tiers? or there template somewhere on net? the way using sts this. go to file --> new --> project --> maven project--> create simple project (skip archtype) --> come in artifact details. for example: grouping id: com.examples artifact id: myproject click on finish. now right click project in project explorer , select spring tools--> add together spring project nature. i utilize simple project because using same pom.xml across projects , add/remove dependencies when needed. sample pom.xml going spring <dependencies> <dependency> ...

c - How to download entire directory in sftp using libcurl -

c - How to download entire directory in sftp using libcurl - i programing in c. want download particular directory server (sftp) using libcurl. know can download file using next alternative how download directory. sftp wildcardmatch alternative not supported can download files in directory atleast. curl_easy_setopt(curl, curlopt_writedata, fd); platform: linux you need explicitly list directory, , download every file within not . or .. (possibly recursing on sub directories). so issue first request list directory. build (locally) array of entries obtained request. then, each such entry, issue request download file, or, if [sub-]directory, recurse inside. and have issues if client of ftp server add together or delete files in same directory. btw, ftp servers able e.g. archive entire directory foo/ if retrieve foo.tar.gz etc.. c linux curl libcurl sftp

html - jQuery remove class when adding it to other elements -

html - jQuery remove class when adding it to other elements - i have 6 images in line, first 1 when page loads has class applied using css3 applies web transformations. when other images hovered on same class applied these, removed when mouseout. final thing need accomplish when other images hovered on first 1 has class removed, , if no images hovered on first 1 has class applied again. here have far: $(document).ready(function() { $("#imagepackshot li img").hover(function(){ $(this).addclass('packshot').siblings().removeclass('packshot'); }, function () { $(this).removeclass('packshot'); }) .first().addclass('packshot'); }); you'll want check after remove class whether there no other images class 'packshot', in case add together first one. $(document).ready(function() { var activeclass = 'packshot', images = $("#galleryslideshow li img"); ...

c++ - How to use pointers in for loops to count characters? -

c++ - How to use pointers in for loops to count characters? - i looking through forums , saw question counting numbers of each letter in string. teaching myself , have done research , starting projects. here have printed elements of array. without pointers. know can utilize pointer array , have increment each value, need help doing so. here code without pointer: code main() { char alph [] = {'a', 'b', 'c'}; int i, o; o = 0; for(i=0; < 3; i++) { cout << alph[i] << ' '; }; }; here bad code doesn't work trying pointer work. main() { char alph [] = {'a', 'b', 'c'}; char *p; p = alph; (; p<=3; p++); cout << *p; homecoming 0; }; i hope it's not obvious of answer; don't mean waste anyone's time. first post if wants give me advice, give thanks you. very try. there's 1 tiny thing wrong, this: p <= 3 pointe...

java - Set bind view in simple adapter? -

java - Set bind view in simple adapter? - i want setup view binder in simple adapter show photos contacts, set 2 text view's name , number hash map, 3rd value image view want set contact photo corresponding contact id. give thanks in advance, wolf. here code : arraylist<hashmap<string, string>> mapa = new arraylist<hashmap<string, string>>(); contentresolver cr = getcontentresolver(); cursor cur = cr.query(contactscontract.contacts.content_uri, null, null, null, null); if(cur.getcount() > 0){ while(cur.movetonext()){ id = cur.getstring(cur.getcolumnindex(contactscontract.contacts._id)); string photouri = cur.getstring(cur.getcolumnindex(contactscontract.contacts.photo_id)); if(integer.parseint(cur.getstring(cur.getcolumnindex(contactscontract.contacts.has_phone_number))) > 0){ final cursor numcur = cr....

android - How to stop the Date Picker Dialogue-box Date to set the previous Dates. It should allow only above System current date date -

android - How to stop the Date Picker Dialogue-box Date to set the previous Dates. It should allow only above System current date date - hi every 1 in advance.. have requirement in app have date picker set date. want restrict date picker set date above scheme current dates not below scheme current date. how....? can 1 help me out this.... , how validate scheme current date date picker date. in case can extend datepickerdialog , create own implementation of ondatechanged , called everytime date changes , parameters datepicker, , new year, month , day values, you can check if date past , in case throw error (with toast or whatever) , phone call datepicker.updatedate() set right value (so datepicker allways in consistent state). also, can phone call datepicker.init(year, monthofyear, dayofmonth, ondatechangedlistener); can pass ondatechangedlistener implementation without having extend datepickerdialog. edit: (i never seek think can done work..) datepi...

mysql multiple many to many joins -

mysql multiple many to many joins - i have events, events_styles, events_formats tables (an event can have many styles , many formats) trying filter events have events_styles bring together , events_formats join. query should select events particular style , particular format - attempts far: select * events bring together events_styles on events.id = events_styles.event_id bring together events_formats on events.id = events_formats.format_id events_styles.style_id = 3 , events_formats.format_id = 1; empty set (0.00 sec) select * events_styles events_styles.style_id = 3 +----------+----------+ | event_id | style_id | +----------+----------+ | 3 | 3 | | 2 | 3 | | 4 | 3 | +----------+----------+ 3 rows in set (0.00 sec) select * events_formats events_formats.format_id = 1 +----------+-----------+ | event_id | format_id | +----------+-----------+ | 1 | 1 | | 3 | 1 | | 4 | 1 ...

vim - Using tabs in gvim along with specific number of lines and columns -

vim - Using tabs in gvim along with specific number of lines and columns - i have problem setting in gvimrc. have windows same size specify following: set lines=90 set columns=90 this works fine except when open gvim -p argument multiple tabs. statusline , ruler hidden until manually resize window. happens when lines/columns specified , utilize -p argument. there way prevent on startup other manually dragging window around redraw ruler/statusline? i'm using gvim 7.3.154 in ubuntu 11.10. the solution spelled out when reading gvim documentation on 'lines', see :help lines. from :help lines "if less lines expected, check 'guiheadroom' option. when set alternative , vim unable alter physical number of lines of display, display may messed up." i able set guiheadroom=100 on scheme , avoid problem completely. 100 guess on part. default value 50, if run problem should set > 50. able go little 80, mileage vary depending on os,...

rails 3 how to find_or_create_by method, how to set additional attributes on the new object -

rails 3 how to find_or_create_by method, how to set additional attributes on the new object - this happening in approval model. approval has attribute :email. saying self.email calling object of approval class email attribute. enter code here def associate_correct_user new_user = user.find_or_create_by_email self.email |u| u.invite! end if creating user here need pass 2 other attributes (first_name , last_name). attributes need pulled model email, self.email been validated against. this makes sense in head: def associate_correct_user new_user = user.find_or_create_by_email self.email |u| user = email.find_by_email(self.email) u.first_name = user.first_name u.last_name = user.last_name u.invite! end this creates user, not set first_name , last_name attributes new user... show me lines of log/development.log when user created. may first_name , last_name protected attributes. here have illustration of find_or_create_...

variables - batch scripting: how to get parent dir name without full path? -

variables - batch scripting: how to get parent dir name without full path? - i'm working on script processes folder , there 1 file in need rename. new name should parent directory name. how in batch file? total path dir known. it not clear how script supposed become acquainted path in question, next illustration should @ to the lowest degree give thought of how proceed: for %%d in ("%cd%") set "dirname=%%~nxd" echo %dirname% this script gets path cd variable , extracts name dirname . variables batch-file directory parent

Is it possible to remove a Facebook application from the Page using Graph API? -

Is it possible to remove a Facebook application from the Page using Graph API? - i'm developing facebook app. the tab removes correctly, there way remove application page? i supposed necessary info might retrieved page settings , tried using graph api: https://graph.facebook.com/%my_page_id%/settings/?access_token=%valid_token% but returns error: "(#210) subject must page." i've tried play https://www.facebook.com/ajax/edit_app_settings.php requires unique variables generated facebook server , not available 3rd side. removing of application pages not possible using graph api (deprecated rest api missed alternative too). you can remove tab (what do) page. 1 time tab removed application available on page settings , links tab of application point page wall/landing tab. facebook facebook-graph-api

http - Does REST send its payload in the URL of the request? What about SOAP? -

http - Does REST send its payload in the URL of the request? What about SOAP? - do soap , rest set respective payloads url? example: http://localhost/action/?var=datadatadata i know soap uses xml , runs on different port on server, still submit info illustration above or send 1 big xml encapsulated packet port? it depends on http method. method set url while post method set path info in url , rest of them streamed http request body. soap should rely on http protocol , hence should follow same rule. check out http://www.w3.org/tr/soap12-part0/#l10309 http rest soap

Migration to Windows 7 32 bit -

Migration to Windows 7 32 bit - currently using vs2008, xp service pack 3 , dotnet framework 2 develop desktop applications. if run applications in windows 7 (32bit), else need do? thanking in anticipation. regards skpaul xp service pack should back upwards latest dotnet framework, can test see if application still run. if do, can migrate win7 32bit safely. i'd advice take caution , backup if necessary. windows-7

In MySQL 5, what's the convention for returning an error level and a resultset? -

In MySQL 5, what's the convention for returning an error level and a resultset? - in mysql 5, stored procedure can homecoming number of output parameters, this: create procedure `test1`(in in1 varchar(64), in in2, out out1 varchar(64), out out2 int, out out3 int) in mysql 5, stored procedure can return/print resultset, this: create procedure `test2` () begin select * `table`; end$$ this nice , flexible. in trying communicate outside world, what's convention using flexibility give notice of results (if any) , errors (if any)? examples: do set error messages in our output parameters? set them in resultsets? do print out multiple successive resultsets? or limit ourselves 1 resultset? do set resultset null if there errors? do utilize output paramenter integers errors, 0 beingness error free? do utilize output parameter varchars errors, '' (empty string) meaning error free? i think makes sense utilize signals returning error if it...

c++ - Disable "deletion of copy constructor when move constructor is avaliable" on Clang -

c++ - Disable "deletion of copy constructor when move constructor is avaliable" on Clang - looking here on stackoverflow found out on clang++ when using c++11 standard, if have defined move constructor class, implicit constructor generation disabled, i.e. re-create constructor "explicted deleted". is there way disable behavior? also, behavior standardized? because don't have same behavior in gcc. is there way disable behavior? no. can always: a(const a&) = default; though i'm unsure if clang implements defaulted re-create constructors. also, behavior standardized? yes. [class.copy]/p7: if class definition not explicitly declare re-create constructor, 1 declared implicitly. if class definition declares move constructor or move assignment operator, implicitly declared re-create constructor defined deleted; ... ... because don't have same behavior in gcc. which version? would've gues...

Facebook API: Determine if Facebook Page is published / unpublished -

Facebook API: Determine if Facebook Page is published / unpublished - what reliable way check whether facebook page published or unpublished using graph api? this: http://graph.facebook.com/{page_id} and check if homecoming value "false". if it's false, conclude it's unpublished , if returns graph object, conclude it's published. i'm noticing lot of published pages homecoming "false" above request. here's example: this page published: http://www.facebook.com/ajirestaurant but these requests homecoming false: http://graph.facebook.com/104433516257517 (using page id) http://graph.facebook.com/ajirestaurant (using page username) what best way check whether page published? punch in under fql query on http://developers.facebook.com/tools/explorer select page_id, name, username, is_published page page_id in (select page_id page_admin uid = me()) , is_published="" order fan_count desc that ...

Odd behavior of backspace in Vim (SSH to Linux from Mac) -

Odd behavior of backspace in Vim (SSH to Linux from Mac) - i didn't alter setting of vim, today backspace gets crazy behavior. every time when nail it, not delete character, prints ^? . knows going on? the problem comes communication between mac terminal linux terminal. go mac terminal -> preferences -> advanced tab, check alternative "delete sends ctrl-h". after login linux, , backspace works fine in vim. vim backspace

sql server - Transforming SQL statement - no cursors and loops needed? -

sql server - Transforming SQL statement - no cursors and loops needed? - i have got next sql statement (sql server): declare @atr nvarchar(255), @con nvarchar(1000), @func nvarchar(5); set @con='example' set @func=(select fncelem cndsc name @con) declare atr_cursor cursor select atrbt cnea (elems '%'+@func+'%' , not elems '%1' + @func + '%'); open atr_cursor; fetch next atr_cursor @atr; while @@fetch_status = 0 begin declare @sqlstring nvarchar(500); if (select count(*) cnextra atr ''+@atr+'' , name ''+@con+'')>0 begin set @sqlstring= n'select name, atr, cnval, inrdr cnextra atr ''' + @atr + ''' , name '''+@con+''';'; end else begin set @sqlstring= n'select '''+@con+''' name, '''+@atr+''' atr, '''' cnval, '''' inrdr'; end...

thin client - Terminal Services - can a user's physical location be identified? -

thin client - Terminal Services - can a user's physical location be identified? - when using terminal services (maybe or maybe without citrix add-ons), can physical location of user identified? the client workstation h/w mixture - windows pc, other times lean client unit (eg wyse, etc). our app needs vary business functionality based, essentially, on location of user. instance, compliance different state laws, or cash handling (a cash drawer can used workstation @ branch or store, can't accessed other branches or stores). also can't depend on user's logon identify location - while users working @ 1 location, users travel 1 location another. having different logons each location not option, security , audit reasons. other asking user (a problematic solution, sure), there apis, systemic back upwards or techniques addressing type of need? thanks! on remote desktop server, can identify approximate physical location of user based on ip address. can...

android - Implicit intent within same application -

android - Implicit intent within same application - how build intent , manifest can invoke activity application implicit intent. the thought writing general code wish utilize in number of applications. code held in android library , linked using application. general code opens activity , work. 1 time done (user clicks button) needs transfer activity specific application. as per understanding on questions, you can declare activity specified implicit intent in application's manifest file.. for example: if want create application view image application , have utilize application on device can allow other activity view image using implicit intent action.view ,just <activity android:label="@string/app_name" android:name=".myimagevieweractivity"> <intent-filter> <action android:name="android.intent.action.main"> <category android:name="android.intent.ca...

linux - ecryptfs size different from home directory size -

linux - ecryptfs size different from home directory size - i'm puzzled. harddisk total , of space used .eryptfs/$myusername (810.4 gb). strangly, home directory /home/myusername (22.2gb) consumes less diskspace. thought wrong or "missing" free space? ecryptfs slightly pads files, , overhead of encryption increment on disk usage, certainly not grade describe, 37x! the disk usage matters of /home/.ecryptfs/$user directory, encrypted files stored on disk. you're seeing in terms of usage of $home phantom -- cleartext decryption of files appears in memory, , not on disk. to see true usage, use: df -h /home du -sh /home linux ubuntu-11.04 diskspace ecryptfs

iphone - Issues generating Push Notification SSL Certificate -

iphone - Issues generating Push Notification SSL Certificate - i'm trying generate apple force notification service ssl certificate - here's screen-grab: (blurred certificate name privacy purposes) but after hanging @ screen 2 minutes, maintain getting error: i'm doing right, checked , re-did steps, several times, verified using multiple sources (like http://mobiforge.com/developing/story/programming-apple-push-notification-services) - error keeps popping up. anyone have thought what's going on or how solve it? , in error, says "or seek using provisioning portal" - know they're talking about? mean know provisioning profile is, poked around in there - supposed click or there? any help appreciated. this have happened me sometime. think got solved using apple id(since company had one). may not necessary. seek doing after sometime, clearing browser cache. should work, if doing correct iphone push-notification ssl-certificate...

Opencv can write flv format? -

Opencv can write flv format? - try pastebin code....keep 1 test.avi file in same folder...please check whether opencv create new.flv i tried write avi file - this works cvvideowriter *vdowriter = cvcreatevideowriter( "/path/converted.avi", cv_fourcc('m', 'j', 'p', 'g'), 20.0, cvsize(640,480) ); similarly tried write flv file - this doesnt works cvvideowriter *vdowriter = cvcreatevideowriter( "/path/converted.flv", cv_fourcc('f', 'l', 'v', '1'), 25.0, cvsize(640,480) ); you can seek recompiling opencv ffmpeg. go opencv folder type cmake see if lists ffmpeg video encoder/decoder if specify ffmpeg download , install site: http://ffmpeg.org/download.html run cmake 1 time again in opencv folder run create , create install in opencv folder you can utilize tutorial more assistance: http://www.rainsoft.de/projects/ffmpeg_opencv.html...

user - entities in different bundles -

user - entities in different bundles - i'm using symfony 2 , have 2 entities in different bundles like: //this class overrides fos_user class //user\userbundle\entity\user class user extends baseuser { //.. /** * @orm\onetomany(targetentity="news\adminbundle\entity\news", mappedby="author_id") */ protected $news_author; //... } //news\adminbundle\entity\news class news { //... /** * @orm\manytoone(targetentity="\user\userbundle\entity\user", inversedby="news_author") * @orm\joincolumn(name="author_id", referencedcolumnname="id") */ protected $news_author; //... } both classes (entities) works fine. have setup fos_user bundle registration , other stuff. same if news class. build relation between 2 classes oneto many (user -> news) shown in code. works fine without errors , can add together news belongs user. problem when buil...

asp.net - What's the best way to cache complicated search queries in a .NET webapp? -

asp.net - What's the best way to cache complicated search queries in a .NET webapp? - i have website allows users query specific recipes using various search criteria. example, can "show me recipes can create in under 30 minutes utilize chicken, garlic , pasta not olive oil." this query sent web server on json, , deserialized searchquery object (which has various properties, arrays, etc). the actual database query expensive, , there's lot of default search templates used quite frequently. reason, i'd start caching mutual queries. i've done little investigation various caching technologies , read plenty of other posts on subject, i'm still looking advice on way go. right now, i'm considering next options: built in system.web.caching : provide lot of command on how many items in cache, when expire, , priority. however, cached objects keyed string, rather hashable object. not need able convert searchquery object string, hash have ...

jqGrid ASP.NET MVC3 + EF: Which is the best method to implement search? -

jqGrid ASP.NET MVC3 + EF: Which is the best method to implement search? - i'm still trying implement research in jqgrid + mvc3, far without success. meanwhile solve me this, i wondering in sentiment between these 2 articles best search implementation , whether there valid alternatives: using jqgrid’s search toolbar multiple filters in asp.net mvc ilya builuk jqgriddemo @oleg sense sec solution more elegant , complete, i'm still having problems. moreover, in code used javascriptserializer , read in this blog "the javascriptserializer type marked obsolete prior .net framework 3.5 sp1"...and this give-and-take me more confused this... personally, still having problem objectquery because calculated properties of entities, no reside dataset ... thank , apologize if questions can trivial most, beginner...and i'm trying learn...thx asp.net-mvc asp.net-mvc-3 entity-framework search jqgrid

flash - Counting all 'drawing objects' on stage -

flash - Counting all 'drawing objects' on stage - i have little problem counting all elements on stage. flash, unfortunately counting objects on stage without drawn objects (all shapes, including drawing objects, rectangles etc) missed. there way count them? thanks in advance. if referring drawing primitives, such lines , circles, no, there no way. can address , modify container (shape, sprite, movieclip, etc.), 1 time primitive vector element drawn, lose reference it. can modify bitmap data. you could, create own class , maintain counter elements flash player doesn't recognize - increment count whenever drawn , reset on graphics.clear() . flash actionscript-3 count

Picture URLs for gallery sources Android -

Picture URLs for gallery sources Android - hi im new im trying utilize image urls sources gallery pictures im having difficulty finding how works, code far. public class imageadapter extends baseadapter { private static final int item_width = 232; private static final int item_height = 150; private final int mgalleryitembackground; private final context mcontext; private final integer[] mimageids = { r.drawable.pic1, r.drawable.pic2, r.drawable.pic3, }; where set urls ? if url's web, there work done. fortunately, there many libraries offering imageview implementations handle these scenarios. check out loopj's smartimageview also greendroid more robust ui-builder implementation. android android-gallery

jira - Configure project-specific workflow without global admin permission -

jira - Configure project-specific workflow without global admin permission - as far understood way jira works, workflows defined on global level , require global "jira administrator" permission administer them. having "administrator" role project seems not sufficient edit workflow assigned project (via workflow schema). in practice, i've experienced people have global administration permissions not "motivated" care configuration of individual projects, when there dozens of them. the project admins, however, much adjust workflows , other things project. global jira admins, however, not willing set project admins "jira administrator" group, is, after all, quite reasonable. a typical result projects run more or less same way, , wonderful configuration features of jira remain unused. is there way allow people don't have global admin permission have project administration role alter workflows , other stuff their project(s) only?...

c - How to read file from local directory path -

c - How to read file from local directory path - i have 1 function reads file , conversion part. fp=fopen("newfile.txt","r"); here have copied newfile.txt in project file , compiling in vc++ 2008 ide.it works fine i read file local drive directory path.is possible read files local drive.how mention path.if please mention example. one more thing if want read files in particular folder out changing name of text files in above code. suggest me thing do. i dont want alter file name manully in code you utilize absolute path file: file* fp = fopen("c:\\your_dir\\your_file.txt", "r"); if(fp) { // fclose(fp); } or relative path, assuming file located in c:/etc , executable located in c:/etc/executables : file* fp = fopen("..\\your_file.txt", "r"); if(fp) { // fclose(fp); } c

java - How to determine value of user.home without writing a program? -

java - How to determine value of user.home without writing a program? - in windows xp system, there way determine current value of java's user.home scheme property without having write sample programme this? i.e. command line or command panel or registry, etc.? if need find exact value returned user.home in java programme when run under same user business relationship should run java programme obtain value. there no guaranteed stable mapping else on windows propery , mapping used wrong , it's not unlikely changed eventually. this bug entry describes how user.home gets it's value , discusses several alternatives might more appropriate: http://bugs.sun.com/view_bug.do?bug_id=4787931 java

sencha touch: Drag and delete -

sencha touch: Drag and delete - is there possibility in sencha touch delete icon dragging trash icon, such dragging recyclebin. please help me regarding issue i've couldn't find way create this example work on tabpanel. i managed create own bottom toolbar can drag component , delete them. hope helps sencha-touch

data structures - Search for cyclic strings -

data structures - Search for cyclic strings - i looking efficient way store binary strings in info construction (insert function) , when getting string want check if cyclic string of given string in structure. i thought storing input strings in trie when trying determine whether cyclic string of string got inserted trie means |s| searches in trie possible cyclic strings. is there way more efficiently while place complexity in trie? note: when cyclic strings of string mean illustration cyclic strings of 1011 are: 0111, 1110, 1101, 1011 can come canonicalizing function cyclic strings based on following: find largest run of zeroes. rotate string that run of zeroes @ front. for each run of zeroes of equal size, see if rotating front end produces lexicographically lesser string , if utilize that. this canonicalize in equivalence class (1011, 1101, 1110, 0111) lexicographically to the lowest degree value: 0111. 0101010101 thorny instance algo not perform wel...

Jquery Ui Drag and drop with some ease or gravity -

Jquery Ui Drag and drop with some ease or gravity - basically designer , not programmer. trying build application. can see basic code here @ jsfiddle http://jsfiddle.net/mailverma/wwftn/1/. thought is, user can sort 6 descriptive , 6 to the lowest degree descriptive words , drag , drop them in respective container. need help regarding enhancements in code. 1) issue in current code is, when reset, after that, yellowish rectangles not accepted in dotted slots. if place same yellowish rectangle in other slot accepted. don’t know reason. please help. 2) when user drags , throws yellowish rectangle towards greenish or bluish container, should go gravity force. when more half of yellowish rectangle comes within bluish or greenish container, should automatically snap available empty dotted slot. overlapping not expected here. 3) want alter class of yellowish rectangle holder in top (in code li) when yellowish rectangle dropped in bluish or greenish container....

Hook into old VB6 program with C# -

Hook into old VB6 program with C# - is there way hook old vb6 programme using c# , modify of ui? also, maybe modify of features? wouldn't know first thing doing know can stuff injecting dll's programs. need in c#. you can't inject dlls programs unless designed that, instance plugin architecture. that said can mess ui of application using specific windows api calls. instance, many, many years ago, used method alter of excel. check out link - includes source code , images of affected changes. c# vb6 hook

Association in Linq to SQL -

Association in Linq to SQL - i have pretty simple model client , item, one-to-many relation between them (one client can have many items). used designer place entities , see association between them in designer. xml reflects this: <association name="vgmficustomer_vgmfiitem" member="vgmficustomer" thiskey="customerlink" otherkey="customer" type="vgmficustomer" isforeignkey="true" /> trouble in designer.vb, there's no mention of association, cannot customer.items in code. did miss step in generating model? or maybe need add together navigation property manualy? come ef.net background, navigation properties created automatically. it sounds have association setup 1 direction, not other. in dbml, there should association element each type. may want seek removing association in designer , re-adding it. linq-to-sql

c - "Too few arguments" error trying to run my compiled program -

c - "Too few arguments" error trying to run my compiled program - i'm trying code refresh memory preparing myself course. int main(){ int x; for( x = 0;x < 10; x++){ printf("hello world\n"); } homecoming 0; } but when tried run too few arguments i compiled code above using gcc -o repeat file.c run type repeat sorry if stupid question, has been while since took introduction class. your code compiles fine. try: gcc -o helloworld file.c ./helloworld c compiler-construction

java - How to apply a JUnit @Rule for all test cases in a suite -

java - How to apply a JUnit @Rule for all test cases in a suite - i using junit 4.10 running test suites, , have implemented "retry failed test" rule next matthew farwell's awesome notes in how re-run failed junit tests immediately? post. created class "retrytestrule" next code: public class retrytestrule implements testrule { private final int retrycount; public retrytestrule(int retrycount) { this.retrycount = retrycount; } @override public statement apply(statement base, description description) { homecoming statement(base, description); } private statement statement(final statement base, final description description) { homecoming new statement() { @override public void evaluate() throws throwable { throwable caughtthrowable = null; // retry logic (int = 0; < retrycount; i++) { seek { base.evaluate(); return; } grab (throwable t) { ...

How can i set my image to the bottom of the screen in android using xml code -

How can i set my image to the bottom of the screen in android using xml code - hi have displayed png image on screen in android using xml code: android:src="@drawable/grass" but showing image @ top of screen ,now want image @ bottom of screen. make sure layout file taking total of screen setting match_parent or fill_parent both layout_height , layout_width. <relativelayout android:id="@+id/relativelayout1" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@+id/picture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/grass" android:layout_alignparentbottom="true"/> </relativelayout> android

How to give a user temporary access to edit integration stream elements in clearcase -

How to give a user temporary access to edit integration stream elements in clearcase - currently integration stream of projects in our clearcase setup can edited admin users. but have requirement give user temporary permission edit contents in integration stream. when tried edit contents, prevented doing noinact trigger, prevents user creating activities on integration stream. is there way temporarily disable trigger in particular project, stream or vob of particular user? there other method give user temporary edit privilege integration stream ? as per vonc's instruction, tried add together user excluded list of users, using mktrtype command. please find below command tried execute: cleartool mktrtype -replace -c [comment] -ucmobject -nusers [list of user ids] -preop mkactivity -execwin [windows trigger.pl location] -execunix [unix trigger.pl location] but getting error cleartool: type not specified error. can please help troubleshoot new error mes...

node.js - Nodejs Cassandra Client [node-cassandra-client] -

node.js - Nodejs Cassandra Client [node-cassandra-client] - i tried connecting cassandra cluster [version 1.0.6] via nodejs using node-cassandra-client this sample script var connection = require('cassandra-client').connection; var con = new connection({host:'x.x.x.x', port:9160, keyspace:'stats', timeout:10000}); console.log(con); con.execute('update testcf ?=? key=?', ['cola', '1', '20120132'], function(err) { if (err) { console.log("failed"); } else { console.log("success"); } }); on executing script "sys" module called "util". should have similar interface. node-cassandra-client.driver: connecting x.x.x.x:9160 {} { validators: {}, client: null, connectioninfo: { host: 'x.x.x.x', port: 9160, keyspace: 'stats', timeout: 10000 }, timeout: 10000 } node.js:201 ...

Only replace string in sql when not adjacent to other characters -

Only replace string in sql when not adjacent to other characters - i'm using mssql 2008 replace values in columns. current query is: update table set name = replace(name, 'old', 'new') i know if possible replace 'old' 'new' when 'old' not adjacent other characters. is: when occurs 'old' ensure e.g. 'bold' not become 'bnew' currently i'm retrieving results via jdbc, splitting string @ delimiter (,) , checking if string equals'old'. if want replace 'new'. takes long time retrieve results , send them back, if possible sending sql-statement containg 'old' & 'new' great! records should replaced: 'old , blabla blabla, bla' 'blabla, old, blabla' 'blabla, bla old, blabla' 'blabla, blabla, old' 'blabla, bla old bla' records shouldn't replaced: 'blaold, blabla' 'blabla, oldbla' use spaces in cla...

android - why And-engine is completely blackout on onResume overrided function? -

android - why And-engine is completely blackout on onResume overrided function? - i using andengine gles 2.0. sometime when resume activity there finish blackout in game. although update , touch events of sprites working there finish blackout on screen. problem? andengine assumes egl context invalidated, , must reload resources. typically takes non-negligible amount of time, causing black screen. efforts underway eliminate problem on android 3.0+ possible, impact android 2.x android andengine

python - Django - Unitest or Doctest? -

python - Django - Unitest or Doctest? - i'm begin 3rd medium-sized project , (for first time in life admit) start using unittests. have no thought though, method use, unitests or doctests. of methods efficient, or should beginner take implement? thanks i happen prefer unittests, both first-class , developed methods of testing, , both well-supported django (see here details). in short, there key advantages , disadvantages each: pros of unittests unittests allows easy creation of more complicated tests. if have test involves calling multiple helper functions, iterations, , other analyses, doctests can sense limiting. unittests , on other hand, writing python code- can in python can comfortably there. take code (a modified version of unittest 1 time wrote): def basic_tests(self, cacheclass, outer=10, inner=100, hit_rate=none): c = cacheclass(lambda x: x + 1) n in xrange(outer): in xrange(inner): self.assertequal(c(i), + 1) if...

override - CSS overriding when using inheritance -

override - CSS overriding when using inheritance - i'm trying override css class used display arrow. want create arrow disappear. class found in liferay theme. this css class: .v-tabsheet-tabitem-selected:after { border: 10px solid; border-bottom-width: 0; border-color: #333 transparent transparent; bottom: -6px; content: '-'; display: block; height: 0; left: 50%; margin-left: -10px; position: absolute; text-indent: -9999px; width: 0; } i did: .v-tabsheet-tabitem-selected:after{ content: none; } it not seem work, there other way? it looks arrow beingness drawn css borders, seek overriding this: .v-tabsheet-tabitem-selected:after {border: none;} css override

syntax - What is the difference between != and =! in Java? -

syntax - What is the difference between != and =! in Java? - this question has reply here: what's =! operator? [duplicate] 13 answers i looking on mock ocjp questions. came across baffling syntax. here is: class oddstuff { public static void main(string[] args) { boolean b = false; system.out.println((b != b));// false system.out.println((b =! b));// true } } why output alter between != , =! ? the question playing confusing spacing. b != b usual != (not equals) comparison. on other hand: b =! b improve written b = !b parsed as: b = (!b) thus it's 2 operators. first invert b . then assign b . the assignment operator returns assigned value. therefore, (b =! b) evaluates true - print out. java syntax

javascript - dojo toolkit closing external dialog -

javascript - dojo toolkit closing external dialog - i'm trying since yesterday how close external dialog after click on button this shows dialog: <div id="external_dialog" data-dojo-type="dijit.dialog" title="edytuj dane firmowe" href="/external/dialog" style="overflow:auto; width: 365px; height: 280px;"> </div> and dialog in external file simple form <form data-dojo-type="dijit.form.form"> <script type="dojo/event" data-dojo-event="onsubmit" data-dojo-args="e"> dojo.stopevent(e); if(!this.isvalid()){ return; } $.post('ajax/something', {name: $('#fm-name').val()}, function() { alert('ok') }); </script> <table cellpadding="0" cellspacing="2" style="width: 330px"...

java - selecting a list from a object in JPA -

java - selecting a list from a object in JPA - i have object contains list on of fields, object mapped db. trying create query select few fields object , fore mentioned list. the object mapping: @entity @table(name="buys") @primarykeyjoincolumn(name="buy_id") public class purchase extends domainobject implements serializable { @column(name = "buy_name") private string buyname; @onetomany( cascade = {cascadetype.persist, cascadetype.merge}) @joincolumn(name="buy_id", referencedcolumnname = "buy_id") private list<insersionorder> insertionorders; //other fields omitted } the query using: "select new com.dtos.domainobjects.buydto(b.id, b.buyname, b.insertionorders) purchase b b.buygroupid = :groupid , b.isdeleted = false" when running query hibernate (my jpa vendor) generates faulty query: hibernate: select buy0_.buy_id col_0_0_, buy0_.buy_name col_1_0...

c++ - Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one? -

c++ - Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one? - issue i wrote c++ project called 'foo' using microsoft visual studio 2005 verison 8.0.50727.762 (sp.050727-7600) on windows xp professional version 2002 service pack 3. built project foo.exe. then, copied file foo.exe windows server 2003 enterprise edition service pack 2. when tried run it, failed error, c:\foo.exe application has failed start because application configuration incorrect. reinstalling application may prepare problem. in event viewer > system, 3 events logged. event id: 32; source: sidebyside dependent assembly microsoft.vc80.crt not found , lastly error referenced assembly not installed on system. event id: 59; source: sidebyside resolve partial assembly failed microsoft.vc80.crt. reference error message: referenced assembly not installed on system. event id: 59; source: sidebyside generate ac...

c# - Multiple viewmodels using 1 model? -

c# - Multiple viewmodels using 1 model? - i have viewmodel1 , viewmodel2. viewmodel1 needs show info list of sort contained in model. viewmodel2 needs input info list contained in model. so both viewmodel1 , viewmodel2 need "know" model. what proper way in mvvm? should create model in app , give viewmodel1 , viewmodel2 reference or? i find helps if think of viewmodel beingness model, translated view. you have few choices: create controller sets viewmodel. selection if viewmodel needs info more 1 place. can either give viewmodel reference info needs, or create plain old .net object (pono) , have controller set you. just pass reference viewmodel suggest. useful if no interaction required between different classes wire eventaggregator, can used publish notification when models change, , pass repository viewmodels each of them can go , / store model when need to. i lastly pattern it's scalable if find need more presenters or controllers...

asp.net - Text - empty text node Problems -

asp.net - Text - empty text node Problems - i have asp.net buttons rendered on browser in different lines. assume text- empty text node because of that. since buttons displayed in different lines, on browsers noticed little space. how can clear this? dont have css adds space. if remove line spacing in editor. dont see space, can't because of formatting code. <asp:button runat="server" id="btnbutton1" text = "button1"/> <asp:button runat="server" id="btnbutton1" text = "button1"/> if want buttons positioned next each other, no space in between them, can consider using css float rule: <div style="overflow: auto"> <asp:button runat="server" style="float: left" ... /> <asp:button runat="server" style="float: left" ... /> </div> the <div> element contain both buttons, , elements after on new line. buttons...

php - Why is Post not Coming out -

php - Why is Post not Coming out - when seek post online shop doesnt show username, shows item. html: <style type="text/css"> body { background-image: url(abstractsdark6.jpg); } body,td,th { color: #fff; } </style> <center> <p>&nbsp;</p> <p><img src="tengokucraftshop.png" width="1002" height="215"> <p><span style="font-family:'myriad web pro'; font-size:12pt">thank buying 1 time access listed $10</span> <p style="font-family:'myriad web pro'; font-size:12pt">please insert minecraft username below.</p> <input type="text" value="username" name="username" method="post"> <p>&nbsp;</p> <p style="font-family:'myriad web pro'; font-size:12pt">item wish buy:</p> <form name="myform" action="purchaseconfi...

html - Get the left sidebar background to extend all the way left -

html - Get the left sidebar background to extend all the way left - i have fixed 960px layout light-gray sidebar , white else. want content of site centered within 960px layout, i'm trying figure out how background of sidebar extend way left of page css. ideas? here's photoshop mock of i'm trying achieve in css body {padding: 0px; margin: 0px;} style side bar no left margin , define width. best can without seeing code. html css