Posts

Showing posts from February, 2011

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -

i love facebook dashboard: pue & wue. beautifull can point out if there open source or commercial product offer similar style? here link https://www.facebook.com/forestcitydatacenter?sk=app_288655784601722&app_data so read through 29,888 lines of javascript ya.. biggest js file i've ever seen. looks make graph using variety of tools, including tween.js . it'd fascinating chat whoever made it. code wheel graph object starts @ line 27,266 text var graphcomponent = class.extend({ . can find source @ https://www.fbpuewue.com/assets/application-3a3af20f7fa3591229c79442ae3d1c26.js . sorry if dissapoints it's not awesome plugin can use :/ share pain. let me know if have questions :)

How to use fopen() in php? -

i trying make code able log kind of errors on opening database. trying , create .txt file logs saved in there in case of error. what ve done far : bla bla bla } catch(pdoexception $e) { //in case of error , create log file error //$pdoexception_file = 'pdoexception_file_' . date('y_m_d-h-i-s') . '.txt' ; $pdoexception_file = 'pdoexception_file' . '.txt' ; $fh = fopen($pdoexception_file, 'w') or die(); fwrite($fh, date('y_m_d-h-i-s') . ' pdoexception error: ' . $e->getmessage() . "\n\n" ); fclose($fh); echo 'error: ' . $e->getmessage(); } what expected code wrote create 1 .txt file "pdoexception" file , inside logs : 2013_05_02-12-40-02 pdoexception error: bla bla bla 2013_05_02-12-43-02 pdoexception error: bla bla bla 2013_05_02-13-45-02 pdoexception error: bla bla bla that means every time have error , op

flex - How to change input language in adobe air' -

i want change default operation system language inside adobe air programmatic, keep getting english, event if current lang else , air application loaded. thanks/// the application-class has style-property called "locale". you can change using this.setstyle("locale", "de_de"); for changing @ runtime. or check compiler-settings. flash builder sets locale en_us default.

cocoa - How to load NSURL that contains “#” with WebView? -

i have url string contains "#".for example, nsstring* urlstr = @"https://developer.apple.com/library/ios/#/legacy/library/documentation/xcode/conceptual/ios_development_workflow/10-configuring_development_and_distribution_assets/identities_and_devices.html#//apple_ref/doc/uid/tp40007959-ch4-sw"; urlstr = [urlstr stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; nsurl* url = [nsurl urlwithstring:urlstr]; [[self.webviewsample mainframe] loadrequest:[nsurlrequest requestwithurl:url]]; after using encoding ,the "#" replaced "%23".if don't use encoding, nsurl nil. problem webview load incorrect webpage different browser.how can handle url string can load correct webpage? so think question now, root problem apple's documentation uses rather oddly formed urls. contain more 1 # character, isn't technically valid url. first valid (and important); others should escaped. safari able handle this, think because m

PowerShell snap-in 'AzureManagementToolsSnapin' is not installed on this computer -

i've download script uses 'azuremanagementtoolssnapin' on first line below: add-pssnapin azuremanagementtoolssnapin i read few blogs , downloaded azure powershell cmdlets link below: http://wappowershell.codeplex.com/releases/view/84058 when tried install per given documentation on link below i'm not being able install. logs error below don't understand why: installing assembly 'c:\windowsazure\wappscmdletsbin\release\microsoft.windowsazure.samples.managementtools.powershell.dll'. affected parameters are: = assemblypath = c:\windowsazure\wappscmdletsbin\release\microsoft.windowsazure.samples.managementtools.powershell.dll logfile = c:\windowsazure\wappscmdletsbin\release\microsoft.windowsazure.samples.managementtools.powershell.installlog logtoconsole = exception occurred while trying find installers in c:\windowsazure\wappscmdletsbin\release\microsoft.windowsazure.samples.managementtools.powershell.dll assembly. system

java - Create DAO for existing CSV file -

given existing csv file following example structure/content: id,password,role user1,1234,student user2,1234,professor i want create basic dao simple crud operations in java access , modify data. possible update/edit single record/line? or have parse , rewrite file? current implementation: package com.testproject.persistence; import java.io.filewriter; import java.io.ioexception; import java.util.list; import com.testproject.model.user; public class userdao { private final static string csv_file = "/users/someuser/desktop/test.csv"; /** * * @param user */ public void add(user user) { try { filewriter writer = new filewriter(csv_file, true); writer.append(user.getid()); writer.append(';'); writer.append(user.getpassword()); writer.append('\n'); writer.flush(); writer.close(); } catch (ioexception e) { e.pri

android - using application service in another application -

i have android application contains service. want access service in application. how can that? found application on net. please find code snippets bellow 1> public class localwordservice extends service { private final ibinder mbinder = new mybinder(); private arraylist<string> list = new arraylist<string>(); @override public int onstartcommand(intent intent, int flags, int startid) { random random = new random(); if (random.nextboolean()) { list.add("linux"); } if (random.nextboolean()) { list.add("android"); } if (random.nextboolean()) { list.add("iphone"); } if (random.nextboolean()) { list.add("windows7"); } if (list.size() >= 20) { list.remove(0); } return service.start_not_sticky; } @override public ibinder onbind(intent arg0) {

JSF 2.2 - fileupload does not work with Ajax. Form appears to have incorrect enctype (only via AJAX) -

Image
trying implement jsf 2.2 example have following code: <h:form prependid="false" enctype="multipart/form-data"> <!-- it's ajax file upload component --> <h:inputfile id="fileupload" value="#{somebean.file}" > <f:ajax /> </h:inputfile> <h:commandbutton value="upload" /> </h:form> according jsf 2.2 should work in case giving me following error: the request doesn't contain multipart/form-data or multipart/mixed stream, content type header application/x-www-form-urlencoded;charset=utf-8 looking request although have set form enctype correctly, partial request submits: content-type:application/x-www-form-urlencoded;charset=utf-8 faces-request:partial/ajax note web.xml modified to: <servlet> <servlet-name>faces servlet</servlet-name> <servlet-class>javax.faces.webapp.facesservlet</servlet-class>

git - Hudson hangs on "Started by user anonymous" -

my hudson job started hanging @ start of build, output looks like: started user anonymous [spinner] it can in state several hours, don't know can wrong. ideas? how can debug stuff? the same job or different job had left behind zombie process. of old build task, svn checkout or git clone process related job, still running or hung. please check if such process running using ps command. if yes, terminate process , job continue run. way can fix problem without restarting hudson.

ibm mobilefirst - How to give Worklight Server access to MySQL (SQL adapter) -

i'm migrating worklight app 5.0.3 5.0.6. i tried add mysql-connector-java-5.1.22-bin.jar** worklight.war file following error : procedure invocation error. runtime: java.lang.classnotfoundexception: class com.mysql.jdbc.driver not found in worklight platform or project /worklight any workaround? why .war file? add more information question: running worklight in eclipse or on application server (tomcat/liberty/was)? if using worklight developer edition (essentially plug-in download eclipse): you need place mysql-connector-java-5.1.22-bin.jar \lib folder of project... located at: yourproject\server\lib . make sure update datasource definitions in adapter xml: <datasourcedefinition> <driverclass>com.mysql.jdbc.driver</driverclass> <url>jdbc:mysql://localhost:3306/mydb</url> <user>myusername</user> <password>mypassword</password> </datasourcedefinition> if using

ios - Specify the time offset with an NSDateFormatter (-0500) -

i have date strings similar these: 2013-01-25 00:00:00 -0500 2013-01-22 00:00:00 -0700 2013-01-26 00:00:00 -0200 i want use nsdateformatter create nsdate using these kinds of strings. know how use formatter first part of date ( 2013-01-25 00:00:00 ), don't know how specify offset part ( -0500 , -0200 , etc). here's code start of date string: nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"yyyy'-'mm'-'dd hh':'mm':'ss"]; nsstring *datestring = @"2013-01-25 00:00:00"; // <-------- truncated ---- nsdate *date = [dateformatter datefromstring:datestring]; nslog(@"date: %@", date); how can working -0500 part? tried sssz , didn't work (gave null date). try this: nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"yyyy'-'mm'-'dd hh':'mm':'ss zzz"]; nsstring *da

android - send complex objects as post php java -

is possible send contact numbers via post php class inside eclipse ? or post limited primitive types , have find work arounds send them string ? i propose: send them json in post request, befor start, have @ gson project , keep in mind set content application -> json. luck

haskell - How can I log an entire HTTP request in WAI/scotty? -

i run middleware logstdoutdev network.wai.middleware.requestlogger, logs path , accept header (possibly other headers too). want see body of post , put requests well. body happens json, printing stdout fine. i have searched wai middleware logs have not found any. don't know enough wai internals write extracts post body , puts in myself, hoping avoid learning curve right now. wai middleware transformation on application : type middleware = application -> application and application handler: type application = request -> (response -> io responsereceived) -> io responsereceived all need define handler log whatever want , delegate "real work" downstream: -- note equivalent application -> application logallmiddleware :: application -> request -> (response -> io responsereceived) -> io responsereceived logallmiddleware app req respond = print . unpack . requestbody req app req respond please keep in mind wrote code

jquery - Radio button condition to set a value -

i have 3 radio buttons[ 1day, 1week, 1month ], 1day selected. have required starton , expireon values in hidden field. based on user selection have update starton , expireon values span tag. here starton value same 3 selection, expireon values change based on radio button selection. can 1 me here complete this. html code: <body> <input type="hidden" id="starton" value="01/01/2013" /> <input type="hidden" id="expireday" value="01/01/2013" /> <input type="hidden" id="expireweek" value="01/07/2013"> <input type="hidden" id="expiremonth" value="01/31/2012" /> <input type="radio" id="packageamt1" name="packageamt" checked="checked">1 day</input> <input type="radio" id="packageamt2" name="packageamt">1 week</input>

jquery - python code from javascript using ajax -

i have seen topic: ajax request python script trying need there 1 information missing. $.post('mypythonfile.py',{data}, function(result){ //todo } ); now problem is: how call function inside mypythonfile.py? there way specify name of function , give input data? thank time. ajax calls making http requests,so need have http server handles requests seen in other question. (there cgi provide http request handling). in python can use django, bottle, cgi etc have http request handling. call python function javascript. edited : in url.py should define api url; (r'^myapi', 'myapi'), and on url should have web api in views.py . can ; def myapi(request): callyourfunction(); and can call javascript now. can use jquery ajax request; $.ajax({ type:"get", url:"/myapi", contenttype:"application

ssis - Flat file source with EzApi -

does have examples of using ezapi flat file data source? examples in documentation start oledb connections. specifically can't work out how define input , output columns. say, instance, have csv file columns firstname, surname , age. want read ssis, sort age , write out text file. according post how use ezapi flatfile source in ssis? need define columns manually, can't suggested code work. if do: if (!pkg.source.outputcolumnexists("col0")) { pkg.source.insertoutputcolumn("col0"); } bool newcolumnexists = pkg.source.outputcolumnexists("col0"); newcolumnexists still false. i think link : http://blogs.msdn.com/b/mattm/archive/2008/12/30/ezapi-alternative-package-creation-api.aspx you know how create one. if want add columns in flat file use code: var flatfilecm = new ezflatfilecm(this); flatfilecm.connectionstring = file; foreach (var column in columns) { // add new column flat file connection

hadoop - Set reducer capacity for a specific M/R job -

i want change cluster's capacity of reduce slots on per job basis. say, have 8 reduce slots configured tasktracker, job 100 reduce tasks, there (8 * datanode number) reduce tasks running in same time. specific job, want reduce number half, did: conf.set("mapred.tasktracker.reduce.tasks.maximum", "4"); ... job job = new job(conf, ...) and in web ui can see job, max reduce tasks @ 4, set. hadoop still launches 8 reducer per datanode job... seems can't alter reduce capacity this. i asked on hadoop mail list, suggests can make capacity scheduler, how do? i'm using hadoop 1.0.2. thanks. the capacity scheduler allows specify resource limits mapreduce jobs. have define queues, job being scheduled. each queue can have different configuration. as far issue concerned, when using capacity scheduler 1 can specify ram-per-task limits in order limit how many slots given task takes. according documentation , memory based scheduling supported

javascript - PhoneGap Device ready not firing in ios but working fine in android emulator and ripple -

hey guys have problem firing deviceready on ios, code work find on adnroid emulator , ripple dont know problem. didnt try on readl android device emulator works fine, have tried on iphone 5 never call device ready.i have question true there different js files cordova different platforms ? var devicereadydeferred = $.deferred(); var jqmreadydeferred = $.deferred(); document.addeventlistener("deviceready", deviceready, false); document.addeventlistener("resume", deviceresume, false); function deviceresume() { dowhenbothframeworksloaded(); } function deviceready() { devicereadydeferred.resolve(); } $(document).one("mobileinit", function() { jqmreadydeferred.resolve(); }); $.when(devicereadydeferred, jqmreadydeferred).then( dowhenbothframeworksloaded); function dowhenbothframeworksloaded() { var networkstate = navigator.connection.type; var states = {}; states[connection.unknown] = 'unknown connection'; states[connection.ethernet] = &

templates - c++ generic way to check a value in a range -

in maths there different kind of range: can open ( (a, b) ), close ( [a, b] ), left opened (a, b] ) or right opened ( [a, b) ). want write template function in c++ (not 11) can easly manage these situation. i'm not confident meta-programming , templates. want have this: const int max = max, int min = min; int x = value; // check close range if ( is_in_range( x, min, max ) ) //... if ( is_in_range( x, min, max, open) ) //... if ( is_in_range( x, min, max, left_open) ) //... if ( is_in_range( x, min, max, right_open) ) //... have suggest? edit 1 i've tryed cannot compile enum { range_open, range_close, range_left_open, range_right_open }; namespace detail { template < typename type > inline bool check_open_range( const type& x, const type& max, const type& min ) { return ( min < x ) && ( x < max ); } template < typename type > inline bool check_close_range( const type& x, con

javascript - Drag all Divs. "this" -

i have code dnd element. works especific element. wanna make work divs. can't reference "this.id" move function. don't missing make work. window.addeventlistener('load', init, false); function init(){ //just 1 element /* box = document.getelementbyid('div1'); box.addeventlistener('mousedown', startmoving, false); box.addeventlistener('mouseup', stopmoving, false);*/ //all element? box = document.getelementsbytagname('div'); (i=0;i<box.length;i++) { box[i].addeventlistener('mousedown', startmoving, false); box[i].addeventlistener('mouseup', stopmoving, false); } } function startmoving(evt){ evt = evt || window.event; var posx = evt.clientx, posy = evt.clienty, = document.getelementbyid(this.id); divtop = parseint(a.style.top), divleft = parseint(a.style.left); var diffx = posx - divleft, diffy = posy - divtop; document.

android - How to invoke onClick and onLongClick of EditText from RelativeLayout -

Image
i'm creating compose screen app. have scrollview contains relativeview in turn contains 2 things: edittext user types message, , imageview visibility toggled on , off depending on whether image attached status or not. here's part of layout xml. <!-- @dimen/biggap = 8dp --> <scrollview android:id="@+id/parentscrollview" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true" android:layout_margintop="@dimen/biggap" android:layout_marginright="@dimen/biggap" android:layout_marginleft="@dimen/biggap" android:layout_marginbottom="@dimen/biggap" android:layout_above="@+id/footer" android:background="#006400" > <!-- green background color --> <relativelayout android:id="@+id/parentlinearlayout" android:layout_width="match_parent" a

ClassNotFoundException / NoClassDefFoundError when running a Scala jar -

having scala project exported .jar eclipse, application started java -jar app.jar dies error java.lang.classnotfoundexception: scala.predef$ . full output: exception in application start method exception in thread "main" java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:490) @ org.eclipse.jdt.internal.jarinjarloader.jarrsrcloader.main(jarrsrcloader.java:58) caused by: java.lang.runtimeexception: exception in application start method @ com.sun.javafx.application.launcherimpl.launchapplication1(launcherimpl.java:829) @ com.sun.javafx.application.launcherimpl.access$000(launcherimpl.java:56) @ com.sun.javafx.application.launcherimpl$1.run(launcherimpl.java:150) @ java.l

show title from php include page? -

im having problems finding way of doing this. i have page on site called profile.php, page has page tittle 'user profile', profile.php page looks this: <?php $page_title = "user profile"; include('includes/headerframe.php'); ?> <? // profile id url if (isset ($_get['id'])) { $profile_id = $_get['id']; } $user_info_set = get_user_info(); if (!$user = mysql_fetch_array($user_info_set)) { include ('includes/mod_profile/mod_noprofile.php'); } else if (!isset($profile_id)) { include("includes/mod_profile/mod_noprofile.php"); } $profile_info_set = get_profile_info(); while ($profile = mysql_fetch_array($profile_info_set)) if (isset ($profile_id)) if ($user['account_status'] == "active") if ($user['account_type'] == "user") { include("includes/mod_profile/mod_profile.php"); } what im doing using profile.php includes page if user exists include mod_profile el

c# - Clear CheckBoxList in one line -

does know how clear checkboxlist in 1 line? i have checkboxlist holds hundreds of values , i'm trying speed code. i.e. without iterating through each checkbox so: foreach (listitem li in cblcategories.items) { li.selected = false; } i know isn't going make huge difference user experience - i'm curious if knows more efficient way of doing this? hoping like: cblcategories.items.selected = none; the clearselection method , inherits listcontrol class.

jquery - Passing Objects as Parameters in javascript function -

i want pass objects parameters javascript function , i had tried following,actually iam calling function function in innerhtml.. var tempobj={ result:results, jsobj:jsobj } str +='<input type="button" onclick="buildcstrwisechart('+tempobj+')" value="view" class="btn btn-info">'; but didnt works me iam getting error like.. syntaxerror: missing ] after element list [break on error] buildcstrwisechart([object object]) can 1 in this.. you treating object if string. that's error. is tempobj global variable? if so, str +='<input type="button" onclick="buildcstrwisechart(tempobj)" value="view" class="btn btn-info">';`

html - How can I show an image as a background of a div? -

inside home.html : <div id="footer"> working!!! </div> in css file: #footer { height: 70px; background-image:url('footer.png'); border: 1px solid #000; } i check url of image again & again.. cannot see image background in footer div. reason. please me the syntax seems fine put path relative css file e.g. if files located as web-inf | | css | | your.css | | images | | footer.png then use background-image:url('../images/footer.png'); you use firebug correct path, can edit url putting ../../images , once image visible update css file same data.

c# - how to optimize performance of longlistselector with images on windows phone? -

i have page pivot containing 10 items, each pivot item contains longlistselector 30 items each. each longlistselector item contains image. when i'm browsing page , flip next pivot item, app crashes @ 4th pivot item memory exception. is there anyway unload undisplayed images in longlistselector? i suggest rethinking app layout, 10 pivot items tad many normal user navigation, why not have main page longlistselector of "categories" follow details page of 30 images. but if absolutely have way, take @ microsoft's photohub source i'm using , have no problem loading hundreds of images in panoramaitem. better still if can afford time, memory profile , bloat is, might part of application hogging on memory. last of all, wp caches images automagically, not likes way (i'm sure don't) take @ this: image caching this important one, , msdn silent it. if ever wondering why image memory didn't released after clearing source , removing i

MySQL index on VARCHAR(1000) -

a varchar(1000) column included in where clause e.g. where propertyvalue in ('sample, ...') the values unique not guaranteed/constrained be. i want index , wondering best approach is. realise indexing column make inserts slower. would storing hash of value char(64) , indexing , searching on faster? thinking fixed size value more suitable indexing. i using 5.1 , innodb the simplest approach use partial index: create index on [...] propertyvalue(100) [...] so long first 100 characters (in example) of columns reasonably distinctive, more sufficient make index work.

Get video's privacy settings using Youtube API -

in youtube video manager, have option set video a) public b) private , c) unlisted. using youtube api, possible find out setting of video currently? thanks it depends. i'm going answer in context of youtube data api v3 , recent release. there analogous methods in older v1 , v2 of api. if you're authenticated owner of video, can make videos.list(part=status, id=video_id) call, , video's status returned in video.status.privacystatus property. if you're not authenticated owner of video, can make same videos.list() call, if video private won't response. if video public or unlisted video resource, , check video.status.privacystatus see exact privacy level is.

javascript - how to append table to DIV -

i trying append table div : <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script> <script type="text/javascript"> function addstuff() { var html = '<table>'; $.each(function() { html += '<tr><td>' + '</td></tr>'; }); html += '</table>'; $("#divresults").append(html); } </script> </head> <body> <div id="divresults"></div> <button onclick="addstuff()">add stuff</button> </body> </html> but not working. want dynamically add table div block. you want append table div try this.... <html> <hea

xaml - How to Clip content with rounded corners in Windows Store App -

i've attempted have <grid/> (with interactive stuff inside, not image) clipped rounded corners (a <border/> or <rectangle/> , whatever works). i've attempted multiple solutions, none of them compatible windows store app. no brush: radialgradientbrush not supported in windows app project. drawingbrush not supported in windows app project. the type 'visualbrush' not found. verify not missing assembly reference , referenced assemblies have been built. no mask: the attachable property 'opacitymask' not found in type 'image'. the attachable property 'opacitymask' not found in type 'stackpanel'. the attachable property 'opacitymask' not found in type 'grid'. no rounded geometry: the property 'radiusx' not found in type 'rectanglegeometry'. multibinding not supported in windows app project. is technically impossible in c#/xaml wi

php - CakePHP 1.3 - Getting nested data from Form->input()? -

i'm upgrading system cakephp 1.1 cakephp 1.3. in 1.1 able use html helper like: $html->input('user/email'); to data nested in: $this->data['user']['email'] in controller. know $html->input() has been replaced $this->form->input() . however, when try use: $this->form->input('user/email') i get: undefined offset: 2 [core\cake\libs\view\helpers\form.php, line 496] this coming because / in input. seems 1.3 doesn't using / specify data should returned nested. how might achieve equivalent of in 1.3? thank much! in 1.3 use $this->form->input('user.email'); to set input user model , email field. if have set form correctly though, need email for example $this->form->create('user'); $this->form->input('email'); $this->form->end('submit'); but in short, answer specific question, replace / .

javascript - jQuery loaded through JS in head -

i'm using jquery , jquery mobile build application. load jquery , jquery mobile dynamically through script in head. body uses jquery ($) in script cannot access loads asynchronously. how can load jquery in synchronously or approach resolving problem? thanks in advance you might want @ head.js . asynchronously loads scripts, , gives ready function, similar jquery's, can put of onload code. <head> ... <script src="/js/head.js"></script> <script> head.js('/js/jquery.js', '/js/jquery-mobile.js', function() { $(document).ready(function() { // write code! }) }); </script> ... </head> if need javascript elsewhere, can use head.ready() <script> head.ready(function() { $(document).ready(function () { // write more code! }); }); </script> which can go anywhere in html. note: head.js examples don't use jquery's $

Losing tabs when scanning an NFC tag -android -

i have app has tab layout. 1 main activity tabhost/tabspecs/intents etc , 3 others in want read nfc tags using enableforegrounddispatch. my problem when read tag 1 of 3 activities, activity gets loaded anew, replacing tabbed layout. i think it's activity i'm calling in pending intent, can't work out, or find on web, how keep tabbed layout. i'm not sure if maybe should switching fragments because possibly tabs activities can't handle functionality? thanks in advance. russ p.s. can include code if helps, i'm hoping people have dealt before, though seem asked on here few times no answers. it's known problem (see example here or here ). solution nfc intent handling in tabactivity launchmode set singletask (not nice solution). better switch using fragments, say. there 1 activity, can handle nfc intents.

html - META REFRESH alternatives -

i know how use meta refresh , problem breaks button in browsers. here meta refresh tag: <meta http-equiv="refresh" content="5;url='http://google.com/'"> i wondering whether there alternative this? use java script redirect has similar function 1 in question: window.location.replace("http://google.com/");

jquery ajax multiple dynamic forms processing -

i'm doing simple php quiz app uses jquery, rules are: each quiz has many questions (max 100), user clicks add more questions, generates new form, appended @ end of list many answers each question (max 5), user clicks add more answers question, appended @ end of answer list of question questions sorted/weighted submit sequence, ajax post in case answers named "answer[]" the quiz loaded db, user can remove, edit or add new questions/answers within above limits i've decided organized each question form "class='postable'". script quiz updating looks this $("#update-change").click(function(e){ e.preventdefault(); showupdate('updating..'); $('form.postable').each(function(){ $.ajax({ type: "post", url: 'update_ask.php', data: $(this).serialize() }).done(function( msg ) { feedbackmessage(msg);

sql - Create a table in Oracle using the boolean value (true) as an unique index field -

imagine table card_service key(id_number, begin_date, service_type), end_date , is_active. the table card_service allows single id_number have multiples registers same service not want to happen. i change table card_service to: key(id_number, service_type),begin_date, end_date , is_active , can have 1 single service type per id_number not keep previous services set false in is_active field is_active loses use. so know if possible set value of boolean unique field in table in order create table accepts new entries if there no active service in specific service. best regards if i'm following want, use unique function-based index this: create table card_service ( id_number number, begin_date date, service_type number, end_date date, is_active varchar2(5), constraint ck_is_active check (is_active in ('true', 'false')) ); table created. create unique index ui_card_service on card_service ( case when is_active = 'true' i

.net - SSL Decryption on a load balancer while hosting WCF service through Biztalk -

i’ve got situation have wcf load balancer sitting behind f5 load balancer doing ssl decryption , forwarding unencrypted message biztalk hosted wcf service behind it. if configure service using basic http , client attempts call service comes back: the provided uri scheme 'https' invalid; expected 'http'. parameter name: via if configure service use wcf-custom , set bindings wshttp windows auth or none client gets following exception: there no endpoint listening @ https:/// service.svc accept message. caused incorrect address or soap action. see innerexception, if present, more details. i think answer may involve using custom behavior, wondering if had run situation in past, , if so, how did deal it? the easiest solution case use called clearusernamebinding can pass username password on http channel. default basichttpbinding doesnt allow username password passed on http channel , tend use wshttpbinding fails in case of load balanced environments.

preg match - PHP preg_match how to get from string begin "charcter=" and end with "&" -

i novice in regular expressions. i have: $str = 'manufacturer=1,2,3&brand=5,4&filter=29-31+48-46,47&price=150-700'; $find = 'filter'; // example. can price or brand or if (strpos($str, $find) !== false) { $matches = array(); preg_match('/' . $find . '=???/', $str, $matches); var_dump($matches); } ??? represent, regular expressions must use , how can parse string data separately preg_match use like: [0] = 29-31+48-46,47 // data parsed "filter=" "&" character i cant use explode or similar command because positions of parameter in string not fixed. thank! don't use regex, wrong tool job. use parse_str() : $str = 'manufacturer=1,2,3&brand=5,4&filter=29-31+48-46,47&price=150-700'; parse_str( $str, $array); echo $array['filter']; this prints : 29-31 48-46,47

json - Couchbase's view Automated Index Updates setting -

i'm looking way change couchbase's view automated index updates setting. i've followed this couchbase documentation , produced following curl command: curl -x post http://administrator:welcome@localhost:8091/settings/viewupdatedaemon -d 'updateinterval=7000&updateminchanges=1' but i'm getting error: {"updateinterval":5000,"updateminchanges":5000,"replicaupdateminchanges":5000}'updateminchanges' not recognized internal or externa l command, operable program or batch file. when try change 1 parameter, example: curl -x post http://administrator:welcome@localhost:8091/settings/viewupdatedaemon -d 'updateminchanges=1' it didn't give error settings remained same (produced in response): {"updateinterval":5000,"updateminchanges":5000,"replicaupdateminchanges":5000} i tried send fields in json format same outcome - no error settings did't change. curl

c# - Why am I getting badimagexception? -

i have code sample that's supposed detect canon 550d digital camera can control camera pc. downloaded source files here: http://www.codeproject.com/articles/17344/a-wrapper-for-the-canon-cdsdk-and-prsdk-for-remote?fid=379739&df=90&mpp=25&noise=3&prof=false&sort=position&view=quick&spc=relaxed&fr=1#xx0xx i created new project in visual studio 2012 pro; pc running windows 8 64bit. added .cs files , copied dll files downloaded canon website after registering. the first time ran program , clicked on connect button, got exception dll missing. since there no way add dlls referenced, copied them debug directory. the missing dll prsdk.dll, found , downloaded dll, , copied it. now when click on connect button, different exception: badimageformatexception: attempt made load program incorrect format. (exception hresult: 0x8007000b) the exception in file camera.cs, on line: err = prapi.pr_startsdk(); i googled exception , found people have

sass - How to use Yeoman with Bourbon rather than Compass? -

how go setting yeoman + grunt.js compile sass without compass? i'd use thoughtbot's bourbon rather compass. need create custom generator or matter of passing flag existing yeoman generators? in directory: npm uninstall grunt-contrib-compass --save-dev (removes compass node_modules , package.json) npm install grunt-contrib-sass --save-dev (adds sass node_modules , package.json) open gruntfile.js in watch task (around line 22) change "compass" "scripts" change compass task (around line 109) "sass" format according grunt-contrib-sass docs. gruntfile gruntfile.js gist . run find , replace "compass" "sass" install bourbon

eclipse - Java: my code is shown as a text file .. not as in a java format -

Image
i downloaded eclipse (indigo - version 3.7.2) local machine vm (linux ubuntu), , managed run subclipse connect repository , pull project(with code files inside source folder). now able see project , open files, nonetheless code bunch of "normal text" lines.. when try check editor, text editor , there no java editor available what missing .. here screen shot perhaps opening java file in text editor. fix: select file right-click -> open -> java editor

jquery - Knockout.js, mapping plugin and moment.js - formatting/mapping json dates -

i using knockout.js mapping plugin. getting json data , using mapping plugin map html. in json data json formatted date need map html using mapping plugin. possible use moment.js format date , allow mapping plugin map html? how json date, reformat readable date , map html? // here json formatted date "duedate":"\/date(1362124800000)\/" // here's data model var viewmodel; $.getjson('/myjsondata', function (data) { viewmodel = ko.mapping.fromjs(data); ko.applybindings(viewmodel); // moment.js format date json - how can passed ko.mapping? var mo = moment("\/date(1362124800000)\/").format("mmm yy"); }); here's alternative answer, utilizes custom binding . use in view this: <span data-bind="textualdate: duedate"></span> the custom binding code this: ko.bindinghandlers.textualdate = { update: function(element, valueaccessor, allbindingsaccessor, viewmodel, bindingcontext) {

objective c - iOS : View works in ViewDidLoad but not once reloaded? -

i'm pretty confused problem. basically, have coreplot chart uses numbers i've parsed web. the view works first time it's loaded i've since put reload button on it. reloading view this: -(ibaction)refresh:(id)sender{ [self reloaded]; } -(void)reloaded{....... lots of code } when click button, getting exc_bad_access error in plot code (the place making plot in coreplot.) here's line that's throwing error: - (nsuinteger)numberofrecordsforplot:(cptplot *)plot { return dates.count; } i'm not sure why works @ first not once reload it. can please help? thanks!

Access functions from multiple Google Apps Projects -

is there way in google apps scripts create function can accessed multiple projects/spreadsheets? when i'm in google spreadsheet, go tools > script editor... , create project. create functions within project. have other spreadsheets i'd able use functions in, without having copy , paste them each project. if existed in 1 place, easier update them. thanks! apss-script libraries a library project can included or other developers gain access functions. learn how write, include , use library, see sections below. http://goo.gl/j0kw1

api design - Why does the jQuery library expose DOM elements? -

this question design of jquery api, not specifics of usage. why jquery object collection of dom elements , not collection of jquery objects? working jquery objects allow dom manipulation done same way throughout code. seems usage patterns convert dom element jquery object anyway. understand it, many dom-element-to-jquery-object conversions expected, that's why chose shorthand $ function. why way? why not assume want manipulate dom through jquery , avoid explicit conversions everywhere? it inefficient create jquery object when 1 isn't needed. example: $("a").each(function(){ console.log(this.href); }); since href available property of domelement, waste turn jquery object , use .attr . for jquery make each 1 jquery object, have make new jquery object each element iterates over, waste if don't need jquery object. same thought process can applied event handlers, filter method, , other method iterates on elements.