Posts

Showing posts from June, 2012

ws security - Bottom-up CXF Web Service with WS-Trust - is it possible? -

i'm trying develop secure cxf web service java-first approach (java2ws). fine until try define "issuedtoken" policy shown, example, here . the problem is, of course, wsdl generated, can't insert policy in wsdl. tried @policy annotation , managed generate proper wsdl file, find policy ignored service, doesn't show in "online" wsdl. so how go implementing secure web service bottom-up approach? can done? p.s. i'm going deploy service in fuse i think it's not possible way. per ws-thrust note: because ws-issuedtoken support builds on ws-securitypolicy support, available "wsdl first" projects.

javascript - SVG animation on path like the snail -

Image
i have following svg , draw circles pixel pixel on path after moveing. it's when snail goes let streak behind him. question how draw light red circles? <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewbox="0 0 1000 200" id="svgbox" style="background-color:#e4e4e4"> <path d="m3.858,58.607 c16.784-5.985,33.921-10.518,51.695-12.99c50.522-7.028,101.982,0.51,151.892,8.283c17.83,2.777,35.632,5.711,53.437,8.628 c51.69,8.469,103.241,11.438,155.3,3.794c53.714-7.887,106.383-20.968,159.374-32.228c11.166-2.373,27.644-7.155,39.231-4.449l10,10" stroke="grey" stroke-width="1" fill="none" id="animatemotion"/> <circle cx="" cy="" r="5" fill="red"> <animatemotion dur="6s" repeatcount="0"> <mpath xlink:href="#...

python - Return the "valid" numbers -

i need write function in python, returns valid measurements list of numbers. measure invalid, if closest other measurement less 0.1 second away. also, output list should same length length of input list. thus: [5.1, 5.6, 6.0, 10.34, 10.37, 10.45, 12.5] should return [true, true, true, false, false, false, true] i have approached problem in following fashion: list = [5.1, 5.6, 6.0, 10.34, 10.37, 10.45, 12.5] newlist = [] i, j in zip(list, list[1:]): if j - >= .1: newlist.append(true) else: newlist.append(false) the problem returns following list: [true, true, true, false, false, true] 1 false measurement missing. how can write code differently? your assumption incorrect. there's 2 false measurements. 1 @ 10.37 , 1 @ 10.45. measurement @ 10.34 ok since happens several seconds after previous one. your result has 1 less value input list because you're comparing values 2 2. it's typical "intervals & values...

javascript - I want to pull the names with the top 5 values out of an object...in React -

