Posts

Showing posts from May, 2014

entity framework - Set Service Tiers when create Azure SQL database from VS C# -

is possible set microsoft azure sql database service tiers when creating new database visual studio in c#? currently, can connect azure sql server , create table no problem reason (maybe microsoft default) databases created in web service tier going retired. set default service tiers either basic, standard, or premium depends on needs. what found far when call method database.initialize(true) <--ef http://msdn.microsoft.com/en-us/library/system.data.entity.database.initialize(v=vs.113).aspx create database , set web service tier. with azure sql v12 have option specify sku. example: var dbcreationcmd = $"create database [{databasename}] (maxsize={maxsize}," + $"edition='{edition}'," + $"service_objective='{serviceobjective}')"; // azure sql db v12, database creation tsql became sync process. // need 10 minutes command timeout executenonquery(connectionstring, dbcr...

c++ - Does C style casting adds assembly (code) or is it only for the compiler to understand the situation? -

class { public: *geta(void) { return a; } protected: *a; }; class b : public { public: b *getb(void) { return (b*)a; } }; in class assume compiler (ideally) optimize , inline getter no different code accessing variable directly ? in class b variable cast b. purely compiler or involve code ? assembly instructions same function in b ? most casts not insert assembler instructions, however, there exceptions: expanding casts on signed integers: cast inserts sign extension instruction preserve value of negative values. casts , floating point types: these casts perform full conversion, not reinterprete bits. consequently, computer has something. pointer casts multiple inheritance. while first base first member in object, second base can't be. so, casting derived* secondbase* adjust pointer, adding addition instruction code.

c# - Passing parameter from client side to web method in asp.net telerik -

i've 10 telerik dropddownlist in 1 page. so, want bind dropdownlist using webservice method. don't know how pass parameter client side web method in telerik webservice. can 1 me please. you can use onclientitemsrequesting event: http://www.telerik.com/help/aspnet-ajax/dropdownlist-onclientitemsrequesting.html small example taken article: function clientitemrequesting(sender, eventargs) { var context = eventargs.get_context(); context["filterstring"] = "value sent server"; }

android - VS 2013 Multi Device Hybrid App Failed to deploy to device, no devices found -

Image
i use new vs 2013 phonegap/cordova template create hybrid apps. it works fine using emulators , ripple media emulators when connect phone . error saying ( see screenshot ) error: failed launch application on device: error: failed install apk device: error: failed deploy device, no devices found. blankcordovaapp1 below steps tried resolve http://blog.falafel.com/running-cordova-multi-device-hybrid-app-from-visual-studio-on-android-device/ i use alcatel 1 tocuh x+ phone see below device driver installed , date. also environment variables set shown below i have tried edit android_winusb.inf file include hardware ids still no go . doing here or missing here ? the problem indeed mode of "usb computer connection" should selected "ptp camera" device recognized along below steps without driver device manager screen the device on performing command "adb devices" might still show "unauthorize...

c++ - Getting size of enum using preprocessor -

i trying find way calculate length of enum, other adding "count" element @ end of enum. have found way use preprocessor follows. #include <iostream> #include <boost/preprocessor/tuple/elem.hpp> //simple declaration template <class e> struct enum_size; //specialization done in macro each enum created #define make_enum(name, ...) enum name {__va_args__}; \ template <> \ struct enum_size<name> { \ static const int value = boost_pp_variadic_size(__va_args__); \ }; make_enum(my_enum1, a, b, c) //make_enum(my_enum2, a) //triggers compilation error int main(int argc, char** argv) { std::cout << enum_size<my_enum1>::value << std::endl; } however when try create my_enum2 above redeclaration error compiler (gcc 4.8.3 on cygwin) follows main.cpp:16:21: error: redeclaration of 'a' make_enum(my_enum2, a) ^ main.cpp:9:41: note: in definition of m...

Java add items into class as an Array -

i have below class structure , want add item it. public class person implements serializable { private string name; private string mobile; public person(string n, string e) { name = n; mobile = e; } public string getname() { return name; } public string getmobile() { return mobile; } @override public string tostring() { return name; } } i want add item this: people = new person[]{ new person("hi" , " programmer"), new person("hello", " world") }; my code , want add items while() code don't correct. people = new person[]{}; while (phones.movetonext()) { people = new person("hi" , " programmer"); people = new person("hello", " world") } you have error in source code trying put object of person array gives compilation error overcome problem first take list of type person , convert array , business ...

python - Tkinter: How do I hide text as if with a password with a Text (not Entry) widget? -

