text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
for doing it? hasktags has some bugs, one of which is that it uses lazy IO, which tends to give those resource busy errors. As it happens, I just wrote a tags program, at <http://hackage.haskell.org/package/fast-tags> Other options are hothasktags, which makes qualified Module.function tags, and lushtags, which is de...
[ 0.15648871660232544, -0.36653441190719604, 0.18778009712696075, 0.35605332255363464, 0.07885874062776566, -0.37266528606414795, 0.20062030851840973, -0.23002640902996063, -0.29551252722740173, -0.39363858103752136, -0.05521265044808388, 0.479214608669281, -0.5221809148788452, -0.4960293769...
own parser, which means it doesn't have those problems, but is also more vulnerable to parsing bugs that miss tags or give bogus tags. As you noticed, gasbag (and htags) use haskell-src which means they only work on Haskell 98. Disclaimer: if by TAGS you mean emacs tags, fast-tags doesn't do those yet, though if some...
[ 0.15006937086582184, -0.11382418125867844, 0.37484437227249146, -0.02122262865304947, -0.16251584887504578, -0.47236862778663635, 0.5482345819473267, 0.15042267739772797, -0.15561476349830627, -0.30771109461784363, 0.07228797674179077, 0.5427495241165161, -0.45899835228919983, -0.373409718...
I'm new to both Android and Java. My app needs to be able to check what the user is typing as they are typing it. If the user types in a predetermined word that has been flagged, an event needs to occur before the user presses a button. It seems like the best choice for this would be a TextWatcher and an addChangedText...
[ 0.3330143094062805, 0.08625099062919617, 0.1966620236635208, -0.06349731236696243, 0.05044625699520111, -0.06747201085090637, 0.11244037747383118, 0.06822791695594788, 0.0013141916133463383, -0.9587617516517639, 0.07558750361204147, 0.39229628443717957, -0.011099954135715961, -0.0603806786...
edittext, the program should be able to recognize that "very" was typed and alert the user in some way. I hope I was able to make this clear without using any code. Any help that could be given would be greatly appreciated. This is the simplest form of doing it via **TextWatcher**: ``` String word = "very"; TextWatc...
[ 0.02124788612127304, -0.3017883598804474, 0.8104749321937561, -0.17352409660816193, 0.010342979803681374, -0.0983610600233078, 0.26333314180374146, 0.08228152990341187, -0.10399898886680603, -0.8091768026351929, -0.14246800541877747, 0.8609524369239807, -0.38624298572540283, -0.07653389871...
{ } public void afterTextChanged(Editable s) { String tmp = s.toString().trim().toLowerCase(); if(tmp.contains(word.toLowerCase())){ //inform the user here } } }; ```
[ 0.04639310762286186, -0.29467493295669556, 0.6777708530426025, -0.48909711837768555, 0.3513029217720032, 0.18575555086135864, 0.5016244649887085, -0.30857381224632263, -0.2122400403022766, -0.7439557313919067, -0.48282304406166077, 0.534605085849762, -0.3075093626976013, 0.1096666157245636...
Error is: > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an > error in your SQL syntax; check the manual that corresponds to your > MySQL server version for the right syntax to use near 'book\_id = > 'DSP123'' at line 1 > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Metho...
[ -0.45724356174468994, 0.3267402946949005, 0.0506189689040184, -0.049872152507305145, -0.21162845194339752, 0.2521686851978302, 0.5733255743980408, -0.477252334356308, -0.21538205444812775, -0.6820685267448425, 0.13152523338794708, 0.5640628337860107, -0.25790107250213623, 0.002387834247201...
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) > at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) > at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) > at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListen...
[ -0.29031381011009216, -0.04166329279541969, 0.4053232967853546, -0.2936224639415741, -0.04123624041676521, 0.5289419293403625, 0.33065342903137207, -0.7164096832275391, -0.37632080912590027, -0.631784200668335, -0.2764701843261719, 0.6599398255348206, -0.3006211221218109, -0.23920992016792...
String bookid = jTextField2.getText(); String doi = ""; Calendar cal = new GregorianCalendar(); doi = doi + cal.get(Calendar.YEAR) + "-" + cal.get(Calendar.MONTH) + "-" + cal.get(Calendar.DAY_OF_MONTH); String sql = "insert into library.issue values ('"+ bookid + "','librarian','"+ username + "','" + do...
[ 0.14022204279899597, -0.07827111333608627, 0.5313218832015991, -0.08394657075405121, 0.0855766087770462, 0.009416049346327782, 0.16799485683441162, -0.3453707993030548, -0.015406119637191296, -0.21913820505142212, -0.26481786370277405, 0.4865596294403076, -0.4239622950553894, 0.24048526585...
if(i>0) JOptionPane.showMessageDialog(null,"BOOK IS ISSUED","SUCCESS",JOptionPane.PLAIN_MESSAGE); else JOptionPane.showMessageDialog(null,"problem in issuing book","FAILURE",JOptionPane.ERROR_MESSAGE); bookid = bookid.toUpperCase(); String sql1 = "update library.books set s...
[ 0.11589627712965012, 0.10767820477485657, 0.3412218391895294, -0.24297286570072174, 0.19906409084796906, -0.02304568514227867, 0.26375049352645874, -0.6226682066917419, -0.04017198085784912, -0.37672871351242065, -0.5942768454551697, 0.26276594400405884, -0.2975465953350067, 0.125519633293...
//int j = st.executeUpdate(sql1); } catch(Exception ex) { ex.printStackTrace(); } } ``` Insert a space before `where`: ``` String sql1 = "update library.books set status = " + 1 + " where book_id = '" + bookid + "'"; ```
[ 0.15440838038921356, 0.0509328693151474, 0.4375956952571869, -0.13507288694381714, 0.3742910921573639, -0.14050565659999847, 0.14121027290821075, -0.45549124479293823, -0.06385860592126846, -0.3855378031730652, -0.38767802715301514, 0.36528512835502625, -0.32159483432769775, 0.082574866712...
I'm using a HTML 5 Reset Wordpress Theme as a framework for a project. The problem I'm having is with a plugin - slidedeck - that doesn't work, more precisely, the javascript doesn't load. This is the link to the website: <http://melisayavas.com/web> (on the homepage the text should slide). This is what I have in m...
[ 0.10769885778427124, 0.1429036259651184, 0.3909418284893036, -0.09760363399982452, 0.04769954830408096, -0.01697372831404209, 0.10559384524822235, -0.003356907283887267, -0.15289883315563202, -0.6420217752456665, -0.0929177924990654, 0.49129337072372437, -0.33959725499153137, 0.22659835219...
wp_register_script('jquery', ("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"), false); wp_enqueue_script('jquery'); } } core_mods(); } ``` In header.php the only script I have is this: ``` <script src="<?php bloginfo('template_directory'); ?>/_/js/modern...
[ -0.01848079264163971, 0.16798751056194305, 0.4855475425720215, -0.008068285882472992, 0.06250044703483582, -0.01638798415660858, 0.4782728850841522, -0.1763724386692047, -0.05538290739059448, -0.7385966777801514, 0.07282435894012451, 0.6547226309776306, -0.22807691991329193, -0.01574252545...
it. In your code you used ``` wp_deregister_script('jquery'); wp_register_script('jquery', ("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"), false); wp_enqueue_script('jquery'); ``` and as a result you got this error `Failed to load resource: the server responded with a status of 404 (Not Found)` bec...
[ -0.12375719100236893, -0.27988290786743164, 0.3774257004261017, 0.439728707075119, 0.23090128600597382, -0.1512194573879242, 0.2955527901649475, 0.35344481468200684, -0.07251355797052383, -0.8810422420501709, -0.3562159240245819, 0.6962198615074158, -0.1537143737077713, 0.17280374467372894...
I am learning x86 assembler in order to write a compiler. In particular, I'm taking a variety of simple recursive functions and feeding them through different compilers (OCaml, GCC etc.) in order to get a better understanding of the kinds of assembler generated by different compilers. I've got a trivial recursive inte...
[ 0.21469268202781677, 0.04655689001083374, 0.25730380415916443, -0.13651302456855774, 0.16041512787342072, 0.015642618760466576, 0.27837419509887695, -0.13636627793312073, -0.05462673306465149, -0.7999781370162964, -0.22022418677806854, 0.6530477404594421, -0.49969685077667236, -0.092138931...
fib push eax mov eax, [esp+4] add eax, -2 call fib add eax, [esp] add esp, 8 fin: ret ``` Compiling that function to Intel-syntax assembler using `gcc -O2` produces this enigmatic code: ``` _fib: push edi push esi push ebx sub esp, 16 mov edi, DWORD PTR ...
[ -0.2981710135936737, -0.11757176369428635, 0.9432518482208252, -0.47429367899894714, -0.05165336653590202, 0.2295408397912979, 0.1537841260433197, -0.48187848925590515, 0.1638294905424118, -0.5643749833106995, -0.34872370958328247, 0.5610396265983582, -0.7739868760108948, -0.13676886260509...
cmp edi, 1 jle L4 mov ebx, edi xor esi, esi L3: lea eax, [ebx-1] mov DWORD PTR [esp], eax call _fib sub ebx, 2 add esi, eax cmp ebx, 1 jg L3 and edi, 1 L2: lea eax, [esi+edi] add esp, 16 pop ebx pop esi pop edi
[ -0.37143266201019287, 0.19212894141674042, 0.9189758896827698, 0.18401239812374115, -0.06757738441228867, 0.5031663775444031, -0.11017738282680511, -0.31664860248565674, -0.2329120635986328, -0.5303739905357361, -0.5090717673301697, 0.19347839057445526, -0.41226205229759216, -0.27010869979...
ret L4: xor esi, esi jmp L2 ``` So I guess the calling convention is argument at `[esp+4]` and return value in `eax`. It starts by pushing `edi`, `esi` and `ebx`. Then it claims another 16 bytes for a stack frame, enough for 4 temporary ints. Then `edi` is read from `[esp+32]`, which is the argument. If the a...
[ -0.04965244233608246, -0.01757355034351349, 0.9940581321716309, -0.44409558176994324, 0.07265061885118484, 0.5140726566314697, 0.16868017613887787, -0.5114672780036926, -0.14340753853321075, -0.48243197798728943, -0.41989538073539734, 0.7928861379623413, -0.45129820704460144, 0.00280467863...
into `ebx` and zeroes `esi` before falling through into `L3`. In `L3`, it sets `eax=ebx-1` and stores the result (n-1) at `esp` in the stack frame before recursing to calculate `fib(n-1)`. The result is added to `esi`, `ebx` is set to `n-2` and it loops back to `L3` if `ebx>1` otherwise it extracts the lower bit of `ed...
[ -0.3524283170700073, -0.05056310445070267, 0.5362170934677124, -0.5123803615570068, -0.02380256913602352, 0.14025941491127014, 0.2583487629890442, -0.3973076045513153, -0.01293223723769188, -0.6294376254081726, -0.381858766078949, 0.2882581651210785, -0.5438854694366455, -0.164707094430923...
call wasn't in tail position so how was this done? What is the purpose of the `and edi, 1`? What is the purpose of the `mov DWORD PTR [esp], eax`? Why is the stack frame so large? Can you disassemble this algorithm back into C to make it clearer what is going on? My preliminary impression is that GCC generates pre...
[ 0.07218098640441895, 0.1023472249507904, 0.3665013909339905, 0.0312291719019413, 0.014707324095070362, -0.27431124448776245, 0.2254069596529007, -0.4131562411785126, -0.21531341969966888, -0.18337278068065643, -0.17356032133102417, 0.7303310632705688, -0.5269507765769958, 0.061828505247831...
x < 2 ? x : fib(x - 2) + fib(x - 1); ``` with: ``` if ((xprime = x) < 2) { acc = 0; } else { /* at this point we know x >= 2 */ acc = 0; /* start with 0 */ while (x > 1) { acc += fib(x - 1); /* add fib(x-1) */ x -= 2; /* now we'll add fib(x-2) */ } /* so at this
[ -0.015965929254889488, -0.19409219920635223, 0.9567392468452454, -0.20208299160003662, -0.08942970633506775, -0.12865853309631348, -0.061905913054943085, -0.6157847046852112, -0.14543847739696503, -0.7067140936851501, -0.268425852060318, 0.6664758324623108, -0.5390615463256836, -0.14950822...
point we know either x==1 or x==0 */ xprime = x == 1 ? 1 : 0; /* ie, x & 1 */ } return xprime + acc; ``` I suspect this rather tricky loop arose from multiple optimization steps, not that I have fiddled with gcc optimization since about gcc 2.3 (it's all very different inside now!).
[ -0.37382271885871887, 0.10140468925237656, 0.7578534483909607, -0.0968010425567627, -0.13140392303466797, -0.2598796486854553, -0.04434017091989517, -0.3882122337818146, -0.05766310170292854, -0.4081699550151825, 0.0938449278473854, 0.5911729335784912, -0.028460931032896042, 0.127863883972...
I'm using [jFeed](https://github.com/jfhovinne/jFeed) to try to retrieve a Facebook page's RSS feed. I can manually navigate to the RSS just fine (<https://www.facebook.com/feeds/page.php?format=atom10&id=12345>) but when I try to use the following code, I end up with the error **"Origin xxxxx is not allowed by Access-...
[ 0.3084571063518524, -0.08276611566543579, 0.36431628465652466, -0.00033159274607896805, 0.12972280383110046, -0.21504421532154083, 0.44733017683029175, -0.015780992805957794, -0.2936084568500519, -0.6115356087684631, -0.1347576379776001, 0.41572824120521545, -0.39019158482551575, -0.028345...
got it working!!! I'm using the app ID and secret code to get the access\_token and then using the jquery getJSON method to get the data. Works like a charm, no facebook auth required!!! ``` appID = '' //myappid secretCode = '' //app "secret code" authURL = 'https://graph.facebook.com/oauth/access_token?client_id=' + ...
[ 0.20363402366638184, -0.24639156460762024, 0.9068502187728882, 0.019075097516179085, 0.3338947594165802, -0.1188209056854248, 0.5604609251022339, -0.29321664571762085, -0.3256145417690277, -0.3727726340293884, -0.3085709512233734, 0.5926847457885742, -0.25314760208129883, -0.25175938010215...
alert(item.message); //type: status, photo //likes.count //from.name //created_time }); });
[ -0.00785567332059145, -0.34996873140335083, 0.6741886734962463, -0.4249940514564514, 0.2913393974304199, -0.06163303181529045, 0.23523543775081635, -0.24730919301509857, -0.20146837830543518, -0.39116349816322327, -0.6475176811218262, 0.6224343180656433, -0.5464532971382141, 0.205997362732...
}); }; ``` Obviously you'd want to do something besides "alert", but it works. Quite simple compared to anything else I've found.
[ 0.2639941871166229, -0.13074623048305511, 0.22719427943229675, -0.16265667974948883, 0.06510107964277267, -0.35940733551979065, 0.21778035163879395, 0.18009646236896515, 0.1845758855342865, -0.3952700197696686, -0.1752326786518097, 0.8728378415107727, -0.49256953597068787, -0.1533343642950...
I know this is a quite easy problem but I just want to solve it for myself once and for all I would simply like to split a string into an array using a character as the split delimiter. (Much like the C#'s famous **.Split()** function. I can of course apply the brute-force approach but I wonder if there anything bette...
[ 0.27316203713417053, -0.021557172760367393, -0.21338172256946564, -0.051003798842430115, -0.5156350135803223, 0.10530809313058853, 0.24582667648792267, 0.13955356180667877, -0.04437876120209694, -0.637380838394165, -0.0026243936736136675, 0.3031117916107178, -0.252179354429245, 0.068530268...
to implement this? **Note:** I wanted to emphasize this because people might ask "How come brute-force doesn't work". My brute-force solution was to create a loop, and use the **substr()** function inside. However since it requires the **starting point** and the length, it fails when I want to split a date. Because us...
[ 0.35075098276138306, -0.31722626090049744, 0.2710651457309723, -0.29390984773635864, 0.1426454782485962, -0.2497987598180771, 0.6272262930870056, -0.28299829363822937, -0.20035572350025177, -0.4183206260204315, 0.02365150861442089, 0.10584534704685211, -0.37862634658813477, 0.3238123953342...
vector with the same contents as ``` std::vector<std::string> seglist{ "this", "is", "a", "test", "string" }; ```
[ -0.37222957611083984, -0.3359678089618683, 0.3875334858894348, 0.04243481531739235, -0.18332549929618835, 0.19702991843223572, -0.11241665482521057, -0.06220855563879013, -0.17232969403266907, -0.509378969669342, -0.18979792296886444, 0.4096463918685913, -0.47831612825393677, -0.0034029211...
How can i redirect users coming to my app on facebook (canvas app) to the mobile version of the same.. i know that can be achieved using this ``` <script type="text/javascript"> <!-- if (screen.width <= 699) { document.location = "mobile.html"; } //--> </script> ``` But how can i achieve this without putting a redi...
[ 0.3382420837879181, -0.006956448312848806, 0.8454225063323975, -0.15386752784252167, -0.13029745221138, 0.16537337005138397, 0.2914196848869324, -0.32904359698295593, -0.4468265771865845, -0.9166321158409119, -0.18286634981632233, 0.6136430501937866, -0.348711222410202, -0.0286035444587469...
website instead of canvas ...
[ 0.8780263662338257, -0.42239630222320557, 0.06237886846065521, 0.12787163257598877, -0.21402616798877716, -0.17836140096187592, 0.10984963178634644, 0.2218261957168579, -0.48822247982025146, -0.8273806571960449, 0.03931140527129173, 0.1922951191663742, -0.050926435738801956, 0.065737664699...
I am iterating a form in **phtml** page how can i Submit or validate the form when i click in the button. because when i am iterating the form , the id is the same for all form i am using Zend Framework , i initiate the Form in my view like this to get different ids for each form ``` <?php $commentForm = new...
[ 0.4200739860534668, -0.04658171534538269, 0.8019310235977173, -0.07808514684438705, -0.0574093796312809, -0.14861661195755005, 0.1237441897392273, -0.6106119751930237, 0.011224486865103245, -0.6373513340950012, -0.080116868019104, 0.43390554189682007, 0.01658417470753193, -0.01057124789804...
a way in Jquery to handle that? I will say, no its not the good way, attaching ID, like that. Configure zend's form to take the id as a hidden paramter, which at last renders as ``` <form id="comment_form" method="post" action=""> <input type="hidden" name="answer_id" id="answer_id" value="64623" /> ``` Next con...
[ 0.0509328618645668, -0.1358417123556137, 0.5915159583091736, -0.01059504970908165, -0.025857174769043922, -0.18746115267276764, 0.1782335340976715, -0.31092920899391174, 0.008707284927368164, -0.5563172101974487, -0.3396509885787964, 0.7611517310142517, -0.04780729115009308, -0.08838622272...
I am trying to make my own CMS and I am pretty new in php and mysql. Let me get to the point: So far I've created news in index page with "read more" permalinks (which means, when I press read more, it moves me to other page e.g. `/readmore.php?id=[news ID]` and in that page the only content is those specific news i.e...
[ 0.37926068902015686, 0.25417211651802063, 0.4897458255290985, 0.14556767046451569, -0.15236951410770416, -0.13377363979816437, -0.041688065975904465, 0.28330278396606445, -0.4130686819553375, -0.8432132005691528, -0.03207718953490257, 0.5338683724403381, 0.08815082907676697, 0.339332163333...
news content... */ echo "<a href='readmore.php?id=".$row['ID']."'>".$read_more_link."</a></div>"; } ``` readmore.php with exact row (for example readmore.php?id=1201) : ``` $params = $_SERVER['QUERY_STRING']; $str = $params; $id1 = $str[strlen($str)-1]; $id2 = $str[strlen($str)-2]; $id3 = $str[strlen($str)-3]; $i...
[ 0.3814103603363037, 0.07230730354785919, 0.538565456867218, 0.21266435086727142, -0.41319286823272705, -0.05918941646814346, 0.36586013436317444, -0.11982231587171555, -0.24449098110198975, -0.23897263407707214, -0.2443457692861557, 0.3834148645401001, -0.28714486956596375, 0.2279838919639...
index page as it should, but in readmore page only the last one or the first one (depends on desc or asc) which was quite obvious to expect Can you help me? I would appreciate it. You can access the values in the query string by name in the `$_GET` array. For example, `$_GET['id']` will be the value of the `id=<ID>` ...
[ 0.176421120762825, 0.04787512868642807, 0.7127511501312256, 0.21643880009651184, -0.26818743348121643, -0.14608050882816315, 0.10980036109685898, -0.09878772497177124, -0.13321764767169952, -0.8804448843002319, -0.2341584414243698, 0.6652140021324158, 0.010612072423100471, 0.04646152630448...
the various tutorial you can find on the web : <http://www.w3schools.com/php/php_get.asp> **Update** Since you accepted my answer, I feel obligated to also throw a word about SQL injection. You should always sanitize any input you're using in a SQL query with [`mysql_real_escape_string`](http://php.net/mysql_real_esc...
[ -0.039032649248838425, 0.15610694885253906, 0.1411474049091339, 0.27342307567596436, -0.3670535683631897, -0.061285194009542465, 0.4869123101234436, -0.10633805394172668, 0.22000977396965027, -0.472846120595932, -0.19363252818584442, 0.5823484063148499, 0.010248684324324131, 0.025131933391...
I currently have an app which displays google maps to the user using MapView. I have been trying to place a marker on the map using this code, ``` public boolean onTouchEvent(MotionEvent event, MapView mapView) { if (event.getAction() == 1) { GeoPoint p = mapView.getProjection().fromPixels((int) e...
[ 0.06149180978536606, -0.1627391278743744, 1.0441608428955078, 0.03646116703748703, 0.21204127371311188, 0.04428042098879814, 0.1153407171368599, -0.09734971821308136, -0.04207392781972885, -1.038344144821167, -0.13238735496997833, 0.5095536112785339, 0.15236374735832214, 0.4205592572689056...
mapView.getOverlays().add(demoOverlay); mapView.invalidate(); } return false; } ``` I have a Demo Overlay set up which puts a marker on the map, however when I touch the screen the marker never appears. Any help would be appreciated !!! Thanks for suggestions but I have decided to f...
[ 0.2998230457305908, -0.18454264104366302, 0.5169361233711243, 0.17862112820148468, 0.22801220417022705, -0.4164622128009796, 0.39126378297805786, -0.15308067202568054, -0.2937110364437103, -0.9296251535415649, 0.1020888090133667, 0.5566939115524292, 0.18764305114746094, -0.0314834453165531...
question, <http://thenewboston.org/watch.php?cat=6&number=141>
[ 0.3681567311286926, -0.3107195198535919, 0.46464383602142334, 0.2984308898448944, 0.16829471290111542, 0.2038656324148178, 0.20765800774097443, -0.2820032238960266, -0.391958087682724, -0.14959539473056793, -0.10170836746692657, 0.15649811923503876, -0.04501953348517418, 0.2046454697847366...
class "org.mortbay.util.DateCache"'s signer information does not match signer information of other classes in the same package I am working on GWT and maven. My GWT code is in project2. It works fine when I run it alone but when I try to create a dependency on another project, I get this error. I also searched on goog...
[ 0.33974459767341614, 0.014627599157392979, 0.18809285759925842, 0.24828524887561798, -0.2430727779865265, -0.09106793999671936, 0.4113623797893524, 0.4473820924758911, -0.3263245224952698, -0.4599415063858032, 0.2767547070980072, 0.06579018384218216, 0.02839624136686325, 0.4147078394889831...
rid of this. Thanks Make your objects static and singleton, and load them on start up, so that whenever a new jar tries to initiate it, it will always return the same object. I know that some work should be done here, but you need it!
[ 0.29769259691238403, 0.1236639991402626, 0.13410530984401703, 0.48411643505096436, -0.16843514144420624, -0.13596877455711365, 0.2374725043773651, 0.20044687390327454, -0.3390795588493347, -0.3236963152885437, 0.04709760099649429, 0.39645782113075256, -0.30541837215423584, 0.22179804742336...
I think this is quite simple but after 2 days of trying I'm still clueless. Basically, I need to run one set of commands if the screen is over 767 pixels wide and another if the screen is under 767 pixels. When the screen is wider than 767 pixels, I want to: ``` <script type="text/javascript"> var jsReady = fals...
[ 0.11624294519424438, 0.007476639002561569, 0.6207944750785828, -0.2833634316921234, -0.21650393307209015, 0.07148841768503189, 0.529659628868103, -0.5682819485664368, -0.23556695878505707, -0.7535793781280518, -0.016951076686382294, 0.598495602607727, -0.0791236013174057, -0.01624947600066...
params.wmode = "transparent"; params.bgcolor = "#111111";//change flash bg color here params.devicefont = "false"; params.allowfullscreen = "true"; params.allowscriptaccess = "always"; var attributes = {}; attributes.id = "flashPreview"; swfobject.embedSWF("preview.swf", "flashPreview", "10...
[ 0.11256152391433716, -0.0577302984893322, 0.8623955249786377, -0.20509575307369232, -0.1561843454837799, 0.12290601432323456, 0.4799591898918152, -0.6302382946014404, -0.2422923743724823, -0.625754177570343, -0.13975657522678375, 0.5599734783172607, -0.3540661036968231, -0.1709866523742675...
$.supersized({ //Background image slides : [ { image : 'img/some_image.jpg' } ] }); }); </script> ``` That's right... For desktops and tablets, I want to show a full-screen video background. For smaller screens (less than
[ 0.4864882230758667, 0.023242367431521416, 0.6852856278419495, -0.03048386424779892, 0.2804825007915497, -0.2633926272392273, 0.17385052144527435, 0.18233975768089294, -0.18317359685897827, -0.6515721678733826, -0.12285187095403671, 0.7896042466163635, -0.25954174995422363, 0.03222972154617...
767 pixels), I want to show a single still image background. You can get the currect size of windows using `$(window).width()` and attach a handler on the resize event of the form. For a simple use, It is as simple as ``` $(window).resize(funcion() { $width = $(window).width(); if($width < 767) { ...
[ 0.5707390904426575, -0.48549607396125793, 0.9474934935569763, -0.07630643248558044, 0.021070627495646477, 0.08672062307596207, -0.23602642118930817, -0.15715816617012024, -0.23528717458248138, -0.526783287525177, -0.004120446275919676, 0.7025114297866821, -0.3502635657787323, -0.0944060981...
: [ { image : 'img/some_image.jpg' } ] }); } else { //if width is greater than 767 } }); ```
[ 0.05615398660302162, -0.2148313969373703, 0.5577839612960815, -0.3384813368320465, -0.04042524844408035, -0.12262389808893204, 0.15638597309589386, -0.19421979784965515, -0.33843451738357544, -0.44765183329582214, -0.5532509088516235, 0.6205494999885559, -0.17955362796783447, 0.05086863413...
I have Devise and CanCan in my Rails app. I think by default, it should redirect users to sign-in page if users try to login to unauthorized page. But somehow, it doesn't work for my app. How to I implement a checking if users are authorized and redirect to home if not globally (i.e., for all controllers/methods)? **...
[ 0.3076854944229126, -0.24216656386852264, 0.5547839403152466, 0.035115569829940796, -0.009249533526599407, -0.16476970911026, 0.26574766635894775, -0.19347701966762543, -0.015667980536818504, -0.9062879085540771, 0.22887367010116577, 0.5656235218048096, -0.22236889600753784, 0.188385516405...
$width = $(window).width(); if($width < 767) { $.supersized({ //Background image slides : [ { image : 'img/some_image.jpg' } ] });
[ 0.173827663064003, -0.3374077379703522, 0.7651718854904175, -0.3884982764720917, -0.017999621108174324, -0.07021082192659378, -0.035768695175647736, -0.09324606508016586, -0.34787359833717346, -0.4392159879207611, -0.3321097195148468, 0.6363376975059509, -0.3352220952510834, 0.190619811415...
} else { //if width is greater than 767 } }); ```
[ 0.11286085098981857, 0.0443880669772625, 0.4958161413669586, -0.5748924016952515, 0.3842686414718628, -0.10338659584522247, 0.20045101642608643, -0.09871751070022583, -0.16580574214458466, -0.5297413468360901, -0.5297247171401978, 0.8469451665878296, -0.1831568330526352, 0.1238531246781349...
I have a new 256 gig **SSD** drive which replaced my MacBook Pro's CD drive. The goal is to make `MonoDevelop` + `MonoTouch` app development the fastest possible. How can I get `MonoDevelop` + `MonoTouch` + (not sure what else, `xcode` perhaps?) moved to the **SSD** drive to make developing the fast. This is the only ...
[ 0.05976366996765137, 0.26993292570114136, 0.4340917468070984, -0.05157702788710594, 0.04458211362361908, 0.13722656667232513, 0.12373404949903488, -0.07849728316068649, -0.0925067737698555, -0.63663649559021, -0.014993655495345592, 1.020371437072754, -0.2674974203109741, 0.0772628486156463...
the IDE exclusively. @sblom covers the major pieces. You also need to be aware that: * a lot of temporary files gets created (mostly in `\var\tmp`) by the compilers; * a lot of system libraries will also be loaded; For both cases the comment (from Sebastian Flückiger) hits the nail. You'll get the best performance if...
[ 0.5643814206123352, 0.12418168783187866, 0.007595712319016457, 0.21431437134742737, -0.26415836811065674, -0.3516000509262085, 0.2934757173061371, -0.4019280672073364, -0.14761604368686676, -0.4687305688858032, -0.5695779323577881, 0.4965226352214813, -0.4475509524345398, 0.108768917620182...
their default directories (which can be useful when creating/sharing scripts).
[ 0.16790182888507843, 0.05008329078555107, 0.356454074382782, 0.23409056663513184, 0.21344289183616638, -0.12631352245807648, 0.3339082896709442, 0.3606323003768921, -0.10906656831502914, -0.47764769196510315, -0.7697843313217163, 0.23396873474121094, -0.09184356033802032, 0.003171574790030...
I am having a little bit of issues with some Undefined index. I realize this could be solved by changing it the error reporting using `error_reporting(E_ALL);`, or `ini_set('display_errors', '1');`, but would like to solve this without the need to change that. Right here is my block of code that throws the error. ```...
[ 0.17244908213615417, 0.4435718059539795, 0.17288802564144135, -0.2599217891693115, 0.02358446829020977, -0.14881962537765503, 0.4973974823951721, -0.22748908400535583, -0.023184549063444138, -0.6949695348739624, 0.1573573797941208, 0.6434370279312134, -0.41685983538627625, 0.08769553899765...
foreach ($errors as $key => $value) { var_dump($value); if (isset($value) == null or empty($value)){ $value = ' A blank value '; }
[ -0.23584745824337006, 0.1881050169467926, 0.1268034428358078, -0.5596470236778259, 0.36885419487953186, 0.4271104335784912, 0.2919290065765381, -0.1641329526901245, 0.18074099719524384, -0.2618652284145355, -0.5281463861465454, 0.6157063245773315, -0.4074222445487976, 0.011586887761950493,...
echo '<p>Please check '. $key . ' for errors.' . $value . 'is not a valid entry.</p>'; } echo '</div>'; } ``` The part that processes my form on submit is ``` if(isset($_POST['Submit'])){ //create the fields you would want required and what fields
[ 0.29182955622673035, 0.17575229704380035, 0.41684281826019287, -0.10510054230690002, 0.09022513031959534, -0.1346164494752884, 0.19948747754096985, -0.7625302672386169, 0.1807517111301422, -0.4315129518508911, -0.21627329289913177, 0.2375408262014389, -0.4191267192363739, -0.08240620791912...
on form to check. $fields = array( 'required' => array( 'name' => '^[a-zA-Z\`\-\s]{1,30}$', //only letters plus apostrophe and hyphens, and up to 30 characters 'Address1' => '^[a-zA-Z0-9\s\.]{1,50}$' // only letters plus numbers, spaces, periods, and up to 30 characters ), ...
[ 0.024083100259304047, 0.12010875344276428, 0.5433673858642578, -0.06739630550146103, 0.06714564561843872, 0.1034233495593071, 0.5049411654472351, -0.45299312472343445, 0.12620921432971954, -0.6408348083496094, -0.5858691334724426, 0.377182275056839, -0.3131239712238312, -0.0622593127191066...
'Address1' => $_POST['Address1'], 'Address2' => $_POST['address2'] ), 'redirect' => 'thankyou.php' ); $errors = TForm::validate($fields); // if no errors redirect if (empty($errors)){ TForm::redirect($fields); } } ``` And my TForm class looks like this ``` class ...
[ 0.09894701838493347, -0.14720337092876434, 0.5490880608558655, -0.3589346408843994, -0.06553293019533157, 0.05687056854367256, 0.4977661073207855, -0.5509400367736816, 0.09335895627737045, -0.2699461281299591, -0.19364051520824432, 0.6289998888969421, -0.2131521850824356, 0.111890666186809...
public function validate($fields){ $errors = array(); foreach($fields['fields'] as $key=>$value) { foreach ($fields['required'] as $req_key => $req_value) { if ($key == $req_key){ $req_key = '\''.$req_value.'\'';
[ -0.20226368308067322, 0.06858274340629578, 0.36664724349975586, -0.22212821245193481, 0.17409537732601166, 0.049906935542821884, 0.49109551310539246, -0.3583315908908844, 0.31855472922325134, -0.13535352051258087, -0.7379387021064758, 0.7842217683792114, -0.4848953187465668, 0.126547083258...
if (preg_match($req_key , $value) == false) { $errors[$key] = $value; } } } }
[ -0.22069251537322998, -0.14769910275936127, 0.15318703651428223, -0.39605093002319336, 0.38054293394088745, -0.043910667300224304, 0.2549667954444885, -0.1411413550376892, 0.29183733463287354, -0.28005796670913696, -0.4245510995388031, 0.8537513613700867, -0.5515225529670715, 0.10673734545...
return $errors; } //redirect function public function redirect($fields){ header('Location: '. $fields['redirect']); } } ``` This is also the first class I have ever wrote so if anyone feels up to pointing out where I could have performed better or broke standards. ~~~~~~~~~~~~~~~~~~~~~~~~~~...
[ -0.04753011837601662, 0.2422255426645279, 0.09964482486248016, -0.16087199747562408, -0.020392192527651787, 0.0024923470336943865, 0.5446652173995972, -0.2531009614467621, 0.22786740958690643, -0.6783838868141174, -0.1930636763572693, 0.5992054343223572, -0.11559800058603287, 0.09502892196...
thinking correctly if it isn't empty it uses whatever is in `$_POST['Name']` and if it is empty it sets the value to `''`. ``` 'fields' => array( 'Name' => !empty($_POST['Name']) ? $_POST['Name']:'', 'Address1' => !empty($_POST['Address1']) ? $_POST['Address1']:'', 'Address2' => !e...
[ -0.36226749420166016, 0.016487056389451027, 0.28294575214385986, -0.32420945167541504, -0.005127504467964172, 0.36011722683906555, 0.6959137916564941, -0.32313403487205505, 0.07699494063854218, -0.699513852596283, -0.15301033854484558, 0.7715656161308289, -0.17665059864521027, -0.274995982...
'Name' => !isset($_POST['Name']) ? $_POST['Name']:'', 'Address1' => !isset($_POST['Address1']) ? $_POST['Address1']:'', 'Address2' => !isset($_POST['Address2']) ? $_POST['Address2']:'' ) ``` results in when name equals a valid variable, such as Frank Wiebenga ``` Please check Name for...
[ -0.520774245262146, 0.538101077079773, 0.044141996651887894, 0.02986248955130577, -0.24071428179740906, 0.4192570149898529, 0.42260244488716125, -0.34899216890335083, -0.13723808526992798, -0.5605654716491699, -0.250381737947464, 0.2829408645629883, -0.548825740814209, 0.13168153166770935,...
correctly ``` Please check Address1 for errors. A blank value is not a valid entry. ``` According to your update, you should use `isset` instead of `empty`, so you avoid the undefined index error: ``` $name = (isset($_POST['Name'])) ? $_POST['Name'] : ''; ``` More info on [isset](http://us2.php.net/isset). -- Upd...
[ -0.35473477840423584, 0.26100221276283264, 0.32777681946754456, -0.11476489901542664, -0.049655552953481674, -0.03857192024588585, 0.5102366805076599, 0.01098132599145174, -0.12658999860286713, -0.5391642451286316, -0.6209825873374939, 0.5983366370201111, -0.35225945711135864, -0.176384836...
I have a WCF Service Library containing a custom ServiceHostFactory derived from DefaultServiceHostFactory. I can't get the test client to use this factory. I just get the "no parameterless constructor was found" error. Here's my hosting enviroment configuration: ``` <serviceHostingEnvironment> <serviceActivations...
[ 0.32497212290763855, 0.22159290313720703, 0.5434036254882812, -0.4336203634738922, -0.07746684551239014, -0.0495593324303627, 0.5927876234054565, -0.27338939905166626, 0.06162169948220253, -1.033773422241211, -0.1024109348654747, 0.5456449389457703, -0.3491226136684418, 0.45889341831207275...
private static IKernel CreateKernel() { WindsorContainer container = new WindsorContainer(); container.AddFacility<WcfFacility>(); container.Register(Component.For<TestService>()); container.Register(Component.For<IServiceManager>().ImplementedBy<ServiceManager>()); return...
[ 0.2737880051136017, -0.20847271382808685, 0.3380504846572876, -0.012093969620764256, 0.014347830787301064, -0.049913663417100906, 0.569355309009552, -0.25907912850379944, -0.13982440531253815, -0.37756648659706116, -0.017358578741550446, 0.746507465839386, -0.4993184208869934, 0.3104780316...
since in this scenario their is no "main" or "application start" or anything. There is an interesting event on AppDomain called [AssemblyLoaded](http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyload.aspx) that looks like it may do the trick, hmm, but how to hook into it, a way I thought to do this is to...
[ -0.05118994414806366, -0.1262461394071579, 0.45883142948150635, -0.2599930465221405, 0.09223572909832001, 0.06344596296548843, 0.2922202944755554, -0.39026397466659546, -0.41828495264053345, -0.8196165561676025, -0.37485697865486145, 0.5513758659362793, -0.5847063660621643, 0.2260514646768...
base.InitializeNewDomain(appDomainInfo); // Look for any classes that implement IAssemblyLoaded, // constuct them (will only work if they have a default constructor) // and call the AssemblyLoaded method var loaded = typeof (IAssemblyLoaded); AppDomain .CurrentDomain...
[ 0.028876641765236855, -0.17243939638137817, 0.23614653944969177, -0.3606795370578766, 0.18851318955421448, 0.33417272567749023, 0.5040076971054077, -0.3352714776992798, -0.1872251182794571, -0.5339990258216858, -0.2057429850101471, 0.2951163649559021, -0.8159106969833374, 0.003971989732235...
=> { var handlers = a
[ 0.2248552441596985, -0.2471277266740799, -0.266099214553833, -0.2267906367778778, -0.16936659812927246, 0.11538732051849365, 0.5886957049369812, -0.22516317665576935, -0.07768406718969345, -0.19080081582069397, -0.19197958707809448, 0.30409902334213257, -0.6332361698150635, 0.0728229656815...
.LoadedAssembly .GetTypes() .Where(loaded.IsAssignableFrom);
[ 0.07307789474725723, -0.2393505573272705, 0.38625746965408325, 0.022525319829583168, 0.13245297968387604, -0.07447218149900436, 0.36023229360580444, -0.140076145529747, 0.05227777734398842, -0.4532482326030731, -0.22990922629833221, 0.626197874546051, -0.5927807688713074, -0.05395222082734...
foreach (var h in handlers) {
[ -0.07910973578691483, 0.07288855314254761, -0.076889269053936, -0.6076485514640808, -0.009287113323807716, 0.15437540411949158, 0.2643353343009949, -0.1926073431968689, 0.26128190755844116, -0.2538538873195648, -0.3802494406700134, 0.4746168553829193, -0.5252173542976379, -0.00561488373205...
((IAssemblyLoaded) Activator.CreateInstance(h))
[ 0.1786457747220993, -0.06383532285690308, 0.24954839050769806, 0.10439473390579224, 0.060626909136772156, -0.3367500901222229, 0.33882126212120056, -0.17151618003845215, -0.09040241688489914, -0.7307652831077576, -0.11454237252473831, 0.5187761783599854, -0.6008447408676147, 0.085917927324...
.AssemblyLoaded(); } }; } } ``` Make sure the assembly is signed and then add it to the GAC. Let's say I called the assembly AssemblyInitCustomDomainManager I can add it
[ 0.32468098402023315, 0.24300652742385864, 0.3474820554256439, -0.39140066504478455, -0.002376249525696039, -0.31741267442703247, 0.31417715549468994, 0.011857225559651852, -0.02628760226070881, -0.519218921661377, -0.17956814169883728, 0.8756711483001709, -0.33704906702041626, -0.133610025...
like so (and I get back the details about it straight away because I will need them): ``` gacutil /i AssemblyInitCustomDomainManager.dll gacutil /l AssemblyInitCustomDomainManager ``` Now edit the **WcfServiceHost.exe.config** (typically located at: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE or the x8...
[ 0.290842741727829, 0.29050374031066895, 0.5207207202911377, -0.29578477144241333, 0.0625128522515297, 0.009337188675999641, 0.33063894510269165, -0.2412533015012741, -0.47790655493736267, -0.8353715538978577, -0.3775624632835388, 0.49228987097740173, -0.5242083668708801, 0.1314557045698166...
what they need to be in your case.* OK, that was easy enough, now we will create a new "WCF Service Library" project in visual studio and it will create an app.config and a service for us (this is the project type you are wanting to test right, oh I hope so!). First of all, remove the **system.servicemodel** part fro...
[ 0.5413509607315063, 0.22719910740852356, 0.5603461861610413, 0.006290112622082233, -0.09145835041999817, -0.008605933748185635, 0.31519439816474915, -0.1121334359049797, -0.3065895736217499, -1.0387067794799805, -0.00006441978621296585, 0.8129482269287109, -0.18729427456855774, -0.06698750...
assembly you created earlier since you need to implement that interface. Now, create a new file and stick the following code in (we are just having a simple service with a dependency hosted by the Castle WCF Facility): ``` using System; using System.ServiceModel; using AssemblyInitCustomDomainManager; using Castle....
[ 0.36693713068962097, 0.1289045512676239, 0.1752646118402481, -0.20654796063899994, 0.06491917371749878, 0.12282735109329224, 0.6914228200912476, -0.4960305690765381, -0.2056136131286621, -0.5781279802322388, -0.13434970378875732, 0.5313699841499329, -0.43020159006118774, 0.3637023270130157...
public void AssemblyLoaded() { new WindsorContainer().Install(FromAssembly.This()); } } // This installer will set up the services public class ServicesInstaller : IWindsorInstaller {
[ 0.23319360613822937, 0.01587929017841816, 0.2342514842748642, -0.23093973100185394, 0.4347502887248993, 0.20650243759155273, 0.8220011591911316, -0.2596195340156555, -0.20752361416816711, -0.6178010106086731, -0.2848220467567444, 0.8687540888786316, -0.37420710921287537, 0.1253934651613235...
public void Install(IWindsorContainer container, IConfigurationStore store) { container .AddFacility<WcfFacility>(f => f.CloseTimeout = TimeSpan.Zero) .Register(Component
[ 0.3718356788158417, -0.5214621424674988, 0.3886452913284302, 0.031625982373952866, 0.3574022352695465, 0.014141343533992767, 0.2545241117477417, -0.3322167694568634, 0.04708162322640419, -0.3620840907096863, -0.09124894440174103, 0.8445342183113098, -0.4051332473754883, 0.35922732949256897...
.For<ITestDependency>() .ImplementedBy<TestDependency>(), Component
[ 0.04526631906628609, -0.4244619905948639, 0.049122974276542664, 0.48290398716926575, 0.07785788923501968, 0.02850409969687462, 0.18801851570606232, -0.36167630553245544, 0.07888352125883102, -0.364342600107193, -0.07603906840085983, 0.45384663343429565, -0.21327362954616547, 0.150898188352...
.For<IService1>() .ImplementedBy<Service1>() .AsWcfService(new DefaultServiceModel(WcfEndpoint
[ 0.12468256801366806, -0.28464794158935547, 0.7570934891700745, -0.06338587403297424, 0.19028139114379883, -0.25924816727638245, 0.4694922864437103, -0.23999300599098206, -0.31359413266181946, -1.072021484375, -0.14588166773319244, 0.4716953635215759, -0.19722944498062134, 0.214550435543060...
.BoundTo(new WSHttpBinding())) .AddBaseAddresses("http://localhost:9777/TestWcfServiceLibrary/Service1")
[ 0.2281973659992218, -0.28046008944511414, 0.5811033248901367, 0.14039480686187744, -0.03973788022994995, -0.199931338429451, 0.6925470232963562, 0.003716763574630022, -0.12759935855865479, -0.7803062200546265, -0.22512014210224152, 0.1298253834247589, -0.2732747793197632, 0.030246827751398...
.PublishMetadata(m => m.EnableHttpGet()))); } } // This is the contract of something we want to make sure is loaded // by Windsor public interface ITestDependency { int DoSomething(int value); }
[ 0.05424627289175987, -0.04885367676615715, 0.686782956123352, 0.1052306517958641, 0.19801712036132812, -0.19324027001857758, 0.1879245489835739, -0.5705865621566772, 0.005065954755991697, -0.6086202263832092, -0.009624401107430458, 0.7489967346191406, -0.37661606073379517, 0.13644210994243...
public class TestDependency : ITestDependency { public int DoSomething(int value) { return value; } } // Regular WCF service contract [ServiceContract] public interface IService1 { [OperationContract] string GetData(int value); }
[ 0.25039008259773254, -0.5863690972328186, -0.04387414827942848, 0.0386839434504509, 0.02945074252784252, 0.07751540094614029, 0.48561179637908936, -0.31392666697502136, 0.23944735527038574, -0.668963611125946, -0.18603140115737915, 0.6611450910568237, -0.39428025484085083, 0.08584630489349...
// Service implementation - notice it does not have a default // constructor public class Service1 : IService1 { private readonly ITestDependency _td; public Service1(ITestDependency td) { _td = td; } public string GetData(int value) {
[ 0.05749576538801193, -0.4667918086051941, 0.08189421147108078, -0.3144022524356842, 0.07221297174692154, 0.2682167589664459, 0.6652121543884277, -0.18435069918632507, 0.13797861337661743, -0.6101981401443481, -0.5707685351371765, 0.47014909982681274, -0.46403366327285767, 0.088865444064140...
int v = _td.DoSomething(value); return string.Format( "According to our dependency you entered: {0}", v); } } } ``` Click run and you will get an error message that says: > WCF Service Host cannot find any service metadata. This may cause the > client application to run impro...
[ 0.5913246273994446, -0.059450674802064896, 0.5002612471580505, -0.07284220308065414, 0.21811716258525848, -0.38524478673934937, 0.716126024723053, -0.46665918827056885, -0.21189595758914948, -0.6488451361656189, -0.14768117666244507, 0.9592176675796509, -0.3737810552120209, 0.4618303775787...
want to exit? Don't worry, just click **no**. The test client starts up, but sadly it does not have your service in it. No worries, just right-click add service... and put in the URL of the service (it is in the installer in the code - <http://localhost:9777/TestWcfServiceLibrary/Service1>). And there you go - WCF s...
[ 0.3792728781700134, -0.110074982047081, 0.5523195266723633, 0.26971161365509033, 0.20631472766399384, -0.20971955358982086, 0.502762496471405, 0.0023483685217797756, -0.033614322543144226, -0.46699121594429016, 0.1613900363445282, 0.2991263270378113, -0.05507669597864151, 0.319098919630050...
for...
[ 0.2538644075393677, 0.40374132990837097, 0.09260380268096924, 0.17779941856861115, 0.23126184940338135, 0.25546029210090637, 0.172294020652771, -0.2816582918167114, 0.010062706656754017, -0.47176167368888855, 0.043586667627096176, 0.2968389093875885, 0.09712415933609009, 0.0608603470027446...
so the following code is what I am using to try to generate a graph using pchart. I have been able to generate some of the graph. The graph at the moment looks like this: <http://befoz.netau.net/charts.php> when it should be looking like <http://befoz.netau.net/chart2.php> The second chart is based on values I manually...
[ 0.23347556591033936, -0.24152697622776031, 0.507656455039978, -0.004593162331730127, -0.08562704175710678, -0.028722794726490974, -0.11399635672569275, 0.0419313907623291, -0.47936543822288513, -0.9435245990753174, 0.4113381803035736, 0.4201889932155609, -0.4406965374946594, 0.125823661684...
the responses. ``` <?php /* CAT:Bar Chart */ /* pChart library inclusions */ include("pchart/class/pData.class.php"); include("pchart/class/pDraw.class.php"); include("pchart/class/pImage.class.php"); /* Create and populate the pData object */ $myData = new pData(); $myData->addPoints(array($Yes,$Result)...
[ -0.1669590324163437, -0.2845276892185211, 0.6095620393753052, 0.13586543500423431, -0.09644196182489395, 0.42767077684402466, -0.07359039038419724, -0.3480793833732605, -0.1618528664112091, -0.4865119159221649, -0.5483439564704895, 0.22565005719661713, -0.7214459180831909, -0.0997507497668...
= $row["Yes"]; $No[] = $row["No"]; $Undecided[] = $row["Undecided"]; } /* Create the pChart object */ $myPicture = new pImage(500,500,$myData); $myPicture->drawGradientArea(0,0,500,500,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); $myPicture->...
[ -0.04140722006559372, -0.23028869926929474, 1.2715551853179932, -0.10366328060626984, 0.09847236424684525, 0.5543475151062012, -0.22539471089839935, -0.0990254282951355, -0.10231321305036545, -0.4655146598815918, -0.001297249924391508, 0.5428372621536255, -0.40748146176338196, -0.163377061...
"4"=>array("R"=>176,"G"=>46,"B"=>224,"Alpha"=>100), "5"=>array("R"=>224,"G"=>46,"B"=>117,"Alpha"=>100), "6"=>array("R"=>92,"G"=>224,"B"=>46,"Alpha"=>100), "7"=>array("R"=>224,"G"=>176,"B"=>46,"Alpha"=>100)); /* Draw the chart */ $myPicture->drawBarChart(array("DisplayP...
[ 0.1387389898300171, -0.04335276409983635, 0.8080249428749084, -0.0011995106469839811, 0.28819262981414795, 0.24836696684360504, -0.19806049764156342, -0.32914677262306213, -0.18389804661273956, -0.5715146660804749, -0.19189400970935822, 0.5566672086715698, -0.1194111555814743, -0.425966322...
Undecided 16 Yes CREATE TABLE `replies` ( `ID` INTEGER NOT NULL AUTO_INCREMENT, `Do you have an interest in Green IT` VARCHAR(50), `Do you think Green IT is a good a thing` VARCHAR(50), `Would you welcome Green IT if it helped the environment` VARCHAR(255), `Would you welcome Green IT if you saved money` VARCHAR(...
[ 0.09692665189504623, 0.17759163677692413, 0.3288807272911072, 0.036066945642232895, 0.05447734147310257, -0.05936623364686966, -0.1896364539861679, -0.09434004873037338, -0.5057311058044434, -0.14352896809577942, -0.3663807511329651, 0.4040265679359436, 0.05106672644615173, -0.431523174047...
VARCHAR(50), `If you did not fill in the quesionnaire, why not` VARCHAR(255), PRIMARY KEY (`ID`) ) ENGINE=myisam DEFAULT CHARSET=utf8; ``` Where am I going wrong? Thanks Assuming that there is one record per respondent the query should be something like this - ``` SELECT `Do you have an interest in Green IT`, COUN...
[ -0.2040242850780487, -0.030983032658696175, 0.40365442633628845, 0.07337088137865067, 0.09995918720960617, 0.04829379543662071, -0.044463418424129486, -0.14928513765335083, -0.3135162889957428, -0.2864575684070587, -0.3129763901233673, 0.6568391919136047, -0.05815653130412102, 0.0001354931...
CAT:Bar Chart */ /* pChart library inclusions */ include("pchart/class/pData.class.php"); include("pchart/class/pDraw.class.php"); include("pchart/class/pImage.class.php"); /* Create and populate the pData object */ $myData = new pData(); $myData->setAxisName(0,"Number of Responses"); $myData->setSerieDescri...
[ -0.18932755291461945, -0.20075948536396027, 0.9509341716766357, -0.06995218247175217, 0.05666256323456764, 0.3618333339691162, -0.02029058150947094, -0.3748970925807953, -0.36323845386505127, -0.5530971884727478, -0.37588900327682495, 0.2105265110731125, -0.9366503357887268, -0.15063123404...
but this should give you some idea.
[ 0.34896302223205566, -0.0038693698588758707, -0.09705185890197754, 0.13690319657325745, 0.17162802815437317, -0.2799552083015442, 0.02364913374185562, 0.22120995819568634, -0.0640581026673317, -0.19137251377105713, 0.490152508020401, 0.09739218652248383, 0.24205899238586426, 0.037224233150...
I have a string `"SOMETHING /\xff"` and I want to save the hex representation of `0xff` into a `char` buffer. So I `strncpy` everything after the forward slash (`/`) into my buffer (let's call it `buff`). However, when I use the gdb command `print \x buff` to view the contents of `buff`, it doesn't show `0xff`. Any i...
[ 0.3399659991264343, 0.47713130712509155, 0.37834593653678894, -0.20116974413394928, 0.00714311096817255, -0.021659206598997116, 0.26939865946769714, 0.06729879975318909, -0.07817720621824265, -0.43299806118011475, 0.06473803520202637, 0.6929992437362671, -0.327443927526474, 0.3602765798568...
gcc), and run and break at the first `puts` statement: ``` int main(void) { char *ptr = "str \xff"; char arr[] = "str \xff"; puts(ptr); puts(arr); return 0; } ``` If I try and print `ptr` the way you've mentioned, `p /x ptr`, it'll print the value of `ptr` (the address it's pointing to): ``` (gdb) p...
[ -0.08075836300849915, 0.033823441714048386, 0.6690694093704224, -0.40503519773483276, 0.03514229133725166, 0.03279605135321617, -0.026933951303362846, -0.2964598536491394, -0.29709312319755554, -0.14161276817321777, -0.2943781316280365, 0.6131542325019836, -0.38339516520500183, 0.353520959...
same results with the command `p /x "str \xff"`, which is useful for testing things: ``` (gdb) p /x "str \xff" $3 = {0x73, 0x74, 0x72, 0x20, 0xff, 0x0} ``` Now if you want to be able to print a certain amount of bytes from the address pointed to by a pointer, use the examine (`x`) memory command instead of print (`p...
[ 0.21500815451145172, 0.44434118270874023, 0.5103121995925903, -0.10768347233533859, -0.004761229734867811, 0.04849189892411232, 0.15959414839744568, -0.45302197337150574, -0.2748381793498993, -0.5156430602073669, 0.11144669353961945, 0.6350979208946228, -0.12256943434476852, 0.253296673297...
and see how you go. Alternatively, another thing you can try is: ``` (gdb) p /x (char[6])*ptr $4 = {0x73, 0x74, 0x72, 0x20, 0xff, 0x0} ``` This will treat the `char` pointed to by `ptr` as the first element in an array of 6 `char`s, and will allow you to use the print command.
[ 0.3064669966697693, 0.15596434473991394, 0.3566564619541168, -0.39324116706848145, 0.04834636673331261, -0.08913455158472061, 0.09555727988481522, -0.25179895758628845, -0.023824000731110573, -0.3674905300140381, -0.06333624571561813, 0.7286428213119507, -0.3267759084701538, 0.073494449257...
I'm trying to stop class B from accessing DoSomething(Class Y) function and only access DoSomething(Class X) . How can I do that in C++ ?. ``` Class A { public: void DoSomething(Class Y); } Class B: public A { public: void DoSomething(Class X); } ``` You can make `A::DoSomething(Class Y)`...
[ 0.42121949791908264, 0.1502961367368698, 0.08908217400312424, -0.1585705727338791, 0.09820093214511871, -0.2618398368358612, 0.47552886605262756, -0.14016684889793396, -0.14383210241794586, -0.4864862561225891, -0.11001013219356537, 0.6897568106651306, -0.5178642272949219, 0.38960570096969...
the only way to deny access.
[ -0.06896138191223145, 0.3271542191505432, -0.07375144958496094, 0.2782656252384186, -0.05495235696434975, 0.033873554319143295, 0.37691083550453186, -0.01806773617863655, -0.019191155210137367, -0.0653006061911583, -0.09247913211584091, 0.1403726190328598, -0.20050011575222015, 0.085379205...