Posts

Showing posts from May, 2013

javascript - Show popup with selections -

i new javascript/jquery. when page loads, show popup user select country. should this: enter image description here upon selection of “united states”, should this: enter image description here there 2 selections: “united states” , “canada”. upon selection of “united states”, show drop-down list containing list of states. upon selection of “canada” or state, close popup. just go through code. can open model window on document.ready method in jquery method triggers when html page ready. can show state dropdown if country selected in change event of country dropdown. can append options selected country inside change event of dropdown. $("#cntry").change(function(){ if(this.value!="select country") { $('#state').find('option').remove().end().append('<option value="select state">select state</option>'); if(this.value=="united states") { $(...

office365 - Document Icon not displaying under SP Document Associated Grid within Dynamics 365 CRM -

Image
has else ran issue document icon won't load under 'sp document associated grid' default view under related documents section on main entity such account or opportunity? it load when changing drop down 'all sharepoint documents' view though. need load within 'sp associated grid' because cannot change default view under settings. insight on getting icons show?

amazon web services - openssl parse error c# aws lambda mqtt -

i trying create aws-lambda function in c# publishes aws-iot thing via mqtt. for now, trying publish string message test topic subscribed to. this code works when running via unit test , string received on iot thing. when deploying aws code publishes without error when invoking code receive following response. { "errortype" : "opensslcryptographicexception", "errormessage" : "error:23076072:pkcs12 routines:pkcs12_parse:parse error", "stacktrace" : [ "at internal.cryptography.pal.opensslpkcs12reader.decrypt(string password)", "at internal.cryptography.pal.pkcsformatreader.tryreadpkcs12(opensslpkcs12reader pfx, string password, boolean single, icertificatepal& readpal, list`1& readcerts)", "at internal.cryptography.pal.pkcsformatreader.tryreadpkcs12(safebiohandle bio, string password, boolean single, icertificatepal& readpal, list`1& readcerts)", "at internal....

reactjs - Handling Apollo-wrapped descendants in unit tests that mount the React component -

i've been working apollojs in react (via react-apollo ) past several months , have learned number of tricks , challenges associated unit testing apollo-wrapped components. when testing component directly wrapped apollo, export , test component before wrapped hoc returned graphql . when testing component has apollo-wrapped component descendant, use enzyme's shallow rendering whenever possible prevent descendant mounting. if full-dom rendering via mount required, use mockedprovider apollo's test utils descendants don't throw error trying access this.context . i have not found solution, however, following case: component apollo-wrapped descendants needs tested using full-dom rendering need make assertions involving component instance (e.g. state, instance methods, etc). avoid issues descendants, have wrap component in mocked provider, means assertions on wrapper operating on mockedprovider instance , not component want testing. an example: import { mount }...

excel - How to distinguish between two "stale values" and blanks in between two values in a column of data? -

i asked question linear interpolation of data missing values. here link question what dynamic solution linear interpolation of data in row missing values indefinite number of missing value sequences? a new problem has arisen pertains case blank sequence ends in blank, , not filled value. in case, formula repeats last filled value in latest blanks. want is, have way conditional formatting or adding 0.0000009 sort of number distinguish stale data. below sample data:- (this data result of formula described solution provided) date data updated data 1/1/2001 1 1.000000000 2/1/2001 2 2.000000000 3/1/2001 3 3.000000000 4/1/2001 4 4.000000000 5/1/2001 4.250000090 6/1/2001 4.500000090 7/1/2001 4.750000090 8/1/2001 5 5.000000000 9/1/2001 6 6.000000000 10/1/2001 7 7.000000000 11/1/2001 7.666670090 12/1/2001 8.333330090 1/1/2002 9 9.000000000 2/1/2002 11 11.000000000 3/1/2002 11.000000090 4/1/2002 ...

for loop - How do I output a square in Java with a character like * or something else using run as a method and with using return? -

i want output square example * . easy need use return command run method run test. square needs n x n big whereby n integer. problem dont know how variable. apparently need use unix newline character (dont know is). have this: public static int run(int n) { int n = for(int row = 0; row!= ; row = row +1) { for(int col = 0; col!= ; col = col + 1); return } } } the original assignment looked this. need run junit tests. why need use method run in combination return command now use for-loops output square of stars of n×n. value of n willbe provided argument typeint.to create new line in string, use unix newline character. example of square n = 4: * * * * * * * * * * * * * * * * this test. says expects string. really confused now. import org.junit.test; import static org.junit.assert.*; public class assignment1_5test { @test public void getstarstest1() throws exception { string expected = "*\n"; assertequals(exp...

javascript - Simulate a shine effect on a button that is executed on hover event, but with other event -

this first question i can't find answer. have been looking on various topics, ones (for example): how force hover state jquery? how simulate mouseover in pure javascript activates css ":hover"? i want simulate shining effect on button triggers on hover (the effect css , took site: https://codemyui.com/pure-css-shining-button-hover-animation/ ), other event, clicking other button or whatever. according previous topics research, not possible trigger hover event, workaround assign class hover css style, , thats tried do, can't make work. i think problem because css has pseudo-elements :after , :before , :hover , combined. here code: css: @import url(https://fonts.googleapis.com/css?family=raleway:300); .btnshine { position: absolute; left: 50%; top: 50%; -webkit-transform: translatex(-50%) translatey(-50%); transform: translatex(-50%) translatey(-50%); } .btnshine { background: #333; color: #ccc; width: 200px; height: 60p...

Eclipse IDE: How to create a view of a subset of my code's variables when debugging? -

i'm using eclipse (neon.3 release (4.6.3)) pydev plugin python. the code i'm debugging has large number of variables, many of nested within other variables. i'd select subset of these variables included in separate view can bypass having drill down variables @ each step, tedious process. the primary data structure being used pandas dataframe containing numerous columns, , typically need see small portion of values few of dataframe's columns. for example, let's have dataframe 'df' column named 'x'. whenever debug code want see values of df.x between indices , j (i.e. df.x[i:j+1]). , j may change time time they're variables in code not in 'df'. how can create streamlined tab/view of variables includes df.x._values[i:j+1], preferably separate standard variables view? thanks in advance suggestions or feedback in general. this can done using 'expressions' view within debug perspective. for example in question abo...

javascript - Empty password input value on autocomplete (React.js) -

Image
after login form autocompleted browser, queried password input's value empty. after click password field, value gets magically available, there many events fired browser don't make sense. (the onchange on password input not among them.) why value on input[type=password] empty? why autocomplete on password input doesn't fire onchange event? ( fires on normal input ) bonus question: why there second (unnecessary) focus/blur event? 1. both inputs set type="text" both inputs rendered once (no autocomplete) note: inputs uncontrolled stateful , track state changes on focus, blur, change entered=true when there value entered focused=true when onfocus fired, =false when onblur fired peek=true when need programatically force type password to  text 2. input set type="password" (see how form autocompleted.) ... 2.render ( red arrow ) - browser focused input onchange fired on email input 3.render - i...

Java game that generates and compares random numbers, looking for matches - Code Review Stack Exchange

i have written java code school assignment. game, , works follows: the game makes 4 random numbers, different, users ticket. generates 4 other random numbers, again different, compare to. if match, win. if don't match, lose. a = random 0-9 b = random 0-9 c = random 0-9 d = random 0-9 a cannot equal b / c / d b cannot equal / c / d c cannot equal / b / d d cannot equal / b / c here code: import java.util.random; import java.util.scanner; public class lottery { public static void main(string[] args) { scanner scan = new scanner(system.in); system.out.println("lottery game"); random rand = new random(); // creating 4 individual balls int ball1 = 0; int ball2 = 0; int ball3 = 0; int ball4 = 0; int guess1 = 0; int guess2 = 0; int guess3 = 0; int guess4 = 0; // users ticket number system.out.println("generating ticket"); guess1 = rand.nextint...

Android 4.4 - TextSelectHandle not working -

i want remove textselecthandle edit text. i created this <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <size android:height="0dp" android:width="0dp" /> </shape> android:textselecthandle="@drawable/your_empty_image" works in other devices. not in android 4.4 ? clue on this?

python 3.6 changing a list to a 2 digit then a space -

i have saw , works on shell need way work on python editor can help a = '345674655' [a[i:i+3] in range(0, len(a), 3)] and outputs ['345', '674', '655'] this want can not on shell on print how work know how works can't too? a = '345674655' ar = [a[i:i+3] in range(0, len(a), 3)] print(*ar) str2= " | ".join(ar(e) e in ar) print (str2) is want? a = '345674655' ar = [a[i:i+3] in range(0, len(a), 3)] print(*ar) output: 345 674 655 updated: second update: no need use list comprehension in case @darthfett's comment. a = '345674655' ar = [a[i:i+3] in range(0, len(a), 3)] print(*ar) str2= " | ".join(ar) print (str2) updated output: 345 674 655 345 | 674 | 655

java - How to get a parameterized ExecutorService? -

how can executorservice instance specific type parameter? i have java.util.concurrent.executorservice named service , i'm calling submit method parameterized callable future result generated callable . void dosomething(callable<response> callback) { future<response> futureresponse = service.submit(callback); } it works ok, service not-parameterized; ideally (i.e., executorservice<response> ). i'm creating executor service executors.newfixedthreadpool(10) , doesn't appear have way parameterize call. there anyway achieve this?

Grouping Non-Resourceful routes in Rails 5 -

i have 2 routes this: get '/quotation/cep_validator', to: 'quotation#cep_validator' '/quotation/price', to: 'quotation#price' they not restful can see both habe same beginning in url , same controller. is there way group them together, similar resource routes? route :quotation 'cep_validator' 'price' end try this: resource :quotation, only: [] collection :cep_validator :price end end hope you.

javascript - How to return all the streams at once from a gulp task with multiple source files? -

the gulp task wrote breaks runsequence in main gulp task. has run in between other tasks, this: runsequence( ... ':build:prod:staticindex', ':build:prod:typedoctomd', // << task ':build:prod:staticdocumentation', ...etc and task after never gets executed. makes me think task doesn't return single stream or incorrectly. here how task looks: gulp.task(':build:prod:typedoctomd', (done: any) => { let tasknum: number = 0; let streams = []; let filespath = [ path.join(__config.tmpl_docs_path, '**/*.md') ]; glob(filespath.tostring(), function (er, files) { tasknum = files.length - 1; files.foreach((filename) => { let stream = gulp.src(filename) .pipe(addtypedoc()) // << custom plugin wrote .pipe(gulp.dest(function (file) { return file.base; })); stream.on('end', () => { streams.push(stream); if (streams.length === tasknum) { ...

Bootstrap 4.0 Collapsible Navbar with Fixed Top not Wrapping Menu Tabs -

i attempting re-build site using bootstrap either doing wrong or may have hit bug. in short, i'm using sample collapse navbar bootstrap samples ( navbar-toggler ). i'm using javascript fill in menu items. thing after number of tabs added, continues add them inline instead of wrapping tabs. i've added jsfiddle should show same behavior. builds 40 tabs should make 2 or 3 rows, instead puts them inline. any thoughts? <!doctype html> <html lang="en"> <head> <title>bootstrap example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384...

appmaker - How to setup people viewer -

[appmaker] trying setup people viewer , doesn't load job title, location, or manager data. how can go getting data inputted each employee? data cannot come outer space, need put in first. people viewer template relies on directory model reads data admin directory . so, need navigate there , add information need.

Ansible - Log stdout lines from each remote host to a single file on the local server -

is there easy way log output multiple remote hosts single file on server running ansible-playbook ? i have variable called validate stores output of command executed on each server. want take validate.stdout_lines , drop lines each host 1 file locally. here 1 of snippets wrote did not work: - name: write results logfile blockinfile: create: yes path: "/var/log/ansible/log" insertafter: bof block: "{{ validate.stdout }}" delegate_to: localhost when executed playbook w/ above, able capture output 1 of remote hosts. want capture lines all hosts in single /var/log/ansible/log file. one thing should add marker blockinfile wrap result each single host in unique block. the second problem tasks run in parallel (even delegate_to: localhost , because loop here realised ansible engine) 1 task overwriting other's /var/log/ansible/log file. as quick workaround can serialise whole play: - hosts: ... serial: 1 tasks: ...

c# - how to handle group subtotal and e.g. target rows in WPF DataGrid? -

i'm implementing wpf datagrid contains projects many key figures. projects grouped project categories. for each category there should be: a row shows in each key figure column sum of rows column. a target row not part of datasource grid in binded to. target row tells every column target year (e.g. how money there's spend). these rows should on top in each group (sorting filtering). my 1st solution have data in group header. not solution because group header not support columns. i.e. should constructed getting column widths. that done gets complicated when users want reorder , hide columns. datagrid using collectionviewsource it's not populated c# code. i'm extending example: http://msdn.microsoft.com/en-us/library/ff407126.aspx thanks & best regards - matti i have hacked-together datagrid group subtotal rows in 1 of projects. weren't concerned of issues bring up, such hiding , sorting columns don't know sure if can extended that...

amazon s3 - Python Write Temp File to S3 -

i trying write dataframe temp file , upload temp file s3 bucket. when run code there isn't action occurs. appreciated. following code: import csv import pandas pd import boto3 import tempfile import os temp = tempfile.temporaryfile() largedf.to_csv(temp, sep = '|') s3.put_object(temp, bucket = '[bucket name]', key = 'test.txt') temp.close() the file-handle pass s3.put_object @ final position, when .read it, return empty string. >>> df = pd.dataframe(np.random.randint(10,50, (5,5))) >>> temp = tempfile.temporaryfile(mode='w+') >>> df.to_csv(temp) >>> temp.read() '' a quick fix .seek beginning... >>> temp.seek(0) 0 >>> print(temp.read()) ,0,1,2,3,4 0,11,42,40,45,11 1,36,18,45,24,25 2,28,20,12,33,44 3,45,39,14,16,20 4,40,16,22,30,37 note, writing disk unnecessary, really, keep in memory using buffer, like: from io import stringio # on python 2, use cstringio imp...

javascript - Highlighting whole street with some maps API -

is there way highlight/display on google/bing/(any other map provider) maps whole street (from beginning of street end of)? i know existence of polyline in google maps api, it's connecting 2 latitude points, , there no way of making automatic display street in city. also thinking directions , many street 2 way, there no guarante mark whole street , it's user friendly. example you may want check mike williams' article on how snap points , polylines streets google maps api: snap points (and polylines) street especially example: click on map , path drawn follows streets.

sql server - TSQL sum a column with the outcome of a case statement -

i looking @ making new column contain sum of column of raw data outcome of case statement. example: sku standardcost addon combined --- ------------ ----- -------- 001 0.578271 0.040194 0.618465 070 0.290721 0.039425 0.330146 223 0.446990 0 0.446990 addon column computed field based on case statement. want create combined column within code... possible? thanks!! rob =) i updating code working with... select itemkey 'product number', ltrim(rtrim([itemkey]))+'_'+ltrim(rtrim([plant]))+'_'+ltrim(rtrim([location])) 'key', [item desc] 'product description', plant 'location', [location] 'warehouse', standardcost 'variable cost', --add on costing case when substring(itemkey,1,4) = '3121' , substring(itemkey,10,3) = '010' ((select -- calculating tanker pricing *np...

java ee - Asynchronous JMS Request-Reply -

what's best way implement asynchronous request reply pattern jms (preferably jms 2.0). for example: receive request async jaxrs service send message jms queue wait reply (2) send response client (1) i see how implement using temporary queue request. some documentation says it's not pattern posted message see if there better alternatives. the problem see other recommended alternatives jms producers , consumers not thread safe using 1 per client more changeling.

pygtk - What does it mean for a gtk widget to have its own window -

i trying learn pygtk , understand meaning of terms in documentation , tutorial. according documentation a button object not have own window. widgets not receive events (widgets not have own window) not work tooltips. so conclude tooltips not work buttons. seems wrong , example code below seems prove wrong. there don't understand meaning of terms? above statements incorrect? can explain missing here. method get_has_window() not answer same question whether tooltip work? #!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk class isbuttonnowindowwidget: def sillycallback(self, widget, data): print data if widget.get_has_window(): print "which has window" else: print "which *not* have window" def __init__(self): # create dismissable top level self.window = gtk.window(gtk.window_toplevel) self.window.connect("destroy", lambda w: gtk....

python - Selenium send keys sending too fast -

i'm testing login on site has standard username entry , hidden password input. select username , send string. i'm unable select password box because selenium.common.exceptions.elementnotvisibleexception: message: element not visible instead this: login = driver.find_element_by_xpath('/html/body/div/div/div/div/div/div/div/div/input[1]') login.send_keys(foo) login.send_keys(keys.tab + bar + keys.enter) this never works, password 10 characters long , never manages 10 in password box. i had thought sleep(1) between sending keys, due nature of hidden field isn't possible. how can past issue, either selecting password field directly, or allowing string sent in full? edit the website sports betting section of this site. of unable view because of jurisdiction reasons, i'll provide html sample of when i'm home. i think of issue how trying sendkeys password field using tab. there's no need rely on tabbing right element, grab 1 want. al...

PHP stop function return from being overwritten -

i've created 2 functions: function script_start_time() { $start_time = microtime(true); return $start_time; } and function script_end_time() { $start = script_start_time(); $end_time = microtime(true); $time_taken = $end_time - $start; $time_taken = round($time_taken, 4); echo 'page generated in '.$time_taken.' seconds.'; } function script_start_time() called in header.php , function script_end_time called in footer.php i trying use $start_time value in function script_end_time without resorting using global or static . 0 in echo, know incorrect. where going wrong these functions seems $start getting overwritten in function script_end_time instead of retaining value function script_start_time . the problem script_start_time function never saves value of $start_time , instead overwrites anytime function called. you're asking current time anytime call function. if adjust code should work expected: ...

html - How to override an element CSS? -

i have element setting width site on specific pages want remove width. can't remove element since it'll break pretty every page on site. (especially header template) i tried doing .nopagewidth {margin: 0 auto; max-width: 1920px !important} but page still inheriting element css. this structure of page - .pagewidth { padding-right: 5px; padding-left: 5px; margin: 0 auto; max-width: 1350px; box-sizing: border-box; } .nopagewidth {margin: 0 auto; max-width: 1920px !important;} <div class="pagewidth"> <div class="pagecontent"> <article> <div class="nopagewidth"> </div> </article> </div> </div> help appreciated, i'm stuck! you should use "width" if trying set page width. "max-width" be, , depends on content. don't need !important. .pagewidth { padding-right: 5px; padding-left: 5px; margi...

ElasticSearch Jest Client Read Timeout -

my config in jest 2.4 es 2.4 jestclientfactory factory = new jestclientfactory(); factory.sethttpclientconfig(new httpclientconfig .builder("serverx:9200") .multithreaded(true) .defaultmaxtotalconnectionperroute(75) .maxtotalconnection(75) .readtimeout(20000) .build()); i have 50 threads doing es queries. read timeout. if leave defaults.. kind of work better. timeouts 1 of every 3 or 4. is issuing 1 query per second or more. clue ? doc on how defaults not quite easy find ?

Using PHP from a Docker container in host machine (bare metal) -

i interesting fr open in atom's ide-php repository . feature requests states whether using php installation inside docker container host machine possible. more context: atom developing ide-like plugins. each plugin (python, ruby, php, etc...) needs proper environment work, common work scenario nowadays bare metal machine clean os , docker containers required environment each project. my question is: possible use php environment inside docker container in host machine? if so, how?

ios - How does CLLocation implement the Equatable protocol? -

in answering question on so, found cllocation class conforms equatable protocol. method use determine equality? exact match of lat/long? exact match of lat/long , altitude? exact match of latitude, longitude, altitude, , timestamp? speed , course? cllocation objects created lat/long pair? various other values of location not optionals, altitude location created using init(latitude:longitude:) ? how cllocation implement equatable protocol? it doesn't. there no overridden == function compares 2 cllocation instances. when calling == 2 cllocation instances, nsobject == function used: public func ==(lhs: nsobject, rhs: nsobject) -> bool to compare 2 cllocation instances, either compare properties on each care (latitude or longitude), or use built in distance(from:) method 2 locations , compare cllocationdistance threshold.

python - Plotting two line plots of different index lengths with disconnects where there is no data -

Image
i have 2 data sets need plot on single pair of axes. each data set contains 2 lists: dates (in format of yyyymm) values (monthly averages) the problem having 1 data set contains summer months (plotted in red), while other contains every month (plotted in blue). result, image 1 below: however, don't want line plot summer months (red) connect between years. is, don't want draw line between data points 200208 , 200306. want gap in red line data not exist, graph joe kuan . the code used plot first image is: #data1 x = monthly_avgs_aod.index.tolist() x = [dt.datetime.strptime(i, '%y%m') in x] y = monthly_avgs_aod.values.tolist() #data2 q = monthly_avgs_pm.index.tolist() q = [dt.datetime.strptime(i, '%y%m') in q] w = monthly_avgs_pm.values.tolist() plt.plot(q, w, '-r') plt.plot(x, y, ':b') the data using looks this: #data1 x=['200101','200102','200103','200104','200105','200106...

Get contact information from Hangouts App programmatically in Android -

from link: read google hangouts messages using android seems there way messages out of hangouts. there permission issues still needs resolved though in above thread. is possible hangouts contacts programmatically android device? thank you

machine learning - tinder-like but for phrases tensor flow recommendation system -

i build recommendation system in tensor flow (possibly). should propose user fitting item (consisting phrase) having votes of other phrases (items can viewed , ... suggested viewing). 1 thing tinder or stumbleupon sentences in places of photos , urls respectively. can text-analysis , how? startup called date-a-mind (think sapio-sexual dating).

using doparallel and foreach in R for nested loops and continuously printing output -

i trying compute auc multiple gene expression combinations. have ~2000 upregulated genes , ~1500 downregulated genes. need use parallel code taking long compute. tried change code little(below) output not how want it. desired output: {pos.gene1}{neg.gene1}, {pos.gene2}{neg.gene2} x1 x2 x3 x4 {pos.gene1}{neg.gene1}, {pos.gene2}{neg.gene3} x1 x2 x3 x4 .... output getting: {pos.gene1}{neg.gene1}, {pos.gene2}{neg.gene2} x1 x2 x3 x4{pos.gene2}{neg.gene4}, {pos.gene3}{neg.gene4} x1 x2 x3 x4 basically, not in order looking , not formatted. i new parallel computing using r. can me fix code? thanks! library(foreach) library(doparallel) #setup parallel backend use many processors cores=detectcores() cl <- makecluster(cores[1]-1) #not overload computer registerdoparallel(cl) validation = readrds("file 5 lists each having sublists") path = "xxx" source(paste0(path,"functions.r")) # importing functions use in script genes = readrds("l...

javascript - How to add each result of the last loop within two nested searches in an array to show the full result in NodeJS and Mongoose? -

i'm beginner in both stackoverflow , nodejs/mongoose, i'm sorry if have error or break rule. thank in advance. i need function return nearby products there in location , given through user wich "id" request called "user". i try making function, finalproducts return products exit @ search , when try add component of result body finalproducts return data empty . error following: throw er; // unhandled 'error' event ^ error: can't set headers after sent. @ serverresponse.setheader (_http_outgoing.js:371:11) @ serverresponse.header (/home/frangaliana/escritorio/client-thingy/node_modules/express/lib/response.js:730:10) @ serverresponse.send (/home/frangaliana/escritorio/client-thingy/node_modules/express/lib/response.js:170:12) @ serverresponse.json (/home/frangaliana/escritorio/client-thingy/node_modules/express/lib/response.js:256:15) @ serverresponse.send (/home/frangaliana/escritorio/client-th...

R dataframe create One to One Relationship -

Image
experts, looking advice below r dataframe need build relationship each zone's within particular city. input: mydf = data.frame(city = c("la", "la", "la", "nyc", "nyc"), zone = c("a1", "a2", "a3", "b1", "b2")) expected output: output here's tidyverse approach defines function combinations & applies each city's zones: library(dplyr); library(tidyr); library(purrr) generate_combinations <- function(data){ zone <- data %>% select(zone) %>% unlist() combinations <- expand.grid(zone_1 = zone, zone_2 = zone) # generate combinations combinations <- combinations %>% filter(!(zone_1 == zone_2)) %>% # remove invalid combinations mutate_all(as.character) return(combinations) } mydf <- mydf %>% nest(zone) %>% mutate(data = map(data, generate_combinations)) %>% unnest() > mydf city...

ActionLink to internal path ASP.NET MVC -

how can generate following link using @html.actionlink ? <a href="#mystore" aria-controls="mystore" data-toggle="tab">my store</a> i know can use create link controller @html.actionlink("my store", "mycontroller", new dictionary<string, object> { { "aria-controls", "mystore" }, { "data-toggle", "tab" } }); but, cannot find overload of actionlink not take action name... instead want internal link: href="#mystore" . reading above comments, seems actionlinks designed external links, used instead: <a href="#@model.name()" aria-controls="@model.name" data-toggle="tab">@model.name</a>

java - Custom Rearrange Package View Intellij -

i working on java using intellij. have sub-packages in src package. want rearrange according own. in src package have 2 sub packages stack & other queue. have made stack first , queue later. think have been sorted alphabetically why queue appearing before stack. how can change or rearrange according own.

arrays - Find if all list1 element are greater than the second list in excel -

i have 2 list contains numbers. list1 {a, b, c, d} , list2 {a, b, c, d}. is there way in excel know if values of list1 greater same index value in list2. in other word if and(a > a, b > b, c> c) true . both vertical arrays (not cse) =sumproduct(--(array1>array2))=count(array1) both horizontal arrays (cse) =sumproduct(--(transpose(array1)>transpose(array2)))=count(array1) array 1 horrizontal array 2 vertical (cse) =sumproduct(--(transpose(array1)>array2))=count(array1) array 2 horrizontal array 1 vertical (cse) =sumproduct(--(array1>transpose(array2)))=count(array1) this cse formula. means use control + shift + enter instead of enter when edit or enter formula.

string - c++ large file performance with char* and pitfalls -

i'm writing , manipulating massive text files (180+mb). , i'm trying come memory schema handle data. bigfile.txt \r delimited list of strings. my current idea preform: std::string str; std::ifstream in2("bigfile.txt", std::ios::binary); if (in2.is_open()) { in2.seekg(0, std::ios::end); str.reserve(in2.tellg()); in2.seekg(0, std::ios::beg); str.assign((std::istreambuf_iterator<char>(in2)), std::istreambuf_iterator<char>()); } for(size_t = 0; < str.size();i++) { if (str[i] == '\r') { str[i] = 0; } } then go through list , map vector of char* string. is there downfalls of design? and long don't delete char*'s shouldn't leak memory right? cause string loose scope , clear correct?

python - Check how many times a key of a tuple repeats itself in a dict? -

i have dictionary following structure: {('key1','key2'): 50, ('key3','key4'): 70, ('key1','key5'): 90.....} i want count in dictionary number of times 'key1' example appears first word in key tuple. i started writing below mentioned code not think further: count = 0 leng = 0 = 0 key1,key2 in range(1,len(bigrams)): count = count +1 leng = leng + (bigrams.get((key1,key2),0)) print(count) print(leng) any suggestion how should proceed ? from collections import defaultdict der = {('key1','key2'): 50, ('key3','key4'): 70, ('key1','key5'): 90} b = defaultdict(int) item, ler in der: b[item] += 1 print b ## defaultdict(int, {'key1': 2, 'key3': 1}) print b['key1'] ## [2] python tuple operations , count

java - Updating GUI through threads -

i'm new threads , haven't written java in long time bear me here. have simple gui. has counter, status label, , 2 buttons, start , stop respectively. what wanted update status label using counter thread. when hit start supposedly starts counter @ 0 , increments every second , , when choose hit stop should suspend current thread , wait start button pressed again. whenever hit stop suspends waits second , resumes counting. when in reality want stay suspended. i'm not sure why it's doing that, tried searching before posting here got nothing. feel free criticize on you'd like. here's have: updated per @madprogrammer's answer. import java.awt.font; import java.awt.gridbagconstraints; import java.awt.gridbaglayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton; import javax.swing.jframe; import static javax.swing.jframe.exit_on_close; import javax.swing.jlabel; import javax.swing.swingutilities;...