Posts

Showing posts from July, 2014

java - Scripts/tags getting removed in text when using antisamy.jar/xml -

i using antisamy.xml , antisamy.jar preventing xss. when enter script tag in text box truncates , other text apart tag stored in database. i want store script/tag in database too, without applying script/tag. for example, if enter alert(); in text box on jsp page. want whole thing saved in db should not alert on ui.

c# - Cannot open browse in a datagridview -

Image
i have datagridview seen in picture , openfiledialog has open when click on "browse file". believe there no way become possible if write code under button_click methods dont know under method write code. please help. as far have made this: (hope helps) string[] col2 = new string[datagridview1.rows.count]; (int = 0; < datagridview1.rows.count; i++) if (col2[i] == "browse file...") { dialogresult result2 = openfiledialog2.showdialog(); if (result2 == dialogresult.ok) { filename = openfiledialog1.filename; } } place code in datagridview.cellvaluechanged event. use selectedcells property find current cell, check if value "browse file...". if so, fire off openfiledialog.showdialog() call. see documentation cellvaluechanged: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvalu...

c++ - Compile error "'struct' type redefinition" although it's the first definition for it -

everything working untill moved code main file new class, had following error: error c2011: 'color1' : 'struct' type redefinition struct color1 { color1() { red = green = blue = 0; } color1(float _red, float _green, float _blue) { red = _red; green = _green; blue = _blue; } float red, green, blue; }; any idea ? if compiler says it's redefined, is. my psychic debugging skills tell me moved struct source file header file, , forget include guards in header, included multiple times in source file. edit: general rule suggest avoiding leading underscores. in cases (for example followed capital letter) they're reserved implementation , it's simplest never use leading _ instead of hoping remember rules.

ios - Overlay blend mode formula? -

i have 2 colors: 1 dynamically set , that's white 0.5 alpha. want calculate resulting white color if drawn on top of dynamic color using overlay blend mode. i'm aware overlay combines multiply , screen blend modes. multiply blend mode's formula is: result color = (top color) * (bottom color) /255 while screen blend mode's is: result color = 255 - [((255 - top color)*(255 - bottom color))/255] how calculate resulting color overlay blend mode? is there uicolor extension class out there out of box? there 2 part of formula: first part: if lower layer value > 127.5, following - value unit = (255-lower layer value)/127.5 min value = lower layer value - (255-lower layer value) overlay = (upper layer value * value unit) + min value second part: if lower layer value < 127.5, following - value unit=lower layer value/127.5 overlay = upper layer value * value unit from formual can see final result depend on upper layer value. if ...

applyPattern() in SimpleDateFormat gives NullPointerEcxeption with white space in java -

i have code formats date pattern dd-mm-yyyy: simpledateformat sdf = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.s"); sdf.applypattern("yyyy-mm-dd"); date date_out = null; try { date_out = sdf.parse(date); } catch (parseexception e) { // todo auto-generated catch block e.printstacktrace(); } sdf.format(date_out); however when change separator "-" white space or slash "/" nullpointerecxeption on format() line. simpledateformat accept white space or other character date separators? the issue sdf.parse(date); null if date not match pattern. if change pattern of simpledateformat object don't change format of date parsing parseexception thrown , date_out null. sdf.format() throw nullpointerexception when try format null string. based on comment think bit more explanation required examples - i'm editing answer appropriately... simpledateformat applypattern chan...

drupal - How to make an image featured when there are multiple images uploaded using CCK field? -

i trying create image gallery using cck image field multiple image upload enabled. fine stuck @ 1 thing. want mark image becomes album cover. have googled lot did not come solution. can here please me or @ least show me correct path. thanks in advance time. although i've not seen drupal image gallery, sorry if not answer you. can not use views select cck field?

Pass jquery event to layer behind OR make inner radius transparent -

