Posts

Showing posts from June, 2012

c# - EF6: Modifying an entity property with a foreign key relation - Do I need to change the Id or the related object or both? -

i modifiying foreign key property on entity in code, modifiying id only: elementdata.servicelevelid = parameter.servicelevelid; i have found, after persisting, works expected, when corresponding navigation property servicelevel null accident. if still holds "old" object, change not hit database. this means, need do elementdata.servicelevelid = parameter.servicelevelid; elementdata.servicelevel = null; //force update database does mean, changing object "stronger" changing id only? should set related object null in such situations? update (per tim copenhaver's comment) : entity in question copy (with mentioned modification) of existing one. uses automapper copying, , maps except primary key , 1 unrelated property. automapper creates shallow copy afaik. thus, situation copy updated id , untouched object reference not match @ moment of adding context. guess, ef decides "object reference stronger". changing either property work l

Service Mediation Using Proxy Services -WSO2 -

i'm new area , need access web service via esb. mentioned in here - service mediation using proxy services tried to create it. after run , response follows : <tryitproxyerror xmlns:h="http://wso2.org/ns/tryitproxy" h:status="soap envelope error">org.apache.axis2.axisfault: input stream incoming message null.</tryitproxyerror> but tried run same web method using soapui , expected out put below: <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap:body> <getpatienthistoryresponse xmlns="http://tilani.lk/"> <getpatienthistoryresult> <nic>123</nic> <fullname>abc def</fullname> <firstname>abc</firstname> <surname>def</surname> <title

Using jquery-ui-rails datepicker in an Ruby on Rails website. datepicker method not defined -

i got problem writing website ruby on rails. bundle show * jquery-ui-rails (4.0.1) in app/assets/javascripts/application.js //= require jquery.ui.datepicker in app/assets/stylesheets/application.css *= require jquery.ui.datepicker in app/views/layouts/application.html.erb <%= stylesheet_link_tag "application", :media => "all" %> <%= javascript_include_tag "application" %> and in somepage.html.erb, got <script type="text/javascript"> $(function(){ $("#startdate").datepicker(); $("#enddate").datepicker(); }); </script> when running it, chrome says uncaught typeerror: object [object object] has no method 'datepicker' i suppose resource not being referred cause because problem fixed adding follows app/views/layouts/application.html.erb <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" /> <

sql - Insert into table on the Linked Server with Data from local table -

i'm working sql server express, created linked server oracle database. as title indicates, want insert data selected local table table @ linked server. i tried many queries no 1 of them worked want. this query below used has worked, static values, want insert data dynamically table on local database. insert openquery (ortest, 'select * reservation') values (2, '2', 3); you should able use linked server name part of qualifying table name, , normal insert select: insert ortest.[dbname].[dbo].[reservation] select * [dbname].[db].[reservation]

c# - Algorithm to detect overlapping recurent time periods -

Image
i'm trying detect event's colision depending of days recurrency , timetable. a version more complex issue algorithm detect overlapping periods . my case : event 8am 1pm tuesday, thurday , saturday, between 2 dates. the b event 11am 2pm tuesday , thurday, between 2 dates(differents of event a) here, putted in red colisions between 2 events. i spent hour trying write algorithm detect if there @ least 1 colision between 2 event. by way date of end of event (tend) can undeterminate. is there existing algorithm manage this? figure out 1 ends first. if both , b unlimited pick random date in future. i'm going assume events repeat on weekly basis (every week there's same recurring times). if that's not true replace week largest repeting basis (month/year/whatever). take last week before date picked in first step. generate events happen week (make sure checks, since 1 of events might start repeating in period. each event should have concrete

sql server - sql union remove "semi-duplicates" -

i'm doing union so select name, price products project = 10 // prio 1 union select name, price products customer = 5 // prio 2 union select name, price products standard = 9 // prio 3 edit: changed where-clause make bit more complicated this typically give me back +-----+------+-----------+--------------+ |(no) | name | price | (prio) | +-----+------+-----------+--------------+ | 1 | | 10 | (1) | | 2 | b | 5 | (1) | | 3 | | 13 | (2) | | 4 | b | 2 | (2) | | 5 | | 1 | (3) | | 6 | b | 5 | (3) | | 7 | c | 3 | (3) | +-----+------+-----------+--------------+ i understand e.g. row no 1 , 3 not duplicates , not removed union statement. however, want do. is, if name (e.g. "a") gets returned first select statement (prio 1) don't want other "a":s result set select statements of higher priori

