Posts

Showing posts from April, 2011

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - J2ME Native Mp3 Player - to play mp3 files larger than 1.5 MB -

i trying play 5mb mp3 file using following code in j2me devices. inputstream myinputstream = getclass().getresourceasstream("/test.mp3"); player myplayer = manager.createplayer(myinputstream, "audio/mpeg"); myinputstream.close(); // closing inputstream after creating player object. myplayer.realize(); myplayer.prefetch(); myplayer.start(); this code works mp3 file below 1.5 mb not working larger files.does 1 how native mp3 players in devices playing mp3 files. the low end j2me devices or low memory devices can play maximum of 1.5 mb of size songs thru programming.

linux - how do I get a list of amplitudes from a audio file? -

how list of amplitudes audio file using linux command line tool ? do mean getting individual samples text? sox can that. $ sox file.wav file.dat will take audio file file.wav , , generate text file file.dat column timebase in seconds, , column each audio channel scaled maximum possible value.

html5 - How can I store the image in websql(SQLite)? -

i want store images in websql(sqllite).so please provide procedure store images in websql. sqlite has data type called blob common in many dbmses. you can serialize image byte[] ans save column other data types. here same questoin how store , retrieve blob sqlite asked , answered.

perl - Why doesn't the recursive function call not change the execution flow? -

