Posts

Showing posts from May, 2013

jquery - Using <option> to scroll to anchor, then opening section -

i'm trying code <select> dropdown when <option> clicked, page scroll down options sections using regular anchors/ids. i'm assuming can calling function onchange, maybe: <select class="jump-select" onchange="scrollto();"> <option selected="selected">jump section</option> <option value="#general-info">general information</option> <option value="#venue-info">venue information</option> <option value="#deal-info">deal information</option> <option value="#doc-mgmnt">document management</option> <option value="#buyer-info">buyer information</option> <option value="#billing-info">billing , additional information</option> <option value="#expenses">expenses</option> </select> but on top of sections using jquery hide them o

python - Remove the newline character in a list read from a file -

i have simple program takes id number , prints information person matching id. information stored in .dat file, 1 id number per line. the problem program reading newline character \n file. have tried 'name'.split() method, doesn't seem work list. my program: from time import localtime, strftime files = open("grades.dat") request = open("requests.dat", "w") lists = files.readlines() grades = [] in range(len(lists)): grades.append(lists[i].split(",")) cont = "y" while cont == "y" or cont == "y": answer = raw_input("please enter student i.d. of whom looking: ") in range(len(grades)): if answer == grades[i][0]: print grades[i][1] + ", " + grades[i][2] + (" "*6) + grades[i][0] + (" "*6) + grades[i][3] time = strftime("%a, %b %d %y %h:%m:%s", localtime()) print time print "exa

sql - sqlite return as day of week -

i have 1 table has 3 columns: tb1 = _id(int,prikey,autoinc) , busnum(text) , servdate(date) i use following query me jobs within past week ( week starts monday): select * tb1 servdate between date('now', 'weekday 1', '-21 days') , date('now') i want query work same instead return "servdate" fields corresponding day of week. example, "monday", instead of "2010-11-28". is possible? you can use ancillary table wallyk suggested; or can use case expression: select _id, busnum, case cast (strftime('%w', servdate) integer) when 0 'sunday' when 1 'monday' when 2 'tuesday' when 3 'wednesday' when 4 'thursday' when 5 'friday' else 'saturday' end servdayofweek tb1 ...

Visual Studio 2010 crashes after build -

i have vb.net windows forms application has been around long time. working project in visual studio 2010 premium, on windows 7 x64 workstation. has been going along fine till couple days ago. no every time build project visual studio 2010 crashes. the thing have go on visual studio 2010 instance attached debugger dieing process. ... thread 'win32 thread' (0x177c) has exited code -2147023895 (0x800703e9). thread 'win32 thread' (0xc44) has exited code -2147023895 (0x800703e9). program '[4224] devenv.exe: native' has exited code -2147023895 (0x800703e9). no 1 else on team has issue, , don't have problems other projects. this .net 4.0. any thoughts or suggestions appreciated, beezler it might wise start vs /safemode parameter. i had problem , solved uninstalling achievements extension.

objective c - NSKeyedArchiver with pointers -

hi if want archive structure pointers in it, 2 different pointers point same place, after encoding-decoding point same place? sorry bad english, , thx ahead answers , free time! yes. if have 2 keys point same object, nskeyarchiver restore them keys pointing same object. nsstring *one = @"1"; nsstring *two = @"2"; nsmutabledictionary *dict = [[[nsmutabledictionary alloc] initwithobjectsandkeys:one, @"one", two, @"two", one, @"three", nil] autorelease]; nslog(@"one=%d, two=%d, three=%d", [[dict objectforkey:@"one"] hash], [[dict objectforkey:@"two"] hash], [[dict objectforkey:@"three"] hash]); nsdata *data = [nskeyedarchiver archiveddatawithrootobject:dict]; dict = nil; // no tricks! dict = [nskeyedunarchiver unarchiveobjectwithdata:data]; nslog(@"one=%d, two=%d, three=%d", [[dict objectforkey:@"one"] hash], [[dict objectforkey:@"two"] hash], [[dict

java - Where the log stream goes? -

when app started, not console ui icon, standard stream goes, mean can example see log? plain old system.out directs "default" ? as angus said, without console don't output. once you've launched application gui, can set system.out field log destination (rather tty or console), using system.setout . in way can write file passing: system.setout(new printstream(path_to_a_file)); however, not advised. the best thing can use logging framework such log4j or slf4j, , perform logging (to file, network host or console) way.

vb.net VB 2010 Underscore and small rectangles in string outputs? -

i've made progress first attempt @ program, have hit road block. i'm taking standard output (as string) froma console cmd window (results of dsquery piped dsget) , have found small rectangles in output. tried using regex clean little bastards seems related _ (underscore), need keep (to return 2000/nt logins). odd thing - when copy caharcter , paste vs2k10 express acts carrige return?? any ideas on finding out these little sob's -- , how remove them? going try using /u or /a cmd switch next.. the square used whenever character not displayable. character cr. can use regular expression normal characters or remove cr lf characters using string.replace .

c - Synchronizing access to a doubly-linked list -

i'm trying implement (special kind of) doubly-linked list in c, in pthreads environment using c-wrapped synchronization instructions atomic cas, etc. rather pthread primitives. (the elements of list fixed-size chunks of memory , surely cannot fit pthread_mutex_t etc. inside them.) don't need full arbitrary doubly-linked list methods, only: insertion @ end of list deletion beginning of list deletion @ arbitrary points in list based on pointer member removed, obtained source other traversing list. so perhaps better way describe data structure queue/fifo possibility of removing items mid-queue. is there standard approach synchronizing this? i'm getting stuck on possible deadlock issues, of inherent algorithms involved , others of might stem fact i'm trying work in confined space other constraints on can do. edit : in particular, i'm stuck on if adjacent objects removed simultaneously. presumably when removing object, need obtain locks on both previous

