Posts

Showing posts from April, 2015

php - OAuth2 token, message: '{ "error" : "access_denied" }' returned when I try to update Google Calendar using OAuth (Service Account) -

i using google standard library php using calendar service , have set service account type oauth 2.0 authentication through google api console. my main objective update user's google calendar (eg: user@organisationname.com) (when user not online) through batch. eg. updating event in users calendar. when user logs in application (using oauth2.0) he/she provide permission application "manage calendars","view calendars" , "perform these operations when i'm not using application" following code used login using oauth2.0 <?php require_once '../../src/google_client.php'; require_once '../../src/contrib/google_calendarservice.php'; session_start(); $client = new google_client(); $client->setapplicationname("google calendar php starter application"); $client->setclientid('xxxxx-flue2a9o5ll602ovrhaejlpm9otgjh1r.apps.googleusercontent.com'); $client->setclientsecret('xxxxxxxxxx'); $client...

Use of 1=2 in a SQL query -

someone please explain meaning of '1=2' in below sql query. select e.empid, e.empname, country = case when t.active = 'n' , 1 = 2 'not working anymore' else c.country_name end, t.contract_no employees e (nolock) inner join contract t on t.contract_no = e.contract_no left join country c (nolock) on e.country_id = c.country_id thanks edit:- corrected slight mistake existed in example sql query given me. @ :- query mentioned here example version of big working query on have reoslve something. have created sample scenario of sql query sake of simplicity of question. when t.active = 'n' , 1=2 'not working anymore' simple, above condition never become true . result c.country_name

oracle apex - Validation to detect text in numeric field -

i'm trying prevent users crashing create new product apex page. on create page have text field:product_name , numeric field: product_quantity. currently when enter text in product_quantity field , click 'save' following error: error processing validation. ora-01722: invalid number i have investigated error thought in apex, if selected numeric field, detect whether user entered text or numeric characters? is there method display validation message if user has entered text, shouts, otherwise enables user save new entry? update i know why happening dont know how solve it. i recreated page , worked. added 2 pieces of validation in page processing , when try error in intial post. if disable them works again. validation use not exists find whether entered value exists in table before add it. if validation kicks in after looking whether numerical value has been entered. stopped validation looking @ associated item, , turned off 'when button pressed' s...

javascript - What is a clean way to send a body with DELETE request? -

i need send request body delete requests using $resource the way see change: https://github.com/angular/angular.js/blob/master/src/ngresource/resource.js from var hasbody = action.method == 'post' || action.method == 'put' || action.method == 'patch'; to var hasbody = action.method == 'post' || action.method == 'put' || action.method == 'patch' || action.method == 'delete'; is there better way override this? when alter content type header can do: $httpprovider.defaults.headers["delete"] = {'content-type': 'application/json;charset=utf-8'}; or similar... ive googled maybe ive missed obvious (not first time). in advance. this works. $scope.delete = function(object) { $http({ url: 'domain/resource', method: 'delete', data: { id: object.id }, headers: { "content-type": "applicat...

Git Local Changes History Location On Hard Drive -

i new git. using git extension , want ask if make changes , commit locally not push yet. local history stored??? have directory cloned repository server. location local commit history stored or stored anywhere in c drive? git stores internal data in hidden folder .git . in root of project checkout.

Assigning Python function to ctypes pointer variable -

i have following c source compile dll: int (*pfuncextb)(int a, int b); int funcb(int a, int b) { return funcextb(a, b); } int funcextb(int a, int b) { return pfuncextb(a, b); } what want make pfuncextb "point" python function, in python: from ctypes import * def add(a, b): return + b mutdll = cdll.loadlibrary("my.dll") pfuncextb = (pointer(cfunctype(c_int, c_int, c_int))).in_dll(mutdll, 'pfuncextb') funcb = mutdll.funcb funcb.argtypes = [c_int, c_int] funcb.restype = c_int pfuncextb.contents = cfunctype(c_int, c_int, c_int)(add) print funcb(3 , 4) after expect following call return 7 print funcb(3, 4) but get: traceback (most recent call last): .................. print funcb(3, 4) windowserror: exception: access violation reading 0x00000001 so doing wrong here? possible have python function "assigned" ctypes pointer-to-function variable? edit: after seeing mark tolonen's workaround (a set function point...

database - python sqlalchemy not filling in the row -

