Posts

Showing posts from August, 2012

c# - VDProj directory has no write access after installation -

i have vdproj project use create setup program application. i've had install visual studio 2010 (on machine) allow me run this, has been removed vs2012.. annoying.. that's different thread. when end user installs program, creates files in c:\program files\mycompany\ folder, inherits security parent directory, has no write access user. the problem is, when program runs, creates log files, , software update if required. application requires write access directory. i'm guessing install software 'mydocuments' folder, or folder has write access, wondering if there's better way of doing this? when program needs write protected locations program files, can launch using shellexecute functionality , runas verb/operation. trigger consent dialog uac require administrator give permission elevation. annoying if happens often, when necessary.

laravel 500 internal server error -

i'm trying deploy laravel 4 app on 1and1 shared hosting, keep getting 500 internal server error. i have checked following: using php 5.4 mcrypt php extension installed chmod 777 /app/storage/ domain pointing /laravel/public/ i'm out of ideas now? one thing i've noticed if go /index.php/, "fatal error: require(): failed opening required" error. mean of paths wrong somewhere? doubt it, because app working fine locally. any amazing. thanks try running composer install after cloning repo. vendor directory in laravel .gitignore file default. edit: re-read follow-up comment , realized shouldn't attempt answer questions after midnight.

java - Reading, parsing and sorting data from a CSV file -

