Posts

Showing posts from August, 2013

multithreading - Python threading - Is this what I need? -

i'm writing python script control various hardware parts of setup. have state want keep while other parts of script thing. think while loop stopping other parts of script running. need introduce threading that loop can continue run until tell stop? not sure if looking @ right method solve issue. edit: have pasted of code whole thing quite large. this listens usb midi device messages of specific types , performs actions based on input values listed in inst while true: b = f.read(1) s='rawdatab:'+ hex(ord(b)) print s if b == '\x90': note=true elif note: if b in inst: print "isnote:" + str( int(hex(ord(b)), 16)) noteaction(inst.get(b)) note=false if b== '\xb0': controller=true elif controller: #grab controller byte 1, value byte 2 bcount = bcount +1 cn=hex(ord(b)) #hex value of byte if bcount == 1: cntrl=cn

android - When should one use Theme.AppCompat vs ThemeOverlay.AppCompat? -

there following theme.appcompat classes: theme.appcompat theme.appcompat.light theme.appcompat.light.darkactionbar theme.appcompat.noactionbar theme.appcompat.light.noactionbar theme.appcompat.dialogwhenlarge theme.appcompat.light.dialogwhenlarge theme.appcompat.dialog theme.appcompat.light.dialog theme.appcompat.compactmenu and following themeoverlay.appcompat classes: themeoverlay.appcompat themeoverlay.appcompat.light themeoverlay.appcompat.dark themeoverlay.appcompat.actionbar themeoverlay.appcompat.dark.actionbar why 1 use themeoverlay.appcompat.light vs theme.appcompat.light example? see there less attributes defined themeoverlay -- curious intended use case themeoverlay is. per theme vs style blog post creator of appcompat: [themeoverlays] special themes overlay normal theme.material themes, overwriting relevant attributes make them either light/dark. themeoverlay + actionbar the keen eyed of have seen actionbar themeoverlay derivatives:

Javascript function without any code in it -

i found following javascript code snippet part of popup window, causing browser ask if want close window. window.onbeforeunload = function() { settimeout(function() { window.onbeforeunload = function() {}; settimeout(function() { document.location.href = 'index.html'; }, 500); },5); return ''; }; i wondering these things: why use function without code in ( code line 3 ) why use window.onbeforeunload inside second time? or try obfuscate purpose ?

c# - Use NumericUpDown to select days in month -

windows form application numericupdown , datetimepicker . using datetimepicker allow user select time (21.20) want use numericupdown allow user select day. how set numericupdown allow user select valid day based on number of days in current month? use datetime.daysinmonth() function set maximum() property of numericupdown() in load() event of form: private void form1_load(object sender, eventargs e) { numericupdown1.maximum = datetime.daysinmonth(datetime.today.year, datetime.today.month); }

haskell - Taking the nth list from a list of lists -

