Posts

Showing posts from July, 2010

windows - Snort ./ at beginning of my RULE_PATH -

i trying configure snort on windows have weird problem. error: error: ./c:\snort\rules\local.rules<0> unable open rules file "./c:\snort\rules\local.rules": invalid argument. my snort.conf var rule_path c:\snort\rules i know problem ./ before path. had issue before , resolved it, today forgot how did it. thanks help.

Jenkins fails due to NoClassDefFoundError: org/sonatype/aether/version/VersionConstraint -

i'm attempting set jenkins on server after building job things turn south. can view console here: http://ci.lolmewn.nl/job/acceptrules/4/console at first thought issue me not having configured nexus yet (since error contained sonatype, makers of nexus), when built 1 of jobs without having repository pushing, still happened. any clues? see there's question mine, unanswered however, here have @ maven explanation it. might error. https://cwiki.apache.org/confluence/display/maven/aetherclassnotfound

php - How to name an array when using map function on a collection in Laravel -

i need build structure collection in laravel. each block should have subarray named $operators_participants , each of these should have 2 fields (operators , role_operator_id).. this attempt: $blocks = $dd->participants->map(function ($i, $k) { $operators_participants = $i->operators->map(function ($item, $key) { return [ 'operator' => $item, 'role_operator_id' => $item->pivot->role_operator_id ]; }); return $operators_participants; });

How to parse all nodes of given XML to an array in python -

how parse nodes of following xml array in python <?xml version="1.0"?> <carlist> <car> <model>benz</model> <specifications> <engine>turbo</engine> <fueltype>petrol</fueltype> </specifications> </car> <car> <model>fiat</model> <specifications> <engine>diesel</engine> <fueltype>petrol</fueltype> </specifications> </car> </carlist> xmltodict python module makes working xml feel working json example: s = """<?xml ... </carlist>""" parsed = xmltodict.parse(s) car in parsed['carlist']['car']: print(dict(car)) {u'specifications': ordereddict([(u'engine', u'turbo'), (u'fueltype', u'petrol')]), u'model': u'benz'} {u'specifications

javascript - How to restrict components in Google Maps geocoding API request URL -

i'm using google maps geocoding api given town/city's latitude , longitude. i'm trying restrict json response cities/towns within france. have gone through documentation found @ https://developers.google.com/maps/documentation/geocoding/start however request returns me coordinates if location have entered not city. following json request url have built. https://maps.googleapis.com/maps/api/geocode/json?address=abc&components=postal_town:abc|country:fr&key=api_key when use above request returns me following json although "abc" not valid town. { "results" : [ { "address_components" : [ { "long_name" : "4", "short_name" : "4", "types" : [ "street_number" ] }, { "long_name" : "rue auber", "short_name" : "

java - get parameter in servlet for for each loop -

i have jsp page this <c:foreach var="product" items="${products}" > <div class="col-md-3"> <div class="panel-body"> <div> <a href="description.html"> <div class="thumbnail"> <img src="data:image/jpeg;base64,${product.base64encodedimage}" alt="image"> <div class="caption" align="center"> <p> <h4>${product.name}</h4>

elasticsearch - No result when using search analyzer -

i'm trying search string using query_string in elasticsearch accented characters. when use query_string without analyzer query result on exact match (i'm searching string "Ředitel kvality" when dot "reditel kvality" no results) when use same analyzer it's used in mappings no results both string or without ascended characters. analyzers & filters: "analysis": { "filter": { "cs_cz": { "recursion_level": "0", "locale": "cs_cz", "type": "hunspell", "dedup": "true" }, "czech_stemmer": { "type": "stemmer", "language": "czech" }, "czech_stop": { "type": "stop", "stopwords": "_czech_" } }, &

android - Firebase Login multiple provider with same email -

i want user logged in first using fb able log out , log in again using his/her google (same email). what should do? read https://firebase.google.com/docs/auth/android/account-linking ,but don't quite understand. thought linking link accounts, regardless of email. while i'm thinking firebase identify user email, if log in , out fb or google using same email, firebase should know same user. in account-linking docs above, says need credential/tokenid , call linkwithcredential , : mauth.getcurrentuser().linkwithcredential(credential) .addoncompletelistener(this, new oncompletelistener<authresult>() { @override public void oncomplete(@nonnull task<authresult> task) { log.d(tag, "linkwithcredential:oncomplete:" + task.issuccessful()); // if sign in fails, display message user. if sign in succeeds // auth state listener notified , logic handle // signed in user can handled in lis