i'm trying make pie chart on top of pie chart (see below) , using flot jquery library. http://cadmiumconsulting.com/carlsberg/screenshot_01.jpg i have managed diagram looking right use mouse events on outer pie chart. my problem is: if draw outer chart first inner 1 'on top', mouse events work on inner layer. if on other hand draw inner chart first , add outer chart 'on top' inner radius, inner radius doesn't work in internet explorer 8 , displays solid circle on top of inner chart. any ideas on how pass events 1 layer other or force transparency of inner radius? any appreciated. update - there seems issue 'globalcompositeoperation' allow transparency. it's included in html5 not in excanvas object hack replicate canvas object in ie8. events traveling should able target chart in background. have made simple guide explains how events travel , how stop them in jquery: first create our test dom <div><br/> ...

c++ - Numeric limits - is there a limit when multiplying very large constants? -

is there explicitly defined limit on size of numbers compiler can handle when multiplying out constants? #define val1 1000000000000000 #define val2 <some really big number> std::cerr << val1 * val2 << std::endl; would generate error due numeric limits in c++ given sufficiently large value val2? where/how limit defined if so? it treat integer , maximum integer (defined in limits.h ) apply if want large number use 1000.......0000l define long.

java - Speeding up date pattern matching -

i writing simple code tries deduce whether or not specific string java date and, if yes, identify format (pattern). obviously, because there many possible date formats, establishing 1 applicable string requires successive pattern matching, time , cpu-consuming, given input string can have other values, too. so, have ended doing, string variable called input , like string datepattern; if (islikedate(input)) { datepattern = matchanyofthepredefineddatepatterns(input); } where islike... method rejects obvious non-date strings , match... method goes on 40-50 predefined patterns, trying construct valid simpledateformat object. constructor throws exception if input string not valid date pattern examined each time. the exception handling slows things down dramatically, there seems no avoiding it. apache commons date packages exhibit similar performance. is there faster way of implementing date pattern matching? depending on complexity of patterns, might want m...

.net - Deserializing xml into an ArrayList of objects in C# -

the following xml result of serializing arraylist of asset objets <arrayofasset xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <asset> <name>bill</name> <type>perosn</type> </asset> <asset> <name>bill</name> <type>perosn</type> </asset> </arrayofasset> i can deserialize default c# deserializer no problem. if root element changes arrayofasset assets , deserializer blows up. how can make deserializer aware of change. here deserialization code: streamreader sr = new streamreader("c:\\assest.xml"); string r = sr.readtoend(); list<asset> list; type[] extratypes = new type[1]; extratypes[0] = typeof(asset); system.xml.serialization.xmlserializer serializer = new system.xml.serialization.xmlserializer(typeof(list<asset>), extratypes); object obj = serializer.de...

php - Caching a MySQL Resultset -

i need working code storing mysql result set in apc cache! searched on google & , did not find any! hope share working code. example: $stmt=mysqli_prepare($con,"select uid users"); mysqli_stmt_execute($stmt); mysqli_stmt_bind_result($stmt, $uid); mysqli_stmt_fetch($stmt); mysqli_stmt_close($stmt); example 2: $stmt=mysqli_prepare($con,"select events calendar uid=?"); mysqli_stmt_bind_result($stmt, "i",$uid); mysqli_stmt_execute($stmt); mysqli_stmt_bind_result($stmt, $events); while(mysqli_stmt_fetch($stmt)) { ... } mysqli_stmt_close($stmt); how store outcoming sql result in apc? i want know code cache in apc (not in mysql) you don't want this! adding caching layer application should 1 of last things do. caching can uncover tremendous number of bugs in code, both subtle , obvious. if trying improve performance of code, should performing code profiling , eliminating real bottlenecks rather perceived ones. es...

Java URI class: constructor determines whether or not query is encoded? -

is behavior intentional? //create same uri using 2 different constructors uri foo = null, bar = null; try { //constructor: uri(uri string) foo = new uri("http://localhost/index.php?token=4%2f4ezdssbg_4vx6d5pzvdsmldoyitb"); } catch (urisyntaxexception e) {} try { //constructor: uri(scheme, authority, path, query, fragment) bar = new uri("http", "localhost", "/index.php", "token=4%2f4ezdssbg_4vx6d5pzvdsmldoyitb", null); } catch (urisyntaxexception e) {} //the output: //foo.getquery() = token=4/4ezdssbg_4vx6d5pzvdsmldoyitb //bar.getquery() = token=4%2f4ezdssbg_4vx6d5pzvdsmldoyitb the uri(string uri) constructor seems decoding query part of uri. thought query portion supposed encoded? , why doesn't other constructor decode query part? from uri javadoc : the single-argument constructor requires illegal characters in argument quoted , preserves escaped octets , other characters present. th...