OCaml makefile dependency problem -

i using ocaml makefile project working on , have folowing modules dynamictree.ml huffman_dynamic.ml uses dynamictree huffman_static.ml main.ml uses both huffman_static , huffman_dynamic . this make file : # put here names of source files (in right order) sources = huffman_static.ml dynamictree.ml huffman_dynamic.ml main.ml # name of resulting executable result = huffman # generate type information (.annot files) annotate = yes # make target (see manual) : byte-code, debug-code, native-code all: native-code include ocamlmakefile when try make project, unbound value dynamictree.create_anchor_leaf results ocamlopt -c -dtypes huffman_dynamic.ml generated makefile. the ocaml makefile wepage states generates automatically dependencies, missing here? thank you. is capitalization of name correct ? in post use both dynamictree.ml , dynamictree.ml . are sure issue comes makefile ? there create_anchor_leaf function exported dynamictree.ml ? no .mli

c++ - Should I assign my pointer 0 after delete? -

possible duplicate: is practice null pointer after deleting it? my professor told it's practice set pointer 0 after we've deleted allocated space pointing , i've been trying make habit out of doing this. when this, compiler sends warning way: warning w8004 linkedlist.h 102: 'nptr' assigned value never used in function linkedlist::remove(int) i know warnings aren't end of world , program still compile, ocd not let go. ask more knowledgeable programmers: is common set pointer 0 after deleting it's node , practice? matter if continue let programs compile warnings such this? answers! it common. not, imho, practice. good practice arrange deletes in such way already know pointer can't used after deletion. best way use raii, i.e. work in destructor. once destructor reaches end, object no longer exists, therefore pointer (being data member) no longer exists, therefore not dangling.

osx - Can a file be transferred from iPhone to Mac using Bluetooth programatically? -

can file transferred iphone iphone/ipod/ipad , mac/pc using bluetooth using iphone app? i posted question yesterday same content. closed. can 1 tell me why done so? iphone sdk 3.0: bluetooth? in short: no.

Calling PHP function using JQuery .ajax() -

