Posts

Showing posts from March, 2015

c# - Conditional Operator in F# (A?B:C) -

this question has answer here: does f# have ternary ?: operator? 4 answers in c#, have conditional operator: [condition] ? [value if true] : [value if false] but can't seem find in f#. exist? as found here answer is c# has ternary operator "?:" conditional expressions: condition ? trueval : falseval f# has same operator, name if-then-else: if condition trueval else falseval (note "if" used less in f# in c#; in f#, many conditionalexpressions done via pattern-matching rather if-then-else.) the website linked offers bunch of c# vs f# examples.

c# - VersionOne API Client not recognizing asset types? -

Image
i running problem versiononeapiclient in not recognize give ass asset type. understand attribute definitions don't make sense i've been trying pretty everything. end goal query teamrooms , team names teams in team room. it's understanding documentation on asset types , how query should work that's say. i using: c# asp.net, versiononeapiclient 15.0.0.0 strings have tried: teamroom task scope project public bool apigetteams() { iassettype teamroomtype = services.meta.getassettype("task"); query query = new query(teamroomtype); iattributedefinition teamattribute = teamroomtype.getattributedefinition("children:room.team.name"); query.selection.add(teamattribute); iattributedefinition scheduleattribute = teamroomtype.getattributedefinition("children:scope.room.schedule.name"); query.selection.add(scheduleattribute); query.find = new queryfind(schedulename, new attributeselection(scheduleattrib...

acl - Extracting file persmission data in Ansible -

i want build playbook check file permissions of files in directory , create report containing details using ansible. i tried using acl module purpose can't understand return list getting stored ? as examples acl module show: # obtain acl specific file - acl: name=/etc/foo.conf register: acl_info to @ results: - debug: var=acl_info that should started. debug task display full results of retrieved acl module.

jni - Hide GPS icon while GPS is on in android? -

i want hide gps icon permanently application user unknown gps enabled. want know if can using jni or other way in android? afaik, can't. this seems system-controlled function - so, have write own rom achieve goal.

html - Need menuitem on the right -

Image
i want logout link shown @ extreme right when other menuitems hidden. in fact showing in middle . how can force in right. <div class="nav-content container"> <div class="nav-wrapper"> <ul class="main-nav"> <asp:placeholder runat="server" id="hidenav"> <li runat="server" id="home" visible="false" class="hide"><asp:hyperlink id="homelink" runat="server"></asp:hyperlink></li> <li runat="server" id="reportclaim" visible="false" class="hide"><asp:hyperlink runat="server" navigateurl="/reportclaim.aspx" text="<span>report claim</span>" id="reportclaimlink"></asp:hyperlink></li> <li id=...

c++ - VS 2005 to VS 2012: do I need a cast now? -

ok, have been searching solution error day, kind of last hope. i have ported solution vs 2005 vs 2012 may make difference if settings or compiler have changed. i have typedef used in struct in template: typedef bool (__cdecl *tbreakpointer)(const double&, const double&); template <typename _t> struct s_optparameter { tbreakpointer pabortpointer; }; these lines give me error (line in switch statement '=' in it): optpara.nid = static_cast<unsigned int>(m_parameterlist->indexof(item)); optpara.nscale = item->scale; switch (item->abort) { case geneticaborttype::greater: optpara.pabortpointer = checkgreater; break; } checkgreater defined this: bool checkgreater(const double& nact, const double& nbreak) { return (nact > nbreak); } now error get: error c2440: '=' : cannot convert 'bool (__stdcall *)(const double &,const double &)' 'tbreakpointer' conversion requires reinterpre...

Run Scala Program with Spark on Hadoop -

