Posts

Showing posts from May, 2010

php - Output (echo?) direct children of parent custom taxonomy in a loop -

i'm trying output 1st child level (not parent or grandchildren) custom taxonomies in loop of sort, can add custom fields / thumbnails it. i created hierarchical custom post type called 'product-type' and there few levels of custom taxonomies it. level 1 - snacks level 2 - chocolates (just showing 1 example) level 3 - milk chocolates, dark chocolates ..and on. on parent taxonomy page, i've been able list existing level 2 taxonomies following code: <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); if ($term->parent == 0) { wp_list_categories('taxonomy=product-type&depth=1&show_count=0 &title_li=&child_of=' . $term->term_id); } else { wp_list_categories('taxonomy=product-type&show_count=0 &title_li=&child_of=' . $term->parent); } ?> the output looks this: <li class="cat-item cat-item-7"> <a href="......

Get reference to jar assembly path in sbt -

i'm using sbt-izpack build installer. looks there's bug variable package file name isn't being referenced properly. i'm looking pass in variable main jar packaged so: variables in izpack += ("artifactname", artifactfilename.value ) the thing can't figure out how path string of main artifact. docs can map on package , (artifact, file) pair so: val artifactfilename = settingkey[string]("my task.") artifactfilename := { val (art, file) = packagedartifact.in(compile, packagebin).value println("artifact definition: " + art) println("packaged file: " + file.getabsolutepath) file.getabsolutepath } but sbt complains a setting cannot depend on task . is there way can somehow path of main assembly without needing generate first (in task) can pass in via setting? alternatively, there someway update setting supplied izpack in task? it looks answer in documentation, it's not obvious because it...

ios - UICollectionViewFlowLayout: Cells with different widths, but same interitem spacing -

Image
i have uicollectionview uicollectionviewflowlayout , cells have different widths. want cells float left , have same spacing between them. don't care if there white spacing on right of every row. ideas? thanks! thank much! you have implement custom uicollectionviewflowlayout, , override method: - (nsarray *)layoutattributesforelementsinrect:(cgrect)rect similar question has been asked here: left align cells in uicollectionview

tfs - CodeLens only showing references? -

Image
i installed visual studio 2015 enterprise rtm , seeing "references" code lens. using tfs source control. expect see related commits tfs. based on article , have enabled in options: here see in vs: is there wrong vs setup? the tfvc lenses part of codelens work when connected version of team foundation server running background job generates historical data. means need running @ least tfs 2013 or 2015 in order feature work. features require specific version of visual studio . it possible server admin has disabled indexing on server , 1 can using tfsconfig codeindex command on application tier.

javascript - Parse background job - Parse.Query.each() promise behavior -

thanks stopping help! i have background job have rewrite using parse.query.each(), have several thousand objects, , number continue grow on product's life cycle. here's link parse.query.each()'s documentation. i have query through 2 different sets of objects 2 custom classes, , depending on data, modify array of objects of third custom class. trying use promises perform both queries save array of objects. however, first query returns error, , trying access error message throwing error since says error undefined. unable debug code, can't relevant error message figure out why first query not succeeding. here's code setup, i'm trying use promises in conjunction query.each: //set queries query1.each ( function( object1 ) { {//do stuff modifying arrayofobject3s} } ).then ( function( results ) { return query2.each ( function( object2 ) {//do more stuff modifying arrayofobject3s} )...

hibernate - How to revert cached entity object to last persisted state? -

