text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
FROM (SELECT min((SELECT SUM(points) - 20 FROM foods WHERE name_id IN(SELECT pk FROM dates WHERE weekly=1) GROUP BY name_id), activity) AS activity_amount FROM activities WHERE activity_id IN(SELECT name_id FROM foods GROUP BY name_id HAVING SUM(points) > 20)); ``` The problem is with the first value in the `MIN()`.....
[ 0.05091072618961334, -0.0792623832821846, 0.30513322353363037, -0.16146869957447052, -0.07231403142213821, 0.33315375447273254, -0.1990913301706314, -0.3646257519721985, -0.3940129578113556, -0.6146821975708008, -0.13793548941612244, 0.35475730895996094, 0.04572151228785515, 0.178355649113...
the above query I created to work? EDIT...some example tables to better help. Thanks jellomonkey and hainstech ``` Table#1(dates) CREATE TABLE dates (pk INTEGER PRIMARY KEY, date INTEGER, weekly INTEGER) pk date weekly 1 05062009 1 2 05072009 1 3 05082009 2 Table #2(foods) CREATE T...
[ 0.23423293232917786, 0.2379896640777588, 0.31033089756965637, 0.08915600925683975, -0.14124834537506104, 0.15840697288513184, 0.039977576583623886, -0.11242177337408066, -0.38113051652908325, -0.7790114879608154, -0.2000594437122345, -0.00518688652664423, -0.08757099509239197, 0.3487403690...
1 2 food2 9.0 1 3 food3 5.0 1 4 food4 15.0 2 5 food5 14.0 2 6 food6 12.0 3 Table#3(activities) CREATE TABLE activities (pk INTEGER PRIMARY KEY, activity DOUBLE, activity_id INTEGER) pk activity activity_id 1
[ 0.30525702238082886, 0.02723102457821369, 0.14191903173923492, -0.26880985498428345, -0.1763962209224701, 0.17912398278713226, 0.10443850606679916, -0.5040552616119385, -0.5976946353912354, -0.34827524423599243, -0.2503960430622101, 0.1537703424692154, -0.569223165512085, -0.16936352849006...
5.0 1 2 4.0 1 3 2.0 2 4 4.0 3 ``` With this ex and query from my original post (one that doesn't work), I would be looking for a result set containing one value..8.0 MIN(26.0-20, 9.0)
[ 0.1188102439045906, 0.0982651636004448, 0.554222583770752, -0.06333421915769577, 0.08475667983293533, 0.13820821046829224, 0.44418829679489136, -0.30637216567993164, -0.055278342217206955, -0.632210910320282, 0.0856577455997467, 0.29466888308525085, 0.09757488965988159, 0.4104806184768677,...
= 6.0 MIN(29.0-20, 2.0) = 2.0 6.0 + 2.0 = 8.0 I hope this helps! After much head-scratching and divining I suspect what you want might be: ``` SELECT SUM(MIN(fp-20, ap)) FROM (SELECT dates.pk AS fd, SUM(points) AS fp FROM dates JOIN foods ON name_id = fd GROUP BY fd HAVING fp >= 20) JOIN (SELEC...
[ 0.36395642161369324, 0.02099420130252838, 0.5408240556716919, -0.06147054210305214, -0.05749329552054405, 0.6593043804168701, -0.21739540994167328, -0.07581400126218796, -0.26266661286354065, -0.5188426375389099, -0.2058420032262802, 0.10383115708827972, 0.044585879892110825, 0.27941522002...
meaning but, hey, at least this does give 8.0 and the subselects give the other numbers you mention!-)
[ 0.06204007565975189, 0.0067831422202289104, 0.4027566611766815, 0.018560538068413734, -0.09383298456668854, 0.10410875827074051, 0.5351354479789734, -0.17666156589984894, -0.4711037576198578, -0.18738791346549988, -0.14968343079090118, 0.2950407862663269, -0.2189609557390213, 0.06260067224...
I am developing a application that needs to store data with many writes and reads as requiring fast searching of data (the need for indexes of some sort), and also be able to serialize and save the data. Currently I am thinking about using SQLite, which gets the job done, but I am open for alternatives. The SQLite's ...
[ 0.31298577785491943, 0.6325090527534485, 0.42076000571250916, -0.05169985070824623, -0.01764499954879284, -0.31799188256263733, 0.08166204392910004, -0.08897258341312408, -0.1175631508231163, -0.3121045231819153, 0.006424670107662678, 0.6474724411964417, -0.21004964411258698, -0.1078200787...
...
[ 0.33003100752830505, 0.5980523228645325, -0.05368642508983612, 0.2757348418235779, -0.007163385860621929, -0.2948451042175293, 0.21162347495555878, 0.0900595411658287, 0.015520160086452961, -1.0327308177947998, -0.16347163915634155, 0.03891986235976219, -0.18308916687965393, 0.438344031572...
I am looking for a library or database that can provide guesses about whether a person is male or female based on his or her name or nickname. Something like ``` john => "M", mary => "F", alex => "A", #ambiguous ``` I am looking for something that supports names other than English names (such as Japanese, Indian, e...
[ 0.5986149907112122, 0.2827542722225189, -0.220687136054039, 0.10857947915792465, -0.007610976696014404, 0.07875660806894302, 0.3784152865409851, 0.4572593569755554, -0.07720214873552322, -0.38722437620162964, -0.07575100660324097, 0.035526178777217865, -0.1735917031764984, 0.17245455086231...
In many cases, the person in question is dead, and the only information I have is name, birth date, and date of death. The reason I want to know the sex of the individual is to make the grammar of the output nicer and to aid in possible searches that may come latter. The gender of a name is something that cannot be inf...
[ 0.5216661691665649, 0.1339479237794876, -0.0065385885536670685, 0.3145604431629181, 0.35828807950019836, 0.40687161684036255, 0.25524696707725525, 0.1590668112039566, -0.3844621181488037, -0.22554965317249298, -0.06667546182870865, 0.06806787848472595, 0.2111816704273224, 0.342045873403549...
in the comments.
[ 0.3004058003425598, 0.1986975222826004, -0.03323525935411453, 0.001843611360527575, -0.21185103058815002, -0.04651094973087311, -0.041881218552589417, 0.1616690456867218, -0.03879614174365997, -0.3825342059135437, -0.132667675614357, 0.22012753784656525, -0.07031355053186417, 0.08013563603...
To combine `stderr` and `stdout` into the `stdout` stream, we append this to a command: ``` 2>&1 ``` e.g. to see the first few errors from compiling `g++ main.cpp`: ``` g++ main.cpp 2>&1 | head ``` What does `2>&1` mean, in detail? File descriptor 1 is the standard output (`stdout`). File descriptor 2 is the s...
[ 0.04582716524600983, 0.08421893417835236, 0.31735697388648987, -0.18374963104724884, -0.16763722896575928, 0.11332463473081589, 0.2631722390651703, -0.3626573383808136, -0.15757209062576294, -0.6590041518211365, -0.3527170419692993, 0.5771328210830688, -0.3127982020378113, 0.04884464293718...
redirect merger operator.
[ -0.07623462378978729, -0.11156666278839111, 0.5548900365829468, 0.0016468885587528348, -0.0954936221241951, 0.0768272876739502, -0.037740107625722885, -0.12093082070350647, -0.17518968880176544, -0.6235470175743103, -0.43690159916877747, 0.278933584690094, -0.5512949228286743, -0.005980058...
I'm just starting to learn the iphone API, and I've done plenty of windows programming, and I'm sure there's a way, given the object passed to an event handler, to identify its object id or tag or something. I created a series of UIButtons in the interface builder, and each has an object ID. But I just can't see where...
[ 0.5479844808578491, -0.09598613530397415, 0.41381728649139404, -0.0620313324034214, 0.27977094054222107, 0.09539160877466202, 0.12164852768182755, 0.1649312674999237, -0.4204106330871582, -0.44530609250068665, -0.03581767529249191, 0.5494409203529358, -0.23949319124221802, -0.0840717107057...
use the title as the ID? The interface builder has an "interface builder identity" which I'm guessing I don't have access to from the iphone API, do I? There's also a setting called "Tag" in the "view" section of the button attributes, but it's a number. That will do, but I don't see any API call to get that either. ...
[ 0.40053504705429077, -0.13584384322166443, 0.37044405937194824, 0.27085280418395996, 0.028989428654313087, -0.1660119891166687, 0.13411004841327667, -0.06526302546262741, -0.14721335470676422, -0.4768494665622711, 0.19530971348285675, 0.9841579794883728, -0.19568774104118347, 0.06678344309...
Is the following "From" header incorect? ``` // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: Mail Master <mail@mailmaster.com>' . "\r\n"; ...
[ 0.18339486420154572, 0.2018207609653473, 0.5836983919143677, -0.22226016223430634, -0.2034640610218048, -0.21088136732578278, 0.5571945905685425, -0.22726917266845703, 0.08002855628728867, -0.6493048667907715, -0.27823418378829956, 0.45623132586479187, -0.42628201842308044, 0.2683435082435...
if (mail($email, $subject, $body, $headers)) { ##check email ##code to say email sent - compare with the number registered return true; } else { ##code to report an error return false; } } ``` Update 2 -------- Problem solved. I am running this on a windows machine us...
[ 0.22099705040454865, 0.12588688731193542, 0.3810090124607086, -0.14472351968288422, -0.2882983684539795, -0.18005861341953278, 0.4795200526714325, -0.08937256783246994, 0.15176589787006378, -0.6055316925048828, 0.12220030277967453, 0.5528048276901245, -0.34889712929725647, -0.0497964620590...
trouble understanding what I had previously. But what worked for me was this: ``` $headers .= 'From: mail@mailmaster.com' . "\r\n"; ``` A Google search for the error message suggests that some SMTP servers fail to parse your syntax for the `From` header. Can you try the following syntax to rule out this possibility? ...
[ 0.30145397782325745, 0.10788010060787201, 0.17595212161540985, 0.040785569697618484, 0.05285235866904259, -0.3469439148902893, 0.5479774475097656, 0.2627424895763397, -0.34055665135383606, -0.45994052290916443, 0.015095885843038559, 0.384970486164093, -0.5012109279632568, 0.178797394037246...
I trying to understand if a isset is required during form processing when i check $\_REQUEST["input\_name"] if no value is passed it doesn't cry about it and php doesn't throw out an error if you are trying to access a array item which doesn't exist....i can use if($\_REQUEST["input\_name"]).. what about "empty" even i...
[ -0.08205754309892654, 0.08850891888141632, 0.4508988559246063, -0.07411109656095505, -0.2935314476490021, -0.12197686731815338, 0.45712095499038696, -0.29856207966804504, -0.1008002758026123, -0.7527869343757629, -0.09303980320692062, 0.3278610408306122, -0.24243523180484772, -0.0356299132...
I'd like to randomly load images from the user's photo album, but I'd prefer not to have to access an image picker (i.e. I'd like to have the images be random background images). Does anyone know if this is possible? (I couldn't find any references other than: UIImageWriteToSavedPhotosAlbum ) Edit: I'm trying to do t...
[ 0.47413891553878784, 0.05170176923274994, 0.008962332271039486, 0.3126436471939087, 0.1534179002046585, -0.20411227643489838, 0.14652307331562042, 0.07914865761995316, -0.4517309069633484, -0.6257933974266052, 0.24737805128097534, 0.583664059638977, -0.08444944024085999, -0.069052338600158...
from the Photo Album. How might I go about that? Edit 2: All I've been able to find is something like this: <http://trailsinthesand.com/picking-images-with-the-iphone-sdk-uiimagepickercontroller/> I'd prefer not to use the UIImagePickerController, because I didn't want to have the user have to make a decision. I was ...
[ 0.4942914843559265, -0.05406299605965614, 0.31939852237701416, 0.20507143437862396, -0.09781578183174133, -0.22359731793403625, 0.116604745388031, -0.11197710782289505, -0.41639676690101624, -0.4487122893333435, 0.2556246519088745, 0.31806281208992004, -0.15527421236038208, -0.391392558813...
would be approved by Apple. So, looks like we'll have to wait until functionality like this can be added...
[ 0.2784455716609955, 0.05033420771360397, 0.31745046377182007, 0.1397119015455246, 0.5707717537879944, -0.2723782956600189, -0.06406442075967789, 0.3095734119415283, 0.13903892040252686, -0.5484170317649841, -0.10291879624128342, 0.6235344409942627, -0.040115438401699066, -0.117497831583023...
I run the following command in Emacs unsuccessfully ``` C-u ``` **How can you clear the beginning of a line in Emacs?** You can set the mark, go to the beginning, kill till mark: ``` C-Spc C-a C-w ```
[ 0.2749632000923157, 0.1359720677137375, 0.48294633626937866, 0.008249374106526375, -0.00009576077718520537, -0.09313667565584183, 0.40680423378944397, 0.09052316099405289, -0.333033949136734, -0.18956387042999268, -0.11738703399896622, 0.0785340815782547, -0.08822338283061981, 0.0548973381...
There exists an RSS feed with over 1000 items. I want to create a Yahoo Pipes RSS feed that returns a subset of the feed's items, specified by the index of the first and last item. For example, I could pass in first=500 and last=600, and the Pipe will return an RSS feed with only the 500th through 600th itemd in the so...
[ 0.3844330608844757, -0.1355142742395401, 0.44788429141044617, 0.18982990086078644, 0.04481680318713188, 0.2404744029045105, -0.0521291121840477, -0.09572461247444153, -0.19293589890003204, -0.7192625403404236, 0.12520629167556763, 0.17621862888336182, -0.3347111642360687, 0.304109692573547...
"FROM vacancies ". "WHERE id = '".$_GET['id']."'"; ``` I always try to leave the variables out of my strings, just add them in with periods, I find it eliminates a lot of confusion.
[ 0.18615838885307312, 0.003117492189630866, 0.08031214773654938, 0.01918429136276245, 0.31285256147384644, -0.02441892959177494, 0.13875111937522888, 0.0394069068133831, -0.1986362785100937, -0.2767929136753082, -0.33060887455940247, 0.25319501757621765, -0.026136593893170357, 0.32040852308...
I have an `NSTableView` which I wish to allow users to drag-and-drop video files onto. When they drop the file, it'll get added as a row in the table view. How would I go about doing this? Currently the tableview's takes its data from an Array Controller (which takes its data from a NSMutableArray) I found [this](htt...
[ 0.22698654234409332, -0.11790595203638077, 0.7330096364021301, 0.12352186441421509, -0.1341242641210556, -0.07383038848638535, 0.03996362164616585, -0.2733471691608429, -0.4365859925746918, -0.570306658744812, 0.08339086174964905, 0.48231855034828186, -0.29648733139038086, 0.35369449853897...
(again in TableCon) ..but, nothing, it acts like I never changed anything (no errors), what am I doing wrong? **Edit:** I've tried implementing Boaz Stuller's suggestion, and also found [this](http://www.cocoabuilder.com/archive/message/cocoa/2009/3/17/232541) description of the solution (the [first reply](http://www...
[ -0.006129066459834576, 0.22283639013767242, 0.6193194389343262, -0.1851794719696045, -0.16562646627426147, -0.24682007730007172, 0.607197642326355, -0.21807602047920227, -0.5408154726028442, -0.6459764838218689, -0.07725276798009872, 0.44654226303100586, -0.31454864144325256, 0.04556516185...
called) NSTableView handles drag-and-drop differently from generic views, which is overall a good thing. It means that you don't have to manually handle the complicated highlighting, cell tracking and inserting behaviours that tables require. A description of what is required can be found [here](http://developer.apple...
[ 0.12002597749233246, 0.16271455585956573, 0.2897333800792694, 0.14432626962661743, -0.20232827961444855, -0.043468162417411804, 0.2070654332637787, -0.37813887000083923, -0.4649255573749542, -0.6635517477989197, 0.06225036829710007, 0.6694464087486267, -0.27452224493026733, 0.0382511168718...
view's dataSource outlet to the class that implements those methods in order for them to be called.
[ -0.11700276285409927, -0.1968066394329071, 0.34496259689331055, 0.24298478662967682, -0.1951381117105484, 0.17286530137062073, -0.10334067791700363, 0.01877274177968502, 0.1258612424135208, -0.47899773716926575, -0.37501123547554016, 0.42939528822898865, 0.07104773074388504, 0.087925314903...
I was wondering if there was a way to get the number of results from a MySQL query, and at the same time limit the results. The way pagination works *(as I understand it)* is to first do something like: ``` query = SELECT COUNT(*) FROM `table` WHERE `some_condition` ``` After I get the `num_rows(query)`, I have the...
[ -0.08263059705495834, -0.01855369284749031, 0.03890853375196457, 0.07925966382026672, -0.1579020470380783, 0.1430932879447937, -0.08462955057621002, -0.10165388137102127, -0.17208018898963928, -0.6303663849830627, 0.07748030126094818, 0.35895800590515137, -0.3231605291366577, 0.15984666347...
in a single query? Or are there any other efficient ways of achieving this? No, that's how many applications that want to paginate have to do it. It's reliable and bullet-proof, albeit it makes the query twice, but you can cache the count for a few seconds and that will help a lot. The other way is to use `SQL_CALC_FO...
[ 0.15160444378852844, 0.04944383352994919, 0.11457566916942596, 0.17679181694984436, -0.14353159070014954, -0.014248618856072426, 0.14659251272678375, -0.25588682293891907, -0.40363991260528564, -0.5725000500679016, 0.16306482255458832, 0.17194820940494537, -0.4223279654979706, 0.0921339914...
on large tables than the naive approach of two queries.
[ -0.26210442185401917, 0.06072672829031944, -0.12870202958583832, 0.2721345126628876, -0.2144780158996582, 0.0022177323698997498, -0.2919505834579468, -0.06523578613996506, -0.2793843746185303, -0.8358367681503296, 0.05157284811139107, 0.42724379897117615, 0.1535102128982544, -0.13801066577...
How to get the directory of a file? For example, I pass in a string ``` C:\Program Files\nant\bin\nant.exe ``` I want a function that returns me ``` C:\Program Files\nant\bin ``` *I would prefer a built in function that does the job, instead of having manually split the string and exclude the last one.* **Edi...
[ 0.062436677515506744, -0.009949324652552605, 0.404432475566864, -0.016137680038809776, 0.24787625670433044, -0.12603792548179626, 0.35344600677490234, -0.09756487607955933, 0.043752871453762054, -0.8638642430305481, -0.10209516435861588, 0.6237046718597412, -0.22438493371009827, 0.12503674...
Developed a Windows application that remotely accesses an SQL Server online. However, the client's ISP blocks port 1433. What are the other options to connect to SQL Server from the windows app? SQL Server should have a network utility where you can configure the port to be used. Contact your client's ISP to see which ...
[ 0.16165520250797272, 0.09014272689819336, 0.3244417905807495, 0.16524416208267212, 0.14459894597530365, -0.02816339023411274, -0.07719764113426208, -0.12389314919710159, -0.2673529386520386, -0.6542176008224487, -0.10581699013710022, 0.3584287762641907, -0.16185450553894043, 0.313932418823...
you can set the default port to a more accessible one.
[ 0.1152224987745285, -0.15882480144500732, -0.044310662895441055, 0.2728927433490753, 0.18454420566558838, -0.23769992589950562, 0.27318060398101807, 0.46235132217407227, -0.30858299136161804, -0.7517842054367065, -0.25674498081207275, 0.5423737168312073, -0.13706140220165253, 0.35891786217...
I have an .INF for a virtual printer that I need to install from a .NET Application. I have done this before using batch scripts, but I am looking for a snippet of code to do this in the .NET Framework. There's nothing particular about the printer .INF, so any code that installs a printer from an INF in C# or VB.NET w...
[ 0.7163709402084351, 0.09108865261077881, 0.3969114422798157, -0.1732061207294464, 0.04341743886470795, -0.14698679745197296, -0.18041075766086578, 0.1814485639333725, -0.18669238686561584, -0.9990858435630798, 0.20352628827095032, 0.456494003534317, -0.17050208151340485, 0.2509487271308899...
script, but if not the parameters are documented here: [PrintUI.DLL User's Guide and Reference](http://www.microsoft.com/windowsserver2003/techinfo/overview/printuidll.mspx) Just be sure to test it against all operation systems you need to support. Some options either do not exist in all Windows releases or have been...
[ 0.22507043182849884, -0.2869708836078644, 0.302097350358963, 0.11733362078666687, 0.09285695850849152, -0.4000747799873352, 0.4448743462562561, 0.41323569416999817, -0.0009981993352994323, -0.7631657719612122, -0.09732820093631744, 0.5780181288719177, -0.16747093200683594, -0.2018243372440...
While editing this and that in Vim, I often find that its syntax highlighting (for some filetypes) has some defects. I can't remember any examples at the moment, but someone surely will. Usually, it consists of strings badly highlighted in some cases, some things with arithmetic and boolean operators and a few other sm...
[ 0.35489022731781006, 0.0013167242286726832, 0.27210620045661926, 0.08146854490041733, -0.23979471623897552, -0.22440694272518158, 0.03499217703938484, 0.2555311620235443, -0.29371002316474915, -0.8371509313583374, -0.12361805886030197, 0.401512086391449, -0.33233439922332764, 0.21628066897...
wondering, do those editors just have better written regexes, or do they take care of that in some other way ? What ? How is syntax highlighting taken care of when you want it to be "stable" ? And in your opinion what is the editor that has taken care it the best (in your editor of choice), and how did he do it (langu...
[ -0.031550269573926926, 0.06461228430271149, 0.3171614706516266, 0.3807292580604553, -0.07103616744279861, -0.060138653963804245, -0.0764855220913887, 0.16183799505233765, -0.32672110199928284, -0.7039830684661865, 0.003028512466698885, 0.6839793920516968, -0.19647487998008728, -0.271477848...
instead of regexes for syntax highlighting is **parsing**. Regexes have a lot of advantages, but as we see with vim's highlighting, there are limits. (If you look for threads about using regexes to analyze XML, you'll find extensive material on why regexes can't do what parsers do.) Since what we want from syntax high...
[ 0.10181452333927155, -0.27492791414260864, 0.13427124917507172, 0.2811741232872009, -0.5792012810707092, -0.016055600717663765, 0.22804932296276093, 0.11169206351041794, -0.10739494115114212, -0.7479174733161926, -0.045413367450237274, 0.6975911259651184, -0.36679089069366455, -0.234049782...
I am learning C++ as a first language. I feel like I am about to hit a ceiling on my learning (I am not learning through a class) if I don't start looking at actual code soon. Here are my two main questions: 1. Where can I find source code 2. What is a good litmus test on code's quality (I've obviously never developed...
[ 0.3085574507713318, 0.09297097474336624, -0.0133361229673028, 0.07260534167289734, -0.15184053778648376, -0.13266056776046753, 0.25057801604270935, 0.03755130246281624, -0.2844703495502472, -0.421966552734375, -0.09818502515554428, 0.7681481242179871, 0.2784202992916107, -0.384346961975097...
design. Reading Boost source code can show you how to use C++ to solve some challenging problems in a concise way. This add on library is itself written in C++, in a peer-reviewed fashion, and has a high standard of quality.
[ 0.36298197507858276, 0.2540975511074066, 0.0017498807283118367, 0.21942901611328125, -0.22214646637439728, -0.15484116971492767, -0.02191230282187462, -0.21911734342575073, 0.035139843821525574, -0.4866963028907776, -0.26328447461128235, 0.7629773616790771, -0.2031467854976654, -0.53773117...
What is the easiest way to check if a socket was closed on the remote side of the connection? `socket::is_open()` returns true even if it is closed on the remote side (I'm using `boost::asio::ip::tcp::socket`). I could try to read from the stream and see if it succeeds, but I'd have to change the logic of my program t...
[ -0.08679935336112976, 0.045376040041446686, 0.2177410125732422, 0.19388192892074585, -0.04934803023934364, -0.2132340520620346, 0.39178040623664856, -0.0971364825963974, -0.1308600753545761, -0.4743250012397766, 0.08479742705821991, 0.6154800653457642, -0.05339418724179268, 0.0053202332928...
order to figure out if the connection is really alive.
[ 0.5601592063903809, 0.0981271043419838, -0.12335477769374847, 0.3696621060371399, 0.029443981125950813, -0.0014355055755004287, 0.3319125771522522, -0.19204868376255035, 0.10883362591266632, -0.4068044424057007, -0.005775253288447857, 0.27083468437194824, -0.07670209556818008, -0.341211736...
All reservations about unsecuring your SecureString by creating a System.String out of it **aside**, how can it be done? How can I convert an ordinary System.Security.SecureString to System.String? I'm sure many of you who are familiar with SecureString are going to respond that one should never transform a SecureStr...
[ 0.35303443670272827, 0.07176106423139572, 0.2273886352777481, 0.17669837176799774, 0.04155660420656204, -0.22891667485237122, 0.41212061047554016, 0.010156160220503807, -0.2694988548755646, -0.5605131387710571, -0.2238527089357376, 0.4418286681175232, -0.3484761118888855, 0.289288133382797...
to increase my security. I'm aware of Marshal.SecureStringToBSTR, but I don't know how to take that BSTR and make a System.String out of it. For those who may demand to know why I would ever want to do this, well, I'm taking a password from a user and submitting it as an html form POST to log the user into a web sit...
[ 0.3450297713279724, 0.320352703332901, 0.3158848285675049, 0.09505978226661682, 0.11710963398218155, -0.3137916922569275, 0.36696964502334595, 0.006881753448396921, -0.2707505524158478, -0.5387265682220459, 0.015347687527537346, 0.4309737980365753, -0.05645941197872162, 0.19842563569545746...
keeps the password secure the whole way. I'm hoping for an answer to at least one of these scenarios. Use the [`System.Runtime.InteropServices.Marshal`](http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.aspx) class: ``` String SecureStringToString(SecureString value) { IntPtr valuePtr = ...
[ -0.07747694104909897, -0.015558335930109024, 0.4466676414012909, 0.19255366921424866, 0.38793519139289856, -0.2172916829586029, 0.43027594685554504, -0.49833163619041443, -0.2495843917131424, -0.34705737233161926, -0.40782105922698975, 0.66593337059021, -0.16059602797031403, 0.122990548610...
short unicodeChar = Marshal.ReadInt16(valuePtr, i*2); // handle unicodeChar } } finally { Marshal.ZeroFreeGlobalAllocUnicode(valuePtr); } } ```
[ 0.02245303802192211, 0.11230277270078659, 0.2384152114391327, 0.1153760701417923, -0.023817334324121475, -0.07003308087587357, 0.2722690999507904, -0.2879240810871124, -0.09010794013738632, -0.3763448894023895, -0.3067915141582489, 0.2378019243478775, -0.16569754481315613, 0.02796315588057...
Is it possible to override the equals() operator (ie. for customer classes where equality may be determined by 2 or more fields matching). if you mean overloading "==" as a synonym for equals() then you can't, as ActionScript doesn't offer operator overloading. Just write an equals() method for your class and use that....
[ -0.20427165925502777, -0.2444768100976944, -0.08411025255918503, 0.17946049571037292, 0.06827517598867416, -0.2152513712644577, 0.166404128074646, -0.06358690559864044, -0.06744315475225449, -0.22629132866859436, -0.06971155107021332, 0.4968756139278412, -0.5389264822006226, -0.37143814563...
Several of the resources I've gone to on the internet have disagree on how set [associative caching](http://en.wikipedia.org/wiki/CPU_cache#Associativity) works. For example hardware secrets seem to believe it works like this: > Then the main RAM memory is divided in > the same number of blocks available in > the ...
[ 0.36290401220321655, 0.16994363069534302, 0.22147588431835175, -0.01651882566511631, -0.06361039727926254, 0.35723450779914856, 0.015787964686751366, -0.544945240020752, -0.23973609507083893, -0.8521744012832642, -0.20918968319892883, 0.4093627631664276, -0.31806689500808716, 0.05204239860...
direct mapped cache. <http://www.hardwaresecrets.com/printpage/481/8> They seem to be saying that each cache block(4 cache lines) maps to a particular block of contiguous RAM. They are saying non-contiguous blocks of system memory(RAM) *can't* map to the same cache block. This is there picture of how hardwaresecret...
[ 0.34998127818107605, -0.1966606229543686, 0.35884255170822144, 0.15484292805194855, -0.036737628281116486, 0.18663501739501953, -0.03472866117954254, -0.4563576877117157, -0.20860938727855682, -0.6030775904655457, -0.14749516546726227, 0.3360186815261841, -0.26573193073272705, 0.2646465897...
of main memory, and the other for > another area which happens to map to > the same cache line. <http://www.spsu.edu/cs/faculty/bbrown/web_lectures/cache/> That is, non-contiguous blocks of system memory *can* map to the same cache block. How are the relationships between non-contiguous blocks on system memory and...
[ 0.14788313210010529, 0.0597149059176445, 0.24344852566719055, 0.22235722839832306, -0.22191910445690155, 0.20701530575752258, 0.04992249980568886, -0.2037217766046524, -0.4388490319252014, -0.6743521690368652, 0.03740059956908226, 0.38940659165382385, -0.04661109670996666, -0.0029451241716...
it based on the paging system? Can someone point me to a url that explains N-way set associative cache in great detail? also see: <http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Memory/set.html> When I teach cache memory architecture to my students, I start with a direct-mapped cache. Once that is understood, you c...
[ 0.3090026080608368, -0.11654577404260635, 0.06668097525835037, 0.23975211381912231, -0.27441877126693726, -0.006832322105765343, 0.007703682407736778, -0.09814352542161942, -0.0484360046684742, -0.539836049079895, 0.024563729763031006, 0.3372592329978943, -0.2577812671661377, 0.10448749363...
in the Wikipedia figure. So, instead of evicting a cache entry, we can use a N-way cache to store the other 'aliased' memory locations. In effect, the hardware secrets diagram would be correct assuming the order of replacement is such that the first chunk of main memory is mapped to Way-1 and then the second chunk to ...
[ 0.2636335790157318, -0.05359882116317749, 0.24723981320858002, 0.5039896368980408, 0.11900504678487778, -0.012626933865249157, 0.33277106285095215, -0.0182918980717659, -0.2729582190513611, -0.8708951473236084, -0.3531172275543213, 0.19584575295448303, -0.10599477589130402, -0.007631988264...
part of your question, I believe that you may be confusing several different concepts.
[ 0.29959189891815186, 0.42007771134376526, -0.4018041789531708, 0.2952553629875183, -0.11111197620630264, -0.13081325590610504, 0.1759980171918869, 0.11101499199867249, -0.04189058020710945, -0.3180690109729767, 0.226249560713768, 0.2503355145454407, 0.0022660433314740658, 0.465971767902374...
Is writing deployment friendly code considered a good virtue on the part of a programmer? If yes, then what are the general considerations to be kept in mind when coding so that deployment of the same code later does not become a nightmare? The biggest improvement to deployment is to minimize manual intervention and m...
[ 0.06940855830907822, 0.23984074592590332, 0.04513121396303177, -0.013278464786708355, 0.15029777586460114, -0.17717474699020386, 0.4878326654434204, 0.09390144795179367, -0.28672507405281067, -0.7215313911437988, 0.006543912459164858, 0.9978825449943542, -0.006250634323805571, -0.483222961...
Say for example I have a Blog app that I want to be able to drop into different projects, but I always want the Blog to be associated with some other model. For example, in one case I may want it to be associated with a user: site.com/someuser/blog But on another site I want it to be associated with, say, a school: ...
[ 0.657931387424469, 0.25092047452926636, -0.051055263727903366, 0.2755906581878662, -0.05136489123106003, -0.1400499790906906, 0.0007886080420576036, 0.09055706858634949, -0.2047657072544098, -0.13170091807842255, 0.036501944065093994, 0.19273239374160767, -0.1048065647482872, 0.33832183480...
it to create a comment app that can be used for commenting any model in the database (for different reasons, I didn't want to use the standard django comment app). <http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/>
[ 0.24782203137874603, 0.039236437529325485, 0.22697044909000397, 0.15329422056674957, -0.3055936396121979, -0.059841930866241455, -0.0509815439581871, 0.14282189309597015, -0.12559911608695984, -0.5041411519050598, 0.28923308849334717, 0.6020466685295105, -0.2426605522632599, -0.02555076219...
Here is my query: ``` select word_id, count(sentence_id) from sentence_word group by word_id having count(sentence_id) > 100; ``` The table sentenceword contains 3 fields, wordid, sentenceid and a primary key id. It has 350k+ rows. This query takes a whopping 85 seconds and I'm wondering (hoping, praying?) there ...
[ -0.15130266547203064, 0.15677490830421448, 0.5421169400215149, -0.14808736741542816, -0.21485291421413422, 0.33771294355392456, 0.23510240018367767, -0.49033015966415405, -0.14182093739509583, -0.8623608946800232, -0.11347978562116623, 0.19707557559013367, -0.24546141922473907, -0.01388506...
does have duplicate word/sentence pairs, you should be using this code to get the correct answer: ``` HAVING COUNT(DISTINCT Sentence_ID) > 100 ``` --- If the table does not have duplicate word/sentence pairs... then you shouldn't count sentence\_ids, you should just count rows. ``` HAVING COUNT(*) > 100 ``` In w...
[ -0.23653282225131989, 0.24222685396671295, 0.29571816325187683, -0.019065894186496735, -0.1001802310347557, 0.2819018065929413, 0.11440939456224442, -0.2920919954776764, -0.2897971272468567, -0.8496978878974915, -0.19575238227844238, 0.43826207518577576, -0.2786104679107666, -0.20661972463...
I have a UserControl (XAML below) that has a ListBox that I want to display images inside a WrapPanel, where images are displayed as many as will fit on one row and then wrap onto the next row etc. It works, except when the ListBox grows higher than the available space in the window, I'm not getting a vertical scrollba...
[ 0.4657110571861267, 0.043758634477853775, 0.6832021474838257, 0.05101437121629715, -0.07771999388933182, -0.07555137574672699, 0.0749996155500412, -0.07281528413295746, -0.39866578578948975, -0.8329905271530151, 0.11495829373598099, 0.3940112292766571, -0.2132248878479004, 0.06961952894926...
control is inside StackPanel inside a Grid in the main window. If I wrap the StackPanel inside a ScrollViewer, I get the scrollbar I'm after, but that's not really a good solution if I wanted to add some more controls to the UserControl above the ListBox (e.g. image size "zoom" etc) as I wouldn't want them to scroll wi...
[ -0.6341323256492615, -0.25182533264160156, 1.0122448205947876, 0.3406253755092621, 0.03303734213113785, -0.0968794971704483, -0.3409191370010376, -0.4567963480949402, -0.08631632477045059, -0.2087590992450714, 0.10523378103971481, 0.4011024236679077, -0.16648659110069275, -0.09658579528331...
<StackPanel Background="LightGray" Margin="5" > <StackPanel Margin="5"> <Image Source="{Binding Path=LocalThumbPath}" Height="100" /> <TextBlock Text="{Binding Path=Name}" TextAlignment="Center"></TextBlock>
[ -0.5548720955848694, -0.03026437945663929, 0.7359409332275391, -0.1457338035106659, -0.10180563479661942, 0.00007776702113915235, 0.006538891699165106, -0.4248015284538269, -0.35601523518562317, -0.578720211982727, -0.1752728819847107, 0.01100870594382286, -0.019432125613093376, -0.3698356...
</StackPanel> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel /> </ItemsPanelTemplate> </ListBox.ItemsPanel>
[ -0.35145992040634155, -0.20226044952869415, 0.09073102474212646, -0.12628985941410065, -0.41648751497268677, 0.4272294342517853, -0.30037713050842285, -0.3186172544956207, -0.6913366317749023, -0.5406964421272278, -0.19087517261505127, -0.31267228722572327, 0.15358726680278778, -0.25825405...
</ListBox> ``` Well, I finally stumbled upon the solution. I was adding my UserControl to a placeholder panel that looked like this: ``` <ScrollViewer Margin="20" > <StackPanel Name="contentPanel"></StackPanel> </ScrollViewer> ``` However, when I switched it to a Grid instead...
[ -0.15416207909584045, -0.0659676343202591, 0.8074925541877747, -0.1132698655128479, -0.21409814059734344, 0.14919127523899078, -0.264273077249527, -0.02060113474726677, -0.46902164816856384, -1.09782874584198, 0.06493917852640152, 0.28307396173477173, -0.0006347588496282697, 0.062626652419...
default, like the Grid is doing.
[ 0.12460438907146454, -0.2804759740829468, 0.20527079701423645, -0.16784562170505524, 0.2556438446044922, -0.24719053506851196, -0.0422569178044796, 0.41236022114753723, -0.2003721445798874, -0.6235727071762085, -0.22177286446094513, 0.5578310489654541, -0.3460782468318939, -0.1093877032399...
VS 2008 I am using the code below to detect if the client can connect to our SIP server. This was working fine. However, the client has changed there network and now my application has to connect to the SIP server from behind a proxy server. The error I get is the: > "A connection attempt failed because the connecte...
[ 0.051740631461143494, 0.1557011902332306, 0.6696888208389282, 0.030697299167513847, -0.4541966915130615, -0.18023881316184998, 0.39105260372161865, -0.21981434524059296, -0.19078421592712402, -0.5945758819580078, 0.30177950859069824, 0.6291398406028748, -0.12001029402017593, 0.244510293006...
can add the proxy address to the socket. Am I missing something? Many thanks for any suggestions, ``` public bool IsSIPServerAvailable() { bool isAvailable = true; Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tc...
[ -0.028428733348846436, -0.10047774016857147, 0.5305243134498596, 0.058803342282772064, 0.1981009989976883, 0.08876677602529526, 0.5601159930229187, 0.09035152196884155, 0.012224891223013401, -0.7767514586448669, -0.14985540509223938, 0.2968975603580475, -0.19502472877502441, 0.109865054488...
sock.Connect("xxx.xxx.xx.xx", xx); } catch (SocketException ex) { Console.WriteLine(ex.Message); isAvailable = false; } catch (Exception ex) { Console.WriteLine(ex.Message); isAvailable = false; } finally { if (sock.Connected) {
[ 0.11910863220691681, -0.45359304547309875, 0.2818322777748108, -0.07440785318613052, 0.1872730404138565, 0.10231729596853256, 0.4808673560619354, -0.13284045457839966, -0.1044362336397171, -0.47587668895721436, -0.09306173026561737, 0.5774822235107422, -0.1563156098127365, 0.09120696038007...
sock.Close(); } } return isAvailable; } ``` See my answer [here](https://stackoverflow.com/questions/3127127/how-to-open-socket-thru-proxy-server-in-net-c/3127176#3127176), maybe it will be helpful. The general idea is to first establish connection to a proxy, and then use HTTP CONNECT command to open...
[ 0.11770205944776535, -0.1012982577085495, 0.3355754017829895, 0.040296249091625214, 0.040107645094394684, -0.22417689859867096, 0.2522875666618347, 0.11504848301410675, -0.1548653542995453, -0.879883348941803, -0.002613515593111515, 0.35434964299201965, -0.1939842402935028, 0.2145781964063...
I want to have a feature in my app where the user can send an email to a friend with the iTunes URL to my application. How is it possible? Thanks. Rather than the long and confusing urls that you usually see, you can create App Store links that are much simpler and more logical. The iTunes Store has a hidden URL forma...
[ 0.7974376082420349, 0.19365406036376953, 0.5195487141609192, 0.08649325370788574, -0.027834085747599602, 0.030622798949480057, -0.18059544265270233, 0.03363284841179848, -0.5383376479148865, -0.6700614094734192, -0.10914917290210724, 0.6473685503005981, 0.1000177413225174, 0.11324691772460...
include a url of this format in the body of the email you create. (Note that spaces might cause problems, but I found that omitting them entirely worked for me - <http://itunes.com/app/FrootGroove> redirects to the app called "Froot Groove".) (Also note that if this doesn't work for you, the iTunes link maker is [her...
[ 0.10902639478445053, 0.14465710520744324, 0.6603900194168091, 0.0361359603703022, 0.0010415902361273766, 0.035784684121608734, 0.5248880982398987, -0.26387903094291687, -0.32562220096588135, -0.8263527750968933, -0.08664070069789886, 0.480486661195755, -0.2514742910861969, -0.1023040115833...
combine to create the fully escaped URL string NSString *mailtoStr = [mailtoPrefix stringByAppendingString:escapedBody]; // And let the application open the merged URL [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mailtoStr]]; #endif ``` You can do better things in iPhone 3.0, but I can't talk abou...
[ 0.1638682633638382, 0.17028148472309113, 0.3953453004360199, -0.13218800723552704, 0.07315302640199661, -0.06710962951183319, 0.6486727595329285, -0.3778294026851654, 0.00020319822942838073, -0.6386569142341614, -0.20030511915683746, 0.45463618636131287, -0.3802151679992676, -0.14599806070...
Is it possible to embed images an email being sent from my app? Can we have an tag with source as an image in our app? Thanks. Yes. Using 3.0's mail APIs you can. I'll not put the code here because it is under the NDA. It is well documented in the SDK though. You need to get the image data into an NSData which is not...
[ 0.4876180589199066, -0.039646223187446594, 0.5622173547744751, 0.19837768375873566, -0.09157121926546097, -0.09727095812559128, 0.21699251234531403, 0.0674930065870285, -0.1641494482755661, -0.9896494150161743, 0.019860675558447838, 0.4537130892276764, -0.23456533253192902, -0.005899964831...
I am new to Objective C and iPhone development. I am using CoreData on the new iPhone 3.0 platform. My application executes; however, I am getting no objects back from the fetchedResultsController. I would like to see the SQL that is being passed to SQLite. In the Apple documentation it says I can see this by passing...
[ 0.17469610273838043, 0.49586620926856995, 0.416395366191864, -0.10046783834695816, 0.11831354349851608, -0.00046042221947573125, 0.44305506348609924, -0.27324461936950684, -0.01319601945579052, -0.4900324046611786, -0.15995556116104126, 0.5963928699493408, -0.3284704089164734, -0.085285976...
tab 5) Add the necessary argument in the Arguments box
[ -0.005283310543745756, 0.3116222620010376, 0.2946171462535858, -0.024242738261818886, 0.20957143604755402, 0.09290909022092819, 0.14144185185432434, -0.35016241669654846, 0.18195338547229767, -0.2583726942539215, -0.6123806238174438, 0.5224571824073792, -0.05818186327815056, -0.22110515832...
We are implementing an emulator for a piece of hardware that is being developed at the same time. The idea is to give 3rd parties a software solution to test their client software and give the hardware developers a reference point to implement their firmware. The people who wrote the protocol for the hardware used a c...
[ 0.5570288896560669, 0.39664003252983093, 0.3064846694469452, 0.05536939203739166, -0.02803928032517433, -0.12993434071540833, 0.038507722318172455, -0.02295292355120182, 0.12826356291770935, -0.4109080731868744, 0.1680450737476349, 0.5353700518608093, -0.3421476185321808, -0.12558445334434...
always has the same global structure: > [HEAD] [INTRO] [DATA] [TAIL] ``` [HEAD] = byte sync 0x03 byte length X [MSB] X = length of [HEADER] + [INTRO] + [DATA] byte length X [LSB] X = length of [HEADER] + [INTRO] + [DATA] byte check X [MSB] X = crc of [INTRO] [DATA]
[ -0.09933895617723465, -0.007099428214132786, 0.6644588112831116, 0.0030348862055689096, 0.18672695755958557, -0.22434228658676147, -0.05044809728860855, 0.16841350495815277, -0.3295227289199829, -0.5702862739562988, -0.32615306973457336, 0.1075347289443016, -0.5072880387306213, 0.088388286...
byte check X [LSB] X = crc of [INTRO] [DATA] byte headercheck X X = XOR over [SYNC] [LENGTH] [CHECK] [INTRO] byte version 0x03 byte address X X = 0 for point-to-point, 1-254 for specific controller, 255 = broadcast byte sequence X
[ -0.11578510701656342, 0.07101931422948837, 0.46885839104652405, -0.042215898633003235, -0.14373375475406647, -0.10861668735742569, -0.12995655834674835, -0.1994156688451767, 0.00398210296407342, -0.43250828981399536, -0.2887122631072998, 0.3829648792743683, -0.4419900178909302, 0.089479357...
X = sequence number byte group X [MSB] X = The category of the message byte group X [LSB] X = The category of the message byte type X [MSB] X = The id of the message
[ -0.23809434473514557, 0.16801971197128296, 0.1317969560623169, -0.3565291464328766, -0.293602854013443, 0.27977505326271057, -0.041295576840639114, 0.05699307471513748, -0.29399988055229187, -0.2513636350631714, -0.8006290793418884, -0.18897858262062073, -0.5353243947029114, 0.227235883474...
byte type X [LSB] X = The id of the message [DATA] = The actual data for the specified message, this format really differs a lot. It always starts with a DRCode which is one byte. It more or less specifies the general structure of the data, but even within the same structure the data...
[ 0.2713821828365326, -0.029500458389520645, 0.362872451543808, 0.17433281242847443, -0.46666693687438965, -0.0637185275554657, -0.3882695138454437, 0.06766144186258316, -0.3543066084384918, -0.45949897170066833, -0.07578683644533157, -0.03345634788274765, -0.22238236665725708, 0.18749158084...
(I think this is an artifact of the INCA_XDR tool) [TAIL] = byte 0x0D ``` As you can see there is a lot of overhead data, but this is because the protocol needs to work with both RS232 (point-to-multipoint) and TCP/IP (p2p). ``` name size value drcode 1 1 name 8
[ -0.015609055757522583, 0.19937703013420105, 0.4506720304489136, 0.005624676123261452, -0.1706712692975998, -0.23989559710025787, -0.004333078395575285, -0.4153512716293335, -0.388153612613678, -0.38738059997558594, 0.014064229093492031, 0.18391335010528564, -0.3282468914985657, 0.273573964...
contains a name that can be used as a file name (only alphanumeric characters allowed) timestamp 14 yyyymmddhhmmss contains timestamp of bitmap library size 4 size of bitmap library to be loaded options 1
[ -0.20784033834934235, -0.10181047767400742, 0.44615450501441956, 0.3082810640335083, 0.09525734186172485, 0.1175961047410965, 0.08347171545028687, -0.23170097172260284, -0.3209156394004822, -0.5226110219955444, -0.3196839392185211, 0.10256849229335785, -0.07653529942035675, 0.1213385537266...
currently no options ``` Or it might have an entirely different structure: ``` name size value drcode 1 2 lastblock 1 0 - 1 1 indicates last block. Firmware can be stored blocknumber 2 Indicates block of firmware
[ -0.17283791303634644, 0.11878466606140137, 0.45278748869895935, -0.04034949466586113, -0.010295462794601917, 0.012664509005844593, 0.1492709219455719, -0.1188497468829155, -0.12599626183509827, -0.4751604199409485, -0.41880351305007935, 0.11437250673770905, 0.07821210473775864, 0.331733882...
blocksize 2 N size of block to load blockdata N data of block of firmware ``` Sometimes it's just a DRCode and no additional data. Based on the group and the type field, the emulator needs to perform certain actions. So first we look at those two fields and based on that we know wha...
[ 0.08873362094163895, 0.13721349835395813, 0.331686407327652, 0.12331577390432358, -0.07712747901678085, -0.08710712939500809, 0.06894561648368835, -0.5351898670196533, -0.06059328094124794, -0.5422966480255127, -0.11848629266023636, 0.41155892610549927, -0.45697516202926636, -0.11943894624...
which again has many different data structures. Some messages simply generate an ACK or NACK message, while others generate a real reply with data. We decided to break things up in small pieces. First of all there is the IDataProcessor. Classes implementing this interface are responsible for validating raw data and ...
[ -0.03789530321955681, -0.08165358752012253, 0.09495382755994797, 0.2828064560890198, -0.5079978704452515, 0.09388767927885056, -0.11572159081697464, -0.27426326274871826, -0.08739092200994492, -0.3404330015182495, -0.012437531724572182, 0.479050874710083, -0.5018292665481567, 0.10270147770...
anything else, all it does is validate the raw data. To inform the IMessageProcessor about errors, some additional properties have been added to the Message class: ``` bool nakError = false; bool tailError = false; bool crcError = false; bool headerError = false; bool lengthError = false; ``` They are not related t...
[ 0.019574029371142387, 0.42060497403144836, 0.1955033391714096, 0.12934048473834991, -0.23573701083660126, 0.004288116469979286, 0.20859815180301666, -0.4525696039199829, -0.05583702772855759, -0.5862882137298584, -0.03409677371382713, 0.597815752029419, -0.34415942430496216, 0.135895758867...
functional languages other than LINQ and SQL) The IMessageProcessor analyzes the data and decides what methods it should call on the IHardwareController. It might seem redundant to have IHardwareController, but we want to be able to swap it out with a different implementation and not be forced to use F# either. The cu...
[ -0.17826862633228302, 0.2554968595504761, 0.38014450669288635, 0.16191992163658142, 0.06597819924354553, 0.03997163474559784, 0.10939114540815353, -0.22126466035842896, 0.24683447182178497, -0.8568230867385864, -0.28377875685691833, 0.6884032487869263, -0.3780532777309418, -0.2207994759082...
generate the response Message. Again... the data in these response messages can have many different structures. Eventually an IDataFactory is used to convert the Message to raw protocol data ready to be sent to whatever class is responsible for communication. (Additional encapsulation of the data might be required for...
[ 0.2967491149902344, -0.22717823088169098, 0.3125094771385193, 0.20375655591487885, -0.43124303221702576, -0.054360248148441315, 0.3189913034439087, -0.1646115928888321, 0.05491367727518082, -0.8160227537155151, -0.002346793422475457, 0.8962104916572571, -0.10566762834787369, -0.22729210555...
I go. The code below is far from finished and probably looks like a giant mess. It only implements a handful of all the messages in the protocol and I can tell you there are lots and lots of them. So this file is going to get huge! Important to know: the byte order is reversed over the wire (historical reasons) ``` m...
[ -0.053790949285030365, 0.07104186713695526, 0.966777503490448, -0.09546107798814774, -0.02157193049788475, -0.228159099817276, 0.48086652159690857, -0.5504036545753479, -0.4365230202674866, -0.39788398146629333, -0.2058635801076889, 0.4864332675933838, -0.4619069993495941, 0.11165648698806...
= (uint16)11 let VPL_INUSE = (uint16)12 let VPL_SIZE = (uint16)13 let VPL_BUSY = (uint16)14 let SYNC_BYTE = (byte)0xE3 let TAIL_BYTE = (byte)0x0D let MESSAGE_GROUP_VERSION = 3uy let MESSAGE_GROUP = 701us [<Export(typeof<IMessageProcessor>)>] type public StandardMessageProcessor() = class let mutable controller : I...
[ -0.39798685908317566, -0.17201343178749084, 0.609653651714325, -0.06854838132858276, 0.11241964250802994, 0.17002999782562256, 0.08370419591665268, -0.6086934208869934, -0.6970376968383789, -0.5171680450439453, -0.389232337474823, 0.2938123941421509, -0.3651477098464966, 0.3878549039363861...
match m with | m when m.LengthError -> this.nakResponse(m,VPL_FRAMELENGTH) | m when m.CrcError -> this.nakResponse(m,VPL_CHECKSUM) | m when m.HeaderError -> this.nakResponse(m,VPL_CHECKSUM) | m -> this.processValidMessage m | _ -> null
[ -0.5839407444000244, -0.20083093643188477, 0.574725329875946, -0.056663379073143005, -0.03110373020172119, 0.3054170608520508, 0.3660975396633148, -0.5359302759170532, -0.4737008810043335, -0.5126910209655762, -0.34742891788482666, 0.2133517861366272, -0.18154184520244598, 0.49190878868103...
member public x.HardwareController with get () = controller and set y = controller <- y end member private this.processValidMessage (m : Message) = match m.Intro.MessageGroup with | 701us -> this.processDefaultGroupMessage(m);
[ -0.19482438266277313, -0.32821160554885864, 0.5543903112411499, 0.17396123707294464, 0.16158829629421234, 0.09694130718708038, 0.1400458961725235, -0.1870846301317215, -0.26387763023376465, -0.39132604002952576, -0.3183247745037079, 0.23111818730831146, -0.3699215352535248, 0.5692380070686...
| _ -> this.nakResponse(m, VPL_GROUPNOTSUPPORTED); member private this.processDefaultGroupMessage(m : Message) = match m.Intro.MessageType with | (1us) -> this.firmwareVersionListResponse(m) //ListFirmwareVersions 0 | (2us) -> this.StartLoadingFirmwareVer...
[ -0.32463130354881287, -0.24484659731388092, 0.6065970063209534, -0.3483434319496155, 0.15259698033332825, 0.08671803027391434, 0.5225169062614441, -0.2956693768501282, -0.5156542062759399, -0.5312851071357727, -0.2099592536687851, 0.3972633481025696, -0.5440280437469482, 0.2819854915142059...
//StartLoadingFirmwareVersion 1 | (3us) -> this.LoadFirmwareVersionBlock(m) //LoadFirmwareVersionBlock 2 | (4us) -> this.nakResponse(m, VPL_FRAMELENGTH) //RemoveFirmwareVersion
[ -0.285701721906662, -0.09721732139587402, 0.6203777194023132, -0.36242198944091797, -0.27542850375175476, 0.1520434319972992, 0.421188622713089, -0.2177381068468094, -0.3399932384490967, -0.48712703585624695, -0.25121134519577026, 0.2566456198692322, -0.531701922416687, 0.13229900598526, ...
3 | (5us) -> this.nakResponse(m, VPL_FRAMELENGTH) //ActivateFirmwareVersion 3 | (12us) -> this.nakResponse(m,VPL_FRAMELENGTH) //StartLoadingBitmapLibrary
[ -0.30295035243034363, -0.2432623952627182, 0.41596388816833496, -0.18565890192985535, -0.23553204536437988, 0.10582129657268524, 0.5985737442970276, -0.2791241407394409, -0.33499136567115784, -0.4946468770503998, -0.2962425649166107, 0.3924422860145569, -0.44254517555236816, -0.00595927378...
2 | (13us) -> this.nakResponse(m,VPL_FRAMELENGTH) //LoadBitmapLibraryBlock 2 | (21us) -> this.nakResponse(m, VPL_FRAMELENGTH) //ListFonts
[ -0.35575586557388306, -0.27570807933807373, 0.36849868297576904, -0.2691839933395386, -0.14166755974292755, 0.09662405401468277, 0.43638110160827637, -0.40307995676994324, -0.6743438243865967, -0.5689759850502014, -0.4480755627155304, 0.1790805160999298, -0.4539853036403656, -0.12800332903...
0 | (22us) -> this.nakResponse(m, VPL_FRAMELENGTH) //LoadFont 4 | (23us) -> this.nakResponse(m, VPL_FRAMELENGTH)
[ -0.43426015973091125, -0.2537290155887604, 0.34023651480674744, -0.1617608666419983, -0.028802108019590378, 0.2816133201122284, 0.3137587010860443, -0.1975913941860199, -0.5192527174949646, -0.43947330117225647, -0.30670419335365295, 0.21433605253696442, -0.38093501329421997, 0.11353855580...
//RemoveFont 3 | (24us) -> this.nakResponse(m, VPL_FRAMELENGTH) //SetDefaultFont 3
[ -0.3236526846885681, -0.07653869688510895, 0.537373423576355, -0.31171804666519165, -0.17003652453422546, 0.028528081253170967, 0.4858335852622986, -0.4232543408870697, -0.41940802335739136, -0.4379304051399231, -0.3472351133823395, 0.12554296851158142, -0.6443502902984619, 0.0253425538539...
| (31us) -> this.nakResponse(m, VPL_FRAMELENGTH) //ListParameterSets 0 | (32us) -> this.nakResponse(m, VPL_FRAMELENGTH) //LoadParameterSets 4
[ -0.5590066909790039, -0.3375042676925659, 0.4514872431755066, -0.014460801146924496, -0.2798793613910675, 0.3180902898311615, 0.34287968277931213, -0.5000046491622925, -0.6451195478439331, -0.5745267271995544, -0.24204500019550323, 0.28609499335289, -0.5867403149604797, -0.1360150426626205...