julia lang - Adding global title to Plots.jl subplots -

i add global title group of subplots using plots.jl. ideally, i'd like: using plots pyplot() plot(rand(10,2), plot_title="main title", title=["a" "b"], layout=2) but, per plots.jl documentation , plot_title attribute not yet implemented: title whole plot (not subplots) (note: not implemented) in meanwhile, there way around it? i'm using pyplot backend, i'm not tied it. when using pyplot backend, can use pyplot commands alter plots figure, cf. accessing backend specific functionality julia plots . to set title whole figure, like: using plots p1 = plot(sin, title = "sin") p2 = plot(cos, title = "cos") p = plot(p1, p2, top_margin=1cm) import pyplot pyplot.suptitle("trigonometric functions") pyplot.savefig("suptile_test.png") one needs explicitly call pyplot.savefig see effect of pyplot functions. note changes made using pyplot interface overwritten when use plots

ios - "Non-portable path to file "File.h"; specified path differs in case from file name on disk" warning in bridging header after updating to Xcode 8.3 -

i updated xcode 8.3 , swift 3.1 , got warning in bridging header file, referencing objective-c header file: non-portable path file "file.h"; specified path differs in case file name on disk how can resolve this? it turned out misspelled file's name, correct name "file.h" instead of "file.h". warning appeared because of coming apfs macos.

arguments - Python - check if arg from arparse was chosen -

i check if argument argsparse chosen, if not choose random value variable. here example: parser.add_argument('--tempo', default=120, type=int, help='tempo of track') and 1 way example: args = parser.parse_args() if args.tempo==120: #my default int tempo=random.randint(60,350) but way when user call program example: main.py --tempo 120 , choose random value. how can check if argument chosen or not? the problem in test. if user chose 120 give random number. think best remove default , check if empty. parser.add_argument('--tempo', default=none, type=int, help='tempo of track') args = parser.parse_args() if args.tempo==none: #my default int args.tempo=randint(60,350)

windows - Cordova wont bulid for android -

Image
why build not working? have android sdk shown in screenshot. >cordova build cordova-custom-config: skipping auto-restore of config file backup(s) android_home=c:\users\tpt\appdata\local\android\sdk java_home=c:\program files\java\jdk1.8.0_121 error: not find gradle wrapper within android sdk. might need update android sdk. looked here: c:\users\tpt\appdata\local\android\sdk\tools\templates\gradle\wrapper it seems android studio not use templates, manually copy , paste template worked: https://stackoverflow.com/a/42995556/285594

html - Validation error message with exclamation icon in MVC -

i working on mvc 5 view design need error messages displayed exclamation icon/image before, here is possible @html.validationmessagefor() validation messages,to show exclamation icon/image( responsive )? i tried adding glyphicon before validation message, @html.textboxfor(m => m.email, new { @class = "form-control text-line", @placeholder = "email id *" }) <i class="glyphicon glyphicon-exclamation-sign colorred"></i>@html.validationmessagefor(m => m.email, "", new { @class = "text-danger" }) question: 1. implementing above, shows exclamation glyphicon, need displayed when validation error occurs. 2. there other way of using scripts or styles achieving this, custom icon images? .field-validation-error:before { content: url('../images/image.png'); } this worked display image when error occurs said stephen muecke .text-danger{ content: url('../images/image.png'); } .text-da

mysql - How to insert ISO-8859-1 charset values in DB using php -

i'm inserting contents table bulk upload format (.csv). in csv columns include special characters server can't insert special characters included rows db , stops execution. how can insert these values? i'm trying: $field1= addslashes(trim($data[0])); and i'm using mysqli_real_escape_string, it's working omits special characters fields... $field2= mysqli_real_escape_string(trim($data[1])); do not call conversion routines. declare .csv file encoded latin1. clause in load data statement: character set latin1 you have not said charset column/table is. please provide show create table . column can either latin1 or utf8. also, use mysqli_set_charset establish charset client code using. (it not need same column/table.) you "omits special characters". mean data stored table(s), strings truncated @ special characters? see "truncated text" in trouble utf8 characters; see not stored . you "stops execution&qu

