Index | Recent Threads | Unanswered Threads | Who's Active | Guidelines | Search |
![]() |
World Community Grid Forums
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
No member browsing this thread |
Thread Status: Active Total posts in this thread: 116
|
![]() |
Author |
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
Regrettably not been able to get the sendkey sequence to always run it's course 100% of the times... only when the CPU is slowed to 8086, does Excel [which is multi-threaded], execute the final Import > OK > Close keystrokes where they are supposed to happen, in the web address connection edit screen and not in the sheet, messing things up. But, while typing this, I know and have already done in other scripts, the automated switching up and down of allowed threads, so that's the next thing to test.
Mapping was today the numero uno issue, or rather re-mapping. How to ask a question on Google makes a world of difference and so far never found the right order of phrasing. Today though just asked "how to add a field to an xml map", and the Stackoverflow answer coming back was "Add A Field To An Xml Map ", hahahaha. In reading the hopes went up to finally have found the working solution. After the first No No not possible, tried the second sequence which failed, went all the way to the bottom and went through those steps with failed too... maps cannot be modified [incessant "table is already mapped", thoug hte map was unmapped and delete]. Then tried the 3rd solution, hacking into the xml directly... copied file, opened it with 7z, found the xmlMaps.xml map [reply 4], and opened that into a text editor. Cut maticulous, paste in the bits for the extra field, saved. Opened in Excel 2010 and got a 'file damaged, should we try to repair?'. Did that, but no added field. Exited, made a new copy, 7zipped, pulled xmlMaps.xml into an editor, did the same, more rigurous, copying the full code of a known expanded map and put that in place of the one with the field short, saved, opened in Excel 2010... no protests. Went to look for the list of the 120 maps in the book... nada, nothing, zilch, blank... no maps. 3 strikes and you're out, went into amino acid dna cutting and pasting... rinse, repeat and, yes, success, the map showed the extra field. Too cumbersome though, but the reading of the whole Q&A gave me some ideas and opened the workbook directly, unmapped -all- fields of a target xml to table map and created an entirely new one in an empty space, then deleted all the field of the new one in the sheet, which has the same effect as unmapping. Deleted the old map, deleted the old web connect, renamed the new connect to that of the old and mapped the new map to the fields of the old table... no protests still. Ran the refresh and pronto prontissomo, voilà , old table with new field pulled from the recreated xml map. The typing of this took longer than doing the steps, and now have a working and documented, fast solution to getting the FileDeleteState field quite quickly into the 120 xml maps without messing things up, for that matter knreed can add more fields to the api and my hunting tool wont choke... 3 done, 117 to go. ![]() Meantime the 6 digit masking method to establish 'to credit or not to credit', continues to work a treat. This morning had 3 new combinations to add to the small mask table [now 30 in total]. Really odd is one because 7 with a code -187 upload issue occurred, and one got credited, the other 6 were not. Why at all a credit if upload failed [ExitStatus -187] is a mystery. Anyhow, any new mask comes in pairs, ying and yang, so when in one cycle they are for instance 011211 [where the 2 is the Validation=Invalid], the next cycle it will show as 011200, since the result is still being listed, but the second last 0 now telling it is a case of of the previous period and the last 0 telling the result has been archived in a previous period i.e. mark as 'ready for deletion' as what the FileDeleteState also confirms... it's a 2, the final setting before deleting from the Result Statûs. Short for, this afternoon after running the MyCon update then Archive then Update History, of course the 3 yangs showed up in the active result listings [The summary reports do this for me, i.e. no need to go scanning all records]. End of this day, the hourglass just turned the 20th hour for the day, so tata, see ya tomorrow. The Hasta is now past-a too. |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
Last piece proofed the toughest [not], highlighting again how bad code can become without a plan... just code to make it work. Having moved to using a 6 digit mask to determine a result state, this last piece
=IF(OR(ResultXml1[@Outcome]>=4;AND(ResultXml1[@Outcome]=6;ResultXml1[@ValState]=2));VLOOKUP(ResultXml1[@Outcome];OutStates;2;0);IF(AND(ResultXml1[@Exit]*1>-188;ResultXml1[@Exit]*1<0);"Error: "&ResultXml1[@Exit];IF(OR(ResultXml1[@Exit]=-186;ResultXml1[@Exit]>0);VLOOKUP(ResultXml1[@Exit];ErrorCodes;2;0);IF(OR(ResultXml1[@ValState]<2;ResultXml1[@ValState]>3;ResultXml1[@ValState]);VLOOKUP(ResultXml1[@ValState];ValStates;2;0);VLOOKUP(ResultXml1[@Outcome];OutStates;2;0))))) became =IF([@Outcome]>3;VLOOKUP([@Mask];ValMasks;3;0);IF(OR(LEFT([@Mask];1)="0";MID([@Mask];2;1)<>"1");VLOOKUP([@Exit];ErrorCodes;2;0);VLOOKUP([@ValState];ValStates;2;0))) From 443 character heavily nested and multi-conditional checking 4 level table lookup, to something less than half the size, 164 characters, 3 level lookup, except the initial version was via 3 steps looking back at itself, yes a circular and those are hard to erradicate, normally. This time it was a quicky, as the design was to not have dependents, but there still was one left which checked for Status = Invalid. Swapped this to look at the validstate = 2 in the dependent and flying again, with code that does not require maintenance, but for keeping up the mask list. Remains, never seen a single result in the collection of now of near 100000, that shows the Outcome = 7... abandoned. What causes this state to be invoked I do not know [can guess] but the set of conditions seem to lead to a result or task getting this sticker. Not a show stopper as when it did not appear in first 100000, why would it in the next 100000 ;O) Hasta la cyclismo... weather is great, a sun-day it truly is, so we're out on the bike for the rest of the day... maybe some gluhwein at one of the stops. ![]() |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
There's so many ways to skin a cat, is said, and that so many is 9. Today I went for the 10th way, getting into Frankenhauser territory, and this time I seem to have hit the jackpot, first a little piece in an exhibition piece of 'how to', dated 2011, then a little piece from a forum post in 2006, and the 'piece de resistance' a post of 2002, using excel 2000... yes we are regressing in time, there where it was revealed that if you insert a for instance a ["offs"] there's a pause for input, into the appropriate places in a URL Query address, and then two-step, to make that ["offs"] look at a field or be fed as a variable that pulls a value in a stepped for-next loop or an array in a sheet, so you can dynamically feed the URL with the member name, account key, results to fetch and the page offset, in short this little diddy
With oSh.QueryTables(tabl)is injecting the url in the concatenated format needed to convince WCG to give up the results wanted, the number of them and counting from which on the Result Status pages [in xml]. Mind you, the headers of the table are completely fried, and half of the fields are for whatever reason duplicated, so 22 became 34 column table, but it works, consistently... Must have run it 100 times this development session, to get to this point and know it's not like the 9th case of the skinned cat where the last 3 .SendKeys go into space and you sit there staring at the screen asking for you to hit Import > OK > Close, 110 times as that is the number of queries that have been merged to get a maximum of 15000 Results and 14000 buffered In Progress (just in case a cruncher goes wild on the farm ;P) . Now building the loop and the arrays and linking the columns to the appropriate field of the Results table [I seem to remember a Borland product I used in the previous millennium that made this real easy]. ttyl P.S. This did land me into .Net framework for good, so it says bottom right when loading the query first time... suspiciously close to what I think WCGDAWS was based on, but ICBVR |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
BTW, the 2002 DIY forum thread is just a dozen posts long, every few years 1 or 2 baffled quizzers are dropping in with a follow up query, then one mid July 2015, if the author of the OP could please help... [Think the one who started the thread, and solved his own problem], does not have this on his watch list anymore, but it's encouraging that a thread is kept on record for nearly 14 years, and was able to put the final screw into my issue
![]() |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
Yesterdays "Mind you, the headers of the table are completely fried, and half of the fields are for whatever reason duplicated" written during the evening, turned a dawning late at night, when a whole x-mas tree of
![]() oSh.QueryTables(tabl) .Connection = "URL;" & "https://secure.worldcommunitygrid.org/api/members/" & memnm & "/results?code=" & acck & "&format=xml&limit=" & pagesz & "&offset=" & offs & "&ServerState=5&SortBy=ReceivedTime" .Refresh became oWb.XmlMaps("ResultsStatus_Map" & i).Import URL:=mymap ... direct injection and refresh in a single code line as part of existing for-next loop, i.e. the account key / member name can be changed on the fly whilst pulling the results data from the website [and this works also during the nightly My Contribution lock-out]. No mapping issues, no recreation, no completely fried table headers, serene processing with a little counter speeding in the status bar telling that the updates per page is faster than the seconds arm moves on the clock. Now all that's needed is knreed give us the xml code for the device stats, device profiles and my history web pages and this baby can be made public distribution [for the interested who PM me]. This morning took the v2.0c running from top of this thread, which I was stil running as small cruncher and ported the data into v2.0t, latest test-build. Data-transfer was smooth, some 'only one page' conditions needing some pre-emptive error catching and some formula enhancements to convert 'numbers turned text' [the ol pain of decimal comma and decimal point friction] and now large and small account run side by side in the same instance, not 1 dog year point difference. Now all that's needed is knreed give us the xml code for the device stats, device profiles and my history web pages, and the lynch-pin can be pulled, whence this baby can be made public distribution [for the interested who PM me]. ![]() P.S. The QueryTable code is retained, just in case a Back to the Future need develops ![]() |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
Last bits, finally got the main graph to show runtime years instead of seconds and the date labels at top without the need of the ExcelCampus Alignment Add-On, AND in the right order [which was the hardest as Excel will plot dates from smallest to greatest on the X-Axis, and if you then tell it to plot in reverse order, it reverses all the series too... After months of intermittent trying suddenly all fell into place.
Also since a few days been running the back-ward compatibility checker. All is now fine for Office 2016, 2013, 2010, and pile of items that are not acceptable for 2007... i.e. sorry time moves forward as does software. As final Pièce de résistance (heard that before), thus for today, the period close procedure "MyCon Refresh" sorts the device master table to list all active hosts at top and inactive [highlighted red] at bottom... yes font color sorting is possible too as a condition. This makes any device going non-returning stand out in between the active hosts [a feature for farm crunchers, where 3 crunch-cows is a farm too ;] Drop me a note on the Berkeley forum PM system if interested to test. Don't ask if you don't have aforementioned [legal] Office versions. The app just will not be maintainable on bogus installs... no jailbreaking will be entertained, and OpenOffice versions... if you really want to go back to the previous century, without me. The .Net framework is required too to be installed [I have 4.5.2 on the testbed]. If it's absent, the app is unlikely to load or run fully and efficiently. Hasta La Pizza Vesuvio. |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
Finally had the chance to test against > 18000 live records on the Result Status pages, 'results' that is, not counting the In Progress, so started coding like crazy and got to 17500 results last night the tool can handle. With some new found 'minimalism' coding, this constituting 68 sequential page calls of 250 results, only 24 were missing this morning [and there's a feature to catch those in a next run]. Regrettably overnight many completed results were migrated off to drop the total to 16900, so only caught 23 of the 24 in the 'search-party' run. Under 1 minute to pull the pile now, 1 minute for Results, 1 minute to pull up to 14000 In Progress, reducing chance of doubles and missing greatly. Now is the waiting for the weekend, when the removal of completed results seems to slow down... maybe another chance to get to 18000+, if the OET1s continue to be short
----------------------------------------![]() Hasta la Pasta Ricotta/Spinaci/Pancetta [the dish for today] edit typos [Edit 2 times, last edit by SekeRob* at Mar 18, 2016 5:51:45 PM] |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
It's been silent on the coding front during the bi-cycle season, a long long one, 10kkm added to the tally but have been picking up, mostly the accumulating Todo's such as
----------------------------------------"[and there's a feature to catch those in a next run]." Which got concluded in a color/text changing button if those show up after the first Result fetch pass, which is automatically initiated after the period archive run. Hit the button, summarize, peruse, hit Yes/No or Cancel, and off they go into the archives too. Early today hit upon a gem via Master Google (slowly turning into Dark Veder's uncle), which had eluded me for so long, but now found a 'trivial' way to reliably send keystrokes to external applications from within Office, any external app, Inkscape or MSPaint, whatever, so instead of a convoluted way with miles of code and roundabouts, their 'So simple' got even more simplified whence I was done... condensing it all in just about 2 dozen lines, and some left there just for readability whence the gray mass forgets what I did yesterday. What it does? It finds the [named] pic, copies it, opens the file, pastes the new pic over, saves and exits, with 'waits' that the user can change to longer, shorter than 0:00:00:00 ain't possible, Public Const BaseP As String = "WbkLoc" 'Where file is stored in BaseP constant If you can see my sig-pic was a virtual camera doing a snapshot cut, paste and store job, you can't. ![]() [Edit 3 times, last edit by SekeRob* at Sep 18, 2016 6:58:17 AM] |
||
|
adriverhoef
Master Cruncher The Netherlands Joined: Apr 3, 2009 Post Count: 2167 Status: Offline Project Badges: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I'm wondering if you are violating the "Communication Guidelines", Rob. It says there:
Make sure your content is appropriate. Do not upload, post or otherwise transmit content that: It's not clear to me what kind of software code they are referring to, but it sounds like they mean ALL software code.
![]() Adri |
||
|
SekeRob
Master Cruncher Joined: Jan 7, 2013 Post Count: 2741 Status: Offline |
Lol, it's like that 18 year minimum lawyer nonsense and subsequently they post an article/video with the standard Colgate smiley faced youngsters in them about the WCG program and "... is for everyone". I wrote the code, and just turned a piece into Open Source (any software code... that is not yours" was omitted in that 'guideline').
![]() BTW, here's a 'spot the useless lines' challenge. There's at a glance 6 lines that I removed since these no-longer serve any purpose. ![]() ![]() |
||
|
|
![]() |