image - /system and /data file system of Android -

when build android sources, end 3 images. ramdisk.img, system.img , userdata.img. i'm trying understand these made of , how used android. came across articles "/system" yaffs2 file system. 1) if want make use of on real board, should file system yaffs2 or can any? 2) if want 3 images file system(say ext2), how do that? you can modify kernel accept filesystem want (ext2 , ext4 2 examples), if can make compile. then, it's matter of mounting , formatting volume corresponding filesystem. there patches different kernels in github , xda-developers. need browse around find patch particular device. unfortunately not can sole devices single hack.

C memory allocator and strict aliasing -

even after reading quite bit strict-aliasing rules still confused. far have understood this, impossible implement sane memory allocator follows these rules, because malloc can never reuse freed memory, memory used store different types @ each allocation. clearly cannot right. missing? how implement allocator (or memory pool) follows strict-aliasing? thanks. edit: let me clarify question stupid simple example: // s == 0 frees pool void *my_custom_allocator(size_t s) { static void *pool = malloc(1000); static int in_use = false; if( in_use || s > 1000 ) return null; if( s == 0 ) { in_use = false; return null; } in_use = true; return pool; } main() { int *i = my_custom_allocator(sizeof(int)); //use int my_custom_allocator(0); float *f = my_custom_allocator(sizeof(float)); //not allowed... } i don't think you're right. strictest of strict aliasing rules count when memory allocated purpose. once all...

CPU usage event notification in C/C++? -

having hard time finding if there's system call receive notification when cpu usage reaches point? i'm looking call linux/bsd variants, if know windows version chime in know future reference. something similar kqueue. obviously check out /proc/cpuinfo or individual utimes periodically, hoping there system call me in more efficient way. e.g. "let me know when average total cpu usage on last minute on 50%" you can cpu usage information getrusage() , can use soft limits setrlimit() sigxcpu when exceed preset threshold (which can increase in signal handler). more information: http://linux.about.com/library/cmd/blcmdl2_getrusage.htm

Heroku/Node.js - Routing error of some kind causing Internal Server Errors -

i'm running node.js/express/mongohq app on heroku. works locally. when push heroku root page '/' loads , access mongohq db. every other route gives me internal server error , no identifiable error in heroku logs. although if go /page/ app's 500 page render (random...) is there can think of going wrong here? thought db thing seems routing thing. i'm happy provide code... thought i'd paste in of log though it's super unhelpful me anways. ideas majoryl appreciated. thanks. log (for route other '/') 2011-10-07t17:27:03+00:00 app[web.1]: 10.94.69.43 - - [fri, 07 oct 2011 17:27:03 gmt] "get /assets_js/lib/jquery.1.4.2.min.js http/1.1" 304 - "<mysite>/" "mozilla/5.0 (macintosh; intel mac os x 10_6_8) applewebkit/535.1 (khtml, gecko) chrome/14.0.835.202 safari/535.1" 2011-10-07t17:27:03+00:00 heroku[router]: <mysite>/assets_js/lib/jquery.timeago.js dyno=web.1 queue=0 wait=0ms service=5ms status=304 bytes=...

How do I have a winform over a fullscree XNA application? -

i want have xna application , runs in both windowed , fullscreen. have text input winform comes when want input new ids. in fullscreen form not go on fullscreen application. there way make appear on it? or need re think approach? is not possible. you should integrate text input xna window.

Rails 3.1: accepts_nested_attributes_for and has_one association - won't work? -