c# - Visual Studio Extension - set "Copy To Output Directory" property -

i'm creating vs extension, , want add file solution , set properties. 1 of them copy output directory , cannot find way of setting it. setting build action works fine, desired property not listed in array while debugging. private envdte.projectitem addfiletosolution(string filepath) { var folder = currentproject.projectitems.addfolder(path.getdirectoryname(filepath)); var item = folder.projectitems.addfromfilecopy(filepath); item.properties.item("buildaction").value = "none"; // item.properties.item("copytooutputdirectory").value = "copyalways"; // doesn't work - dictionary doesn't contain item, throws exception return item; } how can set property newly added item? for c# or vb projects, cole wu - msft's answer should work. if you're trying same thing different kind of project might out of luck since each project type has different properties. from have tried: c# , vb have 23 properties inc

ruby - Pass both the arguments and the template inside the ERB layout -

i'm trying create rails-like mvc framework on ruby. got troubles rendering template inside of layout , injecting tags css , js. want layout contain template (passed controller) , tags pointing css , js files, generated controller name (for example, if controller named 'links', js file located in app/assets/javascript/links.js) far figured out how render erb file inside of erb (template inside of layout) class inserts template inside of layout: require "erb" class layoutrenderer def self.render(template, layout) templates = [template, layout] templates.inject(nil) | prev, temp | _render(temp) { prev } end end def self._render temp erb.new(temp).result( binding ) end end so template renders layout yield. can't understand how can pass layout path assets files , template together. in rails framework render inside of erb layout gracefully, don't understand how :)

php - SQL regularly counting all new votes in one table and incrementing a total count value in another -

i have 3 tables, 1 user made levels, , 2 more tables upvotes , downvotes on said levels. i have 10 million votes cast, , it's becoming slow count votes level whenever necessary, i'm planning add 2 columns on levels table, counts upvotes , downvotes, , server update these maybe once every 24 hours. the votes tables unfortunately don't have auto incremented primary key column, instead primary key mapid , userid combined, 1 user cannot vote same map twice. so i'm adding column votes tables, "counted", 0 if hasn't been added aggregate data, 1 if has. way don't need recount votes have been added aggregate data, new ones. my query needs to: -select votes have counted set 0 -take mapid row, , increment thumbsup count mapid in levels table -set counted 1 vote i'm using mysql. appreciated! table maps_thumbsup userid | mapid | counted table maps_thumbsdown userid | mapid | counted table maps id | authorname | leveldata | ... | thumbsu

javascript - Sharing script between different switch case condition -

condition 1 should perform task 1, 2, 3, 4, 5, , 9. condition 2 should perform task 1, 2, 3, 6, 7, , 9. condition 3 should perform task 8 , 9. the following easy read, not work second condition1 , condition2 tasks not executed earlier break causes script exit switch statement. var condition='condition1'; switch(condition) { case 'condition1': case 'condition2': console.log('do task 1'); console.log('do task 2'); console.log('do task 3'); break; case 'condition1': console.log('do task 4'); console.log('do task 5'); break; case 'condition2': console.log('do task 6'); console.log('do task 7'); break; case 'condition3': console.log('do task 8'); break; } console.log('do task 9'); the following should work, not easy read, , become increasingly m

ios - Swift 3 Segue from UICollectionView Cell -

hi i'm beginner , stuck on basic segue! want find out correct syntax use sender e.g sandals[indexpath.row]sandalname thanks override func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionviewcell { let cell = collectionview.dequeuereusablecell(withreuseidentifier: "cell", for: indexpath) as! shoecollectionviewcell let sandalcell = sandals[indexpath.row] cell.sandalimage.image = uiimage(named: sandalcell["image"]!) cell.sandalstylename.text = sandalcell["stylename"] cell.sandalprice.text = sandalcell["price"] return cell } override func prepare(for segue: uistoryboardsegue, sender: any?) { if segue.identifier == "shoedetailsegue"{ var detailpage = segue.destination as! shoedetailviewcontroller let selectedcell = sender as! uicollectionviewcell let indexpath = collectionview?.indexpath(for: cell) detailpage.getnam

