Posts

Showing posts from August, 2014

java - JSF and f:ajax for hiding/showing div -

i thinking of making hidable/showable menu on web application. before this, used php , ajax extensively purpose. however, since html element id regenerated in jsf framework found out method no longer feasible @ least in scope. i have read f:ajax tag in jsf , tried implement it. apparently no luck me. looks easy still not find out did wrong. i have prepared prototype test f-ajax tag functionality no luck. here code ` <h:body> <h:outputlabel> <h:outputtext value="click a" /> <f:ajax event="click" render="texta"/> </h:outputlabel> <h:outputlabel> <h:outputtext value="click b" /> <f:ajax event="click" render="textb"/> </h:outputlabel> <h:outputlabel> <h:outputtext value="click c" /> <f:ajax event="click" render="textc"/> </h:outputlabel>

MATLAB: Function that computes the coefficients of the polynomial that is formed by multiplying 2 other polynomials -

i need come matlab function computes coefficients of polynomial formed multiplying 2 other polynomials. i know need somehow use conv(a,b) or need create function somehow. please! is homework? anyway, want use conv , , solves problem. problem beyond that?

c# - Youtube video upload/download along with captions/ transcript files -

i aware of youtube api .net , this question . the problem facing want upload youtube video captions or more importantly transcript file , if download them well. know how in c# (silverlight) ? developers guide: data api protocol – captions for c# bit, it's writing bit of http.

java - which tool should be used in order to measure performance of a program unit? -

i need measure performance of program unit. using hibernate orm tool. want tool capable enough measure time taken per method invoked , excluding database loads??? please help this profiler does. visualvm free one, if want mroe detail timings , behaviour of jdbc queries suggest @ yourkit can anlyse queries in more depth.

testing - Passing custom Python objects to nosetests -

i attempting re-organize our test libraries automation , nose seems promising. question is, best strategy passing python objects nose tests? our tests organized in testlib bunch of modules exercise different types of request operations. this: testlib \-testmoda \-testmodb \-testmodc in cases test modules (i.e. testmoda) nothing test_something(), test_something2() functions while in cases have testmodb class in testmob test_anotherthing1(), test_anotherthing2() functions. cool thing nose finds both. most of test functions request factory stuff can share single connection our server farm. lot of test_something1(cnn), testmodb.test_anotherthing2(cnn), etc. currently don't use nose, instead have hodge-podge of homegrown driver scripts hard-coded lists of tests execute. each of driver scripts creates own connection object. maintaining scripts , connection minutia painful. i'd take free advantage of nose's beautiful discovery functionality, passing in connec

Is duplicating data in SQL and Document store (like MongoDB) a legit idea or should be avoided? -

i have question. considering using data store type of objects (e.g. products data). criteria using document store if object has detail page, fast read of entire object necessary (example - product attributes, images, comments etc). criteria using sql displaying lists (e.g. n newest, popular etc). some objects meet both criteria. products example. normal practice store info used in rendering lists on index pages in sql database, , other data in document store? the main idea mongodb created denormalization , embedding. @ 1 of past projects i've done sql denormalization better performance, don't sql denormalization because many dublicated data( if have 1 many relation example). second step rewriting data access layer mongodb. , in mongodb difficult pages need load multiple documents i've created denormalized document(with embeded collections , plain data different documents) fit page content. no problem pages work fast, facebook ;). but here possible problem

ios - iPhone: Click view behind transparent UIScrollView -

i have uiscrollview set have clear background. part of scrollview have content, part not (so shows other views behind it). able click through uiscrollview , mkmapview behind, transparent portion of uiscrollview. i have found code having real hard time understanding how working: - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { if (![self yourmethodthatdeterminesinterestingtouches:touches withevent:event]) [self.nextresponder touchesbegan:touches withevent:event]; } could me wrap mind around how forward touch event view behind view? can call - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event uiviewcontroller? what did subclass uiscrollview , implement logic passes responsibility down views under it, if touch happens inside of transparent area. in our case transparent area defined contentoffset of 120 on y axis, meaning our content starts 120 points below start of uiscrollview, , code looks this: - (bool)pointinside:

oracle - in sql merge syntax how to pass userparameter -

i getting error:bind variable "a" not declared merge emp e1 using (select e2.empno,e2.sal emp2 e2 e2.empno=:a) on (e1.empno=e2.empno) when matched update set e1.sal=e2.sal when not matched insert values(e2.empno,e2.ename,e2.job,e2.mgr,e2.hiredate,e2.sal,e2.comm,e2.deptno); if you're in sql*plus (as suspect error message given), variable number exec :a := 5 before try run merge statement. on other hand, if you're running statement in pl/sql, there no need use colon, instead, place variable name instead: procedure do_the_merge(a in number) begin merge.... .... e2.empno = ....; end do_the_merge;

unix - Re-read the configuration 'snmpd.conf' file? HOW? -

well, year developed agent module net-snmp monitor disk usage/statistics. locally installed on system in lan. now, intend use same module home pc , trap on office.. isp not provide me 'static ip' , expensive own one. over last week-end found out 'no-ip.org' can me out setup virtual static ip using dynamic ip (just stole working-logic, simple) anyways, here did! wrote program check present running ip in system , update me through mail , inserts same snmpd.conf file. i not know how make 'snmpd' re-read configuration file without restarting snmpd service. after spending lot of time on google found can use ' kill -sighup <snmpd-pid> ' but ever me out in re-reading .conf file? sighup terminate process, speaking... how if ever wanted re-read .conf file without restarting snmpd daemon? from snmpd.conf man page: the net-snmp agent can instructed re-read various configuration files, either via snmpset assignment of integer(1) uc

iis - How to write a log on an ASP.NET website virtual directory? -

my website running asp.net user in iis. i've created 1 virtual directory, 'logs', internally pointing shared drive folder access limited number of users. how can create log file on virtual directory log4net? do (or can i) provide user credentials when create logger or file? it looks there's no problem writing log files virtual directory on website. tell log4net path relative current directory writing configuration <appender ...> <file value="logs\website.log" /> </appender> now, if want put current username in log message, you'll want investigate log4net contexts . stashing current user in log4net context log4net.threadcontext.properties["user"] = httpcontext.cache["current-user"]; and pulling out in appender layout <appender ...> <layout ...> <conversionpattern value="%date %-5level [%property{user}] %message%newline" /> </layout> </app

c# - Apply Transition with Silverlight Toolkit to Grid containing Canvas in Windows Phone 7 -

let me explain scenario i developing windows phone 7 , have page on there button. @ buttons click event have added code show canvas panel present on page canvas1.visibility = system.windows.visibility.visible; this enables pop canvas instantly, want canvas should visible turnstile transition effect provided in silverlight toolkit windows phone 7. how apply transition on canvas only. you need like: turnstiletransition turnstiletransition = new turnstiletransition { mode = turnstiletransitionmode.backwardin}; itransition transition = turnstiletransition.gettransition(canvas1); transition.completed += delegate { transition.stop(); }; transition.begin(); gettransition(uielement element) creates new itransition specified uielement. note:handling of completed event optional , depends on specified animation.

How do I make Emacs' other-window command ignore terminal windows? -

emacs okay job of being window manager. i've been splitting emacs frame this: +---------------------------+ | | | | | | | | b | | | | | | | | | | | |-------------| | | c | +---------------------------+ c terminal kind of long-running process, web server or daemon. i'll move point there restart daemon, of time i'd swap between a , b . how can make convenient? there's nothing built-in want. can use following code want (just customize regular expression match name of buffer(s) want avoid). note: my-other-window doesn't implement features other-window does, left exercise reader. my-other-window try switch window buffer doesn't match avoid-window-regexp . if there's no such window available, switches next one. (require 'cl) (defvar avoid-window-regexp "^

operating system - What is the difference between kernel stack and user stack? -

what need of using 2 different stacks in same program? how trap change current stack of program user stack kernel stack? how come user stack after completing system call? does every process have kernel , user stack? there 1 "kernel stack" per cpu. there 1 "user stack" each process, though each thread has own stack, including both user , kernel threads. how "trapping changes stack" simple. the cpu changes processes or "modes", result of interrupt. interrupt can occur many different reasons - fault occurs, (like error, or page-fault), or physical hardware interrupt (like device) - or timer interrupt (which occurs example when process has used of it's allotted cpu time"). either way - when interrupt called, cpu registers saved on stack - registers - including stack pointer itself. typically "scheduler" called. scheduler chooses process run - restoring of saved registers including stack pointer , , continues

How to turn a list of lists to a sparse matrix in R without using lapply? -

i have list of lists resulting bigsplit() operation (from package biganalytics, part of bigmemory packages). each list represents column in matrix, , each list item index value of 1 in binary matrix. what best way turn list sparse binary (0/1) matrix? using lapply() within lapply() solution? how keep factors naming lists names columns? you might consider using matrix package deals large sparse matrices in more efficient way base r. can build sparse matrix of 0s , 1s describing rows , columns should 1s. library(matrix) test <- list( col1=list(2,4,7), col2=list(3,2,6,8), col3=list(1,4,5,3,7) ) n.ids <- sapply(test,length) vals <- unlist(test) out <- sparsematrix(vals, rep(seq_along(n.ids), n.ids)) the result is > out 8 x 3 sparse matrix of class "ngcmatrix" [1,] . . | [2,] | | . [3,] . | | [4,] | . | [5,] . . | [6,] . | . [7,] | . | [8,] . | .

ios - Objective C:: How to check if the user already installed your app? -

i new ios (iphone , ipad) development. i developing app. in app, @ 1 point, need retrieve contact lists, , question is, after user's contact list, possible check each user have/have not installed app? if yes, how? if no, how viber works? they have database phone numbers. , guess send phonenumbers in contacts server , return use viber. i'm guessing, never installed app. from faq: you don't have register! know phone number, , friends, why bother yet username , password? viber uses phone number "identity" , lets make free viber phone calls of friends have viber - using phone number.

In Makefile assign path variable dependent if path exists II -

i helped in makefile assign path variable dependent if path exists , setting of var works fine if condition true. informixdir=$(shell test -d /opt/ibm/informix && echo /opt/ibm/informix ) so did both possible conditions in row informixdir=$(shell test -d /opt/ibm/informix && echo /opt/ibm/informix ) informixdir=$(shell test -d /usr/informix && echo /usr/informix ) but shell command returns kind of null if condition false it's unset again, won't work on system first condition true. sometimes informixdir set in shell environment, nice consider too. could changed $(shell test -d /opt/ibm/informix && echo /opt/ibm/informix || echo ) ? or use fallback value , check after: $(shell test -d /opt/ibm/informix && echo /opt/ibm/informix || echo notset )

c# - How to call a Web Page an automatically fill up a Form passing a String -

i use asp.net 4 c sharp. i populate input text form string sent user. the destination page is: http://www.maxmind.com/app/locate_demo_ip note: im not developer target page. here ho should work: when visitor site click link (ip address) sent to: http://www.maxmind.com/app/locate_demo_ip , textbox automatically populates value (ip address user has clicked). the user manually click button "look ip addresses" in maxmind.com have result. any idea how it? maybe sample of code? guys usual great support! :-) if can, generate link form : http://www.maxmind.com/app/locate_demo_ip?ip=xx.xx.xx.xx then, page can access value using txt1.text = page.request.querystring["ip"] [edit] assumes developer of target page... ? you tells me not developper. either maxmind provide url syntax similar 1 below (check if there api section, or have inject javascript value. in case, have know : for security reason, avoid cross site scripting attack, can'

learning web app development with asp.net -

i have been doing windows applications using c#. our management has planned make of projects web based. thought of using asp.net c#. can guide me on learning asp.net. pls provide useful links sample projects. thanks in advance. web forms quicker route if used desktop development (over microsoft mvc). mvc3 preference takes bit longer used if not familiar it. mvc3 gives more control on code , in oppinion less bloated. may worth looking mvc pattern if go down route. loads of videos started here: http://www.asp.net/web-forms they have couple of example applications can work through: web forms: contoso university app mvc: mvc3 starter app

Simple PHP Form Redirect -

i'm trying create simple redirect on form. form sends email when click submit, won't redirect url specified. here's php code: <?php if ($valid_message) { header("location: http://www.beulahprint.ie/energycentre.php"); exit(); } else {print "we encountered error sending mail"; } $to = "colm@beulahprint.ie"; $subject = "web contact form"; $email = $_request['email'] ; $message = $_request['message'] ; $headers = "from: $email"; $sent = mail($to, $subject, $message, $headers) ; ?> your code seems out of order. first, send mail. then, if successful, redirect. try redirect send mail. <?php $to = "colm@beulahprint.ie"; $subject = "web contact form"; $email = $_request['email'] ; $message = $_request['message'] ; $headers = "from: $email"; $sent = mail($to, $subject, $message, $headers) ;

iPad/iPhone uiSearchbar transparent background -

i know questions asked(and solved) before, wont work me. matter of fact, had solved, issue came out of , struck me on head. i not able set background of uisearchbar transparent. using: searchbar.backgroundcolor = [uicolor clearcolor]; [[searchbar.subviews objectatindex:0] removefromsuperview]; and worked nicely... stopped. since upgraded xcode-version not sure. spent couple of hours investigating this.. out there this? please point me in right direction. heaps!!! best regards t try looping through subviews , right class: for (uiview *subview in searchbar.subviews) { if ([subview iskindofclass:nsclassfromstring(@"uisearchbarbackground")]) { [subview removefromsuperview]; break; } } i'm not sure dont think can assume index 0 background view. example above works me.

javascript - use different XSL templates when opening a XML in a new window -

i have xml file rendered set xsl file (xslt 1.0). xsl file includes several other xsl files multiple templates in them. need include button in rendered xml open same xml in new window, using different templates in xsls. including button , opening new window not problem, how tell xsl use different templates because got opened in new window? idea use javascript opening new window, don't see how set or pass parameter check on xslt/xpath. in advance help! change xml or transform server side (with php,asp,jsp...) or client side (with javascript). can parameterize xsl processor, not xml file. if don't want use xsl processor, have recreate xml file on server side same body , different header stylesheet.

How can I correctly convert these to c#, marshall so I can pass these struct to DLL (c++)? -

c++ #define field_size_msgid 24 #define field_size_time 12 #define field_size_admin 256 typedef struct { char msgid[field_size_msgid+1]; char sendtime[field_size_time+1]; char receipttime[field_size_time+1]; } admindatam0; typedef struct { int type; union { admindatam0 m0; char data[field_size_admin + 1]; } addata; char unknown[field_size_admin + 1]; } admindata; c#: [dllimport("receiver.dll", callingconvention = callingconvention.cdecl, exactspelling = false, setlasterror = false, charset = charset.ansi, entrypoint = "sendmessage")] [return: marshalas(unmanagedtype.i4)] protected static extern int sendmessage( [marshalas(unmanagedtype.struct)] ref admindata ptradmindata, ); protected const int32 field_size_msgid = 24; protected const int32 field_size_time = 12; protected c

Jquery Accordion Menu Issue -

i have accordion menu working on page, when click 1 of links, doesn't go corresponding page. also, love have working when click link, menu closes, automatically drops out again when next page loads. it's prob better if tell code rather post here? html: <div class="basic" style="float:right;" id="list1b"> <a class="serviceheading">printing</a> <ul id="serviceslist"> <li><a href="stationery.php">>> stationery</a></li> <li><a href="flyers.php">>> flyers / leaflets</a></li> <li><a href="brochures.php">>> brochures</a></li> <li><a href="posters.php">>> posters</a></li> <li><a href="calendars.php">>> calendars</a></li> <li><a href="invites.php">>> in

why does Listview + Selector crash from xml file -

i have list view, want background change color when clicked (touched) user. each listitem fallows: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/row_item" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/row_background"> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <imageview android:id="@+id/rowimg" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight = "1" android:background="#ffffff"

java - Android - Custom dialog boxes layout problem -

i have custom dialog box displaying text , image underneath. the text made of few lines , despite messing around xml layout stuff millions of times, image @ bottom overlapping half/some of text. how can tweak appears underneath , after text has finished? <imageview android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" /> <scrollview android:id="@+id/scrollview01" android:layout_width="wrap_content" android:layout_below="@+id/image" android:layout_height="200px"> <textview android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="#fff" /> </scrollview>

dns - Get IP of domain with JavaScript -

possible duplicate: can lookup ip address of hostname javascript? can ip address of current page script running? can current document's domain using var domain = document.domain; . in php can ip address of domain using function gethostbyname($domain) ; there alternative function in js? is there alternative function in js? not know of. your best best using ajax connect php or other server-side script lookup you.

unit testing - Rhino Mocks: Minimal times to call seems not to work -

im using rhino-mocks 3.6 mocking framework in unit tests , have problem repeat.times() : i want verify method on mocked object called 3 times. according docs should use repeat.times(3) or repeat.times(3, 3) . but observe verifying at least 3 calls, when call method 4 times, test still passes. fails when calling method 2 times. here code. there wrong it? mockrepository mocks = new mockrepository(); ijobserviceevent mockedjse; using (mocks.record()) { mockedjse = mocks.dynamicmock<ijobserviceevent>(); expect.call(() => mockedjse.transactionlistchanged(null)) .repeat.times(3); } using (mocks.playback()) { mockedjse.transactionlistchanged(null); mockedjse.transactionlistchanged(null); mockedjse.transactionlistchanged(null); mockedjse.transactionlistchanged(null); } you need use strictmock. dynamicmock allow

c - segmentation fault on g_string_truncate ()? -

when trying following in c : g_string_printf(qbuf,"insert inbox (number, smsdate, text) values ('%s','%04d-%02d-%02d %02d:%02d:%02d', '%s')", xmx.remote.number, xmx.smsc_time.year, xmx.smsc_time.month, xmx.smsc_time.day, xmx.smsc_time.hour, xmx.smsc_time.minute, xmx.smsc_time.second, xmx.user_data[0].u.text); i see following crash: program received signal sigsegv, segmentation fault. 0x00984809 in g_string_truncate () /lib/libglib-2.0.so.0 (gdb) why happen? there initiation before calling g_string_printf() ? from frame 2: (gdb) frame 2 #2 0x08049ba8 in fetching_phone (unit=0x807cd80) @ main.c:152 152 g_string_printf(qbuf,"insert inbox (number, smsdate, text) values ('%s','%04d-%02d-%02d %02d:%02d:%02d', '%s')", (gdb) ptype xmx.remote.number type = char [40] (gdb) ptype xmx.smsc_time.year type = int (gdb) ptype xm

html5 - JQuery slideToggle problems -

sure there obvious answer 1 don't know it. dynamically loading page using jquery .load() on "loaded" page there form form elements e.g. input type="number" (html5). is there reason why if slidetoggle() form form elements revert input type="text" yet if toggle() - (just toggle() ) elements remain "true" likewise if add toggle('slow') form elements revert input type="text" ok. html code on "page1" looks this: <form method="post" id="frmcreate"> <ol></ol> <input type="submit" id="testit" /> </form> it loaded - yes doc ready() etc. $('ul#fieldtypes li a').click(function(){ var id_timestamp = new date().gettime(); var id = $('.inputlength').length; $( "#frmcreate ol" ).append('<li id='+id_timestamp+' class="inputlength"></li>'); $('#'+id_timestamp).load('

java - blackberry parameterised are only available if source level 1.5 -

when user vector object in blackberry app below vector<object> vector = new vector<object>(); i getting compiler error as blackberry parameterised available if source level 1.5 why error ? blackberry based on javame limited java 1.3 syntax. thus, since generics added in java 5 (1.5), out of luck, unfortunately.

php - Mutiple Magento Email Forms & Templates -

i need set mutiple email forms on magento website. i'm including forms onto cms pages. are: arrange site survey catalogue request and defualt contact form but can select 1 email template in admin (system > configuration > contacts). i've got email templates , included forms cms pages need them work. thanks! here blog post on how create controller in magento http://blog.baobaz.com/en/blog/magento-module-create-your-own-controller

c# - I don't wan't to use Thread.Sleep with SHDocVw.ShellWindows -

i have program have shdocvw.internetexplorer instance running ie8 process. instance example code below runs. reason won't work without thread.sleep. the browser.hwnd throws invalidcastexception instances in m_iefoundbrowsers if thread.sleep removed. when using thread.sleep works ie8 windows. does know how in way not using thread.sleep? (i don't use sleep function, pushes problems future...) example code: internetexplorer m_iebrowser = null; shellwindows m_iefoundbrowsers = new shellwindowsclass(); thread.sleep(10); foreach (internetexplorer browser in m_iefoundbrowsers) { try { if (browser.hwnd == (int)m_proc.mainwindowhandle) { m_iebrowser = browser; break; } } catch(invalidcastexception ice) { //do nothing. browser.hwnd not execute item. } } i came across following link seems hans's c

php - debug_print_backtrace doesn't work -

i have php 5.3.4 , when try use debug_print_backtrace, don't anything. when use vardump, empty array, can see below. index.php: <?php define('wp_use_themes', true); require('./wp-blog-header.php'); var_dump(debug_backtrace()); echo php_version; ?> which returns ... </html> array(0) { } 5.3.4 can tell me wrong? expecting see called in run. instead don't see anything. debug_backtrace() doesn't show has been called far current call stack (i.e. more or less php jump on return statement until reaches top level) when function invoked. might interested in profiler e.g. 1 implemented in xdebug plus analyse data e.g. kcachegrind .

java - Creating a file from a jFileChooser component -

i using jfilechooser part of export feature. user able either select file jfilechooser 's file viewer or enter name of file in filename text box. i've read it's possible value using getselectedfile() method, have listeners call getselectedfile() , attempt checks before executing export. the problem i'm encountering getselectedfile() method returning null when enter name filename text box manually. add more confusion, getselectedfile() method work in 3 different situations: i populate via setselectedfile() (a user has clicked value table , use setselectedfile() ) i click existing file in file viewer i hit enter after populating filename text box i have 3 file filters have had same behavior regardless of if enabled or not. listeners call getselectedfile() follows: event listener keyreleased event listener mousepressed. propertychangeevent listener on jfilechooser action listener on jfilechooser is there better way listen jfilechooser user

c++ - referencing a vector -

i have code void split(vector<float> &fvec, string str) { int place = 0; for(int i=0; i<str.length(); i++) { if(str.at(i) == ' ') { fvec.push_back(atoi(str.substr(place,i-place).c_str())); place=i+1; } } fvec.push_back(atoi(str.substr(place).c_str())); } what im trying pass reference vector method splits string give floats without copying vector... dont want copy vector because containing 1000's of numbers. is not possible pass vector reference or making stupid mistake? if helps heres code im testing out with int main (void) { vector<float> fvec; string str = "1 2 2 3.5 1.1"; split(&fvec, str); cout<<fvec[0]; return 0; } it indeed possible. you're using wrong syntax. correct way : split(fvec, str); what you're doing wrong because passes address of vector intended reference.

.net - Good Practices for Method Summary XML Comments -

i have been using method summary xml comments @ top of procedures lately , wondering if there logical or practices related this. i never put in remarks because put description of method in summary tag. what belongs in summary , belongs in remarks? i seldom put in returns tag because seems redundant explain being returned in summary. should keep type of object returned in returns tag? can advise on good, logical, or commonly used approach these xml comments beneficial other programmers on the team while not requiring same information being displayed multiple times? in opinion, correct <summary> tag use explain method meant do. if methods have good, useful names, expect developers use make assumptions how method should behave. example, assume calling "getname" has no side effects, , returns name of instance, regardless of comments say. with in mind, rather writing paragraphs method should doing, tend focus comments on "gotcha"s aware of, k

android - How to gathering 2 rows of list to be 1 row for call ContextMenu -

how gathering 2 rows of list 1 row call context menu does have demo? thanks in advance. it sounds need listview complex layout each list view item. lots of options. create layout file 2 row layout want. then, either use simpleadapter , or use arrayadapter , override [getview][3] function fill in details. if search on of terms, should find plenty of tutorials. [3]: http://developer.android.com/reference/android/widget/arrayadapter.html#getview(int , android.view.view, android.view.viewgroup)

c# - Copying Xth sheet from N Excel workbooks into a new workbook-which language to use? -

i understand can use vba i've found way sheet name not location (5th sheet in workbook) or wildcard of name (sheet named results-*) i'd rather user didn't have install excel on machine in order run this. i'd appreciate suggestions language/libraries in easiest accomplish, following list: java c# groovy ruby for java getsheet(int) method in jexcelapi this.

ajax - How to persist asp.net textbox in a cookie within asp.net updatepanel? -

i have asp.net 3.5 update panel , have few textboxes users enter information want persist when return next time. i've tried various approaches persisting cookie click event of button (postback trigger) etc. believe problem there no response header access during ajax callback? not sure! how can persist values of textbox cookie exist within content of asp.net update panel? thank you. i ended creating serializable class persist.

php - Override Buddypress function to change SQL conditions -

i’d add condtions bp_forum_topics() loop contain posts keywords. can me this? i’d create custom plugin overrides current function bp_forum_topics() this. im new wordpress development unsure filters , tags. right returns topics (with exception of loose search terms, newest, popular etc). want able return topics if posts related topics contains specific search terms. i can manage coding this, i'm unsure overriding bp_forums_get_post functions while still retaining other functions used in buddypress, such get_avatar. any great. mark update: here sql select post.post_id, post.topic_id, topic.topic_title, post.post_text bb_posts post left join bb_topics topic on topic.topic_id = post.topic_id topic_title '%searchterms%' or post_text '%searchterms%'; glad see you've found solution. should put sql answer. select post.post_id, post.topic_id, topic.topic_title, post.post_text bb_posts post left join bb_topics topic on topic.

c# - Page lifecycle stops after command from ListView -

i have listview in web form (c#/.net 4.0). there imagebutton in itemtemplate. after postback, itemcommand event fires... , everythings stops. no other page events occur. (actually there 1 other thing: dispose() extendercontrolbase runs right after event code finishes - site has ajaxcontroltoolkit controls, though there none on particular page). there lot of things involved here it's not practical post code, generally, there cause this? i rebinding listview on each postback, because i'm handling paging on server side. when assign data source listview, it's going have no rows. @ time command event fires, datasource has no data in it, since hasn't yet been loaded database , rebound. can't think why cause entire page stop loading, though. the template this: <itemtemplate> <tr> <td class="datalistrow"><asp:imagebutton id="edit" runat="server" imageurl="~/images/nav/datagrid_edit.gif" comm

c# - SQLDatasource parameters -

how can set sql parameters sqldatasource in code behind? trying this: int id=1; sqldatasource1.selectcommand = "select * categ id=@id"; sqldatasourcearticole.selectparameters.add("@id", id); // , this: sqldatasourcearticole.selectparameters.add("id", id); but doesn't work? doing wrong? make sure add select parameters before trying set default value. i.e. sqldatasourcearticole.selectparameters.add("@id", id); sqldatasourcearticole.selectparameters["id"].defaultvalue = id.tostring();

c# - scroll/move the page to the top after page postback from button click? -

i have button validates username(have username textbox @ bottom of page) on server side, , if username doesnot exist in database return , give error @ top of page throgh label. inside button click need write code if username doesnot exists scroll page top. how can this? thanks after post-back, page typically scrolls top. if not, has done in javascript. can use ilya posted: http://www.electrictoolbox.com/jquery-scroll-top/ .

c# - .net mail classes vs SQL sp_send_dbmail -

we have applications need send out email notifications time time. have been using .net mail classes running problem of virus checkers blocking port 25. me correct solution set correct exclusion rules allow our app keep working. however, afraid may become huge hassle in future, new organizations come on line, , prefer use sql dbmail instead. don't particularly choice, rather have application handle aspect i'm not sure if it's worth fight. there real advantages of using .net mail on sql mail? you should ask following question do really want use database server send out email? it depends on how many emails you'll sending , how busy sql server is. if you'll not sending many emails , you've got pretty quiet sql server; go right ahead. if (like of us) you're not lucky, elsewhere.

.net - Get newly created member's ProviderUserKey -

i've got line works perfectly: // membershipcreatestatus var createstatus = membershipservice.createuser(model.email, model.password); now want provideruserkey of member created. easiest way this? i absolutely love this: membershipuser member; // create new user , return status , member (if created). var createstatus = membershipservice.createuser(model.email, model.password, out member); but i'll settle getting provideruserkey . can use provider specific api instead? if so, should able this. typically provider apis return new membershipuser instance, , have status out parameter createuser() method. the membership.createuser() api returns membershipuser instance, see http://msdn.microsoft.com/en-us/library/d8t4h2es.aspx . can provideruserkey such: membershipuser newuser = membershipservice.createuser(email, password, etc.); newuser.provideruserkey

Why is my Django modelformset always invalid when i use a custom model manager? -

after stripping down code minimum, still not work. alway hint: (hidden field id) select valid choice. choice not 1 of available choices. this forms looks like: class changeitemform(forms.modelform): def __init__(self, *args, **kwargs): super(changeitemform, self).__init__(*args, **kwargs) key in self.fields: self.fields[key].required = false class meta: model = item fields = ('name','tags','no') changeitemformset=modelformset_factory(item,extra=0,form=changeitemform) and view looks this: def manage_view(request): if request.method=='post': itemforms=changeitemformset(request.post, queryset=item.objects.filter(creator=request.user)) else: itemforms=changeitemformset(queryset=item.objects.filter(creator=request.user)) messages.info(request,str(itemforms.is_valid())) #always prints false context=requestcontext(request)

performance - Starting a debugging session in Silverlight takes a very long time -

in sl4 lob app, i’ve hit f5 1000x or more no problems. suddenly, hitting f5 can take 90 seconds before app’s startup event raised. i’ve tried clearing ie browsers cache, no there. i created new navigation app no code whatsoever, hit f5, started immediately, great. began adding same assembly references sl4 lob app newly created navigation app. after each reference added, hit f5 ensure app able startup immediately; far good. alas, came system.windows.controls.data.toolkit.dll caused same behavior original sl4 lob app. removed reference navigation app, , again, start immediately. it’s 33kb, can’t argue i’m having problems symbol cache. has else seen strange behavior? insight appreciated. the small size of app not matter how debugging sessions starts up. slowdown caused large number of dependencies in application. you did remove single reference improved things tremendously , chances single dll dependent on dozens of other libraries. if check process tool process

cross platform - Library that would work on Mac, PC and that can also be ported on mobile devices -

i'm going building library processing , generating syncml messages (syncml = xml protocol syncing contacts , calendars), , i'd able port , use library on many devices possible (mac, pc, iphone, android, blackberry, windows phone 7), because logic going same, , don't want spend time on re-building native library each platform. my question is: technologies , programming languages should getting done? java, c , c++ spring mind, , colleague has suggested lua. i'd so's opinion on before start working on it. my background c#/.net, objective-c, , java. any information welcome. thank you! why reinvent wheel? java has runtime environment mac, pc, linux, android, blackberry, , windows mobile. unfortunately popular option, iphone, has propriatary coding platform , can't run java. java has done hard work in writing cross-platform runtime environment. careful version of java platform use though, mobile devices may not support newest se yet. with ob

relative path - Open file from a different folder in PHP -

let's have 2 folders in php server root directory: "x" , "y". but, in "x" directory there 2 more directories: "a" , "b"! in "/x/a" directory have "index.php" file , in "/y" folder have "stuff.php" file. "/x/a/index.php" file, want include "/y/stuff.php" file! how do that? server doesn't allow including files other domains, adding full url doesn't work! also, i'd know how start path root in php. use "./blabla" index of root , "../blabla" directories in root, but, unfortunately, ".../blabla" doesn't work 2nd grade directories. to access root begin path "/". if want go 1 directory currently, e.g. /x/a/ /x/ use "../". if want go 2 directories (e.g. /x/a/ /) use "../../" (rather ".../" mentioned).

ruby on rails - Query MongoDB with length criteria -

i have several documents in mongodb collection, field 'name' (which string). how can perform queries 7 <= name.length <= 14 you can use javascript expression . user.where("this.name.length >= 7 && this.name.length <= 14")

xna - How can I perform clipping on rotated rectangles? -

so have panel class. it's little window can resize, close, add buttons, sliders, etc. status screen in morrowind if of remember. behavior want when sprite outside of panel's bounds doesn't drawn , if it's partially outside part inside gets drawn. right first rectangle represents bounds of panel, , rectangle sprite, finds rectangle of intersection between 2 translates intersection local coordinates of sprite rectangle , uses that source rectangle. works , clever feel code can't shake feeling there's better way this. also, set cannot utilize global transformation matrix 2d camera, in "world" must passed camera argument draw. anyway, here's code have: intersection: public static rectangle? intersection(rectangle rectangle1, rectangle rectangle2) { if (rectangle1.intersects(rectangle2)) { if (rectangle1.contains(rectangle2)) { return rectangle2; } el

c# - Prevent Exception from crashing process

assume have application, user can provide script written in javascript perform task in it. done using jint. however, badly written script can cause stack overflow exception in jintengine.run() , therefore crashing whole application. rather inform user error in script. i tried run jint on application domain, did not help, cause afaik default action on soe exiting process. changed other way using clr hosting? i know can run separate process , that's fallback, nevertheless not that. as suspected, it's not possible catch stackoverflowexception generated runtime unless you're hosting clr [1]. microsoft documentation suggests, best bet try , detect stack overflow before happens. in case of using jint, means finding way hook execution engine , attach own code arbitrary method calls. fortunately, brief overview of documentation reveals have debugging mode that! [2] no doubt running in debugging mode means slowing down script execution; it's decide if benef

java - How do I programmically resize and change possition of a window -

how resize (and change possition) of window of other application programically? code java, , want resize windows, not created jvm. i'm using windows xp. change other properties of windows if there more options. additional information after comments: q: why want that? a: windows lacks feature move window across multiple displays fast . have tried winsplit revolution 9.02? has great features move/position window few button presses. don't need grab mouse @ all. the way windows not own in pure java java.awt.robot class. not offer useful api goal, screenshot, analize results, , position, press, move , release mouse accordingly - thus, same human user do. if want more, have system-specific. think both windows api , x protocol (ant x client libraries) offer @ least ability informations other program windows, don't know changing them. (i suppose mac os has such capabilities, too.) this mean writing @ least basics of functionality in c (or other language acces

sockets - Is there an 'optimal' buffer size when using send()? -

let's you're transferring file of arbitrary length in chunks on tcp/ip: looping... read(buffer, length) send(mysocket, buffer, length, flags) my question is, optimal value of length? or not matter @ all? i've seen 256 bytes 8192 bytes being used. depends mean optimal. optimal usage of bandwidth, want maximize packet size send @ least network packet size (which on ethernet 1500 bytes). if reading disk 4096 or 8192 bytes value.

AES decryption in iOS: PKCS5 padding and CBC -

i implementing ios decryption code message originating on server on have no control. previous implementation on platform documents decryption requirements aes256, specifies key , initialization vector, , says: * cipher mode: cbc * padding: pkcs5padding the options creation of cccryptor object include kccoptionpkcs7padding , kccoptionecbmode, noting cbc default. what understand padding encryption, don't understand how 1 might use both; thought mutually exclusive. in creating cccryptor decryption, have tried using both 0 options , kccoptionpkcs7padding, both give me gibberish after decryption. i have compared dump of decryption dump of decoded byte buffer on other platform , confirmed different. there doing different in implementation different, don't know what... , don't have clue how handle on it. platforms different enough difficult infer previous implementation because based on different platform. , of course, author of previous implementation has since

How to combine new changes with previous commit in git -

i made commit , have additional changes if committed give me 2 commits & b. what efficient way combine new changes ones previous commit end 1 commit? git add -u && git commit --amend this stage local changes , use them rewrite previous commit. note if you've pushed previous commit bad idea.

iphone - SDK Verision dont match -

hi iphone device has 4.2.1 version, xcode saying 4.2 version. issue because cant debug app on device. developer folder has iphoneentitlements401 folder, shouldnt 4.2 instead of 401? i getting cannot read entitlements data error. please help! sdk support: you need set ios deployment target lowest sdk want support. need set yours @ least 4.2. go to project -> edit project settings -> scroll down to deployment , then find ios deployment target for entitlements: your entitlements file, if exists, may corrupt, remove if have it, add new one: right-click on project, click add , new file , under ios click on code signing , choose entitlements .

javascript - How do i do a onclick who reload 3 different divs -

how can reload 3 javascript datecodes every time press image? i don't want whole paga refresh divs, can done? we need more information. http://api.jquery.com/jquery.ajax/ - i'm guessing starting point.

c# - WCF Service: Publicly available services useful for testing -

i need public wcf service test against. basic methods call. service should use. (sidenote: how search publicly available services?) im trying out : sudz code generator , don't want have setup publicly available service test it try http://www.xmethods.net/ve2/index.po

javascript - How to use a var that has been set in one html file in another html file? -

i have html page sets value onclick using js function. need use value in html page. unable it. seems reset value when use value second page. .js file has been included in both html pages. how retain set value across multiple html pages? within javascript itself, cannot keep track of variables across page loads. pass variable 1 page another, need use 'man in middle' out. either cookie, or query string. a cookie work great! won't go specifics of setting/getting cookies in javascript there excellent documentation here: http://www.w3schools.com/js/js_cookies.asp using set , methods (which of course customise suit needs): first page: var yourvariabletosave = 'i cheese , crackers'; var numdays = 10; //how long cookie should last. setcookie('somecookiename', yourvariabletosave, numdays); second page: var yourvariable = getcookie('somecookiename'); alert(yourvariable); //displays 'i cheese , crackers' if want cookie l

wpf - Help me put event trigger for controls of type Expander! -

hello im trying this allrooms = remote.getallrooms(); (int = 0; < allrooms.count; a++) { expander ex = new expander(); ex.expanded += expander1_expanded; ex.width = 254; ex.name = ("expander" + a); ex.verticalalignment = system.windows.verticalalignment.stretch; ex.horizontalalignment = system.windows.horizontalalignment.stretch; ex.header = allrooms[a].nome; wrappanel panel = new wrappanel(); panel.opacity = 1; panel.width = 254; (int b = 0; b < allusers.count; b++) { system.windows.controls.label lbl = new system.windows.controls.label(); lbl.content = allusers[b].nick; lbl.width = 127; panel.children.add(lbl); } ex.content = panel; canvas.settop(ex, (30 * a)); canvasleft.children.add(ex); } mytim

zip - Distributing Contents for Linux like in Android & iOS? -

i'm designing linux-based system. users of system allowed download contents, i.e. programs, internet. contents distributed in zip packages given special extension names, e.g. .cpk instead of .zip, , 0 compression. i want give users same experience found in ios , android, in contents distributed in contained packages , run there. my question can make linux system run programs inside packages without unzipping them? if not, there approach i'm after in linux? please note don't want extract contents temp folder , delete them after execution because might take longtime, specially large contents. double storage space requirements running contents. thank in advance. klik (at least in klik2 cmg format ) used ziso image, can mounted kernel or fuse client, rather zip. use other filesystem types supported kernel or via fuse. maybe fuse-zip worth shot? you modify loader read directly out of bundle. example, android's dalvik vm can load dex files directl

upgrade - How do I update to newer versions of cocos2d? -

i have project using version .99.4 , i'd update version .99.5. have create new project template , re-add files etc, or there easier way this? it better create new project , add files in again.. there libraries update , default has new files.. gameconfig , rootviewcontroller.. app delegate has changes based on new files..

sql server 2005 - SQL check for NULLs in WHERE clause (ternary operator?) -

what sql equivalent c# statement be? bool isinpast = (x != null ? x < datetime.now() : true) i need construct where clause checks x < now() if x not null . x datetime needs null sometimes, , not null other times, , want where clause consider non-null values, , consider null values true. right clause is: dbo.assignments.[end] < { fn now() } which works non-null cases, null values seem make expression evaluate false. tried: dbo.assignments.[end] not null , dbo.assignments.[end] < { fn now() } and seems have no effect. for use in clause, have test separately where dbo.assignments.[end] null or dbo.assignments.[end] < getdate() or can turn nulls date (that true) where isnull(dbo.assignments.[end],0) < getdate() or can negative test against bit flag derived below where case when dbo.assignments.[end] < getdate() 0 else 1 end = 1 below explanation , how derive isinpast select clause. bool isinpast = (x != null ? x < da

Android AccountManager and SyncManager implementation caused only Name field to appear in Add/Edit Contact screen -

we implemented android's account manager , sync manager api create contact sync. when user selects our account while adding contact, displays name fields , other fields disappear. here have in manifest <activity android:name=".authenticatoractivity" android:label="ianywhere login" android:theme="@android:style/theme.dialog" android:excludefromrecents="true"></activity> <service android:name=".accounts.authenticationservice"> <intent-filter> <action android:name="android.accounts.accountauthenticator"></action> </intent-filter> <meta-data android:name="android.accounts.accountauthenticator" android:resource="@xml/authenticator"> </meta-data> </service> <service android:name=".accounts.syncs