text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
Even though it is unique to the person, it is not personally identifying, unless you also were to release personally identifiable information along with it. For example, if you let people see only first names with a particular query, but also returned the artificial key, then they now know that artificial key 00003 is ...
[ 0.05554094538092613, 0.07190879434347153, 0.055518895387649536, 0.28057026863098145, 0.13008849322795868, -0.04470761865377426, 0.17644058167934418, -0.1118692085146904, -0.6934951543807983, -0.3590085804462433, 0.022714940831065178, -0.14234821498394012, -0.09230101853609085, 0.5246033072...
an unauthorized user to get the artifical key and PII returned in the same query, since that would then make the artifical key itself PII. that's my interpretation at least.
[ 0.21245674788951874, 0.012447242625057697, 0.2031228095293045, 0.19336581230163574, 0.03566472977399826, -0.04169417917728424, 0.1352272480726242, -0.1706230491399765, -0.008885683491826057, -0.03793133422732353, -0.048064082860946655, 0.3692997694015503, -0.18611633777618408, 0.1065604463...
``` Linking... Directory.obj : error LNK2019: unresolved external symbol "public: void __thiscall indexList<class entry,100>::read(class std::basic_istream<char,struct std::char_traits<char> > &)" (?read@?$indexList@Ventry@@$0GE@@@QAEXAAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) referenced in function _main ``...
[ -0.2117181122303009, 0.10844726115465164, 0.2601437270641327, -0.12400630116462708, -0.11498132348060608, -0.09308397769927979, 0.32226598262786865, -0.3692745566368103, -0.19293680787086487, -0.5365501642227173, -0.12831170856952667, 0.6009493470191956, -0.44727757573127747, 0.17721448838...
needed. For example, the following *probably* has a compile-time error in it if tried to call it: ``` template <typename T> void doSomething(const T& x) { x->_this_function_does_not_exist_ever_(); } ``` But as long as you don't call `doSomething` you won't get errors. The problem you have is that your header f...
[ 0.3063228726387024, 0.10867960751056671, 0.34336480498313904, -0.06518843024969101, 0.06358831375837326, -0.21157310903072357, 0.36412522196769714, -0.35718512535095215, -0.017216799780726433, -0.8108654022216797, -0.20116457343101501, 0.6695988178253174, -0.3248331844806671, 0.13555532693...
file.
[ 0.18541590869426727, 0.23327282071113586, 0.11664856225252151, 0.377433180809021, 0.4377826452255249, -0.2228066474199295, -0.14906209707260132, 0.14225329458713531, -0.13097406923770905, -0.3212955594062805, -0.5051196813583374, 0.1254396140575409, -0.24438773095607758, 0.2972111403942108...
Two related questions: 1. What are the maximum number of concurrent files that a web page is allowed to open (e.g., images, css files, etc)? I assume this value is different in different browsers (and maybe per file type). For example, I am pretty sure that javascript files can only be loaded one at a time (right?). 2...
[ 0.41689592599868774, 0.03287327662110329, 0.17692053318023682, 0.30210646986961365, -0.30972200632095337, -0.19780981540679932, -0.026889819651842117, 0.06998968869447708, -0.7084410190582275, -0.6804954409599304, 0.2783946394920349, 0.32668718695640564, -0.41589823365211487, 0.27945655584...
- not actually tried or tested. So please let me know if this doesn't work.
[ 0.5812011361122131, 0.09420429170131683, 0.15767571330070496, 0.7185845971107483, 0.022983374074101448, -0.11961258202791214, 0.6182865500450134, 0.22236518561840057, 0.2254505455493927, -0.20542334020137787, 0.22240161895751953, 0.06490049511194229, 0.1305321753025055, 0.37186989188194275...
My site works fine in Firefox, but it crashes in IE. I am using alot of jQuery in order to fade in content. When the user clicks on one of the above links a few times, it will crash in IE. Here is my site: [Idea Palette](http://www.idea-palette.com/) I have absolutely no idea why the site crashes in IE. I don't even...
[ 0.5931635499000549, 0.4371691346168518, -0.007694855332374573, -0.09965413063764572, -0.005283479578793049, -0.5363186597824097, 0.4463229477405548, 0.3344953954219818, -0.2093001753091812, -1.1644114255905151, 0.015656020492315292, 0.38320058584213257, -0.3025813698768616, 0.2383653521537...
something to do with your DirectX filter (probably what's doing the fades). Here's the stack, and EAX is NULL. Whatever the code is doing is trying to deref EAX: ``` CDXTFilterBehavior::_ClearSurface: 6C8E87E1 mov edi,edi 6C8E87E3 push ebp 6C8E87E4 mov ebp,esp 6C8E87E6 push ecx ...
[ 0.1813635379076004, 0.07084506005048752, 0.5408211350440979, -0.32283347845077515, -0.016263477504253387, -0.02403709851205349, 0.4693523049354553, -0.28115764260292053, -0.150052011013031, -0.5658785700798035, -0.25929924845695496, 0.6173552870750427, -0.654633641242981, -0.04930930212140...
ecx,dword ptr [eax] <--- EAX is NULL > dxtrans.dll!CDXTFilterBehavior::_ClearSurface() dxtrans.dll!CDXTFilterBehavior::_DrawUnfilteredElementLayers() dxtrans.dll!CDXTFilterBehavior::_DrawElementWithProceduralSurfaces() dxtrans.dll!CDXTFilterBehavior::_ExecuteFilterChain() dxtrans.dll!CD...
[ -0.12234152108430862, 0.00970770325511694, 0.8728405237197876, -0.11748720705509186, -0.22114698588848114, -0.10232794284820557, 0.02861843816936016, -0.7156346440315247, -0.3948771059513092, -0.4800103008747101, -0.5696961879730225, 0.5239788889884949, -0.36173608899116516, -0.05321445688...
mshtml.dll!CDispContainer::DrawSelf() mshtml.dll!CDispNode::Draw() mshtml.dll!CDispContainer::DrawChildren() mshtml.dll!CDispContainer::DrawSelf() mshtml.dll!CDispNode::Draw() mshtml.dll!CDispContainer::DrawChildren() mshtml.dll!CDispContainer::DrawSelf() mshtml.dll!CD...
[ -0.13598035275936127, -0.10650840401649475, 0.9900252819061279, -0.153011292219162, -0.28515976667404175, 0.026012646034359932, -0.14891403913497925, -0.1992882490158081, -0.30482056736946106, -0.7016194462776184, -0.842749834060669, 0.5423665642738342, -0.3246347904205322, -0.019549982622...
mshtml.dll!CDoc::OnPaint() mshtml.dll!CServer::OnWindowMessage() mshtml.dll!CDoc::OnWindowMessage() mshtml.dll!CServer::WndProc() user32.dll!_InternalCallWinProc@20() user32.dll!_UserCallWinProcCheckWow@32() user32.dll!_CallWindowProcAorW@24() user32.dll!_CallWindowPro...
[ -0.6526433825492859, 0.13185051083564758, 0.8193811178207397, -0.12323950231075287, -0.039726413786411285, 0.06379248201847076, 0.1720011830329895, -0.47609004378318787, -0.5290314555168152, -0.5525750517845154, -0.5461360812187195, 0.4751555621623993, -0.3489319980144501, 0.24256299436092...
user32.dll!_DispatchMessageWorker@8() user32.dll!_DispatchMessageW@4() ieframe.dll!CTabWindow::_TabWindowThreadProc() kernel32.dll!@BaseThreadInitThunk@12() ntdll.dll!___RtlUserThreadStart@8() ntdll.dll!__RtlUserThreadStart@8() ``` Perhaps you're removing an element from the DOM ...
[ -0.15997561812400818, -0.06979677081108093, 0.28984445333480835, -0.3105972409248352, 0.2509754002094269, -0.16386093199253082, 0.5440533757209778, -0.4213463068008423, -0.014878861606121063, -0.5479833483695984, -0.23035791516304016, 0.9354643225669861, -0.33093348145484924, 0.25195130705...
Using the Magento Ecommerce system, is is possible to remove an item from the Admin Panel Navigation menu? More generally, is there a way to use the config override system to *remove* existing elements from a configuration? I know I can add to the navigation with an override that looks something like this ``` <?xml v...
[ 0.1828988790512085, -0.024750884622335434, 0.751372754573822, 0.25775232911109924, 0.11840561777353287, -0.4281439185142517, -0.0728965699672699, -0.20076514780521393, -0.22194229066371918, -0.3490954637527466, -0.07333285361528397, 0.6447088122367859, -0.21560807526111603, -0.163445025682...
</version> </Company_Module> </modules> <adminhtml> <menu> <cms translate="title" module="cms"> <title>The CMS</title> <sort_order>70</sort_order> <children>
[ 0.07735174894332886, 0.28151389956474304, 0.5813765525817871, -0.20643092691898346, 0.1678285449743271, 0.27336254715919495, -0.3466547727584839, -0.2448928952217102, -0.34341734647750854, -0.5836032032966614, -0.8006722927093506, 0.1870313286781311, 0.05672624707221985, 0.0377681739628315...
<foo translate="title" module="cms"> <title>Foo Item</title> <action>adminhtml/foo</action> </foo> </children>
[ 0.01772494800388813, 0.16642290353775024, 0.2371845692396164, 0.03175384923815727, 0.12357868254184723, 0.10092165321111679, -0.048196956515312195, -0.3739607632160187, -0.11874352395534515, -0.3078775703907013, -0.6986558437347412, 0.3590649664402008, -0.08985856920480728, -0.019005330279...
</cms> </menu> </adminhtml> </config> ``` but how would/could I completely suppress the CMS navigation item? Cleaner way to do this: Add a **adminhtml.xml** (e.g. to an existing modules that keeps all other customization stuff, or create a new module) ``` <?xml version="1.0" ?> <config> <menu> ...
[ -0.05038677155971527, 0.1626698523759842, 0.8037865161895752, 0.05369238555431366, 0.016360275447368622, -0.20680934190750122, 0.1441786289215088, -0.36028605699539185, -0.20935143530368805, -0.8171747922897339, -0.29071301221847534, 0.5814502239227295, -0.489940881729126, -0.1122401580214...
Are there any code coverage tools for manual testing? For example, if I write 30 new lines of code, compile, then run, is there any way to quickly verify that all 30 lines were run? Also, later, after I've checked the code into an official build, is there any way that I can verify that the test department hit on all ...
[ 0.7630448937416077, 0.3032340705394745, 0.18625101447105408, 0.3616184592247009, -0.13774989545345306, 0.0734059065580368, 0.43321692943573, -0.21420425176620483, -0.22819791734218597, -0.514464795589447, 0.13940373063087463, 0.6711063385009766, -0.013349538668990135, -0.27262288331985474,...
of code. I'm most interested in .NET / C# tools. Check [Using Code Coverage with Manual Testing](http://blogs.msdn.com/marcalt/archive/2006/07/02/654157.aspx)
[ 0.41732677817344666, 0.25111275911331177, -0.2846123278141022, 0.19574733078479767, 0.07025203853845596, -0.26639968156814575, 0.4072243571281433, 0.2827499806880951, -0.41524454951286316, -0.59377121925354, -0.18312734365463257, 0.4570320248603821, 0.0008392049930989742, 0.048247385770082...
Every once in a while I'm editing some long pair of if-then-else statements (or worse, *nested* if-then-else statements) , like, say, this: ``` if A < B then begin DoSomething; DoSomethingElse; {...and more statements going on and on and on...} FinallyWrapUpThisBit; end else begin DoT...
[ -0.0628288984298706, 0.18289236724376678, 0.22264066338539124, -0.4320926368236542, -0.009080815128982067, 0.0891280472278595, 0.3996349573135376, -0.2594546675682068, -0.12679427862167358, -0.7206781506538391, -0.14863619208335876, 0.34619882702827454, -0.10809344053268433, 0.175792828202...
to bring up the lower "else" part (usually because I'm referring to something above the if-then statemnent. Maybe so it would just say "begin..." and have [+} sign to the left of it to expand it out again. I've explored the "fold" functions in the IDE, but none of the commands seem to do this. It seems like my CodeRus...
[ 0.25329864025115967, -0.11267600953578949, -0.11037975549697876, -0.10741523653268814, -0.07488573342561722, 0.139505997300148, 0.09284770488739014, 0.08651658147573471, -0.1142687276005745, -0.5447148680686951, -0.003798114135861397, 0.4548487663269043, 0.07767484337091446, -0.00859205331...
surround your begin...end with ``` {$region 'begin...end'} .... {$endregion} ``` which can be done through a code template... I remember Castalia for the nice colored visualization of code blocks (begin..end) but I don't remember if it was foldable.
[ 0.10385043174028397, -0.14883042871952057, 0.7094104290008545, -0.2054232507944107, -0.003968276083469391, -0.27985283732414246, -0.11820206046104431, -0.028211673721671104, -0.05142498388886452, -0.7252492904663086, 0.10354572534561157, 0.3429619073867798, -0.11968435347080231, 0.10143122...
How do I check if another application is busy? I have a program that sends text to a console. The text that I will send contains #13 char (e.g. `ls#13cd documents#13dir`). In other words I want to send many commands at one time and the console will process them one by one. I am sending the text character by character....
[ -0.012173019349575043, 0.22228527069091797, 0.34333300590515137, -0.19963470101356506, -0.24052470922470093, 0.2715079188346863, 0.3013923168182373, -0.012045186944305897, -0.06384634226560593, -0.7600929141044617, -0.1459759771823883, 0.36747997999191284, -0.24549229443073273, -0.12739485...
String; AHandle: Integer); var iWindow, iPoint, i: Integer; SPass: PChar; sList: TStringList; begin sList := TStringList.Create; ExtractStrings([#13],[' '],PChar(Str),sList); iWindow := AHandle;// AHandle is the handle of the console iPoint := ChildWindowFromPoint(iWindow, Point(50,50)); for i:=0 to sList...
[ -0.3667947053909302, -0.12480231374502182, 0.9050140380859375, -0.3304101526737213, 0.3428989350795746, 0.34469977021217346, 0.3819678723812103, -0.514611542224884, -0.008597669191658497, -0.40401092171669006, -0.3775748014450073, 0.34740930795669556, -0.14073537290096283, 0.19436436891555...
end; end; end; ``` I am using Delphi 7. If I interpret you question correctly you are sending the text to some sort of shell/command line interpreter and you want it to execute your commands. Usually command line interpreters output a certain prompt (like $ on a Linux system or C:\ for DOS) that indicate that they...
[ 0.24386531114578247, 0.08206939697265625, 0.40662631392478943, -0.3065631687641144, 0.014799512922763824, -0.31895914673805237, 0.42727750539779663, 0.16808825731277466, 0.20423714816570282, -0.7152346968650818, -0.43829235434532166, 1.010216236114502, -0.3633531630039215, -0.0041932202875...
Can anyone tell me why my redirect helper does not work the way I'd expect it to? I'm trying to redirect to the index method of my main controller, but it takes me `www.mysite.com/index/provider1/` when it should route to `www.mysite.com/provider1`. Does this make sense to anyone? I have index page in config set to bla...
[ -0.2438458651304245, 0.05670459568500519, 0.8276824355125427, 0.18416224420070648, 0.013397547416388988, -0.14362116158008575, 0.38536137342453003, 0.013829145580530167, -0.18499039113521576, -0.8326894044876099, -0.045316003262996674, 0.6460855007171631, -0.25673946738243103, 0.1578705757...
[L] php_flag display_errors On ``` redirect() ========== ### URL Helper --- The redirect statement in code igniter sends the user to the specified web page using a redirect header statement. This statement resides in the URL helper which is loaded in the following way: ``` $this->load->helper('url'); ``` The r...
[ -0.1281151920557022, -0.1504678726196289, 0.7956221103668213, -0.2546600103378296, 0.02922154776751995, 0.14894062280654907, 0.07961186021566391, -0.014298922382295132, 0.07742036134004593, -0.7461451292037964, -0.3952004313468933, 0.42550402879714966, -0.38520100712776184, 0.0604258812963...
FALSE) { redirect('/account/login', 'refresh'); } ```
[ 0.11848781257867813, 0.12063170969486237, 0.563051700592041, -0.26613640785217285, 0.349413126707077, -0.14055004715919495, 0.634961724281311, -0.16532683372497559, 0.029386144131422043, -0.3155350387096405, -0.5559123754501343, 0.7660354375839233, -0.2530830502510071, 0.4007349908351898, ...
**Question** I program in C (ANSI C89/ISO C90) in a \*n\*x environment on a regular basis. I am now in a position where it would be beneficial for me to learn a web-development language. In particular, I'm looking to learn a language which: 1. ...exploits my background as a C programmer. 2. ...can produce the level o...
[ 0.4422706067562103, 0.26317542791366577, 0.16181109845638275, 0.1275952011346817, 0.02137254737317562, 0.03992382809519768, 0.09950911998748779, 0.1086871549487114, -0.3024968206882477, -0.6006779670715332, 0.13769014179706573, 0.3997376263141632, -0.05079203471541405, -0.17579849064350128...
doing things on the client-side. I'm sorry if this was unclear. 3. I plan to use my knowledge of the language to develop a web-site which is stylistically similar to stackoverflow.com (with a very different concept, of course). If you already know C, Perl and Java then in all honesty you already know PHP, you just don'...
[ 0.6011712551116943, 0.10225927829742432, 0.14595136046409607, 0.005297188647091389, -0.09434095770120621, -0.19639800488948822, 0.049635179340839386, 0.12357205152511597, -0.29614362120628357, -0.4500621259212494, 0.22840042412281036, 0.5275235772132874, -0.038562946021556854, -0.298260897...
information I would suggest PHP for several reasons: * It's Web-centric; * It's extremely popular. Finding answers to problems is very easy; * It's very easy to learn (you already know C, Perl, and Java, but its easy even if you didn't) * As [Cal Henderson](http://en.wikipedia.org/wiki/Cal_Henderson) put it in his key...
[ 0.18253378570079803, 0.33548402786254883, 0.3137586712837219, 0.11891898512840271, -0.48726436495780945, -0.22871868312358856, 0.09890739619731903, 0.23447835445404053, -0.04459678754210472, -0.3258682191371918, 0.2843078076839447, 0.4944981336593628, -0.19766637682914734, 0.00753542361781...
first-class in Perl. Plus PHP doesn't have the $\_ operator but in spite of all that there are many similarities; * As a dynamic scripted language, it'll help you get out of the strongly-typed mould, which should make for a bit of a change and useful experience; * In spite of PHP supporting objects (I subscribe to the ...
[ 0.06494035571813583, -0.05288764461874962, 0.25721004605293274, -0.04388631507754326, -0.44010475277900696, -0.256322979927063, 0.2159786820411682, 0.24076522886753082, -0.24251912534236908, -0.17835551500320435, -0.08846918493509293, 0.5501766800880432, -0.2654333710670471, -0.16428604722...
compared to Java or ASP.NET hosting; and * There is something satisfying about just saving your text file and clicking reload on your browser to see what happens rather than having separate compile, build and deployment steps.
[ 0.38933083415031433, -0.11459141224622726, 0.16861456632614136, 0.2395966500043869, -0.1982223093509674, -0.36104902625083923, 0.021743914112448692, 0.18471553921699524, -0.35736697912216187, -0.8011429905891418, -0.18408305943012238, 0.4754164516925812, 0.3603365421295166, 0.0930939242243...
I have the following table schema: ``` create table SerialNo2( IncarnationID_UID counter primary key, Mark integer ); ``` Now I want to add a new column in the table, let's call it `degree`. Given that I want to apply an update on production table, I will have to populate the `degree` column based on the `Mark` valu...
[ -0.06330592930316925, 0.41588714718818665, 0.52655029296875, -0.38339516520500183, -0.15413439273834229, 0.1142975315451622, -0.10228470712900162, -0.2619147300720215, -0.36275845766067505, -0.6211171746253967, 0.00830777082592249, 0.3571069836616516, -0.1932402104139328, 0.370100051164627...
I'm using the SWFObject script (<http://blog.deconcept.com/swfobject>) to embedd a flash object into the following page: <http://parramatta.pjgallaghers.com.au/_flashvr/test> The flash is from an external supplier and I don't have a whole lot of control over it apart from the embed script. For some reason once the Fla...
[ 0.7530443668365479, 0.1430678367614746, 0.06505489349365234, -0.26217904686927795, 0.01337835006415844, -0.09169183671474457, 0.2810027599334717, 0.10180168598890305, -0.314255952835083, -0.36235618591308594, 0.10521867871284485, 0.40204739570617676, -0.23280952870845795, 0.002496455330401...
Firefox 3.1 beta 3, Internet Explorer 8, and Google Chrome 2 beta, and the menus work. What I've noticed is that my CPU usage (Core 2 Duo) shot up to 80% once your flash has completed loading. Your page source is quite hard to read, do you have a better indented one?
[ 0.17339569330215454, 0.23039694130420685, 0.34394371509552, -0.23467247188091278, -0.17067769169807434, 0.016514986753463745, 0.1193925216794014, -0.11660604923963547, -0.05806442350149155, -0.6520290374755859, 0.06268078088760376, 0.69474196434021, -0.45701849460601807, -0.454921752214431...
My app has a select box for users to choose a "venue". This select box is, as you would expect, in a form. I also have an action somewhere on the page that creates a new venue via AJAX. After the new venue is created, I would like to updated the venue select box to reflect this. My solution was to put the select box i...
[ 0.32230842113494873, -0.148188978433609, 0.6074748039245605, 0.03814353048801422, 0.004934912547469139, 0.10598822683095932, -0.2684793472290039, 0.021121712401509285, -0.11084392666816711, -0.8988742828369141, -0.05162862315773964, 0.267412930727005, -0.1803867220878601, 0.165972128510475...
:id, :name, :prompt => 'Select a venue' %> ``` where f is the form reference: ``` <% form_for :shows do |f| %> ``` The problem is that f is undefined in the partial, so I get an error. One solution would be to include the entire form, but I feel like that should not be necessary because I am not updating the entir...
[ 0.26471471786499023, 0.056342098861932755, 0.7505987286567688, -0.027909202501177788, -0.20827889442443848, -0.058608926832675934, -0.24427010118961334, -0.2755340337753296, 0.015806270763278008, -0.5818927884101868, -0.08454566448926926, 0.2792026102542877, -0.40935415029525757, 0.2865974...
:name, { :prompt => 'Select one of your previous venues' } %> ``` Then my VenueController is as follows: ``` class VenueController < ApplicationController layout 'main' before_filter :login_required, :get_user def create begin venue = @user.venues.create(params[:venue]) @user_venues = @user.ve...
[ -0.26725339889526367, 0.08168376237154007, 0.7373637557029724, -0.07978305220603943, 0.07986043393611908, -0.029799841344356537, 0.007153208367526531, -0.3581351041793823, -0.4038815200328827, -0.48970696330070496, -0.36973169445991516, 0.5292986035346985, -0.0016400158638134599, 0.1379255...
end end ``` If this method is bad practice for any reason, please let me know and I will happily credit you for the answer.
[ 0.8687177300453186, 0.5262434482574463, 0.6035699248313904, 0.292901873588562, 0.20696017146110535, -0.6389344334602356, 0.4332948625087738, -0.0015205556992441416, 0.5221700072288513, -0.7842767238616943, -0.35976117849349976, 0.49375054240226746, -0.011136087588965893, 0.1451466828584671...
We have to create few tables for the sole purpose of reporting in Oracle. Option 1 **Receivable Table** * RefNo * Date * TrnType eg:Tax, Fee, Premium * Amount Option 2 **Receivable Table** * RefNo * Date * Tax * Fee * Premium Note: For a given RefNo all types Tax, Fee and Premium or a sub set of them can exist. ...
[ 0.35917794704437256, -0.0398818701505661, 0.5049454569816589, 0.23955294489860535, -0.2164108008146286, 0.02785058692097664, -0.17564210295677185, -0.3935486376285553, -0.1361946016550064, -0.41723892092704773, -0.2765433192253113, 0.653205156326294, 0.16578945517539978, -0.006693131756037...
Amount ``` If RefNo/Date is the primary key, add date to the second table as well. This allows you to minimize storage space for those rows that don't have all three types (although savings is minimal). Then you use `WHERE` clauses combining the two tables (or `JOIN`s) to do your queries. It also allows you to add ...
[ 0.3986883759498596, 0.1422426402568817, 0.4575824439525604, -0.03530419245362282, 0.05913878604769707, -0.15776146948337555, -0.12594233453273773, -0.3561612665653229, -0.4842253625392914, -0.5373548865318298, -0.0755906030535698, 0.4643028676509857, -0.014625449664890766, 0.23063641786575...
you think you're going to be adding more types in the near future, I'd go for your option 2 and use zeros for those values that don't exist. NULLs would most likely make your queries a little more complicated.
[ 0.48744115233421326, -0.09440670907497406, -0.2726704180240631, 0.3345542848110199, -0.110337033867836, 0.07929442077875137, 0.1876564770936966, 0.283439040184021, -0.11849577724933624, -0.5204577445983887, 0.27841368317604065, 0.29278087615966797, -0.574675977230072, 0.31490910053253174, ...
I'm learning about Events / Delegates in C#. Could I ask your opinion on the naming/coding style I've chosen (taken from the Head First C# book)? Am teaching a friend about this tomorrow, and am trying to come up with the most elegant way of explaining the concepts. (thought the best way to understand a subject is to ...
[ 0.3596108555793762, -0.31669971346855164, 0.10902214050292969, 0.4033292233943939, 0.22912247478961945, -0.26895570755004883, -0.0035225285682827234, 0.27487707138061523, -0.12867067754268646, -0.7086717486381531, -0.09871949255466461, 0.5831525325775146, -0.19877725839614868, 0.1713360697...
make sure the EventHandler delegate is ready Metronome metronome = new Metronome(); // wires up the metronome_Tick method to the EventHandler delegate Listener listener = new Listener(metronome); metronome.OnTick(); } } ``` --- ``` public class Metronome ...
[ -0.04195979982614517, -0.5802578926086426, 0.35274484753608704, 0.3753856122493744, 0.215737447142601, -0.01567203365266323, -0.09671084582805634, -0.40956929326057434, -0.3071213364601135, -0.7372713685035706, -0.1573910117149353, 0.5195189118385315, -0.14035546779632568, 0.27105200290679...
// so every time Tick is called, the runtime calls another method // in this case Listener.metronome_Tick public event EventHandler Tick; public void OnTick() { while (true) {
[ 0.5843718647956848, -0.5072944760322571, -0.12007097154855728, -0.1382869929075241, 0.028145909309387207, 0.06505870074033737, 0.3326302170753479, -0.24035409092903137, -0.16992072761058807, -0.12431499361991882, 0.17546191811561584, 0.562670886516571, -0.34291666746139526, 0.3102521002292...
Thread.Sleep(2000); // because using EventHandler delegate, need to include the sending object and eventargs // although we are not using them Tick(this, EventArgs.Empty); } } } ``` --- ``` public class Listener {
[ 0.16423535346984863, -0.057023677974939346, -0.1683080643415451, -0.41739919781684875, -0.05259456858038902, -0.2733893096446991, 0.1735507994890213, -0.1550164669752121, -0.22068017721176147, -0.5371321439743042, 0.12257043272256851, 0.5237279534339905, -0.4407331049442291, 0.324457168579...
public Listener(Metronome metronome) { metronome.Tick += new EventHandler(metronome_Tick); } private void metronome_Tick(object sender, EventArgs e) { Console.WriteLine("Heard it"); } } ``` n.b. Code is refactored from <http://www.codeproject.com/KB...
[ 0.04613368213176727, -0.30254900455474854, 0.3350811004638672, 0.011923272162675858, -0.050680290907621384, 0.17743654549121857, 0.30703070759773254, 0.012377948500216007, -0.2059561312198639, -0.6043899655342102, 0.171498641371727, 0.5673320293426514, -0.2759489417076111, 0.38868796825408...
seem to be named correctly. Semantically, "OnTick" tells me it will be called when it "Tick"s, but that isn't really what's happening. I would call it "Go" instead. The typically accepted model, however would be to do the following. `OnTick` is a virtual method that raises the event. This way, you can override the def...
[ 0.15856873989105225, -0.5613863468170166, 0.267941951751709, 0.03551734238862991, 0.08045011013746262, -0.061062637716531754, -0.008971747010946274, -0.14120347797870636, -0.3648841381072998, -0.27778708934783936, -0.0544869638979435, 0.5413588285446167, -0.35619083046913147, 0.23665544390...
for an explanation of this) var tickEvent = Tick; if(tickEvent != null) tickEvent(this, e); } public void Go() { while(true) { Thread.Sleep(2000); OnTick(EventArgs.Empty); //Raises the Tick event
[ 0.29856523871421814, -0.44472911953926086, 0.08674278855323792, -0.2566782832145691, 0.20815320312976837, -0.01671779341995716, 0.37182509899139404, -0.21181431412696838, -0.3744252026081085, -0.5621803998947144, 0.13238154351711273, 0.4718674123287201, -0.22099138796329498, 0.503326714038...
} } } ``` --- Also, I know this is a simple example, but if there are no listeners attached, your code will throw on `Tick(this, EventArgs.Empty)`. You should at least include a null guard to check for listeners: ``` if(Tick != null) Tick(this, EventArgs.Empty); ``` However, this is still vulnerable in a ...
[ -0.03602133318781853, -0.0028050721157342196, 0.10315193235874176, -0.2277698516845703, -0.08071696013212204, -0.10968650132417679, 0.4555510878562927, -0.25660988688468933, 0.06117192283272743, -0.533778727054596, -0.24939841032028198, 0.6905555129051208, -0.3594963848590851, 0.2339058518...
still gathering upvotes, here's the C# 6 way of doing things. The whole "guard" concept can be replaced with a conditional method call and the compiler does indeed do the Right Thing(TM) in regards to capturing the listeners: ``` Tick?.Invoke(this, EventArgs.Empty); ```
[ 0.330835223197937, -0.22340545058250427, 0.16859573125839233, 0.10159430652856827, -0.2532253563404083, -0.13171382248401642, 0.46356192231178284, -0.5736467838287354, -0.1388774812221527, -0.16042524576187134, -0.08679748326539993, 0.8770985007286072, -0.16703954339027405, -0.313277631998...
I want to know what roles a logged in user belongs to without having to check the user against all possible roles (i.e. using Page.User.IsInRole()) [`using System.Web.Security;`](http://msdn.microsoft.com/en-us/library/system.web.security.aspx) ``` Roles.GetRolesForUser() ``` Or `Roles.GetRolesForUser(String)` if ...
[ 0.4515836834907532, -0.2007514238357544, 0.6427605748176575, 0.02360173873603344, 0.27513736486434937, -0.14371876418590546, 0.15085938572883606, 0.11676958203315735, -0.18870724737644196, -0.8180487751960754, -0.24563318490982056, 0.39035701751708984, -0.16878652572631836, 0.1049279421567...
In the medical domain, a patient has a ton of exams (HbA1C, Lipid, Renal, etc..) and they all basically follow the format of ExamX(ID, ID\_Patient, Date, Value) But you can go from many tables to one by using SuperExam(ID, ID\_Patient, ExamType, Date, Value) One note, value would not be discrete in the second table. ...
[ 0.46757158637046814, 0.02102433331310749, 0.25904610753059387, 0.22940923273563385, -0.032587576657533646, 0.05542275309562683, 0.050672125071287155, -0.18550227582454681, -0.09802639484405518, -0.8660981059074402, 0.25148046016693115, 0.2417922466993332, 0.14366860687732697, 0.33471301198...
to change the db schema, but it seems like reporting would be a nightmare. Which is the better design? In all likelihood you're going to have to take the EAV approach (as described in another answer) and create a data dictionary. You would then not only be storing the specific data for an exam, but you would also have...
[ 0.5645942687988281, 0.2730843126773834, -0.010449282824993134, 0.23700813949108124, -0.23765705525875092, -0.3031699061393738, 0.18360090255737305, -0.35556668043136597, -0.006492511369287968, -0.26323503255844116, 0.10736896097660065, 0.6392225027084351, -0.3580806255340576, -0.0017483881...
as much as it might seem--but it's worth it in the long run if you intend for this medical system to be scalable and maintainable. Do not store multiple values in one column. Ever. For any reason. Here's a quick example... ``` exam: exam id, date, patient id, ...other miscellaneous scalar data thats...
[ 0.327320396900177, 0.21494849026203156, 0.4609305262565613, 0.12034264206886292, 0.36167851090431213, 0.01474018581211567, -0.16675086319446564, -0.11713672429323196, -0.16162197291851044, -0.7560490965843201, 0.18371719121932983, 0.4395104944705963, -0.11973967403173447, 0.388406753540039...
value id, description group: group id, description group value: group value id, group id, value id, sort order ``` Again, very basic and rudimentary, but it hopefully gives you a glimpse into what I'm talking about. You may want to take it a step further and define specific exam types th...
[ 0.2215641289949417, 0.08093877136707306, -0.023185409605503082, 0.3342854678630829, -0.044686075299978256, 0.007967822253704071, -0.1737058311700821, -0.19645485281944275, -0.08592572063207626, -0.6941235661506653, 0.1345883309841156, 0.3241654336452484, 0.044920776039361954, -0.1844382286...
I am trying to keep my [Ajax](http://en.wikipedia.org/wiki/Ajax_%28programming%29) call from posting back to the server when using [Prototype](http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework). ### Code: ``` echo " <a href='my.php?action=show&amp;id=".$fid."' onclick=\"return display('".$fid."');\"> "; ...
[ 0.32865190505981445, 0.20580030977725983, 0.2604621946811676, -0.45299968123435974, -0.13693124055862427, 0.04909959435462952, 0.8010237812995911, -0.37522947788238525, 0.040101271122694016, -0.5720838308334351, -0.019418591633439064, 0.301424503326416, -0.39727112650871277, 0.097005821764...
I am creating an iPhone game. I want to have a button in my game that takes people to the other games by me. I get the URL from the iTunes (copy URL) like this: <http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=307450671> But when I open this URL in iphone, it take me to the iTunes, not App Store. and ...
[ 0.282970130443573, 0.1318484991788864, 0.37966829538345337, -0.06618542969226837, 0.10143724083900452, 0.2807222306728363, 0.1477632373571396, 0.1079966276884079, -0.3427984416484833, -0.6676799654960632, -0.12051532417535782, 0.6791871190071106, -0.2075246125459671, -0.06972193717956543, ...
I am writing a directory scanner in .NET. For each File/Dir I need the following info. ``` class Info { public bool IsDirectory; public string Path; public DateTime ModifiedDate; public DateTime CreatedDate; } ``` I have this function: ``` static List<Info> Recursive...
[ 0.3184273838996887, -0.1783144772052765, 0.7443168759346008, -0.3317752480506897, 0.073753722012043, -0.07231981307268143, 0.22666004300117493, -0.2409963458776474, 0.009299035184085369, -0.7308757901191711, -0.025827493518590927, 0.6960633397102356, -0.2386694997549057, 0.1627783626317978...
= new DirectoryInfo(path); foreach (var dir in dirInfo.GetDirectories()) { info.Add(new Info() { IsDirectory = true, CreatedDate = dir.CreationTimeUtc, ModifiedDate = dir.LastWriteTimeUtc, Path
[ 0.2596929371356964, -0.42656055092811584, 0.7674024701118469, -0.2830469012260437, 0.3704982101917267, 0.10157626122236252, 0.3426702618598938, -0.24223452806472778, 0.03663359582424164, -0.8006304502487183, -0.17244164645671844, 0.7559467554092407, -0.25296130776405334, 0.2888243794441223...
= dir.FullName }); info.AddRange(RecursiveMovieFolderScan(dir.FullName)); } foreach (var file in dirInfo.GetFiles()) { info.Add(new Info() { IsDirectory = false,
[ -0.05176443234086037, -0.4209502041339874, 0.6395131349563599, -0.3630715012550354, 0.3750482201576233, 0.12575866281986237, 0.3818226158618927, -0.339620441198349, 0.24779976904392242, -0.4785890281200409, -0.31298863887786865, 0.934956967830658, -0.3738689422607422, 0.0593721978366375, ...
CreatedDate = file.CreationTimeUtc, ModifiedDate = file.LastWriteTimeUtc, Path = file.FullName }); } return info; } ``` Turns out this implementation is quite slow. Is there any way to speed this up? I'm thinking of hand coding this with FindFirstFileW
[ 0.4519291818141937, -0.24210703372955322, 0.47903329133987427, -0.13948611915111542, 0.18133606016635895, -0.23733076453208923, 0.3975636661052704, -0.08088088780641556, 0.12881465256214142, -0.9775864481925964, 0.08737893402576447, 0.4168442189693451, -0.17155329883098602, 0.2828706204891...
but would like to avoid that if there is a built in way that is faster. This implementation, which needs a bit of tweaking is 5-10X faster. ``` static List<Info> RecursiveScan2(string directory) { IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); WIN32_FIND_DATAW findData; IntPtr findHandle = ...
[ -0.16737282276153564, -0.1953042596578598, 0.4336201250553131, -0.14397871494293213, 0.31723272800445557, -0.1533033698797226, 0.22695371508598328, -0.4880370795726776, -0.2509189248085022, -0.6042413711547852, -0.13613229990005493, 0.6544906497001648, -0.37469881772994995, -0.069238871335...
= FindFirstFileW(directory + @"\*", out findData); if (findHandle != INVALID_HANDLE_VALUE) { do { if (findData.cFileName == "." || findData.cFileName == "..") continue; string fullpath = directory + (directory.EndsWith("\\") ? "" : "\\") + findData.c...
[ -0.09319596737623215, -0.44074273109436035, 1.0896012783050537, -0.47145238518714905, 0.7126674056053162, -0.00048117642290890217, 0.5746974349021912, -0.03723885864019394, -0.02358875796198845, -0.27818620204925537, -0.4334549009799957, 0.7606521844863892, -0.30888471007347107, 0.09131333...
bool isDir = false; if ((findData.dwFileAttributes & FileAttributes.Directory) != 0) { isDir = true; info.AddRange(RecursiveScan2(fullpath));
[ -0.11608773469924927, -0.3410460650920868, 0.5636827349662781, -0.4488573372364044, 0.6019034385681152, -0.0998089611530304, 0.6794745922088623, -0.24037380516529083, 0.11220231652259827, -0.3289996385574341, -0.33507856726646423, 0.8207826018333435, -0.4570305347442627, -0.091134138405323...
} info.Add(new Info() { CreatedDate = findData.ftCreationTime.ToDateTime(),
[ 0.39141184091567993, -0.6756101846694946, 0.6011949777603149, -0.05562664195895195, 0.6581364274024963, 0.1107785776257515, 0.17176663875579834, 0.0035829211119562387, -0.13741633296012878, -0.740877628326416, -0.11293617635965347, 0.41761937737464905, -0.3992631733417511, 0.13207486271858...
ModifiedDate = findData.ftLastWriteTime.ToDateTime(), IsDirectory = isDir, Path = fullpath }); }
[ -0.05649822950363159, -0.7643505334854126, 0.6834753155708313, -0.3418416678905487, 0.26097792387008667, 0.25492510199546814, 0.7407444715499878, -0.3323412239551544, 0.12655232846736908, -0.8196966052055359, -0.05994497612118721, 0.4492591321468353, -0.41189274191856384, 0.102854825556278...
while (FindNextFile(findHandle, out findData)); } } finally { if (findHandle != INVALID_HANDLE_VALUE) FindClose(findHandle); } return info; } ``` extension method: ``` public static class FILETIMEExtensions { public static DateTime ToDateTime(this System....
[ -0.11416251957416534, -0.42088887095451355, 0.6962832808494568, -0.17723703384399414, 0.5757449269294739, -0.06580293923616409, 0.07589178532361984, -0.05488310381770134, -0.07466070353984833, -0.5709428191184998, -0.47002121806144714, 0.5752313733100891, -0.3345043361186981, 0.29846984148...
long highBits = filetime.dwHighDateTime; highBits = highBits << 32; return DateTime.FromFileTimeUtc(highBits + (long)filetime.dwLowDateTime); } } ``` interop defs are: ``` [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] public static extern Int...
[ -0.3319585919380188, -0.4161486029624939, 0.876448392868042, -0.2828618884086609, 0.35729244351387024, 0.004673692863434553, 0.06622228026390076, -0.44254329800605774, 0.03125358372926712, -0.22095105051994324, -0.7501538395881653, 0.8056254386901855, -0.3874496519565582, 0.263973981142044...
[DllImport("kernel32.dll")] public static extern bool FindClose(IntPtr hFindFile); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct WIN32_FIND_DATAW { public FileAttributes dwFileAttributes; internal System.Runtime.InteropServices.ComTypes.FILETIME ftCreationTi...
[ -0.3585267961025238, -0.42516323924064636, 0.7362831234931946, -0.14623217284679413, 0.489050030708313, 0.11229145526885986, 0.3209930658340454, -0.10959693044424057, -0.28385433554649353, -0.8726102113723755, -0.6879333853721619, 0.7471498847007751, -0.365587443113327, 0.08836518228054047...
public int dwReserved1; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string cFileName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] public string cAlternateFileName; } ```
[ 0.3253380358219147, 0.2384861260652542, 0.2774670124053955, -0.19617007672786713, 0.49606162309646606, 0.1775938868522644, 0.5178536176681519, -0.3897624611854553, 0.05535995960235596, -0.4795577824115753, -0.14731404185295105, 0.7888671159744263, -0.24880284070968628, 0.2209678590297699, ...
Does anyone know why there is some hesitation when you hold down a keyboard key and try to process it? I'm calling a function right in my WinProc(...) that will move an image on the screen (OpenGL) when a key is held down. I press it and get a single response, then there is about .5 seconds of nothing, then it behaves ...
[ -0.02420208603143692, -0.058971796184778214, 0.5709937810897827, -0.009605440311133862, -0.09643969684839249, 0.2608872056007385, 0.1598920226097107, -0.24363267421722412, -0.5068444609642029, -0.6791620254516602, -0.10945430397987366, 0.5089373588562012, -0.34088876843452454, -0.145170792...
bool quit = false; MSG msg; createWindow(hinstance, SCRW, SCRH, SCRD, WINDOWED); // Main loop while (!quit) { if (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) { if (msg.message == WM_QUIT) quit = true;
[ 0.05389850214123726, -0.3894808888435364, 0.09630043059587479, -0.35299983620643616, 0.21428804099559784, -0.10040359944105148, 0.8463965654373169, -0.07880933582782745, -0.055021848529577255, -0.12160690128803253, -0.5100757479667664, 0.625598132610321, -0.7338535189628601, 0.106165610253...
TranslateMessage(&msg); DispatchMessage(&msg); } renderFrame(); // processes graphics SwapBuffers(hdc); } return msg.lParam; } ``` and WinProc (there were more cases but same thing...): ``` LRESULT CALLBACK WinProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa...
[ -0.21621012687683105, -0.2771022617816925, 0.61830073595047, -0.14515936374664307, 0.036397770047187805, 0.0808086097240448, 0.1241975650191307, -0.2017296403646469, 0.07614234834909439, -0.8262680172920227, -0.3060215711593628, 0.7754755020141602, -0.4401271641254425, 0.061151497066020966...
{ case WM_KEYDOWN: switch ( wparam ) { case VK_RIGHT: key_RIGHT();
[ -0.2197214663028717, -0.316792756319046, 0.14834347367286682, -0.24114800989627838, 0.5652592182159424, -0.08816118538379669, 0.154328852891922, -0.3519323766231537, -0.08049488812685013, -0.2316388338804245, -0.5846850872039795, 0.8489464521408081, -0.05604449287056923, 0.2280798256397247...
return 0; } return 0; } } ``` and key\_RIGHT: ``` void key_RIGHT() { MoveObjectRight1Pixel(); } ``` It's a rather standard keyboard setting to have a small delay between when the key was pressed and when repeat messages get generated. Instead of processing keyboard input in your...
[ -0.137703537940979, -0.1602245718240738, 0.5524782538414001, -0.29877448081970215, 0.22972457110881805, 0.0346953421831131, 0.21507111191749573, -0.20601999759674072, -0.3359995484352112, -0.3111598789691925, -0.18230731785297394, 0.508089005947113, -0.152182936668396, 0.16915768384933472,...
the current state of the keyboard. When you receive a `WM_KEYDOWN` or `WM_KEYUP`, you update the bit of the corresponding key. Then, in your main loop, you check the current state of the key and the previous state of the key (by keeping a second array of 256 bits that you make a copy to every frame). If the key is cur...
[ -0.30188071727752686, -0.3309737741947174, 0.832430899143219, -0.006095344200730324, 0.3796621263027191, 0.15443585813045502, 0.26776444911956787, -0.1297639012336731, -0.4391516447067261, -0.6214444637298584, -0.45939329266548157, 0.5296014547348022, 0.007060061674565077, 0.16783806681632...
Since arguments sent to a method in Java point to the original data structures in the caller method, did its designers intend for them to used for returning multiple values, as is the norm in other languages like C ? Or is this a hazardous misuse of Java's general property that variables are pointers ? A long time ago...
[ 0.06914471834897995, 0.1130288615822792, -0.017060404643416405, -0.06999901682138443, -0.279878705739975, -0.040214791893959045, 0.13704520463943481, -0.34159061312675476, -0.47820723056793213, -0.10251186788082123, 0.36549505591392517, 0.5676355957984924, -0.6204886436462402, -0.078182280...
like: ``` x, y = foo(); ``` The recommended way of doing it back then, and now, is to make a class that has multiple data members and return that instead. Based on that, and other comments made by people who worked on Java, I would say the intent is/was that you return an instance of a class rather than modify the ...
[ -0.043621428310871124, 0.14037419855594635, -0.20384447276592255, -0.1848323792219162, -0.30518290400505066, -0.1467849612236023, 0.33507174253463745, -0.023823589086532593, -0.12404551357030869, -0.3522718846797943, -0.06675425916910172, 0.585146963596344, -0.50596022605896, 0.19338929653...
I am reading a file and generating two > arrays, of type String and int from > it, picking one element for both from > each line. I want to return both of > them to any function which calls it > which a file to split this way. I think, if I am understanding you correctly, tht I would probably do soemthing like th...
[ 0.3267640769481659, -0.22600822150707245, 0.11647603660821915, -0.17353922128677368, -0.007048783823847771, 0.15739062428474426, -0.027111338451504707, -0.42184317111968994, 0.016398699954152107, -0.804580807685852, -0.10624241828918457, 0.43571141362190247, -0.3321518003940582, 0.10830646...
final String stringVal; public Line(final int iVal, final String sVal) { intVal = iVal; stringVal = sVal; } public int getIntVal() { return (intVal); } public String getStringVal() { return (stringVal); } // equals/hashCode/etc... as appropr...
[ -0.41992253065109253, -0.36208847165107727, 1.0304372310638428, -0.32831475138664246, 0.05428219586610794, 0.23612967133522034, 0.2755219340324402, -0.3808539807796478, 0.03550027683377266, -0.620145320892334, -0.5385319590568542, 0.701099157333374, 0.12483415752649307, 0.16002346575260162...
method like this: ``` public void foo(final File file, final List<Line> lines) { // add to the List. } ``` and then call it like this: ``` { final List<Line> lines; lines = new ArrayList<Line>(); foo(file, lines); } ```
[ -0.13061834871768951, -0.3510698974132538, 0.5755203366279602, -0.23157605528831482, 0.036868866533041, 0.07313798367977142, 0.12107494473457336, -0.2796376347541809, -0.058064404875040054, -0.42851489782333374, -0.2353512942790985, 0.3342520296573639, -0.5839486122131348, 0.19593656063079...
I;m trying yo implement a javacript function which will not allow to the user to input anything else than float numbers (digits) This is my approach but I don't know how to improve it in order to allow submition of negatives numbers also (allow '-' key) and work on IE also. ``` function digits_only(evt, form) { ...
[ -0.016907624900341034, -0.04527781158685684, 0.3977188766002655, -0.2672780454158783, -0.11349356174468994, 0.11181176453828812, 0.39046165347099304, -0.3555524945259094, 0.027708273380994797, -0.5597304701805115, -0.04702203720808029, 0.62128746509552, -0.3874949514865875, -0.192198619246...
isValid = true; if (charCode > 13) { isValid = /[0-9.]/.test(keyChar); //if a dolt is already in input if (keyChar === '.' && /\./.test(targ.value)) { isValid = false; } } return isValid; } ``` I think you are looking for so called "input masks". They are a lot m...
[ -0.07335928082466125, -0.33702754974365234, 0.36924421787261963, -0.32614874839782715, 0.15567632019519806, 0.19407452642917633, 0.6217450499534607, -0.539978563785553, 0.016251925379037857, -1.0560972690582275, -0.2238820642232895, 0.5078101754188538, -0.13764390349388123, -0.248962923884...
just allowing numbers. But you can surly use them for that. Google "javascript input mask" or check out [this jQuery Plugin](http://digitalbush.com/projects/masked-input-plugin/). EDIT: Seems like the linked plugin only supports fixed length masks, but the term may be a good starting point...
[ 0.16930274665355682, -0.2704105079174042, 0.18697862327098846, 0.1928127259016037, -0.14900369942188263, -0.3587101101875305, 0.3938279449939728, 0.05712639167904854, -0.2104511857032776, -0.558589518070221, -0.15287144482135773, 0.5247300267219543, -0.32381588220596313, -0.434116244316101...
I am currently working with using Bezier curves and surfaces to draw the famous Utah teapot. Using Bezier patches of 16 control points, I have been able to draw the teapot and display it using a 'world to camera' function which gives the ability to rotate the resulting teapot, and am currently using an orthographic pro...
[ 0.27432137727737427, 0.16411252319812775, 0.33664876222610474, 0.17889395356178284, 0.11401002109050751, 0.3394029140472412, -0.034491587430238724, -0.20479370653629303, -0.2442665696144104, -0.6097528338432312, 0.3469942808151245, 0.012178693898022175, -0.05617937818169594, 0.495367974042...
3D xyz vertex returned from the 'world to camera' function, and convert this into a 2D coordinate. I am wanting to use the projection plane at z=0, and allow the user to determine the focal length and image size using the arrow keys on the keyboard. I am programming this in java and have all of the input event handler...
[ 0.2439543455839157, 0.16426271200180054, 0.5700437426567078, -0.23227183520793915, -0.3242838382720947, -0.12913335859775543, -0.11114911735057831, -0.08336946368217468, 0.18369868397712708, -0.7756258249282837, 0.11385215818881989, 0.35196489095687866, -0.36712536215782166, 0.204840645194...
represent 2D/3D transformations nowadays is by using **homogeneous coordinates**. *[x,y,w]* for 2D, and *[x,y,z,w]* for 3D. Since you have three axes in 3D as well as translation, that information fits perfectly in a 4x4 transformation matrix. I will use column-major matrix notation in this explanation. All matrices ar...
[ 0.007043056655675173, 0.1512584537267685, 0.5684207081794739, -0.12806247174739838, -0.1023441031575203, 0.32113412022590637, 0.02591034211218357, -0.33349186182022095, -0.28601300716400146, -0.7552522420883179, 0.04548416659235954, 0.30482006072998047, -0.14484941959381104, 0.107625931501...
you don't want to translate normals. The matrix you transform normals with must be *isotropic*; scaling and shearing makes the normals malformed. 2. Transform the point with a clip space matrix. This matrix scales x and y with the field-of-view and aspect ratio, scales z by the near and far clipping planes, and plugs t...
[ 0.2874641716480255, -0.2915598452091217, 0.3002912104129791, -0.046183571219444275, -0.16230656206607819, 0.32405704259872437, -0.1553168147802353, -0.44772130250930786, 0.027442604303359985, -0.7678768038749695, 0.043547023087739944, 0.5860190987586975, -0.2691343426704407, 0.039868969470...
clipping** is the most widespread clipping algorithm in use. 4. Transform x and y with respect to w and the half-width and half-height. Your x and y coordinates are now in viewport coordinates. w is discarded, but 1/w and z is usually saved because 1/w is required to do perspective-correct interpolation across the poly...
[ 0.1392398178577423, -0.08408505469560623, 0.8369964361190796, 0.07096410542726517, -0.07094720751047134, 0.259872704744339, -0.32182416319847107, -0.32529589533805847, -0.32158035039901733, -0.7352219820022583, -0.03863825276494026, 0.5145195126533508, 0.042745016515254974, -0.243586018681...
*angle* must match. Notice that the result reaches infinity as *angle* nears 180 degrees. This is a singularity, as it is impossible to have a focal point that wide. If you want numerical stability, keep *angle* less or equal to 179 degrees. ``` fov = 1.0 / tan(angle/2.0) ``` Also notice that 1.0 / tan(45) = 1. Some...
[ 0.21962431073188782, -0.08582938462495804, 0.6033098697662354, -0.36091282963752747, -0.028529323637485504, -0.04027757793664932, -0.08857238292694092, -0.21992923319339752, -0.05751176178455353, -0.457680881023407, 0.05552002415060997, 0.8064730167388916, 0.0894472673535347, 0.09365454316...
and far planes without treating it as a special case. ### Calculation of the clip matrix This is the layout of the clip matrix. *aspectRatio* is Width/Height. So the FOV for the x component is scaled based on FOV for y. Far and near are coefficients which are the distances for the near and far clipping planes. ``` [...
[ 0.056888580322265625, -0.09018166363239288, 0.890323281288147, 0.09601274877786636, -0.1434965580701828, 0.04608256369829178, -0.5372800827026367, -0.485957533121109, -0.2255246788263321, -0.4438435733318329, 0.08543987572193146, 0.9688630700111389, -0.08681847155094147, -0.173057019710540...
0 ] [ 0 ][ fov ][ 0 ][ 0 ] [ 0 ][
[ -0.2635023891925812, -0.037080295383930206, 0.2863612473011017, -0.5060751438140869, -0.29847216606140137, -0.025955721735954285, 0.05381861329078674, -0.2349880039691925, -0.03930416703224182, 0.098975270986557, -0.4414603114128113, 0.42539942264556885, -0.39553630352020264, 0.07391449809...
0 ][(far+near)/(far-near) ][ 1 ] [ 0 ][ 0 ][(2*near*far)/(near-far)][ 0 ] ``` ### Screen Projection After clipping, this is the final transformation to get our screen coordinates. ``` new_x = (x * Width ) / (2.0 * w) + halfWidth; new_y = (y *
[ 0.2826991677284241, -0.012054483406245708, 1.0233373641967773, -0.2584678828716278, 0.3743404150009155, -0.03545832261443138, 0.011684521101415157, -0.26782622933387756, 0.09523922204971313, -0.8284922242164612, -0.06688864529132843, 0.4031775891780853, 0.08396714925765991, 0.1684414446353...
Height) / (2.0 * w) + halfHeight; ``` Trivial example implementation in C++ ------------------------------------- ```cpp #include <vector> #include <cmath> #include <stdexcept> #include <algorithm> struct Vector { Vector() : x(0),y(0),z(0),w(1){} Vector(float a, float b, float c) : x(a),y(b),z(c),w(1){} ...
[ -0.082842618227005, -0.2126626968383789, 0.7552302479743958, 0.039539884775877, -0.048265065997838974, 0.2054561823606491, -0.09048404544591904, -0.6651508212089539, -0.2804594337940216, -0.3892204463481903, -0.20237590372562408, 0.6344952583312988, -0.0294520054012537, -0.0103957680985331...
float mag = Length(); if(mag < epsilon){ std::out_of_range e(""); throw e; } return *this / mag; } }; inline float Dot(const Vector& v1, const Vector& v2) { return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; } class Matrix { public: Matrix() : data(16) {
[ 0.19306190311908722, -0.17353729903697968, 0.6727145910263062, -0.06941104680299759, -0.10138938575983047, 0.4376029372215271, 0.148821622133255, -0.9201582074165344, -0.1288614273071289, -0.3368310332298279, -0.1624811738729477, 0.7045198082923889, -0.41834861040115356, -0.055476833134889...
Identity(); } void Identity() { std::fill(data.begin(), data.end(), float(0)); data[0] = data[5] = data[10] = data[15] = 1.0f; } float& operator[](size_t index) { if(index >= 16){ std::out_of_range e(""); throw e;
[ 0.0214366652071476, -0.22932875156402588, 0.38173267245292664, -0.271406352519989, 0.3872784376144409, 0.09339098632335663, 0.13164018094539642, -0.6144236922264099, 0.1881566196680069, -0.27174440026283264, -0.4786902964115143, 0.7343966364860535, -0.180792897939682, -0.06430239975452423,...
} return data[index]; } Matrix operator*(const Matrix& m) const { Matrix dst; int col; for(int y=0; y<4; ++y){ col = y*4; for(int x=0; x<4; ++x){
[ -0.3470737934112549, -0.3639366328716278, 0.6832370162010193, -0.15691830217838287, 0.04747996851801872, 0.3006390333175659, 0.17364643514156342, -0.4692836403846741, -0.02373236045241356, -0.16683419048786163, -0.5017108917236328, 0.5570552945137024, -0.49774500727653503, -0.0546552315354...
for(int i=0; i<4; ++i){ dst[x+col] += m[i+col]*data[x+i*4]; } } } return dst; } Matrix& operator*=(const Matrix& m) { *this = (*this) * m;
[ -0.3284832239151001, -0.45829641819000244, 0.7229140400886536, -0.3091985881328583, 0.17465105652809143, 0.11854194849729538, 0.2712867259979248, -0.6076244711875916, -0.00971720926463604, -0.35472193360328674, -0.4984362721443176, 0.5971730947494507, -0.6031102538108826, -0.11542104929685...