i'm trying use accepts_nested_attributes_for on has_one association model, , getting absolutely :-( i have 2 models, user , location. user has 1 location: class user < activerecord::base # current location has_one :location, :dependent => :destroy accepts_nested_attributes_for :location end class location < activerecord::base belongs_to :user end i can save changes model using user.find(1).location.current_location_text = "blah" console, know associations set correctly. i have 2 forms on edit user page. 1 updates main user attributes (and works fine , not shown below) , 1 allows user update attribute of location model, called "current_location_text": <%= form_for(@user) |f| %> <%= fields_for(@user.location) |location_fields| %> <%= location_fields.label :current_location_text, 'current location' %> <%= location_fields.text_field :current_location_text, :placeholder => 'roa...

c# - Binding two Dependency properties in WPF -

i declare 2 dependency properties: first, filtercolor of type color , second filterbrush of type brush. need update value of filtercolor when filterbrush.color property has changed, , need update value of filterbrush.color when filtercolor property has changed. how can realize it? bind 2 properties twoway binding , if change 1 in ui change other in properties setter , vice versa, , use inotifypropertychanged notify ui property changed.

Make Perl web server deliver an ogg through HTTP to Chrome for a HTML5 audio element -

i writing perl script acts simple web server serves audio files on html5. have succeeded in getting show page web browser html5 audio element. continues listen socket when browser asks audio file via request; hh.ogg in example , tries respond ogg inside message body. works on port 8888. #!/usr/bin/perl use strict; use warnings; use io::socket; $port = 8888; $server = new io::socket::inet( proto => 'tcp', localport => $port, listen => somaxconn, reuseaddr => 1) or die "unable create server socket"; # server loop while(my $client = $server->accept()) { $client_info; $faviconrequest = 0; while(<$client>) { last if /^\r\n$/; $faviconrequest = 1 if ($_ =~ m/favicon/is); print "\n$_" if ($_ =~ m/get/is); $client_info .= $_; } if ($faviconrequest == 1) { ...

Apache service failing ("BUSY") when using port 80 -