i have relatively run of mill mvc scenario view ( jsf ) loads list of managed entities in ejb via managed bean using namedquery defined in entity class. each entity modifiable in view, collection of represented primefaces component p:accordionpanel . in each tab of panel form allows updates corresponding entity: jsf: <p:accordionpanel id="entityaccordion" value="#{managedbean.entitylist}" var="entity" multiple="false" dynamic="true" cache="true"> managed bean: public list<appeal> getentitylist() { //this loads entities db return manager.getentitylist(this.parentid) } when user changes form values in view, ajax automatically updates cached entity in managed bean. commision of new values, however, triggered hitting submit button in form. between first form change , submission, state of cached entity object different corresponding db row. need implement reversion of db state for...

database - Not able to create a table in netezza -

i new netezza , i have physical machine installed ubuntu 14.04. in ubuntu 14.04, have installed vmware player , on top of created netezza virtual host. the above process successful , able login netezza. used below commands connect netezza. command 1: nzsql -u admin -pw password system.admin(admin)=> create database test; and able create database system.admin(admin)=>\c test the above steps worked when tried creating table using below test.admin(admin)=>create table users(name varchar(20)); it hangs without error or proceeding further: any appreciated. thanks when see state of "discovering" tells system trying boot , bring online spu vm, provides backed mpp processing. state normal few minutes in nzstart process, not if hangs there forever. when running netezza emulator may find in situation client vm represents spu in netezza host vm gets confused state. this happen me time time when hibernate vm. following process clears me. ...

java - Executing Random in Android App -

i beginner in android development , need display random string on user's screen. i have made array , got random string it, so how display string on user's screen? sorry, beginner , can't find anywhere. thank you. put textview in activity's layout: <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/mytextview"/> then in activity's oncreate method fetch , change text string: string mystring = "abc"; textview mytextview = (textview) findviewbyid(r.id.mytextview); mytextview.settext(mystring); if doesn't make sense @ all, should try reading this: https://developer.android.com/training/basics/firstapp/building-ui.html

c# - Why is my foreach printing out 2 char? -

i trying create encryption (ceasar) education , reason can't seem understand why simple code (so far) making such hazzle static void main(string[] args) { string word; int key = 0; console.writeline("write messages"); word = console.readline(); console.writeline("enter key cypher"); key =int.parse(console.readline()); encrypt(word, key); } static void encrypt(string message, int key) { foreach (char otherword in message) { console.write(otherword); console.read(); } } if write example test after "write messages" , place string word , use in function encrypt , should output t e s t but whatever god forsaken reason output t es t and dont understand why. you want use console.writeline(otherword); then. spacing of newlines in output dependent on key press after console.read(); line. (for example, if pre...

android - compile aosp failed and show errors with webrtc -

i'm trying compile , repo branches android-2.0_r1 | in: bionic bootable/bootloader/legacy bootable/recovery build cts dalvik development external/apache-http external/bison external/blktrace external/bsdiff external/bzip2 external/dhcpcd external/e2fsprogs external/elfutils external/emma external/esd external/expat external/fdlibm external/freetype ...

ios - Calling method after for loop is finished -

i have simple for loop adds objects nsmutablearray need utilize in method after loop finished. know how can detect when for loop "ready"? or [map addannotations:self.namelist]; won't called until loop running don't need care it? if (objects) { (pfobject *obj in objects) { [self.namelist addobject:obj[@"name"]]; } [map addannotations:self.namelist]; } most of executions sequential in nature, therefore loop completed first, [map addannotations: self.namelist]; method called. so don't need care it.

javascript - Dreamweaver CS6 - How do I stop slider on mouseover? -

below jquery code.. i'm wondering how , in code have enter function, when go on slider pause sliding.. , when move mouse out of slider, continues slide photos.. $(document).ready(function() { $('.photo').hover(function() { $(this) .find('.caption') .stop() .animate({ bottom: '0' }, { duration: 2000, easing: 'easeoutquart' }); }, function() { $(this) .find('.caption') .stop() .animate({ bottom: '-100px' }, { duration: 2000, easing: 'easeoutquart' }); var interval = setinterval(slideswitch, 2000); }); }); you can use jquery's hover() function shortcut: $(function() { var interval = setinterval( slideswitch, 10000 ); $('#slideshow').hover...

c# - SignalR and OwinContext = System.ObjectDisposedException -

i have asp.net application using signalr. when try call owincontext (in signalr hub), got system.objectdisposedexception. i use owincontext : context.request.gethttpcontext().getowincontext().getusermanager<applicationusermanager>(); here startup class: app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, authenticationmode = authenticationmode.active, provider = new cookieauthenticationprovider { onvalidateidentity = securitystampvalidator.onvalidateidentity<applicationusermanager, applicationuser>( validateinterval: timespan.fromminutes(30), regenerateidentity: (manager, user) => user.generateuseridentityasync(manager)) }, cookiename = "aspnetidentityauth", cookiedomain = configurationmanager.appsettings["cookiedom...

How to reduce number of parameters in go nested function calls -

i have go calltree structured follows: // state common struct shared among "instances" of mytype - simulating member variables interface (s mytype) run(state *state){ // called outside // define goroutines fetch via http httpcallback(){ // runs on every http response parsedata(record, outputchan) } } (s mytype) parsedata(rec []string, outputchan chan(interface{})){ // doesn't need "state" far doidmapping(string) } doidmapping(key) { return state.map[key] } is there way of getting access map (which constant) without being forced pass "state" through httpcallback , goroutines above end in calling httpcallback? this not bad clear code bad when comes testing. intermediate functions carry around struct pointer don't need depend on. did miss language design of go? :/ if of within single package can declare state @ package level , use everywhere. example; package myhttpclient import ( "allthatstuff...

java - how get entire retrieved tabled data into excel in jsp -

i'm using code row of table data entered file.. .i'm using mysql database. connection established in connection.jsp. tablename login. using poi-2.5.1.jar file. code working without error how entire table data excel sheet <%@page contenttype="text/html" pageencoding="utf-8"%> <!doctype html> <html> <%@page import="java.sql.*"%> <%@pageimport="java.util.*,java.io.*,javax.servlet.*,javax.servlet.http.*"%> <%@ page import="java.io.*"%> <%@include file="connection.jsp" %> <%@page import=" org.apache.poi.hssf.usermodel.*"%> <head> <meta httpequiv="contenttype"content="text/html;charset=utf-8"> <title>jsp page</title> </head> <% response.setcontenttype("application/xls"); ...

android - Is there a better way to block raycast using transparent Image in UGUI(Unity new UI)? -

like when showing popup dialog, i'm using image covers whole screen alpha set 0 raycasting won't go beyond dialog screen. , use tactic lot, somtimes there're 3-5 of transparent images covering screen , makes me worried performance. so i'd know if there's better way block raycasting in ugui ( except using canvas group's "interactable" property since it's big headache turn on/off ui's under dialog ) if trying block personal "on game"/physics raycasting try unityengine.eventsystems.eventsystem.current.ispointerovergameobject() it true when on ui element can test before shot raycast. don't know if works touch.

webjars - How to customize swagger-ui? -

i'm learning swagger, trying make little change , see if can reflected on index page. starting point index.html page, made copy of jar file : c:\swagger-ui\target\swagger-ui-2.1.0-m1\web-inf\lib\swagger-ui-2.1.8-m1.jar and saved new page index2.html, added line html content inside, , added above jar file. but i've noticed has .gz file original index.html file, don't know purpose, made file called index2.html.gz , added above jar file, run jetty server, , loaded index.html : http://localhost:8080/swagger-ui/webjars/swagger-ui/2.1.8-m1/index.html it showed alright, tried load : index2.html, couldn't find page, why ? should include show @ : http://localhost:8080/swagger-ui/webjars/swagger-ui/2.1.8-m1/index2.html the error message : http error 404 problem accessing /swagger-ui/webjars/swagger-ui/2.1.8-m1/index2.html. reason: not found what trying change in swagger-ui? have been messing around branding/customizing swagger myself. if take @ swagge...

javascript - Strategy for testing POST to API without changing database -

i'm using jasmine-node test api, , has worked great routes. now, however, need test posts , i'm not sure how go without changing database. one thought had reset whatever value change @ end of each spec. is reasonable or there better way go testing post requests api? wrap modifies database transaction. can have database changes , rollback after each test.

java - 500 internal server error with GWT Tomcat Apache -

i getting following error on tomcat apache server running gwt web application. 500 internal server error call failed on server; see server log details the server log contains: jul 22, 2015 8:05:51 org.apache.catalina.core.applicationcontext log severe: exception while dispatching incoming rpc call org.hibernate.assertionfailure: null id in com.simulconsult.test.shared.model.script entry (don't flush session after exception occurs) @ org.hibernate.event.def.defaultflushentityeventlistener.checkid(defaultflushentityeventlistener.java:82) @ org.hibernate.event.def.defaultflushentityeventlistener.getvalues(defaultflushentityeventlistener.java:190) @ org.hibernate.event.def.defaultflushentityeventlistener.onflushentity(defaultflushentityeventlistener.java:147) @ org.hibernate.event.def.abstractflushingeventlistener.flushentities(abstractflushingeventlistener.java:219) @ org.hibernate.event.def.abstractflushingeventlistener.flusheverythingtoexecutions(abstrac...

c# - leaving entity framework entity properties empty when they're not applicable -

i'm afraid might @ risk of being closed being opinion-based but... i have entity namespace rota.domain.entities { public class shift { [key] public int shiftid { get; set; } [required] [stringlength(50)] public string name { get; set; } public string starttime { get; set; } public string endtime { get; set; } public timespan shiftlength { { return datetime.parse(endtime).subtract(datetime.parse(starttime)); } } public virtual icollection<employeeshift> employeeshifts { get; set; } } } what wondering is, whether ok leave of fields intentionally blank, examble if starttime/endtime not applicable e.g. if person on holiday, wouldn't require start or end times. currently initaliser file looks this: protected override void seed(efdbcontext context) { list<shift> shifts = new list<shift>()...

angularjs - proper way of calling the functions during init in JavaScript -

i getting error method1 () undefined. proper way invoke method during init? gdmsdashboard.controller('dashboardcontroller', '$scope') { $scope.msg = ""; (function init() { $scope.method1 (); method1 (); this.method1 (); })(); $scope.method1 = function () { // } } you need understand variable hoisting concept just make code work this $scope.method1 = function () { // } (function init() { $scope.method1(); })();

excel - How to specify the sheet a worksheet function should use via a range object? -

i have code searches column of values in sheet(3) in format of string "value1 - value 2" value2 first value in column in sheet(2) , value1 value in same column, in cell further down sheet. the setup have is: in sheet(1), cells c2:c6 have values a-e respectively in sheet(2), cell c1 has value "yes" , cells c2:c6 have values 1-5 respectively in sheet(3), cell a2 has value "4 - yes" so code should countif column in sheet2 first value being yes , cells value 4, , put result in cell b2 on sheet(3) what find yes column (column c) , search same column on sheet(1) (so message boxes show letters rather numbers). is there way can more precisely specify sheet countif function uses? i'm using excel 2000 on windows 7 private sub test_click() scenario_count = 6 dim integer = 1 sheets(2).select j = 2 24 if sheets(2).cells(1, j).value = right(sheets(3).cells(i + 1, 1).value, len(sheets(3).cells(i + 1, 1).value) - instrrev(sheets(3).cells...

list - F# tricky recursive algorithm -

i have code in vba (looping through array a() of type double): bm = 0 'tot b = 0 'prev = 24 0 step -1 bp = b 'prevprev = prev b = bm 'prev = tot bm = t * b - bp + a(i) 'tot = a(i) + t * prev - prevprev next p = exp(-xa * xa) * (bm - bp) / 4 '* (tot - prevprev)/4 i'm putting in f#. use array , mutable variables recreate vba. , maybe example of right time use mutable i've seen hinted at. why not try idiomatic way? i write little recursive function replicate loop. kind of feels littering hang out little sub-loop has no meaning on own standalone, named function. i want list functions. have couple ideas, i'm not there yet. in snap?? the 2 vague ideas have are: 1. make 2 more lists chopping off 1 (and two) elements , adding zero-value e...

c# - How do I inject javascript code via webview? -

basically want this can't seem find similar webview xaml control. need do, capture incoming json file webview. is, bad request server , unsupported file exception webview. thought injecting javascript alert me, body of incoming json , bypass errors. there 2 main things can do: call functions programically inject code using html string function calling you can use invokescript call javascript functions. if have in webpage script: <script lang="en-us" type="text/javascript"> function myfunction() { alert("i alert box!"); } </script> then can in c# call: mywebview.invokescript("myfunction", null); which execute script function myfunction . injecting text if download html page , other needed files(using windows httpclient), can inject code manipulating , navigating string. lets want change above script add function, "helloworld", can search file know there, such as: ...

scala 2.11 - How do i create a TCP receiver that only consumes messages using akka streams? -

we on: akka-stream-experimental_2.11 1.0. inspired example we wrote tcp receiver follows: def bind(address: string, port: int, target: actorref) (implicit system: actorsystem, actormaterializer: actormaterializer): future[serverbinding] = { val sink = sink.foreach[tcp.incomingconnection] { conn => val serverflow = flow[bytestring] .via(framing.delimiter(bytestring("\n"), maximumframelength = 256, allowtruncation = true)) .map(message => { target ? new message(message); bytestring.empty }) conn handlewith serverflow } val connections = tcp().bind(address, port) connections.to(sink).run() } however, our intention have receiver not respond @ all , sink message. (the tcp message publisher not care response ). is possible? not respond @ since akka.stream.scaladsl.tcp.incomingconnection takes flow of type: flow[bytestring, bytestring, unit] if yes, guidance appreciated. in advance. one a...

.htaccess - redirect non-www to www resulting in loop address -

i'm configuring website redirect non-www www, resulting in address loop this: abc.com/www.abc.com/index.php/www.abc.com/index.php/www.abc.com/index.php/www.abc.com/index.php/www.abc.com/index.php ... , on below .htaccess file. can me spot error? <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php?/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !^(/index\.php|/assets|/robots\.txt|/favicon\.ico) rewriterule ^(.*)\.html$ /index.php/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !^(/index\.php|/assets|/robots\.txt|/favicon\.ico) rewriterule ^(.*)$ /index.php/$1 [l] rewritecond %{http_host} !^www\. rewriterule ^(.*)$ www.%{http_host}/index.php/$1 [r=301,l] </ifmodule> <ifmodule !mod_rewrite.c> errordocument 404 /index.php </ifmodule> many thanks, rewri...

c# - Selecting indexes from Multidimensional Array where the value is 0 is not working -

please given task return indexes 2d array updating. assignment on 2048 game . when ever, random numb added, want added randomly free/empty tiles should be. thats array value 0 in case. private static int[][] addtile() { rd = new random(); int px, py; px = rd.next(0, 4); py = rd.next(0, 4); list<int> availableind = randposition(py); int r = rd.next(0, availableind.count); int newpx = availableind[0]; if (tiles[py][newpx] == 0) { tiles[py][newpx] = rd.next(0, 20) == 0 ? rd.next(0, 15) == 0 ? 8 : 4 : 2; } else { py = py; // put break here } } my randposition() method loks fflg; public static list<int> randposition(int num) { list<int> indexes = new list<int>(); // var emptytiles = arr.where(x => x == 0).tolist(); index...

Building construction with array list in java -

i beginer developer , have java program array list. program building constructor in must create entrances , floors , apartments in array list , program has work user iputs using console. , example if want create apartment on 10th floor there 9 floors has give me error message. did here part of code: public class building { static string answer; public static void main(string[] args) { // todo code application logic here scanner input = new scanner(system.in); list<entrance> entrance = new arraylist<entrance>(); list<floors> floor = new arraylist<floors>(); list<apart> apartment = new arraylist<apart>(); system.out.println("welcome, choose (a) operations , (b) information!"); answer = input.nextline(); if(answer.equals("a")){ system.out.println("chose (a) create entrance , (b) create floor , (v) create apartment"); answer = input.nextline(); if(answer....

jsf 2 - Let JSF set selected items of selectManyListbox value as List or Collection instead of array -

is there way selected items selectmanylistbox list orcollection? after submit items selected come arrays. set collectiontype attribute fqn of desired collection implementation. e.g. if want jsf set selected items in instance of java.util.arraylist : <h:selectmanylistbox ... collectiontype="java.util.arraylist">

android - How can I manage OnApp exit event and do something before app closes? -

i have send requests server before app exits. but app close asynctasks killed , requests aren't being sent web service. make yourbasicactivity , override onpause() method , extend every activity yourbasicactivity run code when android app closed/sent background you can try ontaskremoved how detect application exit on android?

symbolic math - Force evaluate index expression before passing to sum() -

i want write (somehow) enhanced sum function takes number of indices @ once, cannot understand how work. here have: (%i1) nsum(indexes, expr) := if indexes = [] expr else nsum(rest(indexes), sum(expr, first(indexes),1, n)) $ (%i2) nsum([i,j], i+j), nouns; sum: index must symbol; found intosym(first(indexes)) #0: nsum(indexes=[k,j],expr=k+j) i think fixed forcing maxima expand first(indexes) symbol before passing sum function. tried ''(...) , ev(..., nouns) , without success. after reading , trying came following solution uses apply function pre-evaluate arguments sum : nsum(indexes, expr) := if indexes = [] expr else nsum(rest(indexes), apply(sum, ['expr, indexes[1], 1, n])) $ upd1: unfortunately, there wrong above code, works relatively simple expressions. in case straightforward approach works fine nsum fails: (%i1) rot[i](f) := sum(sum(sum(sum( g[r,i]*g[q,j]*w[i,j,k]*('diff(f[k]...

node.js - nodejs sequelize join query -

suppose have 2 models var = db.seq.define('a',{ id1: { type: db.sequelize.integer}, id2: { type: db.sequelize.integer}, count: { type: db.sequelize.integer}, }); var b = db.seq.define("b",{ id1: { type: db.sequelize.integer }, id2: { type: db.sequelize.integer }, name: { type: db.sequelize.string}, }); a.hasmany(b, {foreignkey: 'id1'}) b.belongsto(a, {foreignkey: 'id1'}) a.findall({ include: [{ model: b, where: { b.id2: { $eq:a.id2 } } }] }) its possible make kind of query? how can update model specify other condition on join sentence or should move check query clause? some example helpful thanks try a.findall({ include: [{ model: b, where: { id2: sequelize.col('a.id2') } }] }) id2 automatically reference b.

python - KeyError: SPARK_HOME during SparkConf initialization -

i spark newbie , want run python script command line. have tested pyspark interactively , works. error when trying create sc: file "test.py", line 10, in <module> conf=(sparkconf().setmaster('local').setappname('a').setsparkhome('/home/dirk/spark-1.4.1-bin-hadoop2.6/bin')) file "/home/dirk/spark-1.4.1-bin-hadoop2.6/python/pyspark/conf.py", line 104, in __init__ sparkcontext._ensure_initialized() file "/home/dirk/spark-1.4.1-bin-hadoop2.6/python/pyspark/context.py", line 229, in _ensure_initialized sparkcontext._gateway = gateway or launch_gateway() file "/home/dirk/spark-1.4.1-bin-hadoop2.6/python/pyspark/java_gateway.py", line 48, in launch_gateway spark_home = os.environ["spark_home"] file "/usr/lib/python2.7/userdict.py", line 23, in __getitem__ raise keyerror(key) keyerror: 'spark_home' it seems there 2 problems here. the first 1 path use. s...

ios - Highlight attributedtext UITextView using NSRanges to an array value? -

Image
haven't had luck in searching, hoping make story text animate (change colour)in sync audio clip quite stuck how (i'm quite new @ coding) i'm stuck how find correct range, word gets coloured , how update string in sync .caf; how connect , colour correct ranges im guessing run action duration (using audiointervals array timing) // int wordcount = 0; int wordcount = 0; int indexcount = 0; //for (nsstring *word in wordsinarray) (nsmutableattributedstring *word in wordsinarray) //*wordsinarray = componentsseparatedby whitespace { if (wordcount < [audiointervals count]) //wordcount less audiointervals { nsstring *orange = @"orange\n\n";//change text orange // action duration here on //original mutable string block/duration/delay audiointerval //how range***********the bit i'm stuck on********** [attstring addattributes:colour01 range:nsmakerange(0,???)]; [attstring addattributes:colour02 range:nsmak...

android - Replace launching activity with flavors -

is possible replace activity gets intent-filter <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> by configuring flavors? yes, add manifest file in folder of product flavour , the manifest of product flavor merged on top of manifest of main configuration. more info here: http://tools.android.com/tech-docs/new-build-system/build-system-concepts

ruby - How to update a node attribute in Chef at converge time? -

i'm trying parse value file in order set attribute use further down recipe (to set subdirectory name). the file downloaded jenkins server , parsed in ruby block value - far good. however, if try assign node attribute, doesn't work. thought i'd found answer here: how lazily evaluate arbitrary variable chef , none of methods mentioned there work me. doing wrong? ruby_block "get build number" block f = file.open("/tmp/myappjenkinsbuildinfo.txt") f.each {|line| line_arr = line.split('=') if line_arr[0] == 'jenkins.build.number' node.default['myapp']['jenkins']['build'] = line_arr[1] break end } f.close end end build = delayedevaluator.new { node['myapp']['jenkins']['build'] } release_dir = "#{node['myapp']['dir']['main']}/releases/#{build.call}" this "works" in there's no syntax erro...

ckeditor - editor.getSelection().getRanges()[0] don't return the same result in IE11 -

i have been looking issue few hours , can't find way fix it. using ckeditor 4.3 (also try 4.5) custom colour picker change font colour. all work in chrome , firefox , opera , safari yet not in ie . problem come editor.getselection().getranges()[0].startcontainer which gave me span in chrome want , p in ie 1 level high. here litle exemple : _me.editor.focus(); var range = _me.editor.getselection().getranges()[0]; addlinkcolor(range.startcontainer, value.value); var addlinkcolor = function (element, color) { var selectedchild = null; if (element.getchildren) { selectedchild = element.getchildren(); } if (selectedchild) { if (selectedchild.count) { (var = 0; < selectedchild.count() ; i++) { var childelement = selectedchild.getitem(i); if (childelement.getstyle && childelement.getstyle('color') != '' && childelement.getstyle('color'...

javascript - Navigation jQuery -

i have code : $('.category').hide(); $('.category').first().show(); $('.inline-title a').first().addclass('active'); $('.category .inline-subtitles a:first-child').addclass('active'); //category $(".inline-title a[data-toggle]").on("click", function (e) { e.preventdefault(); // prevent navigating var selector = $(this).data("toggle"); // corresponding element $(".category").hide(); $("."+selector).show(); $('.category .inline-subtitles a:first-child').addclass('active'); $(".inline-title .active").removeclass('active'); $(this).addclass('active'); }); $('.document').hide(); $('.documents-75 .document').first().show(); $('.documents-76 .document').first().show(); $('category:first-child .documents document').first().show(...

java - Start a new Activity with an extra class (android) -

i've found examples, didn't me out. i'm creating app mobile phone ran problem. problem want start new activity in new class doesn't work. this class below want start new activity called "phonestatus" package com.example.phone; import android.content.intent; import android.view.view; import android.widget.button; public class controller { button ps; phonestatus c_ps; public controller(button ps) { this.ps = ps; c_ps = new phonestatus(); createphone_status(); } private boolean createphone_status() { ps.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { intent = new intent("com.example.phone.phonestatus"); c_ps.startactivity(it); } }); return true; } } can 1 me start new activity? because gave me error , crashed app. activity1 (so mainactivity) working fine. the error: 07-22 15:38...

mysql - SELECT query for three connected tables -

my table structure looks following: subversions( id int(10) auto_increment, version_id int(10) name varchar(16) not null, primary key (id), foreign key (version_id) references versions(id) ); /* ^ many| | many v */ users( id int(10) auto_increment, name varchar(16) not null, password varchar(32) not null, primary key (id), ); with junction table subversions_users_conjuction( id int(10) auto_increment, subversion_id varchar(16) not null, user_id varchar(32) not null, primary key (id), foreign key (subversion_id) references subversions(id), foreign key (user_id) references users(id) ); my problem designing query selecting users "users" not in subversions_users_conjuction with subversion_id = specificid , without getting so following: //query other users $res2 = mysqli_query($conn,"selec...

php - Selecting a sheet using Laravel-Excel -

i'm using useful https://github.com/maatwebsite/laravel-excel package. as liked idea of keeping controllers clear of excel import code, i'm loading uploaded file using excelfile injections, see here: http://www.maatwebsite.nl/laravel-excel/docs/import#injection this code excelfile injection: studentimport.php namespace app\excel; class studentimport extends \maatwebsite\excel\files\excelfile { public function getfile() { return \input::file('student_file'); } public function getfilters() { return []; } } however, problem don't understand run methods like: ->selectsheets('mysheet') when using approach. my current work around doing following in controller after using excelfile injection grab file. excelcontroller.php public function import(studentimportformrequest $request, studentimport $import) { $results = $import->get(); foreach($results $sheet) { $sheettitle = $s...