Posts

Showing posts from June, 2010

Writing SQL in Informatica Data Quality Analyst -

i new informatica data quality analyst (version 9.5.1 hotfix3) , having trouble in generating basic sql statement. the sql statement being written against mapping specification of table imported flat file. statement looks like: select columna, columnb table1 table1.columna = 's' the select .... portion of statement works fine encounter errors when throw in clause. think statement looks standard sql i'm not sure why not work. informatica analyst accept sql written in specific form? inverted commas causing problems? the query must work trying execute. if not fetching results, need following steps: 1) load data source flat file database(oracle). can directly import data flat file table via sql developer. 2) execute query filter condition. if doesnt fetch rows, query in idq fetching correct results. if not, there missing in idq code.

How to use jquery to add text between existing <a href=''>Add text here</a> -

i have lightbox gallery following html code: <!doctype html> <html> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="css/style.css" type="text/css"> <title>gto gallery</title> </head> <body> <div class="container-fluid"> <h1>gto gallery</h1> <ul id="imagegallery"> <li><a href="img/1964_gto.jpg"><img src="img/1964_gto.jpg" width="100" alt="1964 pontiac gto" class="image"></a></li> <li><a href="img/1965_gto.jpg"><img src="img/1965_gto.jpg" width="100" alt="1965 pontiac gto"></a></li>

c - Pow precision with unsigned longs -

so trying pow (x, y). x , y unsigned longs , result stored in unsigned long. result smaller 2^63 should able it. since returns floating point number inaccurate results big numbers. there anyway exact result without using external libraries bignum? know x*x y times, trying avoid because trying make program faster. pow function returns double has precision issues , when cast long precision issue. far know if dont use library not possible accurate result using pow function alone. you can @ exponentiation squaring , @ barak manos answer can try implement own pow function as unsigned long long pow(unsigned long long x,unsigned int y) { unsigned long long res = 1; while (y > 0) { if (y & 1) res *= x; y >>= 1; x *= x; } return res; }

angularjs - Angular 2-way binding in ng-repeat -