i'm trying use php function read server directory images. images need passed jquery using .ajax() use in slideshow. i'm using php function hoping simplify adding/removing images user. basically, they'd have add or remove images directory modify slideshow , not edit code. i'm struggling jquery function return i'm expecting. it's been while since i've done php may overlooking someone. here's php code: <?php $path = "./"; while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') echo "<img src=\"" . $path.$file. " alt=\"" . $file . "\>"; { } ?> here's readimages jquery function: function readimages() { $.ajax({ type: "post", url: "getimages.php", datatype: "html", success: function(imagepath){ $(".slideshow"

r - Group rows by attributes -

i have data frame containing data student lateness various classes. each row contains data late student , class: date , time of class, name of class, class size, number of minutes late, , gender of student. in order total percentage of late students classes, need count number of rows (late students) , compare total number of students attended class. i can't sum class sizes of rows; count students of given class several times, once each late student in class. instead, need count each class size once each meeting of class. example key: minutes late, class name, students in attendance, gender of tardy student, minutes late. 11/12/10 stats 30 m 1 11/12/10 stats 30 m 1 11/12/10 stats 30 m 1 11/15/10 stats 40 f 3 11/15/10 stats 40 f 3 11/15/10 stats 40 f 3 11/16/10 radar 22 m 2 11/16/10 radar 22 m 2 11/16/10 radar 22 m 2 11/16/10 radar 22 m 2 11/16/10 radar 22 m 2 in case, there 3 different class meetings , 11 late students. how make sure each class meeting's class size

Regex speed in Java -

some example wallclock times large number of strings: .split("[^a-za-z]"); // .44 seconds .split("[^a-za-z]+"); // .47 seconds .split("\\b+"); // 2 seconds any explanations dramatic increase? can imagine [^a-za-z] pattern being done in processor set of 4 compare operations of 4 happen if true case. \b? have weigh in that? first, makes no sense split on 1 or more zero-width assertions! java’s regex not clever — , i’m being charitable — sane optimizations. second, never use \b in java: messed , out of sync \w . for more complete explanation of this, how make work unicode, see this answer .

Cannot Insert NULL into NTEXT field in SQL CE? -

a simple example: create table people ( personid int not null , name nvarchar(50) not null , addrline1 nvarchar(50) null , addrline2 nvarchar(50) null , suburb nvarchar(30) not null , xmlrawinput ntext not null , xmlrawoutput ntext null ) go insert people ( personid , name , addrline1 , addrline2 , suburb , xmlrawinput , xmlrawoutput ) select 101 personid , 'george benson' name , '123 st' addrline1 , null addrline2 , 'los angeles' suburb , '<example>record<example>' xmlrawinput , 'i love microsoft' xmlrawoutput go this works fine; notice null can inserted addrline2 column; if change 'i love microsoft' null on ntext column, following error: conversion not supported.

DatePicker Example in android -

please suggest me tutorial gives example datepicker , how use methods ondatechangedlistener, ondatechanged etc. going through sites, did not clear idea of it. thank you android references on datepicker quite good. have @ here . private datepicker datepicker; //monthofyear between 0-11 datepicker.init(2010, 11, 1, new ondatechangedlistener() { @override public void ondatechanged(datepicker view, int year, int monthofyear,int dayofmonth) { // notify user. } });

javascript - Not able to register preferences on mozilla using registerFactoryLocation -

i m xpcom component registering preferences on mozilla firefox not getting reflected in prefs.js file. more need use apart registerfactorylocation code.... in advance :) ya sure,i have developed xpi,in in comonents folder have added mymanager.js file. in have creted component using code like.......... http://kb.mozillazine.org/implementing_xpcom_components_in_javascript code not able add _prority preferece mozilla firefox preferences(prefs.js) file. need more register preference... although extension can register preferences, prefs.js contains changed preferences, won't automatically appear there.

java - How to relay NAT dynamic port numbers if the server receives 0 as port no? -

i'm trying implement udp punch holing through java servlet. when use req.getremoteport() 0 (i.e. dynamic). that's doesn't help. way around that? alternative solutions? http://sss.mysimpatico.com/server?authentication=unregistered the code prints first 0 , 1 attached ip: final int port = req.getremoteport(); pw.println(port); final string ip = req.getremoteaddr() + ":" + port; there gae issue (please star if interested): http://code.google.com/p/googleappengine/issues/detail?id=4210 your question tagged google-app-engine; google app engine uses http (see sandbox section), http uses tcp not udp.

php - Name for the Strings that Define Magento Class Names -

magento uses factory pattern instantiating objects classes $model = mage::getmodel('catalog/product'); //mage_catalog_model_product default $helper = mage::helper('catalog/data'); //mage_catalog_helper_data default these strings expanded classnames, , system can configured replace default values. what are, or should, these strings called? i've been abusing term uri (sometimes tempering abuse phrase "uri-like"), that's not right. "class name" doesn't seem right either, cause confusion (are talking factory class name, or actual php class name?) anyone have stabs @ authority on this? this string called class (model, block, helper - depends usage context) alias. alias naming rule is: group/entity . each module can define own group or define rewrites existing one.

asp.net - Iterate each textbox controls in "MainContents"? -

i'm able iterate each text box control in "maincontents" using code below. q1: there shorter way? (to controls in "maincontents"?) each ctrl control in page.controls each subctrl control in ctrl.controls each subctrlsub control in subctrl.controls if typeof subctrlsub system.web.ui.webcontrols.contentplaceholder if subctrlsub.clientid = "maincontent" each ct control in subctrlsub.controls if typeof ct system.web.ui.webcontrols.textbox r short = 1 8 c short = 1 6 .... (do something) ... next next end if next end if end if next next next i convert

php - wp_insert_post with a form -

<?php $submitted = $_post['submit']; $post-title= $_post['post_title']; $post-content= $_post['post_content']; $new_post = array( 'post_title' => '$post-title', 'post_content' => '$post-content', 'post_status' => 'publish', 'post_author' => $user_id, ); if(isset($submitted)){ wp_insert_post($new_post); } ?> <form method="post" action=" "> <input type="text" name="post_title" size="45" id="input-title"/> <textarea rows="5" name="post_content" cols="66" id="text-desc"></textarea> <input type="hidden" name="cat" value="7,100"/> <input class="subput round" type="submit" name="submit" value="post"/> </form> i tes

c# - How to stop scrolling of Panel scrollbar when textBox is selected -

i have panel called panel1 contains many textboxes .(around 12 textboxes) when click on textbox (one of last textboxes) panel's scrollbar position change position.(it scrolls automatically , focus changes). how can prevent ? i not getting exact problem. tried same did, getting focus on same textbox clicked mouse. set properties of panel like: autoscroll=false; autoresize=true;

from and select in c# .net? -

possible duplicate: from , select in c# .net? can please tell me how specify particular column in select statement in following coding: var combinedrows = dt1 in dsresults.tables[0].asenumerable() join dt2 in dsresults.tables[1].asenumerable() on dt1.field<string>("methodname") equals dt2.field<string>("methodname") select new { dt1, dt2 }; datatable finaldt = new datatable("finaltable"); finaldt.columns.add(new datacolumn("sp", typeof(string))); finaldt.columns.add(new datacolumn("method", typeof(string))); finaldt.columns.add(new datacolumn("class", typeof(string))); finaldt.columns.add(new datacolumn("bllmethod", typeof(string))); datarow newrow = finaldt.newrow(); foreach (var row in combinedrows) { datarow datarow = finaldt.newrow(); datarow.itemarray = row.dt1.itemarray; finaldt.rows.add(datarow); }

ssl - erlang socket send timeout never happens -

i implementing tcp server in erlang talks mobile phone clients. mobile phones offline lot, server must able detect it. hence want server send messages clients timeout, when timeout happens connection closed , client marked offline. i used listen option on server: [{certfile, "cert.pem"}, {keyfile, "key.pem"}, {reuseaddr, true}, {active, false}, {send_timeout, 10000}] after set connection between server , mobile phone, switch phone airplane mode(which shuts down wireless signals), , ssl:send on server. send function happliy returned ok if packet transmitted. what have done wrong? did set {send_timeout_close, true} parameter on socket inet ? if not, socket won't closed, return timeout error. there risk ssl swallows error , it. some other points: remember check return value of ssl:send , ssl:receive options error. important know send went well. ok = ssl:send(sock, data), the underlying tcp/ip stack might accept data send_

delphi - Installing component in dclusr.dpk breakes other components -

first i've installed rx library 2.75 , others. i'm trying install custom (not mine) component tmylookupedit derived trxlookupedit . thru main menu -> component -> install component... , choose components' .pas file and when delphi tries rebuild dclusr.dpk (don't remember, reproduce i've found no other way reinstall delphi): can't load package c:\program files\borland\delphi6\projects\bpl\dclrx6.bpl. cannot load package 'rxctl6.' contains unit 'fileutil,'which contained in package 'rxctl660' then ide tells me mylookupedit component installed and 100 other components un installed. rx components gone palette i'm sure i've installed rxctl6 , not rxctl6 60 . both in c:\program files\borland\delphi6\projects\bpl now. clue have #define in dclusr.dpk file (see below) how can make rx , component work ? here dclusr.dpk (most #defines omitted): {$libsuffix '60'} requires rtl, vcl, designid

Unit testing dynamic queries in Entity Framework 4 -

when implementing unit of work pattern entity framework 4.0, correct design give ability create dynamic queries createquery method of object context? , correct mean designing somehow can use in unit test mock objects. thanks. don't know mean "correct" depends on situation, general answer need abstractions can replaced during test. inspiration, here use (we use self tracking poco entities) /// <summary> /// object context interface abstracting service layer /// implementation details of object storage. /// </summary> public interface iobjectcontext : idisposable { /// <summary> /// returns entity objects of given type known object context. /// </summary> /// <typeparam name="tentity">the type of entity.</typeparam> /// <returns>the instances of given type loaded object context</returns> ienumerable<tentity> getmanagedentities<tentity>() tentity : entitybase;

asp.net - How to create multiple classes in single DTO class? -

i used making separate business object , list<> classes db tables. have basic task in hand displaying list of year search box or having values in drop down. right ending lot of separate classes , list classes<> these basic operations. how can make single class basic tasks these using generics? want have single class methods current year, employee names, department name/code, title etc. please give me example. using .net 2.0. edit after searching, found can achieve similar tasks creating dto namespace. what don't right how create multiple classes inside dto class. 1 class returning 'year', 1 'employee name/code' , on inside single dto class. you can map classes db table manually or can use nhibernate advanced orm works quiet .net 2.0. basically can map plain c# classes db table using simple xml mapping file. example class called product can public class product { public guid id { get; set; } public string

creating a folder and putting spreadsheet automatically after submitting the form in google site -

what wanted have created form registration in after giving submit button need create folders called product , catalog. in product folder need spreadsheet needs created everytime when new person gets registered in form. registration form-->after submit-->product folder creation-->spreadsheet of product. is possible in google site??is there google api this?? you can't store file in gae, can store bigtable db, of course can use google docs account, http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#createfolders http://code.google.com/apis/spreadsheets/

How to run a javascript function after a specific JS has loaded? -

i have made js function including javascript in html. need make sure script have loaded using function has completed processing , move further in original script. function loadbackupscript(){ var script = document.createelement('script'); script.src = 'http://www.geoplugin.net/javascript.gp'; script.type = 'text/javascript'; var head = document.getelementsbytagname("head")[0]; head.appendchild(script); } i need know script has loaded use functions ahead. how do that? function loadbackupscript(callback) { var script; if (typeof callback !== 'function') { throw new error('not valid callback'); } script = document.createelement('script'); script.onload = callback; script.src = 'http://www.geoplugin.net/javascript.gp'; document.head.appendchild(script); } loadbackupscript(function() { alert('loaded'); });

c - Does For-Loop counter stay? -

simple question. imagine in ansi-c: int i; for(i=0 ; i<5 ; i++){ //something... } printf("i %d\n", i); will output "i 5" ? is i preserved or value of i undefined after loop? yes. if declared outside of loop remains in scope after loop exits. retains whatever value had @ point loop exited. if declatred in loop: for (int = 0 ; < 5 ; i++) { } then undefined after loop exit.

iphone - adding icon between back button & title of navigation bar -

i want put icon side of title of navigation bar. i'd prefer not implement custom titleview, because i'll need create custom titleview each controller put on stack (and have pretty deep nesting). i'm adding uiimageview navigationbar. problem calculate icon's horizontal position. depends on width of button, has each time title. how calculate button frame? googling on seems doesn't bring reasonable results. thanks in advance you calculate size of label, text in , experiment button add on.. cgsize s = [label sizewithfont:_font];

java - how to set textview in bottom -

Image
my textview display in emulator top..how change bottom... <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/tv"> <textview android:text="embdes technologies" android:id="@+id/textview01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="#ff000000" android:textstyle="bold" android:gravity="bottom"/> <gallery xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/videogrdvw" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </relativelayout> although question see

c# - Impossible to Kill Threads waiting for Interop objects -

i've been searching through google little bit , quite fast discovered there no solution on aborting thread using com interop , in "wait interop event" state. thread.abort() put thread "abortrequested" mode, which, quite franky, isn't much. the results me not being able close application. process remains in taskman because of childthread. anyone know if possible force abort thread? have tried setting " isbackground=true " on thread? threads marked background cleaned when process exiting, whereas process exit wait "foreground" threads.

If I kill a delete query in mysql, will the rows all be saved? -

suppose i'm halfway through running import, , instead of running select count(*) table_being_imported i hit ctrl + r , type table_being_im , hit return, find horror i've issued delete table_being_imported oops. hit ctrl + c , told: ctrl-c -- sending "kill query 627" server ... ctrl-c -- query aborted. error 1317 (70100): query execution interrupted would have deleted of rows? hypothetically, of course... hypothetically,... some of rows gone. during update or delete operations, kill flag checked after each block read , after each updated or deleted row. if kill flag set, statement aborted. note if not using transactions, changes not rolled back. not time mention it, why transactional queries best when dealing business-critical data.

jvm - How would I be able to access (click buttons, type text) to Java AWT / Swing Frames from another application? -

i work application testing , our integration testcode (written in java , using among other stuff selenium webdriver) access frames executed in different jvm (launched product testing). i have looked @ using festswing, relies on java 1.6 , forced use java 1.5. our organization used quicktest professional unstable. had way of accessing frames through jvm hooks in other jvm. our product web uses java swing jframes , awt frames. /mikael magnusson. try review resource: http://java-source.net/open-source/testing-tools

winapi - What's the difference between WindowFromPhysicalPoint and WindowFromPoint? -

windowfromphysicalpoint new vista. documentation identical windowfrompoint . what's difference? both seem take absolute point (offset screen origin) , return topmost (z order) hwnd contains point. http://msdn.microsoft.com/en-us/library/ms633533(vs.85).aspx windows vista introduces concept of physical coordinates. desktop window manager (dwm) scales non-dots per inch (dpi) aware windows when display high dpi. window seen on screen corresponds physical coordinates. application continues work in logical space. therefore, application's view of window different appears on screen. scaled windows, logical , physical coordinates different.

c++ - Delete objects of incomplete type -

this 1 made me think: class x; void foo(x* p) { delete p; } how can possibly delete p if not know whether x has visible destructor? g++ 4.5.1 gives 3 warnings: warning: possible problem detected in invocation of delete operator: warning: 'p' has incomplete type warning: forward declaration of 'struct x' and says: note: neither destructor nor class-specific operator delete called, if declared when class defined. wow... compilers required diagnose situation g++ does? or undefined behavior? from standard [expr.delete]: if object being deleted has incomplete class type @ point of deletion , complete class has non-trivial destructor or deallocation function, behavior undefined. so, it's ub if there's nontrivial stuff do, , it's ok if there isn't. warnings aren't neccessary ub.

Executing javascript from Silverlight out of browser app -

i have silverlight app uses javascript process images facebook. javascript calls context.drawimage throws security exception (ns_error_dom_security_err) understood happens since image not hosted server, different server (in case facebook). after research, found correct permissions given app if run out of browser, understood can't run javascript since there no browser host it. is correct? if so, can suggest workaround running javascript needed permissions access image hosted different server. thanks! you correct. javascript cannot run because there's no browser host it. the solution rewrite javascript.

php - 1 line. Where to place ID in the link -

i have created separate posting large 1 of before because think have isolated cause of id value not getting passed. i have link, there not correct , no value sent. $soutput .= '"<a href=\"#' ."id=" .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",'; that above line of interest. and curiosity, snippet receives value <script type="text/javascript"> $(document).ready(function(){ $('a.flip').live('click',function(){ $(".panel").slidetoggle("slow"); $('#reviews').load('sendidtodatabase.php', {idcruise: this.id}); }); }); </script> so, whole scenario is: a table, rows , links on column in rows. when click on link, 2 things should happen. a) slide panel opened b) , value passed div inside panel (div loads result of php query received id value)

visual studio 2008 - Free Allocated Memory Generates Exception - C++ -

there function in application in memory allocated formatting port name. createfile called open port. @ end of function free called attempt free allocated memory. dword cserialport::open( wchar_t * port ) { dcb dcb = {0}; lpthread_start_routine pthreadstart; void * pvthreaddata = null; wchar_t * pwcportname = null; dword dwretval = error_success; /* validate parameters. */ pwcportname = (wchar_t *)malloc( wcslen( port ) + 6 ); if ( pwcportname == null ) { trace(_t("cserialport::open : failed allocate memory formatted serial port name.\r\n\terror: %d\r\n\tfile: %s\r\n\tline: %d\r\n"), error_not_enough_memory, __wfile__, __line__); return error_not_enough_memory; } memcpy( pwcportname, l"\\\\.\\", 4 * 2 ); memcpy( pwcportname + 4, port, wcslen( port ) * 2 + 2 ); // handle serial port. _hserialport = createfile( pwcportname, // formatted serial port

javascript - how to use rich:effect with a4j:support and reRender -

on jsf-page, i'm showing content based on value of checkbox. how can attach effect (like fading in , out) when content rerendered? there event onrender or something? here got far, effect not showing. <t:selectbooleancheckbox title="yes" label="yes" value="#{mybean.booleanvalue}"> <a4j:support ajaxsingle="true" event="onchange" rerender="panel"/ </t:selectbooleancheckbox> <t:div id="panel"> <rich:effect name="hidediv" for="mypanelgrid" type="opacity" params="duration:0.8,from:1.0,to:0.1"/> <rich:effect name="showdiv" for="mypanelgrid" type="opacity" params="duration:0.8,from:0.1,to:1.0"/> <t:panelgrid columns="2" rendered="#{mybean.booleanvalue}" id="mypanelgrid"> ... ... ... </t:panelgrid> </t:div> what you've forg

How to integrate Rational ClearQuest and RequisitePro -

hi looking solution "how integrate rational clearquest , rational requisitepro" both typical , customs setup type. try on ibm site confusing me, please help thanks in general, cq-reqpro integration tends confusing. best source have found integrating requisitepro , clearquest little manual developed ibm support people. can found in link: http://www-01.ibm.com/support/docview.wss?uid=swg27009627 there's video manual configuring cqtm requisitepro (the tm test manager). can found here: http://publib.boulder.ibm.com/infocenter/ieduasst/rtnv1r0/index.jsp?topic=/com.ibm.iea.rcq/rcq/7.0/operations/cqrp_with_cqtm/player.html

Passing Objects from Java(BlazeDs) Server to Front end Flex app -

i looking help. have set java dynamic web project uses blazeds. on tomcat server , can send , recieve strings front end flex project. my question amf channels set communicate how can pass objects such arraylists or 2 dimensional arrays accross channel , render them in flex app (say through datagrid?) appreciated! thanks the mechanism send objects same strings. instead of service returning or receiving string can return or receive object, list, etc. what need keep in mind how data serialized/de-serialized, is, how data converted actionscript data type java data type , viceversa. link can link text

python - How to add a pagination "go to page" form set to Django admin on a ModelAdmin form? -

here's gist of desired scenario : i've got standard django pagination going in admin site. i'd let user enter number text input corresponds page number. user presses enter or clicks button. results page number entered shown. note : i'm using django 1.2.3 python 2.65 i'm modifying modelform else created our admin site. any ideas, suggestions, and/or comments appreciated! thank you, michaux every pagination system have come across including standard django pagination uses parameters rendering page. so, providing form page number of page displayed simplest thing can html forms. <form> <input type="text" name="page"> <input type="submit"> </form> to include this, might want override corresponding admin template.

php - how to generate array that shows reletionship between multiple classes? -

i want php script scans php classes files in given directory(sub directories too) , generate relation ship between them in array form. suppose folder contains files , subdirectories( 2 subfolders). | | |-class1.php | | \-class2.php | |-subdir1 | | |-class11.php | | \-class22.php | |-subdir2 | | \-class33.php it contains total 5 files. scanning files in directory not big issue...but how can deliver class relationship between them. i want array in form. array([0]=>classname=>class1,extends=>class2,implements=>[0]class11[1]class22,[1]=>classname=>class2,extends=>class33,implements=>null) hint: can done through reflection class. can me?i need script.. thanks extract files parts of code class<something not }>{<something perhaps containing nested {}>} , eval of pieces of code. i guess have determine specific order in eval them (you might take note files include determine order, or take @ extends , implements ) then use ref

regex - PHP preg_match problem with IPv6 -

i'm matching ip addresses in php. check is: function checkip($ip){ $ip = trim($ip); if (preg_match("\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b", $ip)) return true; $v6pattern = "/ (\a([0-9a-f]{1,4}:){1,1}(:[0-9a-f]{1,4}){1,6}\z)| (\a([0-9a-f]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,5}\z)| (\a([0-9a-f]{1,4}:){1,3}(:[0-9a-f]{1,4}){1,4}\z)| (\a([0-9a-f]{1,4}:){1,4}(:[0-9a-f]{1,4}){1,3}\z)| (\a([0-9a-f]{1,4}:){1,5}(:[0-9a-f]{1,4}){1,2}\z)| (\a([0-9a-f]{1,4}:){1,6}(:[0-9a-f]{1,4}){1,1}\z)| (\a(([0-9a-f]{1,4}:){1,7}|:):\z)| (\a:(:[0-9a-f]{1,4}){1,7}\z)| (\a((([0-9a-f]{1,4}:){6})(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})\z)| (\a(([0-9a-f]{1,4}:){5}[0-9a-f]{1,4}:(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})\z)| (\a([0-9a-f]{1,4}:){5}:[0-9a-f]{1,4}:(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-

internet explorer - Javascript check/uncheck all function. IE doesn't update -

function checkuncheckall(theelement) { var theform = theelement.form, z = 0; while (theform[z].type == 'checkbox' && theform[z].name != 'checkall') { theform[z].checked = theelement.checked; z++; } } theelement checkall checkbox @ bottom of list of checkboxes. when clicked calls function set checkboxes in same form value of checkall. it works across browsers aside 1 glitch in ie. after clicking checkall box seems checkboxes updated, don't see it. if click anywhere on page checkboxes updated proper status. happens both checking , unchecking. this easy without jquery, unnecessary here. function checkuncheckall(theelement) { var formelements = theelement.form.elements; (var = 0, len = formelements.length, el; < len; ++i) { el = formelements[i]; if (el.type == "checkbox" && el != theelement) { el.checked = theelement.checked;

flex - Developing a paint application in Adobe flash builder -

can 1 provide me resource getting started graphics api in adobe flash builder? regards, abdul khaliq there «flex 4 fun» book chet haase graphics , animation on flex platform. simple chapter introduces sample application shapely show drawing basics in flex 4.

Accurate least-squares fit algorithm needed -

i've experimented 2 ways of implementing least-squares fit (lsf) algorithm shown here . the first code textbook approach, described wolfram's page on lsf. second code re-arranges equation minimize machine errors. both codes produce similar results data. compared these results matlab's p=polyfit(x,y,1) function, using correlation coefficients measure "goodness" of fit , compare each of 3 routines. observed while 3 methods produced results, @ least data, matlab's routine had best fit (the other 2 routines had similar results each other). matlab's p=polyfit(x,y,1) function uses vandermonde matrix, v (n x 2 matrix) , qr factorization solve least-squares problem. in matlab code, looks like: v = [x1,1; x2,1; x3,1; ... xn,1] % line pseudo-code [q,r] = qr(v,0); p = r\(q'*y); % performs same p = v\y i'm not mathematician, don't understand why more accurate. although difference slight, in case need obtain slope lsf , multiply large numb

etl - FileHelpers - string length issue? -

i'm moving data using rhino.etl one of tables i'm moving has column stores large chunk of text each row - though it's not huge , there 2000 rows. when running job get: a first chance exception of type 'filehelpers.filehelpersexception' occurred in filehelpers.dll now, removing large text column fixes issue - output though. is there restriction somewhere dictates limit on data size or something? debug output: monobin i'm developer of filehelpers, can post here stack trace , full message of exception ? for filehelpers there no limit string length, maybe column stores info binary data , rhino.etl send way best regards

Android software NDK native c code profiling on actual Android phones -

i developing rather large software on android log native code, it's working having performance issues. i hoping can profile each module(function call) of software cpu cycles, memory usage, etc, on several real android phones. there simple c library that? i see people using oprofile, seems overkill case since system wild profiler, , requires rebuild kernel , system image. as have full source code of app, need simple c library can embed in code profiling while app runs several test cases. btw, linux way of doing this? i've had pretty decent results android-ndk-profiler. http://code.google.com/p/android-ndk-profiler/ outputs /mnt/sdcard/gmon.out

c++ - OpenCV gets aways with assigning to a const reference? -

i stumbled upon piece of code in opencv source ( cxoperations.hpp , line 1134, in definition of vector class ): vector(const vector& d, const range& r) { if( r == range::all() ) r = range(0, d.size()); // more stuff... } note vector class has no data member called r (and indeed, identifier r occurs in 1 more place in entire class definition, parameter in method). apparently, right there assignment const reference. i tried reproduce minimal example: #include <iostream> class foo { public: int _a; foo(int a) : _a(a) {} }; int main() { foo x(0); const foo& y = x; printf("%d\n", y._a); y = foo(3); printf("%d\n", y._a); } this, of course, fails compile: g++ gives error test.cpp:15: error: passing `const foo' `this' argument of `foo& foo::operator=(const foo&)' discards qualifiers the way got work overriding operator= this: #include <iostream> class foo

Emacs regexp groups in regex-replace -

i have bunch of c macros in files, stuff next( pl ) expanded ( ( pl ) -> next ) i want remove of them because they're unnecessary. what do, text inside parentheses in macro, pl . want replacing regexp use text rewriting. example, in perl /next\(\s*(.+)\s*) (may little incorrect) , output $1->next , should turn line if ( next( pl ) != null ) { into if ( pl->next != null ) { in emacs, use match groups in emacs replace-regexp on file file basis. i'm not entirely sure how in emacs. m-x query-replace-regexp next(\([^)]+\)) ret \1->next ret which can done inside function (to apply entire buffer) (defun expand-next () "interactive" (goto-char (point-min)) (while (re-search-forward "\\<next(\\([^\)]+\\))" nil t) (replace-match "\\1->next"))) and, apply multiple files, can mark files in dired , type q query-replace-regexp on marked files (use regexp/replacement in first line of answer).

Python library for dealing with time associated data? -

i've got data (noaa-provided weather forecasts) i'm trying work with. there various data series (temperature, humidity, etc), each of contains series of data points, , indexes array of datetimes, on various time scales (some series hourly, others 3-hourly, daily). there sort of library dealing data this, , accessing in user-friendly way. ideal usage like: db = timedata() db.set_val('2010-12-01 12:00','temp',34) db.set_val('2010-12-01 15:00','temp',37) db.set_val('2010-12-01 12:00','wind',5) db.set_val('2010-12-01 13:00','wind',6) db.query('2010-12-01 13:00') # {'wind':6, 'temp':34} basically query return recent value of each series. looked @ scikits.timeseries, isn't amenable use case, due amount of pre-computation involved (it expects data in 1 shot, no random-access setting). if data sorted can use bisect module entry greatest time less or equal specified time.

vb.net - Child Form not refreshing when i try to start the app from MDI form? -

have mdi form , child forms in app. here situation... main form : mdi form register form : child of mdi form desig form : form open when click 1 button on register form. now if try refresh items of combo box of register form desig form, not refreshing. i.e. can't see new items in combo box on register form. now when try start app directly register form same code works same code not running when try start app mdi form. here codes. mdi form : dim regform new register statuslabel.text = "opening workman registration" regform.mdiparent = me regform.show() statuslabel.text = "workman registration" regform.concombo.focus() register form: public sub refreshcombo() desigcombo.items.clear() sitecombo.items.clear() adddescombo() ' method loads new data database desigcombo.text = designame ' string variable (designame) end sub desig form register.refreshcombo() ' run when click on 1 button. so thing

iCalendar (ics) versions and various calendar clients (Outlook, iCal, Lotus Notes) - what works and what doesn't? -

i'm working on web application allows users create calendar of events, download events calendar program of choice (e.g., outlook, lotus notes, ical, google calendar, etc.) the web app outputs event data attachment in icalendar (ics) format. i'm running variety of problems... if use "version:1.0", outlook 2003 recognize , import attachment. however, apple ical not. if it's "version:2.0", ical works, outlook 2003 not. if attachment has more 1 event (vevent), outlook 2003 imports first event, unless user uses outlook's import function. i don't have lotus notes, or multiple versions of outlook (2007, 2010), can't how behave easily. i don't mind having implement little dialog asks user calendar program use can customize output accordingly. however, don't know each of major programs supports or requires. has found resource lists, calendar program, works , doesn't? e.g., outlook 2007 or 2010 support "version:1.0&qu

objective c - Creating one static library for iOS and simulator for distribution -

if create static library ios have distribute header file(s) or there way work? currently have single my_lib.a file both device , simulator when drag test app use it, says can't find header , places i'm using in code undeclared. figure i'm either doing wrong, or have send appropriate header files it. background process: i've seen 2 guides creating static library both device , simulator. 1 on site: build fat static library (device + simulator) using xcode , sdk 4+ and 1 here: http://mark.aufflick.com/blog/2010/11/19/making-a-fat-static-library-for-ios-device-and-simulator i used second site try out. i'm bit curious if did correctly. went release-iphone(os|simulator) folders , found .a in ios 1 , .o in simulator one. the short answer yes, have package header files static library. have package header files library in fact, dynamic or static. library contains compiled code, still have tell compiler identifiers in library when it's compiling c

regex - Perl Pattern Matching Question -

i trying match patterns in perl , need help. i need delete string matches [xxxx] i.e. opening bracket-things inside it-first closing bracket occurs. so trying substitute space opening bracket, things inside, first closing bracket following code : if($_ =~ /[/) { print "in here!\n"; $_ =~ s/[(.*?)]/ /ig; } similarly need match i.e. angular bracket-things inside it-first closing angular bracket. i doing using following code : if($_ =~ /</) { print "in here!\n"; $_ =~ s/<(.*?)>/ /ig; } this how not seem work. sample data below : 'joanne' <!--her name not contain "kathleen"; see section "name"--> "'jo'" 'rowling', obe [http://news bbc co uk/1/hi/uk/793844 stm caine heads birthday honours list] bbc news 17 june 2000 retrieved 25 october 2000 , [http://content scholastic com/browse/contributor jsp?id=3578 jk rowling biography] scholastic com retri

grid - JQGrid Is it possible to change the value of cells in subgrid -

i have jqgrid , contains subgrid. when edit cell in jqgrid, want change value of cells in it's subgrid. how can do? refer discussion how inline edit jqgrid subgrids? . cell editing possible if create follow 'grid subgrid' pattern.

c# - Generating default values from property when domain object instainciated -

i have domain object called user , usercreateviewmodel.automapper used mapping viewmodel user. working fine. when mapping done see user domain object has values in userid, createdon , modifiedon respectively like 00000000-0000-0000-0000-000000000000 1/1/0001 12:00:00 1/1/0001 12:00:00 these default values when instainciate user object. cause problem user object can not create guid , dates properties get. note: don't want hardcode above default values. is there clean approach solve problem userid, createon , modifedon generated values properties? i understand problem usercreateviewmodel public class usercreateviewmodel { public string username { get; set; } public string password { get; set; } } user private guid? _guid; public guid? userid { { return (_guid.hasvalue) ? _guid.value : guid.newguid(); } set { _guid = value; } } public string username { get; set; } public string password { get; set; } private datet

Adding a div element in rails -

i having helper function as def link_to_user(text, user, options = {}) options[:class] = options.has_key?(:class) ? "#{options[:class]} user-link" : "" content_tag :span, :class => :vcard link_to(text, user, options) + content_tag(:span, :style => "display: none;", :class => "userbox") content_tag(:span, :class => "fn") content_tag(:span, :class => "given-name") user.firstname end + content_tag(:span, :class => "family-name") #user.lastname end end end end end now trying add div element sibling vcard span. tried getting errors syntax error, unexpected '+', expecting kend (syntaxerror) please give suggestions have tried: @content = content_tag :span, :class => :vcard link_to(text, user, options) + content_tag(:span, :style => "display: none;", :class => "userbox") content_tag(:span,

algorithm - Loops in C challenge: can it be done another way? -

hi c experts (please don't shoot, i'm no c programmer anymore time time have question pops in mind) i reading question ( how print entered string backwards in c using loop ). the "simplest" , logical answer for (x = end; x >= 0; --x) { printf("%c", word[x]); } but wondering if there wasn't way achieve same goal staying closer original loop poseted: for (x = word[end]; x >= word[0]; x--) { printf("%c", x); } i don't know enough c work out, couldn't play arrays pointers loop through char * wordp; for(wordp = &word[end]; /*something*/; wordp--){\ printf("%c", &wordp); } p.s.: don't care if forwards or backwards loop. p.p.s.: sorry if made obvious c mistakes in pointers; point them out in comment , i'll edit them. ;) jason absolutely. char *wordp; for(wordp = word + end; wordp >= word; wordp--){ printf("%c", *wordp); }

android - ListView with custom Adapter does not show all item seperator between different listItems -

i developed small application .it contain listview in dialog box . i tested application work fine emulator except in emulators specification qvga 240*320 , wqvga432 in item separator not shown in listview!. i added <uses-sdk android:minsdkversion="6" /> layout of item in listview <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:layout_height="60dip" android:id="@+id/themelabel" android:layout_width="wrap_content" android:layout_alignparentleft="true" android:paddingright="50dip" android:paddingleft="20dip" android:paddingtop="10dip" android:text="theme 7" android:textcolor="#fff" android:tex

Lua - Accessing files & controlling applications? -

how person use lua scripting language things such this: opening application such ie , controlling it, accessing c drive , current directory .lua file located modify, move, create , delete files. any links references appreciated, cannot find clear documentation anywhere. generally speaking, lua doesn't have kind of stuff built-in. lua minimalist programming language, great embedding. core language uses facilities available in c89. if want bells , whistles, need add lua libraries. you can find libraries searching wiki , @ luarocks , luadist , or luaforge for "controlling ie" should take @ luacom for accessing current directory, try luafilesystem

parsing - Building a regex with packrat parsers in Scala -

i have 2 packrat parsers in scala: val symbols : packratparser[string] = "{" | "}" | ">" val keywords : packratparser[string] = "bool" | "int" i want build parser can recognise if statement composed of 1 or more of 2 parsers. way i'd is: val statement : packratparser[string] = regex( "[symbols | keywords]+".r ) but wouldn't work because they're thinking want actual "symbols" or "keywords" token... can help? you can't use regex way. however, whole point of parser combinators can combined! val statement : packratparser[list[string]] = rep1(symbols | keywords)

php - How to add custom HTML Tag with Zend Form Description -

consider display checkbox, checkbox label , image there after. how can create view same using zend engine form i tried follows $this->addelement( 'checkbox', "$key", array( 'label'=>$value, 'checkedvalue' => "$key", 'uncheckedvalue' => '', 'checked' => true, 'disabled' => false, ) ); $element = $this->getelement($key); $element->setdecorators( array( 'viewhelper', array('label', array('tag' => 'dt', 'class'=>'hidden')), array('description',array('escape'=>false,'tag'=>' span')), //escape false because want html output ) ); $element->setdescription('<img name="help_'.$key.'"