Posts

Showing posts from March, 2010

C++ How to create a map from two other maps -

how create map mymap3 as: std::map< vector<std::pair<int, int>>, int > mymap3 example: mymap3[0] = ((1,3) , (1,5), 7 ) // 5 = 4 + 3 mymap3[1] = ( (2,1) , (2,4), 6 ) // 6 = 1 + 5 where key = (vector of pairs) extract 'mymap1', and value = sum of pairs' values in 'mymap2'. i don't care pair order, (2,4) same (4,2) std::map <int, vector<pair<int, int>> > mymap1; std::map< std::pair< int, int>, int> mymap2; here example: mymap1[0] = (0, (1,3) , (1,5) ) mymap1[1] = (1, (2,1) , (2,4) ) mymap2[0] = ( (1,3) , 4 ) mymap2[1] = ( (1,5) , 3 ) mymap2[2] = ( (2,1) , 1 ) mymap2[3] = ( (4,2) , 5 ) i don't know how that, , try: std::map <int, vector<pair<int, int>> > ::iterator it1 = mymap1.begin(); std::map<std::pair< int, int>, int> ::iterator it2 = mymap2.begin(); // std::map< vector<pair<int, int> >, int> mymap3; std::map< pai

sql - Reproduce certain rows in PostgreSQL -

i have table ids represent individuals (call id_table) , table characteristics individual can have (call char_table). now want add column id_table containing values char_table. difficulty, me, is, id shall 1 characteristic (simple case) , id shall several characteristics. reason rows these id several characteristics must reproduced until have matched every characteristic id. example: id '001' shall characteristics 'a', 'b', , 'c'. row id='001' must reproduced 2 times (to same row 3 times) , each of these rows shall 1 of these 3 characteristics. i hope explained intelligible enough. idea how this? thanks. in cases, want association or junction table. table like: create table individualcharacteristicsr ( individualid int not null, characterid int not null ); (it might have unique id itself.) each characteristic individual has on separate row. so, 3 characteristics mean 3 rows. typical query using information join

join - mysql error table cannot be used in global order clause -

(select dtable.* app_detailsvvv dtable inner join new_apps on new_apps.trackid=dtable.trackid primarygenrename='games' , composed='1' , new_apps.top>0) union (select * app_detailsvvv dtable primarygenrename='games') order new_apps.top asc, trackname asc limit 12 with query error: #1250 - table 'new_apps' 1 of selects cannot used in global order clause new_apps not used in second query, idea first top rank same table has listed id in new_apps table as docs says this kind of order cannot use column references include table name (that is, names in tbl_name.col_name format). instead, provide column alias in first select statement , refer alias in order by. so rewrite this ( select dtable.*, new_apps.top t1 app_detailsvvv dtable inner join new_apps on new_apps.trackid=dtable.trackid primarygenrename='games' , composed='1' , new_apps.top > 0 ) union ( select *, 0 app_detailsvvv dtable

python - Scipy Griddata Output Dimensions -

Image
i'm not sure i'm doing wrong. i'm attempting use scipy griddata interpolate data in irregular grid. from scipy.interpolate import griddata i have 2 lists, "x" , "y", represent axes of original, uninterpolated grid. both lists of length 8. then, make arrays represent axes of intended final, filled-in grid. ny = np.linspace(0.0, max(y), y[len(y)-1]/min_interval+1) nx = np.linspace(0.0, max(x), len(ny)) i've checked , both "ny" , "nx" of shape (61,). then, create 8 x 8 list "z". finally, attempt make final grid. z = griddata((np.array(x), np.array(y)), np.array(z), (nx, ny), method='nearest', fill_value=0) print z.shape the resulting 2d array has dimensions (61,8). tried using "x" , "y" lists , arrays - no change. why interpolating in 1 direction? expecting (61,61) array output. have included actual numbers if felt have been helpful, don't see how make difference. not unders

javascript - jQuery remove duplicate row(s) on output loop -

