Posts

iphone - getting the details to show above an annotation -

iphone - getting the details to show above an annotation - ok have annotations showing fine can't figure out how little dialogue box thing appear above it. when create annotation, this: annotation *annot = [[annotation alloc] init]; annot.coordinate = touchmapcoordinate; annot.title = @"location"; annot.subtitle = @"the address"; [self.mapview addannotation:annot]; again, works find doesn't show little dialogue box. i understand has delegate. downloaded apple's mapcallouts illustration code , couldn't figure out how contacted delegate annotations. here annotations class annotation.h #import <foundation/foundation.h> #import <mapkit/mapkit.h> @interface annotation : nsobject <mkannotation>{ cllocationcoordinate2d coordinate; nsstring *title; nsstring *subtitle; } @property (nonatomic) cllocationcoordinate2d coordinate; @property (nonatomic, copy) nsstring *title; @property (nonatomic, copy) nsstring...

c - pipe chain between processes -

c - pipe chain between processes - i want have 1 parent 2 children. the parent reads file "a.txt" , sends trough pipe first child; first kid reads chars , sends sec kid lower letter chars. the sec kid prints in "b.txt" each distinct char , number of appearances(per line) , sends trough pipe parent number of distinct chars. parent prints result sec child. i've done pipe parent 1 kid , test i've set pipe parent. can't figure out how create pipe go sec child. i've been searching info on dup2 don't on how create work. #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include <unistd.h> #include <ctype.h> #include <fcntl.h> void main() { int pfd1[2], pfd2[2], pid1, pid2, pfin, status, fd; char *c = (char *)malloc(sizeof(char)); if (pipe(pfd1) < 0) { printf("eroare la crearea pipe-ului\n...

java - Create a password protected excel file using apache poi? -

java - Create a password protected excel file using apache poi? - i developing simple java programme create excel file using (apache poi) api. using oracle 10g database , using ojdbc14 jar. i have table called userinfo having 3 columns namely username,password , name. using apache poi , have been able set rows in excel file. since file contain sensitive info such username , password, want create password protected. on forums , have found how read password protected files not how create them. how can accomplish this? thanks in advance. updated: of version 3.10 poi supports encryption decryption xlsx files. see the "encryption support" page on poi's website. below still relevant xls binary workbooks. according the "encryption support" page on poi's website poi supports reading encrypted xls , xlsx files. encrypting not mentioned on page, implies it's not supported. backed searching poi site "encrypt" returns handful...

c - read an unknown number of lines -

c - read an unknown number of lines - i need implement in c programme ,which reads unknown number of lines stdin. know maximum number of lines 100. tried utilize gets ,but don`t know when stop loop. can advise me how implement it? this depends on when want programme stop. there several mutual approaches: never: run infinite loop until end-user hits ^c or otherwise terminates programme using facilities of operating system until user enters special marker, i.e. "keyword" quit , exit , etc. on line itself until user enters empty line (i.e. hits enter ) since max number in case 100, can utilize limit automatically terminate input 1 time max reached. c input stdin gets

c++ - Strange behaviour updating sprite position -

c++ - Strange behaviour updating sprite position - i'm coding simple roguelike game in c++ using sdl library, , have problems moving character on screen. each time frame needs rendered, update position of sprite using update() function, nil if player standing still. issue motion command, , starting animation, utilize step() function called 1 time per each player motion 1 tile another. upon receiving "up" command, game behaves fine , character moves smoothly in 1 sec new position. however, when "down" command given, moves @ half speed, , after 1 sec has passed, instantly "teleported" final position, sudden flicker. code motion identical, fact in 1 case delta motion summed y position, in other case subtracted. maybe fact position integer , delta double causing problems? sum , subract behave differently (maybe different rounding)? here relevant code (sorry length): void player::step(player::direction dir) { if(m_status != standing) //...

.net - Validating xml signature on part of the document using SignedXml -

.net - Validating xml signature on part of the document using SignedXml - i using signedxml class validate signature in xml document. signature refers part document. i able verify signature, how can sure signature signing specific part of document need validate? sign different part of document using same key , signature still valid. from understand, signedxml automatically verifies signature against part of document that's supposedly signed. a digital signature verified passing signature value and data/content that's supposedly signed (or hash value of it). means if signature verifies, can sure right part of document signed. if signs different part of document , you're verifying signature against non-signed part of document, won't positive result. , due construction of xml, signedxml verifies signature against what's suppposedly signed, not against else. .net xml xml-signature xml-dsig

java - Android how to add a Linearlayout to another LinearLayout from code -

java - Android how to add a Linearlayout to another LinearLayout from code - i have linearlayout in main.xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="fill_parent" android:orientation="vertical" android:id="@+id/mainlayout" > </linearlayout> i have made xml file, called item_box.xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/item_bg" android:gravity="right" > <imageview android:id="@+id/imageview1" a...