i know entry widget, in tkinter, can this: entry.config(show="*") and show asterisks instead of whatever type. however, same thing text widget, there no show option configure text widgets. there way in text widget? it'll mean lot less work me if there is. the reason less work because have lots of custom functionality , customizations set text widget class, , don't want have reprogram on again entry widget, when one-line text widget works fine in place (other maybe feature). text , entry widgets have different ways access indexes , such, , these quite involved. customizations make can such press ctrl+left skip word, , kinds of stuff (and complicated stuff not that, too, may or may not have indexes). no, text widget has no such feature. have implement yourself, , i'm guessing difficult make work.

HighChart with large amount of data(complex structure) not working -

i have demo project show inventory trends, , inventory of each product frequently, there may hundreds of inventory points in 1 day. need show inventory report of 1 week,a month , more, problem comes out---i have 2 series, 1 line disappeared when points come neer 3000(not accurate);the chart displays nothing when amout of data large(such 7000 points , more) completely! the demo here code: demo here , format of datapoints demo, error occures when point number large,such 4000 , more, can try mock large data of demo find problem. actully see million points of data shows fine in others' demo, tried min size of data points failed, problem still exists. how can solve problem? you need increase turbothreshold parameter, huge data recommen use highstock uses datagrouping module, allowing increase performance.

mysql - Remove deprecated `:distinct` option from `Relation#count` for Rails 4.1 -

code: checkin_scope.count(:select => "user_id", :distinct => true) sql query select count(distinct `checkins`.`user_id`) count_user_id, location_id location_id `checkins` inner join `locations` on `locations`.`id` = `checkins`.`location_id` `checkins`.`business_id` = 452 , `checkins`.`status` = 'loyalty' , `locations`.`status` = 'approved' , `checkins`.`location_id` in (302825, 302838, 302839, 302901) , (date(checkins.created_at) between '2014-10-11' , '2014-11-11') group location_id i need remove :distinct => true has been removed in rails 4.1. ok, solve problem checkin_scope.count("distinct(checkins.user_id)") where checkin_scope method, def checkin_scope cscope = @business.checkins.loyalty_punchh.joins(:location).where(:locations => {:status => "approved"}).group(:location_id) cscope = cscope.for_location(@location) if @location if @from &&...

how to setup google earth tour auto run after applying KML in google earth -

i have generated kml google earth tour, every time need click "start tour" run tour. i expect after loading kml file tour should run without user intervention , should repeated automatically. could 1 help? 1 please thanks & regards, pica here enclosed 1 simple tour application. start automatically without human intervention. if want know more google earth api tour ,see link. https://developers.google.com/earth/documentation/touring <html> <head> <title>sample tour in google earth plugin</title> <script src="https://www.google.com/jsapi"> </script> <script src="http://earth-api-samples.googlecode.com/svn/trunk/lib/kmldomwalk.js" type="text/javascript"> </script> <script type="text/javascript"> var ge; var tour; google.load("earth", "1"); function init() { google...

How to get particular value from JSON response in Android? -

i want value of "result" below json response , store locally.here's code: private class getcontacts extends asynctask<void, void, void> { @override protected void doinbackground(void... arg0) { // creating service handler class instance servicehandler sh = new servicehandler(); // making request url , getting response string jsonstr = sh.makeservicecall(url, servicehandler.get); if (jsonstr != null) { try { jsonobject jsonobj = new jsonobject(jsonstr); //jsonarray contacts; contacts = jsonobj.getjsonarray("response"); log.d("response: ", "> " + contacts); } catch (jsonexception e) { e.printstacktrace(); } } else { log.e("serviceha...

javascript - JS not working in Rails -

i familiar turbolinks issue, seems fix not working. i have this: var ready = function () { $('.add_to_cart').click(function (e) { e.preventdefault(); var pid = $(this).attr('data-pid'); $.post('/cart/'+ pid, function(data){ var data = json.parse(json.stringify(data)); $('#items-in-cart').text(data['cart_size']); console.log(data); }); }); }; $(document).ready(ready); $(document).on('page:load', ready); my javascript won't trigger on document load. have refresh. have done fix on other pages, , worked. else should try / for? edit: i using jquery (through jquery-rails gem, 3.1.2) i found error in jquery: uncaught typeerror: undefined not function ret = ( (jquery.event.special[ handleobj.origtype ] || {}).handle || handleobj.handler ) .apply( matched.elem, args ); found reference 'bug' here . edit 2: here html.slim: =link_to "add car...

ios - weak variable with a strong reference in a block: does not create a retain cycle? -