i need read in csv file, parse , sort value according these parameter: the top 10 selling products the top performing branches the worst performing branches the employee took sales here code far, advice on how sort it? import java.io.*; public class csv { public static void main(string[] args) throws ioexception { try (bufferedreader csvfile = new bufferedreader(new filereader("/k:/connexicawork/data/data.csv"))) { string[] dataarray = null; string data = csvfile.readline(); // read first line. while (data != null) { data = data.replace(",00", ".00"); dataarray = data.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)"); //split on comma if comma has zero, or number of quotes in ahead of it. (string item : dataarray) { system.out.print(dataarray[34] + " # "); } system.out.println(); // print data line.

sql - squeryl: how to use oneToMany relation for constructing queries -

i have liftweb application in use record/squeryl orm framework. here schema: object appschema extends schema { import org.squeryl.dsl.onetomanyrelation val groups = table[group]("groups") val domains = table[domain]("domains") val grouptodomains = onetomanyrelation(groups, domains). via((g, d) => g.id === d.groupid) } object group extends group metarecord[group] loggable { } class group extends record[group] keyedrecord[long] loggable { override def meta = group @column(name = "id") override val idfield = new longfield(this) val name = new stringfield(this, 700, "") @column(name = "date_added") val createdat = new datetimefield(this) lazy val domains: onetomany[domain] = appschema.grouptodomains.left(this) } object domain extends domain metarecord[domain] loggable { } class domain extends record[domain] keyedrecord[long] { override def meta = domain @column(name = "id") overri

php - Find days difference between two dates with range of thousands of year -

how can find days difference in php dates may 1/1/1 1/1/1000000. strtotime(), mktime(), date->diff() these function not helpful more limit of unix timestamp. as far know, datetime allows dates in periods of time. before unix. quite possibly fial on 1/1/10000000 needs testing. to difference, use diff $datetime1 = new datetime('2009-10-11'); $datetime2 = new datetime('2009-10-13'); $interval = $datetime1->diff($datetime2); echo $interval->format('%r%a days'); if diff doesn't work on ranges, try https://stackoverflow.com/a/676828/486780 .

Android adapter for a custom layout listview based on a class -

i have class looks this: public class vizita { public int icon; public string titlu; public string loc; public string idviz; public vizita(){ super(); } public vizita(int icon, string titlu, string loc, string idviz) { super(); this.icon = icon; this.titlu = titlu; this.loc = loc; this.idviz = idviz; } } i use asynctask retrieve json array php. works perfect simple layout of listview. want use more complex layout, designed 1 uses 4 values vizita.class above. not know how set adapter it, because way try it, gives me errors. of course trying in onpostexecute, this: public class myactivity extends activity { {...} jsonarray lststat; {...} public jsonarray liststatus() { jsonarray jdata=post.getserverdatax(url_connectx); return jdata; } class asyncpost extends asynctask< string, string, string > { vizita weather_data[]; .... pro

javascript - How can I know when there is a new line on a Wheel of Fortune Board? -

Image
i following code here in can play wheel of fortune-like game 1 person (more of test of javascript objects). my issue when screen small enough, lines not seem break correctly. for example: where circle is, have "blank" square. reason why have blank square when screen big enough, square serves space between words. is there way in code efficiently know if blank square @ end of line , not show it, , window gets resized, show accordingly? the thought had add window.onresize event measure how big words related how big playing space , decide based on fact, seems inefficient. this code creating game board (starts @ line 266 in my fiddle ): wheelgame.prototype.startround = function (round) { this.round = round; this.lettersinpuzzle = []; this.guessedarray = []; this.puzzlesolved = false; this.currentpuzzle = this.puzzles[this.round].touppercase(); this.currentpuzzlearray = this.currentpuzzle.split(""); var currentpuzzlearray

c# - DataGridView linked to DataTable with Combobox column based on enum -

having spent lot of yesterday searching on 1 have give up. i have datagridview linked datatable. 1 of columns enum , want show combobox column. i found link create drop down list options enum in datagridview has answer of using following... datagridviewcomboboxcolumn col = new datagridviewcomboboxcolumn(); col.name = "my enum column"; col.datasource = enum.getvalues(typeof(myenum)); col.valuetype = typeof(myenum); datagridview1.columns.add(col); i've tried when user creates new record, chooses option drop down (the correct options show) moves off field message "datagridviewcomboboxcel value not valid". i've found solutions in searching talk how trap error, nothing (thus hiding error) want solve not hide it. if user ok's message repeat 2 times. i've seen solutions loop through values in enum , create datatable containing int , string each one, using datatable datasource on combo. i've used datatable source combob

java - JNI FindClass can't find class which uses jar -

i'm working on project java functions must called c++ code using jni. i've tried simple java class, when i'm starting use .jar in java project jni's findclass function can't find class. i've done research , read classpath needed compiling .java file if uses libs, findclass returns null in case. here's basic structure of code javavmoption options[2]; jnienv *env; javavm *jvm; javavminitargs vm_args; long status; jclass cls; jmethodid mid; jint square; jboolean not; options[0].optionstring = "-djava.class.path=<path_to_my_java_class>"; options[1].optionstring = "-djava.library.path=<path_to_my_jar_file>"; memset(&vm_args, 0, sizeof(vm_args)); vm_args.version = jni_version_1_6; vm_args.noptions = 2; vm_args.options = options; status = jni_createjavavm(&jvm, (void**)&env, &vm_args); if (status != jni_err) { cls = env->findclass("package/classname"); //returns null while using jar i

javascript - Chrome Extensions Bloated Background Page -

is there technique break down or modularize background page in chrome extension? go on developing extension of javascript in background page , since it's long lasting running script of extension (the minority of javascript in popup.js , content scripts). wanted know developers - accept big background.js file? ideally "include" different js files containing data or objects , include them background.js not possible in javascript . any advice ? instead of specifying background script, can specify own background page, see http://developer.chrome.com/extensions/background_pages.html docs. such background page allows load number of scripts using regular script tags, or other techniques. when specify background script instead of background page, default background page (with 1 script tag pointing script) generated you. you script loaders requirejs. i'm developing extension using commonjs modules (i.e. style used in node.js) compiled browserify, combines

sql - Multiple joins to get the same lookup column for different values -

we have rather large sql query, rather poorly performing. 1 of problems (from analysing query plan) number of joins have. essentially have values in our data need on table.to value display user. problem have join on same table 4 times because there 4 different columns need same up. hopefully diagram might make clearer raw_event_data event_id, datetime_id, lookup_1, lookup_2, lookup_3, lookup_4 1, 2013-01-01_12:00, 1, 5, 3, 9 2, 2013-01-01_12:00, 121, 5, 8, 19 3, 2013-01-01_12:00, 11, 2, 3, 32 4, 2013-01-01_12:00, 15, 2, 1, 0 lookup_table lookup_id, lookup_desc 1, desc1 2, desc2 3, desc3 ... our query looks this select raw.event_id, raw.datetime_id, lookup1.lookup_desc, lookup2.lookup_desc, lookup3.lookup_desc, lookup4.lookup_desc, raw_event_data ra

quickbooks - QBXML InvoiceAddRq and Taxes -

i'm having issue trying tax applied invoice qbxml. i'm using salestaxcoderef in invoicelineadd doesn't seem it's working whatever reason. same code worked salesreceiptaddrq. missing flag or something? <?xml version="1.0" encoding="utf-8"?> <?qbxml version="11.0"?><qbxml> <qbxmlmsgsrq onerror="stoponerror"> <invoiceaddrq requestid="c16d1753af62163f3891551c07a1eed493bb291a"> <invoiceadd> <customerref> <fullname>customers fullname</fullname> </customerref> <templateref> <fullname>default template</fullname> </templateref> <txndate>2013-07-31</txndate> <refnumber>12324</refnumber> <billaddress> <addr1>customers fullname</addr1> <addr2>123 test dr</addr2> <addr3></addr3> <city>customer city</city>

mysql - RDBMS vs NoSQL for CRM, CMS and other financial Systems -

i've read whole sql vs nosql stuff out there in internet (spent few days on have rights call way :) ) , still have feeling i'm far away being able decide wich platform our products shall go with. we're start designing new set of products fit crm/cms categories, i'd several b2b, b2c, b2e, e-commerce other financial , banking apps. it's gonna complex system dozens of databases solving different tasks. let's concentrate on db area. found this article particularly interesting db systems in world of enterprise. actual problem is: is better stay old rdbms such mysql (yes, has open-source, that's requirement) or start off nosql such mongodb/couchdb (i guess cassandra scalable crm, it's not going distributed , heavily clustered system. 4 strong guys job perfectly)??? as additional details can lot of media stuff , docs engaged in system, must stores, markets, hr systems. , consumers of storage web apps mainly. would better split db back-end 2 parts:

html - trying to align three images in twitter bootstrap 2.3.2 row/span -

i trying align 3 images centered in row, evenly. here fiddle of markup, http://jsfiddle.net/bkmorse/btcrk <div class="container" <div class="row" style="border:1px solid red;"> <div class="span12"> <a href="" class="share-icon facebook" title="share on facebook">share on facebook</a> <a href="" class="share-icon twitter" title="share on twitter">share on twitter</a> <a href="" class="share-icon email" title="share in email">send email</a> </div> </div> </div> a.share-icon { height:64px; display: inline-block; width:64px; text-decoration: none; text-indent: -10000px; font-size: 0px; line-height: 0px; } a.share-icon.facebook { background: #fff url('http://f.cl.ly/items/3f1o172z1o0824021f

Drupal 7: How to show the top rated nodes of the day/week/month? -

i'm building site in drupal seven. main purpose it's feeds 300 blogs, , show posts in organized way. i'm using feeds module, , i'm having no problem organizing content tags , categories. however, want show in main page x top rated posts of day/week/month, , don't have clue on how approach this. important top rated nodes have own rss feed, people can subscribe x bests posts. reading other related questions, guess showing top rated questions possible using view, don't know how translate (or export) view rss feed. maybe using short of taxonomy term? make sense? i'm new drupal, , don't have real programming skills, i'm wondering if relatively easy way approach this. any appreciated, thank in advance. ps. excuse poor english :( ps. found related questions: a drupal view show top rated node per day, each day year? create drupal view list of top voted nodes month there views display called feed . create views display display.

ruby on rails 3 - Can ActiveRecord use a proxy to access the database? -

i need access database requires whitelisted ips. in order have static ip using proximo addon on heroku. allows me use proxy outbound connections. can use proxy access database? searched on activerecord documentation couldnt find reference.

qt - QSqlQueryModel in a QML view causes items being shown twice -

thanks jay, problem seems not qml in database. so minimal erroneous code : qfile::remove("my.db.sqlite"); qsqldatabase db = qsqldatabase::adddatabase("qsqlite"); db.setdatabasename("my.db.sqlite"); db.open(); qsqlquery drop("drop table list;"); qsqlquery create("create table list (sample_text char(200));"); qsqlquery insert("insert list values (\"some message!\");"); drop.exec(); create.exec(); insert.exec(); db.close(); when inspecting my.db.sqlite, : sqlite> select * list; message! message! thanks! ------ old question ------- i in process of learning both qtsql , qml, there room errors. pretty whole problem in title of question. tried make short, self-contained code reproduce : c++ code : int main(int argc, char *argv[]) { qguiapplication app(argc, argv); qtquick2applicationviewer viewer; // uncomment after first launch, deleted test make code short // qfile::remove("my.db.sqli

mongodb - Mongo Map-Reduce - Top Venues By Users in a Radius -

i'm having issues mapreduce function - goal list of top venues, within lat/lng, group vid , ordered distinct user_id . here sample data set: { "_id" : objectid("51f9234feb97ff0700000046"), "checkin_id" : 39286249, "created_at" : isodate("2013-07-31t14:47:11z"), "loc" : { "lat" : 42.3672, "lon" : -86.2681 }, "icv" : 1, "ipv" : 1, "vid" : 348442, "user_id" : 151556, "bid" : 9346, "pid" : 549 } { "_id" : objectid("51f9234b488fff0700000006"), "checkin_id" : 39286247, "created_at" : isodate("2013-07-31t14:47:07z"), "loc" : { "lat" : 55.6721, "lon" : 12.5576 }, "icv" : 1, "ipv" : 1, "vid" : 3124, "user_id" : 472486, "bid" : 7983, "pid" : 2813 } ... here map function: map1 = function() { var te

Warbler does not package Java/JRuby gems? -

i have ruby on rails app want compile/package war file host in tomcat. i've added of relevant stuff can find, war appears include non-jruby versions of gems. result, gemnotfound exceptions such "could not find activerecord-jdbc-adapter" in tomcat. if open war file in 7-zip, not show of jruby or java gems under /web-inf/gems/gems. warbler not report errors or warnings, , war appears contain needs, except these gems. (because lightweight, internal app, i'm using sqlite now... explains sqlite gems. db stored outside project , configured in database.yml file.) the relevant snippet gemfile: if defined?(jruby_version) gem 'jdbc-sqlite3' gem 'activerecord-jdbc-adapter' gem 'activerecord-jdbcsqlite3-adapter' gem 'jruby-openssl' gem 'jruby-rack' else gem 'sqlite3' end i tried explicitly including/excluding these gems in warble.rb file: config.gems -= ["sqlite3"] config.gems += [ "

windows - Windbg ethread - IrpList location -

i'm struggling make sense of output windbg. what i'm trying find out how many irps (interrupt request packets) queued in particular thread, here have: lkd> !thread thread fffffa8001fce270 irp list: fffffa8001cf3b60 ... so tells me current thread has 1 irp in it's list, , it's address. however, next command what's confusing me slightly: lkd> ??@$thread->irplist struct _list_entry [ 0xfffffa8001cf3b80 - 0xfffffa8001cf3b80 ] +0x000 flink 0xfffffa8001cf3b80 _list_entry [ 0xfffffa8001fce658 - 0xfffffa8001fce658] +0x000 blink 0xfffffa8001cf3b80 _list_entry [ 0xfffffa8001fce658 - 0xfffffa8001fce658] all of information coming out of _ethread structure, , according windbg offset 'irplist' element in structure 0x3e8. so if thread (_ethread) starts @ offset 0xfffffa8001fce270, irplist element should @ offset 0xfffffa8001fce658 (0xfffffa8001fce270 + 0x3e8) however, don't understand why windbg reporting irp list entry @ offset

javascript - Display space characters in pre tag -

in visual studio , other code editors possible view white space characters. these appear small ellipses in line. is possible mimic feature in html. have been able use pre tag display text @ loss on how display white space characters. is possible via css or javascript show white space characters? you can wrap each space in pre elements in span background, spaces become visible, copy text usually. here jsfiddle example . example script (assuming there no nested tags in pre ): var pres = document.queryselectorall('pre'); (var = 0; < pres.length; i++) { pres[i].innerhtml = pres[i].innerhtml.replace(/ /g, '<span> </span>') } css: pre > span { display: inline-block; background: radial-gradient(circle, #cc0, rgba(192,192,0,0) 2px); } alternatively, can use custom font pre elements, in whitespace characters replaced visible.

python - Using Flask to emulate PHP page -

i'm writing flask+sqlalchemy app replace series of php scripts developed long time ago. 1 of scripts depends on number of keys being available on $_get variable, appname. these values sent external app cannot control. what best way capture key/value pairs set on $_get flask? all need examine request object. extract variable called "foo" request, run similar this: request.args.get('foo', ''); this return value of foo parameter, , if doesn't exist return default empty string (the second parameter get function). here relevant documentation: the request object

iphone - UITextView inside UITableViewCell -

according tutorial , had uitextview inside uitableviewcell . when uitableview has been loaded , want uitextview , uitableviewcell resize height. but did based on tutorial, uitextview can not display content , part of uitextview content still needed scroll display. here's code: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *contenttableidentify = @"contenttableidentify"; uitableviewcell *cell = nil; //uilabel *label = nil; uitextview *textview = nil; cell = [self.tableview dequeuereusablecellwithidentifier:contenttableidentify]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:contenttableidentify]; textview = [[uitextview alloc] initwithframe:cgrectzero]; [textview settextcolor:[uicolor blackcolor]]; [textview setfont:[uifont fontwithname:@"helvetica" size

c# - MVC @Html.Grid Column Height Adjustment -

i looking display small section of text otherwise large block act "context clues". able adjust width of column cannot figure out how adjust height, or amount of lines displayed. code below: @html.grid(model).columns(columns => { columns.add(model => model.name).titled("name").sanitized(false).encoded(false) .rendervalueas(model => @html.actionlink(model.name, "details", new { id = model.id })); columns.add(model => model.description).titled("description").sanitized(false).encoded(false).setwidth(350); columns.add().sanitized(false).encoded(false).setwidth(15) .rendervalueas(model => <a class=\"btn btn-mini\" href=\"/laborcategory/edit/" + model.id + "\"><i class=\"icon-pencil\"/></a>"); columns.add().sanitized(false).encoded(false).setwidth(15) .rendervalueas(model =>

php - Differentiate MYSQL Query for entries with similar numbers (17, 170, 171) -

i'm working on trying find id's within database. need find following: 17, ,17 ,17, making sure not find other id's start 17 (i.e. 170, 171, 173, etc). i've set following variables pull mysql query: $userid = '' . $row['userid'] . ',%'; $userid2 = '%,' . $row['userid'] . '%'; $userid3 = '' . $row['userid'] . '%'; but i'm finding i'm pulling in id 170. think happens whenever id 170 put @ end of string. can provide appreciate. here query i'm working with: "select formid, draft, activestatus forms notifyusers '$userid' , activestatus != '3' or notifyusers '$userid2' , activestatus != '3' or notifyusers '$userid3' , activestatus != '3'"; you use find_in_set function, this: select formid, draft, activestatus forms (find_in_set('17', notifyusers)>0 , activestatus != '3') or ..

java - Forcing server to wait because image haven't finished writing to disk -

i have website when user uploads pdf file, gets sent server, pdf rendering, , creates .png file display pdf preview thumbnail. the problem when .png created, write disk slower whole execution, causes image show on site error because tried access image isn't there (because code finished before write disk finished). i added thread.sleep(2000) after .png creation , seems fix problem. question is, situation thread.sleep(2000) best code use? don't know if code effect multiple users accessing site , uploading files. let's usera uploads file while userb browses normally. after usera uploads file, userb experience 2 second delay? is there better way me pause code execution in situation this? edit: added code. using pdf-renderer library: https://java.net/projects/pdf-renderer public static void convertpdftoimage () throws ioexception { randomaccessfile raf = new randomaccessfile (new file (rep.pathsamplepdf), "r"); filechannel fc = raf.getchannel

knockout.js - Showing and hiding items based on a parent's value -

example jsfiddle i have array of questions in model, following attributes: id : simple enough, id of question text : again, text question parents : array of question ids question dependent on activators : array of strings when parent's answer 1 of these values - question shown answer : answer question visible : boolean dictating whether question should visible on form i'm using ko.mapping bind json string (of i'm retrieving asmx web method) view model. i have bunch of primary questions have no parents or activators these should visible, bunch of dependent questions depend on respective parent(s) having value before dependent visible. can extend far depdendents being dependent on dependents (if see mean). my initial thought (as i'm getting there knockout.js) subscribe answer property of question , grab sub-set of questions depend on 1 answered. have @ value, compare them activators , show / hide necessary. viewmodel.questions().foreach(fun

ceiling - Can I use math ceil with input string in Java? -

is possible make output in java? using looped statements while asking input grades each student use ceiling identify has highest grade. student number grades student 1 _ student 2 student 3 student 4 student 5 student 6 student 7 student 8 student 9 student 10 the student highest grade is: (e.g) student 8 yes, can use loop: scanner scan = new scanner(system.in); double max = -1; // grades can't negative int maxstudent = 0; double[] grades = new double[10]; (int = 1; < grades.length; i++) { system.out.println("please enter grade student "+i); grades[i] = scan.nextdouble(); if (grades[i] > max) { max = grades[i] maxstudent = i; } }

jquery - changing colour of parent element of unchecked checkbox -

i'm using jqgrid , have many checkboxes there, value puller database: <td role="gridcell" style="text-align:center;" title="" aria-describedby="schedule_1st draft ?"> <input type="checkbox" value="0" offval="no" disabled="disabled"></td> <td role="gridcell" style="text-align:center;" title="" aria-describedby="schedule_art work ?"> <input type="checkbox" value="0" offval="no" disabled="disabled"></td> <td role="gridcell" style="text-align:center;" title="" aria-describedby="schedule_on sys ?"> <input type="checkbox" checked="checked" value="1" offval="no" disabled="disabled"></td> after grid loaded, want change background colour of cells checkboxes of unchecked. i

python - How do I do Excel-style "Calculated fields" (including subtotals) in a pandas pivot_table? -

Image
so, have army of salvation-army-style bell-ringing santas collecting money on streets in days leading xmas. data looks like: day am/pm santa donors revenue 12/22/2012 candi 92 $762.56 12/22/2012 bronson 3 $13.06 12/22/2012 pm candi 41 $68.97 12/23/2012 aloysius 45 $905.53 12/21/2012 pm aloysius 89 $704.80 12/24/2012 pm aloysius 64 $227.87 12/23/2012 candi 54 $223.57 12/23/2012 bronson 36 $212.99 ...etc. what's pandas code make equivalent pivot_table this? (note 1. summing of "am/pm" field 2. calculated field "avg. donation" , 3. subtotals.) (is possible want use besides pivot_table?)

active directory - Powershell TestPath and GetADuser Issues based off current location -

i'm having issues set of scripts writing create new active directory users. @ point i'm trying test if prospective account name in use, along whether folder same name exists. below example of i'm using: $usernametocheck = 'ttesterson' $samtest = $null $samtest = get-aduser -filter {samaccountname -eq $usernametocheck} -server xx-dc.domain.ca $pathtotest = '\\fileserver\users$\' + $usernametocheck $foldertest = test-path $pathtotest if( ($samtest -eq $null) -and ($foldertest -eq $false) ) {#set flag here , stuff} here's problem, when run script, can't target specific server (the -server parameter) unless i've set current location ad: similarly, can't test-path work unless i'm not set in ad: able explain why happening, , apart setting location , forth between two? thanks. (edited change double quotes single quotes on file path) if don't have explicit drive in path (which don't since it's unc), powershell

How to add android to cordova platform? PATH error? -

i trying add android cordova platform can build apps phonegap. when tried add android thus: $ cordova platform add android i received error message: [error: command android failed. make sure have latest android sdk installed, , android command (inside tools/ folder) added path. output: /bin/sh: android: command not found ] i have latest android sdk installed, suppose need add android path. i've googled on how that, , searched forum, have little knowledge of command line use , don't understand answers. if provide simple steps add android path, grateful. there's step-by-step instructions on phonegap doc's. check out here , , go step 3b . linked 2.8 version of phonegap since quick doesn't seem explain how set path on 3.0 version docs.

bluetooth - how to get the data on Samsung bluetooth4.0 with Android4.2 -

i had developed ios write/read data le device . need build android app write , data same le device. i connected le device,but show status code 6 or 129 when write data remote device. , never invoke onchar...change() callback. so , advise how can data le device. ps: using s4 ,android4.2.2, samsung ble 2.0 sdk.

c# - Nservice bus sagas implemetation -

i have nservice bus project which call connector. connector receives variouis kinds of messages example clientchangemessage, clientcontactchangemessage. connector has not implemented saga have handler each message clientchangemessage have clientchangemessagehandler gets fired when connector receives clientchangemessage , clientcontactchangemessagehandler when receive clientcontactchangemessage. now while looking @ sagas implementation found myself writing following code (if client contact message comes before clientchange message i.e client not exist in database): public class clientcontactchangemessagehandler : clientmessagehandler, ihandlemessages<clientcontactchangemessage>, iamstartedbymessages<clientcontactchangemessage>, ihandlemessages<clientchangemessage> { [setterproperty] public iclientcontactchangedb clientcontactchangedb{get;set;} [setterproperty] public ibusreftranslator busreftranslator{get;set;} static client

algorithm - Why JavaScript selection sort hangs -

i have following code: var longlorem = "..."; // here string, > 1 000 000 length var buffersize = 1000000; var lorem = longlorem.substring(0, buffersize - 1).split(''); var swap; var i, j; for(i=0;i<buffersize;i++){ for(j=i+1;j<buffersize;j++){ if(lorem[i] > lorem[j]){ swap = lorem[i]; lorem[i] = lorem[j]; lorem[j] = swap; } } } why hangs under chrome? how speed javascript or not possible dom , ui, etc.? with buffersize=100 000 completes in 2m 35s. the following c program completes in >17m #include <stdio.h> #define buffersize 1000000 int main( int argc, char *argv[] ) { int i,j; char swap; file *loremfile = fopen("lorem.txt", "r"); char buff[buffersize]; fgets(buff, buffersize, (file*)loremfile); fclose(loremfile); //printf("'%s'\n-----end--------\n", buff ); for(i=0; i<buffersize-1;i++) { for(j=i+1;j<buffersize

html - Drop down list with foreach loop PHP -

i'm trying make drop down list php using foreach loop loop through data. works without drop down when displaying results in table loop work. it seems drop down list gets populated (as list expands/contracts when i've added new fields in testing) no data shown. need show 1 field, though. here's code: <select name="language_select"> <?php foreach($this->getcontent('languages') $language => $value) : ?> <option value="<?($language['name']);?>"></option> <?php endforeach ?> </select> so fetches array , tries return data, pretty simple. doing wrong? i'm not sure of composition return of $this->getcontent('languages') think need. <select name="language_select"> <?php foreach($this->getcontent('languages') $language) : ?> <option value="<?= urlencode($language['name&#

php - Adding a new hard drive to xampp -

i running xampp intranet server using 'virtualhost' 15 'sites' inside our network , things working fine 3 exceptions. first problem biggest-my 2tb drive full , need add drive server call data - how can this? here 2 virtual domains vhosts file - 3rd example need accomplish. <virtualhost 172.16.106.162:80> servername clubcal.iserver serveralias www.clubcal.iserver documentroot "f:/xampp/htdocs/clubcal" </virtualhost> <virtualhost 172.16.106.163:80> servername digiport.iserver serveralias www.digiport.iserver documentroot "f:/xampp/htdocs/digiport" </virtualhost> this example of need do: <virtualhost 172.16.106.164:80> servername tzone.iserver serveralias www.tzone.iserver documentroot "g:/public_html/tzone" </virtualhost> this xampp server separate windows7 (64bit) system in our network windows active directory resolving dns issues inside our vlan (i downg

c# - not all paths return a value in anonymous method -

i trying create method checks if number abundant (the sum of proper divisors greater number itself), error @ 1.toinc(28123, 1) line of code says: "not code paths return value in anonymous method of type system.func<int,bool> ". believe referring isabundant method. in isabundant doesn't return value? public void solve () { //check if number abundant -> number < sum of proper divisors. memoize func<int, bool> isabundant = x => { return x < properdivisors (x).select(x => x).sum () && x >= 0; }; isabundant = isabundant.memoize (); //make sequence of these numbers readability var seq = 12.toinc (28123, 1).takewhile (x => isabundant (x)); // take numbers between 13 , 28123 take while (from 12 number / 2 sequence) check if number - item sequence isn't abundant 1.toinc (28123, 1).takewhile (x => { foreach (var in seq){

android - getAssets NullPointerException XML from Assets -

before ask question i'll point out brand new android programming. so, i'm trying parse data xml file in assets folder , place data in custom listview. i've been looking around how parse files correctly , how not nullpointerexception few days now. if real problem here attempted code terrible that's possible solution. any part of incompetence appreciated. code: public class z_pullmain extends listactivity { assetmanager manager = getassets(); private listview lv; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_specials_weekday_list); lv = (listview) findviewbyid(android.r.id.list); context context=getapplicationcontext(); arraylist<hashmap<string, string>> listofspec = new arraylist<hashmap<string, string>>(); string lowercaseday = ((globalvariables) getapplication()).getlowercaseday(); hashmap<string, string> specmap =

vba - How can I select (or copy) text from a Word 2010 ActiveX label? -

Image
a word 2010 document has activex label displays text. there way make text selectable, or otherwise copy-able, user's point of view, can paste somewhere else? use case: give form someone, fill out , return me. element in question label which, when double clicked, produces userform1 has listbox on it. once 1 or more selections made , user presses ok on userform1, label in word doc gets updated. receive form back, , want right click label, copy text, , paste email. you can't, @ least end-user's point of view. let me explain. i started out wanting achieve label, found couldn't copy text displayed there using conventional ctrl-c or right-click > copy. so, switched textbox. worked somewhat, , data displayed, though 1 flaw: word 2010 seems put bunch of unselectable space between last line in textbox , bottom of textbox, making contents hidden until scrolled top of it. here's looked like: notice empty, unselectable space below last item in list?

html5 - Parent container not expanding to child elements -

i have bunch of vertically aligned tab items in , can't seem parent container (the <a href...> in html) expand cover child elements. i've tried using <br style="clear: both"> , overflow: hidden; but first didn't , second cut off (using auto added scroll bar, doesn't help) thoughts on how fix it? html sample: <li class="active"> <a href="#pane1a" data-toggle="tab"> <div class="preview-box"> <img class="preview-image" src="img/monestary_floorplan.png"> <p id="previewcarousel1a"></p> </div> </a> </li&

c++ - How To Make Window Look More Modern -

i have created simple window using win32 api c++. window shows fine, however, there no styling , buttons , such on window appear in windows 95/me style oppose modern windows 7 look. so, how can modern look? i have tried using xml ways stated in ( http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx ) microsoft documentation program not compile. believe because using mingw compiler oppose vc++ compiler wrong. in addition, trying setwindowtheme function unsure how works , how include. some notes may causing issue: i not using ide, makefile i using mingw compiler the manifest file must incorporated resource in executable. that's vs automatically you; possible mingw too, it's little more convoluted. take @ this tutorial , in section "enabling visual styles". although tutorial shows winxp look, don't worry; once visual styles enabled, they'll show native theme of machine.

javascript - JQGrid not working at all in IE8 -

the following code works fine in ie9, ie10, firefox, , chrome, not in ie8 (i testing using ie10 in ie8 mode). grid doesn't show @ all, it's if nothing there. $(document).ready(function () { $("#grid").jqgrid({ url: "/forms/getdata", datatype: 'json', mtype: 'get', height: 'auto', width: 950, colnames: ['id', 'date', 'lem number', 'job number', 'job phase', 'foreman', 'approved', 'signed', 'billed'], colmodel: [ { name: 'id', index: 'id', width: 55, hidden: true }, { name: 'date', index: 'date', width: 80, sorttype: 'date', formatter: 'date', formatoptions: { newformat: 'm/d/y' }, search: true, searchoptions: { datainit: function(el) { $(el).daterangepicker({ dateformat: 'yy/mm/dd' }); } } }, { name: 'lemnumber', index: 'lemnumber',

c# - Static constructor overloading? -

i reading eric's blog series on static constructor , thought came in mind instance constructors can overloaded,why static constructor cannot overloaded? reason behind not providing same ? because can never invoke static constructor directly; it's done implicitly runtime. therefore, can't pass parameters static constructor; therefore, possible static constructor 1 default parameters.

javascript - AngularJS $http and how to get error response -

i see following example calling server-side resource: usersession.prototype.$save = function() { return $http.post('/users/sign_in', { "user" : { "email" : this.email, "password" : this.password, "remember_me" : this.remember_me ? 1 : 0 } }); }; my question is, possible see actual error response in code in event call fails? how above written that? you missed callbacks usersession.prototype.$save = function() { return $http.post('/users/sign_in', { "user" : { "email" : this.email, "password" : this.password, "remember_me" : this.remember_me ? 1 : 0 } }) .success(function (data, status, headers, config) { // success logic here }) .error(function (data, status, headers, config) { // error logic here }); };

Python Pandas merge only certain columns -

is possible merge columns? have dataframe df1 columns x, y, z, , df2 columns x, ,b, c, d, e, f, etc. i want merge 2 dataframes on x, want merge columns df2.a, df2.b - not entire dataframe. the result dataframe x, y, z, a, b. i merge delete unwanted columns, seems there better method. you merge sub-dataframe (with columns): df2[list('xab')] # df2 columns x, a, , b df1.merge(df2[list('xab')])

javascript - Looping through numbered html tag id's -

i'm having issue not able loop through id's of multiple canvas tags have created edit various pixel data. canvases have id's ranging 0 - n. when id's created, numbers turned strings. so, if create loop iterates through numbers correspond id's of tags, how make .getelementbyid(); method recognize number value string value? (this might little unclear code should clear things up) for (var = 0; < 3; i++) { var usegetimagedata = function(i){ var canvas=document.getelementbyid(i); var context=canvas.getcontext("2d"); var imagedata = context.getimagedata(0,0,canvas.width,canvas.height); var data = imagedata.data; } } the canvas id's are; "0", "1", "2" try this. weren't calling function (which bad create inside loop anyhow). var usegetimagedata = function(i){ var canvas=document.getelementbyid(i); var context=canvas.getcontext("2d"); var imagedata = context.get