Posts

Showing posts from March, 2010

amazon web services - Deploy same code to two environments in AWS elastic beanstalk -

i have 2 environments in same elastic beanstalk application, 1 web environment , other worker environment, share same code. now have run eb deploy web && eb deployer worker make work, takes few minutes each deployment, possible deploy code these 2 environments in 1 command?

java - why void method can not be called in system.out.println -

this question has answer here: the method println(boolean) in type printstream not applicable arguments (void) 6 answers can please answer why code giving error? package hello; public class hello { public void eat() { system.out.println("eating"); } private string run() { return "dwedsdfsdfsdf fsdf rgdsfg"; } public static void main(string[] args) { //system.out.println("hello bhopi"); //hello hello = new hello(); hello mahir = new hello(); //string y = mahir.eat(); system.out.println(mahir.run()); system.out.println(mahir.eat()); } } 1) no method may accept parameter invocation void method. if pass void argument method. 2) here println() refers printstream.println() method out field declared printstream . compile fine when invo...

Windows hijacked WebStorm's the Ctrl+Shift+N shortcut -

until day or 2 ago i've been able navigate files in webstorm using ctrl+shift+n . today, windows has hijacked shortcut , launches new edge window. any idea how can override windows , use ctrl+shift+n in webstorm again? it ends clipboard-history application clipx has hotkey of "navigate" set ctrl + shift + n . setting none resolved it. i've had application long time, i'm still not sure why it's navigate hotkey got set, or why launch edge instead of default browser (chrome).

amazon web services - CI/CD process with Jenkins or Chef -

Image
suppose have following jobs: 1: detect there new war file on s3. 2: pull s3 bucket. 3: stop wildfly server 4: replace war file on wildfly server 5: restart wildfly server the diagram using jenkins example. wildfly , appeon on ec2 instance. because of licensing issue, can't use cft create new instance every time, have assume these steps done within ec2 instance. let's assume failover not issue. two routes done, 1 using jenkins, jenkins watch s3 bucket, , stop, replace, restart server , war, without creating new instance every time. the other using chef on instance, check s3 bucket every 5 minutes, example, if there new war file, pull down. (suppose war file name doesn't change...), using magic script stop server, replace war file, restart server, run on same instance. since don't know ci/cd, jenkins, or chef. so advice or example help! in advance! if you're doing, chef waaaaaay overkill. simple bash script run cron (or systemd timer unit if w...

Spring security, thymeleaf and cookie -

actually, use spring boot, thymeleaf , spring security. security splitted in 2 in application. one mvc , other 1 rest call. i search way if login ok create cookie login/password able add header every ajax call. headers: { "authorization": "basic " + $.cookie('cookie-authorization') }, so search create cookie if login success edit possible on server side? you can use code official doc include tokens in ajax calls. $(function() { var token = $("meta[name='_csrf']").attr("content"); var header = $("meta[name='_csrf_header']").attr("content"); $(document).ajaxsend(function(e, xhr, options) { xhr.setrequestheader(header, token); }); }) hope helps.

security - How to secure/harden an Ansible Machine -

we have bunch of servers, want manage, update , on ansible. there problem, ansible-server needs have root access managed machines. what measures secure ansible machine or clients, if got security breach attacker not have root access servers?

ember.js - Ember - using api/server data -

i new ember , see far. have done tutorial , found to pretty easy , running. question has using mirage vs real data. used mirage stub in data link to real data. think should not hard since have models..etc set need call api instead of mirage. have not seen clean example of how best this. thanks you can turn mirage on/off requests per environment in config/environment.js e.g. off development, on testing, // config/environment.js if (environment === 'development') { env['ember-cli-mirage'] = { enabled: false }; } if (environment === 'test') { env['ember-cli-mirage'] = { enabled: true }; } or if leave mirage on everything, allow specific endpoints passthrough : http://www.ember-cli-mirage.com/docs/v0.3.x/configuration/#passthrough

c# - How to handle different category of logged in user in asp.met mvc application -

i in learning phase of asp.net mvc 5 web development , stuck @ 1 place. so, have website have 3 flow. non loggedin user authenticated user (tenants) authenticated user (owner) now during registration have added checkbox capture if user going tenant or owner. now view file 3 (non loggedin, owner , tenant) needs different. as of know how handle two type of user (non-logged in , (tenant)logged in) . in _viewstart.cshtml file did below @{ if(user.identity.isauthenticated) { layout = "~/views/shared/_loggedinlayout.cshtml"; } else { layout = "~/views/shared/_layout.cshtml"; } } so far good. can see there no identificaiton of "tenant , owner user". given fact have property during registration true or false tenant , owner. i want below @{ if(user.identity.isauthenticated) { if(user.istenant) {layout = "~/views/shared/_loggedtenantlayout.cshtml"; } else{layout =...

python - Create new columns by grouping and aggregating multicolumns in pandas -

i have dataframe 50 columns, of them period_start_time, id, speed_throughput, etc. dataframe sample: id period_start_time speed_througput ... 0 1 2017-06-14 20:00:00 6 1 1 2017-06-14 20:00:00 10 2 1 2017-06-14 21:00:00 2 3 1 2017-06-14 21:00:00 5 4 2 2017-06-14 20:00:00 8 5 2 2017-06-14 20:00:00 12 ... i have tried go create 2 new columns grouping 2 columns(id , period_start_time) , find avg , min of speed_trhoughput. code i've tried: df['throughput_avg']=df.sort_values(['period_start_time'],ascending=false).groupby(['period_start_time','id'])[['speed_trhoughput']].max() df['throughput_min'] = df.groupby(['period_start_time', 'id'])[['speed_trhoughput']].min() as can see, there 2 ways i've tried, nothing works. error message received both attempts: typeerr...

Get Php variable value from while loop into a javaScript -

i have ajax function connects database fetch " rows " of info. achieved using while..fine.. i want value of while loop assigned radio button. when click each radio button, want display value assigned it. i.e. while($row = mysqli_fetch_array($res, mysqli_assoc)) { $mn = $row['mn']; echo $mn . "<td onclick = \"vote()\"> <input type = \"radio\" id = \"votecan\" value = \"$mn\"> </td> </tr>"; } echo "</table>"; the above query displays multiple results. i have javascript function fired when user clicks of radio button, javascript function getting value of first row. it's not getting other rows. please appreciated. try this while($row = mysqli_fetch_array($res, mysqli_assoc)) { $mn = $row['mn']; echo $mn . "<td onclick = \"vote(this)\"> <input type = \"radio\" id = \"votecan\...

ios - UIGestureRecognizer blocking TableView Editing -

Image
i have uipangesturerecognizer , tableview in editing mode. when want move tableviewcell , gesture blocks it. how can disable this? i want disable gesture recognizer when user drags cell using uitableviewcellreordercontrol. the code repository on github. downloaded project git . please use gesture.cancelstouchesinview = false in viewdidload method.

linux - Why is my new service script parameter ignored? -

i added optional parameter /etc/init.d/postgresql specify directory. if no directory specified, command applied clusters. running script in /etc/init.d executes commands correctly: cd /home/pi; clear # - omit /etc/init.d/postgresql start ps aux | grep pg /etc/init.d/postgresql stop dev_5433 ps aux | grep pg # - stops dev_5433 cluster, [dev_5433 cluster stopped, good][2] ... running script service not: cd /home/pi; clear # - omit /etc/init.d/postgresql start ps aux | grep pg service postgresql stop dev_5433 ps aux | grep pg # - stops clusters, should stop dev_5433 cluster [stops clusters instead of one][4] why seem ignore new parameter when execute service commands?

Set “publish to web” in Google spreadsheet using Drive API (PHP) -

i trying use google drive api set google sheet "publish web" mode can embed on website. using drive api in php:- // api client , construct service object. $client = getclient(); $service = new google_service_sheets($client); $driveservice = new google_service_drive($client); /* $copiedfile = new google_service_drive_drivefile(array('name' => 'project plan')); $responsebody=$driveservice->files->copy("1hajkeox4hhlk4aocvluuvftjbkphfklg1gg9-hsgh7u", $copiedfile); $sheet_id=$responsebody->id; */ $sheet_id="1tyktonmpaaxgas5ylnn8ntzpjtdesuyidhakhap8amk"; $revisions=$driveservice->revisions; $sheetinformation =$revisions->listrevisions("1tyktonmpaaxgas5ylnn8ntzpjtdesuyidhakhap8amk"); $revisions=$sheetinformation->getrevisions(); $count=count($revisions); $revision_id=$revisions[$count-1]->id; $finalrevision=$driveservice->revisions->get($sheet_id,$revision_id); $finalrevision->publishauto=true; $...

deep learning - Output from fully connected network in tensorflow -

weights = { # 5x5 conv, 1 input, 32 outputs 'wc1': tf.variable(tf.random_normal([5, 5, 1, 32])), `# 5x5 conv, 32 inputs, 64 outputs` 'wc2': tf.variable(tf.random_normal([5, 5, 32, 64])), # connected, 7*7*64 inputs, 1024 outputs 'wd1': tf.variable(tf.random_normal([7*7*64, 1024])), # 1024 inputs, 10 outputs (class prediction) 'out': tf.variable(tf.random_normal([1024, n_classes])) } in code,the output connected layer given 1024 cannot understand calculation '1024' generated , cannot find satisfactory answer tensorflow documentation.and how ouput size affects prediction result. in advance. a number 1024 empirical, depending on data , goal. in general, think question has many ramifications answer succinctly. i'll answer in restricted , assumed context of question: convolutional nets. kind of network describe have hidden layers more nodes target number of classes (this classifier, right?). in case last hidden layer...

PHP subtracting a week from two existing date variables -

php 7.1.7 i have custom work processing week runs saturday through friday. code below, i'm selecting current processing week $current_date '08/25/2017' , returns range of '08/19/2017' (saturday) '08/25/2017' (friday). what i'm trying previous work processing week. '08/19/2017' selected, should '08/12/2017' through '08/18/2017'. i'm confused why, when i'm subtracting 1 week $saturday , $friday dates, new 'previous working week' variables off. the output of php is: this reporting week: 08/19/2017 08/25/2017 previous reporting week: 12/31/1969 12/31/1969 <?php #------------ working ------------------------- $current_date = "08/25/2017"; if(date("l", strtotime($current_date)) == "saturday"){ $saturday = strtotime($current_date); }else{ $saturday = strtotime($current_date . " previous saturday"); } $friday = strtotime(date("m/d/y"...

datetime - RadGrid filter: GridDateTimeColumn style is missing -

Image
i using griddatetimecolumn filter date, cant figure out why style missing. if missing css reference should be?

android - retain Timer value after I leave and comeback to the fragment -

i have bottom navigation bar , activity hosts 4 fragments. open fragment scratch 1 of fragments has timer feature need retain value unless user explicitly turns off. started savedinstance state takes lot of work maintain time counter in app closed scenario, looking efficient solution. should best strategy ? here doing call fragments. fragment named f3 1 contains timer. public class mainactivity() extends appcompatactivity{ bottomnavigation.setontabselectedlistener((position, wasselected) -> { if (position == 0) { if (!wasselected) getfragmentbytag(f1.tag); } else if (position == 1) { if (!wasselected) getfragmentbytag(f2.tag); } else if (position == 2) { if (!wasselected) getfragmentbytag(f3.tag); } else if (position == 3) { if (!wasselected) ...

java - Using UML Diagrams as clickable objects -

Image
i want create site used internally explain how our lengthy, complex java code works. have been able create uml class, components, , package diagrams , want able embed diagrams site. obviously, can embed .png or other style of image, do, example, make possible click on package , have go exploded view of package's contents. to try , better clarify question, i'll try give more detailed illustration of mean. suppose have uml diagram of components , want each of these components treated clickable objects, similar site have images contain href link properties. would open new page contains uml diagram showing codes, libraries, etc particular component . is possible embed uml diagrams that, lack of better term, contain object href property each component ? i've read, not common use umls , have found no documentation supports ability; leads me believe not possible. however, maybe i've missed or knows way this? finding way implement become more helpful when showing ...

javascript - Prevent website from requesting external src -

this question has answer here: block mixed content 1 answer so i'm working on website make work on ssl. thing there external resource been asked http apparently not have control, or if have somewhere in php code. is there way jquery/javascript prevent 1 website request external src image website loads https? search , replace http:// // load correct protocol.

python - Inserting a value (evaluated in views.py) to database in views.py -

here models.py file: class soundfile(models.model): date_created = models.datetimefield(auto_now_add=true) # date of creation name = models.charfield(max_length=50, default='sound file') # name of file during upload nameonly = models.charfield(max_length=200, default='filename') # song identifier without file extension identifier = models.charfield(max_length=50, default='xxxxxxx') # song identifier without file extension filesize = models.integerfield(default=0) # file size in bytes uploaded_file_url = models.charfield(max_length=200, default='url') # file url duration = models.integerfield(default=0) no_of_frames = models.integerfield(default=0) score = models.floatfield(default=0.0) i need alter 'score' in views.py evaluated function in views.py only. views.py: from .models import soundfile def rnp(request, nameonly, no_of_frames): # ... # nameonly unique every row in database file = soundfi...

php - Creating CRUD for quiz website using Laravel. Best practices concidering Create part -

i not asking complete solutions, best practices considering uploading quizes website. a single quiz question may have several answers , image. my guess having questions in excel spread sheet convenient way administrator load them. i've found tool handling excel docs: https://github.com/maatwebsite/laravel-excel but don't know how make easy load images. seems must done in 2 steps: first, load excel spread sheet, load images. or images can uploaded cloud , links these images included excell (i came idea during writing question) but there others, more effecient ways?

sql - How to validate (compare for sameness) two arraylists and output CSV file as results JAVA -

this question has answer here: writing array of strings down column of csv file in java 2 answers writing per line new csv file (java) 2 answers csv api java [closed] 11 answers i have 2 arraylists (open working other collections) , need output csv file determines whether contents of these arraylists same; cell cell comparison essentially. arraylists taken result set , sorted. this: sourcedata = (9, orlando, feb 28, 668, lloydtown, dec 1, etc) targetdata = (9, caledon, jan 19, 38, south hark, dec 1, etc) what attempted take first value of first arraylist, first value of second arraylist , compare them , print cvs file. for (int = 0; <sizeofdata; i++) { if (sourcedata.get(i)....

html - What is better way between loading pages into one page or making every page for it self -

i made full website 4-5 different pages this: index.php contains nav-bar , content div by jquery load(); loading inside content div every other page without reloading page. is bad, slow or better making each page redirecting?

javascript - i18next multilanguage site with URL change -

i trying add multiple language support web-site, doesn't have .php files , doing i18next . urls need www.mysite/en/about/. decided make that window.history.pushstate("", "", '/en' + window.location.pathname); and on changing language: $('.lang').on("change", function() { window.history.pushstate("", "", '/' + $(this).val() + window.location.pathname.substring(3)); i18next.changelanguage($(this).val(), function() { $('.page_text').localize(); $('.info').localize(); }); }); the problem when shares link www.mysite/fr/about/ gets error. can redirect www.mysite/about/ via .htaccess, how can language "/fr" parameter? if know other ways around without using .htaccess, i'll glad hear them out. thank help. edit: the error 404. routing folders .html files.

elasticsearch - How to give tokens from certain tokenizers more weight? -

i have following (simplified) data [ { id: 1, customernumber: "0008", name: "bob" }, { id: 2, customernumber: "0854", name: "sue" }, { id: 3, customernumber: "0041", name: "larry" } ] the context auto-complete search bar @ top of application. i'm using custom regex tokenizer trim leading zeros user need not enter them. gets me tokens id 1 => "8" id 2 => "854" id 3 => "41" i have edge-n-gram tokenizer applied gives me tokens id 1 => "8" id 2 => "854", "85", "8" id 3 => "41", "4" our users consider "0008" better match query "8" "0854". when search "8" getting tons of results "08**" ranking higher "0008". how make "0008" rank higher "0854" when searching "8"? sometimes users include leading zeros in que...

In R: Selecting and replacing a sequence into a new column -

i have .csv looks @ waste generation in us, loaded in r studio. creating path waste shipments shipper receiver. tried visualizing data below give sense of need. describe it, create new column called "path" takes second value of data$receiver state, , lays below first value of data$shipper state. repeat every series of 2 rows. so far, have tried selecting sequence of data$shipper, , odd sequence of data$receiver, not know how overlay them data$path. currently, data looks this shipper | receiver ---------------------- kansas | wyoming kansas | wyoming texas | vermont texas | vermont idaho | ohio idaho | ohio and this: shipper | receiver | path ---------------------------- kansas | wyoming | kansas kansas | wyoming | wyoming texas | vermont | texas texas | vermont | vermont idaho | ohio | idaho idaho | ohio | ohio thank help! i sure there other simpler ways this. use basic loops. please see if below code works you: ...

ios - DispatchGroup doesn't work as expected -

i have made dispatchgroup , run 2 async tasks. 1 on main , other 1 on global() . as long understand, dispatchgroup.notify 's block should invoked once tasks done doesn't work thought. class que { let group = dispatchgroup() init() { group.notify(queue: .main) { print("group done") } } func run() { doc() dod() } fileprivate func doc() { group.enter() dispatchqueue.main.async(group: group) { var rst = 0 idx in 0 ..< 500 { rst += idx } print("work item c done") self.group.leave() } } fileprivate func dod() { group.enter() dispatchqueue.global().async(group: group) { var rst = 0 idx in 0 ..< 50 { rst += idx } print("work item d done") self.group.leave() } } } ...

How to implement full text search on complex nested JSONB in Postgresql -

i have pretty complex jsonb stored in 1 jsonb column. db table looks like: create table sites ( id text not null, doc jsonb, primary key (id) ) data storing in doc column complex nested jsonb data: { "_id": "123", "type": "site", "identification": "custom id", "title": "site 1", "address": "uk, london, mr tom's street, 2", "buildings": [ { "uuid": "12312", "identification": "custom id", "name": "building 1", "deposits": [ { "uuid": "12312", "identification": "custom id", "audits": [ { ...

c# - ASP.NET GridView - Click on a cell, edit, and update SQL Server database -

i working on asp.net web application in visual studio 2017. on 1 of .aspx web pages, have gridview displays table sql server. i trying create controls user on client side can click on cell in gridview, cell turns textbox, user can put in new value, , upon leaving cell or pressing enter, gridview , sql server table update show new value. in addition when cell clicked, delete row button generated. if delete row button clicked, row containing selected cell deleted gridview , sql server table. lastly, there needs add row button @ bottom of gridview. clicking add row button creates new row in gridview, first cell of row turns textbox, user can put in value, , upon leaving cell or pressing enter, gridview , sql server table update show new row. i dynamically generate gridview autogeneratecolumns="true" , bind gridview in code behind. if possible, keep way , not hardcode sql server table columns gridview. here current markup gridview: <asp:gridview id="grid...

node.js - Find and merge all package.json files into one using jq in bash? -

how can find package.json files , merge them 1 file using jq within bash? following snippet far have gotten, appends files: find ../../projects -maxdepth 4 -type f -name "package.json" \ -exec cat {} + | jq -s . > $(curdir)/node/.tmp/package.json i have tried using 'add' seems overwrite target each time without merging two. my project structure initially looks this: \ projects \ webapp \ package.json \ service \ package.json \ admin \ package.json \ solutions \ killersolution makefile \ node and should after make prenode (see below): \ projects \ webapp \ package.json \ service \ package.json \ admin \ package.json \ solutions \ killersolution makefile \ node \ .tmp \ package.json <- created i using makefile kick off: prenode: @find ./node -type d -name ".tmp" -exec rm...

git - How to use difftool and mergetool on Windows 10 Ubuntu bash -

i use windows 10 ubuntu bash. want use visual diff/merge tool git. installed p4merge on windows (followed artice ) , configured git .gitconfig file following way (i adjusted paths accessible windows 10 ubuntu bash): [merge] tool = p4merge [mergetool "p4merge"] path = /mnt/c/program files/perforce/p4merge.exe [mergetool] prompt = false [diff] tool = p4merge [difftool "p4merge"] path = /mnt/c/program files/perforce/p4merge.exe [difftool] prompt = false additionally, added following folder bash path variable in .bashrc make callable anywhere: export path=$path:"/mnt/c/program files/perforce" so problem if call git difftool in bash - investigate changes p4merge - got following messages in bash: unable translate current working directory. using c:\windows\system32 . the p4merge application started right after call gives following message: error: ... point invalid file . if understand right, problem may emanate ...

unity3d - what will happen with unity LoadSceneAsync -

everyone.i'm beginner unity programming.i try first game.because game hiccup when clicking play button, try new empty scene preload main scene.after attempt, did it.but after loading arrives 100%, game hiccup 1 second, enter main scene. i want know: 1.with loadsceneasync method load main scene, , include pool manager method in main scene?or include game objects in hierarchy of main scene? 2.if want preload pool manager in load scene, can connect load progress ui pool manager load progress?

Cache query performance Spark -

if i'm trying cache huge dataframe (ex: 100gb table) , when perform query on cached dataframe perform full table scan? how spark index data. spark documentation says: spark sql can cache tables using in-memory columnar format calling spark.catalog.cachetable("tablename") or dataframe.cache(). spark sql scan required columns , automatically tune compression minimize memory usage , gc pressure. can call spark.catalog.uncachetable("tablename") remove table memory. http://spark.apache.org/docs/latest/sql-programming-guide.html#caching-data-in-memory i didn't understand above statement, helpful if explain in detail below statement or how optimizes query on large cached dataframe "then spark sql scan required columns , automatically tune compression " when perform query on cached dataframe perform full table scan? how spark index data. while minor optimizations possible, spark doesn't inde...

Modify mysql tp add prefix and to be autoincremented to mysql field -

is there option alter table gather required functionality ? my table has id(int), pal_id(varchar,50) ... @ time id autoincremented unique , key, need make pal_id auto incremented, field values has prefix ex: pal0001 i have tried solution how make mysql table primary key auto increment prefix doesnt work me.

python - Extracting values from pandas DataFrame using a pandas Series -

i have pandas series contains key-value pairs, key name of column in pandas dataframe , value index in column of dataframe. for example: series: series then in dataframe: dataframe therefore, dataframe want extract value @ index 12 dataframe 'a', 435.81 . want put these values series, { 'a': 435.81 , 'aap': 468.97,...} my reputation low can't post images images instead of links (can fix this? thanks!) i think indexing you're looking for. pd.series(np.diag(df.loc[ser,ser.axes[0]]), index=df.columns) df.loc allows index based on string indices. rows given values in ser (first positional argument in df.loc ) , column location labels of ser (i don't know if there better way labels series ser.axes[0] ). values want along main diagonal of result, take diagonal , associate them column labels. the indexing gave before works if dataframe uses integer row indices, or if data type of series values matches dataframe row indices. i...

android - How can I make multiple app flavors use the same google-services.json file? -

i have 1 google-services.json file, 1 application id, connected 1 firebase "app" in 1 firebase "project," used variety of flavors of android app. my flavors branded differently, work same, , want analytics data of them end in same place in firebase. however, (of course) have android application ids/package names suffixed differently, , none of flavor package names match 1 in google-services.json, doesn't have suffix @ all. i've seen many ways connect different flavors of android app different firebase "apps" in same firebase "project," that's not want do: want connect different android app flavors same firebase "app." is there way firebase, or should elsewhere? thanks, dan wiebe indeed previous answer not enough answer question i've created step step guide. step step build application product flavor want default. remove apply plugin: 'com.google.gms.google-services app/build.gradle . plu...

What decides the color of the tab bar in a Xamarin.Forms tabbed page? -

i use same color background of area @ top of 1 of screens. does know how color decided. xamarin preset or ios , android present color? they defaults in each platform. android via it's theme , ios default properties. however if want change it, can in xamarin.forms project. var tabbedpage = new tabbedpage() { barbackgroundcolor = color.black, bartextcolor = color.white }; or set properties in xaml.

How to convert a dataframe to a matrix in R -

i want transfer named vector matrix , fill missing values (fill 0s). for example, have dataframe this: col1 col2 col3 cancer1 gene1 2.1 cancer1 gene2 2.51 cancer1 gene3 3.0 cancer2 gene1 0.9 which has 2 columns of names: col1 , col2 . want transform matrix, like: cancer1 cancer2 gene1 2.1 0.9 gene2 2.51 0 gene3 3.0 0 if there missing values in vector, fill 0s. how can efficiently in r? you can use tidyr package: tidyr::spread(mydata, col1, col3, fill = 0) # col2 cancer1 cancer2 # 1 gene1 2.10 0.9 # 2 gene2 2.51 0.0 # 3 gene3 3.00 0.0 data: mydata <- structure(list(col1 = structure(c(1l, 1l, 1l, 2l), .label = c("cancer1", "cancer2"), class = "factor"), col2 = structure(c(1l, 2l, 3l, 1l), .label = c("gene1", "gene2", "gene3"), class = "factor"), col3 = c(2.1, 2.51, 3, 0.9)), .names = c("col1"...

javascript - AngularJS, input textbox not even showing -

i'm running basic default boiler plate code , edited file: app.component.html <input type="text" [(ngmodel)]="name"> <p> {{name}} </p> app.component.ts import { component } '@angular/core'; @component({ selector: 'app-root', templateurl: './app.component.html', styleurls: ['./app.component.css'] }) export class appcomponent { name = ''; } but literally nothing. there blank page. doing wrong? seems basic since ngmodel directive included in formsmodule , have import , add module inside imports metadata option of appmodule . code import { ngmodule } '@angular/core'; import { formsmodule } '@angular/forms'; //<-- formsmodule import import { browsermodule } '@angular/platform-browser'; import { appcomponent } './app.component'; @ngmodule({ imports: [ browsermodule, formsmodule ], //<-- added formsmodule imports opt...

android - How can I query firebase database with text search -

in android app making have implemented search bar user may type in in hopes of finding in database. have set result come up, if spelled , completely. make can bring results user typing, , if spelled incorrectly , similar. have read possible built in query options firebase library, don't seem support looking for. there way relatively add project? understand predictive text searches not created, there library can import? building off of martin's answer, if want show if off little filter. databasereference.orderbychild('_searchlastname') .startat(querytext) .limittofirst(10) //return 10 results ... i assume can convert list of strings, give of results starting your query , next 9 more want. from here, want filter based on either contains or startswith public list<string> filter(list<string> listtofilter, string query){ list<string> results = new arraylist(); for( string string : listtofilter){ if(string....

python - Converting specific rgb values -

i trying create code converting rbg values of specific pixels in picture. here code have far: so have gotten far inputting new rgb values new color of pixel, stumped how input pixel. thanks, appreciated! this came with. from pil import image, imagefilter print("enter image file:") myimage = input() try: original = image.open(myimage) im = original.load() except: print('invalid file') # print(myimage) # print("the size of image is: ") print(original.format, original.size, original.mode) # pixel_values = list(original.getdata()) ''' y in range(0, 512): row = "" x in range(0, 512): row = "" ''' print("enter coordinates of desired pixel in x,y form") coordinates = [int(x) x in input().split(',')] x, y = coordinates r, g, b = im[x, y] print("r,g,b values corresponding pixel are:") print(r, g, b) print("enter new r,g,b values") new...

javascript - How to prevent same selected values in multiple drop down lists in a table & POST to server -

Image
example : imagine table of babies , with each row users selects baby genderdropdown , selects name. need prevent duplicate name selection across table, if user select male & john, cannot select again in row. except babies, table has rows contain projects, , billcodes dropdowns . if disable select option in dropdown, not post server! $('.timecodeddlid').find('option[value=' + $(this).val() + ']').prop('disabled', true); works but disabled not post selected value server question : how can prevent duplicate selection in second dropdown ? while found answers on here . however, fail - , dont posting server**. $('.timecodeddlid').find('option[value=' + $(this).val() + ']').prop('disabled', true); not post server side. rendered html snippet table, dropdown rows <tbody id="ts"> <tr class="rowcss"> //row 1 <td> <span class="project"> <select...

java - Using JPA/Hibernate in Play2.6, create a new Entity that has a reference to a foreign key and redirects client once operation is done -

tl;dr problem statement i building web application using play2.6 framework, jpa/hibernate , mysql want create user has foreign key employee, redirect client destination url can see result. my actual problem i complete beginner of jpa, hibernate, play framework 2.6 , java async architecture , having trouble inserting objects database depend on foreign key (or object reference in jpa). having trouble redirecting http client correct landing page vía http redirections using completionstage , results , wrapping result in completionstage. i still learning jpa/hibernate, java persistence , java async, overwhelming task has me going in circles in inception kind of sense (to learn a, need learn b, ....). such, sure failing understand fundamental rules lead compilation error. what doing i trying create async web application using play framework 2, jpa/hibernate , mysql. web application simple employee repository company keeps track of employee history (vacations, job posts, eval...

javascript - Smart Card relogin failed with message "validation of viewstate MAC failed" After executed "ClearAuthenticationCache" -

in asp.net web application, use smart card login. after logged out, want make iis prompt pin if login again. following command run - document.execcommand('clearauthenticationcache'); it prompt selection of certificate. after pick correct certificate, "validation of viewstate mac failed" error thrown. machine key has been set in web.config. test in single server. can fixed? is there way force relogin without executing above command? the error log - <error application="/lm/w3svc/2/root" host="mmm809-pb8gmtc" type="system.web.ui.viewstateexception" message="invalid viewstate. &#xd;&#xa;&#x9;client ip: 127.0.0.1&#xd;&#xa;&#x9;port: 64307&#xd;&#xa;&#x9;referer: https://localhost:48044/account/login.aspx?returnurl=%2f&#xd;&#xa;&#x9;path: /account/login.aspx&#xd;&#xa;&#x9;user-agent: mozilla/5.0 (windows nt 6.1; wow64; trident/7.0; rv:11.0) geck...