im looking jquery script run when results output on screen. while running output loop, need jquery @ rows see if row similar id exists, if does, need remove current row output has duplicate id. i constructing tr "id" passing in unique value db call , appeding "row_". in end make id "row_6373" (6373 being unique value). <table> [while loop] // jquery script right here... <tr id="row_6373"><td></td></tr> <tr id="row_988732"><td></td></tr> <tr id="row_6435"><td></td></tr> <tr id="row_6373"><td></td></tr> row output [/while loop] </table> as loop running need jquery check see if row id "row_6373" exists, if need remove last instance of row_6373. happen several time in output loop. "row_6373" come check thousand times. right doing this: running @ beginni

android - firemonkey xe5 save captured image with specified name -

in firemonkey xe5 there sample how capture image , show bitmap , possible change image name, right after capturing, source code? i've tried use code : image.savetofile(gethomepath + pathdelim + 'myimage.jpg') on procedure : procedure tform2.takephotofromcameraaction1didfinishtaking(image: tbitmap); begin end; but nothing happened.

jquery - Hide the excerpt and re show it when re toggled -

i have done best this,.. took me hours still cant work. when readmore clicked hides excerpt , shows full content, re names buttons hide, when hide clicked again, has show excerpt again , hide full content. here's fiddle jquery code jquery(document).ready(function () { jquery('.testi-more').click(function (e) { e.preventdefault(); var same = jquery(this).closest('.testi-wrapper'); jquery(this).closest('.testi-wrapper').children('.testi-full').slidetoggle('slow'); }); if (jquery('.testi-full').is(": hidden")) { jquery(this).closest('.testi-wrapper').children('.testi-excerpt').show(); jquery(this).closest('.testi-wrapper').children('.testi-more').html('read moar'); } else { jquery(this).closest('.testi-wrapper').children('.testi-excerpt').hide(); jquery(this).closest('.testi-wrapper

activerecord - Yii join tables on column other than PK -

i'm using gallery manager extension has gallery model connected one-to-many relation galleryphotos model (gallery_photo.gallery_id fk gallery.id). i have products model want join gallery model one-to-one relation. how define such relation given don't want modify gallery table (to add fk). 1 option thought adding gallery_id field products table point gallery->id how define relationships in products model file? how define such relation given don't want modify gallery table (to add fk). 1 option thought adding gallery_id field products table point gallery->id how define relationships in products model file? if use one-to-one relation situation method, can cause developer inherit code wonder why original guy has done that. think not matter right therefore call situation method assume how works: adding gallery_id field products table point gallery->id in function relations() of product model 'gallery' => array(self::belo

file - 'Do While' loop does not generate new timestamp based values inside it -

consider while loop find $filepath -iname "$var*" | < commands > while read filename; logfile=$var/$var1/$filename_"`date +%y%m%d_%h_%m_%s`".log echo "<a long command > > $logfile" >> commandfile.ksh done so every iteration of $file should generate new value want a new timestamp every instance of file comes in when see generated ksh file -the $logfile set same value am missing here. don't want have logfile calculation inside echo because there's lot of escaping , confusion. if every file should generate time-stamp based value , values should not same ..right ? expect 1 iteration @ least 1 s apart. if in comments maybe find $filepath -iname "$var*" | < commands > while read filename; sleep 1 logfile=$var/$var1/$filename_"`date +%y%m%d_%h_%m_%s`".log echo "<a long command > > $logfile" >> commandfile.ksh done

logging - logstash grok pattern not functioning as expected -