why work when pass weak reference strong reference inside block? if local variable in block retained, should add retain self , create bad retain cycle? here example : __weak id weakself = self; [self.operationqueue addoperationwithblock:^{ nsnumber* result = findlargestmersenneprime(); [[nsoperationqueue mainqueue] addoperationwithblock:^{ myclass* strongself = weakself; strongself.textlabel.text = [result stringvalue]; }]; }]; when create or copy block (it copied when you, example, schedule gcd), referenced variables captured (unless declared __block specifier). strong references retained, weak references not. when create local strongself variable keeps self alive while block executes (i.e. while it's not executed , sits in property there's no strong reference). when reference self directly - self captured , retained, keeps self while block alive . __weak id weakself = self; [self.operationqueue addoperationwithblock...

javascript - To what extent can we refactor unit tests -

when working jasmine testing framework, have come across code snippet expect written in sub-function called in it() , not in it() itself. reason behind writing is, trying compare similar objects , refactored test code , moved expect sub-function. now, don't have expect in it() rather have method call has expect . describe("bla bla", function() { //for nunit, junit guys, testsuite() function somefunc() { //this [test] //do stuff , generate object expect(someobject).toequal(otherobject); //expect assert } it("some case", function() { //do stuff somefunc(); }); it("some other case", function() { //do other stuff somefunc(); }); }); now, kind of test code encouragable? can have it() without expect ? i argue 2 examples below both readable. if assertexpected() did kind of setup otherobject first example more readable. describe("bla bla", function() { //for nunit, junit...

c++ - Debug Assertion Failure even when using delete[] -

i beginner @ programming , wrote code #include<iostream> using namespace std; void removeallcharacters(char * , char * ); void printarray(char*); void deletearrays(char*,char*); int main() { char * source,*remove; source=new char[18]; remove=new char[10]; source="hello how you"; remove="hi me"; removeallcharacters(source,remove); printarray(source); deletearrays(source,remove); system("pause"); return 0; } void removeallcharacters(char * source, char * remove) { int n1=strlen(source)+1; int n2=strlen(remove)+1; bool arr[128] = {false}; for(int i=0;i<n2-1;i++) { arr[remove[i]]=1; } char *newsource=new char[n1]; for(int i=0,j=0;i<n1-1;i++) { if(arr[source[i]]==0) ...

postgresql - Postgis funciton ST_Contains to write an sql query -

i having issues writing query uses postgis function st_contains. want display urban areas in state of colorado. actual definition of query here. return names (name10) of urban areas (in alphabetical order) entirely contained within colorado. return results in alphabetical order. (64 records) the tables using tl_2010_us_state10 (this stores information states). think going use name10 variable in table because has of names of states. table "public.tl_2010_us_state10" column | type | modifiers ------------+-----------------------------+------------------------------------- gid | integer | not null default region10 | character varying(2) | division10 | character varying(2) | statefp10 | character varying(2) | statens10 | character varying(8) | geoid10 | character varying(2) | stusps10 | cha...

java - How to convert Byte array to PrivateKey or PublicKey type? -

i using rsa algorithm generate public , private key final keypairgenerator keygen = keypairgenerator.getinstance(algorithm); keygen.initialize(1024); final keypair key = keygen.generatekeypair(); final privatekey privatekey=key.getprivate(); final publickey publickey=key.getpublic(); after these keys encoded using base64 encoder , save database. how convert encoded string private , public key type in java decrypt file. when decoding string using base64decoder byte array. how convert byte array public or private key type? if have byte[] representing output of getencoded() on key, can use keyfactory turn publickey object or privatekey object. byte[] privatekeybytes; byte[] publickeybytes; keyfactory kf = keyfactory.getinstance("rsa"); // or "ec" or whatever privatekey privatekey = kf.generateprivate(new pkcs8encodedkeyspec(privatekeybytes)); publickey publickey = kf.generatepublic(new x509encodedkeyspec(publickeybytes));

c - Why does this print 1? -

#include <stdio.h> int main() { int var=0; for(; var++; printf("%d",var)); printf("%d", var); } please explain me c code. how output 1? you might confused because of wrong code indentation. code is: for(; var++; printf("%d",var)) ; printf("%d", var); so output of second printf. var initialized 0 , var++ (the for-condition) executed, end var==1.

interpolation - Android custom interpolator -

Image
i have animate view decelerate upto 30% after accelerate till 70% , @ last again decelerate till finish. please find below image function of time. which interpolater have used or need go custom one. if custom 1 required please let me know function have use in getinterpolation () thanks in advance. you not have write own custom interpolator, can use library https://github.com/daimajia/animationeasingfunctions , use expoeaseout animatorset set = new animatorset(); set.playtogether( glider.glide(skill.expoeaseout, 300, objectanimator.offloat(mtarget, "translationy", 0, 100) ); set.setduration(300); set.start();

Visual Studio 2013 C# Build Output to File -

Image
i'm using visual studio 2013 @ work , want c# build output saved file i've specified. found tools > options > projects , solutions > build , run allows me set build output , build log file verbosity there's nothing indicates path of build file. can't find such files in bin or obj folders. i've found this article has instructions manually copying build output text file. want way have output written file automatically, if possible. [edit] i'd avoid command-line tools (i.e. want build in visual studio) , hope avoid writing custom logger class. i put screen cap of options section referenced above here . you need set output path property. following: in solution explorer right click project , select properties select build tab enter path in output path:

if anonymous, what is a call to python lambda? -

i have lambda_expr ::= "lambda" [parameter_list]: expression and supposed able without assigning name. constitutes call lambda function. in other words, if want use inline function, makes supposed do? a lambda expression returns function object, call same other function, () . >>> (lambda x : x + 3)(5) 8 a more "normal"-looking function call works same way, except function object referenced name, rather directly. following demonstrate 3 different ways of accomplishing same thing: calling function returns value of argument plus three. def foo_by_statement(x): return x + 3 foo_by_expression = lambda x: x + 3 print foo_by_statement(2) print foo_by_expression(2) print (lambda x: x + 3)(2) the first traditional way of binding function object name, using def statement. second equivalent binding, using direct assignment bind name result of lambda expression. third again calling return value of lambda expression directly without bi...

ssl - Which certificate chain file to include with self-signed certificate? -

edit : may have been preferable ask on server fault, reputation wouldn't let me post more 2 links. :( i want pages require passwords on website secure, followed this create custom ssl certificate. followed this , because explains how generate self-signed multidomain certificates (the subjectaltname allows me valid certificate example.com , *.example.com, didn't find way this). had mix commands wanted, , think ok did (though i'll detail later in case). have configure apache listen queries on port 443 , provide ssl security on according pages. found this . when defining virtualhost listening on port 443, says : <virtualhost 127.0.0.1:443> sslengine on sslcertificatefile /etc/apache2/ssl/something.crt sslcertificatekeyfile /etc/apache2/ssl/something.key sslcertificatechainfile /etc/apache2/ssl/gd_bundle.crt ... </virtualhost> i think know files need specify sslcertificatefile , sslcertificatekeyfile fields, can't seem figu...

php - How to separate value $_GET -

i have problem getting 1 value. i'm calling script with: xxx.php?action=activate&timestamp=1415550311&gate=smscz&pricing=czchest1 &sum=29.00&currency=czk&days=0&identifiers%5bglobal%5d%5btext%5d=nomiscz&key=czchest1` $action = $_get['action']; $pricing = $_get['pricing']; etc. but have problem getting value &identifiers . need only value nomiscz this &identifiers%5bglobal%5d%5btext%5d=nomiscz . what have in request, url decoded identifiers[global][text]=nomiscz&key=czchest1 to access nomiscz use this $_get['identifiers']['global']['text'];

mysql - SQL: How to select values from multiple tables that contains specified column -

i want ask if know how values multiple tables have specified column. for example have 5 tables (t1 ... t5) t2, t3, t4 contains column 'a' - how values of 'a' if don't know tables contains it? i solution mysql (but postgresql). thanks. this should find columns on sql server. set column name in first commented area. test test me area. then use comments below switch printing query , executing query. declare @tab table (id int identity(1,1) primary key ,table_catalog varchar(50) ,table_schema varchar(50) ,table_name varchar(50) ,column_name varchar(50)) insert @tab(table_catalog , table_schema , table_name, column_name) ------- test me select table_catalog , table_schema , table_name, column_name information_schema.columns -- set column name looking for. column_name = 'name' ---- order table_name ---- test me endline declare @sql varchar(8000), @i int,@count int , @table_cata...

php - Make a call from website -

i developing website allow user make call website business owner. stuck in problem how do it. want open skype window(audio call) or clicking on call button. (calling external protocol or call exe) , responsive website, user can call , send sms mobile/iphone. on mobile site, after clicking call button, call should made mobile , after clicking sms button, sms writting window should open. pls me! thank you. you can generate skype button on this website . call phone link has format: <a href="tel:+435555555">call me</a> send sms link: <a href="sms:+435555555?body=hallo">send sms</a> you should test on devices , maybe hide of them if sure not supported.

writing a modbus program for a Open-WRT router using libmodbus C (rewrite Python app to C) -

i trying write program run on open-wrt router, reads registers modbus device. way have found write program in c. have written simple working python app communicating modbus rtu slave device pc: #!/usr/bin/env python import minimalmodbus import serial m = minimalmodbus.instrument('/dev/ttyusb0', 2) # port name, slave address (in decimal) m.serial.baudrate = 19200 m.serial.bytesize = 8 m.serial.stopbits = 2 m.serial.parity = serial.parity_none data = m.read_registers(0, 2, 3) # 3 = read holding register print "value = ", data[0] print "value b = ", data[1] if (data[0] < 20): send = 1 else: send = 0 m.write_register(2, send, 0, 16) # 16 = write multiple registers now need rewrite code c using libmodbus or other c modbus library. cannot install python device, has 4mb of space, option use c/c++. i found this example code raspberry pi, code rpi only: // access arm running linux #define bcm2708_peri_base 0x20000000 #define gpi...

android:windowNoTitle will not hide actionbar with appcompat-v7 21.0.0 -

i updated appcompat-v7 lollipop version(21.0.0) then can't hide actionbar following style worked before. <style name="apptheme.noactionbar"> <item name="android:windowactionbar">false</item> <item name="android:windownotitle">true</item> </style> i set specific activity. <activity android:name=".noactionbaractivity" android:theme="@style/apptheme.noactionbar"/> when use appcompat-v7 20.0.0 version, actionbar hidden intended. how can hide actionbar custom style appcompat version 21 library? @chk0ndanger answer true should use below code : <style name="theme.appcompat.noactionbar" parent="theme.appcompat.light"> <item name="windowactionbar">false</item> <item name="android:windownotitle">true</item> </style> without parent element, white color ( textviews , buttons ...

html - I am having alingment issue in navigation bar css -

Image
in first image taken ie, having full width every content, if u see in second image last menu content, not taking full width. how solve in both browser html: <div class="menu-section clearfix"> <div class="menu-element clearfix"> <ul> <li class="active"><a href="#">home</a></li> <li><a href="#">about us</a></li> <li><a href="#">administration</a></li> <li><a href="#">academics</a></li> <li><a href="#">research</a></li> <li><a href="#">activities</a></li> <li><a href="#">examination</a></li> <li><a href="#">facilites</a></li> <li><a href=...

AngularJS : UI-router setting configurations using directives -

i understand configuration settings ui-router , working fine. trying move following configuration directives. that, length of code reduced in js file. may be, poor design want achieve :) current configuration (as per ui-router design) //router configuration angular.module('myapp', ['ui.router']).config(function($stateprovider) { $stateprovider.state('addcustomer', { url: "/addcustomer", templateurl: 'views/customer/add_customer.html', controller: 'addcustomercontroller' }); ...no of configuration, list big... }); //in template <a ui-sref="addcustomer">add customer</a> what trying change //router configuration angular.module('myapp', ['ui.router']).config(function($stateprovider) { }); //in template <a ui-sref="addcustomer" router-info="{'url':'/addcustomer', 'templateurl':'views/customer/add_customer.html', '...