hello new sqlalchemy , have problems inserting data in column. import sqlalchemy sqlalchemy import create_engine sqlalchemy.ext.declarative import declarative_base sqlalchemy import column, integer, string, foreignkey, boolean sqlalchemy.orm import relationship, backref sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///test.db') base = declarative_base() class users(base): __tablename__ = 'users' id = column(integer, primary_key=true) name = column(string, unique=true) password = column(string) email = column(string) def __init__(self, name, password, email): self._name = name self._password = password self._email = email base.metadata.create_all(engine) session = sessionmaker(bind=engine) session.configure(bind=engine) session = session() dm_user = users("dungeonmaster", "123", ...

c - Why does writing to a named pipe continue after no one is reading? -

i'm doing experiments learn named pipes. it's understanding os block program writes named pipe until program reads named pipe. i've written 2 programs, startloop , readbyte . startloop creates fifo , continually writes each read of client ( readbyte ): #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> int main(int argc, char *argv[]) { const char num = 123; mkfifo("fifo", s_irusr | s_iwusr | s_irgrp | s_iwgrp); int fd = open("fifo", o_wronly | o_creat | o_trunc, s_irusr | s_iwusr | s_irgrp | s_iroth); while (1) { printf("loop_start\n"); write(fd, &num, sizeof(num)); } close(fd); return 0; } readbyte reads 1 byte fifo when run: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <fcntl.h> int main(int argc, char *argv[]) { char num; int fd; if ((fd = ope...

java - ant build failed error: unmappable character for encoding UTF8 -

have ant build script builds java files. these files may have existed in windows environment previously, though attempting build , compile them on osx. file in question seems encoded following u'western (windows 1252)' the error receive is error: unmappable character encoding utf8 does have experience rectifying these types of issues? open file text editor allows control on coding, such emacs, , save file in utf-8.

vb.net - How to load csv files from the internet into an Access database? -

i have following array contains ticker symbols: public shared tickerarray() string = {"goog", "aapl", "v", "msft"} . need use loop: for each tickervalue in form1.tickerarray load csv file each ticker symbol 1 large table in microsoft access. csv files located @ "http://ichart.yahoo.com/table.csv?s=" & tickervalue . need respective ticker symbol loaded each line of table imported csv file in order make each line unique. columns in database should be: "ticker, date, open, high, low, close, volumne & adj close". i've found information loading local csv file access can't seem figure out how load csv files internet access through vb.net. also, need update table need insert new unique lines csv file. no duplicates. any suggestions? thanks! update: here code have far. imports system.data imports system.data.oledb imports system.net imports system.io public class form1 public shared tickerarray()...

Parse Python String for Units -

say have set of strings following: "5 m^2" "17 sq feet" "3 inches" "89 meters" is there python package read such strings, convert them si, , return result in easily-usable form? instance: >>> a=dream_parser.parse("17 sq feet") >>> a.quantity 1.5793517 >>> a.type 'area' >>> a.unit 'm^2' is there extension ipython can @ least part of want. it's called ipython-physics it store value , units , allows (at least) basic math. have never used myself, don't know how easy use in python script

java - Not able to start start-hbase.sh -

i had java installed inside program files , while installing hbase in windows, reinstalled in c drive. when try start start-hbase.sh, points old path. had changed java_home , path , restarted machine. error when double-click start-hbase.sh: /c/java/hbase-1.1.2/bin/hbase: line 400: /cygdrive/program files/java/jdk1.8.0_6 5/bin/java: no such file or directory /c/java/hbase-1.1.2/bin/hbase: line 400: /cygdrive/program files/java/jdk1.8.0_6 5/bin/java: no such file or directory starting master, logging c:\java\hbase-1.1.2/logs/hbase--master-tct-nb-j0g606 2.out c:\java\hbase-1.1.2/bin/hbase: line 400: /cygdrive/program files/java/jdk1.8.0_6 5/bin/java: no such file or directory java installation directory here path: c:\programdata\oracle\java\javapath;c:\program files\git\bin;c:\java\jdk1.8.0_66\bin;c:\cygwin64\bin;c:\apache-maven-3.3.9\bin;c:\protobuf;c:\program files\mysql\mysql server 5.7\bin;c:\program files (x86)\intel\icls client\;c:\program files\intel\icls client\;%system...

xcode - XC UITesting with Dynamic Labels -

