Posts

Showing posts from March, 2012

java - SQL Input String was not in a correct format on XML -

i formatting .xml file contains coding of .swf game (through .xmls , .dats), however, it's runable server using mysql. i adding items on dat1.xml (basically main .xml), won't post .xml here (it's 79823 lines long) code goes this: code <object type="unique id shown 0x000-0xffff" id="item name"> <class>equipment</class> <item/> <texture> <file>texture .png file</file> <index></index> </texture> <slottype>9</slottype> <description>self explainatory</description> <bagtype>4</bagtype> <feedpower>feed in-game pets</feedpower> <soulbound/> (soulbound = cannot traded) <displayid>name display in-game</displayid> when finished adding new items, tried run server.exe (which selects dat1.xml, among other .xmls items coded correctly server-sided), when server reaches dat1.xml, error shows up: sys...

linux - Could pthread mutex with PTHREAD_PROCESS_SHARED attribute be used to synchronize two unrelated process(not father and child)? -

we use pthread mutex pthread_process_shared attribute synchronize father , child process: 1,mmap 2,pthread_mutexattr_init , pthread_mutexattr_setpshared 3,fork but if want synchronize 2 unrelated process(not father , child) using phtread mutex, how? please give example?

vb.net - Excel find the sum of every 6th column in a loop -

Image
i have excel sheet have inserted blank columns through macro need find sum of every 6 columns , store values in empty column? trying step 7 7 isnt working. need empty columns have average of last 6 columns the code have tried is sub sum_of_every_6th_column() dim ilastcol integer ilastcol = cells(1, columns.count).end(xltoleft).column ' same ctrl+right arrow colx = 7 ilastcol step 8 '?? unable understand can come here next end sub try code, alter per needs, sub sumcols() dim long, j long, k long j = 0 k = 1 cells(rows.count, 1).end(xlup).row = 1 cells(k, columns.count).end(xltoleft).column + 1 if isempty(cells(k, i)) cells(k, i) = j j = 0 else j = j + cells(k, i) end if next next k end sub

assembly - How to read image file and display on screen in windows tasm dosbox -

Image
im learning graphical programming in tasm using dosbox. ive been using bunch of loops draw square blocks of pixels , hard. want know if theres way read image , display it. know how read txt file maybe start. pls help you need write/use image loader or use own image file format. bmp may simple has in compression pixel formats etc still can focus on specific type of bmp , ignore others... back in days of ms-dos using 256 color pcx images palette used 256 color video modes. here nasm linez game example: color lines - simple game in c++/the checking algorithm see pcx: subroutine. decodes loaded pcx file memory ds:0 raw vga image @ es:di . beware support 64 kbyte size limit !!! visualize image have copy es:di content videoram (assuming a000:0000 ) example rep movsd or can set es:di in first place (but flicker). this pcx loader not use palette image need encode ... (the routines change vga palette included in source need extract rgb values pcx think @...

java - Bitmap drawn in a rectangle, now rotate 90 and scale it to the same rectangle -

Image
i have bitmap drawn in rectangle. want rotate bitmap 90 degree , draw oriented bitmap in same rectangle bound, may need scale it. above oriented image not scaled fit rectangle bound of original rectangle (see first image, normal one) , remove lower part of image. below code snippet. suggestion ? sourceimagerect.left = 0; sourceimagerect.top = 0; sourceimagerect.right = bmp.getwidth(); sourceimagerect.bottom = bmp.getheight(); destimagerect.top = desttop; destimagerect.left = destleft; destimagerect.right = destleft + destwidth; destimagerect.bottom = desttop + destheight; canvas.save(canvas.matrix_save_flag); canvas.rotate(90, (destleft + (destwidth / 2)), (desttop + (destheight / 2))); canvas.drawbitmap(bmp, sourceimagerect, destimagerect, null); canvas.restore(); last image exact required output need. i writed tool java class named imagescaleutil.java several days ago. helping can useful information on it. you can use it, this: ```java bitmap ta...

python - styling issue in navigation bar with django -

Image
i have styling issue in navigation bar when next button enabled, has issue error in next page button: but when button disabled, got fixed error fixed: here code navigation.html <div class="col-6 col-offset-3 text-center pagination-set"> <nav aria-label=""> {% if queryset.has_other_pages %} <ul class="pagination"> {% if queryset.has_previous %} <li class="page-item"> <a class="page_link" href="?page={{ queryset.previous_page_number }}">&laquo;</a> </li> {% else %} <li class="page-item disabled"> <a class="page-link"><span class="page-link">&laquo;</span></a> </li> {% endif %} {% in page_range %} {% ...

swift - Enum Case not found in type -

enum operator: character { case substract = "-" case add = "+" case multiply = "*" case divide = "/" } i have enum above , function declared below checks if have valid operator. e.g. isoperator("+") func isoperator(_ symbol: character)-> operator? { let op = operator(rawvalue: symbol) switch op { case .substract, .add, .multiply, .divide: return op default: return nil } } what compiler returns here "enum case not found in type" means cases defined in switch statement (.add .. etc) not available in operator type. why compiler not able find case since op operator type swift inver types atuomatically? yes, because let op = operator(rawvalue: symbol) optional , in switch case matching exact values. can apply optional in case while comparing. below. func isoperator(_ symbol: character)-...

ios - Why do I get nil in my Collection View Cell? -

i using alamofire in case when debug alamofire code not execute , tried manually creating url , setting headers , calling api url. my collection view class follows. // // categoryviewcontroller.swift // irate // // created ammar khan on 16/08/2017. // copyright © 2017 theistudio. rights reserved. // import uikit import alamofire import swiftyjson import sdwebimage class categoryviewcontroller: uiviewcontroller, uicollectionviewdatasource, uicollectionviewdelegate { @iboutlet var mycollectionview: uicollectionview! var catarr:[string] = [] var catimage:[string] = [] let categoriesurl = "http://127.0.0.1:8000/api/places/categories" override func viewdidload() { super.viewdidload() // additional setup after loading view. } override func viewdidappear(_ animated: bool) { loadcatlist() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can...

android - Set some Alarm Manager -

i want set working alarm manager. want start alarm manager in 11 a.m , after call stop alarm manager in 11:10 , again start alarm in 11:15 , continue this. think not working code. need alarm manager object setting alarm? what problem? have advise me? protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.managedatamenu_activity); am=(alarmmanager)this.getsystemservice(context.alarm_service); start(9,50); stop(9,52); start(9,53); stop(9,54); start(11,13); stop(11,15); //setalarm(); inititems(); } private void start(int hour,int min){ //first start calendar calendar=calendar.getinstance(); calendar.settimeinmillis(system.currenttimemillis()); calendar.set(calendar.hour_of_day,hour); calendar.set(calendar.minute,min); intent intent=new intent(this,alarmmanagerbroadcastreceiver.class); intent.putextra("start","start"); pi=p...

javascript - Clear data in kendo ui grid -

hello read article use kendoui grid angularjs directive , create sample project use directive grid : <div kendo-grid="kendo.cargrid" k-options="maingridoptions"></div> my problem when click set new data button , grid showing data , next click clear data button , grid clear data , next click again set new data button grid doesn't show data whats wrong it? did forgot? <!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled</title> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.2.621/styles/kendo.common.min.css"> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.2.621/styles/kendo.rtl.min.css"> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.2.621/styles/kendo.default.min.css"> <link rel="stylesheet" href="http...

angularjs - How can I change value of angular object used in HTML? -

i need change value in html using angular click. value getting changed in angular function not reflecting in html. angularjs , html :- $scope.gettbldata = function (name) { var data = $.param({ tblname: name }); var mytbldatalist = []; $scope.tempname = ''; $scope.tempname = name; if (name == 'contacttbl') { $('#contacttbl').show(); $('#coursetbl').hide(); $('#coursedesctbl').hide(); $('#coursesubdesctbl').hide(); $('#interntbl').hide(); $('#locationtbl').hide(); } else if (name == 'coursetbl') { $('#contacttbl').hide(); $('#coursetbl').show(); $('#coursedesctbl').hide(); $('#coursesubdesctbl').hide(); $('#interntbl').hide(); $('#locationtbl...

Rspec ruby rails -

i'm trying create action set properly. i keep getting error: argumenterror: unknown keyword: topic here testing: require 'rails_helper' rspec.describe topicscontroller, type: :controller let(:my_topic) { topic.create!(name: randomdata.random_sentence, description: randomdata.random_paragraph)} describe "post create" "increases number of topics 1" expect{ post :create, {topic: {name: randomdata.random_sentence, description: randomdata.random_paragraph}}}.to change(topic,:count).by(1) end "assigns topic.last @topic" post :create, { topic: {name: randomdata.random_sentence, description: randomdata.random_paragraph}} expect(assigns(:topic)).to eq topic.last end "redirects new topic" post :create, {topic: {name: randomdata.random_sentence, description: randomdata.random_paragraph}} expect(response).to redirect_to topic.last end end here controller: def create @topic = topic.new @topic.name = params[:topic][:na...

sql server - SQL query to show data by today(current) date? -

i trying record database current date here query have tried bu getting no records table: select * transactions transaction_date = getdate(); just compare date part select *from transactions convert(char(10), transaction_date ,126)=convert(char(10), getdate(),126);

php - cURL send data after registration -

i can't message websites avito.ru problem if add curl_setopt($ch, curlopt_post,1); curl_setopt($ch, curlopt_postfields, $comment); on page write write 404 if delete show page . me need send message. me please websites here 2oq.ru/avito/message error no code here $urlout = 'https://m.avito.ru/saratov/vakansii/operator_frezerno-gravirovalnogo_stanka_s_chpu_890782585/write'; // Куда данные послать $urlto = 'https://www.avito.ru/profile/login?next=%2fprofile'; // Куда данные послать $login = 'tytr.trte@mail.ru'; // Логин $password = '1qazxsw2'; // Пароль $auth = 'login='.$login.'&password='.$password; // post данные $mes = '2oq.ru Сайт по поиску работы'; $comment = 'comment='.$mes; $ch = curl_init(); // Инициализация сеанса curl_setopt($ch, curlopt_url, $urlto); curl_setopt($ch, curlopt_useragent,...

angularjs - Error during npm run start with Angular 4 and Universal -

i have frontend application developed others angular4 application makes call our apis. i integrate universal in order have seo. important because application ecommerce. followed lot of tutorials, when same on application error. this tutorial followed: https://coursetro.com/posts/code/68/make-your-angular-app-seo-friendly-(angular-4-+-universal) when npm run start got error: error: compilation failed. resource file not found: d:/test/frontend/src/assets/sass/global @ moduleresolutionhostadapter.readresource (d:\test\frontend\node_modules\@angular\compiler-cli\src\compiler_host.js:387:19) @ compilerhost.loadresource (d:\test\frontend\node_modules\@angular\compiler-cli\src\compiler_host.js:250:33) @ object.get (d:\test\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:25757:107) @ directivenormalizer._fetch (d:\test\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:14104:43) @ d:\test\frontend\node_modules\@angular\compiler\bundles\compiler.umd.js:1...

javascript - Cannot open SemanticUI modal window using Angular 2 -

i using angular2 , semantic ui css-framework. trying open modal window cannot show it. in official semantic's docs offer open way: $('.ui.modal').modal('show') far know it's jquery , doesn't work, causes error: error typeerror: webpack_imported_module_1_jquery (...).modal not function @ appcomponent.webpackjsonp i call app controller. approach in opening modal may not best one. wondering if me know how easily. <html> <head> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.js"></script> </head> <body> <div style="width: 60%; margin-left: 15pt; margin-top: 30pt"> <ap...

dependency injection - use custom service with angular service in another service - angular2 -

i have 2 services 1 of them(logger) going used another(settingservice), have searched lot , see other questions , answers problem no luck, i've read document angualr.io/when service needs service here code 2 services logger service @injectable() export class logger { public logs: string[] = []; //do stuffs } settingservice @injectable() export class settingservice { private url = '/setting'; private headers = new headers({ 'content-type': 'application/json' }); constructor(private http: http,private logger: logger) { } //problem here //do stuffs } the settingservice using both http , logger , have component app.component uses settingservice , here app.component , app.module app.component.ts @component({ moduleid: module.id, selector: 'my-app', templateurl: 'app.component.html', styleurls: ['app.component.css'] }) export class appcomponent implements oninit { ...

php - in Zend Framework 2 or 3, can module name be same as class name? -

we create module our project called memcached . way can have namespaced services (e.g. memcached\service\get ) perform actions using php's installed memcached class. however, notice following lines in zendframework/zend-modulemanager/src/listener/moduleresolverlistener.php if (class_exists($modulename)) { return new $modulename; } this means if name our module memcached , loading module not work. module instantiated memcached object rather desired memcached\module object. so, there way can name our module memcached ? or, need more creative , name our module memcachedmodule ? prefer not latter since none of our other modules have module suffix. module zend thing written using php classes. cant have 2 classes same name, cant import "module class" , "own class" same name, related if working in 1 namespace. can access classes full namespace. here example. <?php namespace my\space; class theone { function __construct() { ...

mongoose - MongoDB Loadbalancer is not working as execpted -

i have multiple mongos in below uri. mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostn[:portn]]][/[database][?options]] mongodb://username:password@host123:40000,host124:40000,host124:40000/admin?ssl=true we created mongoclient , try read value collection, prints system.out.println("server address: " + mongoclient.getaddress()); system.out.println("connection point: " + mongoclient.getconnectpoint()); it returning host123 , not working round robin. changes required in connection uri? mongodb use hostn fall on redundancy, if want deploy load balancing you'll have deploy own load balancer mix.

node.js - Converting an node js app to android app -

i have developed web app in node js using express involves mongodb. how convert android app ? main app file directly inside main application folder. your subject in thread looks confuse. think want convert web application (can express.js app, php app, or jsp, etc) mobile application (ios or android). if so, can use cordova it. please read document. http://cordova.apache.org/docs/en/3.5.0/guide/cli/index.html

java - ProgressDialog in AsyncTask in android -

i working on login in application. trying display progressdialog in backgroundworker class extends async task. click on login button, progress dialog shown few seconds. there possibility signing process last longer? snippets of code `public class backgrroundworker extends asynctask<string,void,string>{ context context; alertdialog alertdialog; boolean correct; public backgrroundworker(context context){ this.context = context; } @override protected string doinbackground(string... params) { string type = params[0]; string login_url = "random"; string register_url = "random"; if(type.equals("login")){ try { string username = params[1]; string password = params[2]; url url = new url(login_url); httpurlconnection httpurlconnection = (httpurlconnection) url.openconnection(); httpurlconnecti...

c# - Routing API project and Web Application project in the same domain (Azure) -

background i have 2 separate projects in solution. 1 of them (the web application project) responsible show landing page (on root of domain, www.example.com) , documentation api (say www.example.com/documentation). the other project responsible api itself. it's path must www.example.com/api/v1/ ensure compatibility our previous software. we made way able publish updates of projects without need publish entire solution, , of course, organization. problem i don't how configure applications run on azure on same domain different routes, , i'm stating fear not possible. i tried configure subdomain (say api.example.com/v1), can't done because break compatibility our current clients. this question i'm looking for, not show how on azure, , this one on azure using subdomains. first: have create 2 folders, 1 web api , second web app second: have set 2 folders application. after doing 2 steps can acces 2 folder puting: www.yourdomaine.co...

javascript - Gulp file not updating/building css in browser -

so can compile scss css fine. however, whenever change in scss file has no effect on page unless build styles. my gulp file: var gulp = require('gulp'); var sass = require('gulp-sass'); var concatcss = require('gulp-concat-css'); // gulp watches gulp.task('watch', function() { gulp.watch('app/scss/**/*.scss', ['sass']); // sass watch // gulp.watch('dist/css/main.css'); }); // sass compiler gulp.task('sass', function() { return gulp.src('app/scss/**/*.scss') .pipe(sass()) // convert sass css .pipe(gulp.dest('app/css')) }); // compile css files gulp.task('styles', function () { return gulp.src('app/css/**/*.css') .pipe(concatcss('main.css')) .pipe(gulp.dest('dist/css')); }); /** default builds **/ // build gulp.task('build', ['styles']); // watch , build changes gulp.task('default', ['build', 'watch...

arrays - How to check 2 values in 1 table using PHP, jQuery? -

is there way check 2 exists values in 1 table ? it work fine when use 1 value 'beezname' when added value 'divid' didn't work, check whether 'beezname' or 'divid' exist in table. i'm trying : if beezname , divid exist return true else false how can make work? in advance here's controller : beez function checkbeezexists() { $beezid = $this->input->post("beezid"); $beezname = $this->input->post("beezname"); $divid = $this->input->post("divid"); if(empty($beezid)){ $result = $this->beez_model->checkbeezexists($beezname, $divid); } else { $result = $this->beez_model->checkbeezexists($beezname, $divid, $beezid); } if(empty($result)){ echo("true"); } else { echo("false"); } } and model : beez_model function checkbeezexists($beezname, $divid, $beezid= 0) { $this->db->select("beezname, divid");...

javascript - Nodejs - how group and export multiple functions in a separate file? -

how can group , export multiple functions in nodejs? i trying group util functions in utils.js: async function example1 () { return 'example 1' } async function example2 () { return 'example 2' } module.exports = { example1, example2 } and imported in home.js: import { example1, example2 } '../utils' router.get('/', async(ctx, next) => { console.log(example1()) // promise { 'example 1' } }) i thought 'example 1' test case above? any ideas? this solution exporting problem! , don't mix es5 exports es6 imports , can weird - sometimes! export const example1 = async () => { return 'example 1' } export const example2 = async () => { return 'example 2' } // other file import { example1, example2 } '../../example' return example1() nevertheless if have mix them, let me know! can find solution aswell! more exporting modules , can go wrong! mdn ...

jpanel - Java - Reading coordinates -

g.drawrect(30, 50, 30, 30); g.filloval(30, 90, 30, 30); = g.drawrect(x, y, width, length); g.filloval(x, y, width, length); is correct? how need understand these numbers/coordinates?

javascript - three.js dat.GUI, automated control (.listen) does not transfer to morph target -

i want control morpt targets of json character automatically. control of sliders works, face not move. when use mouse, face moves well. why not work if without mouse? can me? var shape = { mouth_open: 0.0, //anfangsposition 0.0 }; var gui = new dat.gui({ autoplace: false, width: 250, height: 9 * 32 - 1 }); var folder = gui.addfolder( 'morph targets' ); folder.add( shape, 'mouth_open', 0, 1 ).step( 0.01 ).name('mouth_open').listen().onchange( function( ) { mesh.morphtargetinfluences[ 40 ] = a;}) folder.open(); var update = function() { requestanimationframe(update); shape.mouth_open = 0.50 }; update(); function animate() { render(); requestanimationframe( animate ); } function render() { renderer.clear(); controls.update(); renderer.render( scene, camera ); } animate();

javascript - Ajax search doesnt connect to database -

iam trying make live ajax search . when put word automatically shows suggestions bellow w3schools. reason index file , php doesnt exchange data value or database doesnt connect reason.what "no country found". can check code errors? php file : <?php include_once('dbconnect.php'); $q = intval($_get['q']); $query = mysqli_query($conn,"select * `users` usercountry '%".$q."%'"); $count = mysqli_num_rows($query); //replace table_name table name , `thing_to_search` column want search if($count == "0" || $q == ""){ $s[] = "no country found!"; }else{ while($row = mysqli_fetch_array($query)){ $s[] = $row['usercountry']; // replace column_to_display column want results } } for($x = 0; $x < $count; $x++) { echo $s[$x]; echo "<br>"; } ?> and index.php file : <head> ...

mysql - Loading a lot data into labels Windows form c# -

i'm working on 1 software. have 1 tab shows lot of user data database. values databases stored labels.(i have label name, price, model etc.). works fine, except fact takes lot load data , show. program stop working 1-2 s , begins work. have separate function set data on labels , show panel , separate select data database. i tried multi threading/invoke way wrote same. question best way display lot of data labels , show them, possible without program being frozen.

How to handle selenium Dropdown elements in Page Object model? -

i'm new in pom framework. being stuck handle dropdown in page object model. please me out. here html code: <select id="gender" class="form-control" required="" data-hint="gender" placeholder="gender" ng-model="pvregister.gender" name="gender"> <option name="male">male</option> <option name="female">female</option> </select>

sql server - Convert and Insert varchar date from one table to another -

i want insert date 1 table another. problem is, source table having date stored varchar , destination date datatype. also want change format of date while inserting destination. table1 date varchar(80) null table2 date date null date in table1 stored in mm-dd-yyyy want convert dd.mm.yyy , store table2. how should convert it? tried below, not working. select convert(varchar(10),try_convert(date,[date]),104) if destination table has date field of date type should convert source data date type , insert it. the format dd.mm.yyyy want output not date format string , can date data second table using convert string format 104 while selecting data second table this: declare @table1 table ([date] varchar(80) null); insert @table1 values ('12-31-2001'), ('02-28-2002'); declare @table2 table ([date] date null); insert @table2 select convert(date, [date], 101) @table1; select convert(char(10), [date], 104) @table2; here used table variables ...

javascript - I'm trying to import Excel to Mongodb from Meteor, How can I get every _id to my documents? -

for each document in mongodb should have _id, i'm trying import excel mongodb meteor. has 1 _id, result looks beautiful it's not expect, please me solve this. my code: import { template } 'meteor/templating'; import { reactivevar } 'meteor/reactive-var'; import { excels } '../imports/api/excels.js'; import './main.html'; const xlsx = require('xlsx'); template.read.events({ 'change input' (evt, instance) { /* "browser file upload form element" sheetjs readme */ const file = evt.currenttarget.files[0]; const reader = new filereader(); reader.onload = function(e) { const data = e.target.result; const name = file.name; /* meteor magic */ meteor.call('upload', data, name, function(err, wb) { if(err) console.error(err); else { /* here -- dumps array of arrays console */ ...

Howto create an Apache Rewrite rule to redirect Microsoft Edge browser -

Image
how create simple apache rewrite rule mod_rewrite redirect microsoft edge browser page 1 fixed page. needed on instance of apache runs on intranet , runs 1 specific application not cater edge, ie. when user tries go application edge, rule should redirect them specific url on server enlighten them how fine ie. i facing 2 issues: i know rule needs act on user-agent, don't know makes edge browser unique others. thoughts on best place might go , figure out? have looked @ microsoft's web site , share strings are, doesn't spell out how tell them apart. thinking might best @ open source library has figured out. how write rule url hits site except 'enlightenment' page? in general, user agents crappy deal with. best not rethink , use heavily tested library. 1 of best ua-parser . collection of regexes match user agents, flavors in languages. if want have in apache logic itself, you can extract list of regex (edge)(\d+)(?:\.(\d+))? how writ...

c# - Using Dispatcher to change a label's foreground throws an exception -

i trying make cpu friendly infinite loop update label every 2 seconds. when comes update label, can use dispatcher change content , tooltip values, can't change foreground reason. invalidoperationexception : can not use dependencyobject belongs thread freezable parent. there code: private void setping(brush foreground, string content, string tooltip) { try { this.dispatcher.begininvoke(dispatcherpriority.send, (action)(() => { this.ping.content = content; this.ping.tooltip = tooltip; })); // this.dispatcher or this.ping.dispatcher throws same error this.ping.dispatcher.begininvoke(dispatcherpriority.normal, (action)(() => { this.ping.foreground = foreground; })); } catch (exception) { } } and i'm calling code performping method here: new thread(() => { while (true) { this.performping(this.host); thread.s...

javascript - Add last hundread year list in input field dropdown -

i want add last hundreds years year list in dropdown list . how can that. var time = new date(); var year = time.getyear(); if (year < 1900) { year = year + 1900; } var date = year - 101; /*change '101' number of years in past want show */ var future = year + 100; /*change '100' number of years in future want show */ document.writeln ("<form><select><option value=\"\">year"); { date++; document.write ("<option value=\"" +date+"\">" +date+ ""); } while (date < future) document.write ("</select></form>"); date.getyear() deprecated, use date.getfullyear() instead. example: <select id="selyears"></select> var selectlist = document.getelementbyid('selyears') var d = new date() var year = d.getfullyear() var past = 200 // change num here var future = 250 // change num here for(var =...

java - Define custom Comparator for JavaFX TableView Column rendered as SimpleObjectProperty<ImageView> -

i have table has different columns , signature of 1 want add custom comporator : @fxml private tablecolumn<media,simpleobjectproperty<imageview>> hasbeenplayed; so column rendered imageview . has 2 possible states , either imageview have null image or imageview have image , specific 1 have defined . so want sorting based on i f imageview has null image , if imageview has image , made below comparator reports error don't know why... hasbeenplayed.setcomparator( new comparator<simpleobjectproperty<imageview>>() { @override public int compare(simpleobjectproperty<imageview> o1 , simpleobjectproperty<imageview> o2) { if (o1.get().getimage() == o2.get().getimage()) return 0; return -1; } }); i should use lambda expression above , added in way more obvious trying achieve. the error getting .. exception in thread "javafx application thread" java.lang.classcastexception: javafx.scene.i...

.net - Akka.NET Persistence: Warning on deleting messages -

i getting following warning in logs when trying delete messages snapshot version: 2017-08-20 15:58:09.6802|warn|appriver.office365.subscriptionprovisioningchecker.actors.subscriptionprovisioningstatuscheckcoordinator|failed deletemessages tosequencenr [3] persistenceid [subscriptionprovisioningstatuscheckcoordinator] due to: [microsof t.data.sqlite.sqliteexception (0x80004005): sqlite error 5: 'database locked'. @ microsoft.data.sqlite.sqliteexception.throwexceptionforrc(int32 rc, sqlite3 db) @ microsoft.data.sqlite.sqlitecommand.executereader(commandbehavior behavior) @ microsoft.data.sqlite.sqlitecommand.executereader() @ microsoft.data.sqlite.sqlitecommand.executenonquery() @ system.data.common.dbcommand.executenonqueryasync(cancellationtoken cancellationtoken) --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime...

python - I have error 'Attempt to use a closed connection.' -

i have problems code. so, want add data accces writing in form. (i not in programming). from tkinter import * import pypyodbc import ctypes form=tk () form.title ("add data") form.geometry ('400x200') #create connection con = pypyodbc.connect('driver={microsoft access driver (*.mdb)};uid=admin;usercommitsync=yes;threads=3;safetransactions=0;pagetimeout=5;maxscanrows=8;maxbuffersize=2048;fil={ms access};driverid=25;defaultdir=c:/users/hp/desktop/pitl;dbq=c:/users/hp/desktop/pitl/pitl.mdb;') cursor = con.cursor () = entry (form, width=20, font="arial 16") a.pack () b = entry (form, width=20, font="arial 16") b.pack () def add (event): cursor.execute ("insert crime (`number_of_article`, `id_of_criminal`) values (?, ?)", (a, b)) con.commit () cursor.close () con.close () button=button(form, text = 'push me') button.pack () button.bind ('<button-1>', add) form.mainloop () my error is: excepti...

javascript - Hide parent with v-onclick Vue 2.0. max-width: 767px -

trying build dropdown-menu shown when screen smaller 767px. there 2 requirements here hide menu , are: if clicks outside menu , when random router link being clicked. export default { name: 'navbar', data() { return { isshow: false } }, methods: { onclick(e) { isshow = false } } } <button v-on:click ="isshow = !isshow">click me</button> <div class="router" v-show="isshow"> <router-link to="/" class="nav-link" v-on:click.prevent="onclick()">home</router-link> <router-link to="/phones" class="nav-link">phones</router-link> <router-link to="/moreproducts" class="nav-link">more products</router-link> <router-link to="/blogs" class="nav-link">support</router-link> ...

javascript - block consecutive $http request -

i working in angular project there have grid data , actions. on clicking 1 of action in onclick function ajax request going server side once in life time process. but when user consecutively click action button before first request's response came same call going server more once ends in error. i have tried disable action button before ajax request though cant prevent multiple request. there method block second request? my code is $http({ method: 'post', url: urls.api_url_serv + 'notification/read?token=' + token, transformrequest: transformrequestasformpost, withcredentials: false, headers: { 'content-type': 'application/x-www-form-urlencoded' }, data: { notification_id: notification_id } }).then(function(response) { var data = response.data; //some actions }).catch(function(response) { var status = response.status; // actions }); <span ng-class="{'disabled': read_disable}"...

json - AngularJS filtering ng-repeat by array -

so have json data of hvac businesses , want filter them certification array using html checkbox. following code simple version of i'm working |filter , ng-model removed angular.module("list",[]) .controller("listcontroller",[listctrlfun]) function listctrlfun(){ this.businesses = [ { "name": "hotcold", "certifications": ["residential","installation"] },{ "name": "megacorp", "certifications": ["commercial","installation"] }]; } <div ng-app="list" ng-controller="listcontroller vm"> <div> <label> <input type="checkbox" /> residential </label> <label> <input type="checkbox" /> commercial </label> <label> <input type="checkbox" /> installation </label> </div> ...

git - Version control of spreadsheet macros -

so while ago fiancée asked me create spreadsheet manage new small business. come find out looking fully-fledged crm. being future husband am, decided tackled googlesheets macros. 2 weeks in, have basic inventory handling down, project has gotten way bigger had ever anticipated. in-browser syder ide , basic version management isn't cutting more. my question now: begin managing project in github, can't find graceful way so. i've found this blog post on stand-alone apps script files, can't seem find macro (.gs) files in google drive. my questions: these files located? there way use e.g. eclipse develop macros , store them spreadsheet while using git or other version control? edit: got great feedback far, apparently cloud tools eclipse not allow apps script editing in same way google plugin eclipse did, see here . once you're done migrating code stand-alone script per michelle's instructions may want check out chrome extension: google apps scr...