Posts

sql server - Saving to a Database using C++ -

i developing c++ application , have problem when comes save ta database. using visual studio 2010 , database using microsoft sql server database. can please achieve task since beginner in c++? if you're working ms tools, want use sql server native client

c - How to clean the Array after write some information -

i first declare pointer array int q,k; char ***scharray; scharray = malloc(sizeof(char**)*1000); for(q = 0; q < 1000; q++) { scharray[q] = malloc(sizeof(char*)*100); for(k = 0; k < 1000; k++) { scharray[q][k] = malloc(sizeof(char)*100); } } char buf[80]={0}; then read data pipe put in buf , copy pointer array strcpy(scharray[commandnum][0], buf); after that, want clean content of pointer array. use following code. scharray[commandnum][0]=null; after that, cannot write data scharray[commandnum][0] code strcpy(scharray[commandnum][0], buf); is there mistake in code above? i think want set first character of allocated string '\0' . you'd using scharray[commandnum][0][0] = '\0'; your current code replaces (and leaks) pointer buffer allocated malloc(sizeof(char)*100) as aside, , before pulls me on it, note sizeof(char) guaranteed 1 malloc can simplified malloc(100) .

java - Display online users from server to all connected clients -

i'm building simple socket server-client application consisting of: server project (which creates new client handler thread when socket accepted) , client project (which establishing connection server , displaying gui message thread open). so far i'm able connect using multiple clients , chat no problems. i've set command called !getusers should display connected users requesting client. when so, i'm unable continue , chat, client stuck, connected users list though. as request here entire client code: import java.io.*; import java.net.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import static java.lang.system.out; import java.util.logging.level; import java.util.logging.logger; public class chatclient extends jframe implements actionlistener { string uname; printwriter pw; bufferedreader br; jtextarea tamessages, tauserlist; jtextfield tfinput; jbutton btnsend, btnexit; socket client; public chatclient(string uname, string servern...

cocoa - Ligatures not do not work in UILabel/NSAttributedString in iOS 6 -

Image
i trying turn on ligatures ( nsligatureattributename ) nsattributedstring displayed uilabel . i targeting ios 6.1 , running in ipad simulator. my set of test words are: aeciospore coeliac halfheaded cliffhanging aufkommender snuffkin domineesbriefjes offtrack dahinraffte coffins my test code simple, loops through list of words , display 1 in uilabel using text property: self.normallabel.text = words[i]; and other using attributedtext property, after creating nsattributedstring (see brandon campbell's answer more info on value of nsligatureattributename ): nsdictionary *attrs = @{ nsfontattributename : [uifont systemfontofsize:74.0], nsligatureattributename : @1, //@2 not supported in ios nsbackgroundcolorattributename : [uicolor redcolor]}; self.attr.attributedtext = [[nsattributedstring alloc] initwithstring:words[i] attributes:attrs]; as can see i'm setting nsligatureattribut...

java - what is the meaning of 1.3.6.1.2.1.43.11.1.1.5.1.1 3 ) in snmp? -

i wrote snmp application test printer status. when give 1.3.6.1.2.1.43.10.2.1.15 check printer status got ( 1.3.6.1.2.1.43.11.1.1.5.1.1 3 ) output. newvars = cominterface.getmibentry(itemids); if knows, please me. not sure library use perform above operation. if can convert java code sequence of operations can repeat step step on mib browser, should able interpret meaning. for example, 1.3.6.1.2.1.43.10.2.1.15 column named prtmarkerstatus in prtmarkertable, defined in printer-mib (original rfc http://tools.ietf.org/html/rfc3805 ), http://www.oidview.com/mibs/0/printer-mib.html because column, hardly understand mean "when give 1.3.6.1.2.1.43.10.2.1.15 check printer status got (1.3.6.1.2.1.43.11.1.1.5.1.1 3) output". snmp request on wire? next, bulk, or another? meaningless send 1.3.6.1.2.1.43.10.2.1.15 that's invalid. the proper way manage printers, digest rfc 3805, documents tables defined in it, , columns mean. once understand how mib docu...

asp.net - Adding Subscribe Button for a RSS URL -

i have rss url website , have make people directly subscribe url clicking on image home page. image click must have functionality similar "subscribe" button found in header of rss page. if declare rss html links ( how tell web browsers atom feeds ) many browsers show 'subscribe' buttons. however, there's no general way cause subscription single link; you're better off linking feed , relying on browser offer add new subscription. (you may able better specific aggregators, i'm assuming you're after using browser's subscription mechanism here.)

actionscript 3 - removing instance after excecuted 2 -

got parameter child must non-null error code can ? for (i=1; i<=4; i++) { this["box" + i].addeventlistener(event.enter_frame, move); this["box" + i].addeventlistener(mouseevent.click, action); } function move(e:event):void { e.target.y -= 6; if (e.target.y <= 56) { movieclip(e.target).removeeventlistener(event.enter_frame, move); removechild(getchildbyname(e.target.name)); comment.text = "miss"; miss += 1; score += 0; } } function action(event:mouseevent):void { if ((event.target.hittestobject(bts1))&&(event.target.hittestobject(bts2))&&(event.target.hittestobject(bts3))&&(event.target.hittestobject(bts4))) { movieclip(event.target).removeeventlistener(mouseevent.click, action); removechild(getchildbyname(event.target.name)); comment.text = "perfect"; perfect += 1; score += 10000; } else ...