i'm trying assert value of label (which populated dynamically) contains substring part of result of uitest. my issue xctassert doesn't seem allow substrings or approximate matches (from can find anyway). have advice on how might write following find match "hours ago" instead of specific "xx hours ago"? at present i'm able work exact matches (as below). //set expectation let texttofind = app.statictexts["13 hours ago"] let exists = nspredicate(format: "exists == true") expectationforpredicate(exists, evaluatedwithobject: texttofind, handler: nil) //give app time network data & update ui waitforexpectationswithtimeout(5, handler: nil) //assert results xctassert(texttofind.exists) change query finds ui element method other name. ui test recording feature in xcode can work through — see wwdc2015 session introducing ui testing example of doing this. once you've found ui ele...

Is any Jenkins plugin which could check jobs configuration against recommandation ? -

we manage large jenkins instance(< 1000 jobs). made recommendations job configuration number of artifacts keep, number of jobs keep etc. is there plugin check jobs not respect recommendation, , report them? i've used groovy script console or configuration slicing plugin accomplish these tasks.

java - How do i make a validation about the missing flash camera on android? -

im making flash aplication school proyect phone doesn't have flashlight so.. have idea make validation if phone dont have flashlight light screen. can me ? :d i think post may halp implement idea: if planing use inside function onupdate or onenabled etc of appwidgetprovider , functions have context input parameter. can use context using packagemanager doing here. also in question mention flashlight . check if need feature_camera_flash or feature_camera . context context = this; packagemanager packagemanager = context.getpackagemanager(); // if device support flash? if (packagemanager.hassystemfeature(packagemanager.feature_camera_flash)) { //yes log.i("camera", "this device has flash supported!"); }else{ //no log.i("camera", "this device has no flash support!"); } from: check if device has flashlight check also: how check if device has flash light led android android: ho...

android - RecyclerView within fragment -

the following recyclerview crashes when run in fragment class inside "else". following exeption: 01-05 18:19:14.922 18178-18178/? e/androidruntime: fatal exception: main process: com.ymoshel.moshel.handcuffed, pid: 18178 java.lang.nullpointerexception: attempt invoke virtual method 'void android.support.v7.widget.recyclerview.setlayoutmanager(android.support.v7.widget.recyclerview$layoutmanager)' on null object reference @ com.designdemo.uaha.threefragments.oncreateview(threefragments.java:153) @ android.support.v4.app.fragment.performcreateview(fragment.java:1965) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1078) @ android.support.v4.a...

javascript - AngularJS with Facebook SDK -

this question has answer here: how return response asynchronous call? 21 answers i have problem angularjs. i want return values within facebook sdk functions not let me them in variables. the "perfil_nombre" , "perfil_foto" variables returned "undefined" , wish send scope. any chance? i'm totally lost. excuse bad english. login.controller('inicio_ctrl', function($scope, $http, $timeout, $window) { var laspaginas; var response; var perfil_foto; var perfil_nombre; var resp; $scope.fblogin = function() { fb.login(function(response) { if(response.authresponse) { fb.api('/me', function(response) { perfil_nombre = response.name; //<<<<<-------- ...

c# - How to send emails with List<string>() using Send Grid mvc azure -

i reading send grid documentation, , below states in order add emails of recipients, required: // add multiple addresses to field. list<string> recipients = new list<string> { @"jeff smith <jeff@example.com>", @"anna lidman <anna@example.com>", @"peter saddow <peter@example.com>" }; mymessage.addto(recipients); meanwhile in code have list string stored emails. emailing.find_email_send = new list<string>(); emailing.find_email_send.add("nick@hotmail.com"); emailing.find_email_send.add("john@hotmail.com"); emailing.find_email_send.add("jack@hotmail.com"); how can add recipients ? tried using forloop: recipients.add(emailing.find_email_send[i]); but doesn't seem work. if mymessage.addto method takes list parameter , have addresses in list, don't need except: mymessage.addto(emailing.find_email_send); if want add addresses list recipients...

jquery - Sortable using 2 parameters javascript -