i having interesting problem. after using http://grokdebug.herokuapp.com/ works well. finding following message, though works on above site, , works seemingly identical messages, not working expected. this pattern: %{monthday}-%{month}-%{year} %{time} %{prog:program}: %{loglevel:loglevel}: %{user:from} %{ip:ip}\#%{int:port} \(%{greedydata:request}\): %{word:stage}(\s|\s\s)%{greedydata:drop_reason} %{iporhost:to}/%{int:subnet} this output: { "message" => "03-feb-2014 21:33:51.867 queries: info: client 123.123.123.123#57710 (some.dns.server.1.1.1.1.in-addr.arpa): drop response 231.231.231.0/24", "@version" => "1", "@timestamp" => "2014-02-06t00:51:04.240z", "type" => "ns_query", "host" => "ns2", "path" => "/tmp/named-query.log.29" } i have seen function expected, odd these in particular not working, if has ideas may doing incorrect pl

"Initializer element is not constant" error for no reason in Linux GCC, compiling C -

this question has answer here: error “initializer element not constant” when trying initialize variable const 4 answers i take main.c file , compile gcc -std=c1x -c main.c in mac os x, , works fine no errors. exact same thing in linuxmint , on raspberry pi, , in both cases, gives me errors "initializer element not constant". one example of problematic line relevant code: //static global constants const unsigned long long latitude = (long) 3600000; const unsigned long long longitude = (long) 1810000; const unsigned long long max_coordinates_number = (latitude-1) + latitude*(longitude-1); //compiler error: initializer element not constant it's supposed let me arithmetic, right? replace actual numbers, , work, become messy. , works fine on mac anyway. there option in gcc have specify on linux (besides -std=c1x, don't need on mac)? the c

perl - Access nested hash and subroutine -

consider following code snippet: #global space here { #nested here %hash = ( key1 => 'a', key2 => 'b', key3 => 'c', key4 => 'd', ); sub test { #subroutine code goes here } } how access either hash or subroutine global scope when nested within curly braces? the hash lexically scoped block (the curly braces), can accessed inside block. subroutine can accessed anywhere, regardless of scope.

Split HTML tr elements into PHP array -

i've posted thread never explained well, deleted , rewriting it. my php script sends curl request website output html table, use table has 7 tr elements in it, each tr element have 6 td elements within it. this means html table technically coded on page, want split each tr separate php array, td's accessible through key. so example: table -- tr1 ----td ----td ----td ----td ----td ----td -- tr2 ----td ----td ----td ----td ----td ----td i able do: echo $trarray[1][3] echo 'td' because value of 2nd td element on first tr array i'm not sure if explaining well, want able do any appreciated! make sure php have php-dom enabled: $export = array(); $dom = new domdocument(); libxml_use_internal_errors(true); $dom->loadhtml($html); libxml_clear_errors(); $xpath = new domxpath($dom); $tr_no = 0; foreach( $xpath->evaluate('//tr') $sel ){ $export[$tr_no] = array(); $td_no = 0;

javascript - xslt creation for html tags using for each -

i trying create xslt html tags consists of links, images , text.. tried creating using w3schools not create it... can guys tell me how create it.. providing code below... my h, p , img tag repeatable need put in each... can tell me how it... <?xml version="1.0" encoding="iso-8859-1"?> <!-- edited xmlspy® --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="/"> <html> <body> <xsl:for-each select="section/article/div"> </xsl:for-each> </table> </body> </html> </xsl:template> try template: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0"> <xsl:key name="kimg" match="img" use="@src"/> <xsl:k

ocaml - Data structure for occurrence counting in long tail distribution -

i have big list of elements (tens of millions). trying count number of occurrence of several subset of these elements. occurrence distribution long-tailed. the data structure looks (in ocaml-ish flavor): type element_key type element_aggr_key type raw_data = element_key list type element_stat = { occurrence : (element_key, int) hashtbl.t; } type stat = { element_stat_hashtable : (element_aggr_key, element_stat) hashtbl.t; } element_stat use hashtable key each elements , value integer. however, inefficient because when many elements have single occurrence, occurrence hashtable resized many times. cannot avoid resizing occurrence hashtable setting big initial size because there many element_stat instances (the size of hashtable in stat big). i know if there more efficient (memory-wise and/or insertion-wise) data structure use-case. found lot of existing data structure trie, radix tree, judy array. have trouble understanding differences , whether fit problem.

