Posts

Showing posts from April, 2010

ruby - Raise Undefined local variable or method -

ok understand local variable , global variable, got exercise 40 on learnrubythehardway credit ask each method on hash. $cities = {"ca" => "san francisco", "mi" => "detroit", "fl" => "jacksonville"} #adding new kay new value $cities["ny"] = "new york" $cities["or"] = "portland" def loop(map,state) $cities.each |map,state| if map.include? state return map[state] else return "not found." end end end $cities[:find] = method(:loop) while true print "state? (enter quit) " state = gets.chomp break if state.empty? #this line important ever! study! puts $cities[:find].call(cities,state) end the error giving me undefined local variable or method 'cities' anyway understand local variable can access in main file, when comes g

php - search on table,real time -

i have below table: <input type="search" class="light-table-filter" id="search" data- table="order-table" placeholder="kerko"> <table border="0" class=" table table-striped table-hover table-bordered table-condensed tabledemo bordered order-table table" > <tr id="header"> <th>id</th> <th>emri</th> <th>mbiemri</th> <th>username</th> <th>password</th> <th>email</th> <th>nr tel</th> <th>action</th> </tr> <?php if(count($records)){ $i = 1; $eachrecord= 0; foreach($records $key=>$eachrecord){ ?> <tr id="<?=$eachrecord['id'];?>"> <td><?=$eachrecord['id'];?></td> <td class="emri"><?=$eachrec

osx - Bash glob pattern behaviour different between terminal and shell script -

i have glob pattern {,**/}*.* recursing through files in current directory plus children. in terminal if run echo {,**/}*.* outputs of files in current directory plus nested directories. when run shell script contains line 1 directory deep. i understand terminal has different behaviour shell : adding shopt -s extglob made no difference. #!/bin/bash shopt -s extglob echo {,**/}*.* i on macosx bash 4 terminal , shopt -s globstar enabled. thanks @aserre , @anubhava, indeed combination of bash path , making sure globstar enabled (for macosx). full script is: #!/usr/local/bin/bash shopt -s globstar echo {,**/}*.* and yes ./** suffice wasn't problem :)

javascript - Bounding the d3.js force directed graph -

i have forced directed graph big , hence trying bound it. below of massive json data var iddata = json.stringify([ ["1000000000039214051", "1000000000336563307", "customer", "customer", "2016-06-21 01:32:42", "2016-06-21 02:39:45", 155.4492950439453, 5], ["1000000000039214051", "10000000682705", "customer", "agent", "2016-08-16 23:12:24", "2016-08-17 05:08:22", 171.84144592285156, 4], ["04144221227", "1000000000060220197", "phone", "customer", "2016-01-04 03:41:13", "2016-01-05 01:54:03", 264.75457763671875, 5], ["10000000490503", "1000000000060220197", "agent", "customer", "2016-10-21 03:39:50", "2016-10-21 06:59:41", 26.845823287963867, 5], ["1000000000218556629", "600169462257", "customer", "ph

node.js - Upserting element of array in a timeseries array -

i'm following schema design document mongodb @ https://www.mongodb.com/blog/post/schema-design-for-time-series-data-in-mongodb for time series model: { timestamp_hour: isodate("2013-10-10t23:00:00.000z"), type: “memory_used”, values: { 0: { 0: 999999, 1: 999999, …, 59: 1000000 }, 1: { 0: 2000000, 1: 2000000, …, 59: 1000000 }, …, 58: { 0: 1600000, 1: 1200000, …, 59: 1100000 }, 59: { 0: 1300000, 1: 1400000, …, 59: 1500000 } } } the tutorial uses $set change values: db.metrics.update( { timestamp_hour: isodate("2013-10-10t23:00:00.000z"), type: “memory_used” }, {$set: {“values.59.59”: 2000000 } } ) in practice, values added @ interval, this: { timestamp_hour: isodate("2013-10-10t23:00:00.000z"), type: “memory_used”, values: { 0: { 0: 999999, 1: 999999, …, 59: 1000000 }, 1: { 0: 2000000, 1: 2000000, 2: 1900000 } } } the question have when trying insert "values.1.3:2000000&qu

Electron-Osx-Sign is breaking my app -

when run electron-osx-sign app no longer opens. can see in dock tries open split second, closes no error or warning. have how signing or entitlements? cli: sudo electron-osx-sign app.app --provisioning-profile=my.provisionprofile --entitlements=parent.plist --entitlements-inherit=child.plist entitlements patent: > <?xml version="1.0" encoding="utf-8"?> <!doctype plist public > "-//apple//dtd plist 1.0//en" > "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist > version="1.0"> <dict> > <key>com.apple.security.app-sandbox</key> > <true/> > <key>com.apple.security.application-groups</key> > <string>"my team id here".com.site.app</string> </dict> </plist> child: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en

javascript - Active class dynamic in bootstrap tabs -

i cant seem active class change corresponding item selected (see code bellow) so active class change depending on thumbnail selected. html <h2 class="">title</h2> <div class="row text-center advice-bar" id="mytab"> <div class="col-md-3 overlord-thumbnail"> <div class="thumbnail thumbnail-yellow active"> <a href="#tab1" data-toggle="tab"> <img src="<?php bloginfo('url'); ?>/wp-content/uploads/2017/01/antenna.svg"> </a> </div> <h3>one</h3> <p>text</p> </div> <div class="col-md-3 overlord-thumbnail"> <div class=" thumbnail thumbnail-blue"> <a href="#tab2" data-toggle="tab">

python 2.7 - Text wrap with box in Basemap -

i'd write text on world map pointing several locations. text written each location short, few lines, 1 or 2 words/numbers (i.e earthquake magnitude, location, date). there pythonic way perform this? since matplotlib-basemap based on matplotlib , can use plt.text(x,y,'yourtext') to write text onto map. if want have boxed, add like: plt.text(x,y,'yourtext',bbox={'pad':10}) see http://matplotlib.org/users/text_intro.html .

jquery - Alert sum result based on row and class -

i'm trying sum text value inside table. here try $(document).on("change", ".kd1", function() { var sum = 0; $('.kd1').each(function() { sum += number($( ).closest('.kd1').val()); }) alert(sum); }); <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <table> <tr> <td><input type="text" class="kd1"></td> <td><input type="text" class="kd1"></td> </tr> <tr> <td><input type="text" class="kd1"></td> <td><input type="text" class="kd1"></td> </tr> </table> for now, i'm able alert it. but result total of each tr want separate result each row. how can achieve ? in advance sorry bad english. it not seem user-friendly present sums in

javascript - What is stopping my JS from getting my URL Hash? -

so trying add class on element, after hyperlinking separate page. have link on page1 set this: <a href="https://jsfiddle.net/mv7nneu4/2#redbox">go redbox</a> and on page2 running function: $(function() { var id = window.location.hash; $(id).addclass('expanded'); }); this div should affecting: <div id="redbox" class="red"> hajkldjfs </div> which, should grabbing hash, adding class expanded element. class never gets appended , console has no errors. here 2 js fiddle links created simulate this: page1 page2 appreciate help! your selector wrong. change $('#' + id).addclass('expanded');

c# - Is there no app tracing in mono? -

here project structure: . |-- app.config |-- bin | `-- debug |-- nlog.config |-- nlog.xsd |-- obj | `-- debug |-- packages.config |-- program.cs |-- properties | `-- assemblyinfo.cs |-- serviceclient.csproj `-- web references `-- testsvc |-- reference.cs |-- reference.map |-- testservice.disco `-- testservice.wsdl 7 directories, 14 files i've manually compiled project using below mcs command: mcs -d:trace -d:debug -r:system.web.services.dll -out:./bin/debug/serviceclient.exe web\ references/testsvc/reference.cs program.cs i've copied app.config target folder serviceclient.exe.config heres configuration looks like: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.diagnostics> <sharedlisteners> <add name="console" type="system.diagnostics.consoletracelistener"/> <add name="nlog" type="nlog.nlogtraceli

c++ - extern const default constructed object -

here code #include <iostream> using namespace std; class q { public: q() { cout << "constructor" << endl; } }; extern const q t/*()*/; //a const q s/*()*/; //b int main() { const q t/*()*/; } i expect line marked "a" mean creating object t of type q linkage external, , fields can't modified. creation done constructor no arguments, have provided. in main, expect local t object of type q created in same way, though linkage file, , in fact, scope , duration main. c++ allows me put or not put parenthesis in const q t/ () /; in main. in global scope, in line can put or not put parentheses, , constructor not called either way. in line b, allowed not put parenthesis since otherwise, compiler confused if defining function prototype. my questions are: why allowed flexibility put () or not in line //a, considering in line //b flexibility not exist? regardless of choice in 1., find "constructor" not printed line

c++ - Resizing the Input Panel in Windows Mobile 6.5 -

i've created soft input panel running in windows mobile 6.5. problem is, de bitmap showing keys bigger standard keyboard of wm6.5, need resize window of sip, should cover half screen. my sip works implementation class , window class, implementation class contains inherited methods of iinputpanel in c++ , creates window sip. window created following code: this->m_psipwnd->createex(0, etssip_wndclass, null, ws_child | ws_visible, 0, 0, (rc.right - rc.left), (rc.bottom - rc.top), this->m_hwndparent, (hmenu)null, 0); where rc client rect , m_hwndparent hwnd sent along select method of iinputpanel. if set size manually 250 e.g., new created sip window has size of standard sip in wm6.5. i've set registry key hkcu\controlpanel\sip\dragstyle 0x01, sip displayed title bar , draggable on screen, try, size keeps same. is there possibilty change size of sip window, if yes, in method should done? answers

shell - Count lines following a pattern from file -

for example have file test.json contains series of line containing: header{...} body{...} other text (as others) empty lines i wanted run script returns following counted started on : test.json - headers : 4 - body : 5 - <others> counted finished : <time elapsed> what got far this. count_file() { echo "counted started on : $1" #todo loop cat $1 | grep header | wc -l cat $1 | grep body | wc -l #others echo "counted finished : " #todo timeelapsed } edit: edit question , added code snippet perl on command line perl -e '$match=$argv[1];open(input, "<", $argv[0]);while(<input>){ ++$n if /$match/g } $match," ",$n;' your-file your-pattern for me perl -e '$match=$argv[1];open(input, "<", $argv[0]);while(<input>){ ++$n if /$match/g } $match," ",$n;' parsing_command_line.pl my it counts how many number of pattern my are, in s

How can I make the Views defined in Android XML customs view file visible -

Image
i've below code, having 1 element shown in xml file below it, , call of custom view named card package tk.zillion.app1; import tk.zillion.app1.customviews.card; public class emptyactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_empty); relativelayout rl; rl = (relativelayout) findviewbyid(r.id.activity_empty); rl.addview(new card(this)); } } below xml file, , how layout appear in android studio: the card custom view below code , xml file: package tk.zillion.app1.customviews; import tk.zillion.app1.r; public class card extends relativelayout { public card(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); init(context); } public card(context context, attributeset attrs){ super(context, attrs); init(context); } publi

remote: GitLab: You are not allowed to push code to protected branches on this project -

i trying push master branch of repo , failing so, since protected. tried project settings , not see option protected branches. option see members. remote: gitlab: not allowed push code protected branches on project. git@gitlab.ins.risk.regn.net:cmd/release.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed push refs 'git@gitlab.ins.risk.regn.net:cmd/release.git' my repo has 1 branch, no contents in far. see protected branches options of other repos not specific one. new repo no contents , default branch. have master permission. unfortunately not able upload image here somehow. please suggest how push code master branch. with no contents in far that means there no master branch protect yet, because empty repo not has one. to "enable/disable branch protection" , need master or owner of gitlab project (which are). make sure: your first push git push -u origin master ; the remote origin referen

if statement - Javascript: Reduce cyclomatic complexity -

function(response) { if (response.bmap && seltype === 'q') { setdefaultqq(response.bmap); } else if (response.bmap && seltype === 'a') { setdefaultaa(response.bmap); } else if (response.bmap && seltype === 'o') { setdefaultoo(response.bmap); } else if (response.mmap && seltype === 'm') { setdefaultmm(response.mmap); } else if (response.bmap && seltype === 'p') { setdefaultpp(response.bmap); } else if (response.emap && seltype === 'e') { setdefaultee(response.emap); } else { setdefaultdata(); showmodal(); } } is there way reduce conditional statement shorter form , better readability could use object map seltype specific methods var methods = { 'a': setdefaultqq, 'o': setdefaultoo, 'm': setdefaultmm, .... } if(response.bmap && methods[seltype]){ methods[

drawing - Transform a view by dragging its edge (Swift) -

i try make app user can draw or add arrow, , transform arrow (translate, rotate, ...). moment, manage draw arrow , make transformations on it, able modify arrow dragging edges. to draw arrow, create uiview height of 20px (it thickness of arrow), , width of 400 (length of arrow). func drawarrow(frame: cgrect) { let thicknessarrow = 20 let viewhorizontalarrow = uiview() viewhorizontalarrow.frame.origin = cgpoint(x: 100, y: 600) viewhorizontalarrow.frame.size = cgsize(width: 400, height: thicknessarrow) drawdoublearrow(viewhorizontalarrow, startpoint: cgpoint(x: 0, y: thicknessviewwitharrow/2), endpoint: cgpoint(x: viewhorizontalarrow.frame.width, y: thicknessviewwitharrow/2), linewidth: 10, color: uicolor.blackcolor()) } after that, transform uiview pan, pinch , rotate gesture. the function "drawdoublearrow" create arrow bezierpath , add layer of uiview. i hope these explanations clear enough :). could me find solution ? thanks !

How to manually decode an an array in swift 4 Codable? -

here code. not know set value to. has done manually because real structure more complex example. any please? struct something: decodable { value: [int] enum codingkeys: string, codingkeys { case value } init (from decoder :decoder) { let container = try decoder.container(keyedby: codingkeys.self) value = ??? // < --- put here? } } your code doesn't compile due few mistakes / typos. to decode array of int write struct something: decodable { var value: [int] enum codingkeys: string, codingkey { case value } init (from decoder :decoder) throws { let container = try decoder.container(keyedby: codingkeys.self) value = try container.decode([int].self, forkey: .value) } }

osx - Making SDL2 app portable on OS X -

some background: consider understanding of c++ quite strong, total beginner graphics, sdl2, , static linking, i'm not sure if understanding of problem i'm having quite accurate. goal learn opengl (i'm following tutorial @ https://open.gl.com ) , sdl , i'd make simple application portable on recent versions of os x utilizes sdl2 + opengl. i first installed sdl2 on mac os x sierra downloading .dmg this link, mac os x. in dmg installer ui placed library /library/frameworks/ directed. compile program following: g++ test.cpp -i/library/frameworks/sdl2.framework/headers -framework sdl2 ...however gross errors when trying run resulting binary on mac without sdl2 installed in way. makes sense. read needed statically link sdl2 library resulting binary make application more portable, i.e., working on os x without user having install extra. seemed i’d need perform static linking @ compile time happen , every example found used sdl2-config in form or in invocation of g

c++ - Is it possible to draw a colored rectangle on a pushButton? -

Image
i want after choosing color qcolordialog put rectangle (as preview) on pushbutton , change color color have chosen. the pushbutton before choosing color: the pushbutton after choosing color: is possible draw colored rectangle on pushbutton, , how can (an example)? create custom class derived of qpushbutton, example: pushbutton.h #ifndef pushbutton_h #define pushbutton_h #include <qpushbutton> class pushbutton : public qpushbutton { public: pushbutton(qwidget*parent=0); protected: void paintevent(qpaintevent *event); }; #endif // pushbutton_h pushbutton.cpp #include "pushbutton.h" #include <qpainter> pushbutton::pushbutton(qwidget *parent):qpushbutton(parent) { } void pushbutton::paintevent(qpaintevent *event) { qpushbutton::paintevent(event); qrect r(0, 0, width()/3, height()); r.moveto(rect().center()-r.center()); qpainter painter(this); painter.setbrush(qt::red); painter.drawrect(r); }

javascript - when touch move out of the page the iscorll list can not bounce back in webview of ios -

iscroll works in webview of android,but not ios. can reproduce by: 1. open page in webview ,and not full screen; 2.scroll top or bottom of list; 2.keep touching move finger inside of page 3.stop on zone of native app,such header or footer of native webview 4.take off hand list can not detect end of touching , not bounce back. works in browser,like safari , chrome. me pls.my project runnning online x_x

javascript - Hide x-Axis from angularjs-chartjs -

i using angularjs-chartjs display charts. how can hide x-axis without setting labels : ["", "", ""] i wish hide them needing use them inside tooltiptemplate vm.att = { labels: avglabels, datasets: [ { label: "average response time", fillcolor: colors.byname('warning'), strokecolor: colors.byname('warning'), highlightfill: colors.byname('warning'), highlightstroke: colors.byname('warning'), data: avgtest }, ] }; vm.baroptions = { scalelabel: "<%=value%>" + ' ' + 'ms', scalebeginatzero: true, scaleshowgridlines: false, scalegridlinecolor: 'rgba(0,0,0,.05)', scalegridlinewidth: 1, barshowstroke: true,

javascript - Need to store Objects, so that on refresh, the object should be available in angularJS? -

i have service implemented. , i'm creating 2 objects. after refresh values becoming null. how should store these objects, can access them after refresh also. var userpool = new awscognito.cognitoidentityserviceprovider.cognitouserpool(xyz); var cognitouser = awscognito.authenticate(userpool); this implemented in service, run once. need store these objects, can access them after refresh. for data persistence within app, services should used. for data persistence within browser, localstorage should used. read localstorage: https://developer.mozilla.org/en/docs/web/api/window/localstorage an angular library localstorage: https://npmjs.com/package/angular-local-storage

c++ - Which "value" has an un-init value? -

i've code : double val1; double val2 = 0.0; if(val1 != val2) { cout << "different: " << val1 << " | " << val2 << endl; } which enter if-statement . think val1 doesn't 0.0 default (i.e. null). value so? thought 0.0 default... local non-static variables not initialized have indeterminate value, , seemingly random. you should not use uninitialized local variables leads undefined behavior .

php - How to get mysqli error in different environments? -

in local/dev environment, mysqli query performing ok . however, when upload on webhost environment, got error; fatal error: call member function bind_param() on non-object in... here code: global $mysqli; $stmt = $mysqli->prepare("select id, description tbl_page_answer_category cur_own_id = ?"); $stmt->bind_param('i', $cur_id); $stmt->execute(); $stmt->bind_result($uid, $desc); to check query, tried execute query via control panel phpmyadmin , result ok . if there lacking information, please tell me can provide. first of all, have line before mysqli connect in all environments: mysqli_report(mysqli_report_error | mysqli_report_strict); after mysql errors transferred php exceptions. uncaught exception, in turn, makes php fatal error. thus, in case of mysql error, you'll conventional php error, instantly make aware of error cause. stack trace lead exact spot error occurred. note have able see php errors in general . ,

ruby on rails - RabbitMq(bunny): Rabbitmq deleting message from queue . acknowledgement not working -

i processing records rabbitmq. in order avoid loss of messages rabbitmq using rabbitmq acknowledgment strategey. testing purpose have raises exception before code gave acknowledgment rabbitmq. per code have written rabbitmq should not delete message queue untile line in code i.e "c.ack(delivery_info.delivery_tag)" executed. below code begin messageservice.with_channel |c| queue = c.queue(queue_name, :durable => true) exchange = c.topic(topic_name, :durable => true) queue.bind(exchange, :routing_key => "#{routing_key_prefix}.#") available_messages = queue.message_count processed_messages = 0 fact_object = {} while queue.message_count > 0 && processed_messages <= message_limit queue.pop(:manual_ack => true) |delivery_info, properties, payload| rad_exam_hash_object = json.parse(payload) entity_manager,criteria = self.query_revenue_cost_calculation(rad_exam_hash_object) fact_object = self.revenue_cost

java - Coloring occasional lines in full XML Structure and show in HTML -

my first question marked duplicated, isn't duplicate show xml in html inline stylesheet i hope question not immediatley marked duplicate, because 1 of moderators has read first 2 sentences and've ignored rest. the problem not show xml structure in html, rather show full dynamically xml structure, tags , occasional colored lines. structure , interior fields full dynamically , every field can correct or wrong, depending on xml file compare. field @ first comparison correct, on comparison it’s wrong. fields , structure of xml can vary 1 comparison another. i’m looking since yesterday corresponding , professional solution problem. background process: comparison different xml files, via soa microservices in java. comparison made org.custommonkey.xmlunit. result have html popup, shows me differences marked colored lines. example output xunit diff result xpath /root[1]/matdetail[1]/output[1]/general[1]/changed_by[1]/text()[1] transform source xml via xslt , xunit dif

php - Passing variable from button to controller Laravel -

i having little routing problem in laravel 5.2. have result page shows detailed information personnel. button, when enabled, generates pdf page. passing variables has been problem close now! public code elaborate. result page <form action="generatepdfpage" method="get"> <button type="submit" class="btn btn-default">generate pdf!</button> </form> routes.php route::get('/dashboard/result/generatepdfpage', 'resultcontroller@generatepdfc'); generatepdfc controller public function generatepdfc(){ $id_array_implode = "hallo"; $pdf= pdf::loadview('generatepdf', ["test"=>$id_array_implode])->setpaper('a4', 'landscape'); return $pdf->stream('invoice.pdf'); } so, on result page using array ($id_array) search database matching records. need pass variable onto generatepdfc controller, can pass a

Backing up specific folders to Azure Blob Storage using Duplicity -

i have ubuntu 16.04 vm running on microsoft azure. have azure storage account. trying use duplicity backup folder ubuntu subfolder under azure container. i using following command: /usr/bin/duplicity -v4 --volsize=25 --log-file=/home/<<user_name>>/duplicity-test/logs/duplicity-log.log --full-if-older-than 30d --asynchronous-upload /home/<<user_name>>/duplicity-test/alf_data azure://bart-test-2/alf_data this fails error message: could not create azure container: requested uri not represent resource on server. however, there no error if don't specify subfolder on azure url, below: /usr/bin/duplicity -v4 --volsize=25 --log-file=/home/<<user_name>>/duplicity-test/logs/duplicity-log.log --full-if-older-than 30d --asynchronous-upload /home/<<user_name>>/duplicity-test/alf_data azure://bart-test-2 but in latter case, duplicity puts file in root folder of azure container, , not in subfolder want to. is there way make dup

wso2 - How to pass basic auth header to SOAP endpoint from WS02 Api Manager? -

i using api manager 2.0, have designed new api , production url end point of web service. in api have added " message mediation policies " convert json soap in request , convert soap json in request. works fine when there no authentication. when tried connect endpoint authenticated using basic unable send auth header. possible pass , if how achieve it? i have tried endpoint security schema , no success that. if configure endpoint security scheme properly, should see authorization property below, in api file, in repository/deployment/server/synapse-configs/default/api/ directory. double check if it's there. <resource methods="get" url-mapping="/menu" faultsequence="fault"> <insequence> <property name="api.ut.backendrequesttime" expression="get-property('system_time')"/> <filter source="$ctx:am_key_type" regex="pro

Using C# dll (built with Microsoft.bcl) in interop(C++ managed) project -

Image
we've c# dll in .net4.0 built using using microsoft.bcl, microsoft.bcl.async, microsoft.bcl.build, microsoft.net.http. these libs got nuget. we've reasons not move .net4.5 want use async, await these bcl libs. works fine in c# projects, couldnt add dll in our c++ interop projects, error: we error when try add reference project. even though clr interop project in .net4.0 , dll adding in .net4.0 end getting error. there way resolve this? error in text format: --------------------------- microsoft visual studio --------------------------- not add reference to: c:\xxx\xxx\xx\xxxhelper.dll 1 of following reasons: - targets higher version of .net framework - not .net assembly - not registered activex control --------------------------- ok --------------------------- code reproduce issue: https://dl.dropboxusercontent.com/u/1967630/bcl_problem/oauth2_sdk_consumer_dll/bcl_problem_projects.zipx i repro, sure looks bug. judging error message

c# - ItemsControl do not update itself when ObservableCollection fires CollectionChanged -

i've read lot of answers of question, contains "you missed inotifypropertychanged". use mvvm light implementation of viewmodelbase, observableobject etc. view: <window x:class="baseflyingfigure.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:baseflyingfigure" xmlns:helpers="clr-namespace:baseflyingfigure.helpers" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:cmd="clr-namespace:galasoft.mvvmlight.command;assembly=galasoft.mvvmlight.platform" xmlns:system="clr-namespace:system;assembly=mscorlib" mc:ignorable="d" title="mainwindow" hei

sapui5 - Formatter include third party moment.js -

i have problem use third party library moment.js in our formatter. formatter.js working way: sap.ui.define([], function() { "use strict"; return { moment: jquery.sap.require("name.de.tbase1.model.moment"), this don't: sap.ui.define([ "name/de/tbase1/model/moment" ], function(moment) { "use strict"; return { moment: moment if use second option, lib loaded fine, error: sinon.js:175 uncaught typeerror: fake xhr onreadystatechange handler threw exception: moment not function any ideas? this solved problem. sap.ui.define([ "name/de/tbase1/model/moment" ], function(moment) { "use strict"; return { moment: moment,

curl - WSO2 Update swagger published API -

i trying update swagger of published api curl: curl -x post -b cookies "http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag" -d 'action=updateapi&name=datumvalidatie&provider=admin&version=1.0.0&visibility=public&thumburl=&description=test&tags=validation&endpointtype=nonsecured&tierscollection=gold,bronze&http_checked=http&https_checked=https' -d 'endpoint_config={"production_endpoints":{"url":"https://www.test.com/datumvalidatiewebapi/api","config":null},"endpoint_type":"http"}' -d 'swagger={"basepath" : "/datumvalidatiewebapi", "paths" : {"/perioden/ingangsdatum" : {"get": {"summary" : "test", "x-auth-type": "application \u0026 application user", "deprecated" : false, "produces" : ["application/json", "text/j

html - Missing values in shorthand property -

quoting css 2.2 spec : when values omitted shorthand form, each "missing" property assigned initial value (see section on the cascade ). but how browsers know value matches property? example, following code taken a complete guide flexbox : .header, .main, .nav, .aside, .footer { flex: 1 100%; } what mean? equivalent .header, .main, .nav, .aside, .footer { flex-grow: 1; flex-shrink: initial; flex-basis: 100%; } or .header, .main, .nav, .aside, .footer { flex-grow: 1; flex-shrink: 100%; flex-basis: initial; } or else? the flexible box layout module specification defines how shorthand property should handled in the 'flex' shorthand section : value: none | [ <‘flex-grow’> <‘flex-shrink’>? || <‘flex-basis’> ] using css values , units specificaiton (which defines | , ? , || symbols in above statement mean, can see value should either: be none be <flex grow> (and optionally <flex-shrink

java - One XSD for both whole document and fragment? -

i wish create grammar able validate both full xml document , fragment of it. i have set of documents aggregate in “batch”. each document has set of meta-data: <batch> <document> <metadata1 /> <metadata2 /> <metadata3 /> </document> <document> <metadata1 /> <metadata2 /> <metadata3 /> </document> </batch> my springbatch process splits batch in documents (with staxeventitemreader ) wish validate sub xml representing single document: <document> <metadata1 /> <metadata2 /> <metadata3 /> </document> i read here can’t use partial xsd validate xml. however, is there way, while avoiding duplication , validate 2 xsds, 1 validate fragment, , other validate batch? you can achieve goal single xsd specifying multiple possible root elements: <?xml version="1.0" encoding="utf-8&q

Generating Haskell source files in cabal packaging -

i have package of .hs files generated spec files haskell processor (stored in subdirectory). at present preprocessor run manually, , not work particularly version control or when used part of larger stack. i cabal run processor, example setup.hs, package can built using cabal build or stack part of larger project without needing separate manual steps. the input files not 1-1 output .hs files: instead, pile of .csv files read in, , differently arranged pile of .hs files output. think means can't use cabal's preprocessor support. for present development purposes have bodged call stack build && stack exec gen-exe @ start of setup.hs. runs many times (for example runs on register @ end of build; , not enough (for example, not run if 1 of input .csv files changes, manual clean necessary). is achieveable in cabal, , if so, need put run build commands enough , not frequently? (this inherited package... please don't blame me)

c# - resolving complex entity model to flat model view using AutoMapper -

i want create map complex entity model flattened view model my entity model so cbitems has many cbitemscontent has many cbregulators so viewmodels so for cbitems: public class itemviewmodel { public itemviewmodel() { this.cbitemscontents = new hashset<itemcontentviewmodel>(); } public int itemid { get; set; } ...... public virtual icollection<itemcontentviewmodel> cbitemscontents { get; set; } } } for cbitemscontent: public class itemcontentviewmodel { public int itemcontentid { get; set; } public int itemid { get; set; } .... public itemcontentregulatorsviewmodel regulatedby { get; set; } } } for cbregulators: public class itemcontentregulatorsviewmodel { public int itemcontentid { get; set; } public ienumerable<int> regulatorids { get; set; } } } i had hoped easy this: config.createmap<

html - Change the Text Position of the Collapsible Header (Jquery Mobile Collapsible) -

i creating website mobile devices using jquerymobile. have simple collapsible looks this: <div data-role="collapsible"> <h3>section</h3> <p>i content how you?</p> </div> i managed change height of header after changing text of header no longer align collapsible icon. is there way change headertext position horizontally aligns icon? because can change position vertically using text-align: center here fiddle have tried far. you can use line-height property center headline text vertically: .ui-collapsible-inset .ui-collapsible-heading .ui-btn { line-height: 10vh; } if set line-height of element same elements height, text vertically centered. in specific case solution, because have 1 line of text (one word). .ui-collapsible .ui-btn { height: 10vh !important; } .ui-collapsible-inset .ui-collapsible-heading .ui-btn { color: red !important; /*margin-top:100px !important;*/ line-height: 1

php - Facebook sdk not returning approved data -

Image
i have user_birthday approved when try query don't in results array. try { $response = $fb->get('/me?fields=birthday,name', \session::get('fb_user_access_token')); } catch (facebooksdkexception $e) { \log::critical('error'); abort(403, 'bad request'); } $facebookuser = $response->getgraphuser(); dd($facebookuser->asarray()); i see user id , user name. same thing when try receive user photos getgraphedge. empty array.

exchangewebservices - Cannot change callback URL for EWS push subscriptions -

i'm subscribing via push several exchange servers. works nicely, when subscribing multiple times, long callback url of first push request used. trying subscribe using other url results in utter silence ews system i've tried, if i've explicitly unsubscribed , can confirm i'm getting no more push events. since i've seen multiple exchange servers acting way guess might somehow intended behavior. i'm using “exchangeservice.subscribetopushnotifications” method 2010 api documented here: https://msdn.microsoft.com/de-de/library/dd636171(v=exchg.80).aspx does have knowledge kind of behavior or idea how can create new push subscription other url first ever subscribed to? many in advance.

Loop Adding BigInteger java -

this question has answer here: java: how use biginteger? 9 answers i've got array of bigintegers, , want add them 1 biginteger. i've used method.add(), reason, sum remains 0. biginteger[] numbers = { new biginteger("20849603980134001723930671666823555245252804609722"), . . . new biginteger("53503534226472524250874054075591789781264330331690") }; biginteger sum = new biginteger("0"); for(int = 0; < numbers.length; i++) { sum.add(numbers[i]); system.out.println(numbers[i]); system.out.println(sum); } system.out.println(sum); thank help! biginteger immutable - calling sum.add(...) nothing sum returns new biginteger . so need change code to: sum = sum.add(numbers

javascript - New line spacing not working in jquery preview -

Image
on form can click preview button , shows me out putted view. because use replace(/</g, "&lt;").replace(/>/g, "&gt;") replaces 1 around br , unable view new lines. not want replace ones around br. question: how possible not touch less < , greater > around br tag in side pre? codepen code view codepen full view script $( document ).ready(function() { $('#preview-question').on('click', function (e) { $('.preview').html($('#question').val().replace(/\n/g, "<br />")); var str = $('.preview pre').html(); $('.preview pre').html(str.replace(/</g, "&lt;").replace(/>/g, "&gt;")); $('pre').each(function(i, block) { hljs.highlightblock(block); }); }); }); html <form class="form-horizontal"> <div class="container"> <div class=&qu