coldfusion - Calling CFC's on another folder level -

i have page use cfc's on. this: <cfset cfcdashboard = new dashboard()> <cfset grab_image = cfcdashboard.getpicture()> how call cfc's if inside of folder? of right work if on same level or inside same folder? how call cfc on different level? or not understanding purpose of cfc? the new keyword syntactic sugar call: <cfset cfcdashboard = createobject("component", "dashboard")> the rules how coldfusion resolves cfc names in docs . if use cfinvoke or cfobject tag, or createobject function, access cfc cfml page, coldfusion searches directories in following order: local directory of calling cfml page web root directories specified on custom tag paths page of coldfusion administrator you can use dot notation corresponds of defined search paths. <cfset mydashboard = createobject("component", "my.custom.dashboard")> <cfset mydashboard = new my.custom.dashboard()&

oop - Javascript add new order id to each new element -

sorry english don't how correct ask question!! i have task list , when add new task ned add smomthing ordinal number each new task example task 1 have stored var whit id 1,task 2 var id 2 ..... think need use iteration how...? project link var todolist = function() { var addnewtask = function() { var input = document.getelementbyid("taks-input").value, itemtexts = input, cola = document.getelementbyid('task-col-a').children.length, colb = document.getelementbyid('task-col-b').children.length, taskboks = document.createelement("div"); taskboks.classname = "min-box"; taskboks.innerhtml = '<div class="col-3 chack" id=""><i class="fa fa-star"></i></div><div class="col-8 task-text" id="taskcontent"><p>' + itemtexts + '</p></div><div class="col-1 color">&

java - can I access a static Arraylist of Vector of another thread? in this example? -