how can configure apache server run on port 80? apache service failing when using port 80; says busy . when change port in config 85, apache works requires maunally entering 85 in address bar every time localhost. i have tried find out program using port 80 cannot come anything. first entered netstat -n -a -o -p tcp in cmd , came information local address 0.0.0.0:80 state: listening pid: 4 then entered tasklist in cmd trying figure out service using port. looks "system" on pid 4. have configured skype not use port 80 without luck. have microsoft webmatrix installed on windows 7 , deleted iis 7.5 server express free port no avail. can guys please me out? using windows 7 , xampp . several programs can block port. candidates are: skype web deployment agent service (can stopped via start -> [-> run] -> services.msc) world wide web publishing service iis (if have installed) teamviewer vmware (in vmware workstation go edit>>...

.net - How do I download images (jpg) via a webclient and save to isolated storage on Windows Phone 7? -

due lack of programming experience (3 months) have been unable recreate found examples of above question. examples have found relate non wp7 silverlight, camera based saving of images, have been complex needs or have not worked. have been able download text file using instance of webclient , save isolated storage using streamwriter. need acomplish same task jpg images. below have used download text file. =============================================================================== isolatedstoragefile mystore = isolatedstoragefile.getuserstoreforapplication(); private void gettextfile() { webclient client = new webclient(); client.downloadstringcompleted += new downloadstringcompletedeventhandler(client_downloadstringcompleted); client.downloadstringasync(new uri("http://mywebsite.com/textfile.txt")); } private void client_downloadstringcompleted(object sender, downloadstringcompletedeventargs e)...

Set fragments' positions in android activities -

i have fragment should shown in activity under fragment in xml of fragment tried use: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/second_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginbottom="10sp" android:layout_below="@id/first_fragment"> <textview android:id="@+id/mytext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" " android:focusable="false" android:clickable="false" android:textsize="20sp" android:padding="5sp" android:layout_centerhorizontal="true"/> </relativelayout> (please note android:layout_below="@id/first_fragment" in layout tag) i hav...

I want my Java program to be able to run external application in Ubuntu -

i want java program able run external application in ubuntu, don't know how. the java.lang.runtime.exec() family of static methods need. there java.lang.processbuilder class, wrapper helps prepare calls exec() . finally, java.awt.desktop class automatically open default system applications various types of documents.

file upload - Symfony: form field access with no sfForm object -

i'm working on symfony project , developed form upload file , save info table in model. , didn't use sfform class implement form. here have form <form name="new_file" action="<?php echo url_for('home/uploadfile');?>" method="post"> <input type="file" id="file"> <input value="<?php echo $codigo_maestro?>" id="master_id"> <input value="<?php echo $codigo_entidad?>" id="entity_id"> <input type="submit" value="upload"> </form> so i'm trying access fields of sumbited form in action function , don't know how :( $request->getparameter('file'); $request->getparameter('master_id'); $request->getparameter('entity_id'); this code didn't work. please me solve this! how can access fields of form action?? you need add name form fields, that...

exception - StreamCorruptedException with Android-Java Communication -

i need send serialized data android device java server. don't know why, communication seems unstable. in debugger, java.io.streamcorruptedexception: thrown after start. not 1 object passing. without debugger, 10 messages passed until same exception thrown. got idea, please me:) thank you! fabian exception: java.io.streamcorruptedexception: invalid type code: 2f @ java.io.objectinputstream.readobject0(unknown source) @ java.io.objectinputstream.readobject(unknown source) @ androidanbindung.androidverwalter.run(androidverwalter.java:114) java-code: public void nachrichtenaustausch(){ port ++; try { serversocket = new java.net.serversocket(port); system.out.println("warte auf 2. verbindungsaufbau..."); client = serversocket.accept(); system.out.println("verbindung 2 ist eingegangen..."); in = new objectinputstream(new objectinputstream(client.getinputstream())); nachricht n; ...

actionscript 3 - How can I fix this video phone app? -

i'm trying practice making simple video phone app i'm trying make program send video , recieve video using cirrus adobe. i'm having trouble recieving stream though. here cod i'm using: <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" applicationcomplete="init()"> <fx:declarations> <!-- place non-visual elements (e.g., services, value objects) here --> </fx:declarations> <fx:script> <![cdata[ import mx.core.uicomponent; import mx.core.mx_internal; import spark.components.group; private const server:string = "rtmfp://p2p.rtmfp.net/"; private const devkey:string = "my-dev-key"; [bindable]...

linux - Segmentation fault by replacing an instruction with another that does the same job. Why? -

i have working shellcode spawns shell have modify such hide "/bin/sh" or "sh" coming anywhere in binary after compiling. have hence thought of taking hex value of /bin/sh(2f 62 69 6e 2f 73 68) adding random value 0x11111 , moving value register, subtracting 0x11111 @ runtime , pushing runtime generated value(which becomes /bin/sh) stack , doing execv segmentation fault on 1st step itself. , unable figure out why? this below code works fine. section .data section .text global _start _start: xor eax,eax cdq push eax push long 0x68732f2f push long 0x6e69622f mov ebx,esp push eax push ebx mov ecx,esp mov al,0xb xor edx,edx int 0x80 but change causes segmentation fault section .data section .text global _start _start: xor eax,eax cdq push eax mov ecx,0x11111 mov ebx,0x68744040 sub ebx,ecx push long eax push long 0x6e69622f mov ebx,esp push eax push ebx mov ecx,esp mov al,0xb xor edx,edx int 0x80 please me on thie. greatful. thanks the c...

php - How to insert into table which contain foreign key -

i'm newbie, gotta problems, cannot update table upload since insert foreign key table request in there can me? table request: id_request; primary key subjek; email; reportto; pelaksana; isi; table upload: id_upload; primary key id_request; foreign key filename; filetype; filesize; filedata; if wanna create new request, create record in table request, insert data table request, insert id_request in table upload, fill in last_insert_id in same time, after insert id_request in table upload, insert attachment using query insert or update query there error the error looking : warning: mysql_query() [function.mysql-query]: mysql server has gone away in c:\wamp\www\beta\insert.php on line 32 warning: mysql_query() [function.mysql-query]: error reading result set's header in c:\wamp\www\beta\insert.php on line 32 this line 32 mysql_query($up)or die('error upload file'); this listing code <?php include('config.php'); session_start(); $jenis = ...

c++ - mouse movement opengl -

i creating pool game written in c++ using plain opengl (no external tools), can use glut. have drawn pool cue want follow mouse cursor not sure how this. i know how use keyboard input move things e.g camera position or draw object m not sure how move object using mouse input. this cue trying move via mouse input: void cue () { glbegin; gltranslatef(-10,5,0); glrotatef(90,0,1,0); glutsolidcone(0.25, 15, 20, 20); glend(); } glut has few mouse callback function mouse callback motion callback you use callback figure out movement of mouse, rest pure math.

iphone - Issue with Duplicate symbol in link phase of project build in Xcode -

i've been building game application ios. application working well, i've done large restructure today little more model-view-controller 'compliant'. i've built main game engine in c++, use objective-c managing viewcontrollers, views etc. now, when compile project, i'm getting error in link phase. details below: ld: duplicate symbol applicationengine::onfingerup(vector2) in /users/dan/library/developer/xcode/deriveddata/blackholes-exrlidtstxzdtsbyjghgquhlsqul/build/intermediates/blackholes.build/debug-iphonesimulator/blackholes.build/objects-normal/i386/applicationengine.o , /users/dan/library/developer/xcode/deriveddata/blackholes-exrlidtstxzdtsbyjghgquhlsqul/build/intermediates/blackholes.build/debug-iphonesimulator/blackholes.build/objects-normal/i386/appdelegate.o architecture i386 collect2: ld returned 1 exit status command /developer/platforms/iphonesimulator.platform/developer/usr/bin/g++-4.2 failed exit code 1 onfingerup function wi...

osx - libiconv.2.dylib Mac OS X Problem -

i have problem important file libiconv.2.dylib. when want start applications (like macvim, etc.) error: dyld: library not loaded: /usr/lib/libiconv.2.dylib referenced from: /applications/macvim.app/contents/macos/vim reason: no suitable image found. did find: /usr/lib/libiconv.2.dylib: mach-o, wrong architecture /usr/lib/libiconv.2.dylib: mach-o, wrong architecture trace/bpt trap is there way restore (no time machine available) or recompile library mac (10.6)? you appear have mismatch between architectures. system library libiconv should universal file contains necessary archs; on os x 10.6, apple ships three. $ file /usr/lib/libiconv.2.dylib /usr/lib/libiconv.2.dylib: mach-o universal binary 3 architectures /usr/lib/libiconv.2.dylib (for architecture x86_64): mach-o 64-bit dynamically linked shared library x86_64 /usr/lib/libiconv.2.dylib (for architecture i386): mach-o dynamically linked shared library i386 /usr/lib/libiconv.2.dylib (for archit...

image - How do I make java's ImageBuffer to read a PNG file correctly? -

for reason, opening png files using imagebuffer , imageio not work. here's code using works fine resizing/cropping jpgs: bufferedimage image = imageio.read(new file(location)); bufferedimage croppedimage = image.getsubimage( cropinfo.getx(), cropinfo.gety(), cropinfo.getw(), cropinfo.geth()); bufferedimage resizedimage = new bufferedimage( target_width, target_height, croppedimage.gettype()); graphics2d g = resizedimage.creategraphics(); g.drawimage(croppedimage, 0, 0, target_width, target_height, null); g.dispose(); this.changecontenttype("image/png", ".png"); // not relevant. property imageio.write(resizedimage, "png", new file(location)); return resizedimage; the goal of function take whatever type given, resize , crop image, , save png same filename. it works on windows, if crop/resize on linux (lenny), crashes altogether , complains type of file (it says type 0). java.lang.illegalargumentexception: unknown image type 0 ...

Jquery Slidetoggle - Can't seem to get it to start off Closed? -

i using jquery slidetoggle on single page website. have been trying figure out went wrong in script can't seem resolve issue. trying slide toggle effect start off closed when page opens , open/close on click. right now, when page opens each section of slide toggle open :/ appreciated. <script type="text/javascript"> jquery(function($) { var opentext = 'open'; var closetext = 'close'; $('.item-util .more-toggle').toggle( function() { $(this).html(closetext); $(this).parent().siblings('div').slidetoggle('slow'); }, function() { $(this).html(opentext); var returnto = $(this).parents('.item'); $.scrollto(returnto, {offset:{top:-150, left:0}, duration:600}); $(this).parent().siblings('div').slidetoggle('slow'); } ); }); </script> thanks set style of elements want start closed display:none , should work...

Reading XML responses from Google Calendar service with Java -

i want retrieve user's busy times using new querying busy times api provided part of google calendar api. result read-only feed containing user's blocks of busy-times looks following: <entry xmlns="http://www.w3.org/2005/atom" xmlns:gcal="http://schemas.google.com/gcal/2005" xmlns:gd="http://schemas.google.com/g/2005" gd:kind='calendar#freebusy' > <id>http://www.google.com/calendar/feeds/default/freebusy/busy-times/liz%40example.com</id> <updated>2010-03-13t00:00:00.000z</udpated> <link rel='self' href='https://www.google.com/calendar/feeds/default/freebusy/busy-times/liz%40example.com' /> <author> <name>liz@example.com</name> <email>liz@example.com</email> </author> <gcal:timerange> <gd:when starttime='2010-03-13t00:00:00z' endtime='2010-03-14t00:00:00z'/> <gcal:timerange> <gcal:...

Flash version across browsers -

this may seem obvious question can't find answer.. is flash version installed on, ie, on single computer same version on other browsers installed on same computer ? ie uses activex control flash implementation whereas other browsers use mozilla/netscape plugin thing. chrome seems have own implementation well. totally possible have multiple versions of flash installed on computer being used different browsers.

ruby on rails - How can I use a PEM certificate with password? -

i'm having plenty of trouble trying use certificate has password on ruby. i'm using rest-client, that's not requirement. this curl-equivalent of call need make: curl -e certificate.pem:password -d ident=language -d data="test" "https://theurl" i tried many things, can't password part working. here's have far: cert = openssl::x509::certificate.new(file.read("#{rails_root}/certificate.pem")) reply = restclient.post("https://theurl", {:ident => 'language', :data => 'test'}, {:ssl_client_cert => cert}) i've tried putting password everywhere, :password , :ssl_client_key, i've looked through documentation find there's accept password. this error get: ssl_connect returned=1 errno=0 state=sslv3 read finished a: sslv3 alert handshake failure what missing? the way uses curl option -e, specifying private key certificate. (from curl man page) -e/--cert (ssl) ...

android - MediaPlayer force close after consecutive clicks -

i've made button , when click it, gives away short sound(max 1 second-sound). after i've clicked button 20 times in row force close.. code is: final button button = (button) findviewbyid(r.id.button); button.setonclicklistener(new onclicklistener() { public void onclick(view v) { // perform action on clicks mediaplayer mp = mediaplayer.create(getbasecontext(), r.raw.buzzer); mp.start(); } }); i've tried mp.stop(); sound stops after have been played half of time... one more thing, know how "prepare" sound when click? because sound gets delayed milliseconds first time press button. create mediaplayer member variable , initialize in oncreate() same way doing in listener. in listener use code: if(mplayer.isplaying()) { mplayer.stop(); } mplayer.start(); then call mplayer.release() in finish() activity. guess since none of mediaplayer instances being released, it's running out of memory use. the...

asp.net to php encoding -

i need php encryption method. turkey 3d bank payment module in code example given me in way encryption. me translate php code? sha1 sha1 = new sha1cryptoserviceprovider(); byte[] nothashedbytes = system.text.encoding.ascii.getbytes(nothashedstr); byte[] hashedbyte = sha1.computehash(nothashedbytes); string hashedstr = system.convert.tobase64string(hashedbyte); return hashedstr; i know nothing .net gathered in this page seems php equivalent just: $hashedstr = base64_encode(sha1($nothashedstr, true)); you need encode raw binary format , not hexadecimal representation.

jsf - The form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within <h:form> -

i getting following error on facelet page, consists of icefaces form 2 fields , 2 buttons: the form component needs have uiform in ancestry. suggestion: enclose necessary components within <h:form> here form: <ice:form id="form1" partialsubmit="false"> <ice:panellayout id="panellayout3"> <ice:graphicimage id="graphicimage1" url="/resources/images/loginimage.jpg" width="560" /> <ice:outputlabel for="j_username" id="outputlabel1" value="username:"/> <ice:outputlabel for="j_password" id="outputlabel2" value="password:"/> <ice:inputtext binding="#{login.username}" id="j_username" required="true" /> <ice:inputsecret binding="#{login.password}" id="j_password" required="true" /> <ice:commandbutton a...

parsing - Best way to parse this in Rebol -

how extract transaction receipt datetime least bit of noise in parse rule following html? (the output i'm looking this: "transaction receipt: 04/28/2011 17:03:09" ) <font color=darkblue>transaction receipt </font></th></tr><tr></tr><tr></tr><tr><td colspan=4 align=center><font size=-1 color=darkblue>04/28/2011 17:03:09</font> the following works don't feeling! there guaranteed datetime following words transaction receipt somewhere (although wouldn't greedy match if i'm doing grep) parse d [ thru {<font color=darkblue>transaction receipt </font></th></tr><tr></tr><tr></tr><tr><td colspan=4 align=center><font size=-1 color=darkblue>} copy t "</font>" ] this shorter... parse d [thru <font size=-1 color=darkblue> copy t </font>] but isn't looking datetime pair. ...

python - Fastest way to filter the A010784 sequence -

the a010784 sequence @ oeis sequence containing numbers distinct digits. finite amount. what i've been trying find several numbers in sequence attributes. e.g: 6 distinct number of magnitude 10. can found follows: 6 x 1 = 6 6 x 2 = 12 6 x 3 = 18 6 x 4 = 24 6 x 5 = 30 6 x 6 = 36 6 x 7 = 42 6 x 8 = 48 6 x 9 = 54 6 x 10 = 60 6 x 11 = 66 (two sixes; these aren't both distinct digits.) now i'm trying highest numbers available several magnitudes of order. let's orders 1 20. what i'm doing loop highest possible distinct number, 9,876,543,210 , highest unique number of magnitude 1, down low number. method feels extremely inefficient. @ least, me does. i'm pretty sure i'm missing stuff factoring should able make things lot faster. def unique_num(num): # check whether number unique. return boolean def unique_num_magnitude(num): # check of magnitude unique number return integer # dictionary current highest values # each...

Java Serialization with object input/output stream -

in java, serializing objects i.e. object state on network using serializable marker interface , object streams(serilaze , deseriaze). having different streams write object state.why marked serialization object?. perhaps, need read java serialization understand concepts, , proceed. the crux here (objectinput/outputstream) mechanism java uses object serialization. are, however, free implement own serialization mechanism (such serializing xml files).

Optimal database design in terms of query speed to store matrices from R -

i have hundreds of matrices need used in r , of them around 45000x350 each. i'd find optimal database software choice , schema store data in , able call subsets of matrices database. needs done object of extracting data fast possible. as base here code creates 5 matrices similar i'm dealing with: if(!"zoo" %in% installed.packages()[,1]) { install.packages("zoo") } require("zoo", quietly=true) numsymbols <- 45000 numvariables <- 5 rdatepattern <- "%d/%m/%y" startdate <- "31/12/1982" enddate <- "30/09/2011" startyearmonth <- as.yearmon(startdate,format=rdatepattern) alphanumeric <- c(1:9,toupper(letters)) nummonths <- (as.yearmon(enddate,format=rdatepattern)-startyearmonth)*12 numvalues <- numsymbols*(nummonths+1) datevector <- sapply(1:(nummonths+1), function(x) {as.character(format(as.date(startyearmonth+x*1/12,fraq=0)-1,rdatepattern))}) symbolnames <- sapply(1:n...