Posts

Showing posts from June, 2012

cocoa - Converting NSString to keyCode+modifiers for AXUIElementPostKeyboardEvent -

edit: turns out, misled during initial explorations of accessibility apis. once found secure text field in ax hierarchy, able set value. not sure question beyond that, wanted update future searchers. i'm working on code post keyboard events targeted applications using accessibility apis. far, have been able write trivial app allows me type in string value , post keyboard events key codes targeted application. in reality, strings read location. what have not yet been able figure out how ascertain whether , modifier keys should posted. instance, when type hello, world! test application, input sent other application hello, world1 because not yet including modifier keys create upper case h , exclamation point. made doubly complicated multi-keystroke characters é or ü . sending é sends raw e no accent example. is there simple method overlooking discerning modifiers combine keycode creating particular nsstring or unichar? if not, have suggestion of how proceed? far, best

c# - how would i call this function with a delegate as a parameter -

i have repetitive code trying refactor generic function generate list of checkboxes list of objects (all lists of inamed). the second parameter delegate call function can't figure out how call method. best way call method delegate? (i looking example of code call checkboxlist function) public delegate bool hashandler(inamed named); here generic method static public string checkboxlist(iqueryable<inamed> allitems, hashandler has, string name) { stringbuilder b = new stringbuilder(); foreach (var item in allitems) { if (has(item)) { b.append("<input type='checkbox' class='checkboxes' name='" + name + "' value=" + item.id + " checked />" + item.name); } else { b.append("<input type='checkbox' class='checkboxes' name='" + name + "' value=" + i

sql server 2008 - Modeling A Food Recipes Database -

i'm trying design "recipe box" database , i'm having trouble getting right. have no idea if i'm on right track or not, here's have. recipes(recipeid, etc.) ingredient(ingredientid, etc.) recipeingredient(recipeid, ingredientid, amount) category(categoryid, name) recipecategory(recipeid, categoryid, name, etc.) so have couple of questions. how doing far? design okay know? how implement preparation steps? should create additional many-to-many implementation (something preparation(prepid, etc.) , recipeprep(recipeid, prepid)) or add directions in recipes table? ordered list in ui (webpage). thank help. some thoughts: you might want use same table recipe , ingredient, type indicator column. reason recipes can contain sub-recipes. let's call combined table "item". recipeingredient table like recipeingredient (recipeid, itemid, amount). i'd expect table have sequencing column. if want calculations these re

iphone - Video recording and saving the video on a server -

i caught task how should go capturing video in app , saving directly on server. have sample code discussed in wwdc2010 need other more helpful links or tutorials complete task. please give me opinion or share links if have. thanks, there nothing in apis allow this. way use avassetwriters segment video. stream completed segments. these need reassembled on server side if require single file.

regex - Attribute Error for strings created from lists -

i'm trying create data-scraping file class, , data have scrape requires use while loops right data separate arrays-- i.e. states, , sat averages, etc. however, once set while loops, regex cleared majority of html tags data broke, , getting error reads: attribute error: 'nonetype' object has no attribute 'groups' my code is: import re, util beautifulsoup import beautifulstonesoup # create comma-delineated file delim = ", " #base url sat data base = "http://www.usatoday.com/news/education/2007-08-28-sat-table_n.htm" #get webpage object site soup = util.mysoupopen(base) #get column headings colcols = soup.findall("td", {"class":"vatextbold"}) #get data datacols = soup.findall("td", {"class":"vatext"}) #append data cols in range(len(datacols)): colcols.append(datacols[i]) #open csv file write data fob=open("sat.csv", 'a') #initiate 5 arrays state

header - Multiple Source File Problem in C++ -