sub dir_list1 { $path=$_[0]; while(<$path/*>){ if (-f "$_"){ print "$path/$_\n"; } else { print "dir: $path/$_\n";# if ($entry ne "." && $entry ne ".."); dir_list1($_); } } } dir_list1("."); when execute above code, first prints contents of current directory , goes on list contents of subdirectory. should not go sub-dir once encounters sub-dir, list files inside , resume parent folder? thanks. [edit, in response orangedog] i'm using code on windows. output this: a.txt b.txt dir: ./images c.txt d.txt ... [and images folder listed] ./images/qwe.jpg ./images/asd.jpg ./images/zxc.jpg ... you've got bunch of problems here. here's version works: use strict; use warnings; sub dir_list1 { $path = $_[0]; (<$path/*>) { if (-f $_) { print "$_\n"; }

What is the best way to have custom css styles to theme a layout? -

let's have massive css file used style layout of application. now, want let users change colours of layout personalize it. best way customization, in terms of design , architecture? i'm looking solution pretty easy implement , isn't intrusive. i don't want make whole css file templated on server if don't have to. i'd keep in /css file if it's possible, without server dependencies. ideally, i'd override styles in default, don't think that's possible erase existing styles. means i'll have duplicate style information overwrite them... bad. duplication = bad. i guess can assume there's server object related account has several properties various colours, backgrounds, menu tabs, link colours, hovered versions, etc. public class theme { private string headerbackground = "#172636"; private string displayname = "#ffffff"; private string tabbackground = "#284767"; private string tabtext =

embedding - Is there other web browser implementations other then webkit,mozila? -

im looking embed web browser in application , (static linking none lgpl/gpl). there other web browsers allow static linking without gpl/lgpl license restrictions? need cross platform. gecko, rendering engine used mozilla firefox, embeddable under mpl, not gpl/lgpl. mpl can combined proprietary code. see faq entry: what license terms embedding gecko also, technical standpoint, this article should contain need know embedding gecko.

html - What is &nbsp; and does it affect perfomance of a webpage? -

while code in visual studio, have lot of &nbsp; i know non-breaking space, question whether absence or presence can better web page performance? why , needed?? it character entity non-break space. it means space not collapsed when viewed in browser (as whitespace normalized , ignored in html). the proper use of ensure words not wrap (if want them appear on same line). example open&nbsp;university - not wrap. it doesn't effect performance, apart added characters transmitted. in earlier times, before css used, &nbsp; s used in conjunction tables layout. these days, should use css layout.

how to rename all file name which contain specific word to another word in a folder using bat or shell script -

how write batch script or shell script rename files in folder ie ..replace name arun_xyz arun_abc present in file names (replace xyz abc) and how replace word xyz present inside files word abc shell: to rename files: for fname in *_xyz; newname=`echo "$fname" | sed 's/_xyz/_abc/g'` echo "$fname" "$newname" done after testing replace echo $fname... mv $fname... . to rename tiles , replace files content: for fname in *_xyz; newname=`echo "$fname" | sed 's/_xyz/_abc/g'` sed 's/xyz/abc/g' "$fname" >"$newname" done

How to sync offline HTML5 webdatabase with centralised database -

i'd able following in html5 (ipad) web app: upload data online database (which <50mb in size if build online database in sqlite) extract either subset or full copy of data offline webdatabase (travel out of 3g network coverage range) perform bunch of analytic-type calculations on downloaded data save parameters calculations offline webdatabase repeat, saving different parameter sets several different offline analytic-type calculation sessions on extended period (head areas 3g network coverage) sync saved parameters offline webdatabase central, online database i'm comfortable every step till last one... i'm trying find information on whether it's possible sync offline webdatabase central database, can't find covering topic. possible this? if so, please supply link/s information on it, or describe how work in enough detail implement specific app? thanks in advance i haven't worked html5 local databases, have worked mobile devices

c - use of generic list -

struct node { void *data; struct node *link; }; given such structure call generic linked list.what use of such list in terms of real time application use. you have service accepts requests multiple applications , provides handle each of them. service can maintain contexts per request in linked list , when done serving them delete node list. empty linked list in case mean no application has registered service. for eg, consider service built on sip stack , multiple applications im , presence information can register service uses sip stack signalling. service maintains data pertaining each of application in linked list(well again question of design lets assume have limit serve 5 applications). sip response has redirected application sending request , hold callback pointer 1 value of node simple call once find corresponding node response. each node saves lot of information every application , uses sending response application. probably may want have @

Pass data to User Control ASP.NET MVC -

i have user control shows list of latest announcements. user control used in 90% of pages. concern how pass data user control latest announcements. my first approach make base controller , in initialise method pass data user control via viewbag/viewdata. other controllers derive base controller. looks nice concern may become overkill simple solution existing out there. need make sure no controller ever fiddles viewdata/viewbag data meant usercontrol. please let me know if correct way of proceeding ahead or there exists better solution. thanks assuming have "user control" (you should try refer them partial view's in mvc) looks this: <%@ control language="c#" inherits="system.web.mvc.viewusercontrol<ienumerable<announcement>>" %> this means partial view expects list of announcement objects. now, question - where rendering partial view ? you doing master page, doing view, or doing partial view. either way, c

C# MongoDB driver trouble( NORM) -

i have used norm driver in production. new year holidays - pretty cool, project high loading , want set replication set, have problem - norm not support replication set :( . far understand sharding too? help me :) did use mongodb csharp or official 10gen driver replset? there problem on production? if choose driver i'll have rewrite repository, not want in vain. there issues? sharding should not depend on driver-specific support. when shard, connect router application mongos , router behaves mongod. so should able shard. need change "connection string". suggested setup have 1 mongos per application server (instead of current single mongod ).

css - jqueryui remove styling applied to buttons in modal form -

im complete beginner jquery , need please. im using jqueryui, im using modal form: http://jqueryui.com/demos/dialog/#modal-form ive got working fine, want regular looking hyperlink can invoke dialog. use appears "create new user" example above. how can remove styling, , make regular unstyled hyperlink invoke dialog the button's classes follows: .ui-state-default, .ui-widget-content .ui-state-default you can find these in css , change styles fit design :) or can override them putting them further down teh cascade (nearer bottom of teh css file) , override default css styles.

php - How can an array value be SIX chars long and echoing nothing (string(6) " ")? -

this weird. on screen right : $albumgenre : array(6) { [0]=> string(5) "noise" [1]=> string(6) " " [2]=> string(5) "blues" [3]=> string(5) "blues" [4]=> string(5) "blues" [5]=> string(5) "blues" } this output of : var_dump($albumgenre); can see says [1]=> string( 6 ) " " ??? how can array value 6 chars long, seen " " ? i know value is. it's "unknown" mp3 tag. fine, it's unknow, want rid of then. can't test it, if php can't reliably tell me hell array value him, see ? i guess question : how can know what's inside array ? is'nt var_dump($array) correct way know everything $array ? because value html entities &nbsp , like var_dump('&nbsp;'); make sure view source, , copy output var_dump ...

jquery slider with variable width elements -

is possible create jquery slider in elements have variable width (i.e. not elements have same width) ? if so, how do ? hannit to set width of jquery slider wrap in div , style using css. can reference child elements through css style well, has done using jquery after have been rendered. example: <script type="text/javascript"> $(document).ready(function(){ //render sliders $(".oslider").slider({ value: 12, min: 8, max: 24, step: 1 }); //size each handle according class $(".narrow-handle .ui-slider-handle").css("width","10px"); $(".wide-handle .ui-slider-handle").css("width","50px"); }); </script> <style type="text/css"> /* define width sliders styling wrapping div */ .oslidercontainer { width:100px; } .oslidercontainer2 { width:200px; } </style> <div class="osl

ant - In rake how do I call a subdir Rakefile -

in ant i'd following <target name="subclient" > <ant antfile="suddir/build.xml" target="target1" usenativebasedir="true"/> </target> how do sort of thing in jruby/rake you can use dir.chdir , launch rake subprocess: def rake(*args) ruby "-s", "rake", *args end task :subrake dir.chdir("subproject") rake end end

flash - Flex performance hit? -

i looked @ demo: http://bubblemark.com/ flex seems slow compared silverlight 3. unfortunately can't see pure flash should flex forbidden if performance top requirements compared flash ? gosh... if make app that, why incur penalty of flex layer? me, flex not right development stack app... flash might be. i'd curious see how works directly using flash api without overhead of flex controls , libraries? i guess point is: flex applications not animations that. flex application development stack. silverlight too, matter. performance overhead flex incurs applications might build small enough isn't noticed user. that being said, depends on type of app developing. pretty uis on data services, huge percentage of flex apps, flex best imo. in other words, wouldn't develop angry birds in flex. wasn't built type of app. but, when flex @ something, @ it. productivity gain worth me when compared performance hit negligible flex apps build. just record

How to deploy database on unit testing -

i have run integration unit tests (not database test). project in visual studio 2010. i have database project setup. how can deploy database before running integration or unit tests? how can deploy database when building solution in tfs 2010? please help we're using visual studio 2010 application , database development. have tried having database project within application solution , having independent solutions. ended keeping them separated. deploy database our development environments directly visual studio using "deploy solution" option. database project properties has "create deployment script (.sql) , deploy database" option on deploy tab. deploy database ever environment configured. it's manual step. when database project part of solution application project(s) gets deployed part of rest of project. the real work in getting continuous integration working time either project has check-in built, tested , deployed ci enviro

iphone - change view's property from method of other class -

i'm trying remotely adjust object myimageview 's alpha to 0 of myviewcontroller class class assistant (it's nsobject subclass). in assistant.h #import <foundation/foundation.h> @class myviewcontroller; @interface assistant : nsobject { myviewcontroller *myviewcontroller; uiimageview *button; } - (void)adjustalpha:(id)sender; @property (nonatomic, retain) uiimageview *button; in assistant.m #import "myviewcontroller.h" @implementation assistant @synthesize button; - (id)init { self = [super init]; if (self) { myviewcontroller = [[myviewcontroller alloc] init]; nslog(@"alloced?: %@", myviewcontroller ? @"yes" : @"no"); } return self; } - (void)adjustalpha:(id)sender { nslog(@"method called"); myviewcontroller.myimageview.alpha = 0; } the method did called, myviewcontroller.myimageview.alpha didn't change, why? need fix? thank reading ^_^ edit this myvi

garbage collection - Seperate GC log file for each Java VM on a Oracle Application Server -

we have oracle 10.1.3.4 running 1 application on multiple jvms. have set garbage collection logging using -xloggc parameter. however, gc logging of both jvms sent same log file. we'd logging in different log files. got idea how this? do have control on jvm arguments of each jvm? guess -xloggc have set getting applied both vm's hence situation. have admin console can view each vm of cluster? if yes, can change jvm properties each vm log gc activity separate file.

namespaces - C++ class declaration and include issues in gsoap project -

i compile file in gsoap project following command. files in project generated gsoap tools , new c++ cant tell it. all in need understand if project compile @ all. need other flags? gcc -c -i/usr/include/gsoap soapauftraegeimportsoap11bindingproxy.cpp the current error is: soapauftraegeimportsoap11bindingproxy.cpp:10: error: 'auftraegeimportsoap11bindingproxy' has not been declared this line 10 is: auftraegeimportsoap11bindingproxy::auftraegeimportsoap11bindingproxy() the file starts include: #include "soapauftraegeimportsoap11bindingproxy.h" but in header file there no declaration of class. , else. see further errors: soapauftraegeimportsoap11bindingproxy.cpp:10: error: 'auftraegeimportsoap11bindingproxy' has not been declared soapauftraegeimportsoap11bindingproxy.cpp:10: error: iso c++ forbids declaration of 'auftraegeimportsoap11bindingproxy' no type soapauftraegeimportsoap11bindingproxy.cpp: in function 'int auftraegei

objective c - Class instances differ, which one to use? -

i'm stuck following. in program, i'm trying communicate between different classes (view controllers nib files attached in tabbar application etc). want call method 'omfg' in class called 'productviewdetailcontroller'. class uiviewcontroller (splitviewdelegate). it's loaded programmatically. anyways, i've been trying right call controller, , came 2 solutions. 1 declaring productviewdetailcontroller in caller's .h file , .m file, making iboutlet, linking in interface builder , calling directly line [productdetailcontroller omfg]; when call method, calls right method in productviewdetailcontroller, instance of viewcontroller differs 1 programmatically can reach code: for (uiviewcontroller *controller in self.tabbarcontroller.viewcontrollers) { nslog(@"%@", [controller class]); if ([controller iskindofclass:[uisplitviewcontroller class]]) { uisplitviewcontroller *cell = (uisplitviewcontroller *)controller;

java - Help with using FFT to determine frequency of an audio sample -

i'm developing percussion tutorial program. program requires can determine drum being played, going analyse frequency of drum recording , see if frequency within given range. i have been using apache math commons implementation fft far (http://commons.apache.org/math/) question is, once preform fft, how use array of results calculate frequencies contained in signal? note: have tried experimenting using autocorrelation, didn't seem work sample drum kit any or alternative suggestions of how determine drum being hit appreciated edit: since writing i've found great online lesson on implementing fft in java time/ frequency transformations spectrum analysis in java in area of music information retrieval, people use related metric known mel-frequency cepstral coefficients (mfccs). for n-sample segment of signal, take fft. resulting n samples transformed set of mfccs containing, say, 12 elements (i.e., coefficients). 12-element vector used classify instrumen

JAVAME: Sort Java Vector -

what best , efficient way sort java vector in javame. my object has 5 properties, , sort property called price of type double . in vector have maximum of 150 items. sample code appreciated. thanx time. use collections.sort(list<t> vector, comparator<t> c) method. if there no such method in java me, copy java se. uses merge sort algorithm, not copy.

Recommendation for design and implement a very large scale data storage system with mysql? -

when mean large, large (at least me) collections of mysql. we hit every system upper limit here, size of table, number of rows, 32bit auto-increment, master server concurrent insert , update limit. it talking more 1k records updates pre-second, uncountable read transactions, sharding, lots of slave, ..etc, etc. i newly join team , yet have no access right monitor production system check bottleneck. system growth large , fast , cannot emulate in sandbox. back question, can have recommendation, resources, articles, , etc work system in scale. wish can prepare before hit wall. congratz on joining fun project. envy you! make use of team members knowledge , experiences. chances have worked hard are. you can find lots of articles on topic on @ http://highscalability.com (just don't swallow without thinking yourself) i don't think should expected prepared kind of work (unless lied experience). systems behave differently load increases , run different boundari

ruby - Proper Mutex usage / Good coding style? -

within following code, producer periodically_fill_page_queue might add page queue being consumed (read: in consumer before status being_processed set). class example def initialize @threads = threadgroup.new @page_queue = queue.new thread.abort_on_exception = true end def start periodically_fill_page_queue periodically_process_page_queue end def periodically_fill_page_queue @threads.add(thread.new loop if @page_queue.empty? page.with_state(:waiting).each |p| p.queued! @page_queue << f end end sleep 2 end end) end def periodically_process_page_queue loop until file = @page_queue.pop sleep 2 end page.being_processed process(page) end end def process(page) sleep 120 page.processed end end class page < activerecord::base state_machine :state, :initial => :waiting event :queue

php - GET Requests vs JavaScript -

alright, have javascript doing http requests php file onto same directory. it's returning it's output. let's there on 50+ people doing request simultaneously ... slow down anything? yes, may seem dumb question - sorry. :| thank you. it depends on backend code. i have php file scrabble type game, checks if word valid. database lookup, , responds true or false. sounds request doing similar. way doing 1 of efficient ways, because checking results, rather doing full page reload. the result less 20ms usually, , under load not particularly increase much. code doing little. in principle though, doing fine.

python - Where to place the call to a external API that has a dependency on a Model? -

suppose have django app named "blog". there's model called post , have external api call returns list of popular posts in given time, e.g., google analytics api. my question is: expected place should place code makes call external api, parses id each post, query database , sort list of models accordingly? i don't think should live in manager or in templatetag . tips or suggestions? thanks in advance! edit: desired result might need in several places across project, if place code in view, i'll have duplication. it should done in view, or better, if view code getting cluttered, put in helper module. import util def view(request): util.process_post_rankings(request.user.id) # ... write additional logic , render template however, cautious relying on external apis render page user. things might go wrong, take awful lot of time, api might not respond etc... better asynchronously javascript, , update page when data ready.

google analytics - Grouping visits by a number ID -

Image
i want group visits id number because every id represents different client (think of subdomain or that), example: http://site.com/234/home http://site.com/234/search/something are url's client 234 , while... http://site.com/155/home http://site.com/155/search/something are url's client 155 . i'm total noob on this, thx! well 1 way permanent way that doesn't require change tracking code in markup advanced segments . advantages of technique in case: you can create each segment , given them descriptive names (e.g., client id); unlike, instance, using advanced filter, advanced segments active (as create them) , don't permanently alter data. advanced segments simple configure. post ga team excellent step-by-step guide, or can follow these 2 consecutive screen shots below: step 1: click advanced segments in upper right-hand corner dashboard view click create new advanced segment when see view below: there number of ways configure a

Is it possible to wrap a C# singleton in an interface? -

i have class in have static members , constants, i'd replace singleton wrapped in interface. but how can this, bearing in mind every singleton implementation i've seen has static instance method, breaking interface rules? a solution consider (rather hand-rolling own) leverage ioc container e.g. unity . ioc containers commonly support registering instance against interface. provides singleton behaviour clients resolving against interface receive single instance. //register instance @ starting point in application container.registerinstance<iactivesessionservice>(new activesessionservice()); //this single instance can resolved clients directly, //will automatically resolved dependency when resolve other types. iactivesessionservice session = container.resolve<iactivesessionservice>(); you added advantage can vary implementation of singleton registered against interface. can useful production, perhaps more testing. true singletons can q

android - Hello World “Conversion to Dalvik format failed” -

i've installed following development environment on 10.6.5: eclipse sdk 3.6.1 android sdk tools r8 android sdk platform-tools r1 android sdk 2.2 android sdt 8.0.1 then when create hello world error: conversion dalvik format failed error 1 i have tried everything, since error has appeared in past many reasons, still have same problem. thanks in advance try found here . this grey area far whether or not duplicate question. if follow link provided @unhillbilly see there many questions covering same topic, varying subtleties , variances. there 40 other questions covering same subject, point unhillbilly making community works best when duplicate , similar questions reduced or eleminated, makes easier newbies find answers need keep pulling our hair out in frustration. not, not find exactly looking for, find plenty going in right direction out having ask. happy coding!

iphone - How can I specify where I want my UI elements to go on orientation change in Interface Builder? -

ok know bit of newbie question, being newbie ok! have view trying make orientation friendly in ib, , having difficulties. i have looking nice in portrait of course, when go landscape mode (by hitting arrow in top-right corner) gets messed up. now, because of way view laid out, need align 3 buttons along bottom of image view in portrait, , in landscape, 3 buttons need symmetrically aligned along right side. no combination of fiddling red arrows in size inspector rewarding me results seeking. possible set buttons 1 way in 1 orientation in ib, , on change, set them different? i have looked around useful ib tutorial, haven't been able find anything. i know want in ib, if you're willing try programmatically, can move things around pretty easily. buttons, implement setcenter method this: [mybutton setcenter:cgpointmake(xcenter,ycenter)]; otherwise, if want use ib, use autosizing options. arrows stretch or compress width , height, , bars (|-|) preserve distanc

Java String quote delimiter -

is there way in java use special delimiter @ start , end of string avoid having backslash of quotes within string? i.e. not have this: string s = "quote marks \" best, here few more \" \" \"" no, there no such option. sorry.

Ruby libs for Twitter User/Site streams? -

are there ruby libs handle twitter user / site streams? the twitter-stream gem can that. http://rubygems.org/gems/twitter-stream

Ajax TabContainer Master Page Load Issue -

while using ajax tabcontainer control master page, i'm running issue tab having activetabindex value set gets loaded content page, pages on other tab not loaded. there property or event needs used in order load other tabs uses other content pages ? please advise! you able load 1 content page @ time asp.net. the point of master page to create common design carry through of pages. when content page loaded, master page rendered content pages content inside of complete page. it works template applied content pages, not single page in content resides.

apache - random numbers after a ? on an image is this for far expires headers? -

i pooking around random site on internet , noticed on images have numbers prefixing it: icons-16.png?1292032550 i've heard of people optimising websites far expires headers. if changes content doesn't change often, cache won't refreshed. ergo new image won't re-downloaded someones cache. because filename has change. yes, intent force refresh of browser cache. however, i not recommend approach : many proxies (and possibly browsers) not cache anything query string, regardless of cache-control headers. you're shooting in foot if include superfluous query string – you'll needlessly consume own bandwidth sending images should cached, aren't. depending on how configure server, user agents periodically make request cached resources, if-modified-since and/or if-none-match header. if client's cache date, server responds 304 not modified , stops; otherwise responds normal 200 ok , sends new content. not have change resource's file

sql server 2008 - SQL Native Client 10.0 Login Failed -

i'm setting classic asp site in iis 7.5 (windows server 2008 r2). set site , application pool run specific domain account. added domain account sql server 2008 instance running on same server. i'm getting following error: [microsoft][sql server native client 10.0][sql server]login failed user 'domain\account'. here connection string: driver={sql server native client 10.0};server=server;trusted_connection=yes;database=db i have exact same setup on site on same server. other site works flawlessly. thoughts? user error. editing wrong file.

ruby on rails - Devise, flash message when require_no_authentication + redirect -

could tell me whats best practice include flash messages f.e. "you must logged out view requested site" , when require_no_authentication-filter set , user accesses site, becomes filtered. flash message should appear in every controller call before filter, not in device controllers (so inheritance isn't enough)... per default there no flash-messages, absurd, point of view. this behaviour changed device maintainers. able same way other hooks become called.

Is there a Web Server plugin for Eclipse? -

just title says, there plugins integrate web server eclipse quicker/easier web development? i'm looking php development can done without installing xampp or other server software separately. ideally, it'd work visual studio - hit "run", web server instance started , script(s) run, allow step through code without going north pole first (ok, 1 trip north pole set acceptable). am dreaming or have been looking in wrong places? yes, absolutely exists! it's called eclipse web tools platform (wtp short), , it's powerful. furthermore, bundled inside eclipse php developer tools (pdt) distribution, want using.

javascript - Shadowbox overlay not transparent in IE 6 -

when trying use shadowbox ie6 overlay transparency not works, remains black. in other ie versions (7, 8 , 9) overlay works fine. guys have idea why happening? if wanna check out i'm talking about, can test examples on project's web site, not work in ie 6. might notice buttons not displayed, .png images transparent background, can fixed creating .gif images , setting them ie6. links: main page: http://www.shadowbox-js.com/index.html thanks, i advice give up, because people still use ie6 seeing weird, ugly, cracked web time , dont care. may spend days struggling weird ways of overcoming problem comes simple fact ie6 not made transparency @ all. gifs wont work you. wanna know why? because opacity of gifs either 100% or 0%. in shadowbox want middle opacity, 50% or 70%. pngs might work pngalpha js scripts, tend fail in animations, used shadowbox. please understand i'm not flaming here, i'm trying honest you.

jQuery slider with ajax content loading -

i'm not js expert creating script scratch difficult me want use plugin. there many slider plugins of them use pre-created elements , want pagination slide effect. do know plugin functionality? you'll want @ jquery ui - tabs , slider component. want sounds should combine 2 of examples - slider controlled tabs , content via ajax . combining 2 should simple in terms of writing javascript, although might need rewrite large amount of css create desired pagination effect, , @ jquery ui tab's ajax mode options .

javascript - Modular GWT design concerns -

i have couple of questions regarding modular gwt based application framework. have ideas them being new field of web development feel far ideal. i'd appreciate few comments , suggestions in regard. here questions: i developing framework allow third parties embed gwt applications our website , communication them using simple iframe postmessage. these third party modules going use our sdk gwt based. problem arises though modules using same codebase there going massive overheard in amount of duplicate javascript code (i.e. our common sdk code base quite large) being downloaded on client's machine. highly redundant , problematic, not due sheer size of duplicate code but, due fact subsequent updates of sdk require modules recompiled going create dll hell kind of scenario in long run. best way of doing kind of thing? there way can have static gwt code (i.e. sdk) , dynamic gwt module refers (even if lies on different domain) , work happily? the other part of problem lies in pr

jquery - IE 8 .png Problem -

ok have searched , found several issues on reason can't find solution problem have background color set , page background set css (had change image paths typeimage because of filter #page-background { position: absolute; background-image: url('images/page_g.jpg'); background-repeat: repeat-x; top: 0; width: 100%; height: 900px; z-index: -1; } and body background body { background:url(images/page_t.jpg) repeat #805b38; font-size: 84%; font-family: arial, helvetica, sans-serif; color: #000; margin: 0; padding: 0; line-height: 1.5em; } my slideshow php code <?php if ($mission) : ?><div id="slideshow-bottom"> <div id="mission"><?php print $mission; ?></div></div><?php endif; ?> <div class="slideshow"> <img src="<?php print $base_path . $directory; ?>/images/slideshows/life.png" width="950" height="355" alt="slideshow 1"/>

Ruby vs. PHP/plugins social networking -

i in process of building site contain features comparable social networking sites use. built signup forms, login forms, , forms add information database in php/mysql. people use these types of projects? can suggest plugins or methods me out? place find these sort of things? worth learn ruby this? ruby make easier? how can use jquery in project such this? how should create chat rooms / forums / profiles? thanks! i think if planning on more 10 pages, should more necesary start thinking framework. said many times, i'm symfony enthusiast , i've been working quite time work. based on php (you wont need learn other language) , implements mvc object pattern. it handles routing, forms, database abstracions , else. has plugin project tons of code. check main project page more details

javascript - how to stop recursion and/or restart the current function with updated variables -

i've got 2 arrays updating , each other based on criteria (it way longer describe suspect solution is). what end function calls within while loop. can imagine, causes ridiculous amount of recursion. here's example (keeping short) var buildarray=firstfunction(new array(), existingarray) function firstfunction(thisarray, existingarray){ for(test1=0; test1<existingarray.length; test1++){ if(existingarray[test1][3]=='2'){ secondfunction(thisarray, existingarray, test1); } } function secondfunction(thisarray, existingarray, t1){ for(test2=0; test2<thisarray.length; test2++){ if(thisarray[test1]<=existingarray[test2][1] || thisarray[test1]>existingarray[test2[0]){ // bunch of stuff existingarray, existingarray has changed, whole process needs start again beginning!!! return firstfunction(new array(), existingarray); // check value isn't in 'thisarray'

javascript - Oracle APEX shuttle item validation -

using oracle apex 3.0.1 i have 2 shuttle items named p1_shuttle , p1_shuttle_2. i need means of checking/validating shuttle when user selects item left right, 1 item ever allowed in right shuttle. what can check if shuttle has got item , disallow further items added when user attempts so? i think you're going wrong way. the whole purpose of using shuttle item, opposed simple item select list or list of values, user can choose more 1 item. if allowed choose 1 item, don't use shuttle.

c# - Google Docs API: List contents at root folder include folders and documents which are shared to me -

i use google docs api. i found url "http://docs.google.com/feeds/default/private/full/folder%3aroot/contents/" list contents @ root. not list documents come person has shared me. expected output: list contents @ root folder include folders , documents shared me https://docs.google.com/feeds/default/private/full " give files , folders in "my drive" , in "my shared docs" this give my-shared-docs files , folders: https://docs.google.com/feeds/default/private/full/-/-mine?showfolders=true " this give drive files , folders:

sql - I need advice about files and categories in asp.net -

i working on project files upload , storage. 1 of tasks able select in category want upload documents, example: "work", "private", etc. now, have folders each user, , each user has 1 folder documents. thinking create sql table , have categories there, idea how reference them. if else have better idea, appreciated. thanks you can have table define categories. need table store metadata , path of uploaded documents. when user uploads document he/she select category in upload , can store path of document, category, size, type, user id etc. in second table. way easier query statistics number of files in each category, total size of files per user or per category.

jquery - No data when attempting to get JSONP data from cross domain PHP script -

i trying pull latitude , longitude values server on different domain using singe id string. not familiar jquery, seems easiest way go getting around same origin problem. unable use iframes , cannot install php on server running javascript, forcing hand on this. my queries appear going through properly, not getting results back. hoping here might have idea help, seeing wouldn't recognize obvious errors here. my javascript function is: var surl = "http://...omitted.../pull.php"; var idnum = 5a; //in practice defined above alert("before"); $.ajax({ url: surl, data: {id: idnum}, datatype: "jsonp", jsonp : "callback", jsonp: "jsonpcallback", success: function (rdata) { alert(rdata.lat + ", " + rdata.lon); } }); alert("between"); function jsonpcallback(rtndata) { alert("called"); alert(rtndata.lat + ", " + rtndata.lon); } alert("aft

c# - Adobe Reader process fails when starting second instance -

in our c# winforms application, generate pdf files , launch adobe reader (or whatever default system .pdf handler is) via process class. since our pdf files can large (approx 200k), handle exited event clean temp file afterwards. the system works required when file opened , closed again. however, when second file opened (before closing adobe reader) second process exits (since reader using it's mdi powers) , in our exited handler our file.delete call should fail because it's locked joined adobe process. however, in reader instead get: there error opening document. file cannot found. the unusual thing if put debugger breakpoint before file deletion , allow attempt (and fail) deletion, system behaves expected! i'm positive file exists , positive handles/file streams file closed before starting process. we launching following code: // open file viewing/printing (if default program supports it) var pdfprocess = new process(); pdfprocess.startinfo.filenam

xml - XSLT2.0 processor for Perl? -

is there robust xslt2.0 processor perl? tried out xml::libxslt , doesn't support analyze-string, regex, etc. i'm afraid of using xml::saxon::xslt2 work cause uses java , wouldn't want add list of dependencies. library guys use xsl2.0 transformations? cheers, so you're looking xslt 2.0 processor written in perl? no, not want pure-perl xslt processor. result excruciatingly slow , memory intensive, not mention want library that's been thoroughly tested in field larger user base comparatively few people xslt in perl. that's why libxslt popular, since it's fast , solid c library minimal perl wrapper around it. , unless you're using gui debugger komodo breakpoints , variable inspection, debugging isn't more complicated. but answer question: only compliant xslt 2.0 processor available today saxon, available featured commercial java library , stripped-down open source version – both incidentally made same guy wrote xslt 2.0 spec (i w

math - Calculus? Need help solving for a time-dependent variable given some other variables -

Image
long story short, i'm making platform game. i'm not old enough have taken calculus yet, know not of derivatives or integrals, know of them. desired behavior character automagically jump when there block either side of him above 1 he's standing on; instance, stairs. way player can hold left / right climb stairs, instead of having spam jump key too. the issue way i've implemented jumping; i've decided go mario-style, , allow player hold 'jump' longer jump higher. so, have 'jump' variable added player's y velocity. jump variable increases set value when 'jump' key pressed, , decreases once 'jump' key released, decreases less long hold 'jump' key down, providing continuous acceleration long hold 'jump.' makes nice, flowing jump, rather visually jarring, abrupt acceleration. so, in order account variable stair height, want able calculate value 'jump' variable should in order jump height of stair; prefera

bind_result into an array PHP mysqli prepared statement -

wondering how bind results of php prepared statement array , how go calling them. example query $q = $dbh->prepare("select * users username = ?"); $q->bind_param("s", $user); $q->execute(); and return results username, email, , id. wondering if bind in array, , store in variable call throughout page? php 5.3 introduced mysqli_stmt::get_result , returns resultset object. can call mysqli_result::fetch_array() or mysqli_result::fetch_assoc() . it's available native mysql driver, though.

CruiseControl.Net - inclusion of html report? (I get 'Unable to find file') -

i have build produces (ncover 3.4 summary) html report. i'd configure dashboard show html report. the report produced in working folder during build - problem referencing report dashboard. should store working folder 'cc.net build records'? don't understand inner workings there... my use of plugin in dashboard.config shown below. don't know should use actionname , have left value documentation. the link in cc.net resolves as: http://dummyservername/ccnet/server/local/project/dummyproject/build/log20101221100723lbuild.2.0.0.176.xml/viewreport.aspx thanks comments, anders, denmark <htmlreportplugin description="ncover summary" actionname="viewreport" htmlfilename="coverage_summary.html" /> from ccnet documentation [1] : this plug-in can display file in build folder under artefacts folder project. cannot display files other location (for security reasons). files can published build folder u

convert array_chunk from php to java -

my php code is: $splitarray = array_chunk($thearray,ceil(count($thearray) / 2),true); php's array_chunk function splits array chunks of size specify. can in java, using arrays.copyofrange , passing in start , end points. here sample code: /** * chunks array size large chunks. * last chunk may contain less size elements. * @param <t> * @param arr array work on * @param size size of each chunk * @return list of arrays */ public static <t> list<t[]> chunk(t[] arr, int size) { if (size <= 0) throw new illegalargumentexception("size must > 0 : " + size); list<t[]> result = new arraylist<t[]>(); int = 0; int = size >= arr.length ? arr.length : size; while (from < arr.length) { t[] subarray = arrays.copyofrange(arr, from, to); = to; += size; if (to > arr.length) { = arr.length; } result.add(subarray); } ret

security - WCF low level communication hacking -

i've read how wcf can send reliable messages , wanted check something. if wcf service set use reliable messaging , client requested data service. if client had been hacked keep saying data not received wcf service keep resending data indefinitely? used affect stability of server , risk? are there security measures should put in place if wcf service public? i suppose it's not worse clients clicking refresh on webpage. there else should considered? there maxretrycount property: this value, defaults 8 (minimum 1, maximum 20), specifies how many times infrastructure shall retry resend message in case of transmission failure. once message has been unsuccessfully resent configured number of retries, failure considered unrecoverable , causes channel fault.

iphone - AVAssetTrack totalSampleDataLength is 0 -

i'm programming iphone app uses avassetreader read samples avassettrack , need allocate memory depends on number of samples in avassettrack , reason totalsampledatalength returning 0. any ideas? < warning - guess! > perhaps it's avasynchronouskeyvalueloading protocol - have ask load value key before it's populated?

php - Replacing a sequence in a string with its match index -

in php, if replacing "a" in string "a b b b c", how replace index of match (i.e. "1 b 2 b 3 b c")? $str = 'a b ba a'; $count = 1; while(($letter_pos = strpos($str, 'a')) !== false) { $str = substr_replace($str, $count++, $letter_pos, 1); }

iphone - Can't programmatically hide UIButton created with IB -

my ios uibutton correctly linked ib iboutlet in view controller, can change title code. ie: [self.mybutton settitle:@"new title" forstate:uicontrolstatenormal]; //works however, [self.mybutton sethidden:yes]; //doesn't work //or self.mybutton.hidden = yes; //doesn't work what's going on? how can make mybutton disappear? update: additional info here's code related in uibutton: in .h file iboutlet uibutton *mybutton; -(ibaction)pushedmybutton:(id)sender; @property (nonatomic,retain) uibutton *mybutton; in .m file @synthesize mybutton; - (void)pushedmybutton:(id)sender{ self.mybutton.hidden = yes; } - (void)dealloc{ [self.mybutton release]; } ok found workaround works still don't know why original code wasn't working in first place. used grand central dispatch dispatch block containing hide call on main queue, this: dispatch_async(dispatch_get_main_queue(), ^{ self.mybutton.hidden = yes; //works }); interes

asp.net - Can an Iframe load its contents at the server side rather than client side? -

i know setting runat="server" , specifying id iframe control, makes accessible on server side need iframe source contents loaded @ server side not client side. is possible? why need way? currently iframe source site configured ntlm authentication , sso means read windows credentials whereas i'd need reads credentials provided site hosts iframe. thanks no cannot done. not way things work. if need load content on server side, can use webrequest class. doubt that want. think need rethink application design.

asp.net mvc - Domain object validation vs view model validation -

i using asp.net mvc 3 , using fluentvalidation validate view models. little concerned might not on correct track. far know, model validation should done on domain object. mvc might have multiple view models similar needs validation. happens if property domain object occurs in more 1 view model? validating same property twice, , might not in sync. if have user domain object validation on object. happens if have useraviewmodel , userbviewmodel, multiple validations needs done. in news class have property called title, required field. on view model have title property, use automapper map news , newsviewmodel. validation happening twice. when domain model validation occur , when view model validation occur? the scenario above example, please don't critise on it. it's subtle distinction validation on view model validate correct user input , forms anti-corruption layer domain model, whereas "validation" on domain model enforces business rules. norma

javascript - IE8 Render Issue -

why doesn't document render in ie8 ?? http://arabiannights.thestagingurl.com/ on ~line 55, if change last line of this: <!--[if ie 7]> <style type="text/css"> .sf-contener {position: absolute; left: 0;} #right_column #cart_block .block_content {position: relative; padding-top: 38px; top: -15px} </style> <! [endif] --> to this: <![endif]--> somehow malformed ie conditional close comment stopping rest of page being parsed.

asp.net - Using C#, how can I read the content of dynamic created textboxes? -

hy, i have created dynamic textboxes standard content. does know how can read content of these textboxes (assuming user modified standard content) when press 1 button? thanks lot. jeff update this how creating textboxes: foreach (string name in listofnames) { textbox tb = new textbox(); tb.text = name; tb.borderstyle = borderstyle.none; tb.borderwidth = 0; tb.font.name = "arial"; tb.font.size = 8; } the specific vary depending on technology using. concept remain similar, though asp.net little more interesting. winforms/wpf/silverlight maintain list of dynamically created textboxes , when button pressed can run through list of textboxes , read text property user input. asp.net - after tag update seems section appropriate requirement. for asp.net need create textboxes in override of oninit method, should happen on each postback. in button.click event can read user input textboxes created in oninit function. need ensure con

eclipse - Whats the difference between Command Parameters and Menu Contribution Parameters -

i can see parameters can defined commands defined using commands extension point. can not define value these command parameters. i can define parameters under command element in menus extension point when defining menu contributions. can define value parameter here. are command parameters in command different parameters in menu contributions? if different how different? the plugin org.eclipse.ui.command, let declare parameters commands. when add parameter command, have set , id, type , list of possible values parameter implementing iparametervalues. after that, can add command menu item parameters , values. for example, imagine have command id org.rcp.commands.new. , it's defined parameter name "type" , posible values (file, project , folder). you'll able add 3 menu item commandid = "org.rcp.commands.new" each parameter sample of plugin.xml

database partitioning - SQL complex view for virtually showing data -

i have table following table. ---------------------------------- hour location stock ---------------------------------- 6 2000 20 9 2000 24 ---------------------------------- so shows stock against of hours in there change in quantity. requirement create view on table virtually show data (if stock not htere particular hour). data should shown ---------------------------------- hour location stock ---------------------------------- 6 2000 20 7 2000 20 -- same hour 6 stock 8 2000 20 -- same hour 6 stock 9 2000 24 ---------------------------------- that means if data not there particular hour should show last hour's stock having stock. , have table available hours 1-23 in column. i have tried partition on method given below. think missing thing around requirement done. select hour_number, case when total_stock null sum(total_

c# - OnResize vs OnSizeChanged -

what difference between these 2 events? can't think of case both wouldn't called @ same time, , msdn less enlightening. answer bob powell [mvp] found on internet (discussion goes further) : internally, onsizechanged calls onresize pretty tightly linked. the onresize method responsible invalidating control if resizeredraw style set.

ruby - Need help in SQL and Sequel involving inner join and where/filter -

need transfer sql sequel: sql: select table_t.curr_id table_t inner join table_c on table_c.curr_id = table_t.curr_id inner join table_b on table_b.bic = table_t.bic table_c.alpha_id = 'xxx' , table_b.name='foo'; i'm stuck in sequel, don't know how filter, far this: cid= table_t.select(:curr_id). join(:table_c, :curr_id=>:curr_id). join(:table_b, :bic=>:bic). filter( ????? ) answer better idiom above appreciated well.tnx. update: have modify little make works cid = db[:table_t].select(:table_t__curr_id). join(:table_c, :curr_id=>:curr_id). join(:table_b, :bic=>:table_t__bic). #add table_t or else error: column table_c.bic not exist filter(:table_c__alpha_id => 'xxx', :table_b__name => 'foo') without filter, cid = db[:table_t].select(:table_t__curr_id). join(:table_c, :curr_id=>:curr_id, :alpha_id=>'

Hibernate foreign key relation - list() makes unnecessary sql queries - setMaxResults ignored -

first of all, first time use hibernate questions might seem naive. i have 2 tables, dsjobs , dsevents. events has foreign key relationship on dsjobs table (eid column in dsjobs table corresponds id column of dsevents table). i have creted mapping anotations, care unilateral relation, have 'dsevents' property in dsjobs table annotated @manytoone: @entity @table(name="dsjobs") public class dsjobs implements java.io.serializable { ... private dsevents dsevents; ... @id @column(name="jid", unique=true, nullable=false) public long getjid() { return this.jid; } public void setjid(long jid) { this.jid = jid; } @manytoone @joincolumn(name="eid") public dsevents getdsevents() { return this.dsevents; } public void setdsevents(dsevents dsevents) { this.dsevents = dsevents; } .... } i want retrieve list of jobs records databse , restricte them setfirstresul

jquery to create advanced search query builder -

i newbie javascript programming, found javascript (mootools) based query constructor useful implement in website working on. the live implementation can found here http://opl.bibliocommons.com/search i believe same functionality possible achieve using jquery. looking @ pointers on how start! e.g mootools integrated js file instantiates new class , binds events various form elements. how should replaced if using jquery? appreciate ideas. balu you can duplicate class functionality in jquery , bind events different form elements same, need syntax right: $(function(){ init = new function(){ this.construct = function(){ actions.bind(); } } actions = new function(){ this.bind = function(){ $("#selector1").bind("click", function(){ actions.doactions(); }); $("#selector2").bind("change", function(){ actions.doactions(); }); } this.doactions = f

.net - multithreaded variable access -

this question keeps haunting me: in multithreaded/multiprocessor environment - necessary use explicit locks synchronize access shared variables? here scenario: have global variable pointing shared object. when instance of object created, reference placed in variable , becomes accessible other threads/processors. the object immutable - once created never changes, because of multiple threads can access without additional synchronization. once in while need update object. creating new instance of object on side , place reference new object in global variable. so here question: can consider replacing reference atomic operation. in other words variable have valid reference object - either old 1 or new one? is necessary use explicit locks synchronize access shared variables? necessary? no. idea? yes. low-lock techniques hard right , justified. remember, lock slow when contested; if locks being contested, fix problem causing them contested, rather going low-lock sol