i have state set empty object. when searched returns list of names values inside of object. how pull names top 5 values names render? here initial state: export default class app extends react.component { constructor() { super(); this.state = { searchinput: '', selectedartist: {}, selectalbums: {}, artistcounts: {}, }; here fucntion gets names , gives them value: gettrackdetails(track) { request.get(`api`) .then((track) => { const { artists } = track.body; const artistcounts = this.state.artistcounts; (let = 0; < artists.length; i++) { const artist = artists[i]; const artistname = artist.name; if (artistcounts[artistname]) { artistcounts[artistname] += 1; } else { artistcounts[artistname] = 1; } } not sure getting right looks need limit for (let = 0; < artists.length; i++) { to run 5...

We want to have utility to tigger test cases on a machine with TestNG with some java code -

i have tests of testng java code , want run on native machine cmd command or bat file. can done using java or not? check the manual . like: java org.testng.testng testng1.xml [testng2.xml testng3.xml ...

c - Integer from pointer warning -

i have problem. 2 warnings console, dont know what's wrong code. can have look? program suppose show lines @ least 11 characters , 4 numbers #include <stdio.h> #include <ctype.h> int main() { char line[200]; printf("enter string: \n"); while(fgets(line, sizeof(line),stdin)) { int numberalpha = 0; int numberdigit = 0; if(isalpha(line)) numberalpha++; else if(isdigit(line)) numberdigit++; if(numberalpha+numberdigit>10 && numberdigit>3) printf("%s \n", line); } return 0; } both isalpha() , isdigit() takes int , not char *, argument . in code, passing array name argument, you're passing char * ( array name decays pointer first element when used function argument ) , so, you're getting warning. you need loop on individual elements of line , pass them functions. that said, suggestion, hosted environment, int main() should int main(void) con...

python - My while loop isn't working -

Image
this part of code , not sure why while loop doesn't let user try again. please me! answer3 = true while answer3: if answer2.lower() == "no" or answer2.lower() == "nah": print ("okay ... bye.") sys.exit() elif answer2 == "yes".lower() or answer2.lower() == "yeah" or answer2.lower() == "yes": print ("okay ... \n") else: print("please enter valid answer! try again!\n") break the break function exits while loop, if answer3 still has value true, stop loop after end of it's first cycle. remove break , shall work. it terminates current loop , resumes execution @ next statement, traditional break statement in c. the common use break when external condition triggered requiring hasty exit loop. break statement can used in both while , loops. if using nested loops, break statement stops execution of innermost loop , start ...

css - Carousel, make a div within an item same height as sibling item's div -

Image
i have responsive owl carousel (v2), each item or slide has image , below text of variable length, see image below: as can seen, images bottom aligned same baseline, regardless of how text there is. i've done setting text div fixed height. problem is, if there 1 line of text, i'd have unnecessary space below carousel. if allow div set own height, this: so images no longer lined up. html <div> <img class='a4_diary_image' src='sizes/test.png'> <div class='owl_diary_desc'> a4 size, going on 2 lines </div> </div> <div> <img class='a5_diary_image' src='sizes/test.png'> <div class='owl_diary_desc'> a5 size </div> </div> <div> <img class='a6_diary_image' src='sizes/test.png'> <div class='owl_diary_desc'> a6 size ...

java - Does interrupt exception to a sleeping thread release lock on the object -

when thread on sleep state still holds lock object, , when interrupted, release lock , go ready state or continue execution without changing state? when interrupted, release lock , go ready state or continue execution without changing state? being interrupted thread status change (a flag has been set) not state change, , has not effect on whether release lock or not. a thread holding object's monitor release if calls wait (with or without timeout) on corresponding object instance or when exit synchronized block, being interrupted or not doesn't change rule. here simple code shows idea: // used make sure thread t holds lock before t2 countdownlatch latch = new countdownlatch(1); thread t = new thread( () -> { synchronized (someobject) { // release t2 latch.countdown(); (int = 1; <= 2; i++) { try { system.out.println("sleeping " + i); ...

java - Jackson Json to POJO mapping -

getting started jackson first time, having issues mapping json data java classes. json structure follow: { "status": "ok", "all_tags": [ { "id": 14, "term_name": "term 1", "category_details": [ { "category_id": 21, "category_name": "category name", "category_count": 1, "category_image": "...202x300.jpg" }, { "category_id": 19, "category_name": "category sample", "category_count": 3, "category_image": "...202x300.jpg" } ] }, { "id": 17, "term_name": "term 2", "category_details": [ { "category_id": 20, "category_name": "category sample a...

Module Based Development in Nette php -

my question pretty simple.i developing web site using nette framework.can use module based project structure. ex: project |- app |- module_1 |- module_2 you can. see official documentation more information.

Highlight items of specific taxonomy -

on test page have 2 columns of same taxonomy terms, make testing: http://trt-test.fusionidea.com/team/ what i'm trying click on of terms on right side, , same term on left side become red , not of them now. i apriciate kind of help. the code have this: <script> $(function() { $('.myclass <?php echo $tax_term->slug; ?>').click(function() { $('.leftcol <?php echo $tax_term->slug; ?>').addclass('tl-selected-red'); }); }); </script> left column: <?php $taxonomy = 'meetourteam'; $tax_terms = get_terms($taxonomy, array('hide_empty' => false)); ?> <ul> <?php foreach ($tax_terms $tax_term) { echo '<li class="leftcol ' . $tax_term->slug . '">' . $tax_term->name.'</li>'; } ?> right column: <?php $taxonomy = 'meetourteam'; $tax_terms = get_terms($taxonomy, array('hide_empty' => false)); ?> <ul...

html - Unify advanced form -

i trying create form using unify , having conflict style.css here piece of html code there problem: <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script> <script type="text/javascript" src="tinymce/js/tinymce/tinymce.min.js"></script> <script src="js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="css/app.css"> <link rel="stylesheet" type="text/css" href="css/animate.css"> <link rel="stylesheet" type="text/css" href="css/line-icons.css"> <link rel="stylesheet" type=...

grails - Second level expand in gson -

i'm using grails 3.2.2 , org.grails.plugins:views-gradle:1.1.1 , in section gson i'd expand users , carnets. tried: import com.example.sections.section model { section section } json g.render(section, [excludes:['archived', 'deleted'], expand:['clients', 'clients.carnets']]){ } but expands clients in result json. how can that? btw carnets in client domain class transient. possible add transient variables result gson? if - how? not of version 1.1, seems reasonable thing want do. please report , issue https://github.com/grails/grails-views/issues

php - mysql - return all dogs from animal_type column -

i don't know right way ask question. lets assume have table animals. each row has information such average weight, native climate, , animal_type. i want see rows animal_type dogs,cats,fish i have array created lists each type, surrounded ' , separated , code line: $sql = "select * mytable ({$want_to_see}) = 'animal_type'"; gets parsed into select * mytable ('dogs','cats','fish') = 'animal_type' which yields operand should contain 3 column(s) on output webpage. going wrong? presumably, animal_type column. if so, don't use single quotes. and function want in() : $sql = "select * mytable animal_type in ({$want_to_see})"; only use single quotes string , date constants, never column aliases. your specific error little inscrutable. happening tuple of 3 strings being compared single string. why error mentions 3 operands.

python - django-admin error with decoding -

i have problem " django-admin startproject mysite . " command. when try execute it, cygwin returns me error: traceback (most recent call last): file "/usr/bin/django-admin", line 9, in load_entry_point('django==1.10.2', 'console_scripts', 'django-admin')() file "/usr/lib/python2.7/site-packages/django-1.10.2-py2.7.egg/django/core/management/ init .py", line 367, in execute_from_command_line utility.execute() file "/usr/lib/python2.7/site-packages/django-1.10.2-py2.7.egg/django/core/management/ init .py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/usr/lib/python2.7/site-packages/django-1.10.2-py2.7.egg/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) file "/usr/lib/python2.7/site-packages/django-1.10.2-py2.7.egg/django/core/management/base.py", line 345, in execute ...

Javascript size on binary search tree -

i have done c++ because can pass in parameter reference. having trouble figuring out how in javascript. need change in code? output 1 this.sizeofbst = function(){ size = 0; return sizehelper(this.root, size); } function sizehelper(node, size){ if(node){ sizehelper(node.left, size); size++; sizehelper(node.right, size); } return size } numbers cannot passed reference in javascript. instead, have sizehelper return size , add size total. function sizehelper(node) { if (node) { return 1 + sizehelper(node.left) + sizehelper(node.right); } return 0; } then can used like this.sizeofbst = function() { return sizehelper(this.root); }

concurrency - How can I declare tasks inside an ada package? -

i'm trying write program class. in specifications, tasks cannot have procedures or functions. must use package name access tasks. how can go doing this? can write along lines of package hello task sample is... end sample; end hello; yes. you of course have put task body in package body.

android - Problems to deploy xcode with ionic -

i'm developing app in ionic android , ios, have opened in android studio , managed deploy, in xcode not deploy on iphone ios 10.1 in xcode jump following error 'in-app purchase' feature available users enrolled in apple developer program. please visit https://developer.apple.com/programs/ enroll., prior updating mac ios 10 , sierra work without developer account, have again changed ?? thanks in advance

Python: Change url of web browser using webbrowser-control -

ok, know if want open particular url using pyton run: import webbrowser webbrowser.open("buinvent.com") but if want change different url in web browser without opening new window or new tab in web browser. there way that? import webbrowser webbrowser.open('google.com', new = 0) and docs says: if new 0, url opened in same browser window if possible. if new 1, new browser window opened if possible. if new 2, new browser page (“tab”) opened if possible https://docs.python.org/3/library/webbrowser.html

javascript - grunt watch tasks no response after running -

Image
i have problem when run "grunt" in terminal, after changes in ".scss" file nothing happens, terminal still waitting..... here gruntfile.js file: module.exports = function(grunt){ require('load-grunt-tasks')(grunt); grunt.loadnpmtasks('grunt-contrib-jshint'); var config = grunt.file.readyaml('gruntconfig.yml'); grunt.initconfig({ sass:{ dist:{ src: config.scssdir+'style.scss', dest: config.cssdir+'style.css' } }, concat:{ dist:{ src: config.jssrcdir+'*.js', dest: config.jsconcatdir+'app.js' } }, jshint:{ options:{ "eqeqeq": true }, all:[ 'gruntfile.js', config.jssrcdir+"*.js" ] }, watch:{...

java - how to iterate over a text file to perform different tasks (including creating an unknown number of objects) depending on which line I'm reading -

hello i'm low level comp sci student that's struggling/unfamiliar file i/o. i'm attempting read in text file using buffered reader. understand how use while loop continue scanning until end of file reached how can instruct reader read 1 line , until end of 1 line reached, read next line , until line ends, etc? basically input text file going repeat every 3 lines. text file represents nodes in weighted directed graph. the input text file supposedly following: each node represented 2 lines of text. example on top line, first 's' name of node, second 's' indicates it's start node, third 'n' indicates it's regular node, not goal node, indicated 'g'. on second line 2 nodes connected 's' first being 'b' weighted distance of 1, , second being 'e' weighted distance of 2. the third line supposed blank, , pattern repeated. s s n b 1 e 2 b n n c 2 f 3 c n n d 2 ga 4 ...

jquery - Javascript replaceing img file -

i working on website needs use javascript. need javascript use external page. don't quite understand how this. have 5 files on computer needs able replace image file's name , alt. cant use http though. i have code image: <img src="images/cablecar.jpg" width="480" height="270" alt="cable car turnaround" id="gallery" /> i need use javascript change cablecare , alt part new image file , description while using onmouseover. code have far javascript: function switchpix(file, desc){ var line = '<img src= asian.jpg width=\'480\' height=\'270\' alt= +desc+/>'; document.getelementbyid("pix").write(line); } html: <figure id="pix" class="right"> <script src="scripts/gallery.js"> </script> <img src="images/cablecar.jpg" width="480" height="270" alt...

python 3.x - Assignments in integers and lists -

a=2 b=3 a=b a=a+12 print(a) print(b) output : 15 3 when did kind of thing in lists: list1=[1,2,3,4] list2=[4,5,6,7] list1=list2 list1.append(12523) print(list1) print(list2) output: [4, 5, 6, 7, 12523] [4, 5, 6, 7, 12523] whenever changed value of , b doesn't change @ all.but in second when changed list1 , list2 changes automatically.can ask why happens ? it's because of data type used, first have a = b (both integers , primitive types ) , such happen in a = b a = 3 . in second case have list (not primitive type) , list1 = list2 list1 point same place in memory list2 pointing to, change make change place in memory both list1 , list2 pointing towards

mongodb - What is the difference between find({}, {sort: ...}) and find().sort(...)? -

in mongodb documentation, when search sort, direct me cursor.sort() page . (btw documentation doesn't specify returned out of method.). used in meteor script collection.find().sort('date':1) , got complained find().sort not function. (i thought find() returns cursor, isn't it?) so did further search, , found tutorials tell me use find({}, {sort: ...}). so difference between these 2 methods? in meteor framework, things need meteor way! use collection.find specified in meteor docs , , pass sort specifier . what difference between two? 1 has been wrapped meteor, , works inside framework, other 1 doesn't! i don't believe see performance difference between 'the meteor api' in framework, or 'the standard mongodb api' (non meteor) nodejs.

javascript - SoundCloud Cross-Origin Request Blocked at https://l9bjkkhaycw6f8f4.soundcloud.com/v1/events -

i trying use soundcloud widget api found here . i have iframe <iframe id="sciframe"></iframe i included script <script src="https://w.soundcloud.com/player/api.js" type="text/javascript"></script> then, execute script in function. var scplayer; var iframesoundcloud = document.getelementbyid("sciframe"); iframesoundcloud.src = "https://w.soundcloud.com/player/?url="+encodeuricomponent(lien); scplayer = sc.widget("sciframe"); scplayer.bind(sc.widget.events.ready, function(){ scplayer.play(); }); when page first loaded, soundcloud song plays well. when call time without refreshing page, cross-origin request blocked: same origin policy disallows reading remote resource @ https://l9bjkkhaycw6f8f4.soundcloud.com/v1/events . (reason: cors header 'access-control-allow-origin' not match ' ').* message, , song cannot play. why that? the probl...

java - How can I communicate which object (within an ArrayList) a clicked node is attributed? -

i making javafx form program. form data handled using arraylist of pages arraylists of nodes, objects containing gui element (label) , it's data members. so: main declaration private final arraylist<arraylist<formnode>> form = new arraylist<>(); private final arraylist<formnode> page = new arraylist<>(); int currentnode = 0; //index of active node object class public class formnode { private string nodename; private boolean visible; private boolean editable; private label nodegui; //constructor...sets...gets...methods } when node initialized, added pane , assigned event handlers via separate class. trying have program communicate object active clicking on node associated it, can flagged active node. something (not actual code, pseudo of need): the user clicks on desired label (node) in gui, calls... nodegui.setonmousepressed(new eventhandler<mouseevent>() { @override public int handle(mouseevent...

node.js - Socket.io connect event not firing -

this first time working node.js/socket.io , i'm having little trouble 'connect' event firing sockets. followed chat application example , tried add feature instead of displaying in console when user connects or disconnects, display on-screen. the disconnect event firing tabs (if have multiple tabs open chat application), connect event seems fire current tab. server (index.js) var app = require('express')(); var http = require('http').server(app); var io = require('socket.io')(http); app.get('/', function(req, res){ res.sendfile(__dirname + '/index.html'); }); io.on('connection', function(socket){ socket.on('connect', function(){ io.emit('connect', "a user connected"); }); socket.on('disconnect', function(){ io.emit('disconnect', "a user disconnected"); }); socket.on('chat message', function(msg){ io.emit(...

How to convert render from three.js to .png file? -

how convert render .png image? i've been looking around awhile nothing has worked. here function use , a fiddle shows working. function takescreenshot() { // screenshots work webgl renderer, preservedrawingbuffer should set true. // open in new window var w = window.open('', ''); w.document.title = "screenshot"; //w.document.body.style.backgroundcolor = "red"; var img = new image(); img.src = renderer.domelement.todataurl(); w.document.body.appendchild(img); // download file this. //var = document.createelement('a'); //a.href = renderer.domelement.todataurl().replace("image/png", "image/octet-stream"); //a.download = 'canvas.png' //a.click(); }

java - JavaFX: MenuBar showing "..." -

Image
so: have here piece of code using add menu application. stage window; private void buildwindow() { window = new stage(); window.settitle("face"); //menu menubar mblaunch = new menubar(); menu filelaunch = new menu("file"); menuitem savelaunch = new menuitem("save"); menuitem exitlaunch = new menuitem("exit"); filelaunch.getitems().addall(savelaunch, new separatormenuitem(), exitlaunch); mblaunch.getmenus().add(filelaunch); //housekeeping borderpane bplaunch = new borderpane(); bplaunch.getchildren().addall(mblaunch); scene launch = new scene(bplaunch); window.setscene(launch); window.setminheight(500); window.setminwidth(500); window.show(); } however: when run code produces: so, question being, how can make display else ...? in advance. borderpane places each child @ specific location: center, top, bottom, left, right. if add nodes list of children, doe...

vue.js - how can component delete itself in Vue 2.0 -

as title, how can that from offical documentation tell $delete can use argument 'object' , 'key' but want delete component this this.$delete(this) no, not able delete component directly. parent component have use v-if remove child component dom. ref: https://vuejs.org/v2/api/#v-if quoted docs: conditionally render element based on truthy-ness of expression value. element , contained directives / components destroyed , re-constructed during toggles. if child component created part of data object on parent, have send event parent via $emit , modify (or remove) data , child component go away on own. there question on recently: delete vue child component

android - Custom RecyclerView adapter generating heavy lag while using in viewpager -

my app's mainactivity class consist of viewpager around 10 tabs. inside each tab loading listitem using android recyclerview. problem occurs when user swipes right-left in viewpager. after debugging, found problem occurs inside customlistadapter. i found lags increases if increases number of layout inflater inside oncreateviewholder. @override public recyclerview.viewholder oncreateviewholder(viewgroup parent, int viewtype) { recyclerview.viewholder viewholder; // performance hit view itemview = layoutinflater.from(parent.getcontext()) .inflate(r.layout.list_row, parent, false); view itemviewlast = layoutinflater.from(parent.getcontext()) .inflate(r.layout.list_row_last, parent, false); view itemviewdefault = layoutinflater.from(parent.getcontext()) .inflate(r.layout.list_row_default, parent, false); switch (viewtype) { case 0: viewholder = new myviewholder(itemview); ...

C# getting variables from a CAST statement using Regex -

i have following input string: string text = "cast(@myvar datetime)"; is there way extract variable , datatype used using regex? expected output: name ='@myvar' type ='datetime' you use following expression , use capturing groups pairs: (?<=cast\()(.*)(?:\s+as\s+)(.*)(?=\)) see @ regex101 var text = "cast(@myvar1 datetime2)" + environment.newline + "cast(@myvar2 datetime2)"; var matches = new regex(@"(?<=cast\()(.*?)(?:\s+as\s+)(.*?)(?=\))", regexoptions.ignorecase).matches(text); foreach(match match in matches) { // first capturing group full match, need start index 1 actual group 1 var name = match.groups[1]; var type = match.groups[2]; console.writeline("name: {0}, type: {1}", name, type); } // name: @myvar1, type: datetime2 // name: @myvar2, type: datetime2

mysql - $_SESSION is not passing values between pages php -

i have 3 files. ( loginfunctions.php , login.php , index.php ) in login.php , take values , pass loginfunction.php check values , select userid prepared statement return login.php . after login.php calls method called (get('value')) pass userid , return user info. started session in login , index pages. tried echo info have been stored in session nothing returning. my codes: loginfunction.php <?php function absolute_url($page = 'index.php') { //header('location: http:\\localhost'); //exit(); //terminates script $url = 'http://' . $_server['http_host'] . dirname($_server['php_self']); $url = rtrim($url, '/\\'); $url .= '/' . $page; return $url; } function checklogin($email = '', $password = '') { $errors = array(); if (empty($email)){ $errors[] = 'you must enter email'; } if (empty($password)){ $errors[] = 'you must ...

asp.net - Login and account registration broken on MVC application -

hello i'm new mvc , have been looking solution problem last couple days no avail. i've created simple blog engine using asp.net mvc, after installing on iis on local pc, realized needed database login service work. so elected use localdb on pc plan use server. moved files on pc , installed needed. installed sqlexpress localdb , reset site, working perfectly. however, noticed minor typos on section of site that's not edited. stupidly, reinstalled website entirely new build instead of updating view needed correction smart person do. now every time attempt login excising account or create new 1 error cannot attach file 'c:\inetpub\wwwroot\app_data\aspnet-facetblog-20161020065352.mdf' database 'aspnet-facetblog-20161020065352'. from i've learned, it's localdb instance, fixes i've found online seem have no effect. admittingly, i'm pretty naive comes sql, fix simple. if i've failed provide vital information please tell m...

ios - Data is ambiguous for type lookup in this context? -

i converting project latest swift 3. stuck @ 1 position. func nsdatatojson(data: data) -> anyobject? { { return try jsonserialization.jsonobject(with: data, options: .mutablecontainers) } catch let myjsonerror { print(myjsonerror) } return nil } gives me error on func nsdatatojson(data: data) -> anyobject? { data ambiguous type lookup in context. how can use in swift 3? while using function in playground error 'jsonobject' produces 'any', not expected contextual result type 'anyobject?' so after changing anyobject any , working func nsdatatojson(data: data) -> any? { { return try jsonserialization.jsonobject(with: data, options: .mutablecontainers) } catch let myjsonerror { print(myjsonerror) } return nil }

Angular 2 sortable table using Semantic-UI -

i'm using semantic-ui in angular 2 app , trying add sorting functionality table. semantic-ui discusses here: http://semantic-ui.com/collections/table.html , , says this: adding classname of ascending or descending th show user direction of sort. example uses modified version of kylefox's tablesort plugin provide proper class names. make sortable tables work, include javascript(1) page , call $('table').tablesort() when dom ready. (1) = http://semantic-ui.com/javascript/library/tablesort.js so, copied , pasted js code , put in angular 2 project in src > assets > tablesort.js then edited angular-cli.json file scripts section includes this: "../src/assets/tablesort.js" in table's html, set to: <table class="ui sortable celled table"> in table's main component/ts file, after imports before component decorator, added this: declare var $:any; and last step seems adding code "when dom ready": $(...

sql - How to find List Tables using columns value -

i have 500+ tables in database. tables have several columns. among them tables have 'cmdflag' column , value of columns may have 'c'or'd' or 'm'. my requirement find list of tables cmdflag 'c'or'd' or 'm'. table name column name value ---------- ----------- ----- table_a cmdflag c table_a cmdflag d table_a cmdflag m table_b cmdflag c table_b cmdflag d table_c cmdflag m so on ... i can find list of tables these have cmdflag column using information_schema.columns. want find list of tables cmdflag columns have value 'c'or'd' or 'm'. i have gone through several questions can't fulfill requirement. want use simple query not procedure. try this. have use dynamic query , temp tables exec not work common table expressions. create table #t1 ( tablename varchar(30), rn int ) create table #t...

github - Create multiple PRs of one PR -

can tell me how create multiple prs of 1 pr? actually, i've 1 pr have 160 commits it's difficult reviewer. there ay convert pr 4 pr ? there's no magic available task. checkout pr, rebase pieces need 4 separate branches , create 4 prs out of them. for example if you've got pr available locally, can do: git checkout original_pr_topic git checkout -b new_pr_topic_1 git rebase -i master # choose commits want git push github_remote new_pr_topic_1 git checkout original_pr_topic git checkout -b new_pr_topic_2 ....

for loop - Iterating a function based on data.frame cell values -

i have been beating head against problem , have made little progress. i have data.frame 4 columns , 8 rows. table shows column names not row names. 5 10 20 40 1 1 2 4 1 2 4 8 2 3 6 12 2 4 8 16 3 5 10 20 3 6 12 24 4 7 14 40 4 8 16 40 i need calculate function, y <- (c-(i-1))/((k/2)*(1+k)), • c number in data.frame cell • k value of column name • iteration number loop through function c times. for example, cell [8,1], need iterate function 4 times, = 1:4. i new r, , each piece of has been challenge, iteration portion has me stumped. how can use cell value data.frame control iterations such through loop? i have set nested loops move through data.frame column, row, iterate function based on cell value, latter loop not working. perhaps there more simple approach, apply , dplyr approaches have not worked me either. thanks much. ...

c# - Convert 2 datatable to one table -

i have table health: year | value1 | value2 2015 2016 bad 2017 bad bad and table money: year | money1 |money2 2014 100 200 2015 300 null 2018 500 500 i want make tmp table this: tmptable year |value1 |value2 |money1 |money2 2014 null null 100 200 2015 300 null 2016 bad null null 2017 bad bad null null 2018 null null 500 500 can in sql server? use 2 left joins , use union combine result sets both left joins. query select t1.[year], t1.[value1], t1.[value2], t2.[money1], t2.[money2] [health] t1 left join [money] t2 on t1.[year] = t2.[year] union select t1.[year], t2.[value1], t2.[value2], t1.[money1], t1.[money2] [money] t1 left join [health] t2 on t1.[year] = t2.[year] order 1; sql fiddle demo

github - Git issues of leaving a "deleted" file forever which can not do anything to it -

one of git repos (managed on github @ https://github.com/quchunguang/test ), leave file "deleted" state when git status . i cannot git add it, git rm or other thing remove it. tried git fsck --full no error detected. deleted entire repos , git clone github, issues still there. this happened on windows 10 64-bit system, git 64-bit (git version 2.8.0.windows.1). $ git status on branch master branch ahead of 'origin/master' 1 commit. (use "git push" publish local commits) changes not staged commit: (use "git add/rm <file>..." update committed) (use "git checkout -- <file>..." discard changes in working directory) deleted: run_myscript.py no changes added commit (use "git add" and/or "git commit -a") you have 2 files, "run_myscript.py" , "run_myscript.py ", same contents in repo. (the latter 1 has trailing space.) windows filesystem ignores (remove...

html - Three divs next to each other, third fixed position -

i have 3 divs, should next each other third 1 needs fixed @ position. tried using right:0, float:right in these cases third div doesn't stick other two, instead sticks right browser side, not want. have javascript move depending on calculated browser window width or there html/css (perhaps bootstrap) way it? i have following html: <div id="sub-container"> <div id="left"> {left} </div> <div id="content"> {content} </div> <div id="right"> {right} </div> </div> and such css: #left { float:left; top:$topbarheight; width:$leftwidth; position:relative; margin:2px auto; min-height:600px; z-index:1; } #right { width:$rightwidth; height:604px; top:$topbarheight; position:fixed; margin-left: 10px; } #sub-conta...

wpf - How we can access VisualStateGroup of a Control -

i saw page . , started wondering how can access visualstategroup of datagrid , or of button code ? you can use getvisualstategroups method of visualstatemanager . if button name of control: ilist list = visualstatemanager.getvisualstategroups(button); if (list.count > 0) { visualstategroup visualstategroup = (visualstategroup)list[0]; foreach (visualstate visualstate in visualstategroup.states) { // put here logic } } indeed list observablecollection , while states freezablecollection . hope can you.

java - How to provide objects of the same type? Dagger2 -

i new @ dagger2 , tried build such sample understood how work. there sample code : mainactivity public class mainactivity extends appcompatactivity { @inject protected apiinterface apiinterface; @inject protected integer valueint; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); app.getcomponent().inject(this); } public void testbutton(view view) { if (apiinterface == null || valueint == null) { log.e("tag", "apiinterface == null"); } else { log.e("tag", "apiinterface != null : " + apiinterface.value + " : " + valueint); } } } component @singleton @component(modules = {modelmodule.class, anothermodule.class}) interface appcomponent { void inject(mainactivity mainactivity); } module @module class modelmodule { @provides int provideint() { return 1; } @provides apiinterface pro...

xamarin.forms - How to use Couchbase.Lite-PCL in a Xamarin Forms project? -

i see there's couchbase.lite-pcl in nuget has been published recently. capable of running in pcl? knows how make work? couldn't find documentation on this. it not official nuget package, milage may vary. it have dll's in portable folder, , dll's added fine pcl , project seems build. try it, might work fine, don't expect direct support couchbase people. alternatively implement interface in pcl, implement per platform methods need official couchbase nuget. inject platform specific implementation @ runtime through ioc container xamarin.forms provide.

python - Riak TS Performance Benchmark on Writing Data -

i new riakts , trying compare druid riakts in iot area. want checkout efficiency of writes riakts before choosing product.hence, started off below dry-run. data taken: aahrus (data having 4.3 million rows) client used: python node: single independent node. process went smooth. took 6 mins insert 4.3 million rows in batch of 1 million rows. is expected performance or can tweak ? short answer yes, can tweak more performance. first note riak ts, while can run single node, designed clustered. adding nodes , directing writes nodes via load balancer spread workload increase write speed. some other points consider current set increase write speed bit: the python client supports batching writes (not sure if batching using or not). based on experience 100 records per batch seems optimal performance. riak ts replicates data 3 time ha reasons. since using single node replication isn't needed. when create table set n value equal 1. increase write speed. simple exam...

java - Empty jtextfield/jpassword delete sound -

well, working on java project requires input user. realised if user press backspace when there no characters in field, window warning sound heard. how can stop please. system windows 10 if @ behavior may different on different platforms. thank you. behavior may different on different platforms. yes, behaviour can different because controlled laf, should not changing it. but understand how swing works need understand swing uses action provided defaulteditorkit provide editing functions of text components. following code current "delete previous character" action (taken defaulteditkit ): /* * deletes character of content precedes * current caret position. * @see defaulteditorkit#deleteprevcharaction * @see defaulteditorkit#getactions */ static class deleteprevcharaction extends textaction { /** * creates object appropriate identifier. */ deleteprevcharaction() { super(defaulteditorkit.deleteprevcharaction); } /...

sql - Select rows that match several conditions -

my title question not explanatory, didn't figure out better one, if has suggestion title gladly accept it! i'm newbie , still figuring out things... i have table pupil_teachers so +------+----------+------------+ | id | pupil_id | teacher_id | +------+----------+------------+ | 1 | 100 | 200 | | 2 | 101 | 200 | | 3 | 102 | 200 | | 4 | 102 | 201 | | 5 | 101 | 201 | | 6 | 101 | 202 | | 7 | 103 | 200 | +------+----------+------------+ the query retrieve teachers pupils 100, 101 , 102 have in common. in case teacher id 200. pupil 103 has teacher id 200, not part of query, want query pupils 100, 101 , 102. so start with: select teacher_id pupil_teachers i don't know go next. following not correct select teacher_id pupil_teachers pupil_id in (100, 101, 102) any appreciated! thanks! , not duplicate, did try search solution issue. here 1...