Posts

Showing posts from March, 2014

typoscript - TYPO3 - No inheritance of access rights possible via fluid -

via it's possible give fe_user access content if fe_group she/he belongs has subgroup fe_group defined group having access content. so e.g. if define 'product group 02' (uid=2) should have access specific content via be, fe_user belongs 'user group 03' (uid=6), has subgroup 'product group 02' (uid=2), fe_user can access content. fe_groups setup: uid|title|subgroup 1|product group 01| 2|product group 02| 3|product group 03| 4|user group 01|1 5|user group 02| 6|user group 03|2,3 but if define directly in fluidtemplate {f:cobject(typoscriptobjectpath: 'lib.usergroup')} == '2' should have access content , subsequently 'user group 03', mentioned fe_user can't access it: typoscript: lib.usergroup = text lib.usergroup.data = tsfe:fe_user|user|usergroup partial.html <f:if condition="{f:cobject(typoscriptobjectpath: 'lib.usergroup')} == '2'"> ... </f:if> // ... of course, if fe_use

javascript - Appending lots of HTML with jQuery -

in trying make single-page site, i've gotten habit of using jquery's .append function quite bit. however, i'm sure there must better way of appending large blocks of code (for items such tables, graphs, etc.) page. instance, here's hideous block ajax response: $.ajax({ data: { 'cmd': 'rating', 'api' : target }, url: "api/feedback.php", global: false, type: "post", cache: false, datatype: "json", success: function(response) { document.getelementbyid("swagger-ui-container").innerhtml = ""; var formelement = '<form class="form-horizontal"> <div class="form-group"> <label class="control-label col-md-12 title" for="title" style="padding-top:4vh; padding-bottom: 4vh"><h1 align="center">' + target + ' feedback form</h1></

javascript - Enable/Disable aspx Validator via js not holding true in code behind? -

i'd know i'm missing regarding disabling these via js only, , not having add repeat code in code behind. i'm using code disable / enable validators: validator: { enable: function (id) { console.log('enable',id); var validator = document.getelementbyid(id); validatorenable(validator, true); }, disable: function (id) { console.log('disable',id); var validator = document.getelementbyid(id); validatorenable(validator, false); } }, it works great, until make postback save data, ... these disabled validators not disabled. so have run repeated code within onload() if ispostback true disable validators i've disabled via js already. edit: removed code wasn't required achieve answer. answer: server side must disable elements, can't done explicitly these reasons: found here, @connersfan: https://msdn.microsoft.com/en-us/library/aa479045.

c# - Should/Could this "recursive Task" be expressed as a TaskContinuation? -

in application have need continually process piece(s) of work on set interval(s). had written task continually check given task.delay see if completed, if work processed corresponded task.delay . draw method task checks these task.delays in psuedo-infinite loop when no task.delay completed. to solve problem found create "recursive task " (i not sure jargon be) processes work @ given interval needed. // new recurring work can added creating // task below , adding entry dictionary. // recurring work can removed/stopped looking // in dictionary , calling cts.cancel method. private readonly object _lockrecurwork = new object(); private dictionary<work, tuple<task, cancellationtokensource> recurringwork { get; set; } ... private task createrecurringworktask(work worktodo, cancellationtokensource tasktokensource) { return task.run(async () => { // work, wait prescribed amount of time before doing again dowork(worktodo); a

gradle - Importing launcher3 into Android Studio -

i'm not understanding gradle correctly, when clone https://android.googlesource.com/platform/packages/apps/launcher3/ website , import android studio, error: error:unable find method 'org.gradle.api.internal.file.defaultsourcedirectoryset.(ljava/lang/string;ljava/lang/string;lorg/gradle/api/internal/file/fileresolver;)v'. possible causes unexpected error include: gradle's dependency cache may corrupt (this occurs after network connection timeout.) re-download dependencies , sync project (requires network) the state of gradle build process (daemon) may corrupt. stopping gradle daemons may solve problem. stop gradle build processes (requires restart) your project may using third-party plugin not compatible other plugins in project or version of gradle requested project. in case of corrupt gradle processes, can try closing ide , killing java processes. what steps should take work? performing suggested resolution methods still throw error.

group by - Make math operations on a grouped table -

Image
my problem not in real programming language. i have exercise in abap language not important language. anyway, have table: i need make total cost of position(after select obviously). then, table grouped 2 fields (matnr , bukrs), need know each group total cost max, total cost min , total cost average of positions. however need simple algorithm solve problem (pseudo-code). i hope clear. for table aggregations find @ functions within loop handy. sort fields according dimensions need , sort values within ascending or descending. the order of fields important here, because @ looks changes in specified field , fields left of in same row. handle group group , append result of group aggregation result table. loop @ lt_itab assigning <ls_itab>. @ new bukrs. "at first entry of combination matnr, bukrs ls_agg-matnr = <ls_itab>-matnr. ls_agg-bukrs = <ls_itab>-bukrs. endat. try. add <ls_itab>-amount lf_sum. catch cx_sy

sourcing and displaying R source code in R Markdown without executing -

i writing book in r markdown. saved lot of code in separate .r files. didactical purpose need show whole file's contents without running it. e.g., r my_r_chunk source("./code/mycodefile.r") ``` would rendered displaying whole content of mycodefile.r without executing it. check out ?knitr::read_chunk first, assign label script using syntax ## ---- your_label ---- placing in first line of script called foo.r foo.r ## ---- your_label ---- print("hello world") 1:10 after assigning script label, can read_chunk script in uncached chunk. reference contents in subsequent (cached) chunk using eval = false chunk option. your_rmd_file.rmd --- output: pdf_document --- ```{r cache=false, echo = false} library(knitr) read_chunk('foo.r') ``` ```{r your_label, cache = true, eval=false} ```

scala - make sbt build fail on scalastyle warnings -

i'm enforcing scalastyle check code space, referring http://www.scalastyle.org/sbt.html . in build.sbt: // scalastyle check lazy val compilescalastyle = taskkey[unit]("compilescalastyle") compilescalastyle := org.scalastyle.sbt.scalastyleplugin.scalastyle.in(compile).totask("").value (compile in compile) <<= (compile in compile) dependson compilescalastyle in project/plugins.sbt: addsbtplugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") when run sbt compile , scalastyle generating [warning] ***./utils/configmanager.scala: file must end newline character , compile still succeeded . is there way make sbt compile fail on scalastyle warnings ? i change <check level="warning" ...> <check level="error" ...> in scalastylegenerateconfig , i'm not sure right way it. thanks lot there 2 simple options can think of. the obvious 1 change scalastyle config warni

ios - Sorting array of dictionaries by value after for loop? -

i've seen lot of answers similar questions none of methods have worked far. if let users = snapshot.value!["users"] as? dictionary<string,anyobject> { each.users = int(users.count) var pointsarray = [dictionary<string,int>]() (key, value) in users { let uid = key let points = value["points"] as! int pointsarray.append([uid : points]) } i'm needing sort pointsarray "points", sort high low, grab 0th (highest) element, grab uid use. i've tried: var myarr = array(pointsarray.keys) var sortedkeys = sort(myarr) { var obj1 = dict[$0] // ob associated w/ key 1 var obj2 = dict[$1] // ob associated w/ key 2 return obj1 > obj2 } this gives me value of type [ dictionary <string,int>] has no member keys. i guess that's cause i'm trying run sort on array of dicts vs dicts themselves? how switch actual dictiona

String to file not maintaing line breaks displays in terminal correclty java -

i want read text file , change text output text file. i'd open file in notepad new java - has been rehashed , posted in different way throughout forum. seem missing /n in string - thought did in below code. the part confusing me displays in terminal correctly when use showfile method. i assume way i'm writing file. i'd continue use method instead of string variable original file contains text bob red door i use read text file , input in string. public void readfile(string filename) { filetext = ""; try { scanner file = new scanner(new file(filename)); while (file.hasnextline()) { string line = file.nextline(); filetext += line +"\n"; } file.close(); } catch (exception e) { system.out.println(e); } i use method swap "r"s "b"s. i use showfile method , displays in terminal correctly this shows correctly bob

c++ - Type trait through a variable of the type -

i'd test property of type of variable. can it, code verbose. consider example, in define variable of same type type of value in container: #include <vector> int main() { std::vector<int> v, &rv=v; // ‘rv’ not class, namespace, or enumeration //rv::value_type i1; // ok decltype(v)::value_type i2; // decltype evaluates ‘std::vector<int>&’, not class or enumeration type //decltype(rv)::value_type i3; // ok std::remove_reference<decltype(rv)>::type::value_type i4; } i can live decltype , adding std::remove_reference much. there nice way shorten code, without defining auxiliary templates? you can shorten 1 of std::decay_t<decltype(rv)>::value_type i4 = 42; or std::decay_t<decltype(*std::begin(rv))> i4 = 42;

ruby on rails 5 - Traversing a Rich Association -

i'm following kevin skoglund's rails 3 tutorial while using rails 5. first language learn i'm still @ stage of blindly following tutorial. after learning "many many associations: rich" moved onto "traversing rich association". having trouble. i tracked several videos , can't find made mistake. kevin says following code "skip past join table see sections we've edited": me.sections then states, "we can other side too". , enters: section = section.find(1) here run problems. following: activerecord: :recordnotfound: couldn't find section 'id'=1 if understanding correctly, section 'id' = 1 exists because viewed me.sections i included screenshot of kevin , command prompt comparison. thanks help, know simple haven't found helped googling. david boyette my command prompt error kevin's command prompt me.sections empty. please check me associating section. btw, next

haskell - How to use HUnit in Stack -

i have stackproject stapro file app/main.hs module main import lib main = putstrln "this main" foo::int ->int foo = (+1) and file test/spec.hs module spec import test.hunit import main (foo) main :: io () main = putstrln "test suite not yet implemented" testfoo :: test testfoo = testcase $ assertequal "should return 2" 2 (foo 1) when try execute tests however $ stack test while constructing buildplan following exceptions encountered: -- while attempting add dependency, not find package main in known packages -- failure when adding dependencies: main: needed (-any), stack configuration has no specified version needed package stapro-0.1.0.0 my .cabal file is name: stapro version: 0.1.0.0 ... build-type: simple -- extra-source-files: cabal-version: >=1.10 library hs-source-dirs: src exposed-modules: lib build-depends: base >= 4.7 &&

c# - How do I share a sqlite database between a Xamarin app and Java Android app -

as title says wanting share sqlite database between android app written in java , 1 written in c# using xamarin. can share database between 2 java apps ( with of question ) when try same thing in xamarin getting following error: android.database.sqlite.sqlitecantopendatabaseexception: unknown error (code 14): not open database i think have 2 problems. i not correctly setting shared userid. placing following attribute above main activity. [register("my.user.id")] i tried using android:shareduserid="my.user.id" in manifest file throwing errors , wouldn't deploy device. i don't know how whole signing of app works. maybe device sees 2 apps coming different publisher each device , not allowing 2 share context. edit : wanted add how signed both applications same certificate future refrence. the android cert noramlly "c:\users\username\.android\debug.keystore" , xamarin cert noramlly in "c:\users\username\appdata\local\xam

python 2.7 - Why won't PyEphem calculate the elevation of manually generated objects? -

i have been using pyephem quite while, since few days (maybe weeks?) ago, 1 of scripts won't work anymore. script calculates among other things rise , set times of asteroids, create orbital elements using callhorizons . figured out pyephem not calculate asteroids' elevation - however, calculates elevation sun. here minimal script: import ephem import numpy import callhorizons this_target = '3552' body = callhorizons.query(this_target) body.set_discreteepochs(2415730.0) body.get_elements() this_target = body.export2pyephem()[0] ### works fine sun #this_target = ephem.sun() date = ephem.now() this_target.compute(date) obs = ephem.observer() obs.epoch = 2000.0 obs.lon = -111.653152/180.*numpy.pi obs.lat = 35.184108/180.*numpy.pi obs.elevation = 2738 # m obs.date = date obs.horizon = 0. # if target '3552', this_target.alt stays constant time in numpy.arange(date, date+1, 0.1): obs.date = time this_target.compute(obs) print time, this_targe

Connection is not private using Google Domains and Heroku -

i have domain purchased google , heroku app i'm trying send to. i've done steps in article: https://www.justinvrooman.com/articles/how-to-use-heroku-with-google-domains and yet when try access site a your connection not private attackers might trying steal information www.***.com (for example, passwords, messages, or credit cards). net::err_cert_common_name_invalid what doing wrong set or why getting message? it looks you've enabled ssl in rails app site doesn't have ssl certificate configured. disable ssl, set following "false" in 'config/environments/production.rb' file. config.force_ssl = false in addition, in same file, don't forget set "host" equal custom domain. host = 'www.yourdomain.com' if want run ssl on custom domain (e.g. www.example.com) you'll need purchase , configure ssl certificate domain. if, however, fine using heroku's domain (e.g. example.herokuapp.com), can pi

php - Post Error 500 adding a new row using Eloquent -

i'm trying follow tutorial making social network, functionality of liking , disliking when no row available in database using ajax (adding new entry) broken. tutorial i'm following - video creates controller: https://www.youtube.com/watch?v=drm19vkbcgu&list=pl55riy5tl51olosgk5xdo2mgjpqc0bxgv&index=20 development enviroment: phpstorm v9.0 xampp v3.2.2 jquery v1.12.0 google chrome error image: error image link the whole cycle: , dislike button (the view): <a href="#" class="like">{{ auth::user()->likes()->where('post_id', $post->id)->first() ? auth::user()->likes()->where('post_id', $post->id)->first()->like == 1 ? 'you post':'like' : 'like' }}</a> | <a href="#" class="like">{{ auth::user()->likes()->where('post_id', $post->id)->first() ? auth::user()->likes()->where('post_id', $post->id)-

How to exclude an HTML tag in regex search -

i'm using powergrep find instances of these: block 1: <td class="danish">kat <?php audiobutton("../../audio/words/dog","dog");?></td> but there instances of these among files: block 2 <td class="danish">kat</td> <td><?php audiobutton("../../audio/words/dog","dog");?></td> i want find block 1 only, not block 2. i've tried using (?!), in .*<td class(.*?)>(.*)(?!</td>) .*<\?php audiobutton\("(.*)/.*",".*"\);.*\?></td> can somehow exclude </td> tag search, block 2 ignored? i not sure why want match first cell tag only, perform can try: <td[^>]*>\s*(?:.(?!</td>))+\s*<\?php audiobutton\("[^"]*/(.+?)","(.*?)"\);.*?\?>.*?</td> g flag. see working here: https://regex101.com/r/ti4rl4/1 [edit] you can see replacement of dog cat he

javascript - Button not animating from center -

so when used jquery animate padding instead of animation if anchor point center animates top left. code , jsfiddle link down below. jsfiddle html: <div id="gaming-news-info"> <a id="news-button" style="cursor:pointer;">go news section</a> </div> css: #gaming-news-info { position: absolute; z-index: 999; width: 400px; height: 200px; top: 50%; left: 50%; transform: translatex(-50%) translatey(-50%); margin-top: -100px; } #news-button { background-color: #4caf50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; position: absolute; margin-top: 130px; font-family: "prompt-semibold"; margin-left: 90px; } you not need jquery/javascript simple hover effect. css3 transitions , transformations capable of

tsql - Is this Correlated SubQuery Correct -

i trying wrap head around sub-queries (correlated). although book explains (ms sql server 2012) i'm still little confused. using 3 tables, orders, products , orderdetails want find sum of products shipped usa. came following query not quite understand how got there except correlation referencing 'where' in outer query. can correct work , offer better explanation book? select p.productid, p.productname, sum(qty * od.unitprice) totalamount production.products p join sales.orderdetails od on p.productid = od.productid n'usa' in (select o.shipcountry sales.orders o join sales.orderdetails od on o.orderid = od.orderid shipcountry = n'usa') group p.productid, p.productname; select p.productid , p.productname , sum(qty * od.unitprice) [total_amount] production.products productid join sales.orderdetails od on p.productid = od.product join salesorders o on o

google chrome devtools - Why is my React app not loading app shell instantly? -

Image
shown on screen capture below: on page reload webapp's required resources fetched service worker, still takes 1.42 render on page. expecting, on reloads of page items cached service worker should render instantly. i'm missing? the files may not cached , installation of service worker failed. its possible there files failed downloaded, won't considered installed. discussed on install service worker page, having long list of files can increase chances of caching failure, leading service worker not getting installed.

return value - python - getting 'none' at the end of printing a list -

this question has answer here: extra output none while printing command line argument [duplicate] 2 answers newbie here. can please explain me why 'none' printed @ end of code, when called inside function? background: have variable (share_data) contains lists: share_data = [['date', 'ticker', 'company', 'mkt cap', 'vm rank', 'value rank', 'momentum rank'], ['2016-08-27', 'bez', 'beazley', '2,063', '89', '72', '76'], ['2016-08-30', 'bez', 'beazley', '2,063', '89', '72', '76'], ['2016-08-31', 'bez', 'beazley', '2,050', '89', '72', '75'], ['2016-09-01', 'bez', 'beazley', '2,039', '96', '73

Cross-sum operation in matlab -

is there efficient way cross-sum operation in matlab. given 2 sets , b, cross-sum pairwise addition of vectors , b? yes: a=[1 2 3 4] b=[50 60 70 ] bsxfun(@plus, , b') in gnu octave or matlab 2016b can write: a+b' if elements of set vectors possible solution: a=[1 2 3;4 5 6] b=[10 20 30; 40 50 60;70 80 90] [a, b]= meshgrid(1:size(a,1), 1:size(b,1)) a(a,:) + b(b,:) or a={[1 2 3], [4 5 6]} b= {[10 20 30],[40 50 60],[70 80 90]} [a,b]=meshgrid(1:length(a),1:length(b)) cell2mat(a(a))+ cell2mat(b(b))

how to use different denpendency in one project with maven?(android) -

i use maven package app. want integrate leakcanary in debug version. need add <dependency> node pom.xml. want remove release version. how can that? have solution pom.xml debug version , pom release version. solution use shell modify pom.xml before package. better idea? maven:3.3.9 com.simpligility.maven.plugins:android-maven-plugin:4.4.3 you can maven profiles ; can host several pom elements: property values, configurations, dependencies, etc. enable 1 of more of these profiles -p when running command line, or e.g. in eclipse, specific entry in run as... window. here's brief example: <!-- dependencies declarations --> </dependencies> <profiles> <profile> <id>extralib</id> <properties> <!-- specify property values here --> </properties> <dependencies> <dependency> <!-- add dependency decl here --> <

r - Converting column with pipe delimited data into dummy variables -

i'm interested in taking column of data.frame values in column pipe delimited , creating dummy variables pipe-delimited values. for example: let's start with df = data.frame(a = c("ben|chris|jim", "ben|greg|jim|", "jim|steve|ben")) > df 1 ben|chris|jim 2 ben|greg|jim 3 jim|steve|ben i'm interested in ending with: df2 = data.frame(ben = c(1, 1, 1), chris = c(1, 0, 0), jim = c(1, 1, 1), greg = c(0, 1, 0), steve = c(0, 0, 1)) > df2 ben chris jim greg steve 1 1 1 1 0 0 2 1 0 1 1 0 3 1 0 1 0 1 i don't know in advance how many potential values there within field. in example above, variable "a" can include 1 value or 10 values. assume reasonable number (i.e., < 100 possible values). any ways this? another way using csplit_e splitstackshape package. splitting dataframe column a , fill 0 , drop original column. libr

C# how to make it efficient to list the directories on a ftp server -

i need content of file list files specific format ftp server. have read through directories , files, check if or contains file need, add file file list. however, there many directories, subdirectories, , kinds of files in ftp server, time-consuming that. know how can make more time efficient? since have mentioned directory path varies machine machine, need have collection of machines , there directory paths. need loop through directory paths. unfortunately need loop through every files (exclude unwanted). below pseudocode- loop each directory paths loop each files in directory paths excluding unwanted files types store required files in collection end loop end loop return files you may use parallel loop (tpl in .net) execute loops faster. refer- https://msdn.microsoft.com/en-us/library/dd460713(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/dd537609(v=vs.110).aspx

input - How to remove empty separators from read files in Python? -

here input file sample (z.txt) >qrst abcde-- 6 6 35 25 10 >qqqq abbde-- 7 7 28 29 2 i store alpha , numeric in separate lists. here output of numerics list #output : ['', '6', '', '6', '35', '25', '10'] ['', '7', '', '7', '28', '29', '', '2'] the output has space when there single digits because of way file has been created. there anyway rid of '' (empty spaces)? you can take advantage of filter none function that: numbers = ['', '7', '', '7', '28', '29', '', '2'] numbers = filter(none, numbers) print numbers see in action here: https://eval.in/640707

ubuntu - How can I troubleshoot SSL timeouts via curl? -

i'm getting timeout trying consume ups's online tools api through php + curl. issue started happening morning. can reproduce issue using curl directly on ubuntu 14.04 bash. however, on ubuntu 16.04, can connect without issues. ups support wasn't particularly helpful: which of these servers have been completed tls 1.2 migration not known. suggested make sure security protocol enabled tls 1.0, 1.1 , 1.2 time being. though having full stack, should minimized problems, negotiation utilizes highest agreed upon supported protocol both parties. here's verbose output on 14.04: root@ubuntu14-nyc2-01:/etc/ssl/certs# curl https://onlinetools.ups.com -v * rebuilt url to: https://onlinetools.ups.com/ * hostname not found in dns cache * trying 153.2.228.76... * connect 153.2.228.76 port 443 failed: connection timed out * trying 153.2.224.76... * after 86387ms connect time, move on! * connect 153.2.224.76 port 443 failed: connection timed out * failed connect onlin

How to read tag names from xml at any depth using xslt and How to segregate all the tag names and use as columns in table for SQL insert statement.? -

how read tag names xml @ depth using xslt? how segregate tag names , use columns in table sql insert statement. need xslt generate insert statement using xml tags columns table <xxx> <123> <sss>12</sss> <zzz>111</zzz> <aaa> <qqq>000</qqq> <q11>000</q12> <q22>333</q22> </aaa> <bbb> <lll>888</lll> <dd>eee</ddd> <111> <ss1>123</ss1> <vvv>777<vvv> <111> </bbb> </123> </xxx> insert sampletable(sss, zzz, qqq, q11, q22, lll, dd, ss1, vvv) values(12, 111, 000, 000, 333, 888, eee, 123, 777). need output.

regex - How to clean a .srt file without removing numbers that appear in the closed captions through VIM? -

it known .srt files structured in blocks having 3 underlying parts, example: 228 00:39:06,680 --> 00:39:13,460 lorem ipsum dolor sit amet now, let suppose in closed captions there excerpts representing speech of speaker quoting literary opus of else, additional example: 228 00:39:06,680 --> 00:39:13,460 according erasmus, book 1, chapter 23... problem: wish extract text .srt deleting frame number, frame duration without erasing, however, cardinal numbers appear in closed captions quotations through vim . attempts: using regular expression , substitute command, have found way "delete" duration line :%s/\d\d:\d\d:\d\d,\d\d\d --> \d\d:\d\d:\d\d,\d\d\d/ /g , numbers same idea, except searching each cardinal number entry option /gc bypass amidst text. however, have considerable amount of such quotations extract, cardinal number should maintained. selecting yes/no entries turns tedious task. since have lacking skill in using regex , presume there

selenium - How can I decide automation feasibility for web application? -

guys need decide feasibility of automation testing in web application. application developed in c#.net. can 1 guide me factor need consider automation testing. have basic knowledge of selenium webdriver using java, can test web application using it? application leasing application contains many calculations calculate plan. application contains many reports graphs analyse enquiries results. i suggest basic links start with http://www.softwaretestinghelp.com/choosing-automation-tool-for-your-organization/ http://searchsoftwarequality.techtarget.com/answer/how-to-choose-the-best-software-test-automation-tool-for-your-team http://www.xoriant.com/blog/software-testing-and-qa/selecting-right-test-automation-tool.html

android - How to know how much ram size my app needs? -

i new android , app resulted in outofmemoryexception . therefore have check how ram app using , try reduce it. two questions: how know ram size app using? normally, safe threshold app's ram size not cause outofmemoryexception ? thanks lot help! check out android studio's in-built memory monitor . find under android monitor > monitors and second part of problem can use activtymanager class' getmemoryclass () method. android doc.. return approximate per-application memory class of current device. gives idea of how hard memory limit should impose on application let overall system work best. returned value in megabytes; baseline android memory class 16 (which happens java heap limit of devices); device more memory may return 24 or higher numbers.

Iterate through array C++ -

this question has answer here: how iterate through list of numbers in c++ 6 answers newbie question c++ array as class app1{ int end = 3; public: int list[end]; void app1::addinput(){ for(int i=0; i<end; i++){ cout << endl << "enter elements in array: " << endl; cin >> n; list[i] = n; } } void app1::display(){ cout << endl << "display elements: " <<endl; for(int i=0; i<sizeof(list) / sizeof(list[1]); i++){ cout << << end; cout << list[i]; } cout << endl; } } but not display array contents you have few errors in code. have answered them in line comments can read through sequentially: class app1 { private: int end = 3; // hsould either declared in explicit public section made, or explicit

cmd - How to run c# code using notepad++? -

Image
i have trouble executing code have written in notepad++. have researched online, should edit path in system variable c:\windows\microsoft.net\framework64\v4.0.30319. have changed , it's still not working. after type in test.cs, windows form pop stating windows can't open file. here image of command line: here small code have written: using system; public class test { static void main() { console.writeline("***"); } } after compiling c# file, execute typing name in command prompt. don't use extension again. type test after compiling in cmd prompt, , you'll fine. can use test.exe to run instead of test.

Error in executing dynamic SQL Query with table variable in SQL Server 2008 -

these following parameters & table variable used executing dynamic sql query: declaration declare @squery varchar(max) declare @fyear nvarchar(10)='2016-2017' declare @tyear nvarchar(10)='2016-2018' declare @claimsum table ( claimtype nvarchar(max), jan decimal(19,6), feb decimal(19,6), mar decimal(19,6), apr decimal(19,6), may decimal(19,6), jun decimal(19,6), jul decimal(19,6), aug decimal(19,6), sep decimal(19,6), oct decimal(19,6), nov decimal(19,6), dec decimal(19,6), total decimal(19,6) ) dynamic sql query set @squery=n'select c1.claimtype, sum(c1.jan) ''jan '+@fyear+'-'+@tyear+''',sum(c1.feb) ''feb '+@fyear+'-'+@tyear+''',sum(c1.mar) ''mar '+@fyear+'-'+@tyear+''', sum(c1.apr) ''apr '+@fyear+'-'+@tyear+''',sum(c1.may) ''may '+@fyear+'-'+@tyear+''',sum(c1.jun) ''jun

ios - How do I pass an object into a view via presentViewController? -

how pass data view controller i'm presenting programmatically have created in ib? right i've got code pull view when user clicks button not clear how send data along view. i'm trying use code below being told "value of type uiviewcontroller has no member "data"" @ibaction func showpossbutton(sender: uibutton) { print("show data table.") let storyboard = uistoryboard(name: "main", bundle: nil) let vc = storyboard.instantiateviewcontrollerwithidentifier("posstable") var data:data! vc.data = data self.presentviewcontroller(vc, animated: true, completion: nil) } what doing wrong here? like rob has mentioned, must cast instantiated view controller specific class has data field as! *insertviewcontrollerclassname*

How to gracefully restart the Elixir App? -

i have supervised elixir app running :- mix_env=dev mix run . if change code, how can restart app gracefully not killing first. (just gracefully restart supervisord process using hup) the nitty gritty details of actual code hot swapping can find in answer question: achieving code swapping in erlang's gen_server as how automate process of reloading can have @ phoenix , how reloading. summary of uses fs lib monitor file system changes , invoke process similar 1 outlined in answer question above.

CustomView not rendered if I put inside a grid with RowDefinitions in Xamarin.Forms -

i have loaded views inside grid below, <grid> <grid.columndefinitions> <columndefinition width="*" /> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="auto" /> <rowdefinition height="*" /> <rowdefinition height="auto" /> </grid.rowdefinitions> <entry x:name="searchtextbox" grid.row="0" horizontaloptions="fill" placeholder="search" verticaloptions="fill" /> <listview x:name="listview" grid.row="1" horizontaloptions="fill" verticaloptions="fill" /> <local:customlistview x:name="customview" grid.row="0"

spring mvc - how to upload multiple files with form data to database using angularjs -

this code uploading file nwant upload multiple files form data @ same time using spring mvc,please me how using spring , angularjs http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"> <div ng-controller = "myctrl"> <input type = "file" file-model = "myfile"/> <button ng-click = "uploadfile()">upload me</button> </div> <script> var myapp = angular.module('myapp', []); myapp.directive('filemodel', ['$parse', function ($parse) { return { restrict: 'a', link: function(scope, element, attrs) { var model = $parse(attrs.filemodel); var modelsetter = model.assign; element.bind('change', function(){ scope.$apply(function(){ modelsetter(scope, element[0].files[0]); });

PHP - mktime() function returning wrong time -

Image
the problematic code i trying build time using string values extracted file. code runs. $hour = "18"; $minutes = "0"; $month = "28"; $day = "4"; $year = "2016"; echo("<div>"."current php version: " . phpversion()."</div>"); echo("<div>hour :: ".(int)$hour."</div>"); echo("<div>minutes :: ".(int)$minutes."</div>"); echo("<div>month :: ".(int)$month."</div>"); echo("<div>day :: ".(int)$day."</div>"); echo("<div>year :: ".(int)$year."</div>"); $built_time = mktime((int)$hour,(int)$minutes,0,(int)$month,(int)$day,(int)$year); echo("<div> built time [y-m-d h:i:s]: ".date( 'y-m-d h:i:s',$built_time)."</div>"); the wrong results the o

Access Hadoop with kerberos failed -

i install hadoop , kerberos, but when exec hadoop fs -ls / error has bean occured. [dannil@ozcluster06 logs]$ hadoop fs -ls / 16/09/13 11:34:39 warn ipc.client: exception encountered while connecting server : javax.security.sasl.saslexception: gss initiate failed [caused gssexception: no valid credentials provided (mechanism level: failed find kerberos tgt)] ls: failed on local exception: java.io.ioexception: javax.security.sasl.saslexception: gss initiate failed [caused gssexception: no valid credentials provided (mechanism level: failed find kerberos tgt)]; host details : local host is: "localhost/127.0.0.1"; destination host is: "192.168.168.46":9000; i can see datanode , namenode has start jps 20963 datanode 21413 secondarynamenode 20474 namenode 22906 jps i add principal hdfs/oz.flex@oz.flex , http/oz.flex@oz.flex ,then use xst -norandkey -k hdfs.keytab hdfs/oz.flex@oz.flex http/oz.flex@oz.flex generate hdfs.keytab kadmin.local:

verilog - How to increment 4 bit counter by 1 bit when a button is pressed -

i writing stop watch program on nexys4 fpga. can start, stop, , reset stopwatch, i'm having trouble implementing increment feature. increment feature button, when pressed, increment clock 1 millisecond. if 7 segment display showing 1:002 , increment button pressed, display show 1:003. here snippet of code counter: always @ (posedge (clk), posedge(rst)) begin if (rst == 1'b1)begin dig0 <= 4'b0000; dig1 <= 4'b0000; dig2 <= 4'b0000; dig3 <= 4'b0000; end //increment if inc else if(state == 2'b11)// && dig3 < 4'b1001)begin begin dig0 <= dig0 + 4'b0001; state <= 2'b00; end //only continue if cen 01 & not inc else if(cen == 2'b01)begin //add 1 first digit till 9 dig0 <= dig0 + 1'b1; //reset if == 10 if(dig0 > 4'b1001)begin dig0 <= 4'b0000; //add 1 second digit (when first resets) till 9

C# unit testing - ordered test with runsettings file -

i'm trying develope automated regression test framework unit tests. use ordered test combine different test steps , combine them in easy use way. configuration purposes wanna use runsettings file, testrunparameters. works without errors while executing each test itself . if execute tests using orderedtest , testcontext object use access testrunparameters doesn't contain them anymore. debuged object while testing method directly , while testing ordered tests well. in first scenario object has needed properties when executing tests orderedtest object looks total different. there majore difference between these 2 types of execution? the different testcontext objects: execution single test picture execution ordered test picture the error following: ergebnis stacktrace: @ regression.filesystem.filesystemtestinitializer(testcontext context) in \filesystem.cs:line 18 ergebnis meldung: class initialization method regression.filesystemtestinitializer threw except

geolocation - Notification regarding your location in Android app -

i want create android app asks user location input , runs in background. whenever user within 1km radius of location app display notification “within 1 km of xyz location”.. if nor same,can suggest me similar solution. thank you. step : 1 firstly latitude , longitude url you. how can find latitude , longitude address? step :2 save latitude , longitude step :3 onlocationchanged method can required distance, after can generate notification. may you.

Appcelerator with syntax javascript lambda -

Image
i'm download old project have build. have compilation error this: i think appcelerator studio, unknow syntax lambda of javascript. for case, there plugin should install? you can't install third-party plugins in appcelerator studio make work. it supports es5. believe lambda expressions part es6. this has more info: http://docs.appcelerator.com/platform/latest/#!/guide/ecma-262-5_compliance

apache ignite cross cache query - cannot parse sql -

im trying query has inner sub queries between 2 classes. every time try it, gives me sql parse error. therefore figure out problem, did basic cross cache query , gives me same parse error. ideas? cacheconfiguration<integer, myclass1> cfg = new cacheconfiguration<>("class1cache"); cfg.setindexedtypes(integer.class, myclass1.class); igniteconfiguration ignitionconfig = new igniteconfiguration(); ignitionconfig.setcacheconfiguration(cfg); ignite ignite = ignition.getorstart(ignitionconfig); ignitecache<integer, myclass1> cache = ignite.getorcreatecache(cfg); stringbuilder builder = new stringbuilder(); builder.append(" select "); builder.append(" c.name "); builder.append(" "); builder.append(" myclass1 c, \"class2cache\".myclass2 b "); builder.append(" "); builder.append(" c.name = b.name "); sqlfieldsquery qry = new sqlfieldsquery(builder.tostring()); // execut

git - Not how but why a committed file cannot be ignored easily (Practical Purpose of "Assume Unchanged")? -

Image
hi interested know design behind git such committed files cannot ignored directly have assumed unchanged. why there tight coupling between them requires "assumed unchanged" solve it.

python - How to crop zero edges of a numpy array? -

i have ugly, un-pythonic beast: def crop(dat, clp=true): '''crops zero-edges of array , (optionally) clips [0,1]. example: >>> crop( np.array( ... [[0,0,0,0,0,0], ... [0,0,0,0,0,0], ... [0,1,0,2,9,0], ... [0,0,0,0,0,0], ... [0,7,4,1,0,0], ... [0,0,0,0,0,0]] ... )) array([[1, 0, 1, 1], [0, 0, 0, 0], [1, 1, 1, 0]]) ''' if clp: np.clip( dat, 0, 1, out=dat ) while np.all( dat[0,:]==0 ): dat = dat[1:,:] while np.all( dat[:,0]==0 ): dat = dat[:,1:] while np.all( dat[-1,:]==0 ): dat = dat[:-1,:] while np.all( dat[:,-1]==0 ): dat = dat[:,:-1] return dat # below gets rid of zero-lines/columns in middle #+so not usable. #dat = dat[~np.all(dat==0, axis=1)] #dat = dat[:, ~np.all(dat == 0, axis=0)] how tame it, , make beautiful? try incorporating this: #

express - When to call next() in node.js when using Firebase to fetch data -

there easy solution problem, cannot seem wrap head around problem. the problem is: using node.js express.js framework app creating. using firebase.js database. starting understand middleware , how can use fetch data, before sending response client. my problem however, if want loop through child nodes in firebase, want use datasnap.foreach() so: var scoresref = db.ref("scores"); scoresref.orderbyvalue().on("value", function(snapshot) { snapshot.foreach(function(data) { console.log("the " + data.key + " dinosaur's score " + data.val()); }); }); so lets have module should dinosaurs value, this: var dinomodule = {}; dinomodule.getdinosaurs = function(req, res, next){ var dinoref = firebase.database().ref("dinosaurs"); dinoref.orderbyvalue().on('value', function(snapshot){ snapshot.foreach(function(data){ // data here // calling next() here wrong }); //

excel - vba: Find function with .rows returning an unexpected result -

i trying use find function make wider code applicable multiple instances of same basic table. table headers left of table code preschoolstart = (sheets("rotas").columns(3).find(what:="school starters", lookat:=xlwhole, searchdirection:=xlnext, matchcase:=false).row) + 1 which finds header "school starters" , sends reference cell below contain first of several names in category "preschool". this works in instance above , in 2 other instances same format when used below case returns row value far below expected. staffstart = (columns(3).find(what:="staff", lookat:=xlwhole, searchdirection:=xlnext, matchcase:=false).row) + 1 my original theory why there other headers staff in name confusing things have been fixed changes made on advice of @jeeped , @rory. preschoolers section image staff section image note: actual problem was inadvertently writing different same cell , hadn't thought check staffstart variable differe

javascript - On clicking back button, go to home page if navigating through hamburger menu -

so below present navigation scenario app: menu after clicking on hamburger icon home profile saved address wallet logout none of above screens dependent on of other screens listed above. hence, navigate using navigate.replace(). know, cannot pop or go if use replace. what wanna achieve how gmail android app works. if navigate using hamburger menu , hit hardware button on android, go home screen before exiting app. in scenario, directly exits app. below have presented small snippet of work until now: app.android.js: /** * sample react native app * https://github.com/facebook/react-native * @flow */ import react, { component } 'react'; import { stylesheet, text, view, touchableopacity, backandroid, navigator } 'react-native'; import drawer 'react-native-drawer'; // import icon close button import icon 'react-native-vector-icons/fontawesome'; // import route components import home './customer/home/home';