Posts

Showing posts from May, 2013

javascript - D3 Tooltip: Unable to get tooltip working -

i unable tooltip working in line chart. have tweaked code doesn't show me error. can me set tooltips in line chart? below css , complete js code. css: div.tooltip { position: absolute; text-align: center; white-space: normal; padding: 2px; font-size: 14px; background: whitesmoke; border: 1px solid gray; border-radius: 4px; pointer-events: none; cursor: none; } javascript: $(document).ready(function() { var svg_co2_emission = d3.select("#svg_co2_emission"), margin_co2_emission = {top: 20, right: 20, bottom: 30, left: 40}, width_co2_emission = +svg_co2_emission.attr("width") - margin_co2_emission.left - margin_co2_emission.right, height_co2_emission = +svg_co2_emission.attr("height") - margin_co2_emission.top - margin_co2_emission.bottom, g_co2_emission = svg_co2_emiss...

centos - PHP Composer issue None of the 0 stable version(s) of Composer matches your PHP -

hi m trying install php composer in vps using command error warning: file_get_contents(https://getcomposer.org/versions): failed open stream: connection timed out in - on line 770 php warning: invalid argument supplied foreach() in - on line 516 warning: invalid argument supplied foreach() in - on line 516 none of 0 stable version(s) of composer matches php version (5.3.3 / id: 50303) my os centos release 6.8 php php 5.3.3

javascript - Hapi js and Postman Chrome App - subsequent requests -

i have minimal hapi server: const hapi = require('hapi'); const server = new hapi.server(); server.connection({ port: 8080 }); server.route({ method: 'get', path: '/hello', handler: function(request, reply) { console.log('hooray'); settimeout(function() { console.log('mellow'); return reply("hello"); }, 7500);//7.5 seconds } }); server.start((err) => { console.log(`server started @ ${ server.info.uri }`); }); now if send 2 request 2 seconds delay using postman chrome app (from 2 different tabs), output on console: server started @ http://clivend-n56vv:8080 hooray mellow hooray mellow why hapi waiting reply first request before processing other? thanks! it's not hapi waiting prevoius request. bet testing in 1 browser. try make 2 request 2 different browsers or curl.

c# - is nHibernates Expression.Sql Parameterised? -

as per title i'm wondering if expression.sql parameterised, avoid sql injection attacks? example: expression.sql("{alias}.column ?", $"%{stringvalue}%", nhibernateutil.string); i've been having trouble getting column stored string contains numbers, compare value string, contains numbers (i think nhibernateutil.guesstype might getting little eager use integers when generating statement, particular column doesnt honor matchmode.always result in wildcards, thats separate question day). any feedback appreciated.

Using curl for IdentityServer4 / OpenID -

for testpurposes trying authorization via curl (test-)app identityserver4. tried authenticate in flow documentated ( http://openid.net/specs/openid-connect-core-1_0.html#overview ), have feeling making wrong. curl -x post -h "username:test" -h "password:pass" -h "content-type: application/json" -d '' -k -v http://localhost:5000/connect/authorize authorize authorization-endpoint. that's curl-command used test lot of changes in parameter , use. so. need? primary goal full authentification of user 1 of asp.net apps curl on bash windows maybe got wrong flow?

.htaccess - Apache/htaccess disallow other domains with same IP -

i setup brand new server @ host (not on shared host btw), , apparently ip used , keep getting requests in apache logs people going old domain (that has same ip has not been changed in dns). there simple way tell apache or htaccess allow domains have defined there serve site, , ignore/drop/redirect others aren't domain?

javascript - Backreference in Regex -

so, have javascript regexp this: /url:.?(['"])(https?:\/\/.*?)\1/ i use find specific url inside html/js code. can see capture link inside either '' or "" . problem, because don't want links 'http://'. /url:.?(['"])(https?:\/\/.+)\1/ this picks stuff 'http://"+d+', bad. i'd able in regex this: /(['"])(https?:\/\/[^\1]+)\1/ to use [^\1] instead of dot, whatever inside '' or "", making sure not pick 'http://"+d+' is there way stuff this?

sql server - Why same EXISTS returns different result -

Image
each policynumber can have multiple classcode . goal eliminate whole policynumber related columns including classcode's if @ least 1 classcode chosen eliminated. have cte1 policynumber , writtenpremium (wp) , have table tblclasscodesplazacommercial policynumber , classcode . in where clause im choosing: where exists ( select distinct policynumber tblclasscodesplazacommercial policynumber not in (select policynumber tblclasscodesplazacommercial classcode =5151) ) then if select * cte3 classcode =5151 still have policies classcode 5151 the entire select statement below: select cte1.policynumber, cte1.transactioneffectivedate, cc.classcode, case when row_number() on (partition cte1.quoteid, cte1.policynumber, cc.transactioneffectivedate order (select 0))=1 cte1.wp ...

php - Get the_excerpt of a child page from within a parent page -

Image
having trouble getting excerpt of child page within parent page. have static parent page, within, lists excerpts of child pages hierarchal of parent. for reason can return each title , publish date of each individual child page. when try echo get_the_excerpt or the_excerpt excerpt or content of parent-page every child page listed. i'm converting standard excerpt custom trimmed excerpt. worked on "front-page" not in standard "parent-page". not sure i'm doing wrong or overlooking. this appears... note: "the parent page content" repetition. parent page title the parent page content test child page title a the parent page content nov 16, 2016 test child page title b the parent page content oct 5, 2016 using solution: <?php <article id="post-<?php the_id(); ?>" <?php post_class(); ?>> // begin listing child pages $childpages = get_pa...

dynamics crm - When saving certain Business Process Flows: "An error has occurred. Try this action again" -

i trying edit business process flow in crm online/dynamics 365. when save bpf, following error shows: an error has occurred. try action again. if problem continues, check microsoft dynamics crm community solutions or contact organization's microsoft dynamics crm administrator. finally, can contact microsoft support the button downloading logs greyed out. this error shows if open bpf , try save without adding or changing fields. this issue occurs bpfs came system out of box. bpfs created @ later stage can edited without problem. base language of organization not english. this can resolved in following way: create solution containing problematic workflows. export solution. open .xaml files , search/replace languagecode="0" languagecode="1033" re-import solution.

php - Symfony2 Google sign-in without FOS User Bundle and HWIOAuth Bundle -

i'm having hard time figuring out how in symfony 2.8 authenticate user using google oauth sign in. avoid hwioauthbundle because not handle registration, "connect" functionality doesn't work unless hack used - i'd love avoid making mess in vendor directory on each node i'll run it. because of custom users hierarchy / model avoid fosuserbundle, couldn't find reliable way work doctrine's sti , fosuserbundle. the workflow need implement: user presses "sign in google" button gets redirected google oauth page user redirected callback url, e.g. /oauth/login database checked existence of user (by google id / email) if user exists, he's authenticated , token populated user, otherwise he's redirected registration page populated data received google additional fields each "local" account requires now, please correct me @ places i'm wrong: i need route used button url - let's /oauth/google-signin the controll...

.net - WinAppDriver cannot connect to wpf application -

while creating webdriver session wpf application session times out. however, wpf application launched. using nunit under windows 10. exception occurs while trying instantiate iosdriver object. sample notepad works fine https://github.com/microsoft/winappdriver/tree/master/samples/c%23/notepadtest . however, when trying same wpf app, times out. functiontests.tests.report.loadparthistorytest.openparthistory: setup : openqa.selenium.webdriverexception : http request remote webdriver server url http://127.0.0.1:4723/session timed out after 60 seconds. ----> system.net.webexception : operation has timed out teardown : system.nullreferenceexception : object reference not set instance of object. at openqa.selenium.appium.service.appiumcommandexecutor.execute(command commandtoexecute) @ openqa.selenium.remote.remotewebdriver.execute(string drivercommandtoexecute, dictionary 2 parameters) @ openqa.selenium.remote.remotewebdriver.startsession(icapabilities desiredcapabiliti...

angular - Expression has changed after it was checked -- ngClass change -

i'm not expert in angular2. know how resolve error: inline template:0:6332 caused by: expression has changed after checked. previous value: 'btn-disabled'. current value: ''. [ngclass]="!formvalid() ? 'btn-disabled': ''" what's ideas error ? try use: [class.btn-disabled] = "!fromvalid()" when use [ngclass] , should return {class-name: true/false} map. for example: [ngclass]="{active: isactive, disabled: isdisabled}"

class - Python Priority Queue, insertion of elements -

i making class priority queue. queue contains of list paired tuples: [("do homework", 1), ("clean room", 2)] and trying make function inside class insert element (tuple) in queue (list). if inserted tuple has higher priority (greater number right) 1 in queue, tuple higher priority inserted before tuple lower. so correct order be: [("make food", 4), ("clean room", 2),("do homework", 1)] i think have kind of sorting function , have started make 1 stuck. self.item = [] def enqueue(self, a, b): el in self.item: if self.item.empty(): return self.item.insert(0, (a, b)) else: tupl in el: if tupl[1] > tupl+1[1]:

Batch Script Cant get If statements working -

my batch script working fine until tried add long if statements. im new , if check whats wrong. im trying pricing calculator based on rank are. heres section of isn't working. if "%drating%" < "1500" (set /a price=%price%+3) else if "%drating%" < "2000" (@set /a price=%price%+5) else if "%drating%" < "2500" (@set /a price=%price%+6) else if "%drating%" < "2700" (@set /a price=%price%+8) else if "%drating%" < "3000" (@set /a price=%price%+10) else if "%drating%" < "3300" (@set /a price=%price%+12) else if "%drating%" < "3500" (@set /a price=%price%+14) else if "%drating%" < "3800" (@set /a price=%price%+20) else if "%drating%" < "3900" (@set /a price=%price%+30) else if "%drating%" < "4000" (@set /a price=%price%+40) else if "%drating%" ...

PATCH collection with ODATA -

using odata standard possible patch entity property collection sending new item? , result returned? it like patch persons/1/addresses {"city": "sf", "country": "us"} what should return? person or address ? according odata v4 protocol, collection property treated unity, , not support partially update. see update collection property a successful put request edit url of collection property updates collection. message body must contain desired new value, formatted collection property according specified format. service must replace entire value value supplied in request body. since collection members have no individual identity, patch not supported collection properties. you can need use put request in case, both request , response payloads should whole collection.

php - Laravel query builder with pivot table -

i have 2 tables pivot table table tours id | name | country_id | featured table countries id | name pivot table country_tour id | country_id | tour_id i want to find tour has featured column of tours table set 1 , country_id of country_tour table set 1. updated: you can using laravel's query builder method - wherehas() : your models should (many many relationships): tour model: <?php namespace app; use illuminate\database\eloquent\model; class tour extends model { public function countries() { return $this->belongstomany('app\country'); } } and country model <?php namespace app; use illuminate\database\eloquent\model; class country extends model { public function tours() { return $this->belongstomany('app\tour'); } } and can fetch desired results using below query: tour::where('featured', 1) ->wherehas('countries', function($q) { $q->where(...

excel - Adding a date filter search to a current autofilter VBA line -

i helped out immensely bobajob on question regarding autofilters. however, need complicate things slightly. following code allows user search small data sheet of products in excel , have auto filter. works splendidly (thanks again bobajob!!), need complicate adding date search function. file relates products , dates refer production dates, expiration dates, etc. original search function allowed brand searched, produced, , serial code number...but have add ability pull when these items manufactured between 2 dates, still retaining search criteria of manufactured, etc. is best way modifying code below? or adding in separate module? can still link 2 fields, etc? sub filterto1criteria() dim long sheet1 .autofiltermode = false .range("a9:j1018").autofilter = 1 10 if .cells(3, i) <> vbnullstring .range("a9:j1018").autofilter field:=i, criteria1:=.cells(3, i) end if next ...

C# port.write(ENQ), scale turn off and receive null -

i try connect scale via rs232 cable. when try write "enq" port scale turn off , receive nothing. code. sorry bad english :( class scalecas { private serialport port = new serialport("com4", 9600, parity.none, 8, stopbits.one); public string result = null; public scalecas() { port.datareceived += new serialdatareceivedeventhandler(port_datareceived); port.open(); } private void port_datareceived(object sender, serialdatareceivedeventargs e) { this.result = port.readexisting(); } } add in class try write port scale.port.write("enq"); console.write(scale.result); you not waiting scale answer, read value of result way lot faster filled data. a way communicate using serialport readline , writeline , check out newline set correctly according device programming manual (which nice add question ...

caching - C++: execute two tasks and kill the one which takes longer -

let's suppose have generic task doesn't produce side-effect. let's suppose have result caching (or memoization) mechanism, avoid perform our task seen input. let's suppose caching mechanism potentially time expensive, , want avoid waste time cache misses. my solution far is: system receives input data, execute 2 different processes. first 1 original task, happen without caching mechanism. second 1 looks inside cache structure. first process terminates, kills other. more expensive in terms of resources, guarantee our system caching mechanism at expensive original one . so, question is: possible implement "kill slower process" in c++, in moment , given task (without side-effects)? ps: guarantee best possible performance, these 2 processes may distributed in 2 different machines.

php - The checkbox's do not hold all value when I select more then one checked -

i want insert employee attendance. when checked more 1 checkbox take 2 checkbox value 1 , other checkbox value 0 .so how can solve please me. form code <form action="coll.php" method="post" name="create_grading" id="create_grading"> <table width="30%" border="0" cellpadding="2" cellspacing="3" class="maintable"> <tr> <th><input type="checkbox" id="selectall" /></th> <th>name</th> </tr> <?php $sql = "select * employee"; $query = mysqli_query($con, $sql); while ($row = mysqli_fetch_array($query)) { ?> <tr> <td><input type="hidden" name="eid[]" value="<?php echo $row['eid']; ?>"/...

java - Continuously animate Text from left to right -

Image
i'm trying create animation moves textview left right , loop indefinitely. textview want animate: <textview android:id="@+id/txttitle" android:layout_width="280dp" android:layout_height="wrap_content" android:textsize="16sp" android:textstyle="italic" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:layout_margintop="20dp" android:ellipsize="end" android:maxlines="1" android:layout_centerhorizontal="true" android:layout_below="@id/cardview" /> and how trying animate textview : animation animation = new translateanimation(0, -280, 0, 0); animation.setduration(9000); animation.setrepeatmode(animation.relative_to_self); animation.setrepeatcount(animation.infinite); textview.setanimation(animation); what want achieve text start out in center of screen, move right , once first...

regex - java regular expression comma separated numbers -

i trying 1 long (timestamp) , 3 floats out of payload of message, string passing looks (ignore quotes): "5737540811294,359.306580,7.948747,6.6707006621" with method private static void processanglesmsg(string s) { final pattern datatfffsplit = pattern.compile( "[+-]([0-9]+)," + "[+-]([0-9]*[.])?[0-9]+," + "[+-]([0-9]*[.])?[0-9]+," + "[+-]([0-9]*[.])?[0-9]+,"); matcher data = datatfffsplit.matcher(s.trim()); if(data.matches()) { long time = long.parselong(data.group(1)); float yaw = float.parsefloat(data.group(2)); float pitch = float.parsefloat(data.group(3)); float roll = float.parsefloat(data.group(4)); system.out.format("angles - [%8d] yaw: %08.3f pitch: %08.3f roll: %08.3f%n",time,yaw, pitch,roll); } else { if...

javascript - How to trigger AJAX requst only onmouseover -

i have below script shows values search page onmouseover . <script type="text/javascript"> function preview(val) { $.ajax({ type: "post", url: "search.php", data:'id='+val, success: function(data){ $(".ress").html(data); } }); } </script> html : <div class="cvsearchresult" onmouseover="preview('1')"> search : <?php echo $_post['id']; ?> output class .ress : 1 however want hide output onmouseout well. how can this? mean trigger ajax mouse hover , hide if not hover. <div class="cvsearchresult" onmouseover="preview('1')" onmouseout="hide()"> <script> function hide() { $(".ress").html(''); } </script> you adding event handler when user move mouse away element trigger hide function. the hude funct...

Javascript convert unix date to ddmmyy format -

this question has answer here: how format javascript date 36 answers i have chart that's giving me date: 1577612800000 i need convert "ddmmyy" format i found this: var timestamp = 1577612800000; var date = new date(timestamp * 1000); but has no format. how can format ddmmyy ? get values date object , generate string concatenation. var timestamp = 1577612800000; var date = new date(timestamp); console.log( date.getdate() + '' + (date.getmonth()+1) + date.getfullyear() )

jquery - Index incorrectly loading both style.css and javascript -

so have webserver has handler function looks this function handler(req,res){ var urlobj = url.parse(req.url,false); var root = "./files"; var filename = root + urlobj.pathname; //get method if(req.method ==='get'){ //grabbing index file if(filename === "./files/"){ console.log("get: " + filename + "index.html"); fs.readfile("./files/index.html", function(err,data){ if(err){ res.writehead(500); return res.end("error loading chatroom.html"); }else{ res.writehead(200, {"content-type": "text/html"}); res.end(data); } }); }else{ //this style.css *edit*-error within if if(filename === "./files/style.css"){ fs.readfile("./files/style.css", function(err...

php - Ignore notices in ternary conditions -

i wondering if it's possible selective in context undefined variable can ignored. ternary conditions, idea can set default value undefined setting, so: $date = $_post['date'] ?: date(); and use this, had ignore e_notice errors. however, don't idea of undefined variables being ignored, , accidentally using undefined variables go unnoticed. wondering if there possibility of middle ground situation? just clarify, aware of non-ternary solutions, such $date = (isset($_post['date'])) ? $_post['date'] : date(); // or $date = date(); if(isset($_post['date'])) { $date = $_post['date']; } but i'm trying ask is, there way reap benefits of shorthand ternary conditions, while still avoiding supressing notices undefined variables. just prepend @ : $date = @$_post['date'] ?: date('y-m-d'); ^ anyway, suggest verify isset instead: $date = isset($_post['date']) ? $_post['date'...

d3.js - Rotate a resized rectangle with SVG and Javascript -

i'm using d3js , svg resize , rotate rectangles, capture mouse events on handles positioned in each corner of rectangle, there 2 handles in each corner, 1 resizing (square) , other rotate (circle). when following process, rectangle "jumps" location one: rotate (it means it's not more in 0 degrees) resize (any direction) rotate again (here when shape "jumps") the jump occurs when center of rectangle updated, using transform rotate svg. one thing gave me lead updating rotation center while shape being resized, when shape starts move final position "jump" have placed it. i can post code examples, take time do, if helps see problem, no problems. all need direction had problem. edit: i've made plunker current structure i'm using in project. events controls concentrated in svgapp.directive.js . things i've noticed while developing example: the center of element not correctly calculated after angle not zero, this ma...

ios - UIScrollView in UICollectionViewCell gestures handling -

i've seen people similar problems here, couldn't find working solution. have uicollectionview, fullscreen cells. scroll content horizontally (paging enabled). each cell has uiscrollview subview, covers entire cell. problem when use zoom-in functionality of uiscrollview, can't scroll 1 cell unless zoom-out 1.0 scale or reach border of uiscrollview content. idea use two-fingers pan gesture scroll collection view, use 1 finger scroll cell's internal uiscrollview. doesn't work , have no idea why. can provide more details, don't know might important.

c# - Telerik Grid disturbed with action column -

Image
note: when added action column edit delete image telerik grid, whole grid disturbed shown in screenshot. this occurs when want add action column. any highly apprecieted. thank you <telerik:radgrid id="radgrid1" runat="server" pagesize="20" width="100%" autogeneratecolumns="false"> <mastertableview name="masterview1" datakeynames="regid" allowmulticolumnsorting="false"> <itemstyle cssclass="gridrow1" /> <alternatingitemstyle cssclass="gridrow2" /> <columns> <telerik:gridtemplatecolumn headertext="action" datafield="regid" uniquename="ckboxdelkey" headerstyle-cssclass="leftgridheader"> <itemtemplate> <nobr> <asp:imagebutt...

c# - Visual Studio: Alternatives to "find all references"? -

i wonder if there either vs (ultimate) solution or extension can me following. use visualstudio community , c#. i use "find references" lot have issue code has many objects extend interface or base class , "find references" shows of these overridden methods, not 1 want find. another thing wondered if can search explicit operations such assignments only. variables used 1000 times assigned once. great if can found quicker. of possible?

Must declare the scalar variable Error C# ASP.NET Sql Command with Select Statement -

i running problem prompts me error says "must declare scalar variable "@id". happens when when add parameter in, when add variable in, works fine. down below code gives me problem: cmd.commandtext = "select * attendee id=@id"; cmd.connection = conn; cmd.parameters.addwithvalue("@id",id); conn.open(); cmd.executenonquery(); sqldataadapter da = new sqldataadapter(cmd.commandtext,cmd.connection); da.fill(dt); conn.close(); when add in variable such as: cmd.commandtext = "select * attendee id=" + id; it works fine. in sqldataadapter constructor pass sqlcommand.commandtext. text (just string) not enough define parameter @id defined instead in sqlcommand.parameters collection you have 2 options sqldataadapter da = new sqldataadapter(cmd.commandtext,cmd.connection); da.selectcommand.parameters.addwithvalue("@id",id); da.fill(dt); or build adapter using command sqldataadapter da = new sqldataadapter(cmd)...

ruby - How to test a method is called with Minitest? -

class post def save mailer.notify!('bla') true end end how test when post.save called, mailer.notify method fired? , right arguments. with rspec do: expect(mailer).to receive(:notify!).with('bla') post.save thank in advance! you can this: describe 'post#save' "calls mailer::notify!" mock = minitest::mock.new mock.expect(:call, nil, ['bla']) mailer.stub(:notify!, mock) post.save end mock.verify end end and yes, easier , more intuitive in rspec...

c++ - Works with libc++, segmentation fault with listdc++. [MacOs Sierra, Boost, Clang] -

i want mitsuba working on mac, manage compile , got error @ runtime. tried manage generate simple test, show bug : #include <boost/filesystem/operations.hpp> #include <iostream> namespace fs = boost::filesystem; int main(int argc, char*argv[]) { fs::path test = fs::canonical("/users/stephane-lb/projects/"); return 0; } if compile using following command, working clang++ boosttest.cpp -lboost_filesystem -lboost_system but if use: clang++ boosttest.cpp -lboost_filesystem -lboost_system -stdlib=libstdc++ i think happening because boost compiled using homebrew using libc++ , want use libstdc++. there ways make these 2 working ? thank help, stephane-lb

windows - What is causing g++ to produce the error: "ld.exe cannot find -lopencv_world310"? -

i attempting build application using g++ composed of several source files , uses opencv 3.1.0. the cmd command is: g++ -o home_surveillance -static -std=c++11 -m64 -ic:\tools\opencv\opencv\build\include -lc:\tools\opencv\opencv\build\x64\vc14\lib -lopencv_world310 configuration_manager.cpp events.cpp image_processor.cpp main.cpp response_module.cpp scheduler.cpp the error produced is: c:/program files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lopencv_world310 collect2.exe: error: ld returned 1 exit status i have been trying various things , searching answers couple days now. should note application builds in visual studio 2015. have tried compiling source files using g++ -c option , seem compile fine. linking phase produces error. things have tried: just every possible combination of specified command. (modifying order of options, -lopencv_world310.a, -lopencv_wo...

c# - Prevent multiple transfer operations with Azure Storage Data Movement Library -

i started use azure storage data movement library (dml) having code similar public dml sample code . use case (incrementally) sync local directory blob storage several times while files in directory updated time time. uploaddirectoryoptions options = new uploaddirectoryoptions { searchpattern = "*.*", recursive = false, blobtype = blobtype.blockblob }; // register transfer event. directorytransfercontext context = new directorytransfercontext(); //only copy newer files - similar azcopy /xo /xn switches //https://github.com/azure/azure-storage-net-data-movement/issues/12 context.shouldoverwritecallback = (source, destination) => { var sourcefile = new fileinfo((string)source); var destblob = destination cloudblob; return sourcefile.lastwritetimeutc > destblob.properties.lastmodified; }; // start upload var transferstatus = await transfermanager.uploaddirectoryasync(sourcedirpath, destdir, options, context); currently transfer operatio...

symfony - Warning: spl_object_hash() expects parameter 1 to be object, string given -

i have issues "warning: spl_object_hash() expects parameter 1 object, string given" when try save onetomay entity side of relationship, code below may give ideas: <?php namespace backendbundle\entity; use doctrine\common\collections\arraycollection; use doctrine\orm\mapping orm; /** * bulletinsalaire * * @orm\table(name="bulletin_salaire") * @orm\entity(repositoryclass="backendbundle\repository\bulletinsalairerepository") */ class bulletinsalaire { /** * @var int * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ private $id; /** * @var \datetime * * @orm\column(name="periode", type="date") */ private $periode; /** * @var string * * @orm\column(name="mode_reglement", type="string", length=255) */ private $modereglement; /** ...

c# - Cell Values Incorrect - OpenXML Excel -

Image
i trying read excel values in .xlsm - code below. problem i'm having values displayed wrong, nothing @ similar. using (spreadsheetdocument spreadsheetdocument = spreadsheetdocument.open(filename, false)) { workbookpart workbookpart = spreadsheetdocument.workbookpart; sheet sheet = workbookpart.workbook.sheets.elements<sheet>().first(s => s.name.hasvalue && s.name.value == "y1 dose history"); worksheetpart worksheetpart = (worksheetpart)workbookpart.getpartbyid(sheet.id); //sheetdata data = worksheetpart.worksheet.elements<sheetdata>().first(); neither line nor next work sheetdata data = worksheetpart.worksheet.getfirstchild<sheetdata>(); string text; foreach (row row in data.elements<row>()) { text = null; foreach (cell cell in row.elements<cell>()) { if (...

Python read .txt-files header -

i need read information txt file header looks this: date 20160122 sp number 8 gauge 250n internal total height 61 sp modell sp2 corner distance 150 height value comment 60 nan ... i have python program program doing this: depth, n = npy.loadtxt(filename, skiprows=8, unpack=true, usecols = usecols) however read out of values header. there way this? interested value of "total height". on search seem find answers concerning .csv files. i use open rather npy.loadtxt with open(filename, 'r') the_file: all_data = [line.strip() line in the_file.readlines()] height_line = all_data[3] data = all_data[8:] then can parse value of height_line , total height. , data file in variable data .

java - Binding embedded List of objects on a Thymeleaf template for a POST request -

i developing grocery store list web application. 1 feature should (un)checking found/bought items on list. displaying values works fine. when check checkboxes on bought items , try post afterwards incomming @modelattribute in spring mvc controller null (except id). i hope can me. here classes: public class purchaselist { private long id; private list<purchaseitem> purchaseitemlist; private datetime purchasedate; private boolean done; } public class purchaseitem { private long id; private string purchaseitemname; private purchasecategory purchasecategory; private purchaselist purchaselist; private boolean found; } the controller: @requestmapping(value="/{id}", method=requestmethod.post) public string postpurchaselist(@pathvariable(value="id") long id, @modelattribute("purchaselist") purchaselist purchaselist, model model) { list<purchaselist> notdonepurchaselist = purchaselistservice.getnotdonepurchaselist(); model.addat...

c++ - Matrix input and interpretation of the Input -

i have short question initialization don't understand. code: i'm looking pairs , vector "vector temp" saves places loop found pair. after temp filled values check pairs found. made 2 loops loop through vector. outer loop , inner loop j. temp stores j value pair found. question, code bool repeat = 1; vector<double>::iterator rep_check; rep_check = find(repeat_check.begin(), repeat_check.end(), d_in[i]); if( rep_check == repeat_check.end() ) repeat = 0; repeat_check.push_back(d_in[i]); if(!repeat) out.push_back(temp); else out.push_back(vector<int> (1,temp[0])); this part still in loop!!!!! dont understand last part: 'vector (1,temp[0])'. gets pushed output matrix (2x2 matrix), dont understand syntax here. how have interpret last part? what doing here pushing vector<int> in container (i guess vector) named out . constructor call vector<int> (1,temp[0]) , says want construct vector<int...

sql - Unexpected behavior in FIRST_VALUE() with IGNORE NULLS (Vertica) -

i'm seeing unexpected behavior in vertica's first_value() analytic function ignore nulls parameter. appears return null when shouldn't. the issue occurs in tiny table: drop table if exists temp; create table temp (time_ timestamp(6), name varchar(10)); insert temp (time_) values ('2016-03-18 20:32:16.144'); insert temp (time_, name) values ('2016-03-18 20:52:09.062', 'abc'); here contents of table (select * temp): time_ | name ------------------------+-------- 2016-03-18 20:32:16.144 | <null> 2016-03-18 20:52:09.062 | abc here query i'm running: select time_, first_value(name ignore nulls) on (order time_) first_name temp; here results query returns: time_ | first_name ------------------------+------------ 2016-03-18 20:32:16.144 | <null> 2016-03-18 20:52:09.062 | abc here results expect (and desire) query: time_ | first_name ------------------------+-----...

amazon web services - Please explain the advantages of using AWS CodeDeploy over cloud-init -

i've completed continuous deployment proof of concept , i'm still unable see advantages of using codedeploy deploy new code instances within autoscaling group instead of using script runs when new instance launched using launch config. i'm sure there more features of codedeploy go beyond deploying latest version of code in s3 bucket, i'm unable find them in documentation or on 'net. does have further information or insight on this?

Visual Studio SQL Server Insert Statement -

this trigger. first 2 update statements work but, update student not work. "update student set pointsaccumulated = pointsaccumulated + @points @studentid = studentid" create trigger [trigger] on [dbo].[attendance] after insert begin declare @eventid int declare @studentid nchar declare @points int select @eventid=eventid inserted select @eventid = eventid, @points = points event select @studentid = studentid inserted update event set attendance = attendance + 1 @eventid = eventid update attendance set points = @points @eventid = eventid update student set pointsaccumulated = pointsaccumulated + @points @studentid = studentid the solution worked me hlgem : update e set attendance = attendance + 1 event e join inserted on i.eventid = e.eventid update set points = e.points attendance join event e on a.eventid = e.eventid join inserted on i.event...