i had a problem in implementing multiple source file my function this: inline bool textcontains(char *text, char ch) { while ( *text ) { if ( *text++ == ch ) return true; } return false; } void split(char *text, char *delims, vector<string> &words) { int beg; (int = 0; text[i]; ++i) { while ( text[i] && textcontains(delims, text[i]) ) ++i; beg = i; while ( text[i] && !textcontains(delims, text[i]) ) ++i; words.push_back( string(&text[beg], &text[i]) ); } } string convertint(int number) { stringstream ss; ss << number; return ss.str(); } string dateformatchecker(const char *date){ string strdate=date; char getdate[50]; strcpy_s(getdate, strdate.c_str()); vector<string> checkdate; split( getdate, "-", checkdate ); int year, month, day; year=atoi(checkdate[0].c_str()); month=atoi(checkdate[1].c_str()); day=atoi(checkdate[2].c_str()); string checkyear, che

c++ - new operator for memory allocation on heap -

i looking @ signature of new operator. is: void* operator new (std::size_t size) throw (std::bad_alloc); but when use operator, never use cast. i.e int *arr = new int; so, how c++ convert pointer of type void* int* in case. because, malloc returns void* , need explicitly use cast. there subtle difference in c++ between operator new , new operator. (read on again... ordering important!) the function operator new c++ analog of c's malloc function. it's raw memory allocator responsibility solely produce block of memory on construct objects. doesn't invoke constructors, because that's not job. usually, not see operator new used directly in c++ code; looks bit weird. example: void* memory = operator new(137); // allocate @ least 137 bytes the new operator keyword responsible allocating memory object , invoking constructor. what's encountered commonly in c++ code. when write int* myint = new int; you using new operator allo

html - CSS hovering div link -

i using following css create popout menu information when user hovers on particular link. how can modify follow code user click on link within span? of right second mouse moves off original link, div disappears. a:hover { position: relative; } span { display: none; } a:hover span { color:#006699; display: block; position: absolute; width:190px; height:12px; top: -15px; left: 30px; padding: 5px; z-index: 100; } <a href=email.php>email<span>text</span></a> that not valid html have there - block level p tags cannot contained in inline a , span tags. , if you're using html5, changed rules elements can inside other elements, still can't have anchors inside anchors - doesn't make sense. what can do, instead, use adjacent sibling selectors job, having popup element appear next anchor in document markup instead of inside it. however, it's recommended use javascript control behavioural elements of site - javascript offers gr

algorithm - Brute-force string manipulation in Java -

any best algorithm or brute force method implement following things? find words in caps. count number of words in caps. count number of words. search exact words. cheers, venki regular expressions fit each of these.

SSL handshake failures when no data was sent over Twisted TLSConnection -

i start looking @ implementing explicit ftp extending current twisted ftp. most of code straight forward , implementing auth, pbsz, prot easy , got working secured control channel. my problem data channel. the client side error : ssl routines', 'ssl3_read_bytes', 'ssl handshake failure' it looks ssl handshake , shutdown called when data send on data channel. affect case when sending empty files or listing empty folders, since before closing connection, client call ssl shutdown. i looking after suggestion how , should search fixing tls handshake twisted tls when no data sent. this code works when listing folders not empty... fail if folder contains no files or folders. many thanks! def getdtpport(self, factory): """ return port passive access, using c{self.passiveportrange} attribute. """ portn in self.passiveportrange: try: if self.protected_data: dtpport = rea

c - Dynamic data structure with scanf -

i have basic question, patience. i have dynamic data structure integer value , pointer next structure. using scanf user input 5 values add structure , trying print output @ end. having trouble syntax input structure. have looked around stackoverflow , google, no avail (probably because basic!) here code: #include <stdio.h> struct list { int value; struct list *nextaddr; }; int main() { int int1, int2, int3, int4, int5; printf("please enter first integer: "); scanf("%d", int1); struct list t1 = {int1}; printf("please enter second integer: "); scanf("%d", int2); struct list t2 = {int2}; printf("please enter third integer: "); scanf("%d", int3); struct list t3 = {int3}; printf("please enter fourth integer: "); scanf("%d", int4); struct list t4 = {int4}; printf("please enter fifth integer: "); scanf("%d&

c# - assign text value to buttons from database in .net? -

i have 30 buttons nothing in default text value. want ordered data database: here database format: id value cat 1 button name 2 name 3 . . . . . . 30 last button 1 button name b 2 name b 3 b . . b . . b . . b 18 last button b now have created function grab id , category select specific name using oledb ms access database. here function: private string getitem(int i, string a) { //database connection // database query , table slection id = , cat = read data in selected column return string form of column } now whenever form loads, i've assigned following function: button1.show(); ..

resolution - How can I read the VESA/VideoBIOS "Mode Removal Table"? -

many sites , articles on getting widescreen monitors work on notebooks in native resolution mention called "mode removal table" in video bios prevents video modes: http://www.avsforum.com/avs-vb/showthread.php?t=947830 http://software.intel.com/en-us/forums/showthread.php?t=61326 http://forum.notebookreview.com/dell-xps-studio-xps/313573-xps-m1330-hdmi-hdmi-tv-issue-2.html http://forums.entechtaiwan.com/index.php?action=printpage;topic=3363.0 does such thing exist? fix worked me wanted find out if can read, modify, or work around table. can't find mention of in various vesa standards. perhaps goes other more cryptic name? “ many sites , articles”? first couple of dozen results you, , of rest intel article mentioned or other people linking article. you try asking someone talks though know how it. there's another thread discusses it—though has no information on table, quick mention of it. there not seem known way read gma video bios. have

android - How to detect if an application has been closed / exited -

i have 2 service running in background.. if service 1 closed, service 2 start service 1 again, , vice versa, problem is, want know how detect if service closed or exited. the activitymanager should looking for.

How to rename files in directory with its sha1 hash with python? -

i need rename files in directory hash python. i've done same thing using c#: console.write("enter path"); string path = console.readline(); foreach (var in directory.getfiles(path)) { try { using (sha1managed sha1 = new sha1managed()) { filestream f = new filestream(i.tostring(), filemode.open); byte[] hash = sha1.computehash(f); string formatted = string.empty; foreach (byte b in hash) { formatted += b.tostring("x2"); } f.close(); file.move(i.tostring(), path+"//" + formatted); } } catch (exception ex) { console.writeline(i.tostring()); } can me started i'd use in python accomplish same? i'll

I used to use nano to edit text but I switched to vim, which is more powerful. Will I get the same power up if I move to emacs? -

for 3+ years, thought needed (and technically case) nano. did not understand hoopla vim until tried it. although learning curve ever-so-slightly higher, has simplified coding me , not dream of going nano. i have, however, heard many times on emacs difficult learn, yet useful editor programmer. can has taken similar path of evolution through text editors (and find choosing emacs) tell me advantage is? right view on vim same previous view on nano, is: will marginal utility great enough justify putting in time learn? switching nano vim, answer obvious yes (for me anyway). , same thing vim if learn emacs? i have started use emacs, succession - our local editor (home-msu-made), have used vi/vim several years or far editor, , 3 years ago i've switched emacs. basic commands learned quite fast, , rest of life master it, every day discovering faster way something. there's quite useful tutorial first steps in emacs. obtaining basic knowledge of lisp quite fast too, cust

.net - how to read csdl,ssdl,msl in run time and how to Upgrade Tables from edmx file -

how read csdl,ssdl,msl in run time. , if change schema how upgrade tables i.e. if have edmx(in 1 table lets employee etc.) database wizard generate script of create employee. if modify edmx , add 1 table(like account etc.) , alter employee table(i.e remove coloum).what edmx generate alter , create script. default database script generation can create script new database. fortunatelly feature can modified. database script generation handled workflow or t4 template. can build own , define logic demand. visual studio extension manager offers entity designer database generation power pack provides several new workflows , t4 templates db generation including "generate migration tsql , deploy" workflow. worklfow should use vs 2010 premium (and ultimate) db features compare current db newly generated script, create diff script , deploy it. not use these automatic features. generate diff script manually (with of vs or redgate tools).

objective c - How to send mail from iphone app? -

i try send mail app. want type(dynamically) recipient id,ccid,sub , message. thanks senthilkumar on ios 3+ import #import in view controller header. then: -(void)showmailpanel { mfmailcomposeviewcontroller *mailcomposeviewcontroller = [[mfmailcomposeviewcontroller alloc] init]; // on ios < 3 //if ([mfmailcomposeviewcontroller cansendmail] == no) // [self launchmailapp]; // need mailcomposeviewcontroller.mailcomposedelegate = self; [mailcomposeviewcontroller settorecipients:[nsarray arraywithobjects:@"email address1",@"email address 2",nil]]; [mailcomposeviewcontroller setsubject:@"your subject"]; [mailcomposeviewcontroller setmessagebody:@"your body" ishtml:yes]; mailcomposeviewcontroller.delegate = self; [self.navigationcontroller presentmodalviewcontroller:mailcomposeviewcontroller animated:yes]; [mailcomposeviewcontroller release]; } - (void)mailcomposecontroller:

instantiation - Android Runtime Exception: Unable to instantiate activity componentInfo? -

i running list-fragment program , @ run-time got below error. error: **02-09 09:03:40.213: error/androidruntime(572): java.lang.runtimeexception: unable instantiate activity componentinfo{ni.android.fragment/ni.android.fragment.fragment}: java.lang.classnotfoundexception: ni.android.fragment.fragment in loader dalvik.system.pathclassloader[/data/app/ni.android.fragment-1.apk]** i don't know reason.my program contains 3 classes- detailsfragment.java, fragmentstitles.java , shakespear.java can 1 me out please.... at time if error stating unable instantiate activity componentinfo means code has error. error shown in log cat caused by:......... 1. caused by: android.view.inflateexception: binary xml file line #13: error inflating class fragment (this indicates there error in xml , activity has inflating problem. can know error , if rectify error problem solved.

mysql - PHP: Installing doctrine in project -

i trying run doctrine in custom (own) project, isn't based on popular framework. i've been able following current bootstrap.php; <?php require dirname(__file__) . '/doctrine/common/classloader.php'; $classloader = new \doctrine\common\classloader('doctrine', dirname(__file__) ); $classloader->register(); // register on spl autoload stack however have strong feeling far enough , can't find documentation states should next. running $conn = doctrine_manager::connection('mysql://root:root@192.168.1.4/mytable', 'doctrine'); make php file start throwing errors (fatal error: class 'doctrine_manager' not found) - pretty sure have not completed bootstrap.php properly. what should make doctrine run intended in own project? if work way through extensive doctrine documentation on project website, walks through step step what's required proper doctrine bootstrap added comment on question i'm there no doct

php - Setting target for Iframe using Ajax and Jquery? -

i using zend-framework, iframe, ajax , jquery call url when div clicked. i using iframe follow <iframe src="http://localhost.test.com/public/index/listen-message" name="listenmsg" height="120" width="600"> <p>your browser not support iframes.</p> </iframe> i used following code div <div target="listenmsg" class="text" id="<?php echo $row['id']; ?>"> ...... </div> and jquery write following code..... $(".text").click(function() { var clickeddiv = $(this).attr("id"); var id=$(this).attr("id"); $.ajax({ type: "post", url: "http://localhost.test.com/public/index/listen-message", data: id, success: function(data){ } }); return false; }); but when click div "text" control

gwt - How to reload data rows in GXT grid? -

assuming data retrieves datastore using rpcproxy, populate grid using liststore upon opening page. then, there's form add entity , after modification reflect new list in gxt grid new added row. how can reload grid? tried .reconfigure() method in grid didn't work. grid.getstore().getloader().load(); update: first of must extract grid before proxy, , second thing change rpc callback: public class pagingbeanmodelgridexample extends layoutcontainer { //put grid class outside method or declare final on begin of method grid grid = null; protected void onrender(element parent, int index) { super.onrender(parent, index); rpcproxy> proxy = new rpcproxy>() { @override public void load(object loadconfig, final asynccallback> callback) { //modification here - callback overriden not passed through!! service.getbeanposts((pagingloadconfig) loadconfig, new asynccall

Are there any Scala OAuth libraries that support OAuth 2.0? -

i'm looking both consumer , provider code. dispatch , lift's oauth code both target oauth 1.0 right now. it's far lib maybe can en example write own lib: https://github.com/denibertovic/scala-oauth2

Block incoming/outgoing SMS on Android -

does know reliable way block incoming/outgoing sms messages through code? it's ok if actual sms messages being received, block notifications of sms being received. also, user shouldn't allowed send (or prefferably type) sms message. possible? thanks you can't block outgoing text messages. here's use blocking incoming texts. smsreceiver.java import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.os.bundle; import android.telephony.smsmessage; import android.widget.toast; public class broadcastreceiver extends broadcastreceiver { /** called when activity first created. */ private static final string action = "android.provider.telephony.send_sms"; public static int msg_tpe=0; public void onreceive(context context, intent intent) { string msg_type=intent.getaction(); if(msg_type.equals("android.provider.telephony.sms_received")) { // toast

iphone - How to secure the content of .ipa file in ipad apps -

my ipad app in final stages of development , need send .ipa (build) files various clients. there way secure content in ipa files no body can unzip file , see contents in it?? there way secure contents of ipa??? thank you... this has been discussed here . the best way protect data package them encrypted in bundle.

vb.net - Silverlight TreeView Wont Populate -

i trying populate treeview in silverlight, having difficulties - appears empty. i found tutorial ( here ) on how it, created new project , copied code appears, using c#, , worked perfectly. have tried incorporate project (which uses vb), doesnt work. vb code follows: xaml <usercontrol.resources> <common:hierarchicaldatatemplate x:key="myhierarchicaltemplate" itemssource="{binding items}" > <textblock text="{binding mystring}" /> </common:hierarchicaldatatemplate> </usercontrol.resources> <controls:treeview height="200" horizontalalignment="left" margin="280,464,0,0" name="treeview1" verticalalignment="top" width="120" itemtemplate="{staticresource myhierarchicaltemplate}" /> vb code: public class myitem public mystring string public items observablecollection(of myitem) public sub new(byval mystring string, byval parama

java - Losing modelattribute between methods -

this controller works should @sessionattributes("giveform") @controller public class giveformcontroller { private persondao personmanager; private keycardmanager database; private giveformvalidator validator; public giveformcontroller() { } @autowired public giveformcontroller(keycardmanager database, persondao personmanager, giveformvalidator validator) { this.database = database; this.validator = validator; this.personmanager = personmanager; } @initbinder protected void initbinder(webdatabinder binder) { binder.setvalidator(getvalidator()); } @requestmapping(value = "/give", method = requestmethod.get) public string give(model model) { giveform giveform = new giveform(); model.addattribute(giveform); return "give"; } @requestmapping(method = requestmethod.post, params = {"continue"}) public string go(@modelattr

c# - How to create polarized 3D image using Matlab? -

i want create polarized 3d image using matlab or c#?. way create 3d image 2d image using matlab or c#? polarized 3d effect created in physical world physical projectors shining onto same spot of physical screen . it's not digital effect can create in image on computer screen. cannot write code render image onto normal computer screen see 3d polarized glasses.

php - Drupal 6 Page templates depending on node type -

i trying theme node page based on content type. here tried follow instructions in http://drupal.org/node/249726 . what did , copied node.tpl.php file theme directory. renamed page-node-mycontenttype.tpl.php , wrote preprocess function in template file shown in above link. apparently found displays node contents not common layout elements(html) (logo,header, footer , sidebars etc. defined in page.tpl.php). so necessary me define same common layout elements(html) once again (those defines in page.tpl.php) in page-node-mycontenttype.tpl.php? if have manage 2 template files. html changes need done twice in both template files. is there better way of having common layout template file referred both page , node content type middle content area coming 2 different files (page or node content type)? could please suggest common practice , way achieve this? note: make sure override node template file respect content type both template files node.tpl.php , node-[content_type].tp

c# - IFormatProvider with Integer value -

i have integer value in object. need cast integer value. have done way. system.convert.toint64(object) fxcop said need provide iformatprovider. string data type have no issue provide iformatprovider. how can provide iformatprovider integer value? it depends on how need print value. e.g. using: var provider = system.globalization.cultureinfo.invariantculture; you string independent local (regional) settings. using: var provider = system.globalization.cultureinfo.currentculture; or: var provider = system.globalization.cultureinfo.currentuiculture; instead, string printed using local (regional) machine settings.

android - How to delete a file that exists -

possible duplicate: how delete file sd card? this should simple people, want know how delete file in sd card ( /sdcard/folder ) if exists i.e? try this: file folder = environment.getexternalstoragedirectory(); string filename = folder.getpath() + "/folder/image1.jpg"; file myfile = new file(filename); if(myfile.exists()) myfile.delete();

objective c - UITabBar iPhone query -

how change uitabbar selected or highlighted color in iphone application? have @ custom colors in uitabbar

.net - WiX - harvest non project assemblies in setup output -

i'm using wix 3.5 in vs 2010, , i've added of project assemblies references in setup project (.wixproj), , set harvest property true binaries, content, , satellites included in .msi file. however, how go adding third party assemblies (.dlls) .msi output? need add each explicitly product.wxs file, or there nicer way? ideally, i'd add them file references in setup project, doesn't seem option? yes need add them manually wxs file or can use pre-build step uses heat harvest these file (assuming these file reside in seperate directory). heat part of wix , can harvest entire directory using dir switch. depending on commandline arguments, produce seperate wxs file containing single componentgroup. reference componentgroup product.wxs. for example on how use heat harvest release directory: heat dir "../../bin/release" -gg -cg cg.applicationbinaries -dr installdir -scom -sfrag -sreg -srd -var var.buildoutputdir -o applicationbinaries.wxs th

c# - how to get ReTweet of Twitter? -

i using string twitterfeedurl = "http://twitter.com/statuses/user_timeline/xxx.xml?count=4"; tweets. user_timeline = returns 20 recent statuses posted authenticating user. i want retweets too. should use that?? need authenticated that? newtwitter has api method retweets user. perform request https://api.twitter.com/1/statuses/retweeted_by_user.xml?screen_name=xyz you should update existing request use correct url , api version specified in documentation .

Android: Expand/collapse animation -

let's have vertical linearlayout : [v1] [v2] by default v1 has visibily = gone. show v1 expand animation , push down v2 @ same time. i tried this: animation = new animation() { int initialheight; @override protected void applytransformation(float interpolatedtime, transformation t) { final int newheight = (int)(initialheight * interpolatedtime); v.getlayoutparams().height = newheight; v.requestlayout(); } @override public void initialize(int width, int height, int parentwidth, int parentheight) { super.initialize(width, height, parentwidth, parentheight); initialheight = height; } @override public boolean willchangebounds() { return true; } }; but solution, have blink when animation starts. think it's caused v1 displaying full size before animation applied. with javascript, 1 line of jquery! simple way android? i see question became popular post actual solution. m

javascript - Getting CSS file by ID to manipulate the properties -

i have following snippet overwrites css properties:- var stylesheet = document.stylesheets[2]; // refers 3rd stylesheet // mozilla if (stylesheet.cssrules) { var cssrule = stylesheet.cssrules; // ... } // ie else { var cssrule = stylesheet.rules; // ... } this code works, don't fact i'm referencing stylesheet using document.stylesheets[2] because brittle. so, assigned id link tag, hoping can use jquery stylesheet id. however, i'm not sure how cast returned object jquery cssstylesheet object can assign stylesheet variable. // want change this... var stylesheet = document.stylesheets[2]; // [object cssstylesheet] // ... this... var stylesheet = $("link#layout"); // not right because [object object] any clue? thanks. update per @tj's suggestion, after futzing around, think might go title instead of href ... @ least until find incompatibilities next time. right now, works in ff, ie, safari , chrome. for (var =

c# - passing parameter to dowork? -

i calling zip_threading class in class. string = zip_threading(?,?) but problem how can pass parameter values when calling class : string [] files, bool isoriginal. have used in class background worker threading, real problem passing value class , return value when processing finished in make_zip_file class. public class zip_threading { public string[] files { get; set; } // recieved zip method zip file names. public int number; public string return_path; public bool isoriginal { get; set; } // recieved zip method boolean true or fales public static backgroundworker bgw1 = new backgroundworker(); // make background worker object. public void bgw1_runworkercompleted(object sender, runworkercompletedeventargs e) { make_zip_file mzf1 = e.result make_zip_file; return_path = mzf1.return_path; } public make_zip_file bgw_dowork(string[] files, bool isoriginal, make_zip_file argumentest) { thread.sleep(100); argume

Powershell scripting using where-object -

i trying write powershell script exchange management shell, importing list of contacts csv file distribution group. i start out with import-csv c:\filename.csv | foreach-object {new-mailcontact .......} this works well, except entries in csv file have blank email address, , create teh new contact craps out because externalemailaddress blank. so, tried: import-csv c:\filename.csv | foreach-object { where-object {$_.externalemailaddress -ne "" } | new-mailcontact -name $_.name -externalemailaddress $_.externalemailaddress....} but didn't seem work - didn't filter out entries blank email addresses. what doing wrong? i think might want use where-object prior foreach-object because filter objects passed along pipeline. depending on new-mailcontact cmdlet supports might able pipe results directly or may have pass them 1 one. all @ once (not using foreach-object ): import-csv c:\filename.csv | where-object {$_.externalemailaddress -ne "

r - Saving in hdf5save creates an unreadable file -

i'm trying save array hdf5 file using r, having no luck. to try , diagnose problem ran example(hdf5save) . created hdf5 file read h5dump . when ran r code manually, found didn't work. code ran same ran in example script (except change of filename avoid overwriting). here code: (m <- cbind(a = 1, diag(4))) ll <- list(a=1:10, b=letters[1:8]); l2 <- list(c="c", l=ll); pp <- pi hdf5save("ex2.hdf", "m","pp","ll","l2") rm(m,pp,ll,l2) # , reload them: hdf5load("ex2.hdf",verbosity=3) m # read "ex1.hdf"; buglet: dimnames dropped str(ll) str(l2) and here error message h5dump : h5dump error: unable open file "ex2.hdf" does have ideas? i'm @ loss. thanks i have had problem. not sure of cause , neither hdf5 maintainers. authors of r package have not replied. alternatives work in time since answered, hdf5 package has been archived, , suitable alte

transactions - Is rollback can work without savepoints in DB2? -

this question partially related this one why transaction not rolled when using following sql: insert testschema."test" (id, name) values (11111, 'sdfasdfasd'); rollback; as known db2/iseries documentation: the rollback statement used end unit of work , out database changes made unit of work. what indicator unit of work started or ended? rolled in example mentioned above? i thankful answers , links. ps. using db2/iseries v5r4. pps. sorry bad english everything in db2 done within scope of transaction. transaction ends on commit (either explicit or implicit) or rollback. keep in mind that, default, many clients have autocommit parameter set true, means after every statement there implicit commit. so, in example above, i'm going assume autocommit on, , insert committed immediately. thus, rollback statement did nothing.

c# - How can i check for RegistryKey permissions like ReadKey or FullControl in .NET? -

i want check have permissions on registrykey example can read values , write values. blog enumerates permissions http://blogs.msdn.com/b/bclteam/archive/2006/01/06/509867.aspx how can go getaccesscontrol() knowing have example fullcontrol? i'm afraid there no managed code this. use dllimport , invoke checkaccess prefer accessing registry , handling exception (if any)

.net - Is the win7 clock calendar available as a control for applications? -

Image
is calendar used in win7 clock display available reusable control other applications? if so, know of .net wrapper it? there datetimepicker control calendar similar 1 windows has there no .net control clock.

geolocation - How to get use Geocoder in android? -

is below code sufficient lat & long value address. list<address> addresslist = geocoder.getfromlocationname(cityname, 1); address address = addresslist.get(0); if(address.haslatitude() && address.haslongitude()){ double selectedlat = address.getlatitude(); double selectedlng = address.getlongitude(); } please tell me proper method use geocoder

use of the yyleng function in ml-lex -

could me out use of yyleng function of ml-lex. how use display length of length of matched text in analyser ( this question answered in comments. converted community wiki answer suit q&a format .) @jesper.reenberg noted: you might wan't rephrase question. not clear exact problem is. far know, have yypos , yytext in ml-lex. can take length of yytext length of matched. see user guide , here or here examples.

ruby on rails - Multiple associations in same table with multiple potential foreign keys -

i want seemingly simple associations: class orderwizard < activerecord::base belongs_to :buyer_wizard, :class_name => miniwizard.name belongs_to :seller_wizard, :class_name => miniwizard.name end class miniwizard < activerecord::base has_one :order_wizard, :foreign_key = '????' # buyer_wizard_id or seller_wizard_id def is_buyer_wizard? ?? end def is_seller_wizard? ?? end end an associated miniwizard needs know connecting it. assuming has_many :through best way go? if so, how models look? a miniwizard instance needs know if it's buyer or seller. stuck on how this. you want 2 associations, example, might represent relationships more accurately: class miniwizard < activerecord::base has_one :bought_order_wizard, :foreign_key => 'buyer_wizard_id', :class_name => 'miniwizard' has_one :sold_order_wizard, :foreign_key => 'seller_wizard_id', :class_name => 'm

java - Which kind of webapps can realistically be affected by the floating bug? -

there's easy way totally lock lot of jvm: class runhang { public static void main(string[] args) { system.out.println("test:"); double d = double.parsedouble("2.2250738585072012e-308"); system.out.println("value: " + d); } } or, hang compiler: class compilehang { public static void main(string[] args) { double d = 2.2250738585072012e-308; system.out.println("value: " + d); } } as explained here: http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ my question simple: kind of well-conceived web application know can realistically affected this? in other words: on kind of webapps attacker perform denial of service using known weakness? it bad, terribly bad. besides programmers using floating-point monetary computation don't see many java-backed websites can crashed. i can see toy scientific applets being candidates besides that... here's threadump of blocked thread (done

email - CakePHP problems with Yahoo, Hotmail and YopMail referals -

here's 1 of strangest problems i've ever seen in life developer: i have website running cakephp (lastest version, always) , when send email (using yahoo, hotmail or yopmail), let's "remember password" message, cakephp don't work properly. what should happend: user acess website using link sent via email, internal process (generating new password , sending via email user), redirect user homepage message "your new password sent email". the problem when user clicks link he's redirected homepage without session variables... , there's no generated email! but if send same link using gmail works charm. do have clue should start? it problem security level... lowered "low" , worked.

Running multiple applications using hibernate with a single standalone EhCache server -

i have 2 app servers (in case tomcat needn't container) running same application load balancer directing work them. behind these servers have single database both servers wish connect via hibernate. want cache common object requests using ehcache. in single server setup trivial configuration change hibernate use ehcache provider. however, don't want each server have own cache, think want central cache both servers use. originally, thought simple matter of setting standalone ehcache server , pointing hibernate configuration @ them. however, have been unable identify how can performed (if @ all). my questions are: can setup exist , how 1 set up? if isn't possible, there other way (or other caching provider) in maintain common hibernate cache between applications? i not aware of ehcache server can accessed several machines. might write , expose e.g. rest api, have implement own cacheregionfactory hibernate use remote server behind scenes. lot of work ,

vb.net - How update a SQL table from a modified datatable? -

i used dataset designer create ftwdataset holds alarmtext table sqlexpress database. far form contains datagridview1. code below shows contents of alarmtext table plus 1 added checkbox column (which populate display-only data, , not issue here). dim ta new ftwdatasettableadapters.alarmtexttableadapter dim dt new ftwdataset.alarmtextdatatable ta.fill(dt) datagridview1.datasource = dt 'create new bool column in datatable dt.columns.add("newcol", (new boolean).gettype) what else need use datagridview edit , save values in alarmtext table? here's brief msdn walkthrough on topic. some notes: you shouldn't need binding source persist changes database. to make table adapter accessible other procedures in form, make form-scoped (a.k.a. member) variable instead of method-scoped, in example. if created dataset using dataset designer, , you're fetching original data more simple table or view, adapter won't know how

c++ - Saving frames in a directshow filter -

i have application relies on c++ directshow transform filter, purpose of analyzing going on step step want save each frame camera filter processes. simplest method achieve in filter itself? can insert sample grabber filter graph? beware though: frame in pixel format, , if it's not rgb24 you'll in lot of trouble analyze it. if possible, configure input source rgb24 , you'll on way. expand question if need more info.

c# - WPF ComamndBinding Help on MenuItem -

new wpf...was reading wpf routed command bindings per-tab , close getting working. the menuitem disabled until ruletab (tabitem) selected rather pop find dialog shows system.windows.input.commandbinding on menu. doing wrong? xaml: <menuitem header="_find..." isenabled="{binding elementname=ruletab, path=isselected}" > <commandbinding command="find" executed="executefind" canexecute="find_canexecute" ></commandbinding> </menuitem> code-behind: private void executefind(object sender, executedroutedeventargs e) { // initiate finddialog finddialog dlg = new finddialog(this.ruletext); // configure dialog box dlg.owner = this; dlg.textfound += new textfoundeventhandler(dlg_textfound); // open dialog box modally dlg.show(); } void dlg_textfound(object sender, eventargs e) { // find

javascript - HTML form elements with a jstree? -

i have implemented jstree basic layout. <div id="mytree"> <ul> <li class="category"><a href="#">category1</a> <ul><li class="subcategory"><a href="a">subcategory1</a></li></ul> <ul><li class="subcategory"><a href="a">subcategory2</a></li></ul> <ul><li class="subcategory"><a href="a">subcategory3</a></li></ul> </li> <li class="category"><a href="#">category2</a> <ul><li class="subcategory"><a href="a">subcategory1</a></li></ul> <ul><li class="subcategory"><a href="a">subcategory2</a></li></ul> <ul><li class="subcategory">