java - ClassNotFoundException running simple applets -

i wrote http://pastebin.com/ewshf3ys school; it's simple java applet gui pair of eyes watches cursor moves. runs in compiler (netbeans 7.4) , life of me i'm having difficulty understanding why doesn't run in browser. i'm getting classnotfound exceptions. reading i've been doing suggests .class file isn't required because it's applet, browser should generate 1 @ runtime. , if class required, how come netbeans can run without one? the html file stored in same directory .java - , it's real simple: <html> <head> <title>watchme</title> </head> <body> <applet code="watchme.class" width="300" height="200"> </applet> </body> </html> i've tried variety of different things, different browsers, setting classpath; opening on different computers. result same, classnotfound exception. internet research i've been doing yields unproductive answers, such

c++ - Errors within Main program using classes -

i have few errors of same type in main program. college professor not answering emails have resort asking guys. in main program have several errors similar this: "request member of non-class type." program01 testing every function in listtype.h, olisttype.h, , ulisttype.h make sure works correctly. can provide in timely fashion appreciated. here listtype.h: #ifndef listtype_h_included #define listtype_h_included #include <iostream> class listtype { public: listtype(size_t=10); listtype(const listtype&); virtual ~listtype(); virtual bool insert(int)=0; virtual bool eraseall(); virtual bool erase(int)=0; virtual bool find(int) const=0; size_t size() const; bool empty() const; bool full() const; friend std::ostream& operator << (std::ostream&, const listtype&); const listtype& operator= (const listtype&); protected: int *items; size_t capacity; size_t count; }; #endif // listtype_h_included here listtype.cpp: #inc

asp.net mvc 4 - Web api routing methods with different parameter names -