i have following function returns list of list of pairs. getprofilematrix :: profile -> [[(char, int)]] getprofilematrix (profile profilematrix _ _ _) = profilematrix what want create function takes profile , int , char value , looks in list [[(char, int)]] , returns nth list (the int parameter value) [(char, int)] , looks char in list of tuples, , if parameter char value matches, returns int value of tuple. in order int value of [(char, int)] list, constructed following function: tuplenr :: char -> [(char, int)] -> int tuplenr letter list = head [nr | (ltr, nr) <- list, ltr == letter] this function works expected. problem when trying extract nth list [[(char, int]] , applying tuplenr function it: profilefrequency :: profile -> int -> char -> int profilefrequency p c = tuplenr c (map (\x -> (x !! i)).(getprofilematrix p)) but doesn't work.. don't understand why doesn't work. first call getprofilematrix function returns list

gruntjs - running grunt task as configuration in webstorm -

in webstorm, running grunt serve terminal works flawlessly , presents me webpage. however, when make configuration , run that, there's error concerning sass css compilation: running "concurrent:server" (concurrent) task warning: running "compass:server" (compass) task warning: need have ruby , compass installed , in system path task work. more info: https://github.com/gruntjs/grunt-contrib-compass use --force continue. aborted due warnings. which not understand, i'm using same settings (described here ) seems webstorm doesn't see terminal environment when being started shortcut. pleasee try editing launcher suggested in https://devnet.jetbrains.com/message/5513463#5513463 - help?

javascript - Displaying Sum Of Characters and Sum Of Words -

this script counts characters , words 3 separate textarea inputs , echo's out sum. variable sum of characters (chars_all) working, variable sum of words (words_all) returning same number. if return single words variable (words1, words2, words3), works intended. issue seems in getting final sum. here's relevant piece of code setinterval(function(){ var chars1 = $('#content_ifr').contents().find('body').text(); var words1 = chars1.split(" "); var chars2 = $('#contentsection2_ifr').contents().find('body').text(); var words2 = chars2.split(" "); var chars3 = $('#contentsection3_ifr').contents().find('body').text(); var words3 = chars3.split(" "); var chars_all = chars1+chars2+chars3; var words_all = words1+words2+words3; $(".textarea_chars_all").text(chars_all.length); $(".t

javascript - Safari: After 6 concurrent XMLHttpRequest requests, progress block won't get called -

i building multiple file upload jquery script, , using xmlhttprequest , formdata upload files. works great. but, testing , have read, can have 6 concurrent xmlhttprequest requests @ same time. testing correct, after of 6 complete, next ones in queue upload, 1 expect. the issue arises progress function. function getting called first 6 files when using safari , next files queued not call progress method. firefox , chrome perform correctly , show progress files. here using: _makerequest: function(asset) { var _this = this; var xhr = new xmlhttprequest(); (function(progress) { xhr.upload.onprogress = function(e) { if (e.lengthcomputable) { _this._progress(asset, e); } else { _this._log('error: 'asset.file.name+' not computable'); } }; }(asset.progress)); xhr.upload.addeventlistener('load', function(e) { _this._complete(e, _this); });

deb - Debian packaging rules -

when tried make link inside rules file didn't allow me.how can make it? here did. #!/usr/bin/make -f icon = $(curdir)/frontpage.png script = $(curdir)/guilotinga.py launcher = $(curdir)/internation.desktop dest1 = $(curdir)/debian/internation/usr/share/internation dest2 = $(curdir)/debian/internation/usr/share/applications build: build-stamp build-stamp: dh_testdir touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp dh_clean install: build clean $(icon) $(script) $(launcher) dh_testdir dh_testroot dh_prep dh_installdirs mkdir -m 755 -p $(dest1) mkdir -m 755 -p $(dest2) install -m 666 $(icon) $(dest1) install -m 777 $(script) $(dest1) install -m 777 $(launcher) $(dest2) ln -s usr/share/internation/guilotinga.py /usr/bin/internation (that's stopped) the line above giving error saying don't have enough privileges.what fault? binary-indep: build install dh_testdir dh_testroot dh_installchang

Java OOP: referencing subclass object -

i have arrayclass , mergesortarray extends it. , mergesortarray contains mergesort() method. however, since used super call constructor superclass, not know how refer mergesortarray (the subclass object / array) , pass parameter in mergesort method. in fact, feasible ? know can in non- oop way. however, keen know how in oop way. please correct me if have said incorrect, new java , want learn more it. // arrayclass object import java.util.*; import java.io.*; import java.math.*; public class arrayclass{ public int[] input_array; public int nelems; public arrayclass(int max){ input_array = new int [max]; nelems = 0; } public void insert(int value){ input_array[nelems++] = value; } public void display(){ for(int j = 0; j < nelems; j++){ system.out.print(input_array[j] + " "); } system.out.println(""); } } import java.io.*; import java.util.*

javascript - Sails JS - Display flash message doesn't work on Heroku(production) but works fine in development -

the flash message works on local machine during development...it doesn't work when deployed app on heroku. i've been trying find answer couldn't find solves problem. api/policies/flash.js module.exports = function(req, res, next) { res.locals.flash = {}; if(!req.session.flash) return next(); res.locals.flash = _.clone(req.session.flash); // clear flash req.session.flash = {}; next(); }; api/controller/usercontroller.js (within create action) - when form submitted successfully, redirect homepage , display thank message. res.redirect("/"); req.flash('signup-message', '<div class="thankyou-message-wrapper bg-success"><span class="glyphicon glyphicon-remove pull-right" aria-hidden="true"></span><span class="thankyou-message">thank submitting form!<br> our administer review submission , publish soon.</span></div>'); view/main/index.e

javascript - flexslider 2 active thumbails -

i trying create slider thumbnails displays 2 images @ time in slider. got working minitems:2 the problem come thumbnail navigation. when click on second thumbnail, slider move, , display 3rd image on slider, although second image being displayed. is there way create 2 active thumbnails , make them sync images being shown in slider? the other similar slider found uses nastygal in product page. hope way, because not user friendly way now. thanks! i using on woocommerce store: productslider: { selector: '#product-nav', init: function () { var base = this, container = $(base.selector), images = $('#product-images'), zoom = images.data('zoom'); container.flexslider({ animation: "slide", controlnav: false, directionnav: false, animationloop: false, slideshow: false,

PHP asynchronous mysql-query -

my app first queries 2 large sets of data, work on first set of data, , "uses" on second. if possible i'd instead query first set synchronously , second asynchronously, work on first set , wait query of second set finish if hasn't , use first set of data on it. is possible somehow? it's possible. $mysqli->query($long_running_sql, mysqli_async); echo 'run other stuff'; $result = $mysqli->reap_async_query(); //gives result (and blocks script if query not done) $resultarray = $result->fetch_assoc(); or can use mysqli_poll if don't want have blocking call http://php.net/manual/en/mysqli.poll.php

jpa - Problems creating correct ddl from entities using eclipselink -

i have 2 entities person & status manytoone relation @entity @table(name = "person") public class person implements serializable { @id @generatedvalue(strategy = generationtype.identity) private integer id; @column(name = "first_name") private string firstname; @column(name = "last_name") private string lastname; @joincolumn(name = "status_id", referencedcolumnname = "id") @manytoone(cascade = cascadetype.all) private status status; // setters & getters } and @entity @table(name = "status") public class status implements serializable { @id @generatedvalue(strategy = generationtype.identity) @column(name = "id") private integer id; @column(name = "abbreviation") private string abbreviation; @column(name = "title") private string title; @basic(fetch=fetchtype.lazy) @onetomany(mappedby = "

Android keyguard widget not displayed -

i working on widget needs displayed on keyguard, here widget info : <?xml version="1.0" encoding="utf-8"?> <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialkeyguardlayout="@layout/widget_layout" android:minwidth="294dp" android:minheight="72dp" android:updateperiodmillis="0" android:widgetcategory="keyguard"> </appwidget-provider> and here part of manifest : <receiver android:name="com.view.keyguardwidgetprovider" android:icon="@drawable/idoogood_logo" android:label="@string/appwidget_name"> <intent-filter > <action android:name="android.appwidget.action.appwidget_update" /> <action android:name="android.intent.action.user_present"/> </intent-filter> &l

ios - Proper way to manage the array -

i using mutable array . not sure correct way of managing array. tried learn memory management basics,but found difficult grasp. doing is declaring array @ interface @interface myvc() @property (nonatomic,strong) nsmutablearray *substrings; // if use weak attribute here,does change anything? @end -(void)mymethod{ // initializing array _substrings=[[nsmutablearray alloc]init]; //storing data [_substrings addobject:@"hello"]; //do data in array //call method gets data same array , operations there [self method2];-----> // access data array like, x=[_substrings objectatindex:0]; //finally, remove items in array [_substrings removeobject:@"hello"]; //and again start process mentioned here } this thinking do. proper way of declaring , accesssing , managing array? in general work, recommend access array using property getter/setter. way if ever need create custom getter/setter not nee

c# - Linq - check from list some thing like in used in to query on set in SQL -

list<guid?> mobileappid = new list<guid?>(); return d .where(x => x.marketplaceid in mobileappid) .tolist(); i want select values d marketplaceid in mobileappid.mobileappid set how in linq c#. select in query in sql server d class containing marketplaceid the equivalent contains query: return d .where(x => mobileappid.contains(x.marketplaceid)) .tolist(); might want make mobileappid hashset speed up.

merge - Merging code values of categories to dataset in R -

i have political donation dataset holds industry categories in alphanumeric codes. separate text document has listing how these alphanumeric codes translate industry name, sector name, , category-of-industry name. for instance, "a1200", crop production industry, in agribusiness sector, in sugar cane industry category. i'd know how pair alphanumeric codes respective sector, industry, , category values in separate columns. right now, code values dataset in catcode catname catorder industry sector a1200 sugar cane a01 crop production agribusiness and industry donation dataset: business name amount donated year category sarah farms 1000 2010 a1200 the category dataset 444 rows , donation set 1m rows. how feel out donation dataset looks this. category common name catcode catname catorder industry sector business name amount donated year category

javascript - Open specific accordion tab using external link and hash -

hi i'm new in js sorry ask here know basic one, i'm working accordion plugin collects article users want put in accordion , view in accordion question how open specific tab when have dynamic id per article inside item of accordion.. im trying hook item using link, http//:example.com#id open specific tab in accordion here s plugin code. hook inside code , trigger click event open specific in accordion plugin !(function($){ $.fn.spaccordion = function(options){ var settings = $.extend({ hidefirst: 0 }, options); return this.each(function(){ var $items = $(this).find('>div'); var $handlers = $items.find('.toggler'); var $panels = $items.find('.sp-accordion-container'); if( settings.hidefirst === 1 ) { $panels.hide().first(); } else { $handlers.first().addclass('active'); $panels.hide().first().slidedown();

c# - How to create multiple POST methods on an Azure Mobile Service? -

i have azure mobile service multiple controllers. 1 of controllers (testsetcontroller) has methods check on insert. problem need solve: testset table has 2 different types of testsets, 1 local team , field team. table contains data both , records differentiated "teamtype" field says if local team inserted testset or field team did. on insert want check if similar testset exists inserted other team. want compare testsets (if found) other inserts/updates on same table if testsets different. however, keep getting error: exception=system.invalidoperationexception: multiple actions found match request: posttestsetdto on type sbp_ctservice.controllers.testsetcontroller checkfordiscrepancy on type sbp_ctservice.controllers.testsetcontroller comparetestpointattempts on type sbp_ctservice.controllers.testsetcontroller @ system.web.http.controllers.apicontrolleractionselector.actionselectorcacheitem.selectaction(httpcontrollercontext controllercontext) @ system.web.htt

ruby on rails - Finding an Album's Artist with the Spotify API -

i'm trying use rails gem spotify api find artist(s) of particular album. start retrieving name of album such: album_results = rspotify::album.search("the eminem show") to find artist of album issued following method variable above: album_results.artists this returns ton of data don't need. want name of artist. able accomplish partially doing: album_results.first.artists.first.name => "eminem" what i'd return name of available artists album results . tried using select method once again got data wanted: album_results.select {|album| album.artists} what best approach accomplish this? using select here return records artists . you need use either collect or map my_artists = album_results.flat_map{ |album| album.artists.collect{|artist| artist.name} } edit use flat_map returns flattened array default. more efficient using collect , flatten!

In Python, Pandas. How to subset dataframe by WOM - 'Week of the Month'? -

i want able subset df week of month, similar can day of week or month. sample = df[df.index.month == 12] so there way this?? sample = df[df.index.wom == 1] i know if type line above attributeerror: 'index' object has no attribute 'wom', reference understand want do. thanks you can @ value of .weekofyear , same value @ beginning of month , difference of these 2 should give week of month; example: >>> days = ['2014-02-01', '2014-06-10', '2014-08-30', '2014-11-22'] >>> idx = pd.to_datetime(days) >>> idx.weekofyear array([ 5, 24, 35, 47], dtype=int32) for beginning of month can subtract .day index itself: >>> mon = idx - pd.to_timedelta(idx.day - 1, unit='d') >>> mon.weekofyear array([ 5, 22, 31, 44], dtype=int32) and week of month be: >>> 1 + idx.weekofyear - mon.weekofyear array([1, 3, 5, 4], dtype=int32)

regex - Use 'sed' to find a number in line -

i trying use unix sed command find line numbers match particular regular expression. pattern of file below murali : 20 # krishna: 21 $ hari: 22 @ murali : 23 # i need output numbers below using sed command 20 21 22 23 can please me regular expression sed . how $ cat input murali : 20 # krishna: 21 $ hari: 22 @ murali : 23 # $ sed -r 's/^[^0-9]+([0-9]+).*/\1/g' input 20 21 22 23 [^0-9]+ matches other digit ([0-9]+) matches digits, captured in group 1 .* matches rest

C++ array program -

i'm confused when comes arrays , i've got mini-project on using them i'm stuck @ part in program , don't know next, can help? the question is: "write c++ program reads 5 integers screen (provided user) , determines largest integer. must use array store 5 integers. the following shows sample output of program. enter 5 integers: 15 36 -8 92 56 largest integer 92 " what i've got far: #include <iostream> #include <string> using namespace std; int main() { int userintegers[5]; cout<<"enter 5 integers: "; cin>>userintegers[0]; //system("pause"); return 0; } here thing have do. need use for or while loop number of user input , store them in array. int userintegers[5]; int largest = 0; cout<<"enter 5 integers: "; (int i=0; i<5; i++) //use loop upto how many numbers need input. { cin>>userintegers[i];//get input user , store in array @ index /*if inp

java.net.SocketException: Connection reset With HTTPConnection -

i trying hit external api fetch data. when data size small, works fine when size of data returned api big connection reset exception. below code java class interfacehelper , have marked comment @ line no getting exception [ its while trying read data inputstream ]. i have tried search many question on stackoverflow didn't find appropriate answer. please don't mark duplicate question. want know reason behind problem, , proper solution problem. if find question duplicate please answer before marking duplicate. dare you. find below code have used. url dummy url security reason cannot mention actual url have used. try{ url url = new url("http://example.com/someparams/some-access-token"); httpurlconnection connection = (httpurlconnection)url.openconnection(); connection.setrequestmethod("get"); connection.setrequestproperty("content-type","application/x-www-form-urlencoded"); connection.setr

How do I call the basic WordPress header files? -

i'm making custom form action.php , looks this: <?php // collect data $first = $_post["first_name"]; $last = $_post["last_name"]; $email = $_post["email"]; $pass = $_post["password"]; $pass2 = $_post["confirm_password"]; $cat = $_post["category"]; $tandc = $_post["terms_and_conditions"]; $privacy = $_post["privacy_policy"]; $newsletter = $_post["newsletter"]; die(); ?> essentially nothing going on - problem though when want call wordpress hook such this: $user_name = $email; $user_id = username_exists( $user_name ); it returns error: fatal error: call undefined function username_exists()... i'm aware there header files not calling 'undefined function' run. i have tried adding @ top of page: wp_head(); - following error: fatal error: call undefined function wp_head() include wp-load.php file (in ro

box api - mapping automatically Box.com and Php -

i trying design application can create folder , retrieve folder box.com using php , have tried lots of apis fail. also want create folder automatic authentication. i have tried https://developers.box.com/docs/ can't automatic authentication. $ch = curl_init(); curl_setopt($ch, curlopt_url, "https://api.box.com/oauth2/token"); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_encoding,"content-type:application/x-www-form-urlencoded"); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_returntransfer,true); curl_setopt($ch, curlopt_customrequest,"post"); curl_setopt($ch, curlopt_httpheader, array("content-type: application/x-www-form-urlencoded", 'accept: application/json')); curl_setopt($ch, curlopt_postfields,array('client_id=my_client_id&client_secret=my_client_secret_key&grant_type=urn:box

How to find the value that has maximum duplicates in app engine datastore using Java? -

i have datastore stores cab booking details of customers. in admin console need display statistics admin, busiest location, peak hours, total bookings in particular location in particular day. busiest location need retrieve location number of cabs has been booked. should iterate through entire datastore , keep count or there method know location has maximum , minimum duplicates. i using ajax call java servlet should return busiest location. and need suggestion maintaining such stats page. should keep separate entity kind counters , stats , update everytime when customer books cab or logic correct iterating through entire datastore stats page. in advance. there many unknowns data model , usage patterns offer specific solution, can offer few tips. updating counter every time create new record increase writing costs 2 write operations, may or may not significant. using keys-only queries cheap , fast. preferred method counting something, should try model data in such

.htaccess in mediawiki not working -

i have wiki , running @ example.com. when go page links change in url /index.php/main_page i not want parts after / main page. want index.php out i have in .htaccess rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^/(.*)$ wiki/index.php?title=$1 [pt,l,qsa] rewriterule ^/*$ wiki/index.php [l,qsa] rewriterule ^$ wiki/index.php [l,qsa] and in localsettings. $wgscriptpath = "/w"; $wgarticlepath = "/wiki/$1"; where error? cannot figure out ... followed mediawiki t. your 3 rewrite rules contradictory , don't match $wgscriptpath. meant like: rewriterule ^/wiki/(.*)$ w/index.php?title=$1 [pt,l,qsa] rewriterule ^/*$ w/index.php [l,qsa] see https://www.mediawiki.org/wiki/manual:short_url/apache more.

c# - How to dispose a crystal report? -

i new crystal report. have generate reports multiple pages. how dispose reports after use. tried following code. protected void crystalreportviewer1_unload(object sender, eventargs e) { report.close(); report.dispose(); } but gives error when trying navigate other pages. can suggest way dispose report? in event suppose close report? be sure , call garbage collection manually after disposing report or form viewer on it. crytal/.net not clean (or fast enough) if don't.

c# - How to delete dynamically created textbox in asp.net -

i have created code adding textbox not know delete added textbox. share me how remove textbox; counter ++; textbox tb = new textbox(); tb.id = "textbox" +counter; literalcontrol linebreak = new literalcontrol(); placeholder1.controls.add(tb); placeholder1.controls.add(linebreak); controlidlist.add(tb.id); viewstate["controlidlist"] = controlidlist; you can remove textbox placeholder below: protected void remove(object sender, eventargs e) { foreach (control control in placeholder1.controls) { //here need take id viewstate["controlidlist"] if (control.id == "takeidfromcontrollistsid") { controls.remove(control); } } }

powershell - test-path returns permission denied - how to do error handling -

i try error handling within powershell script. fatal. tried few things, e. g. try{ } catch{ } - did not work. any ideas or solutions? function check-path($db) { if ((test-path $db) –eq $false) { write-output "the file $db not exist" break } } it returns: test-path : zugriff verweigert in k:\access\access.ps1:15 zeichen:6 + if ((test-path $db) -eq $false) { + ~~~~~~~~~~~~~ + categoryinfo : permissiondenied: (k:\ss.mdb:string) [test-path], unauthorizedaccessexception + fullyqualifiederrorid : itemexistsunauthorizedaccesserror,microsoft.powershell.commands.testpathcommand somewhat confusingly test-path generates error in number of cases. set standard erroraction parameter silentlycontinue ignore it. if ((test-path $db -erroraction silentlycontinue) -eq $false) {

perl - Checking for alphanumeric characters and getting input from HTML form -

i'm new programming in perl , have couple of compilation issues can't seem resolve. program gets input html form. question: should form use post or method? <form action="./cgi-bin/perl.pl" method="get"> <br> full name: <br><input type="text" name="full_name" maxlength="20"><br> username: <br><input type="text" name="user_name" maxlength="8"><br> password: <br><input type="password" name="password" maxlength="15"><br> confirm password: <br><input type="password" name="new_password" maxlength="15"><br> i open csv file, write value of user_name array , number of checks on user's input. problem #1: need check full_name, user_name, password, , new_password alphanumeric or space keep getting multiple errors like: use of

how to send transactional emails using constant contact in php -

present using sendgrid sending transnational emails after donating/ registering user. , constant contact sending news letters subscribed users in website. i want use 1 server both. is there possibility send transnational emails using constant contact. have searched in developer.constantcontact website. there no exact solution. in given api adding emails list in campaign. , creating campaign , sending email users in list. is there possibility send email notification registered/donated user immedieately without creating campaign. please hemp me. no. you'll need use mandrill mailchimp transactional emails. maybe cc add support @ point, wouldn't count on it.

order by lower have different result in oracle -

Image
i want sort label lower case, not why have 2 different result ? i expect first result must this: 1a a_test btest chrismax chrismax t test xmax 2014 "chrismax" , "chrismax" lowercased same. database can order 2 rows way pleases.

sharepoint 2013 workflow version -

i have downloaded , installed trial version of sharepoint 2013. have setup sharepoint designer because want see workflows can do. unfortunately, when create workflow, can select "sharepoint 2010 workflow" in "platform type" dropdown. message, telling me cannot create sharepoint 2013 workflow: "the option sharepoint 2013 workflow platform not available because workflow service not configured oon server." everything runs on single server - both sharepoint installation, sql server, iis server , designer thing. can shed light on problem? regards leif there separate installation , setup needs done in order make sharepoint 2013 workflow type show in dropdown. need install workflow manager , link farm , should go.

ruby on rails - Updating two tables with one to many relationship via form -

Image
i trying update 2 tables through form getting error: started post "/test" ::1 @ 2014-12-02 00:15:21 -0800 processing userscontroller#create js parameters: {"utf8"=>"✓", "users"=>{"first_name"=>"sdfdsfdsf", "last_name"=>"dsfdsfds", "email"=>"3213213@hotmail.com", "phone_number"=>"23123213", "message"=>"sdfdsfsdfdsfkjsdfksdfk;adklsfjksadfksjdfklsdf"}, "commit"=>"save users"} completed 500 internal server error in 1ms argumenterror (wrong number of arguments (1 0)): app/controllers/users_controller.rb:32:in `create' rendered /users/bli1/.rvm/gems/ruby-2.1.3/gems/web-console-2.0.0/lib/action_dispatch/templates/rescues/_source.erb (2.6ms) rendered /users/bli1/.rvm/gems/ruby-2.1.3/gems/web-console-2.0.0/lib/action_dispatch/templates/rescues/_trace.text.erb (0.4ms) rendered /users/bli1/.rv

javascript - API calls in angularJS right after each other -

i have problem using angular in ionic mobile project , have piece of code working great in desktop environment. 3 api call web server 500ms after each other. in phone using lower connection 1 of call fails whole process fail. there way api calls in exact moment previous 1 finish? mean, not using fixed amount of time. //get member information $timeout(function() { membersservice.getmember(community.url, community.user.api_key, community.user.auth_token, $stateparams.userid). success(function(data) { $scope.member = data.result; }); }, 500); $timeout(function() { messagesservice.getconversation(community.url, community.user.api_key, community.user.auth_token, community.user.user_info.guid, $stateparams.userid, "from"). success(function(data) { if(data.result["entities"].length > 0) { messages = messages.concat(data.result["entities"]); subject = "re: "+data.result["entities"][data.result["enti

java - How can i calculate a string mix of operators and operands -

it giving error when operator encountered in between.i know operator cannot into converted int or other format.i using operator calculation reading byte codes , passing enum defined.but string having operators having prob in handling these.please me on this. ----my inputs 1 + 2 ----expected output-- 1 + 2=3--- error in line ---- b = integer.parseint(st.nexttoken()); --error in during exceution----- enter series-- 1 + 2 no of tokens:3 yo 1 go 1 available byte info:10 ....... exception in thread "main" java.lang.numberformatexception: input string: "+" @ java.lang.numberformatexception.forinputstring(numberformatexception.java:65) @ java.lang.integer.parseint(integer.java:484) @ java.lang.integer.parseint(integer.java:527) @ abc.main(abc.java:42) not able rectify it. below code import java.io.*; import java.util.stringtokenizer; public class abc{ public static void main(string[] args) throws exception { syste

javascript - flot stackpercent setdata bug -

i'm trying update flot graph using stackpercent plugin. wish include ability users turn legend items on , off, problem chart isn't redrawn properly. maths determining % ignored when using draw() function result graph doesn't correct. this documented bug . however, don't see being fixed anytime soon. how can fix this?

multithreading - How do I wait for a set of threads to 'really' finish in java? -

i have group of threads in java want run several times (each time different set of parameters). second run start want wait first run finish. should accomplished thread.join() before second run, since threads run in infinite loop have stop them interrupt, interrupts blocking join: i have thread run() method looks this: try { while(true) { printsomeinfo(); if (...) { thread.currentthread().getthreadgroup().interrupt(); } } } catch (interruptedexception e) { thread.currentthread().getthreadgroup().interrupt(); } { printstats(); } and main method invoking run method of thread: system.out.println("new run:"); (i ...) { //first run mythread[i] = new mythread(someinfostring1); mythread[i].start(); } try { (i...) { mythread[i].join(); } } catch (interruptedexception e) { e.printstacktrace(); } system.out.println("new run:"); (i ...) { //second run mythread[i] =

c# - How to create IsDirty inside OnPropertyChange, but at the same time turn it off when entities are loaded from a database -

i’m building wpf app, , got point want able check whether entity isdirty, found solution online: private bool isdirty; public virtual bool isdirty { { return isdirty; } set { isdirty = value; } } public event propertychangedeventhandler propertychanged = delegate { }; protected void onpropertychanged([callermembername] string propertyname = "") { onpropertychanged(true, propertyname); } protected void onpropertychanged(bool makedirty, [callermembername] string propertyname = "") { propertychanged(this, new propertychangedeventargs(propertyname)); if (makedirty) { isdirty = makedirty; } } then can use [required(errormessage = errormessages.descriptionrequired)] [stringlength(60, errormessage = errormessages.descriptionlength60)] public string description { { return description; } set { if (descr

php - unexpected endif line 34 don't know why -

parse error unexpected endif @ line don't know why <form name="contactform" method="post" action="check.php" class="form-horizontal" role="form"> <?php if(array_key_exists('errors', $_session)); ?> <div class="alert alert-danger"> <?php implode('<br>', $_session['errors']); ?> </div> <?php unset($_session['errors']); ?> <?php endif;?> change <?php if(array_key_exists('errors', $_session)); ?> to: <?php if(array_key_exists('errors', $_session)): ?> reference explanation: in code, putting semi-colon ; after if statement. it means closing if control structure, hence, endif below has no meaning. if put : , code between if , endif considered body

javascript - Cordova/Phonegap shake gesture detection not working on ios simulator -

Image
i testing out cordova plugin https://github.com/apache/cordova-plugin-device-motion/blob/master/doc/index.md i added plugin platform did: cordova plugin add org.apache.cordova.device-motion then testing both on ios simulator , android 3.2 , android 4.1 real devices, on ios simulator seems not working, while on real devices works great. is there limitation ios, or need know? or cause simulator can't emulate shake gesture? as see pic there shake gesture emulation command :( unfortunately don't have real iphone or ipad, knows if on real ios device plugin works same? my code simple: $ionicplatform.ready(function () { navigator.accelerometer.watchacceleration(function (acceleration) { console.log('acceleration x: ' + acceleration.x + '\n' + 'acceleration y: ' + acceleration.y + '\n' + 'acceleration z: ' + acceleration.z + '\n' + 'timestamp: ' +

allow other applications [3rd party] to access my asp.net website, user authentication -

i have website supports many kind of users based on roles. sales,customers etc. want make website accessible form other applications. if application want fetch or send data application should able grant them secure accessibility. please let me know how should go authentication part done. in advance. appreciated. the question broad i'm afraid can offer general guidance. common approach expose functionality api secured oauth. users must authenticate application bearer-token can provide along calls api identify , authorize request. if usinging asp.net suggest looking @ authentication , authorization in web api .

c++ - Searching a Hash Table Saved in a File -

i've written program has created hash table , saved file. supposed write second program allows user enter key, searches file key, , displays information stored in record matching key entered. my program has created hash table , has saved correct file, however, having trouble searching file. when enter key know in hash table, "this key not found" message. here code: my header file: //prog8.h #include <iostream> #include <fstream> #include <string> using namespace std; class hash { private: static const int hashsize = 8; struct record { int key; string name; int code; double cost; record* next; }; record* hashtable[hashsize]; public: hash(); int hash(int key); void addrecord(int key, string name, int code, double cost); int numinindex(int index); void saverecords(); void saverecordsinindex(int index); void findrecord(int key); }; my .cpp file containing defin