Image
i using sortable sorting entries. works fine simple position numbers , when drag , drop entry can update position number , display accordingly. problem when user drags entry want update parameter time. i have created jsfiddle demo here can have more idea of problem. initially looks fine but when drag entries updates position number , not time. want time updated well. as suggested alex, should call calculatetime again. change rather grabbing data input again, can store input in variable , grab data variable. //here set stored variable var stored_starttime, stored_minuteperround; $(document).ready(function() { $("#timing").click( function() { //here set value of stored variable stored_starttime = document.getelementbyid("stime").value; stored_minuteperround = document.getelementbyid("rounds").value; calculatetime(stored_starttime, stored_minuteperround); } ); }); $("#sortable_nav").s...

continuous integration - VSO Copy website static files and binaries (not C# files) -

Image
i trying set continuous integration on server using visual studio online. created new agent pool. installed , configured new build agent added agent pool. trigger new build of code handled in agent pool. i manage build how set task "copy , publish build artifacts". my goal here copy final website files e.g. binaries, images, cshtml, not files such c# files. sort of "right-click > publish" operation in visual studio. what value need enter in "copy root" field? (please see image below) the documentation located at: https://msdn.microsoft.com/en-us/library/vs/alm/build/scripts/variables it boils down output path binaries is. if you're not overriding via msbuild argument, $(build.sourcesdirectory) value of **\bin\* you're after. for web application, make sure you're building appropriate msbuild arguments (something along lines of /p:outdir=$(build.stagingdirectory) /p:deployonbuild=true /p:webpublishmethod=package /p...

Git Tower and PhpStorm -

Image
for reason in git-tower when untick checkbox next file in working copy list makes untracked. that's not i'm wanting do. if uncheck don't want apart of current commit i'm do. i still want tracked though. know why happening? i'm working in current version of phpstorm v10. so after makes file in phpstorm v10 red file name have make click , make added git i'm trying figure out how keep tracked whole time during development. project files. email sent me. roman koellges (fournova) jan 7, 10:31 thank inquiry. from describe, i'm not sure if find "problem" or "bug" in situation: sounds if new files have been created while working in phpstorm - , tower shows these new files when switch on it. aware can add them git right in tower - clicking checkbox in status column? (see attached animated gif.) in case misunderstood request, here's take: if doubt "untracked" status these files correct, can check status git on comm...

swift - Change time interval in SKAction.waitForDuration() as game goes on -

basically 1 of actions in repeating sequence of actions. each time action gets called in sequence, want waiting time increase, added counter act waiting time number , increment whenever action gets called in sequence. problem this, variable increments when sequence starts, doesn't change @ when action happens again in sequence, waiting time remains constant throughout game. , can't figure out how change when gets called up var timeinterval = 0 //main method override func didmovetoview(view: skview) { var scale = skaction.scaleto(5,duration: 2) sprite = spriteset(texture: sktexture(imagenamed: "texture"), color: uicolor.browncolor(), size: cgsizemake(100,100)) sprite.runaction(skaction.repeatactionforever(skaction.sequence([waitaction,scale,waitaction]))) } //i want time increase each time function called in sequence func waitfunction() -> skaction { timeinterval++ return skaction.waitforduration(nstimeinterval(timeinterval)) } you...

ios - UITableCell AccessoryView: Setting accessoryView equal to UIImageView infinite loop -

edit: have figured out answer on own here else needs it: uiimageviews cannot shared different instantiation of each uiimageview required each visible cell. know. i have custom table has 2 types of cells. 1 cell set toggle between normal accessory of type checkmark. cell set have custom image accessory type. when selected accessory image changes opposite type, showing "invited" or "invite" message. i've narrowed down code @ fault following, found within tableview:cellforrowatindexpath delegate method. if(indexpath.section == 0){ cell = [tableview dequeuereusablecellwithidentifier:self.directcellid]; cellvalue = [self.contactsusingapp objectatindex:indexpath.row]; cell.imageview.image = [self getcontactimage:indexpath.row]; //vvvvvvvvvvvvvvvvv section @ fault vvvvvvvvvvvvvvvvv if([self.selectedcontactsusingapp containsobject:indexpath]) cell.accessoryview = self.invitedstatus; else cell.accessoryview = self.notinviteds...

asp.net - Difference between various templates when creating web api project -

Image
i creating asp.net web api application using visual studio 2013. there couple of ways using can create project file > new > project > web > visual studio 2012 > asp.net mvc 4 web application > web api file > new > project > visual c# > asp.net web application > web api file > new > project > web > asp.net web application > empty file > new > project > web > asp.net web application > web api apart option 3, other options add stuff bootstrap, fonts (glyphicons), jquery etc. i want return data web api. right option create solution? why add stuff web api when cannot return view? if don't want of scripts , style stuff you'll need use empty template. file > new project > visual c# > web > asp.net web application be warned: template sparse. empty folders , webapiconfig.cs .

performance - Python: faster operation for indexing -

i have following snippet extracts indices of unique values (hashable) in sequence-like data canonical indices , store them in dictionary lists: from collections import defaultdict idx_lists = defaultdict(list) idx, ele in enumerate(data): idx_lists[ele].append(idx) this looks me quite common use case. , happens 90% of execution time of code spent in these few lines. part passed through on 10000 times during execution, , len(data) around 50000 100000 each time run. number of unique elements ranges 50 150 roughly. is there faster way, perhaps vectorized/c-extended (e.g. numpy or pandas methods), achieves same thing? many many thanks. i found question pretty interesting , while wasn't able large improvement on other proposed methods did find pure numpy method faster other proposed methods. import numpy np import pandas pd collections import defaultdict data = np.random.randint(0, 10**2, size=10**5) series = pd.series(data) def get_values_and_indicies(i...

multi-tenant and use of ruby delegate vs NoSQL for tenant context -

i have multi-tenant app (rails backend) , need mix tenant-agnostic pre-populated list of items tenant specific attributes. was wondering if has used delegate done , had ok performance vs. venturing out of postgres mongodb example models: class equipmentlist < activerecord::base attr_accessible :name, :category_id has_one :tenant_equipment_list delegate :alt_name, to: tenant_equipment_list end class tenantequipmentlist < activerecord::base attr_accessible :alt_name, :group, :sku, :est_price, :equipment_list_id belongs_to :equipment_list default_scope { where(tenant_id: tenant.current_id) } end i've run on low traffic site. rails end handles pretty in outputting json. realized better use tenant version foreign key , delegate master attributes tenant. looks this: class equipmentlist < activerecord::base attr_accessible :name, :category_id has_one :tenant_equipment_list end class tenantequipmentlist < activerecord::base ...

javascript - How to clone models from Backbone collection to another -

i need clone models in 1 backbone collection , add add them another. (iow of models in new collection need unique, , have no connection models in original collection.) here code: collection1.each(function( model ) { var clone = new backbone.model( model.tojson() ); clone.set( this.idattribute, null, { silent: true }); collection2.add( clone ); }); this doesn't quite work. can add model collection1 collection2 once. if try second time, fails. somehow backbone detecting dup. any suggestions on doing wrong? thanks (in advance) help in code provided, this.idattribute not think , won't create models without ids, leading collisions when copy models second time. underscore hard dependency of backbone, can use _.omit on json representation of collection filter out ids. example, function copycollection(collection1, collection2){ var idattribute = collection1.model.prototype.idattribute; var data = _.map( collection1.tojson(), ...

scikit learn - Is there easy way to grid search without cross validation in python? -

there absolutely helpful class gridsearchcv in scikit-learn grid search , cross validation, don't want cross validataion. want grid search without cross validation , use whole data train. more specific, need evaluate model made randomforestclassifier "oob score" during grid search. there easy way it? or should make class myself? the points are i'd grid search easy way. i don't want cross validation. i need use whole data train.(don't want separate train data , test data) i need use oob score evaluate during grid search. i advise against using oob evaluate model, useful know how run grid search outside of gridsearchcv() (i can save cv predictions best grid easy model stacking). think easiest way create grid of parameters via parametergrid() , loop through every set of params. example assuming have grid dict, named "grid", , rf model object, named "rf", can this: for g in parametergrid(grid): rf.set_params(**g) ...

javascript - window.location.href navigates out of my website -

Image
okay i'm having tough situation. i'm using free html template. far have been able following: when user clicks thumbnail. video play should. all had add direct raw video file href of image. <a class="thumbnail" href="video_link.mp4"><img src="http://i.imgur.com/kwyihw8.jpg" /></a> then came accross problem raw link display on bottom left of browser. i fixed adding onclick event form function. <a class="thumbnail" href="#" onclick="video();"><img src="http://i.imgur.com/kwyihw8.jpg"/></a> the function is: function video() {window.location.href = 'video_link_here.mp4'} well turns out when click image navigates whole page link. i need know how can make play without navigating out of website in first picture , importantly not showing raw video link. try using jquery load func, load image in specific div $("#div1").load(...

C# new keyword to override access modifier on a property from a 3rd party lib -

i'm using 3rd party lib following class: class base { protected int count { get; } } i inherit class in code, however, count public property. following considered bad in way? there other ways it? class derived : base { public new int count { { return base.count; } } }

Scala: What is :: in { case x :: y :: _ => y}? Method or case class? -

Image
object test1 extends app { val list: list[int] => int = { case x :: y :: _ => y //what ::? method or case class? } println(list(list(1, 2, 3))) //result 2. } i set "syntax coloring" in scala ide, foreground color of method set red. code snapshot: , can't open declaration of black :: , don't know is. if black :: method, should called way: ... {case _.::(y).::(x) => y} //compile failed! so, black :: ? method or case class? thanks lot! i think it's method described here . history's sake, in case page goes away, here's blurb: about pattern matching on lists if review possible forms of patterns explained in chapter 15, might find neither list(...) nor :: looks fits 1 of kinds of patterns defined there. in fact, list(...) instance of library-defined extractor pattern. such patterns treated in chapter 24. "cons" pattern x :: xs special case of infix operation pattern. ...

go - Python equivalent of golang's defer statement -

how 1 implement works defer statement go in python? defer pushes function call stack. when function containing defer statement returns, defered function calls popped , executed 1 one, in scope defer statement inside in first place. defer statements function calls, not executed until popped. go example of how works: func main() { fmt.println("counting") var *int := 0; < 10; i++ { = &i defer fmt.println(*a, i) } x := 42 = &x fmt.println("done") } outputs: counting done 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 go example of usecase: var m sync.mutex func somefunction() { m.lock() defer m.unlock() // whatever want, many return statements want, wherever. // forget ever locked mutex, or have remember release again. } to emulate defer fmt.println(*a, i) example, use contextlib.exitstack : #!/usr/bin/env python3 contextlib import exitstack functools import partial print(...

lucene - How to perform full text search with modifiers in Elasticsearch -

i building web application using elasticsearch playframework[java] full text search option. want process "sony ericsson phones under 300 dollars" or "samsung phones with 3g". new lucene/elasticsearch, wanted know best way go it. do need parse terms "above, below, with" etc in code , generate relevant queries elasticsearch or there better/standard way this? understand nlp complex area, wanted know how others , how of effort be. , want add doesn't need perfect. help? out of box, elasticsearch supports modified lucene query syntax , not aware of plugins described. so, need parsing in application , generate elasticsearch queries.

beautifulsoup - Python - How to move output text to the left / up? -

#!/usr/bin/python __future__ import print_function import textwrap import requests bs4 import beautifulsoup def bbb_spider(max_pages): bus_cat = raw_input('enter business category: ') pages = 1 while pages <= max_pages: url = 'http://www.bbb.org/search/?type=category&input=' + str(bus_cat) + '&page=' + str(pages) sauce_code = requests.get(url) plain_text = sauce_code.text soup = beautifulsoup(plain_text, "html.parser") link in soup.select("table.search-results-table tr h4 a"): href = link.get('href') bbb_profiles(href) pages += 1 def bbb_profiles(profile_urls): sauce_code = requests.get(profile_urls) plain_text = sauce_code.text soup = beautifulsoup(plain_text, "html.parser") business_name in soup.findall("h1", {"class": "business-title"}): print(business_name.string)...

Using .Net Objects within a Powershell (V5) Class -

this major edit done clarity purposes. appears need work on forming thoughts. below exact code having trouble with. brief description: trying setup powershell class hold objects of different types easy access. i've done numerous times in c#, thought straight forward. types wanted [system.printing] , wmi-objects. originally had tried write class directly powershell profile easy usage, profile fails load when have class code in it. saying cant find type name "system.printing.printserver", or other explicitly listed types. after failed moved it's own specific module , set profile import module on open. however, when stored in own module, if explicitly list .net type of properties, entire module fails load. regardless of whether have added or imported type / dll. specific problem area this: [string]$name [system.printing.printserver]$server [system.printing.printqueue]$queue [system.printing.printticket]$ticket [system.mana...

php - Why is Symfony/Doctrine query giving me a different answer to debugged query with CURRENT_TIMESTAMP()? -

my deleted record not being filtered out. the doctrine querybuilder expression is: $q = $this->createquerybuilder('duty') ->select(array('duty')) ->where('duty.validfrom < current_timestamp() , (duty.deleted null or duty.deleted > current_timestamp())') ->orderby('duty.rank', 'asc') ->addorderby('duty.validfrom', 'desc') ->getquery(); i 6 results (value of 1 has deleted half hour ago. i grab debugger , evaluate $q->getsql(). gives me: select e0_.id id_0, e0_.name name_1, e0_.rank rank_2, e0_.rate rate_3, e0_.validfrom validfrom_4, e0_.deleted deleted_5, e0_.created created_6, e0_.updated updated_7 employmentduty e0_ e0_.validfrom < current_timestamp , (e0_.deleted null or e0_.deleted > current_timestamp) order e0_.rank asc, e0_.validfrom desc which run directly against postgres , 5 results deleted item filtered out. the timezone php 'australia/...

javascript - Swiper.js - Uncaught TypeError: Cannot read property 'params' of null -

i'm using swiper.js , once swiper1.destroy(); run, rebuild, slide slide , click. i got error of swiper.js:438 uncaught typeerror: cannot read property 'params' of null here's code. appreciate helps. thank much. $('.call').click(function(e){ e.preventdefault() $("#menu").addclass("hide"); $("#slider").removeclass("hide"); selector.push("address"); var swiper1 = new swiper('.swiper1', { pagination: '.one', paginationclickable: true, hashnav: true, loop:true, initialslide:0 }); getlocation(); $('.noclick').click(function(e){ e.preventdefault() swiper1.unlockswipes(); // <-- seems causing problem swiper1.slideprev(); // <-- seems causing problem player.seekto(0); }) $('.yes').click(function(e){ e.preventdefault() swiper1.unlockswipes(); // <-- seems causing problem swiper1.slidenext(); // <-- seems causing pro...

algorithm - Printing 2d array in counterclockwise order -

how print array in counterclockwise order? know of famous "print array in spiral order" algorithm, it'd interesting see how print in counterclockwise fashion assuming think of array of 2d coordinates ... basically have sort array atn of quotient of y , x coordinates , print them in order. catering poles , sign changes while avoiding expensive , numerically unstable arithmetics complicates implementation. following pseudocode manly serves illustratin of principle. the point set partitioned 9 categories numbered 0 8. #0 contains points (0,0) printed first, #1,3,5,7 contain points on positive y axis, negative x axis, negative y axis, , positive x axis, respectively. within each of these categories, points printed in order of increasing distance origin. categories #2,4,6,8 contain points second, third, fourth, , first quadrant, respectively. within each of these categories, points printed counterclockwise. points located on same vector origin printed in orde...

hadoop - What does the following fields: 'totalSize' and 'rawDataSize' mean in DESCRIBE EXTENDED query output in hive? -

if 1 runs describe extended command on hive table result presents totalsize , rawdatasize values near end of output. what these fields mean? ex: hive > describe extended <tablename> output results: table(tablename:tablenamexxxxx, dbname:xxxxxx, .......... ....................... numrows=116429472, totalsize=3835205544, rawdatasize=35040221600}) rawdatasize size of original data set, totalsize amount of storage takes. applicable orc file format, compresses data totalsize lesser rawdatasize.

c# - Monitors and re-entrancy (clarifies difference between re-entrant code and re-entrant lock) -

reading on locks in c#. see being able acquire lock on same object multiple times said possible because monitors re-entrant. definition of re-entrant code defined in wikipedia not seem fit in context. can please me understand re-entrancy in context of c# , how apply monitors? have understood, when thread has acquired lock, not relinquish lock when in middle of critical section - if yields cpu..as result of which, no other thread able acquire monitor..where re-entrancy come picture? reentrancy has many meanings actually. here in context means monitor can entered same thread repeatedly several times , unlock once same number of releases done.

linux - gnuplot how to set error bars and label -

i want plot curve has error bars. used with yerrorlines that. know want show label each point should done by: with labels how can use both of theme simultaneously? tried with yerrorlines ,labels not worked! you must plot data twice: plot 'data' using 1:2:3 yerrorlines title 'title',\ '' using 1:2:4 labels offset 0,2 notitle you must adapt label offset such label doesn't overlap error bars.

dom - Smooth Resize Animation with Pure JavaScript -

i'm trying work in [smooth] resize animation effect web application. problem css3's animation , transition effects stutter i've decided go javascript approach. don't want use jquery ui or form of jquery because loading time, though miniscule when served through cdn, 1 http request. suggestion on approach? pure javascript change height of div try this,, var myvar = null; function cal(){ var aa = document.getelementbyid("aa"); var h = aa.style.height; h=parseint(h.replace("px","")); myvar = setinterval(function(){ if(h > 100){ mystopfunction(); }else{ h+=5; aa.style.height = h+"px"; } },30); } function mystopfunction() { clearinterval(myvar); } <div id="aa" style="background-color:rgba(0, 119, 221, 0.47);height:30px;"> try </div> <button onclick="cal()">click here</button...

database - Is it possible one procedure can call another procedure inside a package body? -

question-: possible 1 procedure can call procedure inside package body?(let's want declare 2 procedure inside package body (not in package specification). p1 & p2 procedures.is possible p1 can call p2 inside package body?) yes, otherwise packages lose lot of functionality. procedure defined in package body not in specification private, , cannot invoked outside package; of course can within. however, called procedure has defined before caller within package body source: create or replace package p42 end p42; / package p42 compiled create or replace package body p42 procedure p2 begin null; end; procedure p1 begin p2; end; end p42; / package body p42 compiled no errors. if have them other way around won't compile: create package body p42 procedure p1 begin p2; end; procedure p2 begin null; end; end p42; / package body p42 compiled errors: check compiler log errors package body stackoverflow.p42: line/col error -------- ----------------...

c# - Problems setting up databinding with WPF and MVVM -

i have application uses mvvm. i'm trying set databinding combobox connecting properties in viewmodel. when run application error message: message='provide value on 'system.windows.data.binding' threw exception.' line number '11' , line position '176'. the problem occurs line of xaml: <combobox x:name="schoolcombobox" horizontalalignment="left" margin="25,80,0,0" verticalalignment="top" width="250" fontsize="16" itemssource="{binding locationlist}" selecteditem="{binding source=locationpicked}" /> below viewmodel i'm trying use. using qmac.models; using system; using system.collections.generic; using system.linq; using system.text; using system.windows; namespace qmac.viewmodels { class mainviewmodel : viewmodelbase { address address; location location; private string _locationpicked; public mainviewmodel() { addre...

javascript - How to valid each element by onChange in web-ix form -

i have question relate valid each element in form control. webix.ui({ view:"form", elements:[ { view:"text", required:true, name:"text1" }, { view:"text", invalidmessage: "init", name:"text2" }, ], elementsconfig:{ on:{ 'onchange':function(newv, oldv){ this.validate(); } } }, rules: { text2: function (value) { if (!value) { $$("text2").define("invalidmessage", "text2 can not empty"); return false; } } }); it didn't work this.validate(). how can validate each element custom valid rule it. adds id , name form. ... id:"form1", name:"form1", ... the rule rules: { "text2":function (value) { console.log(value) if (value != "") { $$("text2...

sql server - MsSql Subquery returned more than 1 value -

can me error? msg 512, level 16, state 1, procedure gen048upload, line 101 subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. here code: alter procedure [dbo].[gen048upload] -- add parameters stored procedure here @filedate varchar(20) begin -- set nocount on added prevent result sets -- interfering select statements. set nocount on; declare @ierrorcode int declare @error int, @tday varchar(2), @tmonth varchar(2), @tyear varchar(4) set @tmonth= month(getdate()) set @tday= day(getdate()) set @tyear= year(getdate()) declare @temptable table ( temprow varchar(1000) ) -- declare @command varchar(1000) -- set @command = 'copy y:\ftp\rmt\' + @filedate + '.txt' -- insert @temptable exec master..xp_cmdshell @command declare @fne_count int set @fne_count = (select count(*) @temptable temprow = 'the system cannot find...

sql - how to get all column names in SSAS -

in sql server column names using select * informationschema.columns to column names in ssas how can column names cube see clicking on browse in tree format how can achieve in mdx query please suggest me ssas new area me you can try this: select [catalog_name] [database], cube_name [cube],[dimension_unique_name] [dimension], level_caption [attribute], [level_name_sql_column_name] [attribute_name_sql_column_name], [level_key_sql_column_name] [attribute_key_sql_column_name] $system.mdschema_levels cube_name ='adventure works' , level_origin=2 , level_name <> '(all)' order [dimension_unique_name] source