i have create scala program search word in text file. create file scala eclipse , after compile , create jar sbt , sbt assembly.after run .jar spark in local , run correctly. want try run program using spark on hadoop, have 1 master , 2 work machine. have change code ? , command shell of master? have create bucket , have put text file in hadoop this code: import scala.io.source import org.apache.spark.sparkcontext import org.apache.spark.sparkcontext._ import org.apache.spark.sparkconf object wordcount { def main(args: array[string]) { // set spark context val conf = new sparkconf().setappname("wordcount").setmaster("local[*]") val sc = new sparkcontext(conf) val distfile = sc.textfile("bible.txt") print("enter word in holy bile: ") val word = console.readline var count = 0; var finalcount=0; println("you entered " + word) val input = sc.textfile("bible....

android - How to write a file on the internal storage next to the download folder? -

i not able write file internal storage of nexus 10, sits next folders "downloads", "movies", "music" , "pictures", directly inside root. i create own folder application in root directory , store log files inside. how that? thanks! mediascannerconnection.scanfile(getactivity(), new string[] { file.getabsolutepath().tostring() }, null, null); this code updates file tree on usb device , makes correctly created files visible.

Cordova inappbrowser doesn't open in new webview on Android -

i have problem cordova inappbrowser plugin (within ionic app, if relevant). i try open new webview url (for authentication purposes). should new webview, need loadstart event in original cordova-webapp. the following code works within ios expected, on android seems open url within same webview (and not in _blank, specified). miss something, or bug? var browserref = window.open(flatserverurl+'/tokenlogin?redirect=http://localhost/callback', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); browserref.addeventlistener('loadstart', function(event) { // url }); system info: cordova 4.3.0 com.ionic.keyboard 1.0.4 "keyboard" cordova-plugin-inappbrowser 1.0.1-dev "inappbrowser" org.apache.cordova.console 0.2.13 "console" org.apache.cordova.device 0.3.0 "device" tested on nexus 4 android 5.1.1 , 2 genymotion android emulators (4.4.4 , 5.0.1)

omnet++ - Why does Veins crash when commandSetSpeedMode() is used? -

i trying simulate scenario in veins want disable right of way checks @ road junctions. looked @ sumo wiki , found bitset 23 purpose. lookup in tracimobility.h header bundled veins helped me know can done using function commandsetspeedmode() tracidemo11p node models vehicles in veins demo simulation. trying build model using demo bundled veins. but trying so, sumo crashes. trying initialize nodes in initialize() function of tracidemo11p through following code: void tracidemo11p::initialize(int stage) { basewaveappllayer::initialize(stage); if (stage == 0) { traci = tracimobilityaccess().get(getparentmodule()); annotations = annotationmanageraccess().getifexists(); assert(annotations); traci->commandsetspeedmode(23); // point of modification sentmessage = false; lastdroveat = simtime(); findhost()->subscribe(parkingstatechangedsignal, this); isparking = false; sendwhileparking = par(...

Android: Managing different server URL for development and release -

i developing android application interacts server via rest apis. need use different url development , release builds. commenting , un-commenting code tedious , error pron. which best way handle situation? using different build types in gradle file 1 automate process, not sure if right way go. there possibility of increase in number of build types viz. test, internal-release etc. if using android studio, use buildconfigfield add custom fields buildconfig class. buildtypes { debug { buildconfigfield "string", "server_url", '"http://test.this-is-so-fake.com"' } release { buildconfigfield "string", "server_url", '"http://prod.this-is-so-fake.com"' } mezzanine.initwith(buildtypes.release) mezzanine { buildconfigfield "string", "server_url", '"http://stage.this-is-so-fake.com"'...

c++builder xe7 - Firemonkey style designer make TRectangle fill parent -

i trying add trectangle object firemonkey control in style designer give control background color. can add trectangle , size manually, style not work if control changes size in designer. there way can make trectangle automatically take size of it's parent control? please make sure property "trectangle.align" set "client"

php - jQuery.validator.addMethod check username -

i new php , jquery, have googled day couldn't solve problem. want check if username taken or not, got "username taken" no matter enter. here code: $(document).ready(function(){ $('#registration-form').validate({ rules: { username: { required: true, minlength: 3, maxlength: 25, letters: true, checkusername: true, }, password: { required: true, minlength: 6, maxlength: 12 }, confirmpassword: { required: true, minlength: 6, maxlength: 12, equalto: "#password" }, email: { required: true, email: true }, country:{ required: true, } }, highlight: function(element) { $(element).closest('.form-group').addclass('error'); ...

php - Facing issue while reusing mongo connection -

i have ' employees ' collection i'm creating new mongo connection using following code $mongoobject = db::connection('mongodb')->collection('employees'); //fetch employee employee id $employee = $mongoobject->where('employee_id', $input['employee_id'])->first(); //fetch employees $employees = $mongoobject->get(); now problem got first response when tried fetch employees using same mongo connection gives 1 record. per understanding it's not flushing conditions after use ->first() of eloquent. is there way reuse same mongo connection using eloquent methods? thanks. after calling first() limit being set 1 why returns 1 record. following code works:- $mongoobject = db::connection('mongodb')->collection('employees'); //fetch employee employee id $employee = $mongoobject->where('employee_id', $input['employee_id'])->first(); //fetch employees $employees = ...

php - Should the capistrano configuration files be checked in with git? -

i deploying wordpress site using capistrano 3 , git , i'm wondering if capistrano folder/files in /config /lib like /config/deploy.rb should checked in git? and checked out , copied server when deploying? or should add them in .gitignore , let every developer set capistrano themselfs. the files might contain sensitive information after all. you should check in that's general build/deploy mechanism. needs live somewhere . if not in main repository, maybe you'll set secondary project deploying project. since deploy routines can quite bit of complex code in themselves, need version-control files somewhere . application assumes architecture run on, , capistrano's job set architecture, makes sense keep both things in same repository. you should indeed not check in secrets , , perhaps not machine-specific configurations either. should created locally on deploying machine tailored specific target machine(s). have full power of ruby @ disposal, crea...

Rails / Rspec: How would I test #any? for Sidekiq? -

i have block: def already_syncing? sidekiq::queue.new(queue_name).any? { |q| q.args[0] == car_id } end how test this? if stub out this: allow(sidekiq::queue).to receive_message_chain(:new, :any?) { true } then condition in actual block not tested. i think looking and_yield : allow(sidekiq::queue).to receive_message_chain(:new, :any?).and_yield(<something>) here's sample code/specs (with values/method calls didn't know stubbed out) can try , change see fit: class synctest def already_syncing? sidekiq::queue.new(queue_name).any? { |q| q.args[0] == car_id } end private # values these methods below arbitrarily defined def queue_name 'test' end def car_id 1 end end rspec.describe synctest let(:sync_test) { described_class.new } describe '#already_syncing?' let(:queue) { double('queue') } let(:already_syncing) { sync_test.already_syncing? } before # don't have sidekiq ...

java - Cannot marshall type class without a custom marshaler or @DynamoDBDocument annotation -

error: com.amazonaws.services.dynamodbv2.datamodeling.dynamodbmappingexception: cannot marshall type class [ljava.lang.string; without custom marshaler or @dynamodbdocument annotation. i want store data dynamodb java spring mvc rest. making post request calls method load data amazon dynamodb. here code. restcontroller: @restcontroller public class questionresponsecontroller { @requestmapping(value="/loadquestiontabledata",method=requestmethod.post,produces={"application/json"}) public dynamodbmapper loadquestiontabledata() { return loadquestiontabledata.loadquestiontabledata(); } } this question.java (pojo question table in dynamodb): question.java import java.util.arrays; import com.amazonaws.services.dynamodbv2.datamodeling.dynamodbattribute; import com.amazonaws.services.dynamodbv2.datamodeling.dynamodbhashkey; import com.amazonaws.services.dynamodbv2.datamodeling.dynamodbtable; @dynamodbtable(tablename = "question") public class...

hadoop - What happens to orphaned Yarn Child processes? -

hadoop yarn launches instances of yarnchild in child vm execute actual tasks. tasks communicate applicationmaster (am) through umbilical interface. my question happens if dies , resource manager(rm) fails bring (say, due code defect in am)? in such case, children tasks (a) note absence of due heartbeat , then, (b) go rm new location, in case not get. so, happens these orphaned tasks? have scenario terminate them. default behavior , nodemanager (nm) terminate them? from hadoop -definitive guide, chapter 6, failures, failures in yarn after crash, new resource manager instance brought up(by admin), , recovers saved state. state consists of node managers in system, running applications. here tasks not part of resource managers state, managed application. also, said resource manager designed able recover crashes.

android - Avoid word wrap (and "...") in long tab titles using ViewPager Tab [landscape] -

Image
how avoid word wrap , incomplete tab titles ( 3 '...') in tabs using viewpager see screenshot below: update when set following in styles.xml: <style name="mytabtextstyle" parent="base.widget.appcompat.actionbar.tabtext"> <item name="android:maxlines">1</item> <item name="android:width">80dp</item> </style> it partly works when i not add logo in actionbarstyle: <style name="myactionbarstyle" parent="widget.appcompat.actionbar.solid"> update 2 - problem still exist logo this result, when use actionbarstyle add logo thank in advance the problem in width of tabtext widget: <item name="android:width">80dp</item> as see 80dp enough content, - it's not. should avoid using fixed width or height. instead can use wrap_content (wide or high enough fit content) , match_parent (match parent size exactly, possi...

javascript - check child check box by parent check box in jquery -

i trying check child check box parent check box in jquery. code work first time next stop working $(document).ready(function () { $("#append").delegate("#p0", "click", function () { if (this.checked == true) { $("#submenu0 input").attr('checked', true); } else { $("#submenu0 input").attr('checked', false); } }); html <div id="append" name="append" style="background-color: white;"> <input type="checkbox" id="p0" value="administrative boundary"> <div id="submenu0" class="a" style=" margin-left: 29px "> <input type="checkbox" id="pc00" value="kbjnl:district_boundary_2011" checked="checked">district boundary 2011 <br> </div> </div> you can use checked st...

mysql - Adding number to fetched array with php -

i have problem adding numbering fetched array on parsed xml output. got code website located here http://www.mightywebdeveloper.com/coding/mysql-to-xml-php/ <?php header('access-control-allow-origin: *'); $oid= $_get['oid']; //database configuration $config['mysql_host'] = "localhost"; $config['mysql_user'] = "thisisuser"; $config['mysql_pass'] = "thisispass"; $config['db_name'] = "mydb"; $config['table_name'] = "mail"; //connect host mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']); //select database @mysql_select_db($config['db_name']) or die( "unable select database"); $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; $root_element = $config['table_name']."s"; //fruits $xml .= "<$root_element>"; //sel...

python - Peak fitting with gaussian mixure model (Scikit); how to sample from a discrete pdf? -

Image
as far understood gaussian mixture model in scikit learn expects samples drawn distribution consisting of several gaussians. e.g astroml : they generate samples using gmm: from matplotlib import pyplot plt import numpy np sklearn.mixture import gmm np.random.seed(1) gmm = gmm(3, n_iter=1) gmm.means_ = np.array([[-1], [0], [3]]) gmm.covars_ = np.array([[1.5], [1], [0.5]]) ** 2 gmm.weights_ = np.array([0.3, 0.5, 0.2]) x = gmm.sample(1000) essentially, fit gaussian mixture model data (pseudocode): gmm(number of peaks).fit(x) x looks like: the histogramm of x: plt.hist(x, 30, normed=true, histtype='stepfilled', alpha=0.4) my data looks differently. not have samples drawn distribution. measuring device provides me discrete probability distribution (particle size): how convert discrete pdf ? i tried: from scipy import stats custm = stats.rv_discrete(name='custm', values=(x, y)) but custm.pmf(xk) not reproduce distribution. my data: x...

c - WalkingDead Program - Finding zombies and orphans -

for school paper need write program monitors processes in /proc directory , recording notices when processes become zombie or orphan. i know commands need use don't know how implement in program. there code finds in terminal either there zombie or there not. ps aux | awk '"[zz]" ~ $8 { printf("%s, pid = %d\n", $8, $2); }' there code creates zombie process: #include <unistd.h> #include <stdlib.h> #include <stdio.h> int main() { int pid; /* let's create child process */ pid = fork(); if (!pid) { /* child: dies , becomes zombie */ exit(0); } /* parent process: asks user input */ printf("please, press enter after looking @ zombie process..."); (void)getchar(); } i have code creates orphan won't put here. i don't need code program need explain or guide me step step need finish homework positive result. thanks help! just make loop executi...

Django WSGI deployment. cannot import name 'SimpleCookie' -

i trying deploy django site. runs in development server intended. when running python under cp virtual environment import succeds well. but under apache mod_wsgi folloing error log site: [wed jun 10 17:26:20.204238 2015] [:info] [pid 18376:tid 140307600816000] mod_wsgi (pid=18376): attach interpreter ''. [wed jun 10 17:26:47.476066 2015] [:info] [pid 18377:tid 140307470911232] [client 192.168.1.1:15841] mod_wsgi (pid=18377, process='', application='cp'): loading wsgi script '/var/www/django_projects/cp/mysite/wsgi.py'. [wed jun 10 17:26:47.575882 2015] [:error] [pid 18377:tid 140307470911232] [client 192.168.1.1:15841] mod_wsgi (pid=18377): target wsgi script '/var/www/django_projects/cp/mysite/wsgi.py' cannot loaded python module. [wed jun 10 17:26:47.575951 2015] [:error] [pid 18377:tid 140307470911232] [client 192.168.1.1:15841] mod_wsgi (pid=18377): exception occurred processing wsgi script '/var/www/django_projects/cp/mysite/wsgi...

c# - MVC returning entity with foreign key, again -

i'm trying return entity has foreign key , i'm bit stuck. trying populate dropdownlist results of 2 tables. there's foreign key relationship between itemtype , indicatortype tables. code is: public async task<pagedresults<itemtype>> getasync(int skip = 0, int take = -1) { pagedresults<itemtype> pagedresults; try { iqueryable<itemtype> query = _dbset.include("indicatordetails"); query = take == -1 ? query.orderby(i => i.indicatordetails.code) : query.orderby(i => i.indicatordetails.code); var data = await query.tolistasync(); pagedresults = new pagedresults<itemtype>(data, skip, take, data.count); } catch (exception e) { throw new exception(string.format("could not item types database. {0}", e.message), e); } return pagedresults; } i can work returning single row, because i'm passing in id can mat...

What is ^M in Git? -

this question has answer here: what these ^m's keep showing in files in emacs? 10 answers i'll edit line using ide (nusphere's phped), , return think original. git diff , however, shows being changed difference being ^m @ end. ^m signify? edit code doesn't show change? - <td></td> - <td><img […]></td> + <td></td>^m + <td><img […]></td> ^m something changed line endings unix style windows. ^m carriage return character. check tools settings carefully!

sql server - How to write a Sql query for retrieving one row from duplicate rows? -

Image
i have user table has many users users having same first name , last name 1 user have status active . requirement if user unique need user regardless of status if user duplicate need record having status active. how can achieve in sql server? sorry confusion here example of user table my result table should here steve jordan having 2 records need record having status 1 , records having distinct first name , last name need records regard less of status. note : have user id primary key joining on first name , last name because other table doesn't have user id. select userid, firstname, lastname, status ( select * , row_number() on (partition firstname, lastname order status desc) rownum [user] ) u u.rownum = 1 this groups first , last name, orders status active higher priority, , takes 1 of each unique first/last name combination. ensures each each unique first/last name combination in result set once, , if there multipl...

c++ - Right reference on lvalue -

when rvalue become right reference on lvalue? example following, , should solved std::forward : void g(int && v1, int & v2) { std::cout << v1 << " " << ++v2 << std::endl; } template <typename f, typename t1, typename t2> void flip(f f,t1 && t1, t2 && t2){ g(t2, t1); } error occurs on call this: flip(g, j, 2); my problem is: in flip(g, j 2) , third argument 2 rvalue. in function flip , argument t2 right reference on 2. when g called, seems t2 right reference lvalue . in point did rvalue, received reference (without copying?), became lvalue? here example: https://ideone.com/cjvfcg there's "if has name" rule saying within code this, if variable has name (in case, t2 ) @ point becomes lvalue. (see scott meyers effective modern c++ .) to preserve original intent of caller, indeed use perfect forwarding : g(std::forward<t2>(t2), ...)

javascript - JQuery, JSON and $.each - string not concatenating -

this question has answer here: how return response asynchronous call? 21 answers so, have function when called adds table within new row of existing table, complete results returned in json format restful api. code: $(".transactionviewbutton").each(function(){ var $this = $(this); $this.on("click", function(){ if($(this).closest("tr").next("tr").attr('id') != "itemsrow"){ var rowadd = "<tr id='itemsrow'><td colspan='8'><table class='table table-striped table-hover bureau-customer-table'><thead><tr><th>item id</th><th>item name</th><th>cost</th><th>fsm amount</th><th>end cost</th></tr></thead><tbody>"; $.getjson("transacti...

php - passing one variable from one page to another for pdf generation -

Image
i have page have used retrieve excel data written in php... using phpexcel... part provides me company information echo '<form action="final.php" method="post">'; echo "<table border='1'>"; ($rowcount = $rowcompanyinfostart; $rowcount <= $rowcompanyinfoend; $rowcount++) { //$data = $objworksheet->rangetoarray('a1:' . $maxcell['column'] . $maxcell['row']); $rangecoordinates = $colcompanyinfostart . $rowcount . ':' . $colcompanyinfoend . $rowcount; $rowdata = $sheet->rangetoarray($rangecoordinates, null, true, false); echo "<tr>"; $companyname=$worksheet->getcell($column.$row)->getvalue(); // echo $companyname; foreach($rowdata[0] $result) { echo "<td>...

iphone - fullcalendar.io: can't scroll on iOS after redrawing calendar -

i'm having issue changing view of fullcalendar freezes scrolling on ios devices. example, start loading calendar empty div. upon initial load, can scroll around on device (both ipad , iphone). however, once click basicweek basicmonth view, calendar renders, screen freezes. can still click links, trying scroll around page or calendar not work. has encountered similar or figured out how deal this? my fullcalendar initialization code: $('#simple-calendar').fullcalendar({ googlecalendarapikey: my_google_api_key, events: { googlecalendarid: 'en.usa#holiday@group.v.calendar.google.com' }, defaultview:'basicweek', header: { 'left': 'title', 'center': '', 'right': 'month,basicweek,basicday today prev,next' } }); i've tried using css , overflow scrolling, doesn't seem make difference. ...

oracle - Changing start date for system jobs related to automatic statistics collections in 11g -

i have oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production running on windows 2008 r2 somehow got next run dates scheduled jobs set dates in year 2016. jobs created able reset start_date in turn caused next_run_date reset. jobs related oracle automatic statistics collections unable dms_scheduler.set_attribute work changing start_date values. i tried resetting weekly window's dates per oracle document id 1450173.1 using sql following , did in fact reset values see within dba_scheduler_windows had no change dba_scheduler_jobs begin dbms_scheduler.set_attribute ( name => '"sys"."monday_window"', attribute => 'start_date', value => '10-jun-15 10.00.00.000000000 pm us/central'); end; / the job names seeing issue on are: rse$clean_recoverable_script ora$autotask_clean purge_log sm$clean_auto_split_merge bsln_maintain_stats_job mgmt_stats_config_job some of lack schedule names if try dbms_schedul...

c# - How would I link to an external site from a cell in a kendo grid? -

just title says. want have kendo grid column called link. column need dynamically generate link whatever address user puts it. don't need worry error checking ensure link valid, or that. i've done research, , i've found ways link other locations within same project. in example, i'd need set if user edits cell in link column "www.temporarysite.com", upon saving edit, grid create hyperlink site. i've tried using actionlink, doesn't seem fulfill purpose properly. thoughts? can provide code samples if necessary. edit: i'll include code below. appreciated! columns.bound(o => o.link).clienttemplate(@html.actionlink("#=link#", "#= myscript(#= link#)#").tohtmlstring()); the issue creates anchor tag, errors out "page not found". it's trying go " www.my site.com/www.google.com". here example based on kendo dojo <!doctype html> <html> <head> <meta charset=...

javascript - How to set a lot a class properties from an object with the same property names? -

i'm working in js , i've got following object lot of properties: var foo = { prop1: 123, prop2: 456, prop3: 789, ... propx: 321 } i want set class same properties. i can that: this.prop1 = foo.prop1 this.prop2 = foo.prop2 this.prop2 = foo.prop2 ... this.propx = foo.propx but i'm looking like: for(var property in foo) { this.[property] = foo[property] } do know if it's possible kind of behavior in js? i'd set class properties single loop for. check if this has property , assign foo for(var property in foo) { if(this.hasownproperty(property)) { this[property] = foo[property]; } } or better way loop keys in this , not need if statement.

mysql - How to index documents with their metadata in a DB using Solr 5.1.0 -

i'm using apache solr index documents search engine. these documents stored locally on file system. in order faceted search have include these documents meta-data stored in mysql db. is there way simultaneously index these documents in file system while attaching/indexing corresponding metadata db faceted search? if not alternative? in advance i'm not saying drew's answer incorrect i've found there more direct way solve problem. after couple of days of searching , posting on lucene forums able come pretty comprehensive answer question. if want index database , file system , have them submit 1 comprehensive document file , metadata there 2 ways go it. 1 better other. the first way configure dataimporthandler, or dih. involves changing solrconfig.xml enable use of dih , need create new .xml file in conf directory of core using. enables to 1) tap multiple datasources 2) use data database find file in filesystem. ie in case filepath. this link confi...

objective c - Change screen when iOS app is brought to foreground -

i have ios app (written in objective-c) which, when running in background, perform background task detect if moving greater 5mph. if has occurred (travelled > 5mph), specific screen (screen123) displayed when app brought foreground. this works when app brought foreground briefly see last screen had been viewed previous use of app (for 1 second) before screen123 displayed. there way have app running in background , when brought foreground display screen123 (without previous screen displaying)? the code causes screen123 displayed within applicationwillenterforeground in appdelegate. ios uses snapshot of last state, hide transition delay app. seeing this. read "prepare have app’s picture taken" in "strategies handling app state transitions" apple. you going struggle rid of entirely. should think way smooth transition. maybe have screen contains content doesn't change, , fade "< 5mph" or "> 5mph" content onto sc...

tcl - how to install Expect for windows using ActiveTCL 8.6 x86 -

i'm trying install expect windows using activetcl , i'm having helluva time. understand need use teacup/teapot? there documentation @ all? i'm trying run teacup , says "can't create directory" on network drive, it's trying install in random directory can't seem change.. i've spent day trying figure out how install, thought be, simple program... run command "teacup install except" in prompt. can type "teacup help" find more information.

Deezer Javascript SDK pause() method doesn't work on iOS -

the deezer javascript sdk dz.player.pause() method doesn't seem work on ios, pause button in deezer's inapp demo application doesn't anything. going fixed soon? in meantime, there workaround achieve same thing? instance, tried starting play invalid album, had no effect. this bug fixed in application version published in 3 weeks.

.net - Given the name of an excel cell, how can i find its value? -

Image
so in excel, can assign cells names avoid using row , column numbers. in case, useful because i'm dealing several excel sheets , not know particular cell be. how can value of cell? i'm looping through entire worksheet looking it, stumbled across online, speed application considerably. if found posts online suggest either xlworksheet.cells("cellname").value or xlworksheet.getcell("cellname").value . unfortunately cells method not accept string argument , getcell method not exist. i'm using interop library. thank in advance. edit: range("myname") 1 way, if you're in vba, shortest way value of range use evaluate function shorthand: [myname] return named range called myname or powershell (which uses com .net): $excel.evaluate("myname").value() original answer: have tried worksheet.names , workbook.names thisworkbook.names("myname").referstorange.value proof works through com automation / vs...

Calling child constructor interlaced in parent constructor in java -

i have lots of children base class , plan adding lot more. i'm lazy. child creator sets basic things needed super constructor , vice versa. simple solution problem following: parent { public parent(){/*some code*/} public void finalsetup(){/*code dependent on fact child constructor has run*/} } child{ public child(){/*some code;*/ super.finalsetup();} } how ever, calling super.finalsetup() on every child quite hassle, , if forget on 1 it'll break. that's no good. question simple: there way set form parent. far google skills go haven't been able find one. guys know don't. thanks this should want, mentioned, can not best idea . don't need explicitly call parent constructor in subclass if have no-argument constructor in superclass. abstract class parent { parent() { /*some code*/ childinit(); finalsetup(); } void finalsetup() {/*code dependent on fact child constructor has run*/} abstract void c...

android - App Engine Backend with Google Cloud Messaging connection fails building release version with proguard -

i have android app using gcm , app backend in google app engine. works fine in debug mode. in intentservice "registrationintentservice" token calling instanceid instanceid = instanceid.getinstance(this); string token = instanceid.gettoken(sender_id, googlecloudmessaging.instance_id_scope, null); sendregistrationtoserver(token);//send app engine and pass app engine backend with private void sendregistrationtoserver(string token) { // if (regservice == null) { registration.builder builder = new registration.builder(androidhttp.newcompatibletransport(), new androidjsonfactory(), null) .setrooturl("https://android-app-backend.appspot.com/_ah/api/"); //where android-app-backend corresponds own project id regservice = builder.build(); } try { regservice.register(token).execute(); } catch (ioexception e) { e.printstacktrace(); } } it works ...

Group objects if multiple attributes are same in python -

def class objclass: attr1; attr2; attr3; attr4; attr5; def __init__(self): print("some logic goes here") in .py file obj1 = obj.objclass(); obj1.attr1 = foo obj1.attr2 = bar (..... on , forth) objlist = [] objlist.append(obj1) objlist.append(obj2) objlist.append(obj3) objlist.append(obj4) objlist.append(obj5) now objects there in list, want group ones have same attr1, attr2, attr3 different attr4 , attr5. how do this? what pythonic way of doing this. know how using lists not using objects. def grouper(objs, attr_name): group =[] obj in objs: if hasattr(obj, attr_name): group.append(obj) return group returns list of objects- attribute select equal value want.

lotus notes - validate edit box input text length on xPage -

when enable field length validation validates when submit form... <?xml version="1.0" encoding="utf-8"?> <xp:inputtext id="inputtext1"> <xp:this.validators> <xp:validatelength maximum="20" message="you can input max 20 characters"> </xp:validatelength> </xp:this.validators> </xp:inputtext> <xp:message id="message1" for="inputtext1"></xp:message> so how show error message once user typed in 21st character? assume need code csjs... add client side event handler "onkeyup" inputtext control: <xp:eventhandler event="onkeyup" submit="false"> <xp:this.script><![cdata[ thisevent.srcelement.value = thisevent.srcelement.value.substring(0, 20) ]]></xp:this.script> </xp:eventhandler> it shortens text max...

ios - How to adjust button width based on screen width in Quartz Designer for iPhone -

is there possibility adjust button width based on screen width in origami iphone, expression; for example: button.width = screen.width-50 i can't add current design image question due low reputation i tried solve on own below; add following patches patch library button patch rendering destination dimensions patch math patch then, link pixels wide on rendering destination dimensions first parameter on math patch modify second parameter on math patch required value (for example: 50) select - (minus) operator on math patch link output of math patch width on button patch