text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Basically I have two 2D points and there is a line between them. A cube is placed on the midpoint of this line. I want the cube to rotate so it is facing upwards from the line as the diagram below indicates. ![Illustrative diagram showing cubes on lines](https://i.stack.imgur.com/HBeyS.png) I've been thinking through...
[ 0.1317453682422638, 0.14718233048915863, 0.5890069007873535, -0.20724035799503326, -0.30031850934028625, 0.22774754464626312, -0.08767061680555344, -0.3962423503398895, -0.4059525430202484, -0.6268744468688965, 0.13854192197322845, 0.28125622868537903, -0.10576727241277695, 0.3113915026187...
We have a set of [cross-platform CMake build scripts](https://code.asterisk.org/code/browse/astscf-cmake-release/AsteriskSCF.cmake?r=HEAD), and we support building with [Visual C++](http://msdn.microsoft.com/en-us/vstudio/aa718325) and [GCC](http://gcc.gnu.org/). We're trying out [Clang](http://clang.llvm.org/), but I...
[ 0.40737417340278625, 0.5538104176521301, 0.15445773303508759, -0.10685912519693375, -0.1622888147830963, -0.08496027439832687, 0.08631180971860886, -0.4981423616409302, -0.1397334337234497, -0.5649800896644592, -0.0571710579097271, 0.5005397200584412, -0.27836325764656067, -0.1611589938402...
Intel C++ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # using Visual Studio C++ endif() ``` These also work correctly if a compiler wrapper like [ccache](http://ccache.samba.org/) is used. As of CMake 3.0.0 the `CMAKE_<LANG>_COMPILER_ID` value for Apple-provided Clang is now `AppleClang`. To test for both the A...
[ -0.33213934302330017, 0.2539927363395691, 0.30254799127578735, -0.38090425729751587, -0.13491623103618622, -0.022896893322467804, 0.12306688725948334, -0.2590937614440918, -0.24984408915042877, -0.360906183719635, -0.39158570766448975, 0.4045838713645935, -0.2497057020664215, -0.2455444782...
# using clang with clang-cl front end elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") # using clang with regular front end endif() endif() ```
[ -0.09795860946178436, 0.2289607673883438, 0.5529996752738953, -0.21293076872825623, -0.373023122549057, -0.3872430920600891, 0.26409706473350525, -0.3354319632053375, -0.37672507762908936, -0.09243069589138031, -0.3990075886249542, 0.37799426913261414, -0.48627975583076477, -0.213545039296...
I want to get a list of the following metadata information for a table in SQL Server using PowerShell: Column Name, Is nullable column, Is primary key, Is foreign key, Data type and Is Unique (or belongs to part of the unique key) Currently I'm using the following without getting the information of the unique key: `...
[ -0.06919407844543457, 0.40775203704833984, 0.32741203904151917, 0.2539517283439636, 0.3113059401512146, 0.22797280550003052, -0.024709073826670647, 0.028510428965091705, -0.049707185477018356, -0.5779603719711304, 0.19141671061515808, 0.34486231207847595, -0.24740833044052124, 0.4038608372...
: True ``` Any ideas There is an IsUnique property however, it is a property of an index and indexes are properties of tables. So if you want to use the SqlProvider, here's a way you can grab the columns which are part of a unique index and then add property to your column output: ``` PS SQLSERVER:\SQL\MyComputer\DE...
[ 0.05216508358716965, 0.18330766260623932, 0.5691332221031189, 0.13317500054836273, 0.08266082406044006, 0.11528467386960983, -0.010260272771120071, -0.14849869906902313, -0.2761746644973755, -0.7905032634735107, -0.2799794673919678, 0.3186483085155487, -0.28344640135765076, 0.2912884652614...
I would like to make my active tab unclickable, but i don't know how to modify this code below: ``` function initTabs(){ jQuery('ul.tabset').each(function(){ var _list=jQuery(this); var _links=_list.find('a.tab'); _links.eq(0).addClass('active'); _links.each(function(){ var _link=jQuery(this);...
[ -0.2625981569290161, -0.06993558257818222, 0.9607003927230835, -0.303234338760376, -0.043276745826005936, 0.12543122470378876, 0.45179176330566406, -0.16777940094470978, -0.19362610578536987, -0.7835030555725098, -0.34111112356185913, 0.6841667890548706, -0.5472075939178467, 0.243315383791...
_links.filter('.active').each(function(){ jQuery(jQuery(this).removeClass('active').attr('href')).animate({"opacity":0},000,function(){ jQuery(this).css({"display":"none"});_link.addClass('active'); _tab.css({"display":"block"}).animate({"opacity":1})}) ...
[ -0.3730117976665497, -0.26480603218078613, 0.4793294668197632, -0.16810625791549683, -0.24835394322872162, 0.29306989908218384, 0.34677988290786743, -0.11450053006410599, -0.2535502314567566, -0.9817054271697998, -0.32003772258758545, 0.27403005957603455, -0.47304362058639526, -0.010130574...
your help. ***EDITTED with answer:*** I know the answer now from [Make a link unclickable once it has been clicked - jquery](https://stackoverflow.com/questions/1924026/make-a-link-unclickable-once-it-has-been-clicked-jquery) I made changes to the code above, and now it works! ``` function initTabs(){ jQuery('ul.ta...
[ -0.4342969059944153, -0.08278407901525497, 1.0087358951568604, -0.0224625114351511, 0.004887814167886972, 0.06477402150630951, 0.5786716341972351, -0.13578179478645325, -0.18657062947750092, -0.7537980079650879, -0.43359482288360596, 0.8567949533462524, -0.5166432857513428, -0.030873550102...
_link.click(function(){ if($(this).hasClass('active')){ return false; } else { _links.filter('.active').each(function(){ jQuery(jQuery(this).removeClass('active').attr('href')).animate({"opacity":0},000,function(){
[ 0.0052216146141290665, -0.454459547996521, 0.5824307799339294, -0.08921308815479279, 0.15861496329307556, 0.23904693126678467, 0.36775267124176025, -0.2712598443031311, -0.18378272652626038, -0.8186157941818237, 0.007256484590470791, 0.4511236846446991, -0.5449369549751282, 0.2478661239147...
jQuery(this).css({"display":"none"});_link.addClass('active'); _tab.css({"display":"block"}).animate({"opacity":1})}) }); } return false }) }) }) ``` } Give each button a unique tag value. in the IBAction, sender.tag tells you which butto...
[ -0.36194729804992676, -0.5742274522781372, 0.5414143204689026, -0.18817166984081268, 0.08173298835754395, 0.06533501297235489, 0.16073393821716309, -0.2213626652956009, -0.13813269138336182, -0.6410650014877319, -0.1807280331850052, 0.42928311228752136, -0.49347788095474243, 0.053652465343...
I'm trying to execute a query with the [Tornado's database wrapper](https://github.com/facebook/tornado/blob/master/tornado/database.py), like this - ``` p_id = db.execute_lastrowid("""INSERT INTO `gplaces`.`place` (`gid`, `name`, `reference`, `lat`, `long`, `vicinity`) ...
[ 0.4290356934070587, 0.21393026411533356, 0.43917202949523926, -0.16755938529968262, 0.06600366532802582, 0.10538312047719955, 0.1869657337665558, -0.10549630224704742, 0.019537752494215965, -0.6340191960334778, 0.06960075348615646, 0.09110192954540253, -0.26989656686782837, 0.1745906770229...
%s, %s, %s)""", ( str(place['id']),
[ 0.3684758245944977, 0.061632171273231506, 0.8033758401870728, -0.04193145036697388, 0.08025055378675461, 0.2999357283115387, 0.3400020897388458, -0.13050536811351776, 0.1713840365409851, -0.2725842595100403, -0.7887688875198364, -0.108888179063797, 0.1483745127916336, 0.3407312333583832, ...
str(place['name']), str(place['reference']), float(place['geometry']['location']['lat']),
[ 0.2055864930152893, 0.058541059494018555, 0.7034730911254883, 0.25884029269218445, -0.34538552165031433, 0.503777801990509, -0.27807852625846863, -0.20661009848117828, -0.024629034101963043, -0.23404765129089355, -0.6763858795166016, -0.18327461183071136, 0.1531580686569214, 0.330072700977...
float(place['geometry']['location']['lng']), str(place['vicinity'])
[ 0.3511253595352173, -0.16748079657554626, 1.0158379077911377, 0.40235400199890137, -0.353863000869751, 0.2803415358066559, -0.40043437480926514, -0.3235282599925995, -0.21531260013580322, -0.2347271889448166, -0.342838317155838, -0.049799688160419464, 0.15713365375995636, 0.115450650453567...
) ) ``` But always getting the error in the title. Here is the traceback - ``` Traceback (most recent call last): File "insertbs.py", line 38, in <module> str(place['vicinity']) File "/home/bibhas/Works/yodl/database.py", line 145, in execute_lastrowid self._execute(curso...
[ -0.2783203423023224, 0.2864038348197937, 0.5720734596252441, -0.20655296742916107, 0.350132554769516, 0.12202780693769455, 0.20047348737716675, -0.26064014434814453, -0.17146356403827667, -0.31480416655540466, -0.46647942066192627, 0.3288652300834656, -0.3224790096282959, 0.178255707025527...
cursor.execute(query, parameters) File "/usr/lib/pymodules/python2.7/MySQLdb/cursors.py", line 159, in execute query = query % db.literal(args) TypeError: not enough arguments for format string ``` Not sure what I'm doing wrong. Don't pass a tuple of values, pass them as separate arguments. From the traceback:...
[ -0.3372531533241272, 0.34192875027656555, 0.472101092338562, -0.25718042254447937, -0.2385311722755432, 0.14951762557029724, 0.253237783908844, -0.09630612283945084, -0.21499432623386383, -0.2664945721626282, -0.01045278087258339, 0.43859657645225525, -0.5890873670578003, 0.240260124206542...
Data structure is like following, and I would like to change "lane-7" to "lane-5". I am thinking of a command like this, but it does not work. ``` find PATH -name "lane-7*" | xargs -i echo mv {} `echo {}|sed 's/lane-7/lane-5/'` | sh ``` Anyidea? Thanks ``` PATH/28/lane-7-22.fq PATH/28/lane-7-21.fq PATH/28/lane...
[ -0.249331533908844, 0.032963383942842484, 0.8069238662719727, 0.03263704478740692, -0.008227072656154633, -0.07441398501396179, 0.3301805555820465, -0.09727609157562256, -0.22305645048618317, -0.8147487044334412, -0.39371979236602783, 0.4959527850151062, -0.21772408485412598, 0.23754155635...
// By convention all exposed hub methods start with lowercase connection.getStuff(); }); ``` Hub Quickstart: <https://github.com/SignalR/SignalR/wiki/QuickStart-Hubs> In-depth look at SignalR javascript client: <https://github.com/SignalR/SignalR/wiki/SignalR-JS-Client-Hubs>
[ -0.473643958568573, 0.07341436296701431, 0.38168811798095703, -0.2771640717983246, -0.23268365859985352, 0.22545664012432098, 0.22625276446342468, 0.18957963585853577, -0.32430967688560486, -0.7671055197715759, -0.4215089678764343, 0.4821797013282776, -0.25932756066322327, 0.04953752830624...
I'm building a report for a database where I need to determine the number of "first scans" grouping by company, job, and date. The scan table can contain multiple scans for the same item, however I only want to include the original scan in my COUNT, which can only be identified as being the scan with the earliest date...
[ 0.34168359637260437, -0.10669106990098953, 0.5765274167060852, -0.042032647877931595, 0.29938459396362305, 0.1644400656223297, -0.4756848216056824, -0.24582161009311676, -0.5775083899497986, -0.769713819026947, 0.01986745558679104, 0.03394690528512001, -0.25332963466644287, 0.2877998948097...
_scan INNER JOIN _item_detail ON _item_detail.company_id = _scan.company_id AND _item_detail.serial_number = _scan.serial_number INNER JOIN _item_group ON _item_group.group_id = _item_detail.group_id WHERE _item_detail.job_id = '0326FCM' AND _scan.company_id = '152345' AND _item_group.group_id = 13 GR...
[ 0.004633304663002491, 0.14764389395713806, 0.9389840364456177, -0.16446071863174438, 0.18384438753128052, 0.26514774560928345, 0.11110470443964005, -0.456554651260376, -0.4132947623729706, -0.86075758934021, 0.04582973197102547, 0.49159175157546997, -0.10913228988647461, 0.089536651968956,...
query to achieve the desired results? Something similar to this should work... I'm not completely sure of how your tables are laid out or how the data relates them together, but this is the general idea: ``` SELECT _item_detail.job_id, _item_group.group_id, _scan.company_id, DATE(scan_date_time) as...
[ 0.09350249916315079, 0.22256113588809967, 0.5736767649650574, 0.11446530371904373, 0.17152749001979828, 0.1623651385307312, -0.1098213866353035, -0.28576862812042236, -0.5557893514633179, -0.7019708752632141, -0.03981267660856247, 0.4446617066860199, -0.22297708690166473, 0.179243624210357...
AND _item_detail.job_id = '0326FCM' INNER JOIN _item_group ON _item_group.group_id = _item_detail.group_id AND _item_group.group_id = 13 WHERE s1.company_id = '152345' AND s1.scan_date_time = ( SELECT MIN(s2.scan_date_time) FROM _scan s2 WHERE s2.compan...
[ -0.1445472687482834, -0.0498773530125618, 0.545779287815094, 0.11094453930854797, 0.3569711744785309, 0.4404846131801605, 0.05875397473573685, -0.29793646931648254, -0.4226943850517273, -0.6609988212585449, -0.3542535901069641, 0.3384976089000702, 0.16487137973308563, 0.08640207350254059, ...
AND s2.serial_number = s1.serial_number ) GROUP BY _item_detail.job_id, _item_group.group_id, s1.company_id ```
[ 0.038326214998960495, 0.3941899538040161, 0.38216912746429443, -0.10018497705459595, 0.19499066472053528, 0.3328368365764618, -0.22037459909915924, -0.348092257976532, -0.4824059307575226, -0.327223002910614, -0.5186938643455505, 0.2372102588415146, -0.40540462732315063, 0.3039396107196808...
A sequence is created from sequence of natural numbers: ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ``` removing **every 2nd** number in the **2nd step**: ``` 1 3 5 7 9 11 13 15 17 19 21 23 ``` removing **every 3rd** number in the **3rd step** (from previous sequence): ``` 1 3 7 9 13 15 19 2...
[ 0.012067068368196487, 0.27183905243873596, 0.18807026743888855, -0.19490568339824677, 0.021677233278751373, 0.5828158855438232, 0.4322670102119446, -0.5508572459220886, -0.45375916361808777, -0.4281483292579651, -0.3753889799118042, -0.040609247982501984, -0.4100016951560974, 0.43673914670...
right solution for this is here: <http://oeis.org/A000960> My task is to find a 1000th member of the sequence. I have written an algorithm for this, but I think it's quite slow (when I try it with 10.000th member it takes about 13 seconds). What it does is: * I have `number` which increases by 2 in every step, since...
[ -0.10333167761564255, 0.21073263883590698, 0.44022688269615173, -0.03944883495569229, -0.1622823178768158, 0.3637743592262268, 0.26176902651786804, -0.46571215987205505, -0.5500885248184204, -0.7461659908294678, 0.09893327206373215, 0.0683130994439125, -0.1457858830690384, 0.45103991031646...
= new ArrayList<Long>(10000); long[] counters = new long[1002]; long number = -1; int active_counter = 3; boolean removed; counters[active_counter] = 1; int total_numbers = 1; while (total_numbers <= 1000) { number += 2; removed = false; for (int i = 3; i <= active_counter; i++) { if ((counters[i] ...
[ 0.17969296872615814, -0.4804331064224243, 0.5065349340438843, -0.3930692672729492, -0.11047989875078201, 0.40765663981437683, 0.5012521743774414, -0.8535038828849792, -0.21793855726718903, -0.2801755368709564, -0.35314103960990906, 0.39370712637901306, -0.3505038619041443, 0.02905033528804...
active_counter++; counters[active_counter] = i; } counters[i]++; break; } counters[i]++; } if (!removed) { list.add(number);
[ 0.042194027453660965, -0.4120262563228607, 0.4963121712207794, -0.37811893224716187, -0.18823635578155518, 0.11256145685911179, 0.25532224774360657, -0.40688836574554443, -0.3650771975517273, -0.27532312273979187, -0.506106436252594, 0.3692464530467987, -0.4933386743068695, 0.1233194917440...
total_numbers++; } } ``` Your link to OEIS gives us some methods for fast calculation (FORMULA etc) Implementation of the second one: ``` function Flavius(n: Integer): Integer; var m, i: Integer; begin m := n * n; for i := n - 1 downto 1 do m := (m - 1) - (m - 1) mod i; Result := m; end; ``` P.S. A...
[ -0.43645328283309937, -0.21936748921871185, 0.5216099619865417, -0.21196672320365906, -0.0032970882020890713, 0.5383910536766052, -0.046145256608724594, -0.31339672207832336, -0.5033907890319824, -0.27678197622299194, -0.2533195912837982, 0.4674087464809418, -0.1368284523487091, 0.02650772...
I use Justin Heyes-Jones implementation of the astar algorithm. My heuristic function is just Euclidean distance. In the drawing attached (sorry for bad quality) a specific situation is described: lets say we are going from the node 1 to the node 2. The shortest way would go through the nodes a - b - c - d - e. But the...
[ 0.020887836813926697, 0.15232521295547485, 0.3824082911014557, -0.0739368125796318, 0.0759890079498291, 0.16272126138210297, 0.4403187334537506, -0.09477858245372772, -0.1420077383518219, -0.918549656867981, 0.04751916229724884, 0.11683080345392227, 0.07398558408021927, 0.17675507068634033...
it return the shortest path?! [false shortest path finding by the astar](http://i.stack.imgur.com/QfL1C.jpg) The code for the real road map import: ``` #include "search.h" class ArcList; class MapNode { public: int x, y; // ���������� ���� MapNode(); MapNode(int X, int Y); float Get_h( const...
[ -0.5312814712524414, -0.07250753790140152, 0.7128839492797852, -0.13126514852046967, -0.005534901283681393, 0.2000664323568344, 0.18604300916194916, -0.1271362453699112, 0.01629735343158245, -0.7461511492729187, -0.4402492940425873, 0.5296041369438171, -0.3013310432434082, 0.13666385412216...
list ); private: ArcList * list; }; class Arc { public: MapNode A1; MapNode B1; Arc(const MapNode & a, const MapNode & b); }; class ArcList { public: void setArcs( const std::vector<Arc> & arcs ); void addArc( const Arc & arc ); size_t size() const; bool addNeighbours( AStarSearch<...
[ -0.3573561906814575, -0.38205382227897644, 0.5773482918739319, -0.3280751705169678, -0.056909698992967606, 0.3828926682472229, 0.16116072237491608, -0.43143388628959656, -0.3712432086467743, -0.6300307512283325, -0.6862433552742004, 0.43300193548202515, -0.6123088598251343, -0.218039840459...
unsigned int SearchState; unsigned int SearchSteps = 0; do { if ( SearchSteps % 100 == 0) std::cout << "making step " << SearchSteps << endl; SearchState = astarsearch.SearchStep(); SearchSteps++; } while ( SearchState == AStarSearch<MapNode>::SEARCH_STATE_SEAR...
[ -0.5200724601745605, -0.3394215703010559, 0.7712188363075256, -0.38587066531181335, 0.09858231991529465, 0.24826166033744812, 0.3213849663734436, -0.41466188430786133, -0.30030661821365356, -0.5079852938652039, -0.5842627286911011, 0.4618598222732544, -0.41015684604644775, -0.1116181686520...
{ int steps = 0; for ( MapNode * node = astarsearch.GetSolutionStart(); node != 0; node = astarsearch.GetSolutionNext() ) { S.push_back(*node); // node->PrintNodeInfo(); } astarsearch.FreeSolutionNodes(); } else if ( SearchState == AStarSearch<Map...
[ -0.4318641722202301, -0.581959068775177, 0.8430548310279846, -0.12637260556221008, 0.23787756264209747, 0.016637613996863365, 0.5626540184020996, -0.5169450044631958, -0.3337230086326599, -0.644345760345459, -0.7380931973457336, 0.33819782733917236, -0.21562154591083527, -0.106888599693775...
throw " SEARCH_FAILED "; } return S; } ``` Function FindPath gives me the vector of the result nodes. Here is addNeighbours method: ``` bool ArcList::addNeighbours( AStarSearch<MapNode> * astarsearch, const MapNode & target ) { assert(astarsearch != 0); bool found = false; for (size_t i = 0; i <...
[ -0.13545669615268707, -0.22687707841396332, 0.41985848546028137, -0.3564525246620178, -0.14229123294353485, 0.2781113386154175, 0.34508538246154785, -0.6442855596542358, -0.08510939031839371, -0.5311426520347595, -0.05352356284856796, 0.652016282081604, -0.30368557572364807, -0.15789058804...
{ found = true; astarsearch->AddSuccessor( arc.B1 ); } else if (arc.B1 == target ) { found = true; astarsearch->AddSuccessor( arc.A1 ); } }
[ 0.05321362614631653, -0.04523146152496338, -0.042969755828380585, -0.12042026966810226, 0.1885535717010498, 0.2699921131134033, 0.13374528288841248, 0.01692562736570835, -0.09719131886959076, -0.43287768959999084, -0.25312119722366333, 0.5633399486541748, -0.20908640325069427, -0.324981063...
return found; } ``` and get\_h method: ``` float MapNode::Get_h( const MapNode & Goal_node ) { float dx = x - Goal_node.x; float dy = y - Goal_node.y; return ( dx * dx + dy * dy ); } ``` I know that its not exact distance (no taking of square root here) - this is done to save some machine resources wh...
[ -0.34376683831214905, -0.0076709627173841, 0.36135098338127136, -0.05877775326371193, 0.22330066561698914, -0.28488537669181824, 0.19469508528709412, -0.19431215524673462, 0.051784805953502655, -0.7759386301040649, -0.20415747165679932, 0.353776216506958, -0.0604403093457222, 0.16855342686...
heuristic is not consistent and you use a graph search, (you keep a list of visited states and if you have already encountered a state, you do not expand it again), your search doesn't give the correct answer. However, when you use A\* tree search with an admissible heuristic, you should get the correct answer. The di...
[ -0.09443855285644531, 0.1551310271024704, 0.20908719301223755, 0.31985899806022644, 0.06028466299176216, -0.22343339025974274, 0.5609418153762817, -0.2606719434261322, -0.2617095708847046, -0.5433298349380493, -0.38355889916419983, 0.24069815874099731, -0.3770374655723572, 0.36755600571632...
and finds out that the b, c, d path is in fact shorter. Hence my advice is, either to use the tree search instead of the graph search, or choose a consistent heuristic. For definition of consistent, see for example: [Wikipedia: A\* Search Algorithm](http://en.wikipedia.org/wiki/A%2a_search_algorithm) EDIT: While the...
[ 0.2607816755771637, -0.022902917116880417, 0.2992011606693268, 0.12932300567626953, -0.15032625198364258, -0.13101157546043396, 0.46272698044776917, -0.3553955554962158, -0.2423916757106781, -0.3776368200778961, -0.06813870370388031, 0.5127448439598083, -0.3324391543865204, -0.050884913653...
it is always better to first implement your algorithms as naively as possible. It usually helps to keep them more readable and they are less prone to bugs. If there are bugs, they are easier to spot. Hence, my final advice would be don't optimise unless you need it, or unless everything else is working well. Otherwise ...
[ 0.22524100542068481, -0.14017941057682037, -0.3622024357318878, 0.3072245121002197, 0.48702922463417053, 0.09390991181135178, 0.487754762172699, 0.14107294380664825, -0.04604964703321457, -0.8197788000106812, -0.045740388333797455, 0.7146260738372803, -0.12408425658941269, -0.5307355523109...
I want to use matplotlib to illustrate the definite integral between two regions: x\_0, and x\_1. How can I shade a region under a curve in matplotlib from x=-1, to x=1 given the following plot ``` import numpy as np from matplotlib import pyplot as plt def f(t): return t * t t = np.arange(-4,4,1/40.) plt.plot(...
[ -0.3142966330051422, -0.46862900257110596, 0.6961302757263184, 0.09888486564159393, 0.09189534932374954, 0.3800126016139984, -0.2506245970726013, -0.038525816053152084, -0.17067916691303253, -0.8451236486434937, -0.28781750798225403, 0.22961238026618958, 0.09837310761213303, -0.07611409574...
I've been toying around with Map Reduce with CouchDB. Some of the examples show some possibly heavy logic within the map reduce functions. In one particular case, they were performing for loops within map. Is map reduce run on every single possible document before it emits your selected documents? If so, I would thin...
[ 0.18064410984516144, 0.07266256958246231, 0.14636807143688202, 0.10059992969036102, -0.09021895378828049, -0.11905591934919357, 0.11190687119960785, -0.42759451270103455, -0.11885307729244232, -0.6321788430213928, 0.30567410588264465, 0.6072480082511902, -0.29510146379470825, -0.0897328406...
expensive processing is acceptable in CouchDB map-reduce. CouchDB views (map-reduce) are more like `CREATE INDEX` than they are `SELECT FROM`. Specifically, CouchDB guarantees that a map function runs *only* once per document, ever. (Well, actually once per document *change* ever.) That is what the "iterative map-red...
[ -0.10914964973926544, -0.21923145651817322, 0.9144383072853088, 0.014723456464707851, -0.05258442834019661, -0.007842911407351494, 0.14321018755435944, -0.48662811517715454, -0.09380753338336945, -1.1594383716583252, -0.01686335913836956, 0.7947514057159424, 0.14237208664417267, -0.0449516...
documents directly. Lookup time is O(log n) for the document count. In other words, even if it takes 1 second per document to execute the map, it will take a few milliseconds to fetch the result. (Of course, the view must build first, since it is actually an index.)
[ -0.13209259510040283, 0.16202306747436523, 0.6170284152030945, 0.28807324171066284, 0.20783013105392456, 0.07353915274143219, 0.035307876765728, -0.23245534300804138, -0.1367681473493576, -0.809359073638916, -0.45674827694892883, 0.35427820682525635, 0.15553319454193115, 0.0559455640614032...
I am writing a PHP command line script, and I'm wondering if any grep experts can help me to come up with a command to do the following: For all files ending in .java in the current directory ($curDir), search within the file for any instance of $str, and return an indicator whether any instance has been found or not....
[ 0.1489584743976593, 0.3056066036224365, 0.378543496131897, -0.14733129739761353, -0.21779346466064453, 0.1003754734992981, 0.21339212357997894, 0.2100769579410553, -0.1500556766986847, -0.7760362029075623, -0.0704544261097908, 0.3335479497909546, -0.36941346526145935, 0.04488373175263405, ...
you want it to just output the file names. Other grep options can be found here: <http://unixhelp.ed.ac.uk/CGI/man-cgi?grep> Depending on what `$str` is you may need to pass it through: `escapeshellarg()`: <http://www.php.net/manual/en/function.escapeshellarg.php>
[ 0.08744696527719498, -0.17439302802085876, 0.32300078868865967, 0.09811108559370041, 0.20315080881118774, -0.2323996126651764, 0.3741115629673004, -0.11678770929574966, -0.4376642405986786, -0.2538990080356598, -0.48515820503234863, 0.3475550413131714, -0.44235652685165405, 0.0227708779275...
I'm having some trouble with the query below. I am trying to determine if the "category" field is A, B or C and then creating a field based on the category. That field would sum up payments field. But I'm running into error saying "incorrect syntax near keyword As". I am creating this in a SQL View. Using SQL Server 20...
[ -0.24588637053966522, 0.06301270425319672, 0.4208679795265198, -0.18499627709388733, -0.39702898263931274, 0.10388413071632385, -0.2661764919757843, -0.6493694186210632, -0.35686829686164856, -0.17798590660095215, -0.24877358973026276, 0.6115431785583496, -0.3473967909812927, 0.39063328504...
should be executed because the data that I have has A,B and C Sample Data- r\_invoiceTable ``` Id --- Category ---- Payment 222 A ---- 50 444 A ---- 30 111 B ---- 90 777 C ---- 20 555 C ---- 40 ``` Desired Output A\_payments = 80, B\_payments = 90,
[ 0.19717229902744293, 0.1567017138004303, 0.4589667022228241, -0.06699363887310028, 0.20956668257713318, 0.4058550000190735, 0.22738738358020782, -0.6447033286094666, -0.043940555304288864, -0.4426281154155731, -0.2553275525569916, 0.647306501865387, -0.058075763285160065, -0.10761450231075...
C\_payments = 60 Perhaps you are looking for this: ``` SELECT SUM(CASE WHEN category = 'A' THEN payment END) AS A_payments, SUM(CASE WHEN category = 'B' THEN payment END) AS B_payments, SUM(CASE WHEN category = 'C' THEN payment END) AS C_payments FROM r_invoiceTable ```
[ 0.15738093852996826, 0.07029595226049423, 0.6143821477890015, -0.23904666304588318, 0.13751281797885895, 0.37010911107063293, -0.48262059688568115, -0.34848645329475403, -0.3484894931316376, -0.23318156599998474, -0.363225519657135, 0.6193586587905884, -0.2157379686832428, 0.40225407481193...
When I submit a form that has method="POST" the view that handles it is getting method GET, and I can't seem to get it to be a POST, which is necessary for file uploads. Short of just canning my existing (was working a week ago, before upgrade to 1.4) and trying to use the form upload the sample from <https://docs.djan...
[ 0.4176570773124695, 0.2745983302593231, 0.44924604892730713, -0.26842308044433594, -0.384856253862381, -0.1472606360912323, 0.054027918726205826, -0.3457680642604828, -0.034818537533283234, -0.6216299533843994, 0.18247610330581665, 0.3339293897151947, -0.38825175166130066, 0.17794549465179...
the email. However, when I change to POST/post, it remains method GET and the fields are not in the request.POST or the request.GET dictionaries. Is there a bug in Django 1.4 that is causing this behavior? Is there something I'm missing? I tried to make a simple example to rule out all extraneous potential variables. ...
[ 0.33934900164604187, 0.07338149845600128, 0.4180684983730316, 0.03812891244888306, -0.3774538040161133, -0.1411074846982956, 0.08619470149278641, -0.14854539930820465, -0.22821447253227234, -0.4557056725025177, -0.24439655244350433, 0.44373488426208496, -0.3549700379371643, -0.222074136137...
body, '<from_email>', ['<to_email>'], fail_silently=False) def UploadTest(request): Notify("UploadTest", "METHOD: " + str(request.method) + """ """ + str(request)) return render_to_response('upload.htm', context_instance=RequestContext(request)) def UploadedTest(request): Notify("UploadedTest", "METH...
[ 0.2365497350692749, -0.0012539152521640062, 0.7096296548843384, 0.07398378103971481, -0.3287825286388397, 0.27880191802978516, 0.2676721513271332, -0.8847299814224243, -0.006970098242163658, -0.7492983937263489, -0.17525707185268402, 0.7223508954048157, 0.11909510940313339, -0.330050826072...
<input type="text" name="extra_field" value="extra post field" /> <input type="file" name="upload_file" id="upload_file" /> <input type="submit" name="upload" value="Submit" /> </form> ``` ***Results of simple test scenario*** The emails I get (note the first is the form pre-submit, the second is the posted ...
[ 0.12020374834537506, 0.04219413921236992, 0.3483261168003082, 0.19636420905590057, -0.15081284940242767, 0.23071682453155518, 0.4415658116340637, -0.5619325637817383, 0.18651068210601807, -0.7501166462898254, -0.43459007143974304, 0.39738738536834717, -0.030272172763943672, -0.068584300577...
'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTPS': '1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': '... csrftoken=...; CFID=16005; CFTOK...
[ -0.5053649544715881, 0.138340026140213, 0.6930332779884338, 0.013174996711313725, -0.15892498195171356, 0.37744924426078796, 0.3775801360607147, -0.06218210607767105, -0.23349754512310028, -1.045027256011963, -0.2978925108909607, 0.3353008031845093, -0.4657577872276306, 0.22842445969581604...
'SERVER_ADDR': '10.1.10.12', 'SERVER_ADMIN': '...', 'SERVER_NAME': '...', 'SERVER_PORT': '443', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SIGNATURE': '', 'SERVER_SOFTWARE': 'Apache', 'SSL_TLS_SNI': '...', 'mod_wsgi.application_group': '...|', 'mod_wsgi.callable_object': 'application', ...
[ -0.4831455647945404, 0.15855346620082855, 0.8294171094894409, -0.31757262349128723, -0.16472698748111725, 0.2368798404932022, 0.2746581733226776, -0.03827279433608055, -0.3715576231479645, -0.6406397819519043, -0.4478086829185486, 0.30511343479156494, -0.43176746368408203, 0.12659512460231...
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0xb73d2770>, 'wsgi.input': <mod_wsgi.Input object at 0x1962020>, 'wsgi.multiprocess': True, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'https', 'wsgi.version': (1, 1)}> ``` SECOND EMAIL (...
[ -0.26851123571395874, 0.047837309539318085, 0.701483428478241, 0.015492478385567665, -0.2596103250980377, 0.09330090880393982, 0.5375599265098572, -0.37660735845565796, -0.46244126558303833, -0.7290355563163757, -0.5107444524765015, 0.44390496611595154, -0.2076970636844635, -0.000094111150...
}, META:{'CSRF_COOKIE': '...', 'DOCUMENT_ROOT': '...', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTPS': '1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CONNECTION': 'ke...
[ -0.2084575891494751, 0.06764274090528488, 0.5886304378509521, 0.06344211846590042, 0.15333661437034607, 0.3736083209514618, 0.3232971131801605, -0.24499958753585815, 0.019047744572162628, -0.8177155256271362, -0.3932307958602905, 0.7696395516395569, -0.5378363728523254, 0.3048439621925354,...
'GET', 'REQUEST_URI': '/uploaded_test/', 'SCRIPT_FILENAME': '...site.wsgi', 'SCRIPT_NAME': u'', 'SERVER_ADDR': '10.1.10.12', 'SERVER_ADMIN': '...', 'SERVER_NAME': '...', 'SERVER_PORT': '443', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SIGNATURE': '', 'SERVER_SOFTWARE': 'Apache', ...
[ -0.2968614399433136, -0.08040976524353027, 0.8947442173957825, -0.07003907859325409, -0.008569617755711079, 0.4446159899234772, 0.35152357816696167, -0.006485884543508291, -0.06911513209342957, -0.6878575682640076, -0.6737754344940186, 0.47208303213119507, -0.3070118725299835, 0.1660236567...
'1', 'mod_wsgi.version': (3, 3), 'wsgi.errors': <mod_wsgi.Log object at 0x1956b88>, 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x21cf0f8>, 'wsgi.input': <mod_wsgi.Input object at 0x1961048>, 'wsgi.multiprocess': True, 'wsgi.multithread': True, 'wsgi.run_...
[ -0.3096540868282318, 0.06581481546163559, 0.5758641362190247, -0.12985588610172272, -0.052369892597198486, 0.09465011954307556, 0.5249480605125427, -0.48816218972206116, -0.45351430773735046, -0.7812909483909607, -0.4805816113948822, 0.5365686416625977, -0.509268581867218, -0.1881438195705...
sys.path.append(path) path = '/var/www' if path not in sys.path: sys.path.append(path) path = '/var/www/site' if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'site.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() ``` Apach...
[ -0.013800228014588356, -0.03085482120513916, 0.6059195399284363, -0.2237718403339386, 0.0970660001039505, -0.018844464793801308, 0.6723397970199585, -0.6716188192367554, -0.02210773155093193, -0.7018358707427979, -0.2330436408519745, 0.703949511051178, -0.18852019309997559, -0.032208934426...
/var/log/apache2/site-access.log combined WSGIScriptAlias / /var/www/site/site.wsgi SSLEngine on SSLCertificateFile ... SSLCertificateKeyFile ... # Media serving, must specify which files to serve and not # hand their urls to the django framework. Alias /robots.txt .../robots.txt Alias ...
[ 0.05680163949728012, 0.38397935032844543, 0.5551785230636597, -0.2378242462873459, -0.39574941992759705, -0.2348071187734604, 0.42631179094314575, -0.46364882588386536, -0.2507709562778473, -0.00863975752145052, -0.258741170167923, 0.4718761444091797, -0.467180460691452, 0.4196127951145172...
Allow from all </Directory> <Directory .../django_static/> Order deny,allow Allow from all </Directory> <Directory /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/js> Order allow,deny Allow from all </Directory> <Directory .../...
[ -0.014508768916130066, 0.4385938346385956, 0.2821568548679352, -0.04727386683225632, -0.3416547477245331, -0.2209763526916504, 0.6423282623291016, -0.4379956126213074, -0.04779829457402229, -0.07118218392133713, -0.37392309308052063, 0.30655229091644287, -0.4613379240036011, 0.158193022012...
Order allow,deny Allow from all </Directory> XSendFile on ``` Perhaps I need to read more about the urls.py or regular expression. I accidentally changed the form to post to `action="uploaded_test"` without the opening slash, and received a 404 error report which has the request.method as "POST," ...
[ 0.535004734992981, 0.10558244585990906, 0.4588186740875244, -0.0692974328994751, -0.21353097259998322, 0.2652580440044403, 0.6138595938682556, -0.32588472962379456, -0.15696410834789276, -0.34573760628700256, -0.16899818181991577, 0.2886489927768707, -0.38763198256492615, 0.108523890376091...
the form to post to `action="/uploaded_test/"` and it also worked! I had the /+ in most of my urls entries so that I could accept either /loc or /loc/ for many entries. I think I will change them back, now. I don't know if this is a bug or something I don't understand about the regular expression `/+` syntax.
[ 0.4678243398666382, 0.12536028027534485, 0.25058573484420776, 0.017456768080592155, -0.2018769383430481, 0.07453462481498718, 0.32626137137413025, 0.3794768154621124, -0.15753407776355743, -0.486886203289032, 0.1285257637500763, 0.2611483931541443, 0.04932611435651779, 0.11082043498754501,...
I'm trying to use the jQuery `.attr()` property to get the height of an iframe *or* an img with an explicitly defined height. **jQuery** ``` var scrollerHeight = $('.caroufredsel_wrapper > ul > li').find('img','iframe').attr('height'); ``` **HTML** ``` <div class="caroufredsel_wrapper"> <ul> <li><iframe src="m...
[ 0.04997573792934418, 0.2241848111152649, 0.8946524262428284, -0.21934038400650024, -0.08628534525632858, 0.14405879378318787, -0.10874034464359283, -0.3062373399734497, -0.1538379192352295, -0.6821257472038269, -0.024947183206677437, 0.5419771671295166, -0.07273616641759872, 0.056015271693...
In my current Eclipse config, src folder is not displayed the same way everywhere! As you can see on screenshot below, com.WazaBe.BePlanes is shown as a package and tof.cv.mpp is shown as folder... I really would like to understand where it went wrong and fix that. Thank a lot for any help! ![enter image descriptio...
[ 0.4202781915664673, 0.1310453861951828, 0.45311713218688965, -0.1385006308555603, -0.1825151890516281, -0.3778573274612427, -0.00565507635474205, -0.09914277493953705, -0.29333749413490295, -0.8504895567893982, -0.1426520198583603, 0.8501889705657959, -0.3111463487148285, -0.03567143902182...
I am a beginner in objective C , I want to parse a XML file from URL , I found some sample code about NSXMLPARSER and I write this code but it do not work. please help me. my xml file is : ``` <list> <first>apple</first> </list> ``` ... My ViewController.h ``` #import <UIKit/UIKit.h> @interface ViewController : ...
[ -0.1467607319355011, 0.37922999262809753, 0.5848419070243835, -0.1596536785364151, -0.25736236572265625, -0.0316120944917202, 0.4800472557544708, -0.7763921022415161, 0.1157558485865593, -0.6998844146728516, -0.3745836615562439, 0.2648126780986786, -0.2534334659576416, 0.04736482352018356,...
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary*)attributeDict { if ([elementName isEqualToString:@"list"]) { // clear out our story item caches... myTextField.text = [attributeDict objectForKey:@"first"]; } } - (void)viewDidLoad...
[ 0.32669082283973694, -0.13789229094982147, 0.3541138172149658, 0.13897037506103516, -0.000822116038762033, -0.04069054499268532, 0.449194073677063, -0.2722797095775604, -0.11901593208312988, -0.5224375128746033, -0.26189926266670227, 0.8141310811042786, -0.00501648336648941, 0.092149324715...
[self setMyTextField:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } @end ``` Here is an example u...
[ -0.0011377434711903334, -0.2161634862422943, 0.5786123275756836, -0.37276750802993774, -0.31180018186569214, 0.05548528954386711, 0.4053843915462494, -0.40837863087654114, -0.08224497735500336, -0.5996436476707458, -0.1399935930967331, 0.891838788986206, -0.22668646275997162, -0.0027216703...
title = "title " + x.ToString(), data = Enumerable.Range(3,2).Select(i=> new {column1=i,column2=i*i}) }) , Newtonsoft.Json.Formatting.Indented ); ``` Output: ``` [ {
[ -0.318086713552475, -0.1458389312028885, 0.8123503923416138, -0.0032866375986486673, 0.42334190011024475, 0.09889931231737137, 0.04060967266559601, -0.3061467111110687, -0.15572167932987213, -0.16332487761974335, -0.4814649820327759, 0.7253486514091492, -0.30625608563423157, 0.406037658452...
"id": "1", "title": "title 1", "data": [ { "column1": 3, "column2": 9 }, { "column1": 4, "column2": 16 } ] }, { "id": "2", "title": "title 2", "data": [
[ -0.17066121101379395, 0.25328072905540466, 0.4091780185699463, 0.3716856837272644, 0.26920557022094727, 0.22519850730895996, -0.19976040720939636, -0.2855648696422577, 0.009532070718705654, -0.4859171509742737, -0.42942893505096436, 0.3753673732280731, -0.013599298894405365, 0.182689413428...
{ "column1": 3, "column2": 9 }, { "column1": 4, "column2": 16 } ] } ] ```
[ -0.3177486062049866, 0.45673659443855286, 0.4099085032939911, -0.26745185256004333, 0.16318124532699585, 0.4135681986808777, 0.04067279398441315, -0.09109602868556976, -0.2836378514766693, -0.4759600758552551, -0.34354081749916077, 0.4003050625324249, -0.4827110469341278, 0.060637023299932...
Essentially, I am just creating two classes where one class, in this case class A, runs a function in another class, in this case class B, to grab some information from the database. However, when the `B_runtime()` actually calls upon the database I get the error `Cannot access protected property A::$db`. What I don'...
[ 0.2505071461200714, 0.14238913357257843, -0.2834431529045105, -0.23895026743412018, -0.1688176989555359, -0.2326509803533554, 0.29242342710494995, -0.08746764063835144, -0.03328469395637512, -0.6149564981460571, 0.06446867436170578, 0.46472251415252686, -0.6449633836746216, 0.5597560405731...
this doesn't happen if I call it from outside of class A. I know that I can simply change the `protected $db;` in class A to a public variable, however, I am really curious as to how I can fix this. ``` ob_start(); include('/config.php'); ob_end_clean(); $A = new A($db); $B = new B($db); echo $A->A_runtime(); clas...
[ 0.1560407429933548, -0.04375263676047325, 0.18372240662574768, -0.5325917601585388, 0.09862029552459717, -0.03422669693827629, 0.5084991455078125, -0.3432624340057373, -0.16031058132648468, -0.3009963929653168, -0.23399387300014496, 0.4795445203781128, -0.7643744349479675, 0.43870580196380...
protected $db; public function __construct($db){ $this->db = $db; } public function B_runtime(){ $preparedStatement = $this->db->prepare('SELECT * FROM z_mod_html WHERE ModuleLink = :moduleid LIMIT 1'); $preparedStatement->execute(array(':moduleid' => '1')); $rows = $preparedS...
[ 0.09186156094074249, 0.16725566983222961, 0.3610815107822418, -0.2840997278690338, -0.06033698096871376, 0.03679758682847023, 0.5194951891899109, -0.611324667930603, -0.035562608391046524, -0.41524502635002136, -0.3606804311275482, 0.6309199333190918, -0.3710698187351227, 0.192109659314155...
is an example using [Json.Net](http://json.codeplex.com/) ``` List<int> list = new List<int>() {1 , 2}; string json = JsonConvert.SerializeObject( list.Select(x => new{ id = x.ToString(), title = "title " + x.ToString(),
[ 0.04592511057853699, -0.5217123031616211, 0.4689968526363373, -0.166985884308815, 0.12510716915130615, -0.30896246433258057, 0.1862085610628128, -0.43462640047073364, -0.4926416277885437, -0.49509596824645996, -0.41685688495635986, 0.5456944704055786, -0.29188770055770874, 0.14933946728706...
data = Enumerable.Range(3,2).Select(i=> new {column1=i,column2=i*i}) }) , Newtonsoft.Json.Formatting.Indented ); ``` Output: ``` [ { "id": "1", "title": "title 1", "data": [ { "column1": 3,
[ -0.26556646823883057, -0.10141754150390625, 0.7936225533485413, -0.02311030589044094, 0.3892064094543457, 0.25002238154411316, 0.08328212797641754, -0.43259525299072266, -0.029522668570280075, -0.3196852505207062, -0.2889516353607178, 0.602859616279602, -0.4665537476539612, 0.1303093135356...
"column2": 9 }, { "column1": 4, "column2": 16 } ] }, { "id": "2", "title": "title 2", "data": [ { "column1": 3, "column2": 9 },
[ -0.3535569906234741, 0.18247997760772705, 0.5181469917297363, 0.23421674966812134, 0.18529576063156128, 0.28094935417175293, -0.20251785218715668, -0.21339568495750427, -0.040680889040231705, -0.4409453570842743, -0.4305928945541382, 0.18070180714130402, -0.13606515526771545, 0.01700915768...
{ "column1": 4, "column2": 16 } ] } ] ```
[ -0.2912071645259857, 0.4443703293800354, 0.452041357755661, -0.3566182553768158, 0.13615833222866058, 0.23547939956188202, 0.03158707916736603, -0.10352513194084167, -0.32056260108947754, -0.3830564320087433, -0.3458515703678131, 0.4261821508407593, -0.5358635187149048, 0.07820437848567963...
Okay so I have about 1000 duplicated phrases in this file, so doing this manually is not an option. Note that these are PHRASES, not lines or words, and each "phrase" is about 10 lines long. I am trying to get rid of duplicate phrases, yet the only thing that renders an "item" (or phrase) a duplicate is the position s...
[ 0.049819864332675934, 0.12145894765853882, 0.24050864577293396, 0.02256333827972412, 0.06854688376188278, 0.10500524193048477, 0.6229751110076904, 0.0270853228867054, -0.24911260604858398, -0.3916870951652527, -0.16678893566131592, 0.22059518098831177, -0.11586198210716248, 0.2775869369506...
id=1; side="EMPTY"; vehicle="Land_fortified_nest_small"; lock="UNLOCKED"; skill=0.2; init="this setPos [4347.6, 3214.64, 0]; this setDir 128.816;"; }; class Item1 { position[]={4347.6001,0,3214.6399}; azimut=128.81599; special="NONE"; i...
[ -0.4670912027359009, -0.2625287175178528, 0.13413700461387634, 0.09371989965438843, 0.12432505935430527, 0.4521898627281189, 0.35515546798706055, -0.44674625992774963, -0.09308373928070068, -0.23949973285198212, -0.6070722341537476, 0.3547211289405823, 0.039967041462659836, 0.1689319014549...
side="EMPTY"; vehicle="Land_fortified_nest_small"; lock="UNLOCKED"; skill=0.2; init="this setPos [4347.6, 3214.64, 0]; this setDir 128.816;"; }; ``` Now the previous two phrases are duplicates, yet the ID and ITEM# are different, so the only way to identify duplicate phrases is thr...
[ 0.1990429311990738, 0.30696362257003784, 0.233384907245636, 0.2185949683189392, -0.007010967005044222, 0.26334452629089355, 0.5181066989898682, -0.14058548212051392, -0.27447643876075745, -0.3040505647659302, -0.010336972773075104, 0.0916399210691452, 0.12105482816696167, 0.290990024805068...
or regular expression to delete all duplicate phrases, but leaving the first duplicate untouched. So if there are three duplicates, one phrase is left but the two are deleted. How would I go about doing this? --- *An example of the desired input/output:* **Input:** ---------- ``` class Item0 { posit...
[ -0.03951273858547211, 0.046580247581005096, 0.27181005477905273, 0.010393870994448662, -0.027739305049180984, 0.32297030091285706, 0.41922521591186523, -0.2891896069049835, -0.02550617977976799, -0.4084334969520569, -0.46095624566078186, 0.26932522654533386, 0.06707876175642014, 0.20320397...
lock="UNLOCKED"; skill=0.2; init="this setPos [4347.6, 3214.64, 0]; this setDir 128.816;"; }; class Item1 { position[]={4682.6001,0,3847.6399}; azimut=128.81599; special="NONE"; id=2; side="EMPTY"; vehicle="Land_fortified_nest_small";
[ -0.48743924498558044, -0.3353036642074585, 0.1418343186378479, 0.10901132225990295, 0.2694675028324127, 0.44259968400001526, 0.45793893933296204, -0.5547482371330261, -0.18192213773727417, -0.04303763806819916, -0.5616570115089417, 0.3327317535877228, 0.041751980781555176, 0.14513917267322...
lock="UNLOCKED"; skill=0.2; init="this setPos [4682.6, 3847.64, 0]; this setDir 128.816;"; }; class Item2 { position[]={4347.6001,0,3214.6399}; azimut=128.81599; special="NONE"; id=3; side="EMPTY"; vehicle="Land_fortified_nest_small"; ...
[ -0.45759835839271545, -0.28935593366622925, 0.2121761292219162, 0.07181403040885925, 0.15537860989570618, 0.48149219155311584, 0.46806150674819946, -0.5651686787605286, -0.23839694261550903, -0.0620039701461792, -0.5861450433731079, 0.35710713267326355, 0.09307345002889633, 0.1177640780806...
skill=0.2; init="this setPos [4347.6, 3214.64, 0]; this setDir 128.816;"; }; ``` **Output:** ----------- ``` class Item0 { position[]={4347.6001,0,3214.6399}; azimut=128.81599; special="NONE"; id=1; side="EMPTY"; vehicle="Land_fortified_nest_small";...
[ -0.3704645335674286, -0.30886000394821167, 0.18119342625141144, 0.06533675640821457, 0.1345910131931305, 0.5287869572639465, 0.3460775315761566, -0.40635377168655396, -0.14959153532981873, -0.3796946406364441, -0.6112546920776367, 0.3814724087715149, 0.23580946028232574, 0.1165640950202941...
init="this setPos [4347.6, 3214.64, 0]; this setDir 128.816;"; }; class Item1 { position[]={4682.6001,0,3847.6399}; azimut=128.81599; special="NONE"; id=2; side="EMPTY"; vehicle="Land_fortified_nest_small"; lock="UNLOCKED"; skill=0.2;
[ -0.5183330178260803, -0.39333826303482056, 0.23795591294765472, 0.08600929379463196, 0.1542031317949295, 0.5181395411491394, 0.4386615753173828, -0.30589058995246887, -0.08495888113975525, -0.345318466424942, -0.5683228373527527, 0.20060667395591736, 0.034816380590200424, 0.086483888328075...
init="this setPos [4682.6, 3847.64, 0]; this setDir 128.816;"; }; ``` Here is an example using [Json.Net](http://json.codeplex.com/) ``` List<int> list = new List<int>() {1 , 2}; string json = JsonConvert.SerializeObject( list.Select(x => new{ id = x.ToString(), ...
[ -0.15058596432209015, -0.43547511100769043, 0.5540353655815125, -0.07222845405340195, 0.1310196965932846, -0.059350427240133286, 0.24913688004016876, -0.4014950096607208, -0.423158198595047, -0.5061920285224915, -0.421066015958786, 0.49891775846481323, -0.3820660412311554, 0.18028514087200...
data = Enumerable.Range(3,2).Select(i=> new {column1=i,column2=i*i}) }) , Newtonsoft.Json.Formatting.Indented ); ``` Output: ``` [ { "id": "1", "title": "title 1", "data": [
[ -0.2235766053199768, -0.10423977673053741, 0.7275101542472839, 0.020602256059646606, 0.43083682656288147, 0.16378255188465118, 0.023307176306843758, -0.43648481369018555, -0.03470100089907646, -0.2939072847366333, -0.31903713941574097, 0.630414605140686, -0.4774150848388672, 0.177387416362...
{ "column1": 3, "column2": 9 }, { "column1": 4, "column2": 16 } ] }, { "id": "2", "title": "title 2", "data": [ { "column1": 3,
[ -0.2565055191516876, 0.1802791953086853, 0.5421714782714844, 0.3657653033733368, 0.3327910900115967, 0.20504756271839142, -0.20764194428920746, -0.24931055307388306, -0.057916171848773956, -0.3603236973285675, -0.3796038031578064, 0.2254692018032074, -0.07600303739309311, 0.040001340210437...
"column2": 9 }, { "column1": 4, "column2": 16 } ] } ] ```
[ -0.40023332834243774, 0.3575870096683502, 0.4201890528202057, -0.2961340844631195, 0.12462050467729568, 0.355338454246521, 0.03546586260199547, -0.06426902115345001, -0.2607908248901367, -0.45696091651916504, -0.32682058215141296, 0.34422510862350464, -0.5111290216445923, 0.035206001251935...
I am writing a C# application that interfaces with a pair of hardware sensors. Unfortunately the only interface that is exposed on the devices requires a provided dll written in Delphi. I am writing a Delphi executable wrapper that takes calls the necessary functions for the DLL and returns the sensor data over stout....
[ 0.29948288202285767, 0.15305276215076447, 0.731777548789978, -0.18992555141448975, -0.11118666082620621, 0.18574422597885132, 0.31901079416275024, -0.5816097259521484, -0.16585488617420197, -0.6341210007667542, -0.009583145380020142, 0.659462034702301, -0.27699384093284607, -0.215027421712...
characters and attempt to print them one at a time with an Ansi Conversion, only a few of the characters print (they do confirm the data though) and they will often print out of order. (printing with the index exposed simply jumps around.) I also tried converting the PWideChar's to integer straight: 'I' corresponds to ...
[ 0.16029857099056244, 0.025890782475471497, 0.41614997386932373, 0.02048998326063156, -0.3512546122074127, 0.2872813045978546, 0.22413045167922974, -0.15363460779190063, -0.13295915722846985, -0.6662105917930603, -0.14215710759162903, 0.20408904552459717, -0.15267935395240784, 0.01910550706...
UTF-16 PWideChar to AnsiString for printing. **Example application:** ``` program SensorReadout; {$APPTYPE CONSOLE} {$R *.res} uses Windows, SysUtils, dllFuncUnit in 'dllFuncUnit.pas'; //This is my dll interface. var state: integer; answer: PChar; I: integer; J: integer; output: string;...
[ -0.14065101742744446, -0.14985652267932892, 0.8091978430747986, -0.19347107410430908, -0.1621977835893631, 0.19352202117443085, 0.1514294594526291, -0.6002781987190247, -0.27311792969703674, -0.6409253478050232, -0.11955626308917999, 0.6650049090385437, -0.5391607880592346, -0.127919748425...
if state = HSI_NO_ERRORCODE then begin output:= ''; for J := 0 to length(answer) do begin ch:= answer[J]; //This copies the char. Originally had an AnsiChar convert here. output:= output + ch; end; WriteLn(output); end; except
[ 0.0037301499396562576, 0.04725043103098869, 0.35984674096107483, -0.48647987842559814, -0.1237824410200119, 0.25288769602775574, 0.45622166991233826, -0.47887706756591797, 0.014746634289622307, -0.13918183743953705, -0.21882638335227966, 0.32700175046920776, -0.12320514023303986, 0.3330096...
on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; ReadLn(I); end.` ``` The issue was PAnsiChar needed to be the return type of the function sourced from the DLL. To convert `PWideChar` to `AnsiString`: ``` function WideCharToAnsiString(P: PWideChar): AnsiString; begin Result := P; end; ``` ...
[ -0.19071201980113983, -0.10511980950832367, 0.30911028385162354, -0.23832128942012787, -0.09381849318742752, -0.03232314810156822, 0.3587845265865326, -0.24481512606143951, -0.20161433517932892, -0.41021251678466797, -0.4990050196647644, 0.4826240837574005, -0.4450269341468811, 0.110880650...
Delphi and so uses ANSI text. But now you are trying to link to it from a post-Unicode Delphi where `PChar` has a different meaning. I'm sure Rob explained this to you in your other question. So you can simply fix it by declaring your DLL import to return `PAnsiChar` rather than `PChar`. Like this: ``` function GetDev...
[ -0.0027331963647156954, -0.2296755462884903, 0.5791155695915222, -0.05939109995961189, -0.1024269387125969, -0.17473241686820984, 0.05315137282013893, 0.011437809094786644, -0.23707160353660583, -0.6007487773895264, -0.16758111119270325, 0.5676108002662659, -0.3879864811897278, -0.03988607...
an alias for `PAnsiChar`. In modern Delphi it is an alias for `PWideChar`. That mismatch would explain everything that you report. --- It does occur to me that writing a Delphi wrapper to the DLL and communicating via stdout with your C# app is a very roundabout approach. I'd just p/invoke the DLL directly from the C...
[ 0.009048511274158955, -0.2978309392929077, 0.3131471574306488, -0.058975737541913986, -0.16586974263191223, -0.24954277276992798, 0.3098042905330658, 0.04046107828617096, -0.02705620601773262, -0.47546353936195374, -0.14871303737163544, 0.6360146999359131, -0.6084349751472473, 0.0934855639...
ptr = GetDeviceChannelInfo_HSI(Port, Addr, Channel, ref State); ``` If the function returns a UTF-16 string (which seems doubtful) then you can convert the `IntPtr` like this: ``` string str = Marshal.PtrToStringUni(ptr); ``` Or if it is actually an ANSI string which seems quite likely to me then you do it like th...
[ 0.09828771650791168, -0.2269001007080078, 0.48688310384750366, -0.13206319510936737, -0.01900886930525303, -0.1090652123093605, 0.43679744005203247, -0.5220242142677307, -0.15923094749450684, -0.614599883556366, -0.4876917600631714, 0.6054258942604065, -0.4127647280693054, 0.07633913308382...
I've one page where i do a long polling i've to use at the begin of this page this ``` session_start(); session_write_close(); ``` Because : > to prevent concurrent writes only one script may operate on a session at any time So if i do not and the long polling is running the user will not be able to load another p...
[ 0.2870261073112488, 0.2583658695220947, 0.34825536608695984, 0.08389903604984283, -0.2608659267425537, 0.0005972140352241695, 0.17838022112846375, -0.262743204832077, -0.1105143129825592, -0.6265292763710022, 0.471163272857666, 0.4883807301521301, -0.21484999358654022, 0.11043088138103485,...