i'm trying update values in ng-repeat ng-bind (or double curly braces) , html5's contenteditable. i cannot double binding work. don;t think contenteditable issue since doesn't work either input fields. <div ng-controller="myctrl"> <ul><li ng-repeat="sequence in sequences" sv-element> <span class="flex1" contenteditable="true" ng-bind="sequence.sequencetext"></span> // <span contenteditable="true">{{sequence.sequencetext}}</span> </li></ul> {{sequences}} </div> http://jsfiddle.net/56g2jyd7/1/ well didn't want use directive did. nice , easy: app.directive('contenteditable', function() { return { require: 'ngmodel', link: function(scope, element, attrs, ctrl) { // view -> model element.bind('blur', function() { scope.$apply(function() {

php - Fatal error: Call to undefined method DB::get() -

i accessing db class in index.php. checkout files: db.php <?php namespace blog\db; class db { /** * return db * @var object */ private $db; /** * results limit. * @var integer */ public $limit = 5; public function __construct($config){ $this->connect($config); } private function connect($config){ try{ if ( !class_exists('mongo')){ echo ("the mongodb pecl extension has not been installed or enabled"); return false; } $connection= new \mongoclient($config['connection_string'],array('username'=>$config['username'],'password'=>$config['password'])); return $this->db = $connection->selectdb($config['dbname']); }catch(exception $e) { return false; } } /** * 1 article id * @return array */

.net - Writing VB code for Oscilloscope as C# code -

i work in vb oscilloscope (the oscilloscope has it's own os). trying make c# executable same thing vb code , run on oscilloscope. i trying write following vb code c#: set app = createobject("lecroy.xstreamdso") wave = app.acquisition.c1.out.result.dataarray msgbox(wave(1)) what connect oscilloscope software , output first element of waveform array. this have tried far in c#: made form in vs2015 , made target .net 4.0 since oscilloscope running windowsxp , has .net 4.0 installed. system.type objtype = system.type.gettypefromprogid("lecroy.xstreamdso"); dynamic comobject = system.activator.createinstance(objtype); var wave = comobject.acquisition.c1.out.result.dataarray; messagebox.show(wave(1)); basically put code inside button on form. when run on oscilloscope executable error: "unhandled exception has occurred in application." "cannot invoke non-delegate type". can me doing wrong? appreciate it. since .net4, can

html - Change a div`s background image when hover over the image -

i have following code: <!doctype html> <html > <head> <style type="text/css"> .imgbox {background: url(lock75.png) no-repeat; } .imgbox:hover {background: url(lock75light.png) no-repeat; } </style> </head> <body> <div style="width:200px; height:200px; border:1px solid;" class="imgbox"> </div> </body> </html> my images 75x75 , problem occurs when hover on border image changes, want when hovering on image change image. note: need html construction similar one. edit i forgot mention need picture centralized above other divs have not space picture. thanks you need have container can hold both background image , content in following structure (i know asked similar have posted, it's not possible; involve css3 elements , jquery) here's setup body { padding:10px; } .img-box { max-width:200px; width:100%;

c program to find pythagorean triples -

int a,b,n; printf("input natural number n (n<2,100,000,000) : "); scanf("%d",&n); for(a=1;a<=100;a++) for(b=1;b<=100;b++) if(a<b && a*a + b*b == n*n) { printf("(%d, %d, %d)\n",a,b,n); } /*else { printf("impossible \n"); } */ return 0; if delete 'else' program runs correctly. want make function can check number has pythagorean numbers or not using 'else' paragraph. when put 'else' paragraph in code, result dizzy.... plz me!! put braces around nested code blocks. int a, b, n; int impossible = 1; printf("input natural number n (n<2,100,000,000) : "); scanf("%d", &n); (a = 1; <= 100; a++) { (b = 1; b <= 100; b++) { if (a < b && * + b * b == n * n) { printf("(%d, %d, %d)\n", a, b, n); im

.htaccess - Prevent indexing a domain in search engines like Google and Bing -

This summary is not available. Please click here to view the post.

wordpress - Restrict PHP Script's Access To Other Directories -

Image
i building web application allow users install plugins wordpress. i don't want scripts in plugin directory able access parent directories. how directory structure like: i running php on apache server on linux operating system. on vps server. :)

Messaging inside Chrome Extension in ClojureScript -

i'm trying write chrome extension basic communication between content script , background page. in javascript register listeners in both content , background pages, example in background page: chrome.browseraction.onclicked.addlistener(function(tab) { // send message active tab chrome.tabs.query({active: true, currentwindow: true}, function(tabs) { var activetab = tabs[0]; chrome.tabs.sendmessage(activetab.id, {"message": "clicked_browser_action"}); }); }); (taken this tutorial ). another example works in javascript: // content.js chrome.runtime.sendmessage({screenshot: true}, function(response) { console.log("response: " + response); }); // background.js chrome.runtime.onmessage.addlistener( function(request, sender, sendresponse) { alert('message received!'); console.log("request: " + request); if (request.screenshot) { // } }); how can translate above code clojurescript? my

plsql - Why is my identifer invalid in my code? -

insert phone_shipping_method(shipping_method_id,name, reset_shipping_date) values(50295656, 'ricky riveras',to_date( '010308', 'mmddyy')); insert phone_shipping_method(shipping_method_id,name, reset_shipping_date) values(4507655, 'bobby heenan',to_date( '050998', 'mmddyy')); insert phone_shipping_method(shipping_method_id,name, reset_shipping_date) values(3747547, 'jim johnson',to_date( '070969', 'mmddyy')); insert phone_shipping_method(shipping_method_id,name, reset_shipping_date) values(8432525, 'joshua trinite',to_date( '070909', 'mmddyy')); insert phone_shipping_method(shipping_method_id,name, reset_shipping_date) values(943252, 'dusty rhodes',to_date( '100999', 'mmddyy')); error get: insert phone_shipping_method(shipping_method_id,name, reset_shipping_date) * error @ line 1: o

javascript - Can an IndexedDB key of type "String" be a url path? -

i want use urls keys storing data in indexeddb. think valid key (from reading this: http://www.w3.org/tr/indexeddb/#key-construct ) not 100% certain. following valid keys? //examples of storing keys objectstore.put( data, "http://example.com/some-url" ); objectstore.put( data, "http://example.com/some-url#s?e=t%20something&%20=%@" ); objectstore.put( data, "/some-url-relative-url/audio.mp3" ); objectstore.put( data, "/images/test.jpg" ); are there restrictions on characters can in key if it's string? all strings can keys, unless hit memory limit or browser bugs. this includes things like: "" // empty string "abc\u0000def" // embedded null "\ud834\udd1e" // utf-16 surrogate pair "\uffff" // non-character "\ud800" // lone utf-16 surrogate so yes, stringified urls valid keys. of course, compared strings (sequences of 16-bit code units) may want/need perform url normali

javascript - Can not set selected value in select tag using angular.js and PHP -

i have 1 issue regarding select tag in angular.js.i binding data in select tag dynamically coming database.here unable set selected default text in select tag.i explaining code below. role.html: <select id="coy" name="coy" class="form-control" ng-model="user_name" ng-options="user.name user in listofname track user.value" > </select> my controller code set value inside select tag given below. $scope.listofname=[]; $scope.listofname=[{ name: 'user name', value: '' }] $http({ method: 'get', url: "php/userrole/getuserdata.php", headers: { 'content-type': 'application/x-www-form-urlencoded' } }).then(function successcallback(response){ angular.foreach(response.data,function(obj1){ var user={'name':obj1.user_name,'value':obj1.user_name}; $scope.listofname.push(user

php - Get the specified record and filter laravel eloqouent -

below code records 'department' equal 'admin' (working): $notification = notification::where('department', '=', "admin")->get(); now want records 'department' equal 'admin' while excluding records 'department' equal 'all' . ideas, clues achieve using laravel 's smart eloqouent? hope !! use and phrase in query include department = all laravel query builder , in query

Elixir macros: how to define function with dynamic arity -

refer post: how create dynamic function name using elixir macro? . the post above asked how use macro generate function without arguments, wonder how generate functions arguments ? assume there macro warp , write code like: warp fun, [args], :ok and generate code like: fun(args), do: :ok if want generate dynamic list of arguments, need use unquote_splicing this: defmacro warp(name, argument_names, code) quote def unquote(name)(unquote_splicing(argument_names)) unquote(code) end end end then later warp :foo, [a, b], {:ok, a, b} which generates def foo(a, b), do: {:ok, a, b} if call produce foo(1, 2) # {:ok, 1, 2} you can define macro without unquote_splicing , pass down combined name , arguments def : defmacro warp(name_and_args, do: code) quote def unquote(name_and_args) unquote(code) end end end this means need invoke warp invoke def , example: warp foo(a, b), do: {:ok, a, b}

mysql - Calculating tied ranking in php with pagination -

this first question here, please tell if unclear or need know more. i've provided information need. i got page calculating cycling rankings in norway. riders gets point in each race, , calculate overall ranking. until have calculated ranking after each race , saved overall points , rank in database. have been frustrating, since had run calculation after every small change or update. in updated page calculate overall points , ranking using php-code inside loop when displaying table (all 3 rank variables set 0 before loop): $rank_tmp++; if ($rankpoints!=$row["points"]) { $rank=$rank_tmp; } echo $rank this simple code works well, , give me ranks ties. the challenge when use pagination split results on each page. in query , code i've added: limit $starting_position, $records_per_page"; $starting_position=($_get["page_no"]-1)*$records_per_page; to ranking continue on page 2 expanded loop with: $rank_tmp++; if ($rankpoints!=$row["p

networking - What is the cleanest way to set up a remote control of my desktop from my laptop? -

so, use simulation tools , raw power of armed , operational battlestation windows 7 desktop, windows 10 laptop, hoping try hand @ setting sort of remote control between two. particularly, want to be able control desktop laptop (duh) to able start remote control software remotely, meaning need done fire , log in on desktop, laptop can handle rest. to able on internet, not on lan connection. to able of above, @ reasonable speed, without noticeable latency, own sanity when typing code on connection. so, have of done before? i'm sure there's out there dabbled before. optional, edited out requirements replace, or accompany #2 if possible: 2a. able put desktop in standby mode few days (for power concerns) on remote connection, wake using remote connection on laptop 2b. able log password protected admin account on desktop on remote connection, after waking safe mode. you try teamviewer, don't think can #2 , #3 tho. can control smartphone. don't t

How to publish the Console Application (package from asp.net 5) as an Azure Web Job -

i have new asp.net 5 application (beta 8) , have created console application (the new package version). have followed guide microsoft on publishing azure web jobs. guide based on 2013 , not use vnext, describes files, etc. required publish webjob. have followed , created: webjob-publish-settings.json added reference microsoft.web.webjobs.publish added webjobs-list.json (with reference .xproj) after publish web application, no job appears (so guess not use config properly). there no context menu publish webjob either on console application. is there proper way overcome or we'll have wait till full release of asp.net 5 have fixed , have create ordinary console application meanwhile? hope there workaround publish @ least manually. currently, there no support in vs deploy dnx webjobs. come later, until there still ways deploy manually. related reading: http://ahmelsayed.com/running-dnx-based-webjobs/ publish dnx based webjob local dependencies

Meteor helper doesn't refresh on Reactive var .set() -

i update reactive var on autorun . same reactive var used in helper . helper values doesn't refresh autorun function. below code explain clearly. template.home.oncreated(function () { var self = this; self.items_increment = 2; self.itemslimit = new reactivevar(2); }); template.home.onrendered(function () { var self = this; this.autorun(function(){ if( true ){ self.itemslimit.set(self.itemslimit.get()+self.items_increment); console.log(self.itemslimit.get()); // set values fine } }); }); template.home.helpers({ testhelper: function(){ console.log(template.instance().itemslimit.get()); // console returns 2 , 4 only. no more update :( return true; } }); anything wrong in handling of data or usage? how make helpers workable? well well, don't see going change value of reactive variable. gets changed ones, when first computation runs in tracker. ones see update. idea of using reactivevar when change it, gets changed inside

Selecting an <option> from a <select> with JavaScript in Google Chrome -

i'm trying have javascript listen event option chosen. , once javascript knows i've clicked 1 of options, it's supposed update how submit button functions. similar old fashioned onclick="" inline each option, in safer setting(which doesn't seem work in chrome). small bit of code, , works in firefox, ie, but not chrome. html: <select> <option id="zero">--</option> <option id="one">choice one</option> <option id="two">choice two</option> <option id="three">choice three</option> </select> <button id="submit">submit</button> javascript: function _(el) { return document.getelementbyid(el); } function resetoption() { _('submit').setattribute('onclick', ''); _(&

get a single Boolean value from set in R -

u= runif(5) head=u[u<0.5] u[1:5] == head if run third row in code, false false false true. (it might different in other seed of computer.) want single boolean value indicates whether value of u head or not. in other word, if element of u head, expected value true. if element of u not head, want false printed. i think want: u= runif(5) all(u<.5) #[1] false in version length of head less 5 assigning u[1:5] lead confusion or error.

linux - anaconda python: could not find or load the Qt platform plugin "xcb" -

on os(linux mint debian edition 2), except system python( /usr/bin/python ) installed apt , installed anaconda . i've encounterd problem running following code anaconda python # test.py import matplotlib.pyplot plt import numpy np x = np.array([0, 1]) plt.scatter(x, x) plt.show() the error is this application failed start because not find or load qt platform plugin "xcb". reinstalling application may fix problem. aborted but if try system python, i.e., /usr/bin/python test.py , works correctly. then tried ipythons, of system , of anaconda, result same before: anaconda ipython kernel died. and tried add ipython magic %matplotlib inline code, anaconda ipython works correctly now. if replace %matplotlib inline %pylab , anaconda ipython died again. note: use python 2.7. system ipython's version 2.3, anaconda ipython's version 3.2. same problem linux mint 17, 64 bit. solved after 4h searching on net! need give these comma

c++ - Cannot find input file -

this question exact duplicate of: cannot open input file 1 answer i trying create program asks user name of file, opens file, adds sum of integers listed on file, writes sum on output file. after writing code , saving testfile1.txt same folder program, program keeps giving me the: "could not access testfile1 " (message output notify myself unable open testfile1.txt ). here have far (skipped lines description blocks): #include <iostream> #include <fstream> #include <string> using namespace std; int main(){ ifstream inputfile; ofstream outputfile; string testfile1; string sum; int total = 0; int num; cout << "please input name of file." << endl; cin >> testfile1; cin.get(); inputfile.open(testfile1.c_str()); if (inputfile.fail()) { inputfile.clear(

html - How to store URLs in properties file and access them in templates using Spring and Thymeleaf -

i trying create simple navigation bar links other websites/servers using spring boot , thymeleaf. want store these urls in 'application.properties' , access them via th:href. when try access them, not redirecting me url. here html: <li class="dropdown-submenu"> <a tabindex="-1" href="#">menu</a> <ul class="dropdown-menu"> <li><a th:href="#{foo.bar}">selection 1</a></li> in application.properties: foo.bar=http://www.example.com it turns out notation works: <li class="dropdown-submenu"> <a tabindex="-1" href="#">menu</a> <ul class="dropdown-menu"> <li><a th:href="@{${@environment.getproperty('foo.bar')}}>selection 1</a></li>

java - How to index a super class property in Objectify when super class is not an @Entity -

tl;dr: possible set @index objectify entity property when property derived non-@entity super class. long version: a java project contains abstract model classes used application instead of concrete objects (objectify entities). each such model exists @entity extends model , adds specifics persistence layer (objectify). a simple example: public abstract class usermodel { protected string givenname; } @entity public class userimpl extends usermodel { @id private long id; } i chose approach because want use model classes independently persistence layer. therefore model classes cannot contain persistence layer specific annotations or code. i know in morphia (a mongodb orm) possible annotate @entity class this: @indexes(@index(value = "supergivenname", fields = {@field("givenname")})) is possible achieve similar effect in objectify? not have solution annotations. should possible encapsulate solution in @entity class. note: post possible solu

Unable to get coordinates from bing map REST api -

we have list of address, , trying coordinates of them using server side script. due limitation of google map api(2500 query per 24 hour), move bing map rest api. but when calling api not giving coordinates, while google map api returning correct coordinates. please tell me doing wrong? here sample call http://dev.virtualearth.net/rest/v1/locations?query=a+beka+acadamdy,2303+maravilla,lompoc,ca,93436,&incl=queryparse&key=my_api_key if replace %20 in address still not returning data http://dev.virtualearth.net/rest/v1/locations?query=a%20beka%20acadamdy%202303%20maravilla%20lompoc%20ca%2093436&incl=queryparse&key=my_api_key another url http://dev.virtualearth.net/rest/v1/locations?query=103+black+men+of+the+bay+area+community,3403+malcolm+avenue,oakland,ca,94607-1407,&incl=queryparse&key=my_api_key we tried this https://msdn.microsoft.com/en-us/library/ff817004.aspx#sectiontoggle6 but don't know country, that's why not working c

shell - How to have two JARs start automatically on "docker run container" -

i want 2 seperate jar files executed automatically once docker container called via run command, when type docker run mycontainer both called. far, have dockerfile looks this: # base image java:8 (ubuntu) java:8 # add files image add first.jar . add second.jar . # start on run cmd ["/usr/lib/jvm/java-8-openjdk-amd64/bin/java", "-jar", "first.jar"] cmd ["/usr/lib/jvm/java-8-openjdk-amd64/bin/java", "-jar", "second.jar"] this, however, starts second.jar. now, both jars servers in loop, guess once 1 started blocks terminal. if run container using run -it mycontainer bash , call them manually, too, first 1 outputs , can't start other one. is there way open different terminals , switch between them have each jar run in own context? preferably in dockerfile. i know next nothing ubuntu found xterm command opens new terminal, won't work after calling jar. i'm looking instructions inside dockerfile examp

frameworks - SNMP4J : Is it possible to create an OID in the agent (server) MIB from the manager (client)? -

i using snmp4j framework , implements , makes possible standard set, get, get-next, etc. messages. for example, set, can update value of mib oid "1.3.6.1.2.50.0". works me. can using org.snmp4j.snmp.set(pdu pdu, target target) what want create custom mib oid (as "1.3.6.1.2.100.0") client , assign value , not update existing mib oid value. is there standard snmp way ? yes. but doesn't make sense in context of snmp "create" new scalar out of thin air; setting 1 defined pre-defined oid, , oid shared agent -> manager via mib file. oid 0th instance (e.g., sysdescr.0). you can add/remove rows in snmp table (its rows , cells have oids @ instance 1, instance 2, etc.); , snmp table may have 0 rows. cells in table can have values. here background info on snmp tables .

jquery - How to add a style class in jqGrid Td using asp.net c# -

i want conditionaly change style of td in jqgrid, tried lots of example not worked, think doing wrong, please view code , me find out correct code. my code is $(function () { $("#datagrid").jqgrid({ url: 'client.aspx/load_conversation', datatype: 'json', mtype: 'post', serializegriddata: function (postdata) { return json.stringify(postdata); }, ajaxgridoptions: { contenttype: "application/json" }, loadonce: false, reloadgridoptions: { fromserver: true }, colnames: ['conversation', 'adminstatus'], colmodel: [{ name: 'conversation', index: 'message', width: 245 }, { name: 'adminstatus', index: 'isadmin' }, ], gridcomplete: function () { var ids = jquery("#datagrid").jqgrid('getdataids'); (var = 0; < ids.length; i++) { var st

alignment - wxPython - Align buttons in an expanding sizer -

Image
i'm trying make dialog looks similar wx.messagedialog. there's section @ bottom coloured different in code, buttons not cooperate. the buttons should aligned right, , bottom section should expand colour grey. there's simple solution, able see error? this sizer set expand : this sizer set not expand : here's working simplified version of code demonstrates issue. troublesome code @ bottom, surrounded "===": import wx class testdialog(wx.dialog): def __init__(self, parent, msg, title): wx.dialog.__init__(self, parent, id=-1, title=title) # outer sizer, allow spot @ bottom buttons outersizer = wx.boxsizer(wx.vertical) # main sizer message dialog mainsizer = wx.boxsizer(wx.horizontal) staticicon = wx.staticbitmap(self, bitmap=wx.artprovider.getbitmap(wx.art_information), size=(32,32)) mainsizer.add(staticicon, flag=wx.all, border=10) # sizer hold message , buttons cont

How to starting XAMP port for MySQL in Windows 10 -

i having problem starting xamp port 3306 mysql. i'm using windows 10. have uninstalled skype system. first software installed xamp. xamp control panel version 3.2.1. apache starts fine when start mysql give me following error: error : mysql shutdown unexpectedly. may due blocked port, missing dependencies, improper privileges, crash, or shutdown method. i'm user of computer (with administrative privilege). when try change port address in my.ini file not let me save changes saying " access denied ". (i have installed windows 3 times same problem every time) i tried "netstat -b" see service using port it's not showing service using 3306 port. have tried "netstat -b -p tcp" computer gives following message: " the requested operation requires elevation. " i need start mysql. do run it? complete log: here complete log: 9:17:45 pm [main] initializing control panel 9:17:45 pm [main] windows version: windows 8 64-bit

contextmenu - How to Add context menu entries for Windows 10 start menu tiles? -

it possible add custom context menu items , submenus throughout windows explorer via registry entries , dlls. however, not add items start menu/screen in windows 8/8.1/10 etc. is there different way add extensions context menu in start menu or hard-coded default context menu items (pin, unpin, resize, uninstall, etc.)?

jquery dropdown keep option selected not working with dropdown js -

i using jquery function design select option, having issue keep option selected. can changed via external jquery hook or changing code in javascript file? i tried modify code no luck. here fiddle i have updated fiddle. please check it. my code here https://jsfiddle.net/r6r25ak2/4/

javascript - Remove value from object without mutating it -

what's , short way remove value object @ specific key without mutating original object? i'd like: let o = {firstname: 'jane', lastname: 'doe'}; let o2 = dosomething(o, 'lastname'); console.log(o.lastname); // 'doe' console.log(o2.lastname); // undefined i know there lot of immutability libraries such tasks, i'd away without library. this, requirement have easy , short way can used throughout code, without abstracting method away utility function. e.g. adding value following: let o2 = {...o1, age: 31}; this quite short, easy remember , doesn't need utility function. is there removing value? es6 welcome. thank much! update: you remove property object tricky destructuring assignment : const dosomething = (obj, prop) => { let {[prop]: omit, ...res} = obj return res } though, if property name want remove static, remove simple one-liner: let {lastname, ...o2} = o the easiest way to or clone objec

arrays - A strange dot product in Python -

so have 2 matrices, 1 i×h , other i×i, h = m*i. take dot product of first m rows of first matrix first row of second, next m rows next row of second, etc. does know easy way in numpy? i'm trying avoid loop. import numpy np # examples = 5 m = 3 h = m * first = np.arange(h * i).reshape(h, i) # note dimension h×i, not i×h second = np.arange(i * i).reshape(i, i) # let's compute dot product of # every column of `first` # every column of `second` (i.e. every row of `second` transposed): # full_matrix_product = np.dot(first, second.transpose()) # no (explicit) loops, # more # multiplications # need in end. # extract specific dot products want: wanted_rows = np.arange(h) wanted_columns = np.arange(m).repeat(i) result = full_matrix_product[wanted_rows, wanted_columns].reshape(m, i)

javascript - Node.js update elements in MongoDB -

i have following mongoose schema , model: var deviceschema = new schema({ deviceid:string, devicename:string, deviceplace:string, socket : [{number: number,name:string, state : boolean, current: number, image:number,locked:boolean,reserved:boolean}] }); i have device in database 4 sockets. here example! this original data. { "_id" : objectid("5626569006bc3da468bafe93"), "deviceid" : "0013a20040b5769a", "devicename" : "device", "deviceplace" : "place", "__v" : 0, "socket" : [ { "_id" : objectid("5628bd83570be84e28879e2d"), "number" : 0, "name" : "name" "state" : true, "current" : 0 "image" : 0, "locked" : false, "reserved" : false,

Spring Data - QueryDSL InnerJoin predicate -

lets assume have following domain objects (partially complete reduce code). public class student { @onetomany(mappedby="student") list<assignment> assignments; } public class assignment { @manytoone student student; @onetoone implementation implementation; } public class implementation { @onetoone assignment assignment; @onetomany(mappedby="implementation") list<assessment> assessments; } public class assessment { @manytoone implementation implementation; string grade; } so query want perform "select students assignment implementation has been performed (not null) , has not been assessed @ (list<assessment>#isempty() ) so i'm using querydsl , try use following query students non-implemented assignments public class myservice { @autowired private studentrepository studentrepository; public iterable<student> foo() { retu

java - How does Spring MVC resolve and validate handler method parameters? -

i pretty new in spring mvc , have imported tutorial project related server side validation , have doubt how works. so have login page named login.jsp contain login form: <form:form action="${pagecontext.request.contextpath}/login" commandname="user" method="post"> <table> <tr> <td><label>enter username : </label></td> <td><form:input type="text" path="username" name="username" /> <br> <form:errors path="username" style="color:red;"></form:errors> </td> </tr> <tr> <td><label>enter password : </label></td> <td><form:input type="password" path="password" name="password" /> <br> <form:errors path="password" st

android - How can I make items inside the array adapter clickable? -

basically i'm trying make view open item tapped inside array adapter. states need use setonitemclicklistener() i'm not sure need put method works listview. package com.icemalta.dylan.memorybuddy; import android.app.listactivity; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.arrayadapter; import java.text.parseexception; import java.util.arraylist; import java.util.date; import java.text.simpledateformat; public class notelist extends listactivity { private static final int add_note_request = 10; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_note_list); loadnotes(); } private void loadnotes() { // arraylist<note> notes = storagehelper.loadnotes(this); arraylist<note> notes = new memorybuddycontract.memorybuddydbhelper(this).getnotes(); if (notes.size() > 0) { no

list - Python - Repeated (second)) value in tuple -

assuming list follows: list1 = [('do not care1', 'some string'), ('do not care1', 'some new string'), ('do not care2', 'some string'), ('do not care3', 'some other stringa') ('do not care4', 'some other stringa') ('do not care10', 'some other stringb') ('do not care54', 'some string') i need entire entry if second value repeated more 2 times. in above example, want see output this 'do not care1', 'some string' 'do not care2', 'some string' 'do not care54', 'some string' how go doing this? you can use collections.counter , list comprehension : >>> form collections import counter >>> [i in list1 if i[1] in [item item,val in counter(zip(*list1)[1]).items() if val>2]] [('do not care1', 'some string'), ('do not care2', 'some string'

Android App works in Debug Mode, but not in Run mode -

i have gone through similar questions asked before, scarce responses not helpful. using volley library populate json in recycler view. here logcat: referring other questions, have found failed set egl_swap_behavior on surface 0xb3ffe0e0, error=egl_success not problem. here android studio project- https://github.com/sanke-t/legistify i saw code on github. jsonarrayrequest fetch = new jsonarrayrequest(request.method.get, url1.tostring(), null, new response.listener<jsonarray>() { @override public void onresponse(jsonarray response) { try { (int i=0;i<response.length();i++) { jsonobject random = response.getjsonobject(i); lawyer l=new lawyer(); l.setname(random.getstring("name")); l.setaddress(random.getstrin

Gantt - Modifying the Mouse-over information on a project -

good morning; i looking modify gantt chart title found on left , showing on project same when hove mouse on it, show different set of information. know best way separate weeks noticeable break line runs entire gantt chart. here code: page: @using kendo.mvc.ui <p></p> <h2>@viewbag.title</h2> @(html.kendo().gantt<cpr_web.models.taskviewmodel, cpr_web.models.dependencyviewmodel>() .name("gantt") .views(views => { views.weekview(w => w.dayheadertemplate("#=kendo.tostring(start, 'dd' )#").slotsize(40)); views.monthview(m => m.weekheadertemplate("#=kendo.tostring(start,'d', end,'d')#").slotsize(150)); //views.yearview(); }) .columns(columns => { columns.bound("title").editable(false).sortable(true).width(100); //columns.bound("start").format("{0:mm-dd}").sortable(true).width(10); co