Posts

Showing posts from September, 2010

javascript - How do I attach a jQuery event to a object's method? -

i defined object properties , methods. can't find how attach jquery function method. want : when click on object #mytarget change html text. i wrote : function blocktest(word){ this.word = ""+genrandint(0, 25); this.applynewword = function(){ $(document).ready(function(){ $("#mytarget").click(function(){ $("#mytarget").html(this.word); }); }); }; } actually, i'm trying accomplishing want based on code provided isn't way go. i'd first create object rather using function. insert attributes inside object , handle dom events separately: (function($) { var obj = { word: "example word", applynewword: function() { return this.word; } } $(function() { $("#mytarget").on("click", function() { $(this).text(obj.applynewword()) }); }); }(jquery)); div { border: 1px solid black; cursor:

html - changing the Angular-material sidenav with a Polymer drawer -

i started material design , wanted use angular material features , elements polymer have , angular don't. tried changing sidenav in starter pack drawer panel , header panel this: before: <md-sidenav class="site-sidenav md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="$mdmedia('gt-sm')"> <md-toolbar class="md-whiteframe-z1"> <h1>users</h1> </md-toolbar> <md-list> <md-list-item ng-repeat="it in ul.users"> <md-button ng-click="ul.selectuser(it)" ng-class="{'selected' : === ul.selected }"> <md-icon md-svg-icon="{{it.avatar}}" class="avatar"></md-icon> {{it.name}} </md-button> </md-list-item> </md-list> </md-sidenav> after: <paper-drawer-panel responsive-width="4000px">

java - Exception while calling MPI.Init(args) -

i started using mpjexpress on windows. did configurations mentioned in document windows ran small program :- import mpi.*; public class helloworld { public static void main(string args[]) throws exception { mpi.init(args); int me = mpi.comm_world.rank(); int size = mpi.comm_world.size(); system.out.println("hi <" + me + ">"); mpi.finalize(); } } and when run error :- exception in thread "main" mpi.mpiexception: usage: java mpi <myrank> <conf_file> <device_name> conf_file can be, ../conf/xdev.conf <local>or http://holly.dsg.port.ac.uk:15000/xdev.conf <remote> @ mpi.mpi.init(mpi.java:232) there no xdev.conf file in ../conf/xdev.conf (i checked previous mpjexpress versions) http://holly.dsg.port.ac.uk:15000/xdev.conf not reachable when see code mpjdev.java see if (args.length < 3) { throw new mpjdevexception("usage: " + &quo

Xamarin.Forms Add NavigationBar -

i want manage nav bar appearence in xaml? and how can manage nav bar appearence in tabbed page? navigationbar.sethasnavigationbar(tabpage,true) seems not working. thank all, ilenia changing color of navigation bar to change color of navigation bar generically using xamarin.forms need change properties in 1 place, i'd suggest add following app.cs file mentioned in post on xamarin forums . changing color of tab bar unfortunately, changing color of tab bar not supported in xaml . you although need write customer renderer ios so: [assembly: exportrenderer(typeof(tabbedpage), typeof(customtabbedpagerenderer))] namespace jetadvice_free.ios.renderers { class customtabbedpagerenderer : tabbedrenderer { protected override void onelementchanged(visualelementchangedeventargs e) { base.onelementchanged(e); tabbar.tintcolor = monotouch.uikit.uicolor.black; tabbar.bartintcolor = monotouch.uikit.uicolor.fr

c# - How to replace "0x1B" in a file with nothing ie remove -

i using asp.net mvc3, c#, .net 4.5 i need remove "escape" characters seem appearing in html file. i trying: newhtml = oldhtml.replace("0x1b","") but think have wrong here. please advise. the replace correct doubt string right.. you need convert hex value first character , string: string esc = ((char)0x1b).tostring() to remove 1 character in question use : newhtml = oldhtml.replace( ((char)0x1b).tostring(), "" ); to remove several characters can this: var chars = new char[] { (char)27, (char)0x1b, '\t', '~' }; string newhtml = oldhtml; foreach (var c in chars ) newhtml = str.replace(c.tostring(), string.empty); i have combined few different ways create characters. or can, , should go regular expression.. several other solutions can found here..

python - How to convert a csv file, that has array data, into a json file? -

i have csv file bunch of columns. few of columns same, want convert them json object live under same array. for example in csv: firstname,lastname,pet,pet,pet joe, dimaggio, dog, cat pete, rose, turtle, cat jackie, robinson, dog i want json be { firstname: joe, lastname: dimaggio, pets: ["dog", "cat"] }, { firstname: pete, lastname: rose, pets: ["turtle", "cat"] }, { firstname: jackie, lastname: robinson, pets: ["dog"] } i'm trying write simple python script i'm running problems. here's i've got far: import csv import json csvfile = open('userdata.csv', 'r') jsonfile = open('userdata.json', 'w') fieldnames = ("firstname", "lastname", "pet", "pet", "pet"); reader = csv.dictreader( csvfile, fieldnames) record = {} row in reader: record['firstname'] = row['firstname'] record['lastnam

sql server - SQL stored procedure SET output param using COUNT(*) ON a CTE -

i'm using stored procedure cte , doing paging. want return output parameter total count of returned query before paging. problem error "orderedset" not valid object name. @ft int, @page int, @pagesize int, @count int output begin declare @offset int set @offset = @page * @pagesize -- set nocount on added prevent result sets -- interfering select statements. set nocount on; -- insert statements procedure here orderedset ( select *, row_number() on (order id desc) 'index' tbl_bulkuploadfiles buf buf.filetype = @ft ) select * orderedset [index] between @offset , (@offset + @pagesize) set @count = (select count(*) orderedset) end so issue on last line, error last orderedset not valid object name. thanks in advance help! here 2 approaches avoid copying , pasting ctes multiple times. return total rows column of result set benefit here can calculate total rows without multiple queries ,

powershell - Renaming files in multiple subfolders -

i have 100 folders incremental. e.g. '20d, 0.5b001'...'20d, 0.5b002' ...all way '20d, 0.5b100' each of folders contains files have same incremental names. e.g. 'test_c1s0002001'...'test_c1s0002002' etc. i want rename every file in each of these folders '002001' i.e. rid of 'test_c1s0' in every 1 of these subfolders. how can this? gci 'c:\path\' -file -recurse | ren -newname { $_ -replace 'test_c1s0', '' } (untested)

python - Swapping column positions in a file -

i have file looks this: #name cdsstart cdsend exoncount exonstarts exonends nm_017436 431 586 3 420,440,513, 435,500,596, nm_001173466 720 950 4 700,752,821,823, 721,760,900,973, i want swap numbers in column 2 , column 3 first number in column 5 , last number in column 6, respectively. desired output: nm_017436 431 586 3 *431*,440,513, 435,500,*586*, nm_001173466 720 950 4 *720*,752,821,823, 721,760,900,*950*, i asterisked changes in output file clarity. think of doing splitting file script: with open('nonsensepositions.txt') inf: open('nonsensepositions_split.txt', 'w') outf: line in inf: outf.write('\t'.join(line.split(','))) and try swap particular columns, think might prove challenging due differing amounts of columns after split. have figure out way make appear original file after carry out swapping. there easier way carry out type of sw

r + dplyr filtering out time series -

i have data looks @ group of people , fruits eat on time. want use dplyr @ each individual person until eat banana , summarise fruits ate up until eat first banana . data: data <- structure(list(user = c(1234l, 1234l, 1234l, 1234l, 1234l, 1234l, 1234l, 1234l, 1234l, 1234l, 1234l, 1234l, 9584l, 9584l, 9584l, 9584l, 9584l, 9584l, 9584l, 9584l, 9584l, 4758l, 4758l, 4758l, 4758l, 4758l, 4758l), site = structure(c(1l, 6l, 1l, 1l, 6l, 5l, 5l, 3l, 4l, 1l, 2l, 6l, 1l, 6l, 5l, 5l, 3l, 2l, 6l, 6l, 6l, 4l, 2l, 5l, 5l, 4l, 2l), .label = c("apple", "banana", "lemon", "lime", "orange", "pear"), class = "factor"), time = c(1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l, 9l, 10l, 11l, 12l, 1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l, 9l, 5l, 6l, 7l, 8l, 9l, 10l), int = structure(c(2l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 1l, 2l, 2l, 2l, 2l, 2l, 2l, 1l, 2l, 2l, 2l, 2l, 1l, 2l, 2l, 2l, 1l), .label = c(&

c# - Horizontal Listbox item -

Image
i want create horizontal listbox item suggestion of keyboard <scrollviewer zoommode="enabled" horizontalscrollbarvisibility="visible" verticalscrollbarvisibility="visible" horizontalscrollmode="enabled" verticalscrollmode="enabled"> <stackpanel orientation="horizontal"> <listbox grid.row="1" name="recognizedlistbox"> <listbox.itemtemplate> <datatemplate> <textblock foreground="black" text="{binding}" /> </datatemplate> </listbox.itemtemplate> </listbox> </stackpanel> </scrollviewer> when click on button, must show list horizontal code showing list private async void recognizeallclick(object se

javascript - Highlighting a <td> if two select inputs share a value? -

we've got form has several uniquely named elements; of these elements share same group of options (incl. name/id etc). problem is, need alert user warning (i.e; asterisk, or td turning background-color red) if 2 selectors set same option. so quick example, might have 2 different selectors; <select name="servicename-1"> ...options.. </select> <select name="servicename-2"> ...options.. </select> the options share ids , names. in short, if servicename-n shares selected option id other servicename-n, need perform action - changing td colour, or making div asterisk in visible. here's more dynamic solution: get selects on page, store , loop through them see how many of selects have same value current one when there more 1 same value, update color of parent <td> , otherwise, make white. you can run following snippet see in action. $(function() { markduplicates(); }); $("select").on(&q

swift - Can you extract the text from a CLKRelativeDateTextProvider? -

i'm building set of complications , have come clkcomplicationtemplateutilitarianlargeflat has 1 textprovider. i want display text, along relative date. tried doing this: let date = clkrelativedatetextprovider(date: nsdate(), style: style, units: units) let template = clkcomplicationtemplateutilitarianlargeflat() template.textprovider = clksimpletextprovider(text: "next: \(date)") but is: <clkrelativedatetextprovider: 0x79860b80> can extract raw text clkrelativedatetextprovider or combine clksimpletextprovider in way? pass in clkrelativedatetextprovider object format string, mentioned in apple's code: @interface clktextprovider : nsobject <nscopying> // passing 1 or more clktextproviders in format substitutions, can add text around output of text provider. + (clktextprovider *)textproviderwithformat:(nsstring *)format, ... ns_format_function(1, 2); @property (nonatomic) uicolor *tintcolor; @end here example: id relati

java - Mitigating Hadoop's Achilles tendons -

i gave this hadoop tuorial read state hadoop has achilles' tendon (a single point of failure) in jobtracker : the jobtracker single point of failure hadoop mapreduce service means if jobtracker goes down, running jobs halted. and this article states namenode spof: the single point of failure in hadoop cluster namenode. single points of failure bad, mkay? what strategies/techniques/tooling/etc. can done circumvent these spofs , make hadoop redundant, faul-tolerant , resilient (buzzword alert!)? hdfs , mapreduce core components in hadoop, in earlier apache hadoop releases, namenode , jobtracker spof (only 1 instance can configured). problem fixed hadoop 2.x. jobtracker ha. jobtracker ha can achived configuring 2 jobtracker(jt) instance in active - standby mode on 2 nodes. if 1 jt goes down, second jobtracker available serve request. 1 jobtracker(active) available serving request @ time, second jt(standby ) running in read mode. jobtracker ha req

python - Pandas read_csv - rows with variable number of columns -

i have csv file has rows variable number of columns (and no column headers). e.g. file begin rows 23 columns , rows 83 columns etc. when read_csv() starts reading file guesses number of columns after first few rows read (i think) if data rows in beginning shorter @ end exception below. there way pass parameter function set number of columns max value? or there better way this? thanks. cparsererror: error tokenizing data. c error: expected 23 fields in line 150, saw 83 # coding: utf-8 # in[16]: def params(text): pairs = text.split("|") print pairs out = {i.split("=")[0]:i.split("=")[1] in pairs} return pd.series(out) params("asd=2|qwe=5") # in[27]: import pandas pd aa = pd.dataframe({'id':[1,2],'text':["asd=2|qwe=5","asd=20|qwe=5|qzxc=5"]}) aa # in[29]: aa['text'].apply(params) # in[30]: pd.concat([aa,aa['text'].apply(params)],1)

java - Where do we "import" the stuff from? -

i assuming of familiar import java.util*; :) i wanted know, physically store these classes on our computer, , if so, where? or need sort of internet connection. i assuming has java vm. don't know sure. why can't import java.* ; the class files physically stored on computer. example, go in %jre directory%/lib/rt.jar. in archive file , see java packages (you can find java.util.arraylist.class example). you can import java.* still need qualify paths every package comes after java.*

javascript - div background ease with transparent overlay on hover -

i have created div has transparent overlay when user hovers on it. how possible make background image ease create nice effect when overlay happens. example similar happening on work section of this website . html <ul class="portfolio-project-image"> <li><a href="images/flyer_mock_up.jpg"> <span> marks &amp; spencer <span>summer fete a5 flyers</span> </span> </a> </li> css body{ font: 200 14px/1.3 'roboto', 'helvetica neue', 'segoe ui light', sans-serif; } ul.portfolio-project-image{ margin:10px; padding:0; text-decoration:none; list-style-type:none; } ul.portfolio-project-image li a, ul.portfolio-project-image li a>span{ display:block; width:200px; height:300px; text-align:center; background:#fabada; position:relative; box-sizing:border-box; overflow:hidden; } ul.portfolio-project-image li

windows - Can we disable a microphone from a c++ code -

i want "disable" microphone(an audio capturing device) c++ program. if can in windows gui there might way via c++ code. can mute microphone requirement disabling it. googled lot couldn't find way. thank you. got answer question here change required in registry in value of hkey_local_machine\software\microsoft\windows\currentversion\mmdevices\audio\render\'_some_id_'\ devicestate

Unable to get Changesets in TFS Template 2013 -

Image
i got problem trying develop custom activity tfs template in tfs 2013. first step changesets associated build. , after lot of tries , google have same problems : list empty. last attempt article : http://www.colinsalmcorner.com/post/tfs-2013-default-build--the-getenvironmentvariablet-activity whatever tried, in custom activity i've nothing. public sealed class changelogactivity : codeactivity<ilist<changeset>> { [requiredargument] public inargument<ilist<changeset>> associatedchangesets { get; set; } protected override ilist<changeset> execute(codeactivitycontext context) { ilist<changeset> list = context.getvalue(this.associatedchangesets); // list empty, not null } } in template, it's got : then variables, then property of getenvironmentvariable task and properties of activity i don't know i'm missing. plus, don't know if it's related, trackbuildwarning nothing.

multithreading - pulling out from a text file and do some process in the minimal time Python -

i have text file billion lines. in each line there integer. try pull them out , make processing takes long time - need push items read queue , make process maximum threads cpu can handle. in addition, before script starts, there user input tells how integers want read file in 1 second. example: if user wants read 1000 lines(integers) per second, want sleeping (1/1000 second - visulaizing delay in reading outer file disk). tried solve through next example found here on 1 of questions no success: (i work pyscripter) def worker(): while true: item = q.get() do_work(item) q.task_done() q = queue() in range(num_worker_threads): t = thread(target=worker) t.daemon = true t.start() item in source(): q.put(item) q.join() # block until tasks done

oracle - Spring batch JdbcPagingItemReader missing un commit records -

batch has 4 steps 1. basic task 2. pull records input table -> process -> out table 3. validate error count, check count records in input , output tables. 4. pull records out table , update status business tables. i have issue count of records in out table coming correct when step 4 full records having less records. using oracle feel due commit not done when records pull. please suggest if 1 face similar issue. configuration follows: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util" xmlns:orcl="http://www.springframework.org/schema/data/orcl" xmlns:batch="http://www.springframework.org/schema/batch" x

Problems in moving a register value to a memory address in assembly language using fasm assembler? -

i confused 1 thing. following book assembly programming x86 processors , reading mov instructions , how works. so, author said following instruction valid mov mem,reg.....basically moving register value memory address. now tried , keep getting error called invalid operand. can please explain me error. #fasm# mov ax,[var] ;the value 67 moved ax register works perfect mov myvar,ax ; aim move value 67 memory location of ;myvar keep getting error - invalid operand? why that? var: dw 67 myvar: dw ? can try this: mov [myvar], ax myvar constant holding address of memory allocated variable. [myvar] instructs fetch/store value in memory @ address pointed myvar so: mov ax, myvar ; load address of myvar in ax mov ax, [myvar]; load value stored @ address myvar mov [myvar], ax; store value of ax @ address myvar

mysql - Remove null values from SQL results -

the query below returns null rows in output. can avoid null rows if i've 2 separate queries. there better approach avoiding null rows? select date_part('h',convert_timezone('utc+05:30', value)) h , count (case when cond1 1 else null end) "result1", count (case when cond2 1 else null end) "result2" table_name conds group cols expected output: h | result1 | result2 1 | 23 | 51 2 | 45 | 100 actual output: h | result1 | result2 | 0 | 0 | 0 | 0 1 | 23 | 51 if don't want query, try approach: select date_part('h',convert_timezone('utc+05:30', value)) h , count (case when cond1 1 else null end) "result1", count (case when cond2 1 else null end) "result2" table_name conds group cols having date_part('h',convert_timezone('utc+05:30', value)) not null in example, alternatively expand conditi

ios - didSelectItemAtIndexPath modifying multiple cells in UICollectionView -

i have collection view 30 items, , want perform on press. in way: func collectionview(collectionview: uicollectionview, didselectitematindexpath indexpath: nsindexpath) { let cell = collectionview.cellforitematindexpath(indexpath) as! itemcell var translucentview = iltranslucentview(frame: cgrectmake(0, 0, cell.contentview.frame.size.width, cell.contentview.frame.size.height)) translucentview.translucentalpha = 0.9 translucentview.translucentstyle = uibarstyle.blacktranslucent translucentview.translucenttintcolor = uicolor.clearcolor() translucentview.backgroundcolor = uicolor.clearcolor() translucentview.alpha = 0.0 cell.contentview.addsubview(translucentview) uiview.animatewithduration(0.4, animations: { translucentview.alpha = 1.0 }) } the function works expected, view appears not on tapped cell, on cell in same position not visible on screen. if there 3 visible cells on screen , tap on number 1, when scroll view has been add

anaconda - python.exe crashes when importing `theano` -

i using anaconda(2.2 64bit) on windows 7 64-bit machine. when try to import theano python crashes without infomation. installed theano using anaconda. does know problem comes from? this caused missing, or incorrectly configured c compiler. there's lot of installing theano on windows in documentation . in particular, make sure you've run conda install mingw libpython

c# - Continous integration of Windows 8.1 project using Jenkins -

i trying add windows 8.1 store app project jenkins continous integration. build server not windows 8.1 machine. unable build project after checkout. jenkins giving error saying msbuild cannot find files , unable build. there sdk need installed on build server. since server not windows 8 ; installtion of vs 2013 not possibel. can setup slave compiling win 8 projects? any help?

php - HttpURLConnection setRequestMethod doesn't work properly -

i'm trying consume api rest made laravel 4, when try create new resource ( store , post method) response of index function (get method). i don't know whats happening code: public static string sendinfo(hashmap<string, string> headers) { url url; httpurlconnection urlconnection = null; stringbuilder stringbuilder = new stringbuilder(); try { url = new url(headers.get("url")); urlconnection = (httpurlconnection) url.openconnection(); urlconnection.setdooutput(true); urlconnection.setrequestmethod(headers.get("method")); // loop hashmap , apply headers (hashmap.entry<string, string> entry : headers.entryset()) { // need headers real information. url , method headers setrequestmethod , object url. if (!entry.getkey().equals("url") && !entry.getkey().equals("method")) { urlconnection.addrequestproperty(entry.ge

How can i get the image matrix co ordinates in android? -

Image
i developing application included crop functionality , in i'm stoped @ below scenario. scenario crop overlay not circulating whole image when apply straightening image if changes crop overlay ratio not working. got code google related matrix, i'm tried using matrix here need find coordinates(edges) of matrix move overlay. how find it? if have idea please me.. , add image clarity problem thanks in advance.. using below code didn't exact coordinates of matrix rectf r = new rectf(); mymatrix.maprect(r); rect rect = new rect((int)r.left,int)r.top,int)r.right+width,int)r.bottom+height); you should not use maprect if applying rotation on matrix. advice figure out 4 initial points representing each rectangle edge (the image itself) , use mappoints instead. lets have image 200px wide , 200px tall top left corner positioned @ origin (0,0). if rotate image center (100,100) 45 degrees , scale 200% center have following scenario: //ori

cfc - ColdFusion Component gets initiated from wrong path -

i initiating cfc: <cfset config = new dir.dir1.config() /> this works fine. , in opinion without given reason initiates: <cfset config = new anotherdir.dir.dir1.config() /> although code shows first instantiation , if delete or rename anotherdir.dir.dir1.config file throws error component can't found. which circumstances can cause such behavior? @ end of road wisdom. when using dot notation, cf first @ path relative folder in. cf might finding cfc on path relative file in before checks path root. if code says <cfset config = new dir.dir1.config() > and file running code in in directory 'anotherdir' instantiate anotherdir.dir.dir1.config. if outside 'anotherdir' , relative path cannot resolved, attempt find component root directory.

sonarqube - Does continuous inspection still work with Sonar 5.1.X? -

i'm trying run preview analysis (java) project of ours sonarqube 5.1.1. able local report generated, no coverage data, , message [info] [xx:yy:zz.zzz] build breaker plugin no more supported in preview/incremental mode . if check here , page says starting sonarqube 5.1, build breaker plugin not work longer in preview & incremental modes. . i'm confused - thought continuous inspection 1 needs build breaker plugin. no longer so? has concept in sonarqube changed? why not getting coverage data when running preview analysis? i don't know you've read this, continuous inspection not related preview/incremental mode nor build breaker plugin - it's not related sonarqube (even though has been pushed sonarsource beginning). here key points: continuous inspection analyzing code can in order monitor (and improve) quality of code. whatever tool. on sonarqube, means running analyses push information on server can monitor what's going on , take requ

javascript - Finding a specific html element in a htmlCollection array using jquery -

Image
i hope worded title correctly. basically working in sharepoint environment. on every page of site have sidebar menu quicklinks various other pages. in sidbar menu mostly, if not entirely, generated sharepoint each menu item in list given class 'menu-item-text'. now there specific menu item want to, using javascript, append text existing text. counter specifically. so have this.. menuitem1 menuitem2 menuitem3 menuitem4 menuitem5 and want calculation on page load , display numeric results of calculation menuitem3, such as.. menuitem1 menuitem2 menuitem3 (5) menuitem4 menuitem5 so assume way via javascript. , easy if target directly id, have generic class name - <span class="menu-item-text">menuitem3</span> if use document.getelementsbyclassname('menu-item-text') , given 'htmlcollection[389]' how can find 'menuitem3' item in array? assume can idenitfy 'innerhtml' of 'menu-item-text'

stm32 - Flashing image to STM3220g-EVAL board using Trace 32 -

i have stm3220g-eval board. doesn't seem have preloaded image in now, used other purposes. when power on, display shown blank. i dont have stlink/v2 hardware. using trace32 , lauterbach flashing , debugging code. i created simple c program, created elf file using arm-none-eabi-gcc toolchain, , able flash stm3220g-eval board using cmm script stm32 provided in demo folder of trace32. what require flash default image stm3220g-eval using trace32. can provide me link boot image , cmm script flash same. i tried demonstration builder platform , demonstration firmware provided in following link http://www.st.com/web/en/catalog/tools/fm116/sc959/ss1532/pf250374 as providing hex file, used trace 32 command data.load.asciihex load hex file. when press go, getting error( emulation poer fail). can somesome provide me correct cmm script flash .hex file board. if understand correctly trying flash "stm3220g-eval demonstration firmware" on stm3220g-eval board.

solr4 - Solr Admin Page Shows No Information -

Image
i'm in process of trying solr running company. i've installed 4.10.3 on server , have indexed example docs come zip file. when start jetty , go localhost:8983 in browser see admin screen expected. when use server's full name instead of localhost, following result: the information panel empty, while using localhost url shows expected graphs , information. i'm running win 2008 r2 server. preventing me seeing information? the next step try connecting same implementation client computer using server's url, have feeling need straight before step.

javascript - Nightwatch.js loop through table -

i using nightwatch.js write system tests. want loop through elements of table , check values. how can nightwatch.js? table has <tbody> element containing several rows <tr> . every row has several columns <td> . want values of every first <td> element in every row. take peek @ answer here . talks bit how can use selenium webelements navigate through tree check value of each. it's bit goofy; you'll want write custom command can through nightwatch.js custom commands navigates through tree checking values you're looking resolve.

javascript - AngularJS directive link function does not run in Jasmine test -

in jsfiddle have directive. (function() { angular.module('myapp', []) .directive('appfoo', appfoo); function appfoo() { console.log('directive factory runs'); return { controller: appfoocontroller, link: link, replace: true, restrict: 'e', scope: { parentprop: '=' } }; function appfoocontroller($scope) { console.log('controller runs'); $scope.render({ some: 'data' }); } function link($scope, $element) { console.log('link function runs'); $scope.render = function(data) { console.log(shared.$scope.parentprop, $element[0], data); }; } } }()); and jasmine spec; describe('myapp::appfoo', function() { var shared; beforeeach

multithreading - Screen big data without interrupting data conversion -

this thread extension of thread interruption (ctrl-c) stop data transfer less. create similar system monitoring data conversion found in fdupes . think can reached gnu screen . tools tee , buffers may not needed skip 2 sections if want. hex conversion , tee [skip if know] you can use whatever hex dumper want task, instance hexdump -v , od -v -t x1 , xxd -ps generation of example data. can create binary test data 1gb following command, discussed here dd if=/dev/urandom of=sample.bin bs=64m count=16 let's simplify old situation without while loop. assume have big file. put stin less hexdump -v sample.bin | less -s -m +gg i discussing here how generate big test files. big file, empty screen when not press anything, since conversion under way. when press ctrl-c , data has been converted less @ bottom of screen. not data. interruption ctrl-c end transfer of data file less? possibilities fix this refresh less somehow if conversion still underway bin

php - Change the favicon in an image url -

i want change favicon of resources html display pages. mean when go image url want see icon in title bar not icon of server (in case xampp). just put ico file named favicon.ico in document root. a quick test open url http://my.domain/favicon.ico in browser; should display icon. note icon file must in document root. if can't put file there physically, use apache's mod_alias map file url. done placing following line in server's configuration ( httpd.conf file): alias /favicon.ico /path/to/your/images/directory/favicon.ico

polymer - Using custom data-* attributes inside HTML5 <template> tag -

i'm building menu dom-repeat template this: <template is="dom-repeat" items="{{appletsmenu}}"> <a data-route="{{item.dataroute}}" href="{{item.href}}"> <iron-icon icon="{{item.icon}}" src="{{item.iconsrc}}" ></iron-icon> <span>{{item.name}}</span> </a> </template> the data-route attribute not filled though in generated dom: <a href="...">...</a> <a href="...">...</a> it seems template renders "normal" attributes href . i'm missing something? thanks. to bind attribute, use $= rather =. results in call to: element.setattribute(attr, value); as opposed to: element.property = value; (source) so in case: <a data-route$="{{item.dataroute}}" href="{{item.href}}">

javascript - I want to resize the font-size, while resizing the the table elements -

while increasing height , width of table font-size should increased , vice versa. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jquery ui resizable - default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes /smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <style> #resizable { width: 150px; height: 150px; padding: 0.5em; } #resizable h3 { text-align: center; margin: 0; } </style> <script>

java - Setting custom file format class in mapreduce job -

i extended fileinputformat xmlfileinputformat . problem when set class on job job.setinputformatclass(xmlfileinputformat.class); i error telling expects class extend or.apache.hadoop.mapreduce.inputformat (but checked fileinputformat implements inputformat ) this class set way public class xmlfileinputformat extends fileinputformat<nullwritable, byteswritable> { @override protected boolean issplitable(filesystem fs, path filename) { return false; } @override public recordreader<nullwritable, byteswritable> getrecordreader( inputsplit split, jobconf job, reporter reporter) throws ioexception { return new xmlfilerecordreader((filesplit) split, job); } } how can set correctly inputformat ? please verify package structure in import statement. should org.apache.hadoop.mapreduce.fileinputformat. you have imported: org.apache.hadoop.mapred.fileinputformat

jquery - How distinguish between same class name -

there endless divs same class name. in example class="box" , evaluate how many letters in respective box. $( ".box p" ).text().length you number of elements in jquery objects. jsfiddle use each() function loop through these elements , return text length check demo $('.box').each(function(index) { var count = parseint(index) + 1; $('body').append('<div>box ' + count + ': <span>' + $(this).children('p').text().length + ' letter</div>'); });

mysql - How to query my tables to give data in such a format? -

Image
i have developed structure represent hierarchical data in in db. have 3 tables relationship defined each one. how should query db data in such structure. query have data separate tables (gives me users product in table) list discusersconfs = newarraylist(ao.find(discuserconf.class, query.select())); (gives me effects users in table) list disceffectconfs = newarraylist(ao.find(disceffectconf.class, query.select())); how can combine these queries data in way have shown relationship in below image. using active objects 1 of orm. i this. select table1 while fetching{ select again table 2 user = (user table1) ...and on.. } this problem , has more 1 solution. problem method each deeper level must give more table , add them manually code

verilog - Error: <signal> is not a constant -

module concat( input [7:0] data_in, input rst, input clk, output reg[127:0] data_out, output reg valid_out ); integer i; reg[127:0] datatemp=0; always@(data_in) begin if(rst) begin data_out<=0; datatemp<=0; end else begin for(i=0;i<=127;i=i+8) begin datatemp[i:i+7]<=data_in; end if(i==127) begin valid_out<=1; data_out<=datatemp; end end end endmodule this code showing following error: line 44: not constant please tell me how remove it. i'd grateful. it looks ended loop soon. checking value of being equal 127 after loop done. think code compile want this: for(i=0;i<=127;i=i+8) begin datatemp[i:i+7]<=data_in; if(i==127) begin valid_out<=1; data_out<=datatemp; end end but sure want do? understand in verilog for-loops unrolled? different how behave in

c# - Role-based restriction not working for ASP.NET MVC Forms Authentication via AD -

i've got asp.net mvc page i'd secure login , not authenticate against active directory using forms authentication , grant access specific roles. web.config <system.web> <authentication mode="forms"> <forms name=".adauthcookie" loginurl="~/home/login" timeout=45 protection="all" /> </authentication> <authorization> <allow roles="admin" /> <deny users="*" /> </authorization> ... controllers [httpget] public actionresult index() { return view("~/ng-app/index_template.cshtml"); } [httpget, allowanonymous] public actionresult login() { return view("~/ng-app/login_template.cshtml"); } [httppost, allowanonymous] public actionresult login(logindto dto) { ... // validate dto & stuff formsauthentication.setauthcookie(loginmodel.username, loginmodel.rememberme); } now, basic protect

C# - Force json conversion to always create arrays -

i need serialize xml json before returning client. using: json = jsonconvert.serializexmlnode(xmldocument); a problem when xml element "elem1" has single child folder child added elem1 object rather array 1 member. there way of enforcing that? thanks

javascript - jQuery AJAX return the function as data upon success -

i have codeigniter flashdata + jquery ajax call show it. code: <script type="application/javascript"> var res_no = '<?php echo $this->session->flashdata('res_no'); ?>'; var res_new = '<?php echo $this->session->flashdata('res_new'); ?>'; (function( $ ) { $("#check-reservations").click(function() { $.ajax({ type: "post", url: "mycontroller/function", async: true, data: { res_no: res_no, res_new: res_new }, success: function(data) { if(data) { alert(data); } } }); }); /* default notifications */ $('#check-reservations').show(function() { if (res_no) { new pnotify({ title: 'hmm no new reservations..', text: res_no, type: 'custom', addclass: 'notificat

performance testing - how to get transactions number reduced with Loadrunner Controller -

on load test loadrunner controller, have script make 1029 transactions per hour 1 virtual user,with 1 "number of iteration" ,"ignore think time", , pacing setting start every iteration @ random interval every 3 4 seconds want reduce transactions 45 transactions per hour. set think time "limit think time : 65", without success. knows how reduce number of transactions. there run time setting must changed transactions reduced? use 'fixed' intervals of 80 seconds. 45 transactions per hour 3600 seconds in hour = 80 seconds per transaction

angularjs - How to update view when scope does not change -

there textarea input. , 2 buttons click. `<textarea ng-bind="msg"></textarea> <div class="cancel-btn" ng-click="is_hide=false;"></div> <div class="submit-btn" ng-click="submit_card()"></div>` what process ? input characters in textarea, click 'submit-btn', scope save 'msg'. if click 'cancel-btn', scope won't save msg. what want ? after save msg, input , click 'cancel-btn', want textarea's innerhtml scope.msg instead of input. # now, want exec $scope.$apply() update dom, alert error $digest in progress . # maybe need ng-model textarea, , use other param saved_msg save msg , when click 'cancel-btn', make msg = saved_msg . but, there convenient ways ? -------------------update 6/25----------------- `<div ng-controller="ctrl"> <div ng-class="{'selted':cid == 0}" data-ca