text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
developers banging out copy and paste code. EDIT: Alright, so the consensus is that PHP is the monkey-wrench of web programmers. I can accept that. I was just looking for a insight, but I guess I already had it. I certainly do appreciate mod\_php/libphp for instance. And I was able to get my application out the door ...
[ 0.35145264863967896, 0.31087160110473633, 0.05710063874721527, 0.10193648189306259, -0.4152339696884155, -0.16561570763587952, 0.2400451898574829, 0.18129929900169373, -0.3612229526042938, -0.6037035584449768, 0.08435316383838654, 0.7578733563423157, -0.18068692088127136, -0.09545210003852...
couple of unique PHP-specific features > thrown in. The goal of the language is > to allow web developers to write > dynamically generated pages quickly. In other words, there isn't really a design philosophy: It's a mix and mash of ideas to get a job done (obviously inherited from Perl, hehe).
[ 0.16655662655830383, -0.020759178325533867, 0.15574941039085388, 0.2701679766178131, -0.4485117495059967, -0.2778642475605011, 0.17390833795070648, 0.18498781323432922, -0.08003825694322586, -0.4989610016345978, 0.03596004471182823, 0.3372557759284973, -0.39409059286117554, -0.131611481308...
Let's say I have a javascript method that takes a little to long to finish to go without any user feedback at all. In my case it's sorting the rows in a table element (all in the DOM; only takes too long if there are a *lot* of rows), but it might do anything. I want to show the "progress" cursor while it runs. Here is...
[ 0.10993313789367676, 0.11220689117908478, 0.5049622654914856, -0.019498107954859734, -0.12063705176115036, 0.020720001310110092, 0.20148371160030365, -0.46817177534103394, -0.1859351396560669, -0.8713739514350891, -0.07940275222063065, 0.457650363445282, -0.054234813898801804, -0.167613089...
it's thing correctly, but the cursor never changes. My thought is that the browser needs to wait for the method to return to be able to handle the cursor change message generated by the windowing environment, but that may be way off and even if it's true I don't know how to fix it. Any other ideas? --- [edit]: I dec...
[ 0.06884240359067917, 0.0353689044713974, 0.6399598121643066, 0.10743275284767151, 0.1898733377456665, -0.052723582834005356, 0.4498787522315979, -0.062417276203632355, -0.33096566796302795, -0.39615610241889954, 0.009213362820446491, 0.7346367239952087, 0.13944962620735168, 0.0424463041126...
keep the function declared right there- it's just like adding an inline scope block. Interestingly, on Firefox I discovered that this means I don't need to change the cursor at all. I found that after I added the setTimeout call I was sometimes seeing a wait cursor show up before the progress cursor was set, so I comm...
[ 0.15191413462162018, -0.18583469092845917, 0.8075021505355835, -0.24185630679130554, -0.08940175175666809, -0.10101421177387238, 0.26769834756851196, -0.13277730345726013, -0.2392456829547882, -0.4526383578777313, -0.018556056544184685, 0.8360920548439026, -0.5580950379371643, 0.1047022417...
did put the cursor code back. This lends credence to my belief that a cursor change is the appropriate action here — given the opportunity it's what the browser will do anyway. I really don't want to have to add and remove new items (like a busy image of some type) into the DOM for a page that I know very little about...
[ 0.11282321065664291, -0.11011668294668198, 0.8264610767364502, 0.0016879079630598426, -0.2441878318786621, -0.1933547854423523, 0.3066597580909729, -0.29085350036621094, -0.16685797274112701, -0.43675655126571655, 0.20939183235168457, 0.6317145228385925, -0.07074464112520218, -0.1020932197...
to accomplish. So their javascript engine really is faster. I can't wait for the Firefox 3.1 engine. Unfortunately people here are still mostly using IE6. Is using a timer out of the question? ``` document.body.style.cursor = "progress"; setTimeout(function() { SortTable(cell.cellIndex, dir, sortType); docume...
[ 0.30459165573120117, 0.1447605937719345, 0.5266104936599731, -0.2741639018058777, 0.3805248439311981, -0.07899084687232971, 0.4716612994670868, -0.6433525681495667, -0.3055855333805084, -0.8448389172554016, -0.0749506726861, 0.6481223106384277, -0.3659819960594177, -0.1514204889535904, 0...
I have a command line EXE written in C#. It's log parser that grinds through several GB worth of log files every night. It pegs the processor at 100% for quite a while. Not ideal. How could I "throttle" the app? It can take as long as it wants, but I'd rather have it use less of the total CPU. Is there some coding m...
[ 0.13517464697360992, 0.008371748961508274, 0.5028733611106873, 0.09722838550806046, 0.06556510180234909, 0.16624604165554047, 0.4806402623653412, 0.22631652653217316, 0.05280918627977371, -0.5095362663269043, -0.10664589703083038, 0.6289044618606567, -0.26488804817199707, -0.03787653520703...
itself. You can set the priority of the threads using the [`Thread.Priority`](http://msdn.microsoft.com/en-us/library/system.threading.thread.priority.aspx) property. Of course, if there's nothing else trying to run that will still use 100% CPU - but I guess in that case you don't mind so much. Does your application ...
[ 0.0043607973493635654, -0.2543252408504486, 0.32146191596984863, 0.21764236688613892, -0.11902999132871628, 0.0979437455534935, 0.01323020737618208, 0.07151594758033752, -0.4228718876838684, -0.669067919254303, 0.06410545855760574, 0.2954982817173004, -0.16719724237918854, 0.29915899038314...
Why do I get a 400 - bad request error using the following URL? It is encoded using Server.UrlEncode. The actual `path` query parameter is `C:\Development\Chase\Exports\ChaseExport-090312073930.zip` ``` http://localhost:50199/Common/Forms/Export_Stream.aspx%3fpath%3dC%3a%5CDevelopment%5CChase%5CExports%5CChaseExport-0...
[ -0.09526470303535461, 0.3454166054725647, 0.5133918523788452, 0.09255494922399521, -0.04973843693733215, -0.07014939188957214, 0.4735904335975647, -0.2697409987449646, 0.06943850964307785, -0.5477611422538757, 0.09671209752559662, 0.09794984757900238, -0.2544344365596771, 0.191178157925605...
I'm having a problem with an ad-hoc query that manages a fairly high amount of data. Upon executing the query, the status immediately goes into suspended state. It will stay suspended for around 25 minutes and then complete execution. I have a mirror environment with SQL2K and the same query executes in around 2 minut...
[ 0.05450845882296562, 0.3134356141090393, 0.39312872290611267, 0.14699825644493103, -0.022982552647590637, -0.31183311343193054, 0.4963637888431549, 0.1905345916748047, -0.42025697231292725, -0.20878030359745026, -0.22065803408622742, 0.22777359187602997, -0.1905636489391327, 0.284847110509...
but better to rebuild indexes at the same time. Or, you don't have any. Are stats set to create and update automatically? I've seen cases where they're switched off because someone does not understand what they are for or how updates happen. Note: the sampling rate of stats is based on the last stats update. So if yo...
[ 0.4652799665927887, -0.2726985514163971, 0.2027871012687683, 0.3681541085243225, -0.01565116085112095, 0.005391583312302828, 0.4357098937034607, -0.14529456198215485, -0.3530186116695404, -0.7468964457511902, 0.3232026696205139, 0.3041273057460785, -0.22881612181663513, -0.0286307688802480...
I am trying to clean up some data, and I would eventually like to put it in CSV form. I have used some regular expressions to clean it up, but I'm stuck on one step. I would like to replace all but every third newline (\n) with a comma. The data looks like this: ``` field1 field2 field3 field1 field2 field3 ``` e...
[ 0.12974445521831512, 0.1584860384464264, 0.28958702087402344, -0.21610957384109497, -0.18113557994365692, 0.07601435482501984, 0.5034061074256897, -0.18243668973445892, -0.06204460933804512, -0.5982591509819031, -0.1764213740825653, 0.20085351169109344, -0.3192279040813446, 0.2725472748279...
yourData.txt ``` This script saves the last three lines and print them at every third line. Unfortunately, this works only with files having a multiple of 3 lines. A more general script is: ``` awk '{l=l$0;if(NR%3==0){print l;l=""}else{l=l","}}END{if(l!=""){print substr(l,1,length(l)-1)}}' yourData.txt ``` In thi...
[ 0.06364722549915314, -0.14994162321090698, 0.7553335428237915, -0.39079737663269043, 0.10113934427499771, 0.39567819237709045, 0.21538054943084717, 0.1862245500087738, -0.0867631658911705, -0.6990675330162048, -0.33333513140678406, 0.6152923703193665, -0.42947083711624146, -0.3419084548950...
I can flatten the results of a child collection within a collection with SelectMany: ``` // a list of Foos, a Foo contains a List of Bars var source = new List<Foo>() { ... }; var q = source.SelectMany(foo => foo.Bar) .Select(bar => bar.barId) .ToList(); ``` this gives me the list of all Bar Ids in the Foo...
[ 0.1346764862537384, 0.21752965450286865, 0.5792818665504456, -0.32572439312934875, 0.12989038228988647, 0.32424503564834595, 0.19300569593906403, -0.7155370116233826, -0.05595020577311516, -0.6409345865249634, -0.12888239324092865, 0.656393826007843, -0.3372619152069092, 0.2547679245471954...
be using SelectMany to get the list of all Widgets in all Bars in my list of Foos? **Edit** I miss-worded the above sentence, but the code reflects the goal. I am looking for a list of all Widget Ids, not widgets. An "incorrect" result is not all of the widget ids are returned. Your query is returning all the widget ...
[ 0.2916721999645233, 0.2940722703933716, 0.494783490896225, -0.2025485336780548, 0.012656777165830135, 0.028869712725281715, 0.20676289498806, -0.28589531779289246, -0.08989331871271133, -0.6998339891433716, 0.11368158459663391, 0.585342288017273, -0.522052526473999, 0.20352177321910858, ...
.ToList(); ``` If that's still giving "the incorrect result" please explain in what *way* it's the incorrect result. Sample code would be very helpful :) EDIT: Okay, if you want the widget IDs, your original code should be fine: ``` var q = source.SelectMany(foo => foo.Bar) .SelectMany(bar => bar.Widg...
[ 0.3247201144695282, 0.1008504182100296, 0.6413833498954773, -0.2786683440208435, 0.27489590644836426, -0.22258880734443665, 0.3178790211677551, -0.4601668417453766, -0.21658647060394287, -0.4513499140739441, -0.1213468536734581, 0.7288577556610107, -0.5413164496421814, -0.01774068176746368...
in source from bar in foo.Bar from widget in bar.Widget select widgetId).ToList(); ``` if you like query expression format. This really should work - if it's *not* working, that suggests there's something wrong with your data. We should have checked before - is this just LINQ to Objects, ...
[ 0.4241390824317932, 0.15604184567928314, 0.6440607905387878, -0.12654946744441986, -0.04781684651970863, -0.24877874553203583, 0.03924547880887985, -0.19339558482170105, 0.034143656492233276, -0.45239049196243286, -0.18639269471168518, 0.553764820098877, -0.3838179409503937, -0.04057013615...
Is there any good way of combining ASP.NET Windows Authentication with a custom IPrincipal/IIdentity object? I need to store the user's email address and have done so for Forms Authentication using a custom IIdentity/IPrincipal pair that I added to the Context.CurrentUser during the AuthenticateRequest event. How wou...
[ -0.1974574476480484, 0.16970527172088623, 0.40687695145606995, 0.1504085510969162, 0.10465057939291, -0.23616673052310944, 0.3036730885505676, 0.03113316185772419, -0.12448962777853012, -0.634174108505249, -0.03254115954041481, 0.4056287705898285, -0.16033895313739777, 0.03534586355090141,...
The following code ``` import types class A: class D: pass class C: pass for d in dir(A): if type(eval('A.'+d)) is types.ClassType: print d ``` outputs ``` C D ``` How do I get it to output in the order in which these classes were defined in the code? I.e. ``` D C ``` Is the...
[ -0.29695940017700195, -0.05367239564657211, 0.23474882543087006, 0.010918250307440758, -0.27810046076774597, 0.08122725039720535, 0.2464904934167862, -0.2778933644294739, -0.05517810955643654, -0.7715693712234497, -0.3635108172893524, 0.3884378671646118, -0.37591689825057983, 0.05074702948...
defined. ``` >>> import inspect >>> import StringIO >>> inspect.findsource(StringIO.StringIO)[1] 41 >>> ``` The `findsource` function actually searches trough the source file and looks for likely candidates if it is given a class-object. Given a method-, function-, traceback-, frame-, or code-object, it simply look...
[ -0.10226528346538544, -0.2502202093601227, 0.10526800900697708, 0.07155545055866241, 0.34184184670448303, -0.17618238925933838, -0.1649816334247589, -0.22772599756717682, 0.14700768887996674, -0.8194041848182678, -0.30733323097229004, 0.39341625571250916, -0.10398440808057785, -0.230139404...
I'm wondering how one would go about redirecting the stdin of a script from the current xterm session i.e. /dev/pts/0 to one that is also running i.e /dev/pts/1 using bash? I have a bash script that opens 3 xterm windows and I want to get input from only one of those windows and I cannot figure out how to do it. Any he...
[ 0.4198256731033325, 0.25921568274497986, 0.33424878120422363, -0.02146582119166851, -0.2878122627735138, -0.2045319825410843, 0.3677314817905426, -0.0287131629884243, -0.29498589038848877, -0.8461618423461914, 0.022854626178741455, 0.8522493839263916, -0.1679215431213379, 0.057647716253995...
script will open 3 xterminals, lets say: /dev/pts/0, /dev/pts/1, and /dev/pts/2. These 3 new ptys are what the user is going to see. The script asks the user for some input and I want the input of the user to be typed into /dev/pty/1 and the program should get it's info from there. However I've tried to do this and it ...
[ 0.3123774230480194, 0.09378232806921005, 0.5055912137031555, 0.0442952997982502, 0.07266244292259216, 0.06473066657781601, 0.31595659255981445, 0.02222561649978161, 0.12739016115665436, -0.7426018714904785, -0.10411090403795242, 0.49777090549468994, -0.3437088131904602, 0.07566496729850769...
*) echo "y/n only!";; esac ``` The case statement at the end is just a little placeholder to see if the input actually worked. I suspect this is not possible. AFAIK, without modifying something in kernel space, it's impossible to read the input from a tty (or pty) that is not the current tty. Even root can't do it. I...
[ 0.2725735604763031, 0.1638789176940918, 0.02566869556903839, -0.14619868993759155, 0.10018715262413025, -0.15290527045726776, 0.6192585229873657, 0.28855860233306885, -0.20790833234786987, -0.31034693121910095, -0.26877957582473755, 0.650927722454071, -0.31624364852905273, 0.07893031835556...
Given (in C++) ``` char * byte_sequence; size_t byte_sequence_length; char * buffer; size_t N; ``` Assuming `byte_sequence` and `byte_sequence_length` are initialized to some arbitrary length sequence of bytes (and its length), and `buffer` is initialized to point to `N * byte_sequence_length` bytes, what would be t...
[ -0.007663788739591837, -0.04073037579655647, 0.307508647441864, -0.38267815113067627, 0.04516780748963356, -0.01237823348492384, 0.1375398188829422, -0.1832369863986969, 0.013651736080646515, -0.33507683873176575, -0.153005912899971, 0.7608344554901123, -0.2810637652873993, -0.125977605581...
you are dealing with binary data and are keeping track of the length, not using `'\0'` termination. If you want these to be c-strings you'll have to allocate an extra byte and add in the `'\0'` a the end. Given a c-string and an integer, you'd want to do it like this: ``` char *RepeatN(char *source, size_t n) { a...
[ 0.2162327617406845, -0.2249760627746582, 0.15112903714179993, -0.15444108843803406, -0.005730057135224342, 0.009378696791827679, 0.26875102519989014, -0.32015249133110046, -0.27187037467956543, -0.14489921927452087, -0.08616345375776291, 0.6688046455383301, -0.20489786565303802, 0.30795130...
(int i=0; i < n; ++i) memcpy(buffer + i * length, source, length); buffer[n * length] = '\0'; } ```
[ -0.06807895004749298, 0.021674634888768196, 0.5426971316337585, -0.326602041721344, 0.2555084526538849, 0.17302146553993225, 0.41738420724868774, -0.2954123318195343, -0.13062860071659088, -0.37380996346473694, -0.2942226529121399, 0.46085497736930847, -0.25774914026260376, 0.2379289567470...
I recently had my mind expanded by a new concept: [Web Services for Remote Portlets](http://en.wikipedia.org/wiki/Web_Services_for_Remote_Portlets), or WSRP. I learned of it during a presentation on a Java-based web portal we are considering purchasing at work; we are a .NET shop and WSRP would be the means by which we...
[ 0.2711344361305237, -0.09653481096029282, 0.38741135597229004, -0.29336017370224, -0.2623065412044525, -0.09464448690414429, 0.014553961344063282, 0.22401827573776245, -0.4099903702735901, -0.6584976315498352, -0.15714524686336517, 0.1758558303117752, -0.2023877650499344, 0.471574366092681...
the SO community, the following: what libraries or frameworks are out there for building WSRP-compliant portlets in C#/.NET? What are some of the pros and cons of using WSRP in general? Because there is no correct answer here, I will make this a community wiki post. So far, I have only found the following: * [WSRP ...
[ 0.5438178777694702, -0.206989586353302, 0.49911850690841675, -0.11015201359987259, -0.5559107661247253, -0.5107124447822571, 0.19722820818424225, -0.14510135352611542, -0.07824753224849701, -0.5348725318908691, -0.3475185036659241, -0.0029689643997699022, -0.31967100501060486, 0.2933250665...
the WSRP spec carefully, you'll find it is a remote version of the Java Portlet Specification (if I'm spelling that right). That means that it's useful for integrating Java Portlets. Anything else will have to look like a Java Portlet, which is not very generic.
[ 0.14367997646331787, -0.14537470042705536, 0.20932850241661072, -0.09572970122098923, -0.12120158225297928, -0.5216630101203918, 0.3923710584640503, -0.13111531734466553, -0.0352754071354866, -0.6242589354515076, 0.0017572680953890085, 0.36392655968666077, -0.31920602917671204, 0.164248615...
I know that C++ has the concept of objects but C doesn't. I also know that pretty much all there is to know about C fits into [K & R](https://rads.stackoverflow.com/amzn/click/com/0131103628) but the C++ library is vastly more complex. There have got to be other big differences though. What are the major differences b...
[ 0.14934663474559784, 0.2725059390068054, -0.020399225875735283, -0.050071731209754944, -0.5837299823760986, -0.09665632992982864, 0.2164297103881836, -0.23924383521080017, -0.31420817971229553, -0.42677828669548035, -0.1627257615327835, 0.42232680320739746, -0.1521068662405014, -0.02857375...
of programming styles than C. > C++ is "a better C" in the sense that > it supports the styles of programming > done using C with better type checking > and more notational support (without > loss of efficiency). In the same > sense, ANSI C is a better C than K&R > C. In addition, C++ supports data > abstractio...
[ 0.1649523377418518, 0.08445131033658981, 0.1475246399641037, 0.15761275589466095, -0.43476107716560364, -0.3602032959461212, 0.11850758641958237, -0.04582132771611214, -0.28266432881355286, -0.7833797931671143, -0.08095058798789978, 0.6614705920219421, -0.369413286447525, -0.27698707580566...
I need to provide our clients with a dump of a single sub directory in our SVN repository along with the revision history if possible. I know that you can do a dump but I don't believe you can tell it to isolate a single sub directory in the repo. If I export i'll only get the head or a single revision, this is not wha...
[ 0.44527575373649597, 0.002216561697423458, 0.33616626262664795, 0.09142698347568512, -0.266842782497406, 0.025955118238925934, 0.23725071549415588, -0.11007905751466751, -0.4766920506954193, -0.4617737829685211, 0.14474813640117645, 0.6896679401397705, -0.24215012788772583, 0.3226320743560...
caveat. I was getting a cryptic error about a revision or file doesn't exist when executing the load command into a blank repo. svnadmin load seemed to get confused because creation of the "trunk" directory got filtered out by svndumpfilter. Therefore creating "trunk/MySubDirecory" fails. Doing a svn add/commit manuall...
[ 0.06730039417743683, -0.2337000072002411, 0.4171118438243866, -0.0299444030970335, 0.18142704665660858, -0.23169727623462677, 0.5459557771682739, -0.0951685830950737, -0.23531779646873474, -0.6648270487785339, -0.2893885672092438, 0.46654120087623596, -0.46099555492401123, -0.0419970601797...
repo had always been that directory.
[ -0.12495792657136917, -0.3941126763820648, 0.33094310760498047, 0.19334550201892853, -0.39084264636039734, 0.0294974185526371, -0.5607854127883911, 0.48855867981910706, -0.4356517493724823, 0.1586393266916275, 0.07249967753887177, 0.3967774212360382, 0.006039665080606937, 0.216453254222869...
It will be better if this solution is based on HTTP protocol. Checkout [HTTP::Daemon](http://search.cpan.org/~gaas/libwww-perl-5.825/lib/HTTP/Daemon.pm) in CPAN. It will give you the basics of a server. You can then over-ride methods to handle your HTTP. Alternatively, try [HTTP::Server::Simple](http://search.cpan.org...
[ 0.062013037502765656, -0.12788912653923035, 0.5411026477813721, 0.13270409405231476, -0.07514787465333939, -0.2158210426568985, 0.20505450665950775, -0.47751060128211975, -0.5187758207321167, -0.5890432596206665, 0.06348322331905365, 0.16852937638759613, -0.17178921401500702, 0.06810355931...
How do I write to the serial port in Vista from Python? The termios package only seem to support posix. Seems like it wasn't any harder than this using [pyserial](http://pyserial.wiki.sourceforge.net/pySerial): ``` import serial ser = serial.Serial(0) # open first serial port with 9600,8,N,1 print ser.portstr ...
[ -0.06494894623756409, 0.2766915261745453, 0.6565658450126648, -0.07879823446273804, -0.10995294898748398, 0.04432991147041321, 0.31879979372024536, -0.06368625909090042, -0.4417329728603363, -0.7631212472915649, -0.007307383697479963, 0.5823898911476135, -0.21652327477931976, 0.37649935483...
I have a job processing architecture based on AWS that requires EC2 instances query S3 and SQS. In order for running instances to have access to the API the credentials are sent as user data (-f) in the form of a base64 encoded shell script. For example: ``` $ cat ec2.sh ... export AWS_ACCOUNT_NUMBER='1111-1111-1111' ...
[ -0.009381989017128944, 0.3358609080314636, 0.2879401743412018, -0.16386407613754272, 0.06785307824611664, -0.14197340607643127, 0.40445470809936523, -0.42282700538635254, 0.02447432093322277, -0.5054084062576294, -0.1585262417793274, 0.5832996964454651, -0.33528923988342285, -0.00756464758...
secure 2. The password is hard-coded in the instance (it's always 'secret-password') The method is very similar to the one described [here](http://blogs.oracle.com/ec2/entry/using_parameterized_launches_to_customize) Is there a more elegant or accepted approach? Using gpg to encrypt the credentials and storing the pr...
[ 0.03595978394150734, 0.09225459396839142, 0.24921178817749023, 0.09839697927236557, -0.11403107643127441, -0.5738233327865601, 0.09943769127130508, -0.19465017318725586, 0.051242079585790634, -0.630247950553894, -0.143631249666214, 0.6958123445510864, -0.4000198543071747, -0.29719060659408...
e.g. key pair) so that you would not need to perform any custom encryption (only make sure that permissions are properly set to `0400` on the key file at all times, e.g. set the permissions on the master files and use `scp -p`) If the above does not answer your question, please provide more specific details re. what y...
[ 0.28586721420288086, -0.3840227723121643, 0.17467531561851501, 0.16396012902259827, 0.25507742166519165, -0.6088714599609375, 0.5184565782546997, -0.6083813905715942, -0.47099775075912476, -0.5796140432357788, -0.3870018720626831, 0.6542790532112122, -0.2350182980298996, -0.350173443555831...
instantiate your AMI to first populate the user data (`ec2-run-instances -f user-data-file`) with their AWS keys? Your AMI can then dynamically retrieve these per-instance parameters from `http://169.254.169.254/1.0/user-data`. --- **UPDATE** OK, here goes a security-minded comparison of the various approaches discu...
[ -0.13334792852401733, -0.1648365557193756, 0.3335631191730499, 0.060109276324510574, -0.13905379176139832, -0.4950810372829437, 0.44519832730293274, -0.0887373685836792, -0.1684979498386383, -0.6919304132461548, -0.32002028822898865, 0.6722132563591003, -0.2981039583683014, -0.332707524299...
and forward the clear-text `http://169.254.169.254/1.0/user-data`) 2. Security of data when **stored in the AMI `user-data` and encrypted (or decryptable) with easily obtainable key** * **low** * easily-obtainable key (password) may include: + key hard-coded in a script inside an ABI (where the ABI can be obtained ...
[ -0.16540923714637756, 0.3511066436767578, 0.3410487473011017, 0.007757279090583324, -0.15922293066978455, -0.11009009182453156, 0.3313489854335785, -0.48562949895858765, -0.18266010284423828, -0.38145408034324646, -0.4766991138458252, 0.7380492687225342, -0.058234021067619324, -0.160878613...
1 apply, namely: + the decrypted data is accessible to *any* user who manages to log onto the AMI and has access to `telnet`, `curl`, `wget`, etc. (can access clear-text `http://169.254.169.254/1.0/user-data`) + you are vulnerable to proxy request attacks (e.g. attacker asks the Apache that may or may not be runnin...
[ -0.03992905840277672, 0.013709072023630142, 0.26267769932746887, 0.09769192337989807, -0.09629585593938828, -0.4480457603931427, 0.4956423044204712, -0.2370602786540985, -0.2186778038740158, -0.5136196613311768, -0.5100801587104797, 0.6737529039382935, -0.5856413245201111, -0.1929648667573...
to `telnet`, `curl`, `wget`, etc. (can access encrypted `http://169.254.169.254/1.0/user-data`) + an attempt to decrypt the encrypted data can then be made using brute-force attacks 4. Security of data when **stored on the AMI, in a secured location** (no added value for it to be encrypted) * **higher** * the data ...
[ 0.19558675587177277, -0.06714481115341187, 0.4538332223892212, 0.3777075707912445, 0.2291412651538849, -0.3414379060268402, 0.49297580122947693, -0.3090377449989319, -0.2628176510334015, -0.511967658996582, -0.6272470355033875, 0.7987531423568726, -0.30359598994255066, -0.0907057672739029,...
to pass through `root` for interactive impersonation) improves security So any method involving the AMI `user-data` is not the most secure, because gaining access to *any* user on the machine (weakest point) compromises the data. This could be mitigated if the S3 credentials were only required for a limited period of...
[ 0.00005179347863304429, -0.14974454045295715, 0.1390853226184845, 0.041491806507110596, 0.06211774796247482, -0.16861408948898315, 0.9808621406555176, -0.14455123245716095, -0.22387824952602386, -0.4976278245449066, -0.4292841851711273, 0.06868184357881546, -0.21307985484600067, 0.09125444...
(compromising these credentials, from `user-data`, after the deployment process is completed and the credentials have been invalidated with AWS, no longer poses a security threat.) If the above is not applicable (e.g. S3 credentials needed by deployed nodes indefinitely) or not possible (e.g. cannot issue temporary S3...
[ 0.046548325568437576, -0.24121367931365967, 0.38847512006759644, 0.09287482500076294, 0.17746585607528687, -0.3820735514163971, 0.48794931173324585, -0.08795803785324097, -0.1612606793642044, -0.18462525308132172, -0.7591996192932129, 0.5282079577445984, -0.0186125710606575, -0.11260518431...
I have a table like this... ``` ID Description LowThreshold HighThreshold 1 BAD 0.0 .69 2 MEETS .70 .89 3 GOOD .90 2 ``` The object here is to write a LINQ query that will select
[ -0.05719935521483421, 0.605113685131073, 0.6722341179847717, 0.04895339906215668, 0.09051486104726791, -0.10057534277439117, -0.34877756237983704, -0.07091668993234634, -0.07354387640953064, -0.5395007729530334, 0.18925747275352478, 0.35588550567626953, -0.2007279396057129, 0.1103257387876...
the right Description based on a given decimal. For instance .75 is between .70 and .89, so it would return “MEETS”. BUT, the kicker is, if the Number is higher than all the ranges, automatically return the Description for the record with the highest HighThreshold. So, if I pass in 5, I should get “GOOD” returned. I h...
[ 0.02394261583685875, 0.3578237295150757, 0.3836604952812195, 0.013264034874737263, 0.09367731958627701, 0.10373584926128387, 0.5229611992835999, -0.37324389815330505, -0.0027667435351759195, -0.30551525950431824, -0.033755622804164886, 0.7041402459144592, 0.24561911821365356, -0.0142850102...
(e => e.LowThreshold <= score && e.HighThreshold
[ -0.29010114073753357, 0.07768990099430084, 0.7243945598602295, 0.015317359007894993, 0.26378878951072693, -0.3438742756843567, 0.09879572689533234, -0.32185712456703186, 0.099172443151474, -0.43082576990127563, -0.30608123540878296, 0.4102255403995514, 0.12920580804347992, 0.33615887165069...
>= score ) .Select(eval => eval.Description).First().ToString(); } ``` I'd like to accomplish this with just this one query, but my imagination isn't getting me there. I attempted what I found in [this](https://stackoverflow.com/questions/341264/linq-max-or-default) pos...
[ 0.03445567563176155, 0.004453122615814209, 0.5583891272544861, 0.02957669459283352, 0.21807269752025604, -0.20757901668548584, 0.35179978609085083, -0.6402047872543335, -0.2582116723060608, -0.5727673172950745, -0.18777424097061157, 0.6002585291862488, -0.2121506929397583, 0.08870379626750...
score && e.HighThreshold >= score)?? PerformanceRanges.Single( e=>e.HighThreshold == PerformanceRanges
[ 0.004096680320799351, -0.1611270010471344, 0.4898052215576172, 0.23223599791526794, -0.03533569723367691, -0.07009690254926682, 0.31008556485176086, -0.5944785475730896, -0.09412505477666855, -0.3415397107601166, -0.1507510095834732, 0.39378729462623596, -0.10866600275039673, 0.21034291386...
.Max(p=> p.HighThreshold) ); string evaluationText = range.Description; ``` The `range` query will select the element that matches with the Thereshold ranges, and if the value is greater (the first query will return null), it will select the greatest range.
[ -0.18718884885311127, -0.1324814409017563, 0.4487490952014923, -0.3026428520679474, 0.0955776795744896, 0.13239260017871857, 0.3638955056667328, -0.5494195222854614, 0.20023612678050995, -0.2897401452064514, -0.34855878353118896, 0.7273239493370056, -0.38052746653556824, 0.1402784138917923...
Now that my OpenGL application is getting larger and more complex, I am noticing that it's also getting a little slow on very low-end systems such as Netbooks. In Java, I am able to get around this by drawing to a BufferedImage then drawing that to the screen and updating the cached render every one in a while. How wou...
[ 0.18350668251514435, 0.04169638827443123, 0.48532095551490784, 0.010924414731562138, -0.2911621034145355, -0.10137027502059937, 0.12876053154468536, 0.15310615301132202, -0.21215981245040894, -0.9146336317062378, 0.20741207897663116, 0.6637901067733765, -0.08911934494972229, -0.05729055032...
sacrifice speed for compatability. ``` glBegin(GL_QUADS); setColor(DARK_BLUE); glVertex2f(0, 0); //TL glVertex2f(appWidth, 0); //TR setColor(LIGHT_BLUE); glVertex2f(appWidth, appHeight); //BR glVertex2f(0, appHeight); //BR glEnd(); ``` ...
[ 0.06581755727529526, -0.17342138290405273, 0.4995895326137543, 0.043326303362846375, -0.05757104977965355, 0.09161803126335144, 0.39937615394592285, -0.3648049235343933, -0.10099073499441147, -0.7577659487724304, -0.32898932695388794, 0.9099854826927185, -0.4033534824848175, 0.045645248144...
about. A gradient that takes up the entire screen is being re-drawn many times per second. How can I cache it to a texture then just draw that texture to increase performance? Also, a trick I use in Java is to render it to a 1 X height texture then scale that to width x height to increase the performance and lower mem...
[ 0.15274149179458618, -0.17856717109680176, 0.47437670826911926, 0.11961129307746887, -0.1490071415901184, 0.11679708957672119, -0.059521839022636414, -0.05560865253210068, -0.26575881242752075, -0.8666141033172607, 0.35056936740875244, 0.4800995886325836, -0.14167650043964386, -0.105233296...
fall back. The article from one of the previous posters is a good article to follow on it, and there's plent of tutorials on google for FBOs. In my 2d Engine (Phoenix), we decided we would go with just the back buffer method. Our class was fairly simple and you can view the header and source here: <http://code.googl...
[ -0.04284892976284027, -0.14232565462589264, 0.2285299003124237, 0.23606817424297333, -0.22031082212924957, 0.022392988204956055, -0.08382107317447662, 0.008060567080974579, 0.036965228617191315, -0.35211849212646484, 0.05161585658788681, 0.36115291714668274, 0.06564134359359741, -0.0697923...
I have a site like SO, Wordpress, etc, where you make a post and u can have (optional) tags against it. What is a common database schema to handle this? I'm assuming it's a many<->many structure, with three tables. Anyone have any ideas? A three table many to many structure should be fine. Eg. `Posts, PostsToTags(...
[ 0.39990919828414917, 0.05398997291922569, 0.33982089161872864, 0.2146664559841156, -0.1916588693857193, -0.13562782108783722, -0.04334593191742897, 0.113939069211483, -0.18256452679634094, -0.8394712209701538, 0.21422535181045532, 0.42946335673332214, -0.2898949682712555, 0.252870827913284...
well.
[ -0.06034502387046814, 0.07335762679576874, 0.25588366389274597, 0.11408231407403946, 0.2900284230709076, -0.24014221131801605, 0.1821618676185608, 0.047716714441776276, 0.05080713331699371, -0.1601426601409912, 0.15348441898822784, 0.041998930275440216, 0.17971153557300568, 0.1957090944051...
A while back, smart clients had been touted as the solution to "occasional connected" usage environments, and toolkits like Google Gears have sprouted for the same reason. It looks to me like constant, reliable Internet access is becoming more and more pervasive (even in places such as commercial airplanes), so my ques...
[ 0.2990308701992035, 0.03836486488580704, 0.25973063707351685, 0.3131251931190491, 0.26803508400917053, -0.025900864973664284, -0.12434171885251999, 0.41762542724609375, -0.40905264019966125, -0.6678003668785095, 0.03975914046168327, 0.40524613857269287, -0.1847093105316162, -0.070332035422...
development time ) by about 3 or 4 times. So it is a very expensive feature to add. But there are solid business cases for these apps as I'm sure there are for many systems. One was for engineers on the road who often go to client sites where (for whatever reason, security being one reason sometimes) their wireless co...
[ 0.19899505376815796, -0.23840412497520447, 0.21332718431949615, 0.3365686237812042, 0.1686340719461441, 0.1770850270986557, 0.2583685517311096, -0.0725899413228035, -0.22067901492118835, -0.8168959021568298, 0.04003544896841049, 0.46397197246551514, -0.2667299509048462, -0.1647178828716278...
or will have no connection at all, until the user returns 'to the office'. From a personal perspective I love the idea that with or without an active connection I can continue to 'do my work', indeed even if the connection drops out half way through an activity everything still works and I won't lose any of my data. ...
[ 0.28590986132621765, -0.13305631279945374, 0.632472813129425, 0.45720645785331726, 0.28322526812553406, -0.2064971774816513, 0.2705352306365967, 0.37031373381614685, -0.583747148513794, -0.6011999845504761, -0.0930621400475502, 0.38310912251472473, -0.2769337296485901, 0.10174556076526642,...
connection. Whether it be a hardware or service provider failure or some active security blocking connections, at some point in time your users will be in disconnected mode.
[ 0.16042159497737885, -0.0472467765212059, 0.6514631509780884, 0.5342559814453125, 0.2466825544834137, -0.27788954973220825, 0.4059053063392639, 0.5998103618621826, -0.7389930486679077, -0.5704431533813477, -0.42893704771995544, 0.27379006147384644, -0.5069279670715332, 0.4255867302417755, ...
Simple question for a newb and my Google-Fu is failing me. Using PHP, how can you count the number of files in a given directory, including any sub-directories (and any sub-directories they might have, etc.)? e.g. if directory structure looks like this: ``` /Dir_A/ /Dir_A/File1.blah /Dir_A/Dir_B/ /Dir_A/Dir_B/F...
[ 0.05541645362973213, 0.053172823041677475, 0.40805724263191223, -0.1616991013288498, -0.07442782819271088, 0.13779598474502563, 0.20556560158729553, -0.47482696175575256, -0.24999932944774628, -0.6833749413490295, 0.046123046427965164, 0.49500706791877747, -0.24886630475521088, -0.01280830...
array( 'cgi-bin', '.', '..', '.DS_Store' ); $dh = @opendir( $path ); while( false !== ( $file = readdir( $dh ) ) ){ if( !in_array( $file, $ignore ) ){ if( is_dir( "$path/$file" ) ){ $filecount = count(glob( "$path/$file/" . "*"));
[ -0.11224040389060974, -0.2037101686000824, 0.39475277066230774, -0.4582246243953705, 0.1007707417011261, 0.00942911021411419, 0.31593024730682373, -0.6296145915985107, -0.14215952157974243, -0.2989981174468994, -0.3110024333000183, 0.5929945111274719, -0.5263718366622925, 0.199764966964721...
$total += $filecount; echo $filecount; /* debugging */ echo " $total"; /* debugging */ echo " $path/$file "; /* debugging */ getFilecount( "$path/$file", $filecount, $total);
[ 0.18968698382377625, -0.13869647681713104, 0.039333775639534, -0.292509526014328, 0.0159471295773983, 0.07441041618585587, 0.6059718132019043, -0.7437914609909058, -0.39606013894081116, 0.057648930698633194, -0.3188382685184479, 0.455379843711853, -0.564021646976471, 0.14522229135036469, ...
} } } return $total; } ``` I'd greatly appreciate any help. This should do the trick: ``` function getFileCount($path) { $size = 0; $ignore = array('.','..','cgi-bin','.DS_Store'); $files = scandir($path); foreach($files as $t) { if(in_array($t, $ignore)) continue; ...
[ -0.022084809839725494, -0.3287081718444824, 0.5620456337928772, -0.4529467225074768, 0.4459136128425598, -0.05718282237648964, 0.4769689738750458, -0.4862031936645508, -0.30714505910873413, -0.28829285502433777, -0.5011646151542664, 0.8985755443572998, -0.4237099885940552, 0.13557548820972...
$size += getFileCount(rtrim($path, '/') . '/' . $t); } else { $size++; } } return $size; } ```
[ 0.11121881753206253, -0.14905741810798645, 0.620143711566925, -0.4302608370780945, 0.20749083161354065, 0.031956352293491364, 0.4050792157649994, -0.6150169968605042, -0.39567670226097107, -0.5303484797477722, -0.34122973680496216, 0.8917145729064941, -0.49093708395957947, 0.11593051999807...
I am making a simple lib to use in my apps to save me the trouble of defining some functions over and over... Here's my makefile: ``` CC=gcc CFLAGS=-Wall -g -Wextra OBJS=getline.o debug.o LIB=libjimi.a .PHONY: clean purge libjimi.so : $(OBJS) ar rcs $(LIB) $(OBJS) @echo done! %.o : %.c $(CC...
[ 0.3244931399822235, 0.35049131512641907, 0.5947362780570984, -0.18800915777683258, -0.0902397483587265, -0.155793696641922, 0.497699499130249, -0.280593603849411, -0.3054884672164917, -0.6200278401374817, -0.13482408225536346, 0.5907608866691589, -0.6336372494697571, -0.030702199786901474,...
link the object files that I link to create the library, it works...advice? Your target say libjimi.so which is the extension for a shared library, it should just be libjimi.a for a static lib. And note that when you use a static lib you just link it in like any other object file, but with a shared lib you use the -l ...
[ 0.4781111478805542, -0.04313324764370918, 0.3284740746021271, 0.14885637164115906, -0.3430837392807007, -0.1042783260345459, -0.010865784250199795, 0.40318045020103455, -0.10862477868795395, -0.7187592387199402, 0.016521824523806572, 0.32611486315727234, -0.5510892271995544, 0.106799170374...
I am trying to quickly process large images (about 2000x2000). I am using a TrackBar to change the overall brightness of an image. The problem is that the TrackBar (as you all know) can be moved very quickly. This is ok as I do not need to process the image for *every* tick of the TrackBar, but it does need to be reaso...
[ 0.09389228373765945, -0.027743203565478325, 0.6093280911445618, 0.12745316326618195, -0.09651628136634827, 0.01765493117272854, -0.02182321809232235, -0.02016785927116871, -0.3012285530567169, -1.1716406345367432, 0.3218435049057007, 0.6857860684394836, 0.041317399591207504, 0.115365304052...
use a ColorMatrix because it allows component overflows and I need values to clip at 255. So, I am thinking that I can achieve good performance by using the ThreadPool and splitting the image up into sections. The problem with this approach is that I just don't have much experience with multi-trheaded applications and...
[ 0.266939640045166, -0.13386036455631256, 0.003852351801469922, 0.19936853647232056, 0.02928386628627777, -0.1380339413881302, -0.056000616401433945, -0.16328880190849304, -0.11749397963285446, -0.6761491298675537, 0.31934869289398193, 0.5473119020462036, -0.5588129162788391, 0.017153650522...
good, but I am just working it out and trying a bunch of different things at this point. The basic concept is to use a base image as a source, perform some operation on each pixel, then draw the processed pixel into a display Bitmap. Any help would be awesome. ``` public Form1( ) { InitializeComponent(...
[ 0.4113292098045349, -0.02668166719377041, 0.44323399662971497, 0.06597654521465302, 0.16125965118408203, 0.12480873614549637, -0.028675105422735214, -0.2849116921424866, 0.1522306501865387, -0.651548445224762, 0.13423483073711395, 0.5837752819061279, -0.16324782371520996, -0.06094426661729...
} void trackBar1_ValueChanged( object sender, EventArgs e ) { testPBox1.IntensityScale = (float) trackBar1.Value / 100; } class TestPBox : Control { private const int MIN_SAT_WARNING = 240; private Bitmap m_srcBitmap; private Bitmap m_dispBitmap; private float m_scale;...
[ 0.2585189640522003, -0.5151624083518982, 0.07019371539354324, 0.07505106180906296, 0.06894562393426895, 0.307016521692276, 0.6930071115493774, -0.30229008197784424, -0.1891878843307495, -0.24492822587490082, -0.10656286031007767, 0.6275436878204346, -0.3356474041938782, 0.10373515635728836...
TestPBox( ) { this.DoubleBuffered = true; IntensityScale = 1.0f; } public Bitmap Image { get
[ 0.5663366913795471, -0.7204549312591553, 0.09448227286338806, 0.1477707028388977, -0.040942706167697906, -0.07248358428478241, 0.6062385439872742, -0.35312095284461975, 0.24322597682476044, -0.5906874537467957, -0.07094574719667435, 0.6238924860954285, -0.40985116362571716, -0.212037667632...
{ return m_dispBitmap; } set { if ( value != null ) { m_srcBitmap = value;
[ -0.09938501566648483, -0.05422952398657799, 0.40866678953170776, -0.38846832513809204, 0.37211647629737854, -0.06515014916658401, 0.3759937584400177, -0.2742377817630768, -0.04587196931242943, -0.03502996638417244, -0.38604041934013367, 0.7323015928268433, -0.6130630373954773, -0.143257632...
m_dispBitmap = (Bitmap) value.Clone( ); Invalidate( ); } } } [DefaultValue( 1.0f )] public float IntensityScale { get { return m_scale;
[ 0.2911326587200165, -0.6835173964500427, 0.5303894877433777, -0.3049754500389099, 0.16629233956336975, 0.013035958632826805, 0.6079519987106323, -0.5607560276985168, -0.2050858438014984, -0.546593964099884, -0.08603472262620926, 0.7741206288337708, -0.31473878026008606, 0.26624903082847595...
} set { if ( value == 0.0 || m_scale == value ) { return;
[ -0.1406114399433136, -0.22407208383083344, 0.5969116687774658, -0.4742017388343811, 0.4644472897052765, 0.0687510296702385, 0.2810247540473938, -0.5029701590538025, 0.042043108493089676, -0.4159896671772003, -0.4320656359195709, 0.9903073906898499, -0.24464164674282074, 0.1526949405670166,...
} if ( !this.DesignMode ) { m_scale = value; ProcessImage( ); }
[ -0.1762893944978714, -0.5474881529808044, 0.48588886857032776, -0.39815038442611694, 0.42031699419021606, 0.3056182861328125, 0.36521482467651367, -0.47066664695739746, -0.18046055734157562, -0.8009617924690247, -0.24432027339935303, 0.6102004051208496, -0.2672828733921051, 0.5425859689712...
} } private void ProcessImage( ) { if ( Image != null ) { int sections = 10; int sectionHeight = (int) m_srcBitmap.Height / sections; for ( int i = 0; i < sections; ++i )
[ 0.4427609443664551, -0.18320411443710327, 0.6115539073944092, -0.27939778566360474, 0.0639917403459549, 0.3642454147338867, 0.3302929401397705, -0.37989646196365356, -0.40830492973327637, -0.40541940927505493, -0.24251016974449158, 0.022489087656140327, -0.35960710048675537, 0.312840461730...
{ Rectangle next = new Rectangle( 0, i * sectionHeight, m_srcBitmap.Width, sectionHeight ); ThreadPool.QueueUserWorkItem( new WaitCallback( delegate { ChangeIntensity( next ); } ) ); } } } private unsafe void ChangeIntensity( Rectangle rect )
[ -0.021349305287003517, -0.3994373381137848, 0.5259363055229187, -0.0739906057715416, 0.442211389541626, 0.1841421276330948, 0.2948589026927948, -0.29910001158714294, -0.44642361998558044, -0.5634796619415283, -0.14616458117961884, 0.3082177937030792, -0.4310159683227539, 0.6330156326293945...
{ BitmapData srcData = m_srcBitmap.LockBits( rect, ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb ); BitmapData dspData = m_dispBitmap.LockBits( rect, ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb ); byte* pSrc = (byte*) srcData.Scan0; byte* pDsp = (byt...
[ -0.26892751455307007, -0.4260435998439789, 0.5935289263725281, -0.22266709804534912, -0.18926461040973663, 0.34594103693962097, 0.29077601432800293, -0.7330935597419739, -0.396884024143219, -0.26952487230300903, -0.33003151416778564, 0.2516492009162903, -0.0838012844324112, 0.0152305262163...
{ for ( int x = 0; x < rect.Width; ++x ) { // we are dealing with a monochrome image, so r = g = b. // We only need to get one component value to use for all r, g, and b.
[ 0.31286150217056274, -0.191949725151062, 0.20966899394989014, -0.07222892343997955, -0.02287680096924305, 0.15835386514663696, 0.07269709557294846, -0.35793057084083557, 0.01890178956091404, -0.4382455348968506, -0.2564016282558441, 0.5451421141624451, -0.6411762237548828, 0.10721015930175...
byte b = (byte) CompMinMax( 0, 255, (int) ( pSrc[0] * m_scale ) ); Color c = ( b > MIN_SAT_WARNING ) ? Color.FromArgb( b, Color.Red ) : Color.FromArgb( 255, b, b, b );
[ 0.11579305678606033, 0.03348543122410774, 0.19539585709571838, -0.32761260867118835, 0.23373578488826752, 0.47696539759635925, 0.21736468374729156, -0.30538755655288696, -0.21750269830226898, -0.3725329339504242, -0.6197421550750732, 0.4400717318058014, -0.441240519285202, 0.31809207797050...
// windows stores images internally in // reverse byte order, i.e., Bgra, not Argb. pDsp[3] = (byte) c.A; pDsp[2] = (byte) c.R; pDsp[1] = (byte) c.G;
[ 0.09851973503828049, 0.16233943402767181, 0.3780869245529175, -0.3418249487876892, -0.20601721107959747, 0.27044442296028137, 0.025921327993273735, -0.15691515803337097, -0.4304349422454834, -0.5441067218780518, -0.3866274654865265, 0.5660941004753113, -0.489206463098526, -0.08805396407842...
pDsp[0] = (byte) c.B; pSrc += 4; pDsp += 4; } } m_srcBitmap.UnlockBits( srcData );
[ -0.47331035137176514, -0.19018840789794922, 0.31812936067581177, -0.20151065289974213, 0.4508245289325714, -0.10766149312257767, 0.27166005969047546, -0.3012101650238037, -0.25725844502449036, -0.1799248456954956, -0.4683763384819031, 0.40878719091415405, -0.43238434195518494, 0.1149331107...
m_dispBitmap.UnlockBits( dspData ); this.Invalidate( ); } private int CompMinMax( int min, int max, int value ) { if ( value > max ) return max; if ( value < min ) return min; return value;
[ -0.08163898438215256, -0.557413637638092, 0.46529120206832886, -0.1300472766160965, 0.7675395011901855, 0.1262480616569519, 0.3459278643131256, -0.297145277261734, -0.15807393193244934, -0.2806091904640198, -0.6992928385734558, 0.7185623049736023, -0.45214927196502686, 0.10958380997180939,...
} protected override void OnPaint( PaintEventArgs e ) { if ( Image != null ) { Graphics g = e.Graphics; Rectangle drawingRect = PaintUtils.CenterInRect( ClientRectangle, PaintUtils.ScaleRect( ClientRectangle, Image.Size ).Size );
[ -0.029793957248330116, -0.43966901302337646, 0.6719576716423035, -0.17712362110614777, 0.16544435918331146, 0.2783811688423157, 0.24659322202205658, -0.36475059390068054, 0.12005600333213806, -0.779052734375, -0.36454200744628906, 0.6803784966468811, -0.4760935604572296, -0.030749808996915...
g.DrawImage( Image, drawingRect, 0, 0, Image.Width, Image.Height, GraphicsUnit.Pixel ); } base.OnPaint( e ); } } ``` Have you considered generating a scaled-down version of the image and doing the image manipulation on that while the user is dragging the trackbar? That would give you resp...
[ 0.12094728648662567, -0.16300947964191437, 0.16798005998134613, -0.008225471712648869, -0.07911749184131622, 0.10788281261920929, -0.09586671739816666, -0.19329138100147247, -0.05455593392252922, -0.6539833545684814, -0.018870454281568527, 0.8614456057548523, -0.3043632209300995, -0.162775...
I have installed the newest iPython in Mac. However, it uses the Python verion 2.5.1. I installed the Python 2.6.1 by MacPython package at [here](http://www.python.org/download/). **How can I make my iPython to use Python 2.6.1?** I am not sure where the MacPython package exactly installed the newest Python. The **...
[ -0.004964546766132116, 0.2042665183544159, 0.5694143176078796, 0.1399165242910385, -0.1348203867673874, -0.16536083817481995, 0.21054929494857788, 0.11249414831399918, -0.1759844720363617, -0.8467476963996887, -0.07182510197162628, 0.8144210577011108, -0.47698986530303955, 0.02551298029720...
sym link (ln -s ..) python to python2.6 instead of python2.5
[ 0.07010656595230103, -0.2660747766494751, 0.28278547525405884, -0.22368384897708893, -0.0322934128344059, -0.035294175148010254, 0.24464794993400574, 0.141725093126297, -0.2816544771194458, -0.4363185465335846, -0.37814512848854065, 0.287740021944046, -0.3410576283931732, -0.19816079735755...
I tried the following code unsuccessfully ``` find Applications | xargs -0 grep Applications ``` I also tried the following unsuccessfully ``` find Applications ``` Was it something instead like: ``` mdfind Applications | grep Applications ``` `mdfind` is a command line interface to *Spotlight*. Somehow, I dou...
[ 0.25103136897087097, 0.11740327626466751, 0.4194304347038269, -0.015761056914925575, -0.22562779486179352, -0.11378765851259232, 0.2795197069644928, 0.24728073179721832, -0.3812064528465271, -0.5739657878875732, -0.2806888520717621, 0.8281816244125366, -0.6755694150924683, -0.0897354856133...
Given an array of 81 elements (meant to represent a 9x9 grid) how can I go over each element, grabbing the three around it and then performing an operation on those, then continuing to the next three of each row, column, or submatrix. Look below or at a sudoku grid to see the layout. ``` define COL(n) ((n) % 9) ...
[ -0.21550436317920685, 0.01305677741765976, 0.22019292414188385, -0.21523353457450867, -0.03456101194024086, 0.5288417339324951, 0.07184533774852753, -0.3123033046722412, -0.37001219391822815, -0.758313775062561, -0.20982244610786438, 0.2192375659942627, -0.5447561740875244, -0.136430725455...
the following categories, there are nine elements in each array, and I hope to take the elements of each column (the x axis) in groups of threes, perform ``` r = ((a = ~a) & (b = ~b)) | ((b | a) & ~c); // or r = ((~a & ~b)) | ((~b | ~a) & ~c); ``` on them, take the three resultant numbers, and perform it on them,...
[ 0.09879468381404877, 0.3310375511646271, 0.3876257836818695, -0.28111329674720764, 0.01684962399303913, 0.39075595140457153, 0.3677501678466797, -0.753671407699585, 0.05991930887103081, -0.5269777178764343, -0.013925771228969097, 0.5302892327308655, -0.405082106590271, 0.006582433357834816...
int *rowPointer = grid; for(row = 0; row < 3; ++row) { int *columnPointer = rowPointer; for(column = 0; column < 3; ++column) { doOperation(columnPointer); columnPointer += xPitch; } rowPointer += yPitch * 9;
[ -0.2602347135543823, -0.19578896462917328, 1.1042736768722534, -0.27611538767814636, -0.26835495233535767, 0.2212037295103073, 0.07826675474643707, -0.6001044511795044, 0.10625563561916351, -0.2057601809501648, -0.30396413803100586, 0.30641770362854004, -0.33087441325187683, 0.058994013816...
} } applyThingy(&grid[SUB(n)], 1, 1); // Perform on 3x3 subgrid applyThingy(&grid[ROW(n)], 1, 0); // Perform on row applyThingy(&grid[COL(n)], 0, 1); // Perform on column ```
[ -0.2941668927669525, -0.013303235173225403, 0.7057337164878845, -0.34763428568840027, 0.16474497318267822, 0.0974634513258934, 0.46971583366394043, -0.7681029438972473, -0.05285230651497841, -0.4139634966850281, -0.04281352087855339, 0.5591035485267639, -0.5033151507377625, -0.134685888886...
I'm having trouble creating a solid game engine for my OpenGL application. It's a game which consists of several sprites with a lot of action. I created objects which are basically all of my sprites. Another object called "gameEngine" loops through a set of calculations every something of a second (a timer), resulting...
[ 0.20805950462818146, -0.21816308796405792, 0.5445279479026794, 0.4593813717365265, -0.20406658947467804, 0.16214698553085327, 0.02588263340294361, -0.05475311353802681, -0.38973715901374817, -0.6534315347671509, 0.219334214925766, 0.33896782994270325, -0.010986415669322014, 0.2483511567115...
scene, the game calculations take an undetermined amount of time. So, the actual drawing takes place at different moments in time. How would I prevent that from happening? To clarify, my approach goes something like: ``` // Every something of a second I call tick -(void)tick { drawingData = gameEngine(); draw(dr...
[ 0.12490718811750412, -0.46315866708755493, 0.27528902888298035, 0.22449785470962524, -0.07434920221567154, 0.17606553435325623, 0.05834874510765076, 0.03485744073987007, -0.49427399039268494, -0.7400649189949036, 0.1807265728712082, 0.15238603949546814, -0.34701356291770935, -0.08664251118...
of calculation and rendering. ``` void Initialize() { DrawingData = GameEngine(); } void Tick() { Draw(DrawingData); DrawingData = GameEngine(); } ``` You calculate the first drawing data on application start up and when the timer fires you just draw it. After that you have all the time up to the next ...
[ 0.2144743949174881, -0.0917750895023346, 0.40545541048049927, -0.128041610121727, -0.1283375769853592, 0.17460115253925323, -0.003338590729981661, -0.21037557721138, -0.4008939862251282, -0.9760199189186096, 0.06301966309547424, 0.6912557482719421, -0.24224817752838135, -0.1351554244756698...
Main() { StartTime = Now(); while (!ExitRequested) { DrawingData = GameEngine(Now() - StartTime); Draw(DrawingData); } } ``` You render frames as fast as possible - not with a fixed interval between each frame but instead with the real time the application is running. That means do not a...
[ -0.07925785332918167, -0.3323410749435425, 0.7861521244049072, -0.07241173833608627, 0.21714399755001068, 0.023456139490008354, 0.17889684438705444, -0.0019020640756934881, -0.4604491889476776, -0.8426924347877502, -0.2584254741668701, 0.3454165756702423, -0.04882945865392685, 0.0845040604...
I am trying to port a project (from linux) that uses Semaphores to Mac OS X however some of the posix semaphores are not implemented on Mac OS X The one that I hit in this port is `sem_timedwait()` I don't know much about semaphores but from the man pages `sem_wait()` seems to be close to `sem_timedwait` and it is im...
[ 0.24279478192329407, -0.03461432084441185, 0.2184278666973114, -0.22801224887371063, -0.3871251046657562, 0.015044302679598331, 0.3602149486541748, -0.048884499818086624, -0.08543398976325989, -0.9915878176689148, 0.08943615853786469, 0.3105202317237854, -0.5009945631027222, 0.153539717197...