Posts

Showing posts from June, 2014

SQL Server stored procedure: UPDATE with lowest value, else INSERT if there's already a value -

migrating 20k rows or @ once, hopefully. been away sql on 10 years , struggling. i may going entirely wrong. need update table1.value2 lowest value table2.value1 , unless there's value2 . if latter, need insert row value table1.value1 . table1.value1 lowest value of each id row. value2 needs next lowest. current table1: id1, 123, [empty] id4, 111, [empty] current table2: id1, 224 id1, 331 id4, 210 id4, 551 table1 - desired state: id1, 123, 224 id1, 331, [empty] id4, 111, 210 id4, 551, [empty] table2 - desired state: [empty] here's tried , update section works correctly. insert never works. think coded myself corner. create procedure dbo.broken --declare variables declare @id int, @value1 int, @value2 int, @tmpvalue int --declare counter declare @counter int set @counter = 1 --declare cursor query declare ctable1 cursor read_only select id,value1, value2 table1

IOS Swift what am I messing up on in my UIView adding a subview -

Image
i have uiview , set constraints on image below shows . when open in simulator works correctly . problem comes when try , add wkwebview display video , add subview . want video take dimensions of uiview video looks small , uiview looks shrinks . how can fix video takes full dimensions of uiview . can see constraints set trail , leading , video not taking width though large enough . thing can think of fixing adding a addchildviewcontroller(viewcontroller) however wkwebview not have controller suggestions great . class exampletable: uiviewcontroller, wkuidelegate { @iboutlet weak var newview: uiview! var mywkwebview: wkwebview? override func viewdidload() { super.viewdidload() mywkwebview?.uidelegate = self guard let movieurl = url(string: "my video url") else { return } let webconfiguration = wkwebviewconfiguration() webconfiguration.allowsinlinemediaplayback = true webconfiguration.mediatypesre

python - Last.fm API invalid method signature but valid when getting session key -

i wanna make python client last.fm api. wanna build kind of library. i managed , set session getting session key. afterwards, try call post method requires api_key, api_signature , session key. use api key have, same api_signature used session key , session key itself. but "invalid method signature" though use same api_signature post calls. import json import webbrowser hashlib import md5 import urllib3 class pylast(): def __init__(self, api_key, secret, session_key=none): self.__api_key__ = api_key self.__secret__ = secret self.__session_key__ = session_key self.__api_signature__ = none if session_key none: self.__is_authorized__ = false else: self.__is_authorized__ = true self.__http__ = urllib3.poolmanager() def request_token(self): print("getting token...") url = 'http://ws.audioscrobbler.com/2.0/?method=auth.gettoken&api_key={}&format=json'.format(self.__api_key__) req_respons

pdf - Using rmarkdown to create headers from a large .txt input -

i'm trying create pdf headers rmarkdown. i'm reading in large text file, , want print out pdf using headers. can read in , print pdf desired formatting, minus headers, using ```{r comment='', echo=false} cat(readlines("blah.txt", encoding="utf-8"), sep="/n") ``` however, can't rmarkdown evaluate '#' in text, creates headers. i've inserted '#' different sections of .txt file want create header, doesn't evaluate hashtag. does know how rmarkdown evaluate '#' header without messing formatting of text file have it? thanks! welcome so! rmarkdown recognizes # ... -headers if there space line before. need add line-break: ```{r comment='', echo=false, results='asis'} cat(readlines("blah.txt", encoding="utf-8"), sep="\n\n") ``` note: maybe want add results='asis' in r-junk in order accomplish breaked lines.

html - Boostrap CSS - Change Table Border Colors -

Image
how can change column borders in html table using bootstrap css? this have gone far: boostrap pre-defined table the table lays inside jumbotron , change table borders , lines can more distinguishable. have gone far. as can see, table lines between columns remain same. how can changed? any other suggestions on improving table appearance gratefully accepted table.html <!doctype html> <html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="contai

image - Use BBOX Option In Percentage Instead Of Absolute Pixel - PyScreenShot Python -

the bbox option on grab() function of pyscreenshot able collect area of screen great. is possible same using absolute percentage values? problem using pixel values on different monitors different resolution, grabbed image different. so instead of saying im = imagegrab.grab(bbox=(100,100,500,500)) i can same area, independently if screen 1920x1080 or other resolution is looking for? import mss # import mss.tools mss.mss() sct: monitor = sct.monitors[1] left = monitor['left'] + monitor['width'] * 5 // 100 # 5% left top = monitor['top'] + monitor['height'] * 5 // 100 # 5% top right = left + 400 # 400px width lower = top + 400 # 400px height box = (left, top, right, lower) im = sct.grab(box) # mss.tools.to_png(im.rgb, im.size, 'screenshot.png')

android - How to get the Uri path from a ImageView? -

i trying create wallpaper application. images come internet. before of set background, need crop image. , this, using api named androidimagecropper. api need of uri object execute crop. how can uri imageview? because image internet. image not on drawable folder. confusing. maybe guys can me. public class mainactivity extends appcompatactivity { private networkimageview imageview; private uri mcropimageuri; public static final string url_photo = "http://cdn.wonderfulengineering.com/wp-content/uploads/2016/02/iron-man-wallpaper-42-610x1084.jpg"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); imageview = (networkimageview) findviewbyid(r.id.image_view); // singleton volley api, load image internet imageloader loader = mysingleton.getinstance(this).getimageloader(); loader.get(url_photo, imageloader.getimagelistener(imageview, r.drawable.temp_picture,

r - Getting the week from the date -

i have series of dates , trying week of year. seems innacurate. order_date = c("2017-06-10","2017-06-11","2017-06-12","2017-06-13", "2017-06-14","2017-06-15","2017-06-16") strftime(as.posixlt(order_date) ,format="%w") week(order_date) 06/10 saturday , there's no way 06/10 , 06/11 of same week. any ideas on how this? working date-time not straightforward. illustration of question , comments members. added few days make point more clear. library(lubridate) order_date = c("2017-06-10","2017-06-11","2017-06-12","2017-06-13", "2017-06-14","2017-06-15","2017-06-16", "2017-06-17", "2017-06-18", "2017-06-19") strftime(as.posixlt(order_date) ,format="%w") # week starts on monday # [1] "23" "23" "24" "24&

javascript - Vue.js consume json -

my problem json. http://dev-rexolution.pantheonsite.io/api/noticias i need consume vuejs 2 first element of array able display it, working console worked no vuejs. this console log work: console.log(response.data[0].title[0].value); <template> <div class="box box--destacado1"> <div class="media media--rev"> <div class="media-image"> </div> <div class="media-body"> <span class="box-info">{{ noticias[0].field_fecha[0].value}}</span> <h3 class="box-title"> <a href="">{{ /*noticias[0].title[0].value */}}</a> </h3> <p class="box-text">{{/*noticias[0].field_resumen[0].value*/}}</p> </div> </div> </template> <script> import axios 'axios'; expo

elasticsearch - Input as file path in logstash config didn't work -

when run command this(on windows system): logstash -f logstash-apache.conf there's no output , didn't store log elasticsearch. think didn't work. btw refered website: https://www.elastic.co/guide/en/logstash/current/config-examples.html#config-examples this conf file(logstash-apache.conf): input { file { path => ["c:/users/user/downloads/logstash-5.5.1/bin/access_log.txt"] start_position => "beginning" } } filter { if [path] =~ "access" { mutate { replace => { "type" => "apache_access" } } grok { match => { "message" => "%{combinedapachelog}" } } } date { match => [ "timestamp" , "dd/mmm/yyyy:hh:mm:ss z" ] } } output { elasticsearch { hosts => ["localhost:9200"] } stdout { codec => rubydebug } } this output: c:\users\user\downloads\logstash-5.5.1\bin>logstash -f logstash-apache.

css - How to add a drop down to a drop down -

i can't figure out how add drop down navbar. have 1 need add 1 on top of it. html: toggle navigation custom signs custom signs digital printing services digital printing services </li> </ul> </li> <li role="presentation"> <a href=" untitled.html" id="getanestimate">get estimate</a></li> <li class="dropdown"><a data-toggle="dropdown" aria-expanded="false" href="#" class="dropdown-toggle">industry showcase<span class="caret"></span></a>

java - How to inject a implementation that takes some value in its constructor in Guice? -

i have following implementation trying inject in guice `public class client{ private final database db; public client(database db){ this.db = db } } class someclass{ private client client; @inject public someclass(client client){ this.client = client; } }` this injection code injector guice = guice.injector(); guice.getinstance(someclass.class); but keep on getting error: could not find suitable constructor in hello.package.helloworld.client. classes must have either 1 (and one) constructor annotated @inject or zero-argument constructor not private how inject class takes parameter? the error text quite explicit: haven't used @inject on constructor of client . so idea make so: public class client{ private final database db; @inject public client(database db){ this.db = db } } and if don't know database, want create it, consider using guice's assisted injection , creates factory yo

python - How can I find all the 'name' elements that begin with a specific string? -

i'm working on personal project @ moment , ran trouble. i'm using beautiful soup scrape user replies off web page. i'd scrape number of downvotes , upvotes on post haven't been able so. below html contains number of upvotes user's post. each user has different name element id shown 171119643 have been confused how can scrape name elements. <strong id="cmt_o_cnt_171119643" name="cmt_o_cnt_171119643">756</strong> i did notice each name starts same string: cmt_o_cnt_ . there way can scrape elements starting string using code below? for url in soup.find_all('strong', name_=''): a non-regex solution check if substring "cmt_o_cnt_" in tag['name'] : for tag in soup.find_all('strong'): if "cmt_o_cnt_" in tag['name']: print(tag['name']) # or stuff

Enable Jquery Only after Javascript recursive function is done executing -

//image sequence functions //preload array /** * preload images in directory. * @param {string} baseurl * @param {string} extension * @return {promise} resolve array<image>. */ function preloadimages(baseurl, extension, starter) { return new promise(function (res) { var = starter; var images = []; // inner promise handler var handler = function (resolve, reject) { var img = new image; var source = baseurl + + '.' + extension; img.onload = function () { i++; resolve(img); } img.onerror = function () { reject('rejected after ' + + 'frames.'); } img.src = source; } // once catch inner promise resolve outer one. var _catch = function () { res(images) } var operate = function (value) { if (value) images.push(value);

use chrome --print-to-pdf --headless to print html too quickly? -

i used cmd , typed "chrome --headless --disable-gpu --print-to-pdf=d:\project\test.pdf http://localhost:8085/t1/index.html?data=http://localhost:8085/1/mock.json " and generated pdf blank. think reason used fetch mock.json , dom didn't have enough time render completely. if import mock.json , pdf can render perfectly. so, there way delay print-to-pdf process? thanks!

git - Laravel, command to commit contents of database to github, and command to hydrate database from repo -

i new larvel, , absolutely loving it. using 5.4. when commit, not comiting contents of mysql database github. i want this, because, when go computer, want git clone push database setup same. so in summary, there (1) command commit database contents github repo, , after (2) way rehydrtate database contents github repo?

matlab - Simulink - Store Variables inside a File -

Image
i know typing r=1 in matlab command line let variable r available open simulink model. for complex models can make s-function , type in there. but simpler models, wouldn't wish type command, nor keep .m script aside, .slx file alone, , still having few variables r everywhere in model, , available when open it. i dont remember if possible, how that? in simulink model window choose file/model properties/model properties/callbacks : now r can used in model:

What is settings in scala compiler -

i'm researching scala compiler. in studying, don't understand usage of scala.tools.nsc.seetings. could tell me in detail? scala.tools.nsc.settings document: http://www.scala-lang.org/api/2.12.2/scala-compiler/scala/tools/nsc/settings/index.html thank much.

ruby - Render fields for array attribute in Rails form object -

right im having hard time render form fields array attribute inside may form object. im using virtus gem setting attributes. my code: class journalform include virtus.model extend activemodel::naming include activemodel::conversion include activemodel::validations attribute :group_no, string attribute :description, string attribute :rank_code, string attribute :transaction_type, string attribute :type, string attribute :accounts, array[journalaccountattribute] validates_presence_of :group_no, :description, :rank_code, :transaction_type,:type end this journalaccountattribute class class journalaccountattribute include virtus.model attribute :account, string attribute :transaction_type, string end the problem don't know how render in view. relation 1 journal has_many accounts. according actionview - nested attributes examples docs form in view should like: <%= form_for @journal |journal_form| %> ... <% @journal.j

ValueError: could not convert string to float — user input with Python -

i'm trying write 'while' loop takes users input, if number remembers it, if blank space breaks. @ end should print average of entered numbers. giving me error 'could not convert string float: '. wrong here? thanks! edit: re-wrote , same error converting, seems on final (count += 1) line? number = 0.0 count = 0 while true: user_number = input('enter number: ') if user_number == ' ': break print (number / count) number = number + float(user_number) count += 1 my guess directly hit enter when don't want pass numbers anymore. in case, comparing space incorrect. number = 0.0 count = 0 while true: user_number = input('enter number: ') if user_number == '': break number += float(user_number) count += 1 print (number / count) also statement after break unreachable. if want cleaner alternative, recommend appending list, , computing average. removes need s

python - Error generated in pyaudio stream assignment -

good day. new pyaudio. trying run following code, after cleaning errors , , launching jackd. def generate_sample(self, ob, preview): print("* generating sample...") tone_out = array(ob, dtype=int16) if preview: print("* previewing audio file...") bytestream = tone_out.tobytes() pya = pyaudio.pyaudio() stream = pya.open(format=pya.get_format_from_width(width=2), channels=1, rate=output_sample_rate, output=true) stream.write(bytestream) stream.stop_stream() stream.close() pya.terminate() print("* preview completed!") else: write('sound.wav', sample_rate, tone_out) print("* wrote audio file!") the line sets stream generates following error: type error: unbound method get_format_from_width() must called pyaudio instance first argument ( got int instance... all of coding sources have found use exact same function call , fail. not understand ( , others ) have done wrong. thank you. if

forms - Anonymous clickhandler in foreach loop uses last variable state -

i guess newbie question. yet did not find online... i'm creating small powershell script simple gui. this relevant part of script: foreach ($script in $scripts){ $btn = new-object system.windows.forms.button #text, location, size omitted #add clickhandler $btn.add_click( { write-host "clicked on btn $script" start-process -filepath "powershell" -argumentlist "-command", "`"$script`"" write-host "finished" $form.close(); } ) $form.controls.add($btn) } obviously $scripts contains paths pointing towards other powershell scripts. being java developer naiv enough suspect every click handler created own reference script location ( $script ). but of course powershell not evaluate $script until handler invoked. thus, every button call last element in array $scripts since $script reference last element in $scripts after loop completes. how can create click han

debugging - Error occurs only on actual Android Device? -

i creating android version of existing ios app. the beta works on emulator. got device test on (a honor 6x) , have issues. when install app never runs , starts "sorry, error occurred. home screen icons re-arranged default positions." no matter click keeps popping second later , unable access other screens or apps on phone. when start in safe mode same error appears able click out of it. i have install simple "hello world" app on phone. however, if attempt install simple app after error has starting occurring load icon never show on screens. i ended doing factory reboot want make sure have right approach before testing again on device. there list of common issues may causing errors on device not emulator? there way ensure if app crashes, deletes right away don't have factory reset? thanks!

Is there a way to create rating images (5 stars, 4 stars, 3 stars, etc...) inside an array in JavaScript and output it all as a table in HTML? -

the code below i've been working on. think logic flawed when rate products based on calculated scores, i'm getting mixed up. , i'm unsure how create rating images based on scores. first column in arrays score value, second column product id, third column name of product, , fourth column link brand websites. want output image in fifth column reflect score of product. example, if i'm sorting products based on score , want products highest scores listed first, should products[1] 5 star image, products[3] 4 star image, products[0] 3 star image, products[4] 2 star image, , products[2] 1 star image. note : reason language="javascript" works me , type="text/javascript" not. if provide guidance code sincerely , appreciate. thank in advance :) html: <table id="table"> <tr id="tbody"> <th>score</th> <th>id</th> <th>name</th> <th>website</th> <th>rating</th>

In an Applescript file, how might I go about getting particular groups of albums to play at random -

say, trying artists → artists play on random. or playing genre → metal play on random? you can build list selecting artist or genre , play random item of list : tell application "itunes" set mylist every track genre "pop" set randomnumber random number 1 (count of mylist) play item randomnumber of mylist end tell however, need add repeat loop keep playing next random number. if have itunes version lower 11, can still use shuffle property of play list. since version 11, shuffle property obsolete. regulus663 found workaround in stack overflow 4 years ago; refer link : how set itunes 11 in shuffle or repeat mode via applescript

vue.js - Where do I store shareable data in vuejs? -

i building app various pages, , when users goes /orgs have template require // routes.js ... import orgs './components/orgs.vue'; ... { path: '/orgs', component: orgs, meta: { requiresauth: true } }, from here have simple template in orgs.vue looks like: <template lang="html"> <div> {{orgs}} </div> </template> <script> export default { data(){ return { orgs: []; } }, created() { //use axios fetch orgs this.orgs = response.data.orgs; } } </script> the problem if want show list of organizations in other pages, bound duplicate same code other pages well, trying find solution call return organizations can use in multiple page? what solution this? to make data available across application use vuex . state management library stores application data in single source tree. if don't want vuex above issue, can try mixins . mixins best way share functio

c++ - what is mean by dict -

i came through program below firstmissingpositive(vector<int> &a) { vector<bool> dict(a.size()+1,false); for(int i=0;i<a.size();i++){ if(a[i]>0 && a[i]<dict.size()) dict[a[i]]=true; } if(a.size()==1 && a[0]!=1) return 1; else if(a.size()==1 && a[0]==1) return 2; int i=0; for(i=1;i<dict.size();i++){ if(dict[i]==false) return i; } return i; } in program, not mean following line vector<bool> dict(a.size()+1,false); what dict , statement? it's variable. the definition of variable calls specific constructor of vector initialize specific size, , initialize elements specific value. it's equivalent to vector<bool> dict; dict.resize(a.size()+1,false); see e.g. this std::vector constructor reference more information available constructors.

c# - WPF-XAML expander datatrigger background color change -

reference: wpf event trigger change other ui element i create 7 buttons(different colors) change expander header background when button clicked. <expander x:name="dataexpander" isexpanded="{binding expander_isexpanded}"background="{binding expander_background,fallbackvalue=plum}"> <expander.header> <textblock fontsize="18" fontfamily="bold" horizontalalignment="stretch" verticalalignment="stretch" text="{binding expander_header_text,fallbackvalue=nocolor}"/> </expander.header> <expander.style> <style targettype="expander"> <style.triggers> <datatrigger binding="{binding ismouseover,elementname=color0}" value="true"> <datatrigger.enteractions> <beginstoryboard> <storyboard> <coloranimation

deep learning - Initializing layers in Caffe Convolutional Neural Network -

i working on constitutional neural network using caffe . have prototxt file layer "hungarian". layer has 2 additional top layers box_confidences , box_assignments . layer { name: "hungarian" type: "hungarianloss" bottom: "bbox_concat" bottom: "boxes" bottom: "box_flags" top: "hungarian" top: "box_confidences" top: "box_assignments" loss_weight: 0.03 hungarian_loss_param { match_ratio: 0.5 permute_matches: true } } then box_confidences used in layer box_loss bottom layer{ name: "box_loss" type: "softmaxwithloss" bottom: "score_concat" bottom: "box_confidences" top: "box_loss" } my queries (1)do need setup layers these box_confidences , box_assignments ? (2)if necessary, how setup layer in prototxt file? layer holding blob data , how these 2 layers used in hungarianlosslayer class member

node.js - Process not waiting until get the data for api in nodejs -

i new nodejs. process not waiting until data mailgun api mail validation. here code var validator = require('mailgun-validate-email')('pubkey-xxxxxxxx') validator(req.body.email, function (err, results) { console.log(results) // times getting response. of time getting undefind. if(results.is_valid == true ) { user.findone({ 'emails.email' : req.body.email}, function(err, doc){ console.log(doc) }) } })

jquery - How to make checkbox selection triggering in sequence while calling javascript function -

i have 3 checkboxes , each 1 holds flag value , calls same function. how can make sure selection of these checkboxes makes calls per order of checking check boxes. issue : when click on check boxes quickly, though selected checkbox-1 , checkbox-2 in sequentially, internally making first call checkbox-2 , calling chekbox-1 event. please note intermittent issue happens when user checking boxes quickly. query : there way make sure order of checkbox firing? you haven't added code snippet answer theoretically. problem common non-blocking i/o , ui, if user clicks fast, example form submit button, can send form many times. the easiest method avoid such issue block other check-boxes, when of request pending set boolean indicator , if indicator true disable other check-boxes, when response comes unblock interface , set indicator false again.

java - How to save multiple tables in hibernate -

i have 3 tables example: table_a, table_b , table_c. parent b , c. how can save tables @ time of parent table in hibernate. if have mapped tables entities, : example: //parent @entity @inheritance(strategy = inheritancetype.joined) public abstract class car { } @entity public class bcar extends car {} @entity public class ccar extends car {} session.save(bcar); session.save(ccar);

elasticsearch - Elastic Backup occured -

i troubled when elasticsearch backing up.go right point. elasticsearch.yml ... ... path.repo: ["/usr/local/elasticsearch/backup/cluster"] when tried. curl -xput master:9200/_snapshot/backup?pretty -d '{"type":"fs","settings":{"location":"/usr/local/elasticsearch/backup/cluster"}}' occured { "error" : { "root_cause" : [ { "type" : "repository_verification_exception", "reason" : "[backup] [[llbiftzytrsmbsek4ugusa, 'remotetransportexception[ [node1][x.x.x.226:9300][internal:admin/repository/verify]]; nested: repositoryverificationexception[[backup] file written master store [/usr/local/elasticsearch/backup/cluster] cannot accessed on node [{node1}{llbiftzytrsmbsek4ugusa}{fyhibyulttambfybifp4ua}{slave1}{x.x.x.226:9300}]. might indicate store [/usr/local/elasticsearch/backup/cluster] not

php - Information About Mongodb Log File CONN 3635100 I think creating multiple connections -

i looking mongodb log file(mongod.log-/var/log/mongodb).i saw there can see in below contents of log file each query.its showing connection different number(conn3635100,conn3635079,i.e).so here query mongodb creating new connection each query or not.is there mistake in configuration. using laravel 5.1 mongodb 3.2 ubuntu 16.04 2017-07-27t15:13:18.598+0000 command [conn3635100] command targetjob- plus.jobseekers command: find { find: "jobseekers", filter: { user_id: { $in: [ "5979a1951e184a40c66e98c2" ] } } } plansummary: collscan keysexamined:0 docsexamined:4542 cursorexhausted:1 keyupdates:0 writeconflicts:0 numyields:35 nreturned:1 reslen:1279 locks:{ global: { acquirecount: { r: 72 } }, database: { acquirecount: { r: 36 } }, collection: { acquirecount: { r: 36 } } } protocol:op_query 124ms 2017-07-27t15:13:18.707+0000 command [conn3635079] command targetjob-plus.jobseekers command: find { find: "jobseekers", filter: { user_id: { $in: [ "5

amazon sqs - Do AWS messaging services support STOMP? -

do aws sns , sqs support stomp protocol ? i have tried googling it. went through several forums not sure yet. no. amazon sns , amazon sqs have own api. stomp need support services (rather vice versa), appears stomp not support sns nor sqs.

go - Mock struct golang for testing -

i have following code: type struct { somestring string somenumber int } func (a *a) somefunction(asd string) error { //do thinks return err } func createastruct() (a, error) { return a{},nil } func functiontotest (asd string) error { //do thinks a, _ := createastruct() return a.somefunction(asd) } i want build unit test method "functiontotest" , don't want call method "somefunction" of struct. reason need "subclass" of implements "dummy" "somefunction" . can this? i trying refactor method creating following struct: type acreator struct { createa func() (a, error) } var acreator = acreator{createa: createastruct} type struct { somestring string somenumber int } func (a *a) somefunction(asd string) error { //do thinks return err } func createastruct() (a, error) { return a{},nil } func functiontotest (asd string) error { //do thinks a, _ := acreator.createa() re

javascript - JQuery - Swapping two elements does not work after first move -

i have function bubble sort among content of various div s. each swap operation, swaps divs too, using jquery swapsies plugin . problem tht swap once, , after other swap operations: function swap(id1, id2){ $('#' +id1).swap({ target: id2, opacity: "0.5", speed: 1000, callback: function() { } }); } function bubblesort() { var ret=[]; $(".num-div").each(function(){ ret.push($(this));}); let swapped; { swapped = false; (let = 1; < ret.length; ++i) { if (ret[i - 1].html() > ret[i].html()) { swap(ret[i-1].attr('id'), ret[i].attr('id')); [ret[i], ret[i - 1]] = [ret[i - 1], ret[i]]; swapped = true; } } } while (swapped); return ret; } in first step i=1 works , swaps ret[i-1] ret[i] , after not work. the swap plug-in not process calls when busy animation. can see in source code of plug-in: if (options.target!="" && !swapping) { the swapping variabl

windows - Runas Error 2, trying to run the current Batch instance as administrator -

i'm trying run current batch file run administrator, doesn't quite work. :( it worked once, don't know did there xd please take @ code. :r cls runas /user:administrator rem runas /user:administrator %~n0%~x0 if %errorlevel% neq 0 pause && goto r if %errorlevel% equ 0 cls && goto start :start cls

Is there any way to change the text size (font size) of specific blocks when you using asciidoc? -

i need help. now using asciidoc , asciidoctor create manuals. i want texts smaller on specific blocks, example wide table, wide list, , on, not want main texts smaller. need make texts of wide tables smaller customer requests so. is there way? i read about [small] , [%autofit] option https://github.com/asciidoctor/asciidoctor-pdf/issues/185 never needed maybe give try. example-code [small] ---- should rendered in smaller font. ---- [%autofit] ---- long text doesn't want fit on single line default font size, we'll make shrink fit. ----

ios - TableViewController numberOfRowsInSection section -

i have controller buttons , tableviewcontroller 10 arrays. each button has index, pass tableviewcontroller . in tableviewcontroller code looks this: override func tableview(_ tableview: uitableview, numberofrowsinsection section: int) -> int { if buttonindex == 0 { return array0.count } else if buttonindex == 1 { return array1.count } else if buttonindex == 2 { return array2.count } else if buttonindex == 3 { return array3.count } else if buttonindex == 4 { return array4.count } else if buttonindex == 5 { return array5.count } else if buttonindex == 6 { return array6.count } else if buttonindex == 7 { return array6.count } else if buttonindex == 8 { return array6.count } return array0.count } i want automatically define current index this: override func tableview(_ tableview: uitableview, numberofrowsinsection section: in

Why it is possible to build custom language for JVM, like Groovy, Scala, Clojure, Kotlin? -

these languages differ java in significant ways, oo system, type system (most notable). the actual question whether jvm keeps track of objects under hood? there object inside jvm? responsibility of creators of such languages may interoperate java world, or achieved "by default"? all jvm languages compile "java byte code". actually, jvm not have idea of programming language java. jvm spec specifies " class file", must fulfill rules. long provide compliant class files, created compiler e.g., code run on jvm. that's kotlin example.

payment - Incorrect card number when swiping with Magtek Card Reader -

i'm working on pos web app, use credit card swipe functionality. i'm planning use card reader: magtek 21073062 dynamag magnesafe triple track magnetic stripe swipe reader 6' usb interface cable, 5v, black i tried out swiping credit card , final card data follows: "%b4111111111111111^first/last^1010000000000000000000000000000?;4111111111111111=11111111111111119080000000000000000?|0600|f8861ec73f7bd2790d4ee2dbb7935b039de9653de90d240c1257e225fbb987837b779d29246d9d516a94fe9f770396fe6ad2a5f3312108df35bb512f4ba22a84ff3bb6cdfc008024|669078686f127d2a0660bbbe6c7bd3f708ed1b42216f41e37f3dcf59db02c77452337456c9f5141d||61403000|190894cfa8a9e46a350c2e758dc1d83a798980bf5319298583e13dc98c62272c8c732d07b2713b1face8dbf6ce16b57c94360610cd6ffe46|b2e15b9061015aa|789a6e205c421d40|9011080b2e15b9004018|1ca3||1000" data interpreted according financial cards the card number according response above, card number "4111111111111111"(for representation purpose). problem

node.js - How i can merge two query in one findAndCount in sequelize? -

need make 1 findandcount() 2 partially different query userid comes param, , return result depending on whether param buyerid in order or contained sellerid in good models.order.findandcountall({ distinct: true, limit, offset, where: { archived: 1, buyerid: userid, }, include: [{ model: models.good, where: { type: 'lineup' }, as: 'good', include: userinclude }] }); and models.order.findandcountall({ distinct: true, limit, offset, where: { archived: 1, }, include: [{ model: models.good, where: { type: 'lineup', sellerid: userid }, as: 'good', include: userinclude }] });

sql - Count column with name 'count' returns multiple rows. Why? -

i don't understand why query: select count(base.*) mytable base; does return multiple rows. select count(1) mytable base; returns proper count. there column name count . can please explain behaviour? here information schema: table_catalog,table_schema,table_name,column_name,ordinal_position,column_default,is_nullable,data_type,character_maximum_length,character_octet_length,numeric_precision,numeric_precision_radix,numeric_scale,datetime_precision,interval_type,interval_precision,character_set_catalog,character_set_schema,character_set_name,collation_catalog,collation_schema,collation_name,domain_catalog,domain_schema,domain_name,udt_catalog,udt_schema,udt_name,scope_catalog,scope_schema,scope_name,maximum_cardinality,dtd_identifier,is_self_referencing,is_identity,identity_generation,identity_start,identity_increment,identity_maximum,identity_minimum,identity_cycle,is_generated,generation_expression,is_updatable mydatabase,vcs,mytable,controlepunt,1,,yes,text,,1

vba - How to solve error 91 in access -

i encountered error when ran code on search button. below code. thank you. option compare database option explicit private sub txtsearch_click() if isnull(searchbar) = false me.recordset.findfirst "[ponumber]=" & searchbar me!searchbar = null if me.recordset.nomatch msgbox "no record found", vbokonly + vbinformation, "sorry" me!searchbar = null end if end if end sub you have keep recordset: private sub txtsearch_click() dim rs dao.recordset if isnull(me!searchbar.value) = false set rs = me.recordsetclone rs.findfirst "[ponumber]=" & me!searchbar.value if rs.nomatch msgbox "no record found", vbokonly + vbinformation, "sorry" else me.bookmark = rs.bookmark end if me!searchbar.value = nu

sip - special 487 request terminated scenarios -

when sip isup call on table. mapping ( origination side sip , termination side isup) of that; normal call scenario , after acm , alerting isup side ( 18x on sip side) isup side sends release after (9 seconds) starting of ringing cause code 16 normal call clearing. sip server replied/mapped originator(calling party) 487 request terminated. questions : 1- on isup side: when call not answered yet ( alerting state) , possible isup rel message rel cause 16 ( normal call clearing) called party ( termination side)? 2- if rel message rel cause 16 isup side , on sip side message mapped ? because in specs never seen on sip isup mapping , 16 normal call clearing ... thanks in advance fatih

c# - How to fix a warning "Non COM-visible value type is being referenced either from the type currently being exported or from one of its base types"? -

i develop activex component. inherits system.windows.forms.usercontrol. when build project in visual studio, 0 errors , 20 warnings looks following sample: "warning : type library exporter warning processing 'activexcontrol.activexcontrol.get_anchor(#0), activexcontrol'. warning: non com visible value type 'system.windows.forms.anchorstyles' being referenced either type being exported or 1 of base types." i have tried google solution fix these warnings, can't find helps me. any idea how can fix these warnings? look answer in first comment of post.

aurelia - Get ViewModel of containerless element -

in aurelia when want access view model of dom element aurelia custom element can use au property aurelia attaches, componentelement.au.controller.viewmodel . when custom element containerless (attribute @containerless on class level) property au not available. this gist demonstrates this: https://gist.run/?id=928f97f49c01c1db10d8bf4399f5c335 how can access viewmodel of containerless custom component when have reference dom element? i'm not sure if want, can use view-model.ref . instance: <less-comp text="item three, containerless" view-model.ref="test"></less-comp> usage: export class app { attached() { console.log(this.test); } }

c# - How to reshape a tensor in TensorFlowSharp -

tensorflowsharp wrapper of tensorflow in c# platform. click jump tensorflowshape github now need reshape tensor shape [32,64,1] new tensor shape [1, 2048].but refer official api document, usage seems that: tfoutput reshape (tensorflow.tfoutput tensor, tensorflow.tfoutput shape); the problem dont know how express shape need in way of tfoutput suggestions appreciated:)! in standard tensorflowsharp, example on how operation can given by: tf.reshape(x, tf.const(shape)); where tf current default tfgraph in tfsession. alternatively, if use keras sharp, might able operation using using (var k = new tensorflowbackend()) { double[,] input_array = new double[,] { { 1, 2 }, { 3, 4 } }; tensor variable = k.variable(array: input_array); tensor variable_new_shape = k.reshape(variable, new int[] { 1, 4 }); double[,] output = (double[,])variable_new_shape.eval(); assert.areequal(new double[,] { { 1, 2, 3, 4 } }, output); } as indicated in https://