CRUD operations with Node.js and MongoDB -

what optimal way perform crud operations when using node.js mongodb. can reuse same queries work on mongo shell? advantages odm mongoose provide? other odms fit mean.io stack? vmr. well, guess depends of want do. lets take mongoose says in website: mongoose provides straight-forward, schema-based solution modeling application data , includes built-in type casting, validation, query building, business logic hooks , more, out of box. resuming understood of helps model database , helps mantain logic organized using model in mvc. it's mature odm , recomended using mvc. in personal experience started using monk , did trick while, started need use aggregate , other stuff apparently monk can't handle. , don't wanted tie system model because mutable project, started using mongoskin is, @ least now, perfect me because can use pratically same query use @ robomongo (which navicat, pgadmin, phpmyadmin mongodb) in expressjs code.

three.js - Three js obj loader big file -

i have file obj lots of features , vertices, more 800 000. when load through obzhmtloader hangs, freez. warning script crashes freezes. pleas. var onprogress = function ( xhr ) { if ( xhr.lengthcomputable ) { var percentcomplete = xhr.loaded / xhr.total * 100; //console.log( math.round(percentcomplete, 2) + '% downloaded' ); } }; var onerror = function ( xhr ) { }; three.loader.handlers.add( /\.dds$/i, new three.ddsloader() ); var loader = new three.objmtlloader(); loader.load( '13/13.obj', '13/13.mtl', function ( object ) { scene.add( object ) }, onprogress, onerror ); you should use objloader instead of objmtlloader. https://github.com/mrdoob/three.js/issues/5250

angularjs - Refresh controller when factory data updated -

i have factory: function perioddataservice (apiservice) { var perioddata = {} perioddata.refresh = function(user) { apiservice.query({ route:'period', id: user._id }, function(data) { perioddata.orders = data[0].orders }) } perioddata.orders = [] perioddata.preiod = 1 return perioddata } angular .module('app') .factory('perioddataservice', perioddataservice) and controllers...for example one, use factory data function productionctrl ($scope, perioddataservice) { $scope.board = perioddataservice.board $scope.period = perioddataservice.period } angular .module('loop') .controller('productionctrl', productionctrl) when call refresh, controlles dont update there data. whats reason? perioddataservice.refresh(user) thank you! the problem that, when call refresh , service does perioddata.orders = data[0].orders your service changing perioddata...

Nginx 400 SSL handshaking -

i'm using nginx , add certificate on website, , got strange error. here part of access.log : x.y.z.w - - [12/nov/2014:15:16:09 +0100] "-" 400 0 "-" "-" host : - x.y.z.w - - [12/nov/2014:15:16:09 +0100] "-" 400 0 "-" "-" host : - i see nothing in error.log when force error.log more precise, got : 2014/11/12 15:16:09 [info] 16027#0: *24870 client closed prematurely connection while ssl handshaking, client: x.y.z.w, server: sub.domain.com 2014/11/12 15:16:09 [info] 16027#0: *24871 client closed prematurely connection while ssl handshaking, client: x.y.z.w, server: sub.domain.com here part of nginx config file : server { listen 80; server_name sub.domain.com; root /var/www; rewrite ^ https://$server_name$request_uri? permanent; } server { listen 443 ssl; server_name sub.domain.com; root /var/www; ssl_certificate /var/server.crt; ssl_...

ruby on rails - How do I force a user to either register or login before their post is saved? -

i have post model, , can create post. before saved, user must logged in. i using devise. how force them login/register before saved, , complete operation once that? i thinking of doing before_save on post model. issue approach don't have access current_user object in model. i unsure how save record, , continue operation once login. edit 1 another hacky way change f.submit regular button redirects them login page. issue approach doesn't save info , allow them hit "submit" upon successful login. have go through entire post/_form again - trying avoid. sounds me problems avoided if forbid people access post-creating if aren't logged in. if there no cases user can create post without being logged in, make them log in first. 1 way make link leads post-creating (if there such thing) check if user logged in, , if aren't send them login form.

c# - How to acquire all shared contacts with outlook interop? -

i acquire contacts shared current outlook user (= acquire folders containing contacts shared). it's kind of sharing receive email invitation 1 shares contacts you. can see folder in "persons" tab. folder not visible in "folders" view. the following link shows guide on how reach goal enumerating "nav links" in elusive "common views" folder , ews folders via arcane code. sadly, using ews , not ol interop bound to. thought i'd started acquiring "common views" folder, unable so. recursively looking through olapplication.session.folders gives me mailbox , public folder , subfolders, no common views folder. an answer following question me: how list of recipients mailbox have shared access via outlook interop think call openshared(default)folder() information. any ideas else try?

Delete double values using php inside an array (wp-query and ACF) -

i'm using advanced custom fields on website select field ( type_evenement ) 5 possible values (val_1, val_2, val_3, val_4, val_5) i'm using wp query on custom template page display posts category, posts uses "select" custom field. i'm trying display select values on page, once, i'm trying delete double values, using array_unique, it's not working. here code wrote display values inside loop, display values, when double, example, val_1, val_3, val_4, val_2, val_1, val_1... <?php // args $today = date("ymd"); $args = array ( 'category' => 5, 'posts_per_page' => -1, 'meta_key' => 'debut_date', 'orderby' => 'meta_value_num', 'order' => 'asc', 'meta_query' => array( array( 'key' => 'fin_date', 'compare' => '>=', 'value' => $today, ) ), ); // results $the_query ...

node.js - socket.io trouble in nginx -

socket.io v. 1.0 nginx v 1.4.6 nodejs v 0.10.32 ubuntu v 14.04 droplet ip (for example): 123.45.678.90 nodejs port listen on: 3001 domain: mydomain.com everythigs works correctly both on localhost in webstorm , on droplet address like: 123.45.678.90:3001. problems begin when try bind domain , nginx follow config: server { listen 80; server_name mydomain.com; location / { proxy_pass http://localhost:3001; proxy_http_version 1.1; proxy_set_header host $host; proxy_cache_bypass $http_upgrade; } } when try connect mydomain.com browser, works correct, see message: { host: 'mydomain.com', connection: 'close', 'accept-encoding': 'gzip, deflate', 'user-agent': 'webindex', accept: 'text/html' } /var/www/bm/socket/index.js:29 var sid = socket.request.headers.cookie.split('express.sid=s%3a')[1].split ...

dart - Excessive Memory Usage in my App -

we have dart application using believe excessive memory once loaded. after refreshing main app page , forcing garbage collection, observatory shows old generation size continues grow, meaning things aren't being de-referenced. the primary consumer of space _list class in dart.core library. can tell, class appears used vm store kinds of things, of may out of our direct control. observatory isn't helpful in understanding allocating memory _list instances, since there million instances. i'm not convinced observatory doesn't contribute memory footprint of app it's trying monitor. can tell me how _list class used can begin address allocating memory?

sql server - SQL statement to select only row containing max value in one of the columns -

Image
i have following table: select * [auction].[dbo].[bids] i need select row highest bidvalue. when select bids.itemid, max(bids.[bidvalue]) highestbid [auction].[dbo].[bids] bids bids.itemid = 2 group bids.itemid i right row: ... when add 2 other fields doesn't work (i know shows 3 rows because of group by, throws error if don't include fields in group by): select bids.itemid, max(bids.[bidvalue]) highestbid, bids.submittedby, bids.submittedon [auction].[dbo].[bids] bids bids.itemid = 2 group bids.itemid, bids.submittedby, bids.submittedon so, need display 1 row itemid, highestbid, submittedby, , submittedon. any appreciated! you can do: select top 1 * bids itemid = 2 order bidvalue desc

file - filp_open not working with O_RDWR or O_WRONLY -

i trying use filp_open function within kernel open file under /proc/.../mynode. able open when use o_rdonly flag not work o_rdwr or o_wronly; infact breaks boot sequence of device. does know issue is? code: struct file* file_open(const char* path, int flags, int rights) { struct file* filp = null; mm_segment_t oldfs; int err = 0; oldfs = get_fs(); set_fs(get_ds()); filp = filp_open(path, flags, rights); set_fs(oldfs); if(is_err(filp)) { err = ptr_err(filp); return null; } return filp; } i calling method so: struct file *fp = null; fp = file_open("/proc/.../mynode", o_wronly,0); i not understand why're turning on address conversion before error checking. you've called filp_open in kernel address space(i assume get_ds takes there) , hence it's practice error checks in same space. might reason filp gets translated random address , why device boot sequence breaking. if issue persists afte...

.htaccess - RedirectMatch not working in htaccess -

iam trying to redirect page from from http://domain.com/article.php?id=23232 http://domain.com/article/23232 am using syntax in .htaccess redirectmatch 301 article.php?id=(.*)$ http://domain/article/$1 so please error in this? you cant match query string using redirectmatch . use mod_rewrite rules instead: rewritecond %{query_string} ^id=([^&]*) rewriterule ^article\.php$ http://domain.com/article/%1? [l,r=301,nc]

php - Loading CSV File into MySQL returns error -

i trying load csv file database table.. absolutely 100% sure file path correct , have verified 1 hundred times. despite this, when run sql query, tells me file path wrong. is file path requesting special in case? assume use root pathing.. load data local infile '/var/www/html/wordpress/cron/members.csv' table members_copy fields terminated ',' enclosed '"' lines terminated '\n'; i'm thinking perms issue. check perms on every directory root file...making sure have executable rights in directories (/var, /var/www, /var/www/html, etc ). i'm assuming file @ least 644.

Increasing the cluster size in Google Container Engine -

how add vm instances existing container engine cluster? i understand can add pods via replication controllers, seems there can multiple pods per vm instance. adding 50 new pods initial 3 vm cluster distributed pods evenly , did not start new instances. not helpful if want scale app due increased load. for now, there isn't way scale cluster. working on integrating container engine announced managed instance groups , cloud autoscaling service. stay tuned!

junit - How to get println to print out in the Bamboo logs when running maven test goal -

i'm trying work out how print bamboo logs junit test debug particular issue. i've tried using system.out.println , have tried log4j unfortunately neither printing out in bamboo logs. i'm looking @ log within run. my junit tests being run maven 3.0.4 task within plan defined in bamboo. i able see exceptions have occurred within test. why can't see done through system.out.println ? how can find out being output to? i found answer. turned out pom.xml file had redirecttestoutputtofile option set true. after removing line logs appear in bamboo. <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.12.4</version> <configuration> <redirecttestoutputtofile>true</redirecttestoutputtofile> </configuration> </plugin>

jquery - Special dot masked input HTML-JavaScript -

i'm trying achieve special masked input in html using jquery , themask plugin igor escobar ( http://igorescobar.github.io/jquery-mask-plugin/ ) i need write numbers[0-9] , following conversions: input: 123456789 12345678 1234567 123456 desidered output: 123.456.789 12.345.678 1.234.567 123.456 is possible achive plugin? or exist way it? reading :) edit: i did using plugin (numeral.js): http://numeraljs.com/ this working code: $("#myinput").blur(function() { this.value=numeral(this.value).format('0,0[.]00').replace(/\,/g, '.'); }); but not validated @ end, ie (onblur), there way on fly? - is, gradually validate (keypress). you don't need library that. kept jquery it's used select input, can ditch quite easily. $("#myinput").keyup(function(){ // prevent every character except numbers if(!this.value.slice(-1).match(/^[0-9]+\.?[0-9]*$/) ){ this.value = this.value.slice(0, -1); ...

excel - how to fit more than one shape into the boundary of a cell -

i make graphical representation of tabular data. i may need fit more 1 shape cell, unsure of: how tell how many shapes if in cell how determine new size of shapes need (when go 1 shape in cell 2 or more) - fits cell neatly

Type hierarchy definition in Isabelle -

i build kind of type hierarchy in isabelle: b of type ( b::a ) c , d of type of b (c,d ::b) e , f of type of c (e,f ::c) what best way encode in isabelle? there direct way define hierarchy, or need workaround. should look? ps: suppose a..f abstract , functions defined on each type) thanks (1st note: in opinion, you've been using it, word "abstract" doesn't have clear meaning. isabelle keywords used define types can used define, see it, either abstract or concrete types, or types can considered both, such 'a list .) (2nd note: here, take consideration comparisons, in other questions, object-oriented programming. programming languages , languages of logic, should noted, mere observer.) terms have types, , types have types (or sorts , say) for myself, becomes big blur, , in mind stop differentiating between terms , types, answers such rene thiemann's bring mind. still, not knowing much, can consider phrase "type hiera...

ng-show and ng-hide not binding to given variable in angularjs -

i using ng-show , ng-hide show banner page. when logged in wanna show different banner logged out. have 2 div ng-show , ng-hide value changing in controller true , false. html code: first banner: <div id="firstpageheader" class="navbar navbar-inverse" role="navigation" ng-show={{display}}> second banner: <div id="restpageheader" class="navbar-header" ng-hide={{display}}> controller: var logincontroller = function($scope){ $scope.display = true; $scope.loginuser = function(credentials){ console.log(credentials.username); $scope.display = false; } $scope.logout = function(){ console.log('logout'); $scope.display = true; } so here according login , logout display value change true , false not happening value remains true. want know why value not getting changed used $scope.$apply() ngshow , nghide directives expect expressions. should without curly braces {{ (which used expression int...

java - Quartz instance should only run specific jobs, not all -

i'm using quartz in clustered environment multiple jboss as. there several applications using quartz. currently, application store jobs in tables a_qurtz_ prefix, application b b_qurtz_ , on. so quartz configuration identical except for <prop key="org.quartz.jobstore.tableprefix">a_qrtz_</prop> <prop key="org.quartz.jobstore.tableprefix">b_qrtz_</prop> ... is possible use same tableprefix different applications , distinguish jobs group quartz schedulers application running jobs , none application b? damn, you're right, leo. it's easier thought. using different <prop key="org.quartz.scheduler.instancename">application_a_scheduler</prop> settings working fine. jobs created application_a_scheduler automatically executed application_a_scheduler instances, not application_b_scheduler instances.

java - In which layer should be map/change/format the data? -

imagine have java project 3 different layers: ui (swing), service , dao. ui calls service, , service calls dao. in ui have filter calendar. when search run, selected date (and time) in calendar sent parameter service. the problem time of date needs formatted last second of day (23:59:59), formating has done. first question, have format/change date , time. in ui or in service? because if change in ui, can reuse service method date , time. if change in service, need new method in service if current time needed instead of last second of day. and thing, idea name service layer "service" if exist data transformation, or better name "action layer" or this? it depends! general advice kind of formatting goes clint/application layer if formatting business requiement of services should go service or business logic layers. ask whether formatting should apply or not. chose solution makes service more reusible.

angularjs - Passing arguments to factory -

i building app using angularjs. i have function (createstarmarkup) returns bunch of html based on number. function(rating) { var rating = number(rating); var markup = ""; //do stuff return markup; } i able use function multiple places in application, defined service in utility module. var app = angular.module('utilities', []); app.factory('createstarmarkup', function(rating) { var rating = number(rating); var markup = ""; // stuff return markup; }); i add 'utilities' module dependency 1 of other modules, , inject service controller. var app = angular.module('reviews', ['ionic', 'utilities']); app.controller('reviewcontroller', ['$scope', '$ionicactionsheet', 'createstarmarkup', function($scope, $ionicactionsheet, createstarmarkup){...}); this produces following error error: [$injector:unpr] unknown provider: $ratingprovider <- $rating <...

ios - Xcode use GHUnit command line failed with exit code 139 -

i create project using ghunit. however, when use ghunit make test command execute, error occurs this: running: "/users/gongtao/library/developer/xcode/deriveddata/micioshelper-eqvmgnulwgjftjfnkcrzkpwkyefw/build/products/debug-iphonesimulator/micioshelper.app/micioshelper" -registerforsystemevents runtests.sh: line 50: 8604 segmentation fault: 11 "/users/gongtao/library/developer/xcode/deriveddata/micioshelper-eqvmgnulwgjftjfnkcrzkpwkyefw/build/products/debug-iphonesimulator/micioshelper.app/micioshelper" -registerforsystemevents command /bin/sh failed exit code 139 ** build failed ** following build commands failed: phasescriptexecution run\ script /users/gongtao/library/developer/xcode/deriveddata/micioshelper-eqvmgnulwgjftjfnkcrzkpwkyefw/build/intermediates/micioshelper.build/debug-iphonesimulator/micioshelper.build/script-42d16a2d1a1476c3007976d9.sh (1 failure) make: *** [test] error 65 i follow guidelines: ghunit running command line the makef...