having problems accessing static vector thread , class in thread. 1 class gui class called lotteryplay, has static vector called packarray, , other class called multithreader , part of shown below, runs in different thread. ideas on wrong? the thing think of trying access static vector thread. possible? @override public void run() { try { out = new printwriter(socket.getoutputstream(), true); in = new bufferedreader(new inputstreamreader(socket.getinputstream())); system.out.println("streams setup new thread\n"); line = ""; while((line = in.readline())!= null){ this.messagefromclient(line); if(!(counter > 1)){ textsplitter(line); socketpack = new socketpack(socket, timestamp, address); lotteryplay.packarray.add(socketpack); <<<----null pointer exception system.out.println("size of

Create field in SharePoint programmatically using CSOM (Not with XML) -

is possible create fields in sharepoint csom, not using xml? i've seen many examples using xml, none setting properties field programmatically? fields.add(new **fieldcreationinformation** { internalname = "test", etc.. }); that's doable, in following example introduced fieldcreationinformation class : [xmlroot("field")] public class fieldcreationinformation { [xmlattribute("id")] public guid id { get; set; } [xmlattribute()] public string displayname { get; set; } [xmlattribute("name")] public string internalname { get; set; } [xmlignore()] public bool addtodefaultview { get; set; } //public ienumerable<keyvaluepair<string, string>> additionalattributes { get; set; } [xmlattribute("type")] public fieldtype fieldtype { get; set; } [xmlattribute()] public string group { get; set; } [xmlattribute()] public bool required { get;

javascript - How to access $scope from one controller to another in angular -

i have these controller codes different js files. nlgoalsctrl.js angular.module('mysite').controller('nlgoalsctrl', function ($scope) { $scope.goals_selected = []; }); nlsessionsctrl.js angular.module('mysite').controller('nlsessionsctrl', function ($scope) { //access $scope.goals_selected here }); i need able access $scope.goals_selected nlsessionsctrl. how do this? guys. use factory/service store goals responsible sharing data among controllers. myapp.factory('myservice', [function() { var goals = {}; return { getgoals: function() { return goals }, setgoals: function(op) { goals = op; }, } }]) .controller('nlgoalsctrl', [function($scope, myservice) { $scope.goals_selected = {}; //update goals_selected myservice.setgoals($scope.goals_selected ); }]) .controller

asp.net web api - EF 6 Rollback and Update Best Approach -

i have working solution in place , m initiating thread have discussion on best approach. environment : ef6, sql 2012 scenario: i have task , taskdetail table have parent child/relationship through taskid. create method: while creating task, need ensure entry made in taskdetail table well. first approach: entry made task table. savechanges. taskid , assign dto has information detail table. pass dto taskdetail create method. save changes. commit.. if error occurs, rollback entire transaction second approach: add relavent fields of task table. add relevant fields of task detail table well. add new detail table object task table through navigation property. task.taskdetail.add(newobj). savechanges. question 1: both approaches yield same sql. couldnt notice difference though.. best approach doing this??? question 2: also, if take @ scenario, have noticed saveall or savenone approach. tried looping through dbentityentries , rollbacked change. sounds working second appro

apache - Rewrite rule for changing url from filetype to category -

i have following urls: http:/testdomain.com/file_type.html http://testdomain.com/file_name.html i want able change them to: http://testdomain.com/file-type/ http://testdomain.com/file_name/ but url comes in has format of something_something.html want change /something-something/ i upgraded site wordpress old urls have seo want them still work i tried following rewrite condition of course didn't work rewriterule ^file_name.html(.*)$ http://testdomain.com/file-name/$1 [r=301,nc] and know if did work specific file only, trying test

sonarqube - Pmd violations with sonar -

i need clarification pmd sonar.can reuse pmd reportwhich produced ant..else sonar dynamically produce own violation using pmd. please me out...for past 2 days iam stucked this. thanks!!! no it's not possible import pmd nor checkstyle reports. not philosophy of sonar. nothing guarantees pmd has been executed configuration (quality profile) declared in sonar. lead inconsistent results. why executing pmd while sonar ?

c - WinPcap: Discarded WiFi Packet -

consider winpcap tutorial sending single packet . start running it, relatively straightforward: copy , paste code ide c (in case code::blocks) add #define have_remote 1st line set build options (link libraries , directories) set proper mac addresses fill array data want send compile , execute (as administrator) it works nice , documented. if run other tutorial capturing packets , see packet transmitted properly. however, if set 13th array element 0~5, packet not transmitted properly. example, before sending down packet, add following line of code: packet[12]=5; this way, packet being transmitted, no longer transmitted (without error message). doesn't make sense. according documentation, array element part of payload (ie: no longer mac address, length or header), , integer 0 255. issue why 13th array element causing packets no longer transmitted? packet[12] , packet[13] contain used ethertype , example, ip 0x0800 . see here , here list of e

javascript - Why does Page Inspector display unwanted <$A$> tags -

Image
i'm using page inspector debugger in visual studio compete tutorial on how use jquery display dialog showing line of text , dropdownlist. in page inspector appears random , tags around elements shown this doesn't happen when it debugged in chrome, ie etc has else experienced before, or have ideas why might occurrng. 'feature' or page inspector? the code used generate popup follows... this works pressing button btnlookandfeel on page itemedit.cshtml calls listingitemcontroller.editlookandfeel method, returns partial view editlookandfeel.cshtml itemedit.cshtml @section scripts { <script> $(function () { $('#btnlookandfeel').click(function () { $.get('/listingitem/editlookandfeel', { id: $('#lookandfeelid').val() }, function (data) { $('#divlookandfeel').html(data).dialog(); }); }); }); </script> }

asp.net - Check in / out in Document management System Web Solution -

we have developed , implemented document management system using windows forms. the check out/in feature works following: user check out document the application asks user save document (checkout location) a copy downloaded on specified location on user's pc. now, if user edits document, modifications saved locally on machine. other users cannot make modifications document, can view version on server (until user check in document) user a, can open document, modifications saved, can check in document, document uploaded new version server. now other users can view updated version of document , check out if needed. now, in process of developing web version. where should keep checked out documents? if locally on user stations, how should save , upload server on check in, taking consideration application run on web browser. or in web solution have keep checked out documents on server. i asking design , strategy how check in / out document in web document man

javascript - AngularJS $http.post succeeds but doesn't save the data -

i'm trying save array json file that's located on webserver. response successful when open json it's empty. i've tried create json object of own manually yielded same results. here's process: app.controller('bookcontroller', ['$window', '$http', function ($window, $http) { this.contacts = []; this.exportcontacts = function(contacts){ $http({ method: "post", url: '/data/contacts.json', headers: { 'content-type': 'application/json' }, data: contacts }).then(function goodcall(){ $window.alert("save done!"); }, function badcall(){ $window.alert("failed save error! error: " + $http.status); }); }; }]); i fill array inputs via form: <form name="addcont" ng-show="showform" ng-controller="contactcontroller contactctrl" ng-submit="contactctrl.addcontact(a

window - Extjs err:'0.manager.zseed' is undefined -

when close ext.window,and create new ext.window,i got error:'0.manager.zseed' undefined. however,this problem occurs in ie 8. code: var win = new ext.window({ id: 'winblno', title: 'mywindow', width: 360, height: 120, layout: 'fit', items: [formgetblnorule], closeaction: 'close', buttonalign: 'center', buttons: [ { text: 'ok', handler: function() {} }, { text: 'exit', h

php - How to make use of 'Date of birth' column to send birthday greetings -

i writing script select people database month , day of birth fall on current month , day , send them birthday greetings e-mail. need sql code, pick there , tie cron job. i have used number of codes not run. code used last is: select name_of_staff, email, date_of_birth staff_dossier month(date_of_birth) = month(now()) , dayofmonth(date_of_birth) = dayofmonth(now()); //send mail code follows... my problem extract month , day parts in date_of_birth column necessary , use determine whom birthday greetings go. may please me please. if want list of employees birth month , date matches current date/month, should able use functions month() , day() : select name_of_staff, email, date_of_birth staff_dossier month(date_of_birth) = month(now()) , day(date_of_birth) = day(now()); see sql fiddle demo

date conversion in perl -

i using perl access db getting date in dd-mon-yyyy format. need perform 2 operations: convert format mm/dd/yyyy format. compare date 2 dates see if lies in time range. my $chdate = '15-feb-2013'; sub get_stats { my %map = ( 'jan' => '01', 'feb' => '02', 'mar' => '03', 'apr' => '04', 'may' => '05', 'jun' => '06', 'jul' => '07', 'aug' => '08', 'sep' => '09', 'oct' => '10', 'nov' => '11', 'dec' => '12'); $chdate =~ s/(..)-(...)-(....)/$map{$2}\/$1\/$3/; print "new date: $chdate"; } how perform (2) operation? i have old version of perl (no time::piece module), not have privileges update :) for (2) can this: sub dateasnumber # arg mm/dd/yyyy - converts number compared { $_[0]=~m%(\d

html - Inspecting elements and using XPATH to get the correct data python -

i'm trying scrape coinid's form website . when inpecting element, id's seen here , when copying xpath get: //*[@id="id-bitcoin"] i'm planning on using python code: from lxml import html import requests page = requests.get('http://coinmarketcap.com/all/views/all/') tree = html.fromstring(page.content) id = tree.xpath('') print id but i'm not sure in element plug tree.xpath('') i hoping //span[@class="id"]/text() i tried printing tree understand data better, it's printing `what's syntax see data, tree.getdata() ? any info on how can these coin id names appreciated, thanks. i suppose trying id 's of tr tags. id attribute of tag, can this: from lxml import html import requests page = requests.get('http://coinmarketcap.com/all/views/all/') tree = html.fromstring(page.content) trs = tree.xpath('//table[@id="currencies-all"]/tbody/tr') tr in trs:

asp.net - AutoMapper - Multiple Class Libraries -

i have asp.net web forms application , classlibrary, both of define own automapper.profiles classes. 1 example is: public class mymappings : automapper.profile { public mymappings() : base("mymappings") { } protected override void configure() { mapper.createmap<dal.user, sessionuser>() .formember( dest => dest.locationname, opt => opt.mapfrom(src => src.locationforuser.name)); } } in order both mappings configured , in order 1 mapping profile not overwrite others, correct should have 1 automapperconfig (defined in asp.net forms application) follows:? namespace platformnet.mappings { public class automapperconfig { public static void configure() { mapper.initialize(x => { x.addprofile<mymappings>(); x.addprofile<assessmentclasslib.mappings.mymappings>(); }); } } } and call once global.asax follows?

Excel ranking based on grouping priorities -

hi have excel question on how rank based first on a ranking next on second priority of group. formula written in column 'final_rank' , hid bunch of rows show clear example. within column rank normal rank function. want priority within rank first, add next rank next item of same group*. if @ group hyp supersede ranked (3 , 4) , 5 given next newest group. i hope clear explanation, thanks. group rank final_rank_manual tam 1 1 hyp 2 2 gab 3 5 hyo 4 8 alo 5 9 hyp 7 3 aco 8 12 ibu 9 13 aco 11 14 alo 18 10 gab 44 6 ibu 53 15 ibu 123 16 gab 167 7 hyp 199 4

objective c - NSString to float value incorrect -

i have nsstring converting float value , result logged this 2,146.952 float 2.000000 the comma seems cause float value rounded down, if use doublevalue] same. is there way 2146.952 ? try, 1) remove comma string nsstring * str = [str stringbyreplacingoccurencesofstring:@"," withstring:@""]; 2) retrieve float value string float f = [str floatvalue];

c++11 - C++ file extension in Visual Studio -

gnu gcc compiler compile c++ source files both .c and .cpp extension. is possible configure microsoft visual studio compile c++ source , header files extensions .c , .h extension respectively? the problem windows file system not case-sensitive, there's no difference between .c , .c. means default c language .c apply. you cannot tell compiler treat .c files c++, can tell treat files in a compilation command c++ regardless of extension /tp switch.

c# - how to set parameters to app.config file -

i want set parameters own app.config file programmatically? i tried following code 1 question not working. configuration config = configurationmanager.openexeconfiguration(application.executablepath); config.appsettings.settings.add("param1", "value1"); config.save(configurationsavemode.minimal); my second questions can access & update app.config file of other project if yes how that? plz guide me. this code work me. take @ debug or release folder of application , see yourprojectname.exe.config file. application.executablepath 1 of this.

xaml - ComboBox Custom Winrt -

i'm trying create app bar in winrt app on top with, maybe, combobox. want "bing sport" app in windows 8. : http://i.imgur.com/5xnjyae.png http://i.imgur.com/co0dv6h.png what's best way that? thanks i think best way write own code. 1) create appbar. 2) create first stackpanel menu icons(set orientation horizontal) 3) menu items grid's or stackpanel's 4) add grid or stackpanel slide content.(set visibility collplased) 5) handle click's events. onclick item arrow do: "change clicked event style", "set item slide content visibility visible", "add items"

linux - Bash - Check if line in one file exists in another file -

i wanted know how can check if 1 line first column exists part of line in file. instance if have following files: a.txt: 0000_01_000000049e 7821069312 0000_01_000000049f 7886800896 0000_01_00000004a1 8302987264 0000_01_00000004a2 8469055488 0000_01_00000004a3 8040450048 0000_01_00000004a5 8250165248 0000_01_00000004a6 8116242432 0000_01_00000004a7 8260126720 0000_01_00000004a9 6420892672 0000_01_00000004aa 1076364288 0000_01_00000004ab 7822870528 0000_01_00000004ae 4297589760 0000_01_00000004af 2360320 b.txt: 0000_01_000000049e,000000,0000_02_00000002aa,7821070336,1451596986,l3,0,0 0000_01_000000049f,000001,0000_02_00000002aa,7886801920,1451623534,l3,0,0 0000_01_00000004a0,000002,0000_02_00000002aa,6888983552,1451051126,l3,0,0 0000_01_00000004a1,000003,0000_02_00000002aa,8302988288,1451618939,l3,0,0 0000_01_00000004a2,000004,0000_02_00000002aa,8469056512,1451605811,l3,0,0 0000_01_00000004a3,000005,0000_02_00000002aa,8040451072,1452180174,l3,0,0 0000_01_00000004a4,000006,000

asp.net getting the url parameter and putting it in textbox value -

i have master page has form in textbox , when press enter redirects me results.aspx?srch=search_term , want give textbox searched term. problems results.aspx.cs doesn't see id of masterpage's textbox . there other method achieve this? this master page: <%@ master language="c#" autoeventwireup="true" codebehind="masterpage.master.cs" inherits="groups.site1" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="css/bootstrap.min.css" rel="stylesheet" /> <link href="css/site.css" rel="stylesheet" /> <script src="js/jq.js"></script> <script src="js/bootstrap.min.js"></script> <asp:contentplaceholder id="head" runat="server"> </asp:contentplaceholder> </head>

aem - Adobe CQ 6.1 New Components don't appear -

when go insert new component, window doesn't display options. know reason why? i'm using adobe cq 6.1 , sightly my html file: <div data-sly-resource="${@path='par', resourcetype='foundation/components/parsys'}"></div> what happens when try insert new component

php - How to stop getting serverside errors on android app -

this question has answer here: php parse/syntax errors; , how solve them? 11 answers reference - error mean in php? 29 answers i have android app communicates php script database operations.my problem need prevent server echoing app server errors or warnings.i know there security issues if see sensitive data in errors.i tried lot of things wrote in posts turn off error display in php.ini,error_reporting(0),ini_set("display_errors", 0) , ini_set("log_errors", 1)`.i triger errors , keep getting "received parse error : syntax error, unexpected ......in line...". i don't know if miss something.i new php , serverside things if stupid forgive me. i must again dont need solution errors....because trigger them on purpose.i need prevent use applic

linux - MySql: How to set my.cnf to accept both uppercase and lowercase tables -

how setup mysql my.cnf accept both uppercase , lowercase tables. environment: os: ubuntu 14.04 tls mysql server: app server: wlserver 12.2.1 (only uppercase tables accepted) plesk: 12.0.8 (only lowercase tables accepted) i try lower_case_table_names=2 #(default value '0') error message: database.table doesn't exist if use lower_case_table_names=1 the wlserver work fine wiki, plesk .... have problems how deal issue?

Django query for vendors who supply all parts -

given model (vendors supplying parts, many-to-many relation): from django.db import models class part(models.model): pass class vendor(models.model): name = models.charfield(max_length=100) parts = models.manytomanyfield(part) def __str__(self): return "%s" % self.name is possible write django query vendors supply of parts? i'm interested in query produce single sql statement. for example, following data: p1 = part() p2 = part() p3 = part() v1 = vendor(name="supply nothing") v2 = vendor(name="supply parts") v3 = vendor(name="supply parts") p1.save() p2.save() p3.save() v1.save() v2.save() v3.save() v2.parts.add(p1,p2) v3.parts.add(p1,p2,p3) i want get: [<vendor: supply parts>] you first query parts: parts = part.objects.all() and filter vendors: vendors = vendor.objects.filter(parts=parts)

android - Button OnClicklistener from dynamically genereated Buttons -

i have problem build correct onclicklistener buttons generate @ runtime. found threads here on stackoverflow after many tries don't working. i have methode builds gui textview in left "column" , in right "column" x buttons. each button has other link should open onclick. don't know link before it's created @ runtime. here code actuall try. in case everytime link of last generated button. if click on first one, second 1 .... it's everytime same link. hope there solution it! private void createnewview (string jsoninputbeacon, string jsoninputconfig){ tablelayout tablelayout = new tablelayout(this); tablelayout.setlayoutparams(new tablerow.layoutparams(tablerow.layoutparams.match_parent, tablerow.layoutparams.match_parent)); tablelayout.setstretchallcolumns(true); try { final jsonarray jsonarraybeacon = new jsonarray(jsoninputbeacon); final jsonarray jsonarrayconfig = new jsonarray(jsoninputconfig);

wysiwyg - how to create drupal8 ckeditor shortcodes? -

what best direction toward creating shortcodes usable in drupal 8 editor? ckeditor being placed core, shortcode module nor shortcode_wysiwig module being ported , not quite sure start from. you need implement custom module using ckeditor.api for further examples see here: https://drupal.stackexchange.com/questions/139075/implementing-ckeditors-plugin-in-drupal-8

node.js - How to scale up an EC2 web service from staging to production -

i'm new server-side development , hoping can fill in blanks or recommend appropriate tutorials me scale staging web service built using node.js v4.2.4 on single aws ec2 t2.micro instance production environment resilient down time. in order avoid downtime , make optimal users in multiple regions (say europe , usa now), believe need following. create ec2 instances both europe , usa running same web service. create elastic load balancer points both ec2 instances if 1 goes down or experiences high load, automatically route other. downed instances should automatically restart if instance alive. create cloudfront points elb. both ec2 instances should able automatically push new content want cached cloudfront. create ec2 node.js database holds user authentication data. i'm playing around mongodb open other dbs. questions: a. correct far? b. make sense host user database on separate ec2 instances actual web service? c. user database has maximum uptime, expect ne

Reformat Javascript date object -

this question has answer here: where can find documentation on formatting date in javascript? 33 answers i have date object want reformat different date style, having trouble doing so. i've tried .format() , using moment , can't work ( .format() throws start.format("yyyy/ddd") not function error , moment seems return unix timestamps no matter do. keep getting invalid date . here fiddle code in (the dates displayed when hover on block of time). as requested, here actual code: google.setonloadcallback(drawchart); function drawchart() { var container = document.getelementbyid('timeline'); var chart = new google.visualization.timeline(container); var datatable = new google.visualization.datatable(); datatable.addcolumn({ type: 'string', id: 'rowlabel' }); datatable.addcolumn({ type: 'string', id: 

c# - Issue related to ItemCommand event in DataGrid asp.net -

i have asp.net application having datagrid on aspx page having autogenerated columns : i have bound itemcommand event on grid following : protected void datagrid2_itemcommand(object sender, system.web.ui.webcontrols.datagridcommandeventargs e) { if (e.commandname == "checkinventoryandprice") { string itemmainpagelink = e2wconstants.pages.item_main; string itemid = (datarowview)e.item.dataitem).row["itemid"].tostring(); //response.redirect(); } } but getting dataitem null : how can value of cell of selected row ?? thanks..

How to retrieve currently applied node configuration from Riak v2.0+ -

showing applied configuration values in v2.0+ of riak there new command option: riak config effective which read tell current running values of riak. at time, can snapshot of applied configurations through command line. listing of of configs applied in node config changes applied on start of each node? in multiple locations in riak documentation there reference like: remember must stop , re-start each node when change storage backends or modify other configuration problem: however when made change setting (i've tested in both riak.conf , advanced.conf), see newest value when running: riak config effective ie: start node: riak start view current setting log level: riak config effective | grep log.console.level log.console.level = info change level debug (something output lot console.log) re-run: riak config effective | grep log.console.level , get: log.console.level = debug checking console log file debug: cat /var/l

c++ - Qt5 convert chars to 8bits unsigned values -

i have 2 ways used convert characters representing 8bit byte values. in first 1 gives correct answer in second gives 0 had ba.size()-1 . question why have in second one? know /0 terminator. if im not wrong? there better way this? // simple test if can take bytes , them in decimal (0-255)format: qbytearray ba("down came glitches , burnt in ditches , slept after ate our dead..."); (int = 0; < ba.size(); ++i) qdebug() << "bytes are: "<< static_cast<quint8>(ba[i]); // simple second way it... int j = 0; while (j < ba.size()-1){ qdebug() << "bytes are: "<< static_cast<quint8>(ba[++j]); } the difference because of invalid use of increment operation. when use ++j has value 1 , never 0 index. last index bigger array size. right way is: qdebug() << "bytes are: "<< static_cast<quint8>(ba[j++]);

android - Proper Use Of Fragments -

Image
i want know if using fragments here... my application contains 6 activities. wanted add navigation drawer in process of converting each of these activities fragments. when select option drawer, appropriate fragment appear. fragments "stand alone" meaning each fragment self contained , not interacting other fragments, example calendar displays date. this same on every device, whether tablet or phone. every tutorial have seen fragments has multiple fragments interacting 1 another. mine not. question is, design perspective, ok use fragments in manner? or should use activities instead? thank you. if drawer, proper design use fragments. should using fragments whenever it's possible, makes code easier maintain , control. communication between fragments easier communicating between activities. in addition, activities expensive operate. activities created not implicitly destroy previous activities.

class - VB.net count the number of classes created in the namespace -

i'm trying learn bit using namespace, created 2 items using namespace. in future when implemented there x-number of items created using namespace. how can count number of "cilinders" there exist? public class form1 ' test using namespace private sub button4_click(sender object, e eventargs) handles button4.click ' create cilinder 1 dim cilinder_1 new body_namespace.body_cilinder cilinder_1.index = 1 debug.print(cilinder_1.index) ' create cilinder 2 dim cilinder_2 new body_namespace.body_cilinder cilinder_2.index = 2 debug.print(cilinder_2.index) end sub end class namespace body_namespace class body_cilinder private _index integer public property index() integer index = _index end set(byval value integer) _index = value end set end property end class end namespa

visual studio 2015 - R# & StyleCop issue: Method not found -

Image
i have downloaded r# 9.1 in order integrate stylecop it. passed when installing both r# , extension stylecop. however, when go solution folder (in visual studio 2015) , right-click on 1 of projects , click on "run stylecop" displays error: initially installed r# 9.2 , result same, decided go 9.1 version. reinstalled r# , stylecop both once , multiple times r#'s extension integrating stylecop. my current set r# , stylecop is: resharper 10.0.1 stylecop jetbrains 4.8 which gives in r# options: this gives me r# validation of rules. however, doesn't give me right click run functionality. so had click around , found stylecop doesn't have install vs 2015, installed visual stylecop , have recreated issue. if using visual stylecop may worth while adding issue on github. personally, don't use right click functionality, instead warnings build via stylecop.msbuild nuget package each project want monitor: once have no errors, us

java - Cobertura changes Sonar violations -

my co-worker found morning compiling project cobertura enabled changes sonar results on same project. on particular project ran build sonar:sonar , ran again cobertura:cobertura sonar:sonar . the sonar results in comparison showing without cobertura have 7/78/153/24/0 violations of 5 severities, cobertura changes 7/81/94/24/0 , , in particular finds 3 new critical violations , 15 new major violations aren't found without cobertura. one of biggest changes without cobertura there 60 violations of rule against empty methods (many of them constructors) , cobertura 3 of reported. if cobertura prevented violations being found run 2 independently, since violations found cobertura enabled seems have 2 separate sonar analyses. is known interaction? there workaround other doing cobertura , sonar in separate builds? , using both sets of results best data? based on comment made let me explain seems happening: using findbugs via sonarqube (rules mentioning findbugs rule

c++ - How to compute basis of nullspace with Eigen library? -

how compute basis of nullspace of matrix eigen library? i tried find explicit function name compute null basis , also, workaround, find method computing rref of matrix (as we're able null basis rref). but couldn't find relevant functions names. i think there's must solution this, know not eigen library , eigen's code difficult me understand. please suggest me solution problem. you can basis of null space using eigen::fullpivlu::kernel() method: fullpivlu<matrixxd> lu(a); matrixxd a_null_space = lu.kernel();

amazon s3 - spark error loading files from S3 wildcard -

i'm using pyspark shell , trying read data s3 using file wildcard feature of spark, i'm getting following error: welcome ____ __ / __/__ ___ _____/ /__ _\ \/ _ \/ _ `/ __/ '_/ /__ / .__/\_,_/_/ /_/\_\ version 1.2.0 /_/ using python version 2.7.6 (default, jul 24 2015 16:07:07) sparkcontext available sc. >>> sc._jsc.hadoopconfiguration().set("fs.s3n.awsaccesskeyid", 'aws_access_key_id') >>> sc._jsc.hadoopconfiguration().set("fs.s3n.awssecretaccesskey", 'aws_secret_access_key') >>> sc.textfile("s3n://mybucket/path/files-*", use_unicode=false).count() 16/01/07 18:03:02 info memorystore: ensurefreespace(37645) called curmem=83944, maxmem=278019440 16/01/07 18:03:02 info memorystore: block broadcast_2 stored values in memory (estimated size 36.8 kb, free 265.0 mb) 16/01/07 18:03:02 info memorystore: ensurefreespace(5524) called curmem=121589, maxmem=278019440