c# - Dynamic cast at runtime -

is there way dynamically cast @ runtime following pseudo code: foreach (datarow row in table.rows) { foreach (datacolumn col in table.columns) { if (row[col] != dbnull.value) { type type = col.datatype; type cellcontent = (type)row[col]; //pseudo-code } } } i´ve been searching web , not found anything. there´s object obj = activator.createinstance(type); , i´m still stuck object , can´t use specific type methods it. need cast of existing object , not new instance. need remove eventhandlers cellcontent in cases cause memory leak, example: object type ilist[serialnumbergridviewmodel] , serialnumbergridviewmodel implements propertychanged-handler causing memory leak. idea? there way solve issue? i´ve solved in above specific case, general method lot better, program i´m working big , has lot of memory leaks removed. no. can't cast type unknown @ compile time. however, c# have special keyword declaring varia

java - how to call speak method multiple times -

i'm trying call speak method of class texttospeech multiple times, not seem work - speaks last phrase each time. string temp="abcd"; ss(temp); string temp1="wxyz"; ss(temp1); public void ss(string t){ tts.speak(t, texttospeech.queue_flush, null); } tts object of class texttospeech method. your question not explains if multiple time simultany or every time 5 seconds example, can try: thread thread = new thread(new runnable() { @override public void run() { ss("string text"); } }); thread.start();

how to reference plan variables in bamboo with my selenium webdriver(java) file -

i have selenium driver script this.browsername = system.getenv("browsername"); tags.add(this.browsername); this.browserversion = system.getenv("browserversion"); tags.add(this.browserversion); but when add variables task configuration 'variable name', 'value' , execute script , returns null , no value passed above mentioned variables through bamboo. bamboo adds "bamboo_" prefix variables, try it. or modify java class , print environment variables see exported

python - Multiple pick events interfering -

i have several data series scattered in figure , want able toggle annotations them. problem is, there 2 pick events triggered (when user clicks on spot within both annotation , dot). "annotation" pick event clears annotation, "dot" pick event puts right back, effect toggle doesn't work. df = pd.dataframe({'a': np.random.rand(25)*1000, 'b': np.random.rand(25)*1000, 'c': np.random.rand(25)}) def handlepick(event): artist = event.artist if isinstance(artist, matplotlib.text.annotation): artist.set_visible(not artist.get_visible()) else: x = event.mouseevent.xdata y = event.mouseevent.ydata if artist.get_label() == 'a': ann = matplotlib.text.annotation('blue', xy=(x,y), picker=5) else: # label == 'b' ann = matplotlib.text.annotation('red', xy=(x,y), picker=5) plt.gca().add_artist(ann)

extjs - When you double-click on the widget is thrown -

when double-click on widget thrown: uncaught typeerror: cannot read property 'focusable' of undefined i have grid widget column text:'blabala' flex: 1.8, xtype: 'widgetcolumn', dataindex: 'attachment', stopselection: false, widget: { xtype: 'panel', layout: 'hbox', padding: 5, border: 0, bodystyle: 'background:transparent', flex: 1, header: false, items: [{ xtype: 'panel', flex: 1, bodystyle: 'background:#d7d7d7;border-radius:16px', layout: 'hbox', items: [ { xtype: 'button', cls: 'attach-btn-divers', padding: '10 0 10 5', textalign: 'left', flex: 1,

c# - Net Core Entity Database 1st - Build Error -

i getting build error know why... it's because deleted old files entity except replacing them... -f but super annoying because have comment out lines reference context... is there option or way have scaffolding disregard if there build error or not. "build failed" on database first scaffold-dbcontext reference ^ thanks. edit: long story short, need comment out manually every reference of data context in code , re-scaffold database because build errors. edit2: working before following scaffolg statement doesn't handle - in project name...(project name: posi_master-api) used replace -api _api scaffold-dbcontext "data source=aserver;initial catalog=positiveusers;persist security info=true;user id=positiveconnector;password=apassword" microsoft.entityframeworkcore.sqlserver -outputdir databases/positiveuser -f just restore/revert lost files version control system (git, etc)

c# - Using Task.Delay and a recursive call -

i'm trying figure out best way implement delay task such after delay calls again attempt same work. my application server generates reports database after mobile devices sync data server, if user has called report generation method recently, want pause period of time , attempt run again. this current attempt private static datetime _lastrequest = datetime.minvalue; public async void issuereports() { await task.run(() => { if (datetime.now < _lastrequest + timespan.fromminutes(3)) //checks see when user last completed method { task.delay(timespan.fromminutes(2)); issuereports(); //calls again after delay return; } }); //code generate reports goes here _lastrequest = datetime.now; //updates last request static variable after has finished running } initially if failed check task end. prevented 2 users hitting database @ same time , causing duplicate reports generated. however, probl

javascript - JSON Split - Place array text into li during interval -

my task take 3 different color lists in jsonobj , place them <ul> . should appear 1 @ time, every second. sake of fiddle, put every 5 seconds. i haven't gotten 2nd or 3rd list of colors yet because while can list out 1st color list, they're appending outside of listitem i've created them. code spits is: var jsonobj = '{"one":["red","green","blue"], "two":["red","green","blue"], "three":["orange","purple","hotpink"]}', object = json.parse(jsonobj), cone = object.one, ctwo = object.two, cthree = object.three, = 0, timer; $('body').append('<ul/>'); timer = setinterval(function() { $.each(cone, function() { var list = $('body ul'), listitem = $(list).append('<li>'), html = $(listitem).append(cone[i]); if (i < cone.length) { i++

android - Camera2 api problems firing flash/no flash images -

i explain case. i'm trying application in every 5 seconds take image, 1 without flash, , after 5 seconds 1 flash, , repeat every time. take 1 without flash, 1 flash, 1 without flash, 1 flash... infinitely. the case code can in devices, same code won't work in others want. i.e: bq aquaris x5 plus : no-flash image correct, flash image white. bq aquaris e5 : won't fire flash. how can possible, devices in have tried legacy hardware support level camera2 api. this important methods in code (i can't post code due char limit). started google example: this setautoflash mentioned above. private void setautoflash(capturerequest.builder requestbuilder) { if (mflashsupported) { if(phototaken) { requestbuilder.set(capturerequest.control_ae_mode,capturerequest.control_ae_mode_on_auto_flash); requestbuilder.set(capturerequest.flash_mode, capturerequest.flash_mode_off); }else{ requestb

python - How to logout in django? -

Image
html code {% if request.user %} <a href="{% url 'main:logout' %}"> Выход </a> {% else %} <a href="{% url 'main:registration' %}"> Регистрация </a> {% endif%} settings.py login_redirect_url = 'main/index' views.py def logout(request): logout(request) urls.py from django.conf.urls import url . import views django.conf import settings urlpatterns = [ url(r'^logout/$', views.logout, {'next_page': settings.logout_redirect_url}, name='logout') ] what's wrong? you using custom logout view doesn't take next_page parameter. should add parameter view , pass django logout call, or use django.contrib.auth.logout e.g. in urls.py: from django.conf.urls import url django.conf import settings django.contrib.auth.views import logout urlpatterns = [ url(r'^logout/$', logout, {'next_page': settings.logout

wordpress - How to reduce stock when creating new order using Woo commerce REST API -

i using woo commerce rest api connect web store android app , working good. now when creating new order app status of order default pending payment , stock not being reduced. i have searched issue , got solution need set 'set_paid' => true, data when calling create order api app default status processing , stock reduced. but when use 'set_paid' => true, in data getting authentication error 401 unauthorized . is possible set 'set_paid' => true, when payment method cash on delivery? i not have concern default status through api want reduce stock when order goes in processing mode whether through api or through wp-admin

html - Cursor property on select element (conflit with two <select> elements - IE11 and Edge only) -

i have problem how browser (ms edge) uses css "cursor" property have set on 2 select elements on page. (see example below). the first select element have "cursor" property set "pointer". second select element have "cursor" set "not-allowed". second select element positioning under first select. when user tries select option in first select, each option of first select located on top of second select uses "not-allowed" cursor instead of "pointer" value. the problem exist in edge , ie11; in chrome or firefox rendering good. <!doctype html> <html> <head> <title>demo</title> </head> <body> liste 1 <select style="cursor:pointer"> <option value="1">1</option> <option value="1">2</option> <option value="1">3</option>

retrofit - android Retrofit2 with OkHTTP3 sequence call with unexpected same result -

i using android retrofit2 okhttp3 , need call same api twice. , take action based on each response got old response always. how clear old response every time api called? here code @get("/state/{id}") observable<result<responsestatemodel>> getstatebyid(@path("id") string id); public class cachinginterceptor implements interceptor { @override public okhttp3.response intercept(interceptor.chain chain) throws ioexception { request request = chain.request(); request = new request.builder() .cachecontrol(new cachecontrol.builder() .maxage(0, timeunit.days) .minfresh(0, timeunit.hours) .maxstale(0, timeunit.hours) .build()) .url(request.url()) .build(); return chain.proceed(request); } } retrofit retrofit = new retrofit.builder() .baseurl(base_url)

c# - How to make a CroppedBitmap transparent? -

Image
i have cropped bitmap: croppedbitmap crop = new croppedbitmap(rtb, new int32rect(mapoffset, mapoffset, board_width - 1 - mapoffset, board_height - 1 - mapoffset)); and need set white transparent. unfortunately, not work (croppedbitmap not contain definition 'maketransparent'): crop.maketransparent(colors.white); anybody have ideas / suggestions? thanks in advance. ~~~~~~~~~~~~~~~ i found code how can make white (ffffffff) pixel in image(imagebrush) transparent but when implement public void savemaincanvas2bmp(string filename) { // write bmp visualbrush sourcebrush = new visualbrush(maincanvas); drawingvisual drawingvisual = new drawingvisual(); drawingcontext drawingcontext = drawingvisual.renderopen(); using (drawingcontext) { drawingcontext.drawrectangle(sourcebrush, null, new rect(new point(- mapoffset, - mapoffset), new point(board_width - 1 + mapoffset, board_height - 1 + mapoffset)

java - How to create a listview from callback socket emit? -

i used socket.io in android project. created rest api project using node.js in case find method return json array [{...},{...},{...}] how use following code create listview args? msocket.emit("messages::find", jsonobject, new ack() { @override public void call(object... args) { string string = ; string [] objectlist = new string [] args[args.length-1].tostring(); list<string> stringlist = new arraylist<string>(arrays.aslist(string)); /* have here array callback */ } });

powerpoint - PPT VBA auto-select new textbox? -

i have macro create new textbox parameters, when created, still have go click (and use "enter" keyboard shortcut highlight text , start typing). wondering if there's way have textbox selected run macro, , better, if there's way auto-highlight test text (so there no step between adding box , typing). code below (copied & modified the spreadsheet guru ). dim sld slide dim shp shape 'error handling if activepresentation.slides.count = 0 msgbox "you not have slides in powerpoint project." exit sub end if set sld = application.activewindow.view.slide 'create shape specified dimensions , slide position set shp = sld.shapes.addtextbox(orientation:=msotextorientationhorizontal, left:=24, top:=65.6, width:=300, height:=100) 'format shape 'no shape border shp.line.visible = msofalse 'shape fill color shp.fill.visible = msofalse 'shape text color shp.textframe.textrange.font.color.rgb = rgb(0, 0, 0) &

c# - WPF camera animation issue -

i have 3d model in wpf , im trying make animation makes camera go around model. have following code: public mainwindow() { initializecomponent(); registername("thiswindow", this); } private model3dgroup mainmodel3dgroup = new model3dgroup(); private perspectivecamera thecamera; private double cameraphi = math.pi / 6.0; private double cameratheta = math.pi / 6.0; private double camerar = 35.0; private storyboard storyboard = new storyboard(); private dependencyproperty cameraphiproperty = dependencyproperty.register("cameraphiproperty", typeof(double), typeof(mainwindow)); private void window_loaded(object sender, routedeventargs e) { // define model, lights , everthing animations(); } private void rotatearoundtower() { doubleanimation animation = new doubleanimation(); animation.from = 0.0; animation.to = 360.0; animation.duration = new duration(timespan.from

How to give a python script limited access to azure blob container -

i want python script able append new blobs container in azure. using shared access signatures (sas) seems way go. but can't figure out how use them. don't want give script full access azure account giving storage account key using sas , limiting abilities of script create , removing delete, , list seems ok. how use token in script? here test code: #!/usr/bin/env python3 import requests azure.storage.blob import blockblobservice, containerpermissions, contentsettings # testing, account key removed later account_name = 'myaccountname' account_key = 'myaccountkey' container_name = 'mycontainer' existing_file = 'existing_file.jpg' new_file = 'test.jpg' service = blockblobservice( account_name=account_name, account_key=account_key ) # there 2 ways create permission # 1. assign boolean values `read`/`add`/`create`/`write`/`delete` operation # permission = blobpermissions(read=true, add=true, create=true, write=true, delete

javascript - Deal with big DataList -

https://jsfiddle.net/pb47ap8t/2/ var fruits = ["test"]; (var i=0;i<500;i++){ fruits.push("test"); } // var datalist = document.getelementbyid('datalist'); var frag = document.createdocumentfragment(); (var in fruits) { if (fruits.hasownproperty(i)) { var option = document.createelement("option"); option.textcontent = fruits[i]; option.value = fruits[i]; frag.appendchild(option); } } datalist.appendchild(frag); i want populate datalist (arround 500 values), how can without issues concerning massive data loading ? apologies writing answer , not commenting don't have enough reputation. freezes because of populating drop down on clicking element when data fetched server. loading asynchronously help..

virtual machine - How to know all times when a VM has been started in AZURE? -

Image
is there anyway know times when vm has been started in azure? thanks in advance, you can view information navigating virtual machine blade within azure portal, clicking on activity log. in activity log pane, can change filter setting timespan date range want, type "start" in search box , apply filter. list out times vm started.

user interface - Why color of the Border doesn't change? -

Image
i have textinput , should border around it, when i'm trying define border color, doesn't change, , stay grey, why that? here code use render textinput border: import react, {component} 'react'; import { stylesheet, view, text, image, textinput, appregistry } 'react-native'; class profile extends component { render() { return ( <view style={styles.profile}> <view style={[styles.loginrow, {marginbottom: 8}]}> <textinput style={styles.textinputvalue} ref={(ref) => this.password = ref} onfocus={() => this.password.focus()} onchangetext={(text) => this.setstate({password: text})} underlinecolorandroid="transparent" placeholdertextcolor="#ffffff" p

r - Count observations of distinct values per group and add a new column of counts for each value -

this question has answer here: create columns factors , count 2 answers similar question count number of observations/rows per group , add result data frame not quite. i'd transform this group id_in_group letter 1: a1 alef 2: a2 bet 3: a3 bet 4: b b1 alef 5: b b2 alef 6: b b3 gimel into this group aleph bet gimel 1: 1 2 0 2: b 2 0 1 or without additional library, can use table: table(df$group,df$letter) as seem work data.table, can use dcast() dcast(df, group~letter,length)

javascript - equal an array of numbers in the shortest way -

i have array contain random numbers: var equalme = [math.random(), math.random(), math.random(),math.random()]; now lets numbers chosen are: 0.4, 0.3, 0.2, 0.1. need find way make algorithm, equal each number 0.25 (since (0.4+0.3+0.2+0.1)/4 = 0.25) , i'm trying in fastest way possible withdrawing value each number in array another. so example shortest way withdraw equalme[0] value of 0.15 equalme[3] , withdraw value of 0.05 equalme[1] equalme[2] each number in array same (0.25). my question how can make code, can find shortest way withdraw values when size of array can given choice (not 4 numbers) , values in array random, numbers equal lowest withdraws possible? please note: need code money exchanging program bitcoin wallets each time withdraw money 1 wallet lose fee need withdraw money 1 wallet lowest amount of withdraws possible wallets have same value giving total money edit: find average value of set of numbers, calculate difference each of these comp

sql - Trigger on view in Postgresql -

i have materialized view , view select * materialized view. want have trigger on view, executed after refreshing materialized view. tried after insert or update trigger, seems it's not working. possible in pgsql? as easy example (in reality not have test table in same db ofc): create table test(id integer primary key, sth integer); create materialized view test_mv select * test; create view test_mv_v select * test_mv; create or replace function test_trig() returns trigger $$ begin raise notice 'triggered'; return null;end;$$ language 'plpgsql'; create trigger test after insert or update on test_mv_v each statement execute procedure test_trig();

javascript - Check if user input has certain characters -

hi i'm making "secure password" project school , need check if user input has "!@$%&#" , if have tell them password secure. this project school im stuck doing :( var password = document.getelementbyid('password'); var emsg = document.getelementbyid('feedback'); var minlength = 6; function checkpass() { if (password.value.length < minlength) { emsg.innerhtml = 'password must have' + minlength + 'characters or more'; } else { emsg.innerhtml = ''; } } <html> <head> <title> password secured </title> <link rel="stylesheet" href="style.css"> </head> <body> <h1 class="logo"> logo</h1> <br/> <br/> <p class="input">please type password: <br/> <input type="text" id="password" /> <div id="feedback"

php - Custom Post Pagination Not Working -

i know there have been many pagination questions, i'm stumped here. have "gallery" hierarchical custom post type. parent posts, i'm using index template, , child posts uses more typical single page code. here's of single-gallery.php file. check see if post has children. if does, want index page. get_header(); $template = get_template_directory_uri(); //if it's index page, redirect $args = array( 'post_parent' => $post->id, 'post_type' => 'gallery', 'numberposts' => -1, 'post_status' => 'publish' ); $children = get_children( $args ); if ($children){ get_template_part('template-parts/content', 'gallery-index'); get_footer(); } else{ after else, outputs code single display, working fine. in content-gallery-index.php, have. $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; then goes on handle code another

html - Fixed position footer changing it's position on opening new tab -

i running issue ios mobile safari. fixed position footer not retaining it's position on opening/closing new tab on iphone safari browser. sometime footer move , sometime towards down direction depends upon address bar visible or not. i not able understand why mobile safari behaving this?? <!doctype html> <html lang="en"> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" /> <style type="text/css"> html, body { margin: 0; padding: 0; height:100% } .footer { position: fixed; bottom: 0px; width: 100%; height: 48px; background-color: grey; } </style> <body> <div class="footer">

php - How to get mysqli error in different environments? -

in local/dev environment, mysqli query performing ok . however, when upload on webhost environment, got error; fatal error: call member function bind_param() on non-object in... here code: global $mysqli; $stmt = $mysqli->prepare("select id, description tbl_page_answer_category cur_own_id = ?"); $stmt->bind_param('i', $cur_id); $stmt->execute(); $stmt->bind_result($uid, $desc); to check query, tried execute query via control panel phpmyadmin , result ok . if there lacking information, please tell me can provide. first of all, have line before mysqli connect in all environments: mysqli_report(mysqli_report_error | mysqli_report_strict); after mysql errors transferred php exceptions. uncaught exception, in turn, makes php fatal error. thus, in case of mysql error, you'll conventional php error, instantly make aware of error cause. stack trace lead exact spot error occurred. note have able see php errors in general . ,

Signing a X.509 certificate in Java -

i want find out how sign x.509 certificate. i have set openssl ca create demo certificate. certificate fine , can see relevant elements using tool called dumpasn1. theoretically know have sign structure called "tbscertificate" compounds attributes version , serial number signature, issuer, validity, subject, subjectpublickeyinfo , extensions. however, when try mimic in java, unfortunately not work. is: i read "tbscertificate"-portion of der-encoded certificate then private key issuing ca last try sign tbscertificate-structure using following code: . public static void sign(byte [] data) throws exception { string algorithm = "sha256withecdsa"; privatekey privkey; keypair keypair; keypair = getkeypairfompem(); privkey = keypair.getprivate(); signature ecdsa; ecdsa = signature.getinstance(algorithm, "bc"); ecdsa.initsign(privkey); ecdsa.update(data); byte[] basignature = ecdsa.sign(); }