text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
) { SDL_Rect coordinates; SDL_Surface *sprite; sprite = my_sprite->get_frame( my_frame, my_direction ); coordinates.x = (int)get_x(); coordinates.y = (int)get_y(); SDL_BlitSurface( sprite, NULL, destination, NULL ); } ``` Finally, here is ny get\_frame() function: ``` SDL_Surface* Image_Spri...
[ 0.005506564397364855, -0.1880190670490265, 1.3519506454467773, -0.03548082336783409, -0.27315405011177063, -0.026415610685944557, -0.020099559798836708, -0.4775182604789734, -0.29916101694107056, -0.7539809346199036, -0.2430689036846161, 0.4772561192512512, 0.01917801983654499, 0.238372713...
format->Rmask, format->Gmask, format->Bmask, format->Amask ); SDL_Rect *frame_crop = new SDL_Rect; frame_crop->x = my_frame_width * x; frame_crop->y = my_frame_height * y; frame_crop->w = my_frame_width; frame_crop->h = my_frame_height; SDL_Rect *coordinates = new SDL_Rect; coordinates->x =...
[ -0.17188027501106262, 0.004626796580851078, 1.0273864269256592, -0.1643795222043991, -0.43622738122940063, 0.30777329206466675, 0.06016663461923599, -0.41315221786499023, -0.22726505994796753, -0.6192094087600708, -0.4720778167247772, 0.29788026213645935, -0.03048769012093544, 0.2058603167...
delete frame_crop; return frame; } ``` @modelnine's comment is correct - the `lea` is being used to simplify the assignment in your loop. You have: ``` x = ii - 2; ``` And the `lea` (load effective address) instruction is doing effectively: ``` esi = &(*(eax - 2)); ``` The `&` and `*` cancel each other out (...
[ 0.23638173937797546, 0.1506071537733078, 0.4044366776943207, -0.16975092887878418, 0.22052806615829468, -0.10364403575658798, 0.30685117840766907, -0.2829747796058655, -0.0976148247718811, -0.5440273284912109, -0.16331517696380615, 0.6772112250328064, -0.5300467014312744, 0.130513995885849...
When I inherit the base class, it's telling me there is no such class This is enhanced.h: ``` class enhanced: public changeDispenser // <--------where error is occuring { public: void changeStatus(); // Function: Lets the user know how much of each coin is in the machine enhanced(int...
[ 0.32475799322128296, -0.07777617871761322, 0.5850441455841064, -0.03230912983417511, 0.30978333950042725, 0.3064005672931671, -0.26579010486602783, -0.3457498252391815, -0.327850878238678, -0.6449017524719238, 0.06503250449895859, 0.7806031107902527, -0.06331838667392731, 0.126217395067214...
void changeLoad(int); // Function: Loads what change the user requests into the Coin Machine int dispenseChange(int); // Function: Takes the users amount of cents requests and dispenses it to the user private: int dollar; }; ``` This is enhanced.cpp: ``` #include "enhanced.h"...
[ 0.31493866443634033, -0.05025342479348183, 0.523669958114624, -0.30913347005844116, 0.22416017949581146, 0.3543171286582947, -0.27661246061325073, -0.4266573190689087, -0.1728360652923584, -0.5021387338638306, -0.0522928424179554, 0.6420813202857971, -0.41366124153137207, -0.11366206407546...
changeDispenser::changeStatus(); } void enhanced::changeLoad(int d) { dollar = dollar + d; //changeDispenser::changeLoad; } ``` This is changeDispenser.h: ``` class changeDispenser { public: void changeStatus(); // Function: Lets the user know how much of each coin is in the machine changeDispen...
[ 0.3327273726463318, -0.14779163897037506, 0.5370441675186157, -0.10146062821149826, 0.3354837894439697, 0.5612702369689941, -0.2732309401035309, -0.27320659160614014, -0.3774755299091339, -0.6261976361274719, 0.07653674483299255, 0.4872473180294037, -0.4247181713581085, 0.3027605414390564,...
// Function: Takes the users amount of cents requests and dispenses it to the user private: int quarter; int dime; int nickel; int penny; }; ``` I didn't include the driver file or the changeDispenser imp file, but in the driver, these are included ``` #include "changeDispenser.h" #include "enhanced....
[ -0.0551932230591774, 0.02278866246342659, 0.5172483325004578, -0.05319621041417122, -0.12976382672786713, 0.4996618330478668, 0.3549409508705139, -0.6496831178665161, -0.20339268445968628, -0.5538721680641174, 0.052733294665813446, 0.6734856963157654, -0.13419032096862793, 0.09153861552476...
[self _queryStringWithBase:nil parameters:params prefixed:NO]; return [self _sendRequestWithMethod:HTTP_POST_METHOD path:path queryParameters:params body:body requestType:MGTwitterUpdateSendRequest responseType:MGTwitterStatus]; } `...
[ -0.4307306408882141, 0.12483298778533936, 0.5568165183067322, -0.08291879296302795, -0.3430542051792145, 0.39769071340560913, 0.3783535659313202, -0.5629187822341919, -0.40170833468437195, -0.3605523109436035, -0.14234991371631622, 0.5801088809967041, -0.21186059713363647, -0.0719189196825...
I remember a command that checks that a given condition is true, otherwise it stops the script. It was one word, starting with a, i think starting with att.. and it was just that word, the condition in parentheses, and the semicolon. I've googled everything I can think of and cannot find it! **EDIT:** You're missing `...
[ 0.19973090291023254, 0.15326182544231415, 0.4170716106891632, -0.1232248991727829, 0.1400560587644577, 0.14304637908935547, 0.6943904757499695, -0.09400586783885956, -0.19203203916549683, -0.44310909509658813, -0.08350465446710587, 0.5521970391273499, -0.287845641374588, 0.1631195247173309...
in order with multi-line branches (makes it easier to scan): ``` if (isset($_POST["captcha"])) { if ($_SESSION["captcha"] == $_POST["captcha"]) { //CAPTHCA is valid; proceed the message: save to database, send by e-mail ... echo 'CAPTHCA is valid; proceed the message'; } else { ...
[ -0.06046050786972046, -0.07492367923259735, 0.4409584701061249, -0.18504346907138824, 0.0009411332430317998, -0.03394123539328575, 0.4365929365158081, -0.5620063543319702, -0.3010913133621216, -0.30614447593688965, -0.6353116035461426, 0.12824766337871552, -0.44509798288345337, 0.165803417...
I want to do some calculation, but if they took too much time(say 10 sec), I want to stop it and show current best result. Is it ready way to do it in Java? I don't want to write time checking in every function. Use `Timer` as suggested or go for multiple threads. In your main program, another thread with the calculat...
[ 0.1946006566286087, 0.07773852348327637, 0.26816892623901367, -0.2444324791431427, 0.31748971343040466, -0.20057936012744904, 0.34136611223220825, -0.010930297896265984, -0.18343032896518707, -0.797775149345398, -0.024330222979187965, 0.5951941609382629, -0.16810353100299835, -0.0114068044...
| another thread +---calculation---+ ```
[ 0.05374513193964958, 0.023213965818285942, 0.4283725619316101, 0.08052361756563187, 0.02427196502685547, 0.06507314741611481, 0.04699606075882912, 0.03125740960240364, -0.08630936592817307, -0.5080598592758179, 0.15018819272518158, 0.200790673494339, -0.3240213096141815, 0.4167487025260925...
When I plot something with `contourf`, I see at the bottom of the plot window the current x and y values under the mouse cursor. Is there a way to see also the z value? Here an example `contourf`: ``` import matplotlib.pyplot as plt import numpy as hp plt.contourf(np.arange(16).reshape(-1,4)) ``` The [documentation ...
[ 0.09783755242824554, -0.17096830904483795, 0.8252587914466858, 0.24277736246585846, -0.0168717410415411, 0.030954543501138687, -0.38110020756721497, -0.20805320143699646, -0.15301983058452606, -0.6507776379585266, -0.03604172542691231, 0.5952911376953125, 0.06797845661640167, 0.04776155203...
I have a problem in my Android application. I have a Custom ListView Adapter, but when I launch the application the list does not show any item! My Code : ``` import android.app.Activity; import android.os.Bundle; import android.widget.ListView; public class AccountContents extends Activity { private ListView l...
[ 0.4159846305847168, -0.2382182627916336, 0.6051414608955383, -0.1977866291999817, 0.2296512871980667, 0.33125749230384827, 0.6328838467597961, -0.3989315927028656, -0.38492098450660706, -0.8706885576248169, -0.35215291380882263, 0.7938161492347717, -0.5817522406578064, -0.03627188503742218...
CArrayAdapter adapter = new CArrayAdapter(AccountContents.this, rootContents); setContentView(R.layout.main); ls1 = new ListView(AccountContents.this); ls1.setAdapter(adapter); } } ``` You need to add the list to your activity. To do this, add this line: ``` setContentView(R.layout.main...
[ 0.1229475736618042, -0.15777160227298737, 0.8966479301452637, 0.001844496582634747, -0.10241620987653732, 0.03388402611017227, 0.054116781800985336, -0.21991097927093506, -0.45000773668289185, -0.4824584424495697, -0.13518498837947845, 0.7088536620140076, -0.11073239147663116, 0.2847720682...
I was trying to use the overload operator method to copy the entries of one queue into another, but I am going wrong with my function. I don't know how else to access the values of the queue "original" any other way than what I have below: ``` struct Node { int item; Node* next; }; class Queue { public: // ...
[ -0.03751946613192558, -0.2766120433807373, 0.4124249219894409, -0.05970111861824989, 0.473514586687088, 0.3171331286430359, 0.2918524444103241, -0.18950393795967102, -0.2588394284248352, -0.5547314286231995, -0.02371521294116974, 0.5408765077590942, -0.4485313594341278, 0.35512784123420715...
front->item = original.front->item; front->next = new Node; front = front->next; original.front = original.front->next; } } ``` ``` void Queue::operator=(const Queue &original) { Node* tmp = original.front; //THIS IS WHERE IM GOING WRONG while(tmp->next != NULL) { front-...
[ -0.16958220303058624, -0.307531476020813, 0.4152722656726837, -0.12328021228313446, 0.34433427453041077, 0.5278111100196838, 0.31664010882377625, -0.2343011200428009, -0.40788301825523376, -0.48175904154777527, -0.47130802273750305, 0.256527841091156, -0.37893107533454895, 0.35638362169265...
tmp = tmp->next; } } ```
[ 0.000006287233645707602, -0.06725368648767471, 0.29025882482528687, -0.24878519773483276, 0.06107987090945244, -0.06601930409669876, 0.2756994962692261, 0.007477928418666124, -0.2084442675113678, -0.6640342473983765, -0.3607610762119293, 0.6356983780860901, -0.5907095074653625, 0.049251429...
I have some code dynamically created by Sigma, which looks like this: ``` <div id="myGrid1_headDiv" class="gt-head-div"> <div class="gt-head-wrap"> <table id="myGrid1_headTable" class="gt-head-table"> <tbody> <tr class="gt-hd-row"> <td class="gt-col-mygrid1-uid"> <div class="gt-inner gt-inner-left" unselectable="on" ...
[ 0.087285116314888, 0.04236888512969017, 0.5331475734710693, -0.24330714344978333, -0.12167012691497803, 0.2868614196777344, 0.19592338800430298, -0.4125809371471405, 0.1906251311302185, -0.6798442006111145, -0.11037647724151611, 0.4635249972343445, -0.15081605315208435, 0.07885943353176117...
spans around it that I don't want to touch. What am I doing wrong? ===== Final Answer for others using Sigma Grid: Thanks to @minitech for the pointers, the answer is to add to Sigma Grid's gridOption with: ``` onComplete:function(grid){ $('div.gt-inner > span').addClass('celltitle'); //add cell title after grid l...
[ 0.20669780671596527, -0.06843505054712296, 0.8648142218589783, -0.030656183138489723, -0.19674547016620636, 0.1494361311197281, -0.11442437767982483, -0.6464817523956299, -0.15388160943984985, -0.5471554398536682, -0.11017604172229767, 0.33132582902908325, -0.25394004583358765, 0.038248956...
I call getHeight and getWidth in a custom view in the `onDraw()` method. `getHeight()` returns `1,073,742,549` and `getWidth()` returns `1,073,742,304`. However, when I look at the display metrics for the screen's height and width, I get 800 and 480 respectively. What is getHeight and getWidth returning? I'm getting t...
[ 0.30715662240982056, -0.05088193714618683, 0.9478399157524109, 0.022434143349528313, -0.18731774389743805, 0.2847064137458801, 0.10348090529441833, -0.27071115374565125, -0.23331502079963684, -0.6877059936523438, 0.1775042712688446, 0.9032889008522034, 0.13647149503231049, -0.0934292823076...
chance this custom view is roughly 725 x 480? I have no idea where that extra 0x40000000 came from, but it looks like it could be almost right except for 1 bit :)
[ 0.5954446792602539, -0.21553239226341248, 0.23418664932250977, 0.3765157163143158, 0.33570876717567444, 0.0649314895272255, -0.06725192070007324, 0.20244982838630676, -0.2760513424873352, -0.5660552382469177, 0.54781174659729, 0.5346574187278748, 0.0815679207444191, -0.14695842564105988, ...
I'm slowly learning C. I read this page about input and output dealing with strings here: <http://www.cprogramming.com/tutorial/c/lesson9.html> In the last code example, `fgets` is used to get and assign the input to a variable to the char array `name`. I tried implementing something similar in my own program. ``` #i...
[ 0.08428720384836197, 0.048848558217287064, 0.43842563033103943, -0.36043763160705566, -0.06978204101324081, 0.043107714504003525, 0.19736868143081665, -0.29303476214408875, 0.03237885236740112, -0.5459820032119751, 0.033095214515924454, 0.22457920014858246, -0.014959233812987804, 0.2518839...
for (i=0;i<256;i++) { if (FirstPeriod[0]->name[i]=='\n') FirstPeriod[0]->name[i]='\0'; } printf("\n\nHello Student 0: %s",FirstPeriod[0]->name); } int main() { struct Person DadeLamkins; DadeLamkins.age=16; int numb; int x; int *numb_address=&numb; numb_a...
[ -0.3701059818267822, -0.3233881890773773, 0.607239305973053, -0.1172201856970787, 0.24958479404449463, 0.29168185591697693, 0.3934050500392914, -0.4777771830558777, -0.25836288928985596, -0.4459044635295868, -0.584436297416687, -0.050140347331762314, -0.18459197878837585, 0.457008570432662...
printf("Please enter a number: "); scanf("%d", &numb); switch (numb) { case 0: printf("Dude, 0 is lame...\n"); break; case 7: printf("Dude, 7 is my favorite number!\n"); break; default:
[ 0.046462830156087875, -0.04494008421897888, 0.1812903881072998, -0.18740537762641907, 0.08904337882995605, -0.0010209137108176947, 0.585963785648346, -0.059581998735666275, -0.30733513832092285, -0.4406227767467499, -0.31963470578193665, 0.5734243392944336, -0.13058112561702728, 0.25006720...
printf("You entered %d\n", numb); break; } for (x=0;x<numb+1;x++) { printf("\n::# %d",mult(x,2)); } printf("\n\n%d",numb_address); free(numb_address); numb_address=0; PracticeStrings(); getchar(); return 0; } int mult (int x, int y) { return x*y; } ``` The ...
[ -0.25057899951934814, 0.14177855849266052, 0.3852451741695404, -0.20559561252593994, 0.01629018224775791, 0.19686506688594818, 0.5615875720977783, -0.2028084099292755, 0.042923055589199066, -0.7112718820571899, -0.5231779217720032, 0.25077956914901733, -0.10007701069116592, 0.4272136986255...
before accepting the input (from `fgets`). I'm using Code::Blocks to compile. Any help would be appreciated! Edit... ======= Hahaha, yes, I understand that my program is inefficient and very silly. As you can tell, it doesn't really accomplish much. It is mostly just something to shove what I'm currently learning an...
[ 0.4524243175983429, 0.275333434343338, -0.10686559230089188, 0.36808472871780396, -0.1943473517894745, 0.061159662902355194, 0.27341970801353455, 0.2903551459312439, 0.06314630061388016, -0.5521525144577026, 0.37287628650665283, 0.4965587854385376, 0.11500661075115204, 0.2414136528968811, ...
of a higher understanding. I'm sure that the tutorial writer didn't expect anyone to mix the functions in the way I did. Thanks a ton guys! Hopefully I can get used to this. I've done lots of scripting and plenty in the .net languages, hopefully I can add `C` to this list :) It is because when you read the number: ``...
[ 0.21874691545963287, 0.13587532937526703, 0.37346258759498596, 0.003154290374368429, -0.011924296617507935, -0.07759353518486023, 0.41905510425567627, -0.22447079420089722, -0.28521978855133057, -0.6743717789649963, -0.28773266077041626, 0.7249300479888916, -0.01618931069970131, -0.0241390...
... err ... ``` And even more critical: ``` if (scanf(..) != number_of_items_i_want) { ... did not get a number, or what ever I wanted ... ``` etc.
[ 0.008077054284512997, 0.03333279490470886, 0.4749462306499481, -0.03160639852285385, 0.1935029923915863, 0.043310098350048065, 0.12956251204013824, -0.13212941586971283, -0.4491150677204132, -0.34379225969314575, -0.2901110351085663, 0.4991038739681244, -0.2242565006017685, 0.4284223616123...
I try to play with Service in Android, my application contain an Activity with a button so that it can do action when I press it. The core component is the ExtractingURLService , which extends IntentService framework class. I have overrided the onHandleIntent() method, so that it can handle intent passed to it properly...
[ 0.10411558300256729, -0.2566235661506653, 0.7198195457458496, -0.3249833285808563, 0.1433224081993103, 0.12703725695610046, 0.4085637629032135, -0.23053140938282013, 0.2033795565366745, -0.48490944504737854, -0.0465366505086422, 1.0050413608551025, -0.48644784092903137, -0.1663367599248886...
// do something here ! } } } ``` The Android Manifest file is : ``` <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="example.service.urlextraction" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="10" /> <uses-perm...
[ 0.20175673067569733, 0.14217151701450348, 0.6571145057678223, -0.24645891785621643, 0.03997345268726349, 0.17262643575668335, 0.1478661298751831, -0.38687554001808167, -0.06637988984584808, -0.8692403435707092, -0.24462278187274933, 0.4667981266975403, -0.37731418013572693, -0.159201472997...
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <service android:name=".ExtractingURLService" android:enabled="true"></service> </application> <...
[ -0.0572892464697361, -0.08341763913631439, 0.7296629548072815, -0.7502298951148987, -0.01737385056912899, 0.3019073009490967, 0.5657169222831726, -0.3260050117969513, -0.09974896162748337, -0.6840269565582275, -0.2575737535953522, 0.7014507055282593, -0.27429214119911194, -0.38066986203193...
received was: > 04-09 16:24:05.751: ERROR/AndroidRuntime(1078): Caused by: > java.lang.InstantiationException: > example.service.urlextraction.ExtractingURLService What I should do with that ?? Add full path of Service ``` <service android:name="com.foo.services.ExtractingURLService" android:enabled="true"></servi...
[ -0.15619580447673798, -0.02478429488837719, 0.9905649423599243, -0.3622628450393677, -0.09720248728990555, 0.19980064034461975, 0.5687155723571777, -0.5142037868499756, 0.13682715594768524, -0.4098166823387146, -0.16336868703365326, 0.757854163646698, -0.22359192371368408, -0.0267799049615...
We just started learning windows programming in C++. We have to make a program that has 4 die on the screen, and when the user presses 'SpaceBar', the die roll, or the number of dots on the die change randomly. Our professor hasent given us a lot of information, so I am kind of just looking for some direction. Right ...
[ 0.31031614542007446, 0.34733089804649353, 0.4893096089363098, 0.06471841037273407, -0.04642742499709129, 0.6431109309196472, -0.3887065052986145, -0.3961086869239807, -0.6341496109962463, -0.8082083463668823, -0.017982345074415207, 0.0753394290804863, -0.1808040887117386, 0.086258083581924...
die upwards, the dots move with the square and dont just stay stationed painted on the screen. And 2.) How would I go about making those dots randomly change when spacebar is pressed (simulating that they have been rolled)? Just looking for some direction, thanks. 1) You will still have to draw them on the screen, b...
[ 0.3269774913787842, 0.05001576989889145, 0.5245459675788879, -0.004993652459233999, 0.12140478193759918, 0.1932903230190277, -0.202203631401062, -0.4396277070045471, -0.32699713110923767, -0.8842248916625977, 0.09002086520195007, 0.5797532796859741, 0.08347991853952408, -0.3119609355926513...
`WM_KEYDOWN` and `WM_KEYUP` messages, or the `WM_CHAR` message. Just start a chain of changing how many dots are supposed to appear on the die when space is pressed (`SetTimer` could be handy), and let `WM_PAINT` do the work of painting the dots (or call something to calculate the positions of the dots, and let `WM_PAI...
[ 0.604321300983429, -0.05841570347547531, 0.48220762610435486, -0.2564602792263031, 0.17880000174045563, 0.2799273133277893, -0.11269337683916092, -0.5905596613883972, -0.3966237008571625, -0.9877403974533081, 0.30419954657554626, 0.24612364172935486, -0.15631726384162903, -0.12751202285289...
point } void OnPaint() { //paint each sqaure //paint each dot in the correct position, which should be updated with square } void OnChangeDots() { //change number of dots //also start a new change to happen later if not done rolling } ``` For drawing dots, use Warren P's reference link.
[ -0.20264177024364471, -0.17221225798130035, 0.454067200422287, -0.15986566245555878, 0.19941911101341248, 0.39636895060539246, -0.20033694803714752, -0.31626996397972107, -0.38276007771492004, -0.8585458993911743, -0.12332771718502045, -0.08835674822330475, -0.5964183211326599, -0.04715977...
I have two tables. Here is a simplified breakdown: ``` Table #1 - Album: Rows: albumId | title | userId Table #2 - Photo: Rows: photoId | src | albumId ``` I want to get the first photo's src from each album. This is pretty clearly not what I'm looking for but here is what I have: ``` SELECT pa.id, pa.title, p.src...
[ 0.2081746757030487, 0.34061601758003235, 0.49594470858573914, -0.12260197103023529, -0.04981232434511185, 0.23514875769615173, -0.290501207113266, -0.5878149271011353, -0.30774685740470886, -0.49922987818717957, 0.07781867682933807, 0.5328934788703918, -0.01546933688223362, -0.205350160598...
(don't know if using subqueries is efficient enough for your situation) ``` SELECT pa.albumId, pa.title, p.src FROM Album pa LEFT JOIN Photo p ON p.photoId = (SELECT MIN(photoId) FROM Photo WHERE albumId = pa.albumId) WHERE pa.userId = 1 ```
[ -0.295801043510437, 0.1424817144870758, 0.48928332328796387, 0.12303822487592697, 0.1424207240343094, 0.32377228140830994, -0.15920734405517578, -0.46946287155151367, -0.1516205072402954, -0.5647774338722229, -0.38625413179397583, 0.47622737288475037, 0.14718450605869293, -0.10438606142997...
I am implementing a tridiagonal matrix and I have to be as efficient as possible. Obviously I will only hold the elements that contain data. I overloaded the `operator()` to act as an indexer into the matrix, but I want this operator to return a reference so that the user can modify the matrix. However, I cannot just `...
[ -0.026235882192850113, 0.2967151701450348, 0.139899343252182, 0.07978324592113495, -0.056345384567976, 0.15334318578243256, 0.15826016664505005, -0.5092281699180603, 0.13924692571163177, -0.37960562109947205, 0.18051639199256897, 0.40065011382102966, -0.5663310289382935, 0.3182762265205383...
reference to 0? below is the related class definition ``` template <class T> class tridiagonal { public: tridiagonal(); ~tridiagonal(); T& operator()(int i, int j); const T& operator()(int i, int j) const; private: //holds data of just the diagonals T * m_upper; T * m_main; T * m...
[ 0.35412561893463135, -0.09320156276226044, 0.16029168665409088, 0.03705381229519844, 0.051340457051992416, -0.008499333634972572, 0.028317458927631378, -0.5484460592269897, 0.09972269833087921, -0.5463764667510986, -0.22768808901309967, 0.36946430802345276, -0.5764885544776917, 0.108794748...
then a sparse, tridiagional matrix is paradoxically *not* a matrix (just as a square is not a *modifiable* rectangle - a classic example of inappropriate inheritance that doesn't obey the Liskov Substitution Principle). In short, you'd be better off changing your interface to suit sparse, tridiagonal matrices rather t...
[ 0.12955108284950256, -0.21317856013774872, 0.12055772542953491, 0.15796498954296112, -0.21478711068630219, -0.0032987212762236595, -0.018270976841449738, -0.13893698155879974, -0.12249104678630829, -0.770262598991394, -0.2207392007112503, 0.42042413353919983, -0.41203948855400085, 0.283733...
can just return `0` for the elements off the diagonal. * Modifying your non-`const` accessor to return a reference to a dummy element for locations off the diagonal, and crossing your fingers :) Alternatively, you could change the specification to `throw` in such cases, but that might be a little unfriendly. One other...
[ 0.21838819980621338, -0.17000329494476318, 0.12006360292434692, 0.15164051949977875, -0.134603351354599, -0.219010129570961, 0.39092889428138733, -0.11827889084815979, -0.005341603420674801, -0.7867520451545715, -0.03514516353607178, 0.36663180589675903, -0.1615062654018402, -0.05973553657...
I am attempting to use Python 3 to interface with the Twitter API to return the link for a page that gives me a pin number to use to request access tokens. As detailed here: <https://dev.twitter.com/docs/auth/pin-based-authorization> Twitter's API responds to me telling me that I have not properly authorized my POST r...
[ 0.30970269441604614, 0.21048259735107422, 0.49651286005973816, 0.02618100307881832, 0.16568374633789062, 0.4342823922634125, 0.3035893738269806, -0.05298633873462677, -0.10205492377281189, -0.44222602248191833, 0.12686122953891754, 0.30631235241889954, -0.1628018021583557, -0.0494133718311...
this and I am hoping someone can help nudge me past the final part. Here are the most relevant parts of the Twitter API docs: <https://dev.twitter.com/docs/api/1/post/oauth/request_token> <https://dev.twitter.com/docs/auth/authorizing-request> This is the code I am using: ``` import urllib.parse, urllib.request, j...
[ 0.24708038568496704, 0.08884917199611664, 0.598562479019165, -0.05822748690843582, -0.17103318870067596, 0.09734675288200378, 0.007188970688730478, -0.48598435521125793, -0.15934406220912933, -0.6264166235923767, 0.014062607660889626, 0.3320929706096649, -0.19768963754177094, 0.13116283714...
"Authorization:" #Consumer key HEADER = 'OAuth oauth_callback="oob" oauth_consumer_key="' + TOKEN + '", ' #Nonce HEADER += 'oauth_nonce="' NONCE = "" for i in range(32): NONCE += chr(random.randint(97, 122)) HEADER += NONCE HEADER += '", ' #Timestamp TIMESTAMP = str(int(time.time())) #Signature HEADER += 'oauth...
[ 0.22261902689933777, 0.24394480884075165, 0.708026111125946, -0.19591407477855682, 0.263685405254364, 0.17309162020683289, 0.35135242342948914, -0.6010575890541077, 0.24308393895626068, -0.2767047584056854, -0.3299376964569092, 0.683529257774353, -0.02667904645204544, 0.3560487926006317, ...
+= 'oauth_timestamp="' + TIMESTAMP + '", ' #Version HEADER += 'oauth_version="1.0"' print(HEADER_TITLE + "\n" + HEADER) print(urllib.request.urlopen(urllib.request.Request(REQUEST_URL, bytes(HEADER_TITLE+HEADER, 'utf-8'))).read()) ``` Finally, I would like to note that I am aware of the existence of Python OAuth a...
[ 0.11444038152694702, 0.2775501310825348, 0.4460938572883606, -0.26203057169914246, -0.0037621906958520412, 0.16640202701091766, 0.2329334020614624, -0.13679464161396027, -0.28142815828323364, -0.4864225387573242, -0.252068430185318, 0.3939262628555298, -0.4736034572124481, 0.07022169977426...
- it's `KEY, MESSAGE`, not `MESSAGE, KEY` 4. I removed the reference to `include_entities` in `PARAMETER_STRING` - if you don't use include\_entities in the request (and I believe it doesn't make sense for the token request) it mustn't be included in the PARAMETER\_STRING 5. I added `oauth_callback=oob` to the begin of...
[ -0.032680414617061615, 0.11836312711238861, 0.7111452221870422, -0.1672191619873047, 0.1464543491601944, -0.03741002082824707, 0.13540750741958618, -0.1941463053226471, -0.1378915160894394, -0.3743699789047241, -0.2887321710586548, 0.3264836370944977, -0.2487863302230835, 0.161704123020172...
I removed the trailing semicolon from `HEADER_TITLE`. 8. I added the missing semicolon after `oauth_callback="oob"`. Enjoy! Here's a fixed version of your code: ```py import urllib.parse, urllib.request, json from hashlib import sha1 import hmac import base64 import time import random import sys #Server Links REQUE...
[ -0.11017380654811859, 0.0714377835392952, 0.7080684900283813, 0.0465678833425045, 0.10859055072069168, 0.2261979728937149, 0.033789463341236115, -0.42295780777931213, -0.27701088786125183, -0.1880919337272644, -0.22279594838619232, 0.46372297406196594, -0.24069251120090485, 0.1541625857353...
122)) HEADER += NONCE HEADER += '", ' #Timestamp TIMESTAMP = str(int(time.time())) #Signature HEADER += 'oauth_signature="' PARAMETER_STRING = "oauth_callback=oob&oauth_consumer_key=" + TOKEN + "&oauth_nonce=" + NONCE + "&oauth_signature_method=HMAC-SHA1&oauth_timestamp=" + TIMESTAMP + "&oauth_version=1.0" BASE_STRIN...
[ 0.31987443566322327, 0.056097086519002914, 0.6235852837562561, 0.054882027208805084, 0.03186258301138878, 0.11322576552629471, -0.08561314642429352, -0.41021671891212463, 0.20155532658100128, -0.5817486643791199, -0.2740430235862732, 0.7339813709259033, -0.1406843513250351, 0.0110699823126...
I'd like to run a query on a table where I concatenate the the value of one column with another. Something like the following (javascripty attempt): ``` UPDATE table SET items = items+","+item1 WHERE item1 != "No Data" || item1 != ""; ``` Is this possible to do in the database or do I need to be doing it in the mid...
[ -0.020568743348121643, 0.05143985152244568, 0.38897791504859924, -0.09151515364646912, -0.01858556643128395, -0.032537560909986496, 0.37826821208000183, -0.23472672700881958, -0.10445459187030792, -0.6862508654594421, 0.009295527823269367, 0.5036323666572571, -0.32908618450164795, -0.00477...
I am using the following to plot the graph given below: ``` data <- structure(list(Type1 = c("DB", "DB", "DB", "DB", "DB", "DB", "DB", "DB", "DB", "DB", "DB", "DB", "DB", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manu...
[ -0.040295593440532684, 0.4457734227180481, 0.506051778793335, -0.028480030596256256, 0.07861356437206268, 0.4814194142818451, 0.4606398344039917, -0.4305226802825928, 0.09823665022850037, -0.5159810781478882, -0.4102845788002014, 0.18370963633060455, -0.13021956384181976, 0.206557139754295...
"B", "C", "H", "I", "J", "K", "L", "M", "O", "J", "P", "K", "Q", "M", "K", "P", "J", "P"), Percent = c("83.5106383", "9.574468085", "5.85106383", "0.531914894", "1/188*100", "85.24590164", "11.47540984", "1/61*100", "1.639344262", "90", "3.333333333", "3.333333333", "3.333333333", "20.10582011", ...
[ -0.02273964323103428, 0.4235067665576935, 0.11497284471988678, 0.3125378489494324, 0.33245453238487244, 0.6545071005821228, 0.041034892201423645, -0.4953608810901642, -0.028312575072050095, -0.6284178495407104, -0.2488410472869873, 0.20002910494804382, 0.13282911479473114, 0.74616271257400...
geom_bar(width=0.8, stat="identity", position=position_dodge()) + facet_grid(Type1 ~ Type2, ) + theme_bw() + coord_flip() + scale_y_continuous(limits=c(0,100)) print(g) ``` ![enter image description here](https://i.stack.imgur.com/jgCk7.png) Is there any way that I can ma...
[ 0.06844015419483185, 0.16400028765201569, 0.8291791081428528, -0.026645103469491005, 0.0996374636888504, 0.17205773293972015, 0.05675605684518814, -0.44657689332962036, -0.15681220591068268, -0.3757643699645996, -0.07990705966949463, 0.44497719407081604, -0.36823493242263794, 0.16648590564...
16 labels because the other 10 are being used by the `Manual` part of the data. Likewise for the `Manual` row. What I am looking for is something like this: ``` 1 2 3 H G D
[ 0.32314684987068176, 0.5908721685409546, 0.23771265149116516, -0.21571733057498932, 0.10956192016601562, 0.10610973834991455, -0.01549610123038292, -0.342050701379776, -0.3740498423576355, -0.43650591373443604, -0.2459695041179657, 0.3639819324016571, -0.37280958890914917, 0.31301379203796...
DB C B A Q P O G MANUAL M L K J I ``` Any suggestions on how to do this? There seems to be a bug or unexpected behavior when combining `facet_grid(scales="free")` and `coord_flip()`. Here are 2 possible work-arounds: ``` library(ggplot2) # Removed quotes from Percent values,...
[ 0.27980419993400574, 0.19976499676704407, 0.31493836641311646, -0.017247261479496956, -0.15952345728874207, 0.2888566553592682, 0.3190082311630249, -0.6241188645362854, 0.22345443069934845, -0.5511752367019653, 0.05608929693698883, 0.6842896938323975, -0.24864605069160461, 0.12948083877563...
"Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual", "Manual"), Type2 = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L), Category = c("A", "B", "C", "D", "E", "A", "B", "F", "G", "A", "B", "C", "H", "I", "J", "K", "L...
[ -0.1465340107679367, 0.22742359340190887, 0.4787749946117401, 0.19630157947540283, 0.16335037350654602, 0.7498353123664856, 0.5400304198265076, -0.1265842765569687, 0.005874462891370058, -0.5316832065582275, -0.5645006895065308, 0.3274185061454773, 0.19718432426452637, 0.29160869121551514,...
85.24590164, 11.47540984, 1/61*100, 1.639344262, 90, 3.333333333, 3.333333333, 3.333333333, 20.10582011, 10.05291005, 6.349206349, 5.82010582, 4.761904762, 31.14754098, 16.39344262, 6.557377049, 6.557377049, 4.918032787, 30, 23.33333333, 16.66666667, 10, 6.666666667)), .Names = c("Type1", "Type...
[ -0.1415727585554123, 0.07883963733911514, 0.5177350044250488, 0.22705017030239105, -0.028460007160902023, 0.494403213262558, 0.16042791306972504, -0.48773449659347534, -0.1799219697713852, -0.7602075338363647, -0.3287475109100342, 0.22851896286010742, -0.21895518898963928, 0.34572213888168...
theme_bw() + scale_y_continuous(limits=c(0, 100)) + opts(title="Figure 1. Success!\n(But Rotated 90 Degrees)") figure_2 = ggplot(dat, aes(x=Percent, y=Category)) + geom_point(size=3) + facet_grid(Type1 ~ Type2, scales="free_y") + theme_bw() + scale...
[ -0.3706131875514984, -0.16721458733081818, 1.0284836292266846, 0.14921241998672485, 0.01955428160727024, -0.007079022005200386, -0.07324352115392685, -0.43110164999961853, -0.4412141442298889, -0.4277516305446625, -0.35367351770401, 0.3396182656288147, 0.1556650996208191, 0.310898274183273...
opts(title="Figure 2. Success!\n(But Dotplot Instead Of Barplot)") # Unexpected interaction between scales="free" and coord_flip()? figure_3 = ggplot(dat, aes(x=Category, y=Percent)) + geom_bar(width=0.8, stat="identity") + facet_grid(Type1 ~ Type2, scales="free") + theme_bw() + ...
[ -0.10422337800264359, -0.5479428172111511, 0.6649748086929321, -0.043349120765924454, 0.1628320813179016, 0.1556466519832611, 0.05300053581595421, -0.37661507725715637, -0.33980125188827515, -0.6383899450302124, -0.3356814980506897, 0.7221454381942749, -0.24828799068927765, -0.510677039623...
opts(title="Figure 3. Strange Y-axis Behavior.") ``` ![enter image description here](https://i.stack.imgur.com/uClu5.png) ![enter image description here](https://i.stack.imgur.com/uNpnJ.png) ![enter image description here](https://i.stack.imgur.com/xguLt.png)
[ 0.16153492033481598, -0.3334348499774933, 0.45004579424858093, -0.049383390694856644, 0.24732182919979095, 0.15577609837055206, -0.15749651193618774, 0.17996123433113098, -0.31706559658050537, -0.5634098052978516, -0.5409523844718933, 0.707154393196106, -0.48133647441864014, -0.29363918304...
I use SQLite3 and have a table called blobs that stores *content* and \*hash\_value\*. Here is the schema: ``` CREATE TABLE "blobs" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" blob, "hash_value" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL ); ``` Now I inserted som...
[ -0.16149164736270905, 0.36051350831985474, 0.3232572376728058, -0.1750277280807495, -0.09869367629289627, 0.10627167671918869, 0.24932241439819336, -0.3080124855041504, -0.14908434450626373, -0.5382634997367859, 0.09302912652492523, 0.3908791244029999, -0.44202953577041626, 0.1806207448244...
this down to a simple example where my hash is just `'abc'` and = works. I mean this string is hardly too long. ### EDIT Ok I actually narrowed it down to this: * I am using Ruby to generate the hash like this `Digest::MD5.hexdigest("foobar")` * This generates a string like this: `'3858f62230ac3c915f300c664312c63f'`...
[ 0.25701451301574707, 0.16881664097309113, 0.15476104617118835, -0.31913918256759644, -0.03212486952543259, -0.03713022172451019, 0.5458447933197021, -0.2765064537525177, -0.12072069942951202, -0.6595261096954346, 0.147553488612175, 0.6986866593360901, -0.36983340978622437, -0.0115725062787...
(0 for 1) ``` And I cannot query SQLite3 as stated above. **Solution** The solution is: * Instead of using Digest::MD5.hexdigest("foobar") use Digest::MD5.base64digest("foobar") I do not know why sqlite3 has problems with hexdigest but there definitively is something fishy about this. The difference between the t...
[ -0.14403095841407776, 0.168733149766922, 0.2652953267097473, -0.19828234612941742, -0.21902437508106232, 0.035223279148340225, 0.16233250498771667, -0.21469472348690033, -0.021501868963241577, -0.5653811693191528, -0.053239401429891586, 0.35143283009529114, -0.6232035756111145, 0.024332309...
in turn affects how sqlite3 does the comparison (although I don't understand exactly how). See also [this question](https://stackoverflow.com/questions/6575334/rails-saving-plain-old-string-to-sqlite-as-blob-im-about-to-lose-my-mind)
[ 0.0017781477654352784, 0.16645106673240662, 0.37458378076553345, -0.060176629573106766, -0.17733173072338104, -0.18108239769935608, 0.5091838836669922, 0.023040220141410828, -0.25150376558303833, -0.43149253726005554, 0.13699129223823547, 0.44150516390800476, -0.1431708037853241, 0.1159518...
Is it possible to assign time span to background-image of DIV ? Do you guys know if I can do it with jQuery or not ? I want first image to stay 20 seconds and second image to stay 5 seconds. So they should change each other. The difference between the two is encoding: ``` Digest::MD5.hexdigest("foobar").encoding #=>...
[ 0.08081859350204468, -0.19447429478168488, 0.2883477807044983, 0.047436390072107315, -0.0759778767824173, 0.032620154321193695, 0.08174306899309158, -0.2182745337486267, -0.1930839866399765, -0.5565878748893738, 0.12136876583099365, 0.40606793761253357, -0.24555228650569916, -0.19314205646...
value to the query as a blob, rather than as text. This in turn affects how sqlite3 does the comparison (although I don't understand exactly how). See also [this question](https://stackoverflow.com/questions/6575334/rails-saving-plain-old-string-to-sqlite-as-blob-im-about-to-lose-my-mind)
[ -0.016666512936353683, 0.20968128740787506, 0.4827232360839844, -0.1606116145849228, -0.25410524010658264, -0.015504909679293633, 0.286074697971344, 0.009016603231430054, -0.3518475890159607, -0.3528347611427307, -0.07074808329343796, 0.2954414486885071, -0.24395334720611572, 0.27643340826...
I'm going to go ahead and post my scary MySQL code: ``` INSERT INTO monthlystats (id, server, time, uptime, players, rank) VALUES (09126, 6, 0912, 302, 0, 1) ON DUPLICATE KEY UPDATE uptime = if(302 > uptime, 302, uptime), if(0 > players, 0, players), if(1 > rank, 1, rank) ``` Ok, so let me explain what I'm TRYING ...
[ 0.2624385952949524, 0.26478493213653564, 0.4950200617313385, 0.2383846640586853, 0.09516630321741104, -0.2749439775943756, 0.10064739733934402, -0.050446346402168274, -0.3029908835887909, -0.5633503794670105, 0.17920160293579102, 0.5252791047096252, -0.3615928292274475, 0.1611015796661377,...
table. It looks like I'm doing something terribly wrong, and I quite frankly have NO idea what to do. I tried making it good, but it turned out to be a horrible mess. I hope that somebody can lead me in the right direction, and help me learn (and anyone else that is trying to learn) how to do things like this. Thank ...
[ -0.057004690170288086, 0.30468639731407166, 0.7721440196037292, 0.1963270902633667, 0.4087291657924652, 0.04734556004405022, -0.09096987545490265, 0.02682606503367424, -0.4689091145992279, -0.650716245174408, -0.02336931601166725, 0.48877015709877014, -0.2357517033815384, 0.039009883999824...
players = GREATEST(players, VALUES(players)), rank = GREATEST(rank, VALUES(rank)) ```
[ -0.7504301071166992, 0.06772846728563309, 0.3481898307800293, -0.24984923005104065, -0.38961583375930786, -0.5826445817947388, 0.10999972373247147, -0.2506576478481293, -0.8443422913551331, -0.501038134098053, -0.15172816812992096, 0.46691179275512695, -0.22675888240337372, 0.1917306035757...
I'm trying to write a function that takes in a string, parses it, and returns another string that summarizes the number of consecutive alpha or numeric characters in the original string. For example, the string `999aa45bbx` would return `3N2A2N3A`, i.e. * 3 numbers, * followed by 2 alpha, * by 2 numbers, * by 3 alph...
[ 0.4970914125442505, 0.0803423672914505, 0.12377418577671051, 0.009376180358231068, 0.0732506513595581, 0.26649338006973267, -0.06018213927745819, -0.20057964324951172, -0.06844986975193024, -0.578202486038208, 0.24309515953063965, 0.543914258480072, -0.24480663239955902, 0.1608170568943023...
job * press [alt](/questions/tagged/alt "show questions tagged 'alt'")[f11](/questions/tagged/f11 "show questions tagged 'f11'") together to go the VBE * Insert Module * copy and paste the code below * press [alt](/questions/tagged/alt "show questions tagged 'alt'")[f11](/questions/tagged/f11 "show questions tagged 'f...
[ -0.18882369995117188, -0.02440945990383625, 0.7127223014831543, -0.3826405107975006, -0.2162424921989441, 0.41495585441589355, 0.10804754495620728, -0.4398207366466522, -0.16259868443012238, -0.454093337059021, -0.32182228565216064, 0.8632397651672363, -0.459600031375885, -0.27321130037307...
With objRegex .Global = True .ignorecase = True .Pattern = "[^\w]" If .test(strIn) Then AlphaNumeric = "One or more characters is invalid" Else .Pattern = "(\d+|[a-z]+)" Set objRegMC =
[ -0.2072620689868927, -0.09408000111579895, 0.24942709505558014, -0.1689232587814331, 0.003977099899202585, 0.3137933313846588, 0.35900384187698364, -0.2065507024526596, -0.20023532211780548, -0.46744397282600403, -0.3607906699180603, 0.21860693395137787, -0.6009576916694641, -0.10476350784...
.Execute(strIn) For Each objRegM In objRegMC strOut = strOut & (objRegM.Length & IIf(IsNumeric(objRegM), "N", "A")) Next AlphaNumeric = strOut End If End With End Function ```
[ -0.15994569659233093, 0.18891429901123047, 0.4065092206001282, -0.2005288004875183, 0.009856387972831726, 0.17497073113918304, 0.6234618425369263, -0.5902038216590881, -0.14330919086933136, -0.39138123393058777, -0.2802846431732178, 0.1991918534040451, -0.31641170382499695, 0.1127385422587...
I have a `DataTable` with column such as `# of Students` and would like to sort by this in descending order. Here is my code: ``` ... dt.Columns.Add(new DataColumn("# of Students", typeof(string))); // do some stuff... add records etc. // A runtime error occurs here: "Cannot find column '# of Students'" var rows = d...
[ 0.015102033503353596, 0.31639042496681213, 0.30635738372802734, 0.14018122851848602, 0.20367290079593658, 0.0380079410970211, 0.07114499807357788, -0.05760839954018593, -0.10229715704917908, -0.8084023594856262, -0.03529781475663185, 0.3550261855125427, 0.042016949504613876, 0.319966673851...
I'm setting up an app using FullCalendar (<http://arshaw.com/fullcalendar/>) that will allow the user to see client scheduling information as well as schedule clients through a management interface. I want to use a MySQL database to populate an array, and then pass that array in the form of a JSON feed to FullCalendar...
[ 0.25216835737228394, 0.14983370900154114, 0.5765789747238159, -0.1651812195777893, 0.1796797513961792, 0.07840517908334732, 0.14017648994922638, 0.1175919845700264, -0.22358232736587524, -0.8390247821807861, -0.24433521926403046, 0.5398644804954529, -0.41198986768722534, -0.076924018561840...
if this mistake turn out to be simple. I would deeply appreciate any help or insight on having these events show up. When I manually feed an array into FullCalendar, it does show the events, but so far my JSON feed has resulted in no information being displayed. Thank you For reference: HTML: ``` $(document...
[ 0.00991975236684084, -0.07513268291950226, 0.43434277176856995, -0.05699685215950012, 0.12486447393894196, -0.19784174859523773, 0.3736952245235443, 0.1250385195016861, -0.2738734483718872, -0.6175394058227539, -0.2797698974609375, 0.7231748104095459, -0.13124202191829681, -0.1587410122156...
while ($record = mysql_fetch_array($result)) { $event_array[] = array( 'id' => $record['id'], 'title' => $record['title'], 'start' => $record['start_date'], 'end' => $record['end_date'], 'allDay' => false );
[ 0.07389850169420242, -0.2367306351661682, 0.4439398944377899, -0.2687685787677765, 0.4932822287082672, -0.12855705618858337, 0.21507246792316437, 0.06931133568286896, -0.10048890113830566, -0.12278763949871063, -0.41833633184432983, 0.46429765224456787, -0.19374272227287292, 0.374365061521...
} echo json_encode($event_array); ``` So the problem, for those searchers that come after me, was that my PHP file had HTML head and body tags. I'm a PHP noob and so I didn't know that would cause it not to work. In order for FullCalendar to display the JSON feed, it must ONLY have PHP code, no HTML. JSONLint.com was...
[ 0.5275575518608093, 0.15845583379268646, 0.10875347256660461, -0.44207456707954407, 0.014999044127762318, -0.15708982944488525, 0.540416955947876, 0.11308898031711578, -0.2053220123052597, -0.26302599906921387, -0.0019985653925687075, 0.46452176570892334, -0.43339455127716064, -0.198766067...
I'm running a LAMP stack on a linode. The Ubuntu version is Lucid. When a PHP script executes a `mkdir()` or `move_uploaded_file` command, the newly created folder/file winds up being owned by a unix user 'Grusha'. I did create this user, but it should not be owning files. The web folder overall is owned by `www-data`...
[ 0.32231763005256653, 0.3526904881000519, 0.4237346947193146, -0.19408300518989563, -0.41901832818984985, -0.11984162032604218, 0.03234812244772911, -0.008560394868254662, 0.00963127426803112, -0.7096865177154541, -0.11947771161794662, 0.10982924699783325, -0.3515762984752655, 0.42768752574...
log in with a public key, and the user who that goes through is not Grusha (nor root). When I delete Grusha, I can no longer restart Apache. I get `bad username` and the restart fails. My PHP sessions also don't work. So in the end I add Grusha again and the server will start and everything works except that scripts...
[ 0.07536415010690689, 0.2059440016746521, 0.43786317110061646, -0.03778448328375816, -0.17009712755680084, -0.16170720756053925, 0.6497606635093689, 0.17023378610610962, -0.03333685174584389, -0.6967074871063232, -0.04752466455101967, 0.2410477250814438, -0.38140201568603516, 0.566653132438...
any suggestions I'd be grateful. Thanks a lot, Elliot So the problem, for those searchers that come after me, was that my PHP file had HTML head and body tags. I'm a PHP noob and so I didn't know that would cause it not to work. In order for FullCalendar to display the JSON feed, it must ONLY have PHP code, no HTML. ...
[ 0.5000208020210266, -0.047986894845962524, 0.3106091618537903, 0.1463608592748642, -0.26161837577819824, -0.022208508104085922, 0.45348313450813293, 0.1480904519557953, -0.17945490777492523, -0.42267778515815735, 0.2953636050224304, 0.2505951523780823, -0.14307983219623566, -0.064739421010...
I'm learning how to program for the first time, (with Ruby), because I want to eventually build a web application. I am understanding it well, and am halfway through 2 different tutorials, but have a major question... I have learned so much about objects, methods, strings, etc, but so far the tutorials I've gone throu...
[ 0.41450318694114685, 0.3438358008861542, 0.10030867159366608, 0.1428256332874298, -0.10780951380729675, -0.10100124776363373, 0.6181952953338623, 0.07534777373075485, -0.11415518820285797, -0.9295280575752258, 0.174627423286438, 0.3705590069293976, 0.002419432858005166, -0.1864869892597198...
to see the big picture here, and could really use some guidance. Am I crazy for wondering what is going on here?! It great that you have started learning Ruby! But Ruby in it self is simply a programming language. I think you wan't to check out Rails! <http://guides.rubyonrails.org/getting_started.html> Rails is wr...
[ 0.37032273411750793, -0.07258177548646927, -0.21864262223243713, 0.2720186710357666, -0.37483254075050354, -0.3656177520751953, 0.7720588445663452, 0.5588145852088928, -0.19203560054302216, -0.6257914304733276, 0.34294024109840393, 0.40084323287010193, 0.1726233810186386, -0.04521025717258...
I've written some code in C for converting strings passed from VBA, when the C code is called from VBA from a MacOSX dylib. I got some good hints [here](https://stackoverflow.com/questions/9919066/return-string-to-vba-in-macosx), and since I only care about ASCII strings I've written the following functions to convert ...
[ 0.055923379957675934, 0.12356505542993546, 0.5497609376907349, -0.26808443665504456, -0.03037664107978344, 0.23962530493736267, 0.32545796036720276, -0.3612487316131592, -0.26335662603378296, -0.4714256227016449, -0.1702149361371994, 0.5434513688087463, -0.41244328022003174, 0.169281169772...
i; for(i = 0; i < len; i++) { str[i] = (char) (((uint16_t*) vbstr)[i]); } str[i] = '\0'; asprintf(out, str); } int test(BSTR *arg1) { char* convarg; vbstochr(arg1, &convarg); return 1; } ``` The myheader.h looks like this: ``` typedef uint16_t OLECHAR; typedef OLECHAR * B...
[ -0.14986927807331085, 0.22965598106384277, 0.6274478435516357, -0.0764131247997284, 0.1042645126581192, 0.06371915340423584, 0.5156810879707336, -0.25898224115371704, -0.002709447406232357, -0.5132060050964355, -0.22922007739543915, 0.46810203790664673, -0.464811772108078, 0.32125848531723...
and it seems to work when called from Excel. So this works, but one thing I don't understand is why I have to multiply my `len` in the `vbstrlen` function by 2. I'm new to C, so I had to read up on pointers a little bit - and I thought since my BSTR contains 2 byte characters, I should get the right string length with...
[ 0.17344695329666138, 0.08263423293828964, 0.28234800696372986, -0.20450130105018616, -0.35585275292396545, 0.18649087846279144, 0.10361522436141968, 0.060972075909376144, -0.4948289394378662, -0.2887625992298126, 0.1346607208251953, 0.7144148349761963, -0.0020261923782527447, 0.01910507120...
after the first call. So when I call a function with a `BSTR*` argument from a dylib for the first time (after I start the application, Excel in this case), the `BSTR*` pointer just points at some (random?) address, but not the string. When I call the function from VBA a second time, everything works just fine - any id...
[ 0.13199685513973236, 0.3188461363315582, 0.44068625569343567, -0.17891709506511688, -0.25177329778671265, 0.10541883111000061, 0.19979071617126465, -0.11237961798906326, -0.14734938740730286, -0.6393452882766724, -0.22638937830924988, 0.43146243691444397, -0.3802761733531952, 0.23232409358...
1 byte. You coded your vbstrlen() function to return the number of bytes in the BSTR, not the number of characters. Since you are only interested in ASCII strings, you can simplify the code to the following: ``` #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include "myheader.h" size_t vbstrlen(BSTR...
[ 0.13754908740520477, -0.1339639276266098, 0.6877298355102539, -0.10308777540922165, -0.18649348616600037, 0.2883557379245758, 0.056460365653038025, -0.3579774498939514, -0.4946891665458679, -0.4382529854774475, -0.014130660332739353, 0.3542938530445099, -0.4143950939178467, 0.0765781477093...
str[i] = (char) vbstr[i]; asprintf(out, str); } ```
[ 0.2022838294506073, 0.2654743790626526, 0.39947929978370667, -0.622288703918457, 0.03574882075190544, 0.13435442745685577, 0.6431220769882202, -0.4311200976371765, -0.1123780906200409, -0.2595580816268921, -0.4012385606765747, 0.5514603853225708, -0.2531834840774536, 0.3762507736682892, ...
I have a problem where I need to redirect to another page and pass a value, which is easy and I know how to do, except that theres the old header problem: **Cannot modify header information - headers already sent by ... line 17** ``` <?php include('m_a2_functions.php'); ?> <?php global_header(LOGIN); ?> <?php login();...
[ -0.09885083884000778, 0.10415612906217575, 0.6027657389640808, -0.15546195209026337, 0.024030620232224464, 0.11048833280801773, 0.4636302590370178, -0.19707174599170685, -0.2836688756942749, -0.7037474513053894, -0.1898975521326065, 0.21304699778556824, -0.42143669724464417, 0.289101868867...
= mysql_fetch_array($result); $encrypted_pass = $row[0]; if (crypt($password, $encrypted_pass) == $encrypted_pass) { $flag = "y"; header('Location: m_a2_view.php?flag=y'); } } ?> <?php validation(); ?> <?php page_footer(); ?> ``` This is all fine, except that there is a problem with the ...
[ 0.08217966556549072, 0.15493908524513245, 0.8222815990447998, -0.26122862100601196, -0.020366687327623367, -0.06897750496864319, 0.3471558094024658, -0.832137405872345, -0.4019067883491516, -0.2823164761066437, -0.3635714054107666, 0.0031441114842891693, -0.06834479421377182, 0.02102896012...
- " . $page_title; ?></title> <link rel="stylesheet" href="style.css" /> </head> <body> <div id="container"> <div id="logo"></div> <?php } ?> ``` **LINE 17** ``` <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> ``` I know that's what is causing it. It loads global\_header at the sta...
[ 0.17181332409381866, 0.09302619844675064, 0.650252103805542, -0.18203216791152954, -0.08273500949144363, -0.18823550641536713, 0.40117743611335754, -0.46651846170425415, -0.29550445079803467, -0.6704290509223938, -0.2872580587863922, 0.24666859209537506, -0.4618530571460724, 0.409861743450...
reason you are having this issue is because your script is multiple open `<?php` and closing `?>` of `PHP` tag which has `space` and `new line` between them ... Replace ``` <?php include('m_a2_functions.php'); ?> <?php global_header(LOGIN); ?> <?php login(); ?> <?php ``` With ``` <?php include('m_a2_functions.p...
[ -0.19999445974826813, -0.01009207684546709, 0.48742929100990295, -0.05540775507688522, 0.27153849601745605, -0.06985399127006531, 0.424373596906662, -0.26891347765922546, -0.48029592633247375, -0.6000983119010925, -0.34118324518203735, 0.5035275220870972, -0.4160902500152588, 0.18730905652...
username = '$username'"; $result = mysql_query ( $query ) or die ( "There was an error executing the query $query:<br/>" . mysql_error () ); $row = mysql_fetch_array ( $result ); $encrypted_pass = $row [0]; if (crypt ( $password, $encrypted_pass ) == $encrypted_pass) { $flag...
[ -0.23664888739585876, -0.06671570986509323, 0.45894867181777954, -0.15368452668190002, 0.21812084317207336, 0.08553138375282288, 0.5392361283302307, -0.4091644585132599, -0.12323440611362457, -0.378752738237381, -0.3953339159488678, 0.11788598448038101, -0.2917424440383911, 0.2618921697139...
); } } else { echo global_header ( "LOGIN" ); login (); } validation (); page_footer (); function global_header($page_title) { $content = '<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/D...
[ 0.09913335740566254, -0.002408383646979928, 0.7174187898635864, -0.2998262047767639, -0.15277419984340668, -0.0028128414414823055, 0.2761880159378052, -0.5891743302345276, -0.3610362112522125, -0.13643428683280945, -0.692241907119751, 0.25299447774887085, -0.3566132187843323, 0.00428668269...
<link rel="stylesheet" href="style.css" /> </head> <body> <div id="container"> <div id="logo"></div>'; return $content; } ```
[ 0.579117476940155, 0.01977108232676983, 0.5419474840164185, 0.0033220755867660046, -0.15092062950134277, -0.19807562232017517, -0.03964763507246971, -0.1565016657114029, -0.1866103559732437, -0.664759635925293, -0.4417591989040375, 0.28436222672462463, -0.28370729088783264, 0.3164243698120...
**Why is all the input that is submit blank?** (see below). I believe this is due to an error in my JS file. HTML Form that is getting submitted: ``` <form method="post" id="FanDetail"> <textarea id="bio" name="fan_bio" cols="27" rows="3"></textarea><br /> ...
[ 0.6347350478172302, 0.06518072634935379, 0.27413931488990784, -0.3976409137248993, 0.02125963754951954, -0.03837931528687477, 0.06018466502428055, -0.35638487339019775, 0.05816774070262909, -0.7720763087272644, -0.00383529020473361, 0.39712005853652954, -0.25513648986816406, 0.093653783202...
name="fan_dob" value="(e.g. 01/05/1965)" onFocus="clearText(this)" /><br /> <div class="ui-widget"> <input id="zip" name="term" value="What is your Zipcode?" onFocus="clearText(this)" /><br /> <input id="actualZip" type="hidden" name="actua...
[ 0.0847272202372551, -0.2200881391763687, 0.737606406211853, -0.058354705572128296, 0.11414943635463715, -0.3448868989944458, -0.2002168893814087, -0.0848090648651123, -0.11702900379896164, -0.36774441599845886, -0.34113356471061707, 0.08845782279968262, -0.17649433016777039, 0.119292266666...
/> </div><!--ui-widget :: zip --> <div class="ui-widget"> <input id="occup" type="text" name="term2" value="e.g. Computer Programmer, etc" onFocus="clearText(this)" /><br />
[ -0.016321133822202682, 0.13923196494579315, 0.5071585178375244, -0.2035672664642334, 0.024034028872847557, -0.2555493116378784, -0.18430286645889282, -0.10818718373775482, 0.0036377152428030968, -0.5420470237731934, -0.7433518171310425, 0.25815799832344055, -0.06024479493498802, -0.0235175...