this question have been answered hundred times, couldnt find proper resource. in webapi project (default project provided vs) have valuescontroller below. public string get(int id) { return "value"; } [httpget] public string findbyname(string name) { return name; } [httpget] public string findbyid(int id) { return id.tostring(); } in webapiconfig.cs, have following route mapping. config.routes.maphttproute( name: "actionapibyid", routetemplate: "api/{controller}/{action}/{id}", defaults: new { action = "findbyid", id = routeparameter.optional } ); config.routes.maphttproute( name: "actionapi", routetemplate: "api/{controller}/{action}/{name}", defaults: new { name = routeparameter.optional } ); config.routes.maphttproute(

Dividing by zero error in Python? -

i'm writing program user enters a, b, c, d, e, , f , displays result. if ad - bc = 0, i'm supposed report there no solution. when include part of code where: if denominator == 0: print("the equation has no solution") i keep getting dividing 0 error. numbers use prompt 1.0, 2.0, 2.0, 4.0, 4.0, 5.0 respectively. here's code: def cramersrule(): = float(input("enter a: ")) b = float(input("enter b: ")) c = float(input("enter c: ")) d = float(input("enter d: ")) e = float(input("enter e: ")) f = float(input("enter f: ")) denominator = ((a * d) - (b * c)) x = (((e * d) - (b * f)) / denominator) y = (((a * f) - (e * c)) / denominator) e = ((a * x) + (b * y)) f = ((c * x) + (d * y)) if denominator == 0: print("the equation has no solution.") else: print("x is", x , "and y is" , y) please help! you performing calculations it: x = (((e * d) - (b * f))

php - How to use 'between' in select statement -

Image
this supposed easy solution can't ahead around it. have table here query $salary=2000; select deductions nhif_tbl to_end <=$salary , start_from >= $salary; the query returns null. question how modify query in order correct deductions in case '60' select deductions nhif_tbl to_end >=$salary , start_from <= $salary;

css - How to align the navigation menu in wordpress? -

i have problem.. can't make navigation horizontal.. please teach me how align navigation menu horizontal , place in center in wordpress? i'm newbie in wordpress.. please me thanks! here's css navigation: #toppart #mainnav { margin: 40px 0 0; max-width: 100%; float:none; text-align:center; } #toppart #mainnav ul li { float: none; list-style: none; position: relative; display:inline; background: #16212b; padding: 9px 14px; } #toppart #mainnav ul li { margin:0; padding:9px 14px; display: inline; } #toppart #mainnav ul ul { display: inline; float: none; position: relative; margin-left:20px; top:0; left: 0; z-index:none; text-align:center; } #toppart #mainnav ul ul ul { display: inline; float: none; position: relative; margin-left:40px; top:0; left: 0; z-index:none; text-align:center; } #toppart #mainnav ul ul li { border-bottom:1px solid #000; text-align:center; } #toppart #mainnav ul ul ul li { border-bottom:none; text-align:center; } #toppart #mainnav ul ul

java - What is the advantage of form:label tag in Spring? -

<form:label path="company">enter company name:</form:label> renders - <label for="company">enter company name:</label> why shouldn't directly use html tag more concise? the <form:label /> tag has access underlying model , binding results , such can, on error, use style class. <form:label cssclass="title" csserrorclass="title error" path="company" /> the code above would, in case of error, render differently normal case. of course without form tag mean need include logic pages, in general isn't advised. for properties see reference guide

iis - include once with azure web php in folder -

i try include in folder wwwroot/sample/printsample.php i write code <?php include_once("testerror/warning.php"); ?> and in folder wwwroot/testerror/warning.php i write code <?php echo "hello world"; ?> when try access via web site example.com/sample/printsample.php, result nothing. but when include in full path in include_once in sample/printsample.php like this <?php include_once("d:\home\site\wwwroot\useblockscript\testerror\warning.php"); ?> i result in web print "hello world". what wrong it? look script located in d:\home\site\wwwroot. looks relative path. should d:\home\site\wwwroot\testerror\warning.php this excerpt $_server [script_filename] => d:\home\site\wwwroot\useblockscript\test.php [request_uri] => /useblockscript/test.php [path_translated] => d:\home\site\wwwroot\useblockscript\test.php [document_root] => d:\home\site\wwwroot [appl_physical_p

user interface - How to make a MS Ofiice type dropdown button in tabbar on top left corner in wxribbon in wxpython -

i building gui wxribbon in wxpython , have working great. now, want have 'orb' button on top left corner, near first tab file button dropdown menu not able find support in wxwidget or wxpython. great if me on how that. thanks.... thinking of using brute force approach , creating button absolute position don't know work or not. having idea please me...

c# - How to hide specific jqueryui tab based on some condition? -

i working on application in selected tab should not visible specific users.my code is <div id="tabs"> <ul> <li><a href="#divlogtickets">log tickets</a></li> <li><a href="#divopentickets">open tickets</a></li> </ul> <div id="divlogtickets" runat="server" style="padding: 25px;"> </div> </div> if (getuserrole(convert.tostring(session["userid"])) == "hr") { //hide tab } how hide specific tab based on specific user role. you can add id , runat="server" attributes elements want access code behind , set .visible property in code behind. for example if want hide log tickets tab, here's aspx code should like: <div id="tabs"> <ul> <li id="lilogtickets" runat="server"><a href=&qu

javascript - WebSocket API code -

i using websocket api in html5. api has inbuilt function sending data websocket. usage ws.send().i want know can code inbuilt function. in advance. open source websocket send() implementations: firefox chromium/chrome (starting @ line 390)

How to check .Net version which is installed on my machine using wmic command in batch file -

i want check .net version installed on machine using wmic command in batch file. below command used , not working. wmic /namespace:\\root\cimv2 path win32_product "name '%%microsoft .net framework 4 extended%%'" version can please me out this. thanks in advance. if don't have version, should message saying "no instance(s) available" i recommend wmic /namespace:\\root\cimv2 path win32_product "name '%%microsoft .net%%'" version this way can see versions installed including 4.0

indexing - mongodb index range find -

if have these docs: {"name": 1, "score": 2} {"name": 1, "score": 4} {"name": 2, "score": 2} {"name": 2, "score": 4} if ensure index: db.test.ensureindex({"name":1, "score":1}) then try find(): db.test.find({"score": 4}) i use explain(), , found query can not use index , scan 4 docs. i wonder why scans docs? you know, if enum "name" 's value (1 , 2): db.test.find({"$or":["name":1, "name":2], "score":4}) it can use index , scanned 2 docs. why mongodb can not thing me? the reason index not being used because $or exclusion operator, , means more or less scans in order determine not match. what want use $in . reduce match only values contained in set. db.test.find({"$in":["name":1, "name":2], "score":4}) as inclusive match can applied index with

php - Error parsing JSON data. JSONException: End of input at character -

here php code fragment parsing. $result=mysql_query($qry); $json="{"; for($i=1;$i<=$count;$i++) { $row = mysql_fetch_row($result) $newrow=setjson($i,$row); if($i!=$count) $json=$json.$newrow.","; else $json=$json.$newrow; } $json=$json."}"; $response["success"]=1; $response["count"]=$count; $response["rows"]=$json; echo json_encode($response); function creating new row function setjson($i,$row) { $setrow="\""$i."\":[".$row."]"; return $setrow; } i have developed using php. trying parse mysql result following format. each row in db. need update sqlite db in app. { "success":1, "error":0, "rows":{ "1":["abc","123"], "2":["xxx","909"], "3":["bcn",&quo

microcontroller - Develop client library for MQTT in C -

i want develop c client library mqtt, make pic 8 bit micro-controller talk mqtt broker( active mq). relatively new field. can suggest can start . need implement connect, subscribe,unsubscribe, publish nad disconnect api's start with. thanks in advance you need ethernet working first, implement protocol... :) a place arduino client ( http://knolleary.net/arduino-client-for-mqtt/ ) should have solved lot of need do. good luck!

function - simple javascript: "Reference Error: 'click' is undefined" -

so i'm making satirical cookie-clicker based game first ever js game. i made jsfiddle. (the image won't show, image supposed swag hat, click swag points.) code simple far, wondering why told me click() function undefined. it's mentioned in head , don't know what's wrong. http://jsfiddle.net/69mjq/ html: <html> <head> <title>swag dealr</title> <script src="swagdealr.js"></script> <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" /> </head> <body> <h3>swag dealr</h3> <a href="javascript:click()"><img src="img/swaghat.png"></a> <p>grams of swag</p> <p id="swagnumber"></p> <p id=></p> </body> </html> js: game={}; game.launch = function() { } window.onload = function() { game.load(); };

java - What is dereferencing possible null pointer? -

i making program sftp in netbeans . some part of code: com.jcraft.jsch.session sessiontarget = null; com.jcraft.jsch.channelsftp channeltarget = null; try { sessiontarget = jsch.getsession(backupuser, backuphost, backupport); sessiontarget.setpassword(backuppassword); sessiontarget.setconfig("stricthostkeychecking", "no"); sessiontarget.connect(); channeltarget = (channelsftp) sessiontarget.openchannel("sftp"); channeltarget.connect(); system.out.println("target channel connected"); } catch (jschexception e) { system.out.println("error occured ======== connection not estabilished"); log.error("error occured ======== connection not estabilished", e); } { channeltarget.exit(); // warning : dereferencing possible null pointer channeltarget.disconnect(); // warning : dereferencing possible null pointer

vb.net - Passing structure to a procedure as ByValue, however the procedure changes original structure values -

i want ask vb.net code. i'm suffering problem lot. please answer me if know solution of question or give me comments. 'declare structure "gene" public structure gene dim seq() integer end structure 'here procedure, changes original value. public sub mutation(byval originalgene gene, byref targetgene gene) dim p1 integer dim p2 integer dim temp integer p1 = int((n_jobs - 1 + 1) * rnd(rndnum) + 0) p2 = int((n_jobs - 1 + 1) * rnd(rndnum + 1) + 0) targetgene.seq = originalgene.seq temp = targetgene.seq(p1) targetgene.seq(p1) = targetgene.seq(p2) targetgene.seq(p2) = temp end sub it's not changing structure. structure contains pointer array. reference array same though can have unlimited number of copies of structure. example of immutable gene class: public class gene private _sequence() integer public sub new(sequence() integer)

file io - Mysql infile Data load -

i loading data different remote client. clienta load tablea clientb load tableb. tablea , tableb have similar schema. if happened loading @ same time, find data tablea in tableb. the same user being used data loading.

c# - What decodes my encoded hash symbol(%23)? -

we noticed several machines have problems urls hash parameters. when debugging request url: http://domain.com/entity(%23{number-here} we see in application_beginrequest method in global.asax file url: http://domain.com/entity(#23{number-here} in url.originalstring , url.localpath has http://domain.com/entity( , chars after hash in url.fragment . when running same application on machines running windows 8.1 , iis 8.5 works expected, url.orinalstring http://domain.com/entity(%23{number-here} . i can't see suspisous in url rewrite section in web.config or in iis configuration. what can reason behaviour? this bug in system.web.dll. fixed on windows 8.1, haven't yet rolled out fix system.web.dll on downlevel versions of operating system. we're trying fix in .net 4.5.x supported oses when next reliability update comes out.

embedding excel into form lotus domino -

i need embed excel sheet form multiple users can fill in part of sheet. when save document, without editing excel file embedded, can open document in view. if want edit document saved, following msg: http://i.imgur.com/ldkomrg.png issue is, when fill in parts of excel table , save excel , save form, on view pane see document when want access following msg : "document has been deleted." there work-around make document not read-only excel file modified? or other method insert excel file form? functionality trying achieve multiple users filling in same excel through lotus notes client. working lotus notes/domino 8.5 , database local. when add ole object form in lotus notes, need tell notes whether want new copy of object created each document. if don't, notes launches object on form -- same object every user , every document uses form, , read-only. to this, need add rich text field somewhere on form, go form properties dialog, click on launch tab (looks

c++ - Why does this incredibly simple Makefile produce so much debug logging? -

i learning makefiles , decided write first exercise. have directory 2 files: makefile makefile.cpp here makefile.cpp (surprise surprise!): #include <iostream> int main() { std::cout << "hello world!\n"; return 0; } and here makefile: cc = g++ files = makefile.cpp out_exe = makefileout build: $(files) $(cc) -o $(out_exe) $(files) and run make -d , long log: $ make -d gnu make 3.81 copyright (c) 2006 free software foundation, inc. free software; see source copying conditions. there no warranty; not merchantability or fitness particular purpose. program built x86_64-pc-linux-gnu reading makefiles... reading makefile `makefile'... updating makefiles.... considering target file `makefile'. looking implicit rule `makefile'. trying pattern rule stem `makefile'. trying implicit prerequisite `makefile.o'. trying pattern rule stem `makefile'. trying implicit prerequisite `makefile.c'. trying pattern

c# - How to get work week from two dates -

this question has answer here: how calculate number of weeks given 2 dates? 7 answers lets say, have 2 date order date - 1/1/2014 , delivery date - 6/2/2014. if want calculate how work week taken (order date-delivery date), how can in c#. if want number of worked days in date range, can use this: var = datetime.today.adddays(-10); var = datetime.today; var daysofweek = new dayofweek[] { dayofweek.monday, dayofweek.tuesday , dayofweek.wednesday, dayofweek.friday , dayofweek.thursday }; var days = enumerable.range(0, 1 + to.subtract(from).days) .select((n, i) => from.adddays(i).dayofweek) .where(n => daysofweek.contains(n.dayofweek)); if want number of weeks during date range

c# - Cannot retrieve value of dynamically created textboxes -

good day! i'm creating dynamic textboxes. number of textboxes should created depends on number of column elements xml has. can create textboxes, problem retrieving value of each textboxes on button click. me this? thanks! here code fro creating textboxes: foreach (xmlclasses.column col in columns.tolist()) { literal lt = new literal(); textbox txtbox = new textbox(); label lbl = new label(); lt.text = "<br/>"; lbl.text = col.title + ":"; lbl.width = unit.pixel(200); txtbox.id = "txtbox_" + col.id; txtbox.width = unit.pixel(200); panel1.controls.add(lt); panel1.controls.add(lbl); panel1.controls.add(txtbox); } here code retrieving:(button_click) foreach (xmlclasses.column col in columns.tolist()) { textbox txt = new textbox(); panel pnl

convert mm/dd/yyyy to dd/mm/yyyy using javascript while adding Number of days with a Date -

this question has answer here: how format date in mm/dd/yyyy hh:mm:ss format in javascript? [duplicate] 4 answers i want add number of days particular date. have done problem works mm/dd/yyyy format. want work dd/mm/yyyy format. below sample code.. <script type="text/javascript"> function datechange() { var d = document.getelementbyid('days').value; var mydate = new date(document.getelementbyid('date1').value); mydate.setdate(mydate.getdate() + parseint(d)); document.getelementbyid('date2').value = (mydate.getdate() + 1 ) + '/' + (mydate.getmonth() + 1) + '/' + (mydate.getfullyear()); } function adddate() { date = new date(); var month = date.getmonth() + 1; var day = date.get

ilnumerics - Plotcube with a fixed display area and customized double-click-handler -

i need plotcube fixed display area , double click handler restores view. derived class ilplotcude , put following code setting limits in constructor: : float max = 1000f; limits.ymax = max; limits.xmax = max; limits.zmax = max; limits.ymin = -max; limits.xmin = -max; limits.zmin = -max; aspectratiomode = aspectratiomode.maintainratios; : i have installed doubleclick-handler in class code above , additional line reset rotation: : if (args.cancel) return; if (!args.directionup) return; rotation = matrix4.identity; float max = 1000f; limits.ymax = max; limits.xmax = max; limits.zmax = max; limits.ymin = -max; limits.xmin = -max; limits.zmin = -max; aspectratiomode = aspectratiomode.maintainratios; args.refresh = true; args.cancel = true; : the handler executed nothing happens. testing purposes, put same code directly function onmousedoubleclick of of base class ilplotcube (instead of function call reset ()). works expected, cannot final solution. has idea, what's wrong

objective c - ios:convert html string to nsstring and display in uitableview? -

am doing project using storyboards, in project parse json data , display in simulator. here json activitylist = ( { activitytitle = test; activitytype = chat; apikey = null; desc = "<p>asasasa</p>"; id = 361; issuetitle = "issue created m43 (194)"; sessionid = null; status = true; token = null; when = "sat, 30 nov 2013 04:30 cet"; }, { activitytitle = "test match private"; activitytype = "one way video streaming"; apikey = null; desc = "<p>test match private</p>"; id = 335; issuetitle = "test match (190)"; sessionid = null; status = true; token = null; when = "fri, 29 nov 2013 10:30 gmt"; },

c++ - pthread with without static member function -

i have classb have thread object , function defined as: pthread_t m_thworkthread; void* threadproc(void *); and in constructor of classb, create thread like: pthread_create(&m_thworkthread, null, &(classb::threadproc), this); however got 2 error messages: error: iso c++ forbids taking address of unqualified or parenthesized non-static member function form pointer member function. cannot convert âvoid* (classb:: )(void )â âvoid* ( )(void )â argument â3â âint pthread_create(pthread_t*, const pthread_attr_t*, void* ( )(void ), void*)â pthread_create(&m_thworkthread, null, &(classb::threadproc), this); however if define function static, not complain: static void* threadproc(void *); however not want static, since create multiple threads , want each thread has separate threadproc function.