Friday 15 January 2010

c# - Usage example of the HttpClient.SendRequestAsync method passing a HttpRequestMessage object as an argument -



c# - Usage example of the HttpClient.SendRequestAsync method passing a HttpRequestMessage object as an argument -

i'm trying understand how httprequestmessage class works argument phone call httpclient.sendrequestasync(httprequestmessage), according lastly one's documentation httprequestmessage can used fill of headers in request made httpclient.sendrequestasync, thing still don't understand how manage fill httprequestmessage.headers property it's "get" property? if got right, request headers stored within collection, how can modify if i'm allowed it?

thanks in advance.

c# http windows-runtime

c++ - Modify makefile created using autoconf -



c++ - Modify makefile created using autoconf -

i using autoconf create makefile app using gtkmm-3.0. configure script running , makefile generated. makefile puts object files after libraries as:

g++ -g -o2 -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -o base of operations base-base.o

which giving next error:

/usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference `glib::ustring::~ustring()' base-base.o: in function `main': /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:7: undefined reference `glib::ustring::ustring(char const*)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:7: undefined reference `gtk::application::create(int&, char**&, glib::ustring const&, gio::applicationflags)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:7: undefined reference `glib::ustring::~ustring()' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:9: undefined reference `gtk::window::window(gtk::windowtype)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:10: undefined reference `gtk::window::set_default_size(int, int)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:12: undefined reference `gtk::application::run(gtk::window&)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:9: undefined reference `gtk::window::~window()' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:13: undefined reference `glib::ustring::~ustring()' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:9: undefined reference `gtk::window::~window()'

but when manually run above statement object file before libraries:

g++ -g -o2 -o base of operations base-base.o -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0

then no error happens. problem order of libraries , object file. modify in autoconf script force order alter in makefile?

what modify in autoconf script force order alter in makefile?

if utilize autoconf (without automake), need modify files ".in" extension, makefile.in, , rerun "./configure".

if utilize automake, instead of makefile.in have edit makefile.am. , after run autoreconf && ./configure

c++ makefile configure autoconf gtkmm

angularjs - Object not defined by Angular.js resource factory -



angularjs - Object not defined by Angular.js resource factory -

i'm getting object not defined error in angular application i'm building.

the object triggers error 'coffeeorder' object in givemecoffee function below. entire source code in github.

for read in angular.js documentation, should work (see code snippet @ bottom). error message not helpful.

var coffeeapp = angular.module('coffeeapp', ['ngresource']); coffeeapp.controller('ordercontroller', function($scope) { $scope.types = [ {name:'black', family:'coffee'}, {name:'latte', family:'coffee'}, {name:'cappuccino', family:'coffee'}, {name:'tea', family:'other'} ]; $scope.sizes = ['s', 'm', 'l']; $scope.givemecoffee = function() { coffeeorder.save({id: 1}, $scope.drink); } }); coffeeapp.factory('coffeeorder', function($resource) { homecoming $resource('/service/coffeeshop/:id/order/', {id: '@coffeeshopid'}); });

coffeeorder service. service not globally available object. must injected other angular components, , didn't inject it:

coffeeapp.controller('ordercontroller', function($scope, coffeeorder) {

angularjs angularjs-resource

orm - Conditional sails model schemas -



orm - Conditional sails model schemas -

i'm trying write conditional model schema based if exists other models.

for example, if exist model 'message' add together inbox/outbox:

class="lang-js prettyprint-override">var userschema = { attributes: { ... } } var messageschema = { attributes: { inbox: { collection: 'message' }, outbox: { collection: 'message' } } }; if (<function check message model available) _.merge userschema, messageschema

is possible this?

i think need 1 "pre model load" fase on plugins , 1 hook alow others modules alter construction drupal 7 scheme.

you cold exports 1 function plug "fase feature" in plugin npm loader did default configs: https://github.com/wejs/we-plugin/blob/master/lib/index.js#l18 , set in https://github.com/wejs/we-example/blob/master/app.js#l63

orm sails.js waterline

Mongoose as HLS server -



Mongoose as HLS server -

i trying utilize mongoose dev server stream hls content. able play vlc not browser. able play nasa's m3u8 hls transmission(http://www.nasa.gov/multimedia/nasatv/ntv-public-ips.m3u8) same browser. changed mime type .m3u8 - application/x-mpegurl or vnd.apple.mpegurl.ts .ts - video/mp2t still no luck. clues? tried wireshark, seeing browser using user-agent vlc apple link , not link? problem?

the link utilize success utilize mime 'audio/x-mpegurl', returning mime m3u8 suffix should trig same association in browser.

however draft rfc request usage of 'application/vnd.apple.mpegurl'

mongoose-web-server hls

php - Where clause and Order By not returning as expected in WordPress -



php - Where clause and Order By not returning as expected in WordPress -

i positive missing here.

i have mysql database table setup with: kdate, kday, kmonth, , kontent

kdate set expires date (admin input) formatted 01-01-2014 date(m-d-y)

i trying dates older today not show on execution of script.

global $wpdb; $today = date('m-d-y'); $result = $wpdb->get_results( "select * wp_kaltable kdate >= $today order kdate asc limit 6 "); //echo "<pre>"; print_r($result); echo "</pre>"; foreach($result $row) { echo "<div class='kalcontain'><div class='kal'><div class='kdate'><p class='kmonth'>".$row->kmonth."</p><p class='kday'>" .$row->kday."</div><div class='kontent'><p class='ktext'>".$row->kontent. "</p></div><div class'clear'></div></div></div>"; }

when execute script, data, ones dates less today's date. also, when using order by, ordering month , day, not year.

all assistance appreciated.

(*this code testing purposes only)

try instead:

"select * wp_kaltable kdate >= '$today' order kdate asc limit 6 "

the single quotes around $today important.

if kdate date format utilize curdate() mysql don't have muck around in php:

"select * wp_kaltable kdate >= curdate() order kdate asc limit 6 "

if kdate not date format, may not since order isn't working correctly, neither of sql statements work. need convert date format in order >=

php mysql wordpress

c# - Displayed image in UI locks the source file -



c# - Displayed image in UI locks the source file -

i have datatemplate created here: comboboxes sharing observable collection keeps breaking

<usercontrol.resources> <datatemplate x:key="imageitemtemplate"> <stackpanel orientation="horizontal"> <image height="44" source="{binding path}"/> <label content="{binding name}" verticalalignment="center"/> </stackpanel> </datatemplate> </usercontrol.resources> <combobox x:name="image1" itemtemplate="{staticresource imageitemtemplate}"/>

code:

public observablecollection<imageitem> images = new observablecollection<imageitem>(); generic.importgrfx(tabid, image1, images); public static void importgrfx(string tabid, combobox combo, observablecollection<imageitem> items) { items.clear(); seek { string root = system.io.path.getdirectoryname(system.reflection.assembly.getexecutingassembly().location); var files = directory.getfiles(path.combine(root, "input\\" + tabid), "*.png"); foreach (var file in files) { imageitem item = new imageitem(); item.path = file; item.name = path.getfilename(file).remove(path.getfilename(file).length - 4); items.add(item); } } grab (exception) { } combo.itemssource = items; } public class imageitem { public string path { get; set; } public string name { get; set; } }

the problem having binding these images datatemplate, "locks" image source. meaning can't edit images while programme running... error stating image in use. there way prepare this?

here's skeleton of image updated whenever modify outside.

you set source, copies temp path , loads image there it watches changes in initial image , updates again rinse , repeat :d

you can, not utilize auto-update feature if need ability edit image outside.

it's basic sense free improve ...

code:

using system; using system.io; using system.windows; using system.windows.controls; using system.windows.media.imaging; namespace wpfapplication4 { /// <summary> /// interaction logic mainwindow.xaml /// </summary> public partial class mainwindow : window { public mainwindow() { initializecomponent(); loaded += mainwindow_loaded; } private void mainwindow_loaded(object sender, routedeventargs e) { dynamicimage1.setsource(@"d:\untitled.png"); } } internal class dynamicimage : image { private string _name; private filesystemwatcher _watcher; public void setsource(string filename) { if (filename == null) throw new argumentnullexception("filename"); if (_watcher != null) { _watcher.changed -= watcher_changed; _watcher.dispose(); } string path = path.getdirectoryname(filename); _watcher = new filesystemwatcher(path); _watcher.enableraisingevents = true; _watcher.changed += watcher_changed; _name = filename; string tempfilename = path.gettempfilename(); file.copy(filename, tempfilename, true); source = new bitmapimage(new uri(tempfilename)); } private void watcher_changed(object sender, filesystemeventargs e) { bool b = string.equals(e.fullpath, _name, stringcomparison.invariantcultureignorecase); if (b) { string tempfilename = path.gettempfilename(); file.copy(e.fullpath, tempfilename, true); dispatcher.begininvoke((action) (() => { source = new bitmapimage(new uri(tempfilename)); })); _name = e.fullpath; } } } }

xaml:

<window x:class="wpfapplication4.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wpfapplication4="clr-namespace:wpfapplication4" title="mainwindow" height="350" width="525"> <grid> <wpfapplication4:dynamicimage x:name="dynamicimage1" /> </grid> </window>

c# wpf image locking datatemplate

What am I doing wrong with this Code Xcode Swift? -



What am I doing wrong with this Code Xcode Swift? -

im trying background image not working me. first skspritenode leave screen want add together skspritenode next , want repeat forever. endless background. in flappy bird sky background , ground moves forever. how this? thanks. have far not doing want do.

override func didmovetoview(view: skview) { // background in 0...3{ allow background = skspritenode(imagenamed: "background") background.setscale(1.0) background.zposition = 0 background.position = cgpoint(x: cgfloat(i) * background.frame.size.width, y:0) background.runaction(moveforeveraction(background)) addchild(background) } func moveforeveraction(node: skspritenode) -> skaction { allow movenode = skaction.movebyx(0, y:node.size.height, duration: nstimeinterval(cgfloat(gamespeed) * node.size.width)) allow resetposition = skaction.moveto(cgpoint(x: node.frame.origin.x, y:node.frame.origin.y), duration: 0.0) allow movenodeforever = skaction.repeatactionforever(skaction.sequence([movenode, resetposition])) homecoming movenodeforever }

xcode swift background repeat

c# - LinkLabel Click event being overwritten within loop -



c# - LinkLabel Click event being overwritten within loop -

here's sample code denotes problem. adds 5 linklabels, each click event handler. text on label 1...5 , should display same result when clicked, when click on each of labels same message each: 5.

it's lastly handler overwriting handler on each of other labels. thought had avoided creating new eventhandler , new linklabel each iteration of loop.

i added each linklabel flowlayoutpanel.

why getting result, , how can prepare it?

list<test> objects = new list<test>(); (int = 0; < 5; i++) { objects.add(new test(i + 1)); } foreach (test t in objects) { linklabel label = new linklabel(); label.autosize = true; label.text = t.a + ""; label.click += new eventhandler((sender, args) => { messagebox.show(t.a + ""); }); flowlayoutpanel1.controls.add(label); }

in effort reproduce problem described code, link labels 1 through 5 displayed 1 through 5 respectively when clicked want.

here standalone illustration minimally builds upon code posted (just extent necessary create build , run)...and works expected:

// fornow: added main method poc. void main() { // fornow: added necessary form , flowlayoutpanel locals. form form1 = new form(); flowlayoutpanel flowlayoutpanel1 = new flowlayoutpanel(); list<test> objects = new list<test>(); (int = 0; < 5; i++) { objects.add(new test(i + 1)); } foreach (test t in objects) { linklabel label = new linklabel(); label.autosize = true; label.text = t.a + ""; label.click += new eventhandler((sender, args) => { messagebox.show(t.a + ""); }); flowlayoutpanel1.controls.add(label); } // fornow: added necessary command wiring , display call. form1.controls.add(flowlayoutpanel1); form1.show(); } // fornow: added test class based on op's code. public class test { public int { get; set; } public test(int a) { this.a = a; } }

you may have problem in other code employing, code shared works fine based on said expect.

c# winforms handler linklabel

github - How can I change my git timezone offset? -



github - How can I change my git timezone offset? -

i read --date argument when adding commit can used specify timestamp , timezone offset. i'm curious if there's way globally set timezone offset matches timezone.. i'm in est -0500 utc, , whenever commit , force github contributions never shows on right day. ie. it's 2:00 git sets timezone offset utc. when commit/push changes github show 9 pm utc.

i've got bit of ocd acting right now.

git gets time zone system's configuration, if configure scheme correctly git should utilize right time zone. run date +%z check system's configuration.

perhaps git using right time zone github displaying time using wrong time zone. after create commit, run git show , check offset. if it's correct, problem github.

git github timestamp commit

math - Calculate angle of view from 2D image -



math - Calculate angle of view from 2D image -

i want calculate angle of view (or field of view) photograph, without knowing camera, utilize info in 3d environment.

i have utilize trigonometry solve (most using arctan), i'm not proficient plenty in math ... can please help?

please have @ example.

i assume angle between line center-left , center-right 90° in reality.

i know distances (in pixels) of point c vanishing points vp-left , vp-right.

furthermore height of image angle of view in 3d environment.

thanks!

math trigonometry

Align Divs in HTML + CSS -



Align Divs in HTML + CSS -

i trying align 3 divs within of 4th div create similar see on page: http://www.thedistillerydistrict.com/

i can't seem within divs (#entertainment, #community, #welcome) align side side within #homemain div

this html

<div id = "homemain"> <div id="welcome"> <p>finest booze around, come taste home many of toronto's hottest designer boutiques, unique cafes, artisan shops, breathtaking fine art galleries, performance venues , award-winning restaurants, distillery district place see , seen. internationally acclaimed pedestrian-only village, distillery features more 70 ground-floor cultural , retail establishments in restored reddish brick, victorian-era buildings of renowned gooderham & worts whiskey distillery. 1 of canada's hottest tourist attractions, centrally-located , short walk downtown toronto there happening @ distillery.</p> <div class = "oldman"></div> </div> <div id = "entertainment"> <img src="images/entertainment1.jpg" id="entslide" width=125 height=70 /> </div> <div id = "community"> <img src="images/victoria1.jpg" id="comslide" width=125 height=70 /> </div> </div>

here css

#homemain{ width: 100%; float: left; overflow:hidden; margin:0 auto; padding:5px; border-style: groove; border-width: 3px; border-colour: white; border-radius: 5px 5px 5px 5px; } #entertainment #community{ float: left; width: 25%; border-style: groove; border-width: 3px; border-colour: white; border-radius: 5px 5px 5px 5px; } #welcome{ float: left; width:50%; position: relative; border-style: groove; border-width: 3px; border-color: white; border-radius: 5px 5px 5px 5px; font-weight: bold; padding:15px; }

check fiddle link http://jsfiddle.net/hek7fly2/

all have done utilize box-sizing css property accomplish desired result. assume want images in 2 smaller divs centered, takes care of that.

i have not changed html code tweaked little bit of css code including typo..

#homemain{ width: 100%; float: left; overflow:hidden; margin:0 auto; padding:5px; border-style: groove; border-width: 3px; border-colour: white; border-radius: 5px 5px 5px 5px; box-sizing:border-box; } #entertainment, #community{ float: left; width: 25%; border-style: groove; border-width: 3px; border-colour: white; border-radius: 5px 5px 5px 5px; box-sizing:border-box; } #welcome{ float: left; width:50%; position: relative; border-style: groove; border-width: 3px; border-color: white; border-radius: 5px 5px 5px 5px; font-weight: bold; padding:15px; box-sizing:border-box; } img{ display:block; margin: 0 auto; }

html css

node.js - Saving sorted order to mongo using ui-sortable -



node.js - Saving sorted order to mongo using ui-sortable -

i'm teaching myself ins , outs of building mean app. started basic todo app , modified pretty heavily back upwards multiple key value pairs , have updated ui using bootstrap.

it's hosted here: http://surveymanager-30817.onmodulus.net/

i've implemented ui-sortable, , works itself.

the challenge i'm having, cannot seem find relevant documentation or tutorials - how communicate updated sort order mongo when refresh page, ng-repeat repeat question in questions order had created.

here html

<!-- index.html --> <!doctype html> <!-- assign our angular module --> <html ng-app="questionmanager"> <head> <!-- meta --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"><!-- optimize mobile viewport --> <title>question manager</title> <!-- scrolls --> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/question-bootstrap.css" rel="stylesheet"> <style> html { overflow-y:scroll; } body { padding-top:30px; } #todo-list { margin-bottom:30px; } </style> <!-- spells --> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script><!-- load jquery --> <script src="//code.jquery.com/ui/1.9.1/jquery-ui.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script><!-- load angular --> <script src="js/sortable.js"></script> <script src="core.js"></script> </head> <!-- set controller , todos --> <body ng-controller="maincontroller"> <div class="container sm_head"> <div class="col-sm-6"> </div> <div class="col-sm-6"> <h2 class="pull-right">survey manager</h2> </div> </div> <div class="container"> <!-- nav tabs --> <ul id="navtabs" class="nav nav-tabs" role="tablist"> <li class="active"><a href="#manage" role="tab" data-toggle="tab">manage</a></li> <li><a href="#create" role="tab" data-toggle="tab">create</a></li> <li><a href="#render" role="tab" data-toggle="tab">render code</a></li> <li><a href="#abouts" role="tab" data-toggle="tab">about</a></li> </ul> <!-- tab panes --> <div class="tab-content"> <div class="tab-pane active" id="manage"> <div class="panel panel-default"> <!-- default panel contents --> <div class="panel-heading">manage question order<span class="badge pull-right">{{ questions.length }} questions</span></div> <!-- table --> <table class="table"> <thead> <tr> <th>order</th> <th>question name</th> <th>evergage field</th> <th>username</th> <th>options</th> </tr> </thead> <tbody ui-sortable="sortableoptions" ng-model="questions"> <tr ng-repeat="question in questions"> <td>{{ question.order }}</td> <td>{{ question.meanname }}</td> <td>{{ question.fieldname }}</td> <td>@mdo</td> <td> <button type="button" class="btn btn-default btn-sm" ng-click="deletequestion(question._id)"> <span class="ques-list glyphicon glyphicon-remove"></span> delete </button> </td> </tr> </tbody> </table> </div> <div class="col-md-8"> <form class="form-horizontal"> <fieldset> <!-- form name --> <legend>question details</legend> <!-- text input--> <div class="form-group"> <label class="col-md-4 control-label" for="question name">question order</label> <div class="col-md-8"> <input id="question order" name="question order" type="text" placeholder="question order" class="form-control input-md" ng-model="formdata.order"> </div> </div> <!-- text input--> <div class="form-group"> <label class="col-md-4 control-label" for="question name">question name</label> <div class="col-md-8"> <input id="question name" name="question name" type="text" placeholder="write meaningful" class="form-control input-md" ng-model="formdata.meanname"> </div> </div> <!-- text input--> <div class="form-group"> <label class="col-md-4 control-label" for="custom field name">custom field</label> <div class="col-md-8"> <input id="custom field name" name="custom field name" type="text" placeholder="format: user.profile.xx.xx.xx ( 1 or 3 additional words)" class="form-control input-md" ng-model="formdata.fieldname"> </div> </div> <!-- button --> <div class="form-group"> <label class="col-md-4 control-label" for="create"></label> <div class="col-md-4"> <button id="create" name="create" class="btn btn-primary" ng-click="createquestion()">create</button> </div> </div> </fieldset> </form> </div> </div> <div class="tab-pane" id="create"> </div> <div class="tab-pane" id="render">...</div> <div class="tab-pane" id="about">...</div> </div> </div> <script src="js/bootstrap.min.js"></script> </body> </html>

here client side:

// public/core.js var questionmanager = angular.module('questionmanager', ['ui.sortable']); function maincontroller($scope, $http) { $scope.formdata = {}; // when landing on page, questions , show them $http.get('/api/questions') .success(function(data) { $scope.questions = data; console.log(data); }) .error(function(data) { console.log('error: ' + data); }); // when submitting add together form, send text node api $scope.createquestion = function() { $http.post('/api/questions', $scope.formdata) .success(function(data) { $scope.formdata = {}; console.log('fuck you!'); $scope.questions = data; console.log(data); }) .error(function(data) { console.log('error: ' + data); }); }; // delete question after checking $scope.deletequestion = function(id) { $http.delete('/api/questions/' + id) .success(function(data) { $scope.questions = data; console.log(data); }) .error(function(data) { console.log('error: ' + data); }); }; $scope.$watch("questions", function(newval, oldval) { console.log("oldval", oldval); console.log("newval", newval); }); $scope.sortableoptions = { update: function(e, ui) { $http.put('/api/questions', $scope.questions) console.log($scope.questions); }, axis: 'y' }; } // bootstrap initializers $('#navtabs>li a').click(function (e) { e.preventdefault() $(this).tab('show') })

and here server side random test , console logs starting @ line 44

// server.js var express = require('express'); var app = express(); // create our app w/ express var mongoose = require('mongoose'); // mongoose mongodb var morgan = require('morgan'); // log requests console (express4) var bodyparser = require('body-parser'); // pull info html post (express4) var methodoverride = require('method-override'); // simulate delete , set (express4) mongoose.connect('mongodb://ewill3532:12qwaszx@proximus.modulusmongo.net:27017/puxo2hir'); // connect mongodb database locally app.use(express.static(__dirname + '/public')); // set static files location /public/img /img users app.use(morgan('dev')); // log every request console app.use(bodyparser.urlencoded({'extended':'true'})); // parse application/x-www-form-urlencoded app.use(bodyparser.json()); // parse application/json app.use(bodyparser.json({ type: 'application/vnd.api+json' })); // parse application/vnd.api+json json app.use(methodoverride()); var question = mongoose.model('question', { order : string, fieldname : string, meanname : string }); app.get('/api/questions', function(req, res) { // utilize mongoose questions in database question.find(function(err, questions) { // if there error retrieving, send error. nil after res.send(err) execute if (err) res.send(err) res.json(questions); // homecoming questions in json format }); }); // create todo , send questions after creation app.post('/api/questions', function(req, res) { // create todo, info comes ajax request angular question.create({ order : req.body.order, fieldname : req.body.fieldname, meanname : req.body.meanname, done : false }, function(err, todo) { if (err) res.send(err); // , homecoming questions after create question.find(function(err, questions) { if (err) res.send(err) res.json(questions); }); }); }); // delete todo app.delete('/api/questions/:todo_id', function(req, res) { question.remove({ _id : req.params.todo_id }, function(err, todo) { if (err) res.send(err); // , homecoming questions after create question.find(function(err, questions) { if (err) res.send(err) res.json(questions); }); }); }); // let's set here comes found app.put('/api/questions', function(req, res) { }); app.get('*', function(req, res) { res.sendfile('./public/index.html'); // load single view file (angular handle page changes on front-end) }); // hear (start app node server.js) ====================================== app.listen(8080); console.log("app listening on port 8080");

any help here, or if can point me documentation or tutorials - either way helpful!'

thanks!

node.js angularjs mongodb express mongoose

c# - DatePicker WPF + entering partial date -



c# - DatePicker WPF + entering partial date -

i have datepicker in wpf application. text property of datepicker bound nullable datetime property in view model. updatesourcetrigger set propertychanged.

the problem facing when come in today's date 2/10, posts view model '2/10/2014'. there doing wrong.

is there way stop partial date posted view model on text change?

also not wish alter nullable datetime text.

thanks sandeep

if want stop update on text changing should seek set "updatesourcetrigger=lostfocus", in way source going updated 1 time datepicker lose focus.

also not wish alter nullable datetime text.

in case should bind datepicker.selecteddate property.

c# wpf datepicker

syntax - labels used on ordinary method calls - Java -



syntax - labels used on ordinary method calls - Java -

i aware of labels in java utilize loops such as:

myloop: for(;;) { // codez break myloop; }

but recenlty found out valid:

mylabel: system.out.println("");

why 1 want that? utilize of (if any)?

the label @ top of command construction causes execution resume @ end of command construction 1 time break myloop; called.

putting label on line doesn't precede command construction doesn't anything. there's no point, @ to the lowest degree it's harmless.

labels described here in java language specification. there's nil stopping putting label on statement. maybe java's designers didn't want restrict statements labeled if introduced new command construction wouldn't have add together set of statements can labeled.

java syntax

seo - Disallow: /sites/default/files/ not working for my Drupal Website -



seo - Disallow: /sites/default/files/ not working for my Drupal Website -

i working on drupal 7 website. added next robots.txt file (under # directories section)

disallow: /sites/default/files/

but when type "site:www.example.com filetype:pdf" in google, still able crawl /sites/default/files folder. please help me figure out why these still beingness crawled?

the relevant link got here was: can add together sites/default/files in robots.txt? not reply question.

remember google's cache valid 2 weeks settings affective after time period.

drupal-7 seo robots.txt google-search

java - Issue downloading report exported to PPTX when deployed on server -



java - Issue downloading report exported to PPTX when deployed on server -

we generating our reports using jasperreports 5.6.1, , allow exporting same template pdf or powerpoint. when running locally, pdf , pptx file downloaded work perfectly. when deploy our servers pdf works fine, pptx files cannot opened. when run locally, deployed tomcat, when deployed server running on websphere.

things tried , noticed:

i have checked logs, , there no exceptions or raise eyebrows. the file downloaded larger 1 when run locally. if changed extension of files zip, , unarchived them. file construction , file names same, along files beingness same file size. contents seem different in names objects found in each slide. thinking may problem x type files tried exporting xlsx also, see happen, , works fine same template. i added static pptx file known good, , can download without issue server. did seek eliminate server config issue, , sense worked, assuming code, not sure what.

here code write response:

if ("xlsx".equals(type)) { response.setcontenttype("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setheader("content-disposition", "attachment; filename=" + filename + ".xlsx"); } else if ("pptx".equals(type)) { response.setcontenttype("application/vnd.openxmlformats-officedocument.presentationml.presentation"); response.setheader("content-disposition", "attachment; filename=" + filename + ".pptx"); response.setcharacterencoding("utf-8"); } else { response.setcontenttype("application/pdf"); response.setheader("content-disposition", "attachment; filename=" + filename + ".pdf"); } seek (final bytearrayoutputstream reportresult = reportsservice.generatereport( getdeal(userid, dealid, sessionstore), getscenariomodel(userid, dealid, scenarioid, sessionstore), reportid, type)) { configureresponse(response, type, reportresult, dealid + "-" + scenarioid); // write http response reportresult.writeto(response.getoutputstream()); } response.flushbuffer();

i have run out of ideas on troubleshooting steps, , without beingness able reproduce locally, finding hard diagnose.

java jasper-reports powerpoint

javascript - Obtain the same result as a for..in loop, without any for..in loop -



javascript - Obtain the same result as a for..in loop, without any for..in loop -

(let suppose there reason wishing this. see end of question if want read reason.)

i obtain same result for in loop, without using language construct. result mean array of property names (i don't need reproduce behavior happen if modify object while iterating on it).

to set question code, i'd implement function without for in:

function getpropertiesof(obj) { var props = []; (var prop in obj) props.push(prop); homecoming props; }

from understanding of ecmascript 5.1 specification the in statement , the object.keys method, seems next implementation should correct:

function getpropertiesof(obj) { var props = []; var alreadyseen = {}; // handle primitive types if (obj === null || obj === undefined) homecoming props; obj = object(obj); // each object in prototype chain: while (obj !== null) { // add together own enumerable properties have not been seen yet var enumprops = object.keys(obj); (var = 0; < enumprops.length; i++) { var prop = enumprops[i]; if (!alreadyseen[prop]) props.push(prop); } // add together own properties (including non-enumerable ones) // in alreadyseen set. var allprops = object.getownpropertynames(obj); (var = 0; < allprops.length; i++) alreadyseen[allprops[i]] = true; // go on object's prototype obj = object.getprototypeof(obj); } homecoming props; }

the thought walk explicitly prototype chain, , utilize object.keys own properties in each object of chain. exclude property names seen in previous objects in chain, including when seen non-enumerable. method should respect the additional guarantee mentioned on mdn:

the object.keys() method returns array of given object's own enumerable properties, in same order provided for...in loop [...].

(emphasis mine)

i played bit implementation, , haven't been able break it.

so question:

is analysis correct? or overlooking detail of spec create implementation incorrect?

do know way this, match implementation's specific order of for in in cases?

remarks:

i don't care ecmascript < 5.1. i don't care performance (it can disastrous).

edit: satisfy @lexicore's curiosity (but not part of question), reason following. develop compiler javascript (from scala), , for in language build not part of things want back upwards straight in intermediate representation of compiler. instead, have "built-in" function getpropertiesof show first example. i'm trying rid of many builtins possible replacing them "user-space" implementations (written in scala). performance, still have optimizer "intrinsifies" methods, , in case intrinsify getpropertiesof efficient first implementation. create intermediate representation sound, , work when optimizer disabled, need true implementation of feature, no matter performance cost, long it's correct. , in case cannot utilize for in, since ir cannot represent build (but can phone call arbitrary javascript functions on objects, e.g., object.keys).

from specification point of view, analysis right under assumption particular implementation defines specific order of enumeration for-in statement:

if implementation defines specific order of enumeration for-in statement, same enumeration order must used in step 5 of algorithm.

see lastly sentence here.

so if implementation does not provide such specific order, for-in , object.keys may homecoming different things. well, in case 2 different for-ins may homecoming different things.

quite interesting, whole story reduces question if 2 for-ins give same results if object not changed. because, if not case, how test "the same" anyway?

in practice, true, imagine object rebuild internal construction dynamically, between for-in calls. instance, if property accessed often, implementation may restructure hash table access property more efficient. far can see, specification not prohibit that. , not-so-unreasonable.

so reply question is: no, there no guarantee according specification, still work in practice.

update

i think there's problem. defined, order of properties between members of prototype chain is? may "own" properties in right order, merged way it? instance, why kid properties first , parent's next?

javascript ecmascript-5

javascript - delete data with ajax -



javascript - delete data with ajax -

i unable delete records database, fetching code working delete code not working. please help me out.. in advance

code fetch info ajax

$(document).ready(function(){ done(); }); function done(){ settimeout(function(){ updates(); done(); }, 200); } function updates(){ $.getjson("fetch.php",function(data){ $("table").empty(); $("table").append("<tr><td>name</td><td>date</td><td>delete</td></tr>"); $.each(data.result, function(){ $("table").append("<tr><td>"+this['text']+"</td><td>"+this['date']+"</td><td><a id='del' href='"+this['id']+"'>del</a></td></tr>"); }); }); }

code delete info ajax

$(function() { $("#del").click(function(){ var element = $(this); var id = element.attr("id"); var datastring = 'id=' + id; if(confirm("sure want delete comment?")) { $.ajax({ type: "get", url: "del.php", data: datastring, success: function(){ } }); } homecoming false; }); });

php code del.php

$last_page_id = $_request['d_i_d']; $sql = mysql_query("delete time id = '{$last_page_id}'"); if(!$sql){ echo mysql_error(); }else{ header('location: index.php'); }

ajax data: datastring = 'id=' + id;

calling in php: $last_page_id = $_request['d_i_d'];

you can id $_request['id']

please note mysql_ deprecated: why shouldn't utilize mysql_* functions in php?

and code open sql injection: http://en.wikipedia.org/wiki/sql_injection

javascript php jquery ajax

Create new line based on each regex match in python -



Create new line based on each regex match in python -

i have input file contains info formatted follows:

a; b, c| derp derp "x1234567, y1234567, z1234567" derp derp a; b, c|

i utilize python parse multiple lines each item occurs between double quotes.

the output above illustration be:

a; b, c| derp derp x1234567 derp derp a; b, c|

a; b, c| derp derp y1234567 derp derp a; b, c|

a; b, c| derp derp z1234567 derp derp a; b, c|

so far have this:

import re prefix = re.compile ('^(.*?)"') pattern = re.compile('\"(.*?)([a-z]{1}[0-9]{7})(.*?)\"') suffix = re.compile ('"(.*?)$') i, line in enumerate(open('myfile.txt')): match in re.finditer(pattern, line): print prefix, match.group(), suffix

but seems homecoming first match of each of contents.

in situation it's alot more work (in opinion) utilize regex rather simple string , list manipulations. such:

#!/usr/bin/env pytohn open('myfile.txt','r') f: lines = readlines(f) line in lines: line = line.strip() start = line.find('"') end = line.find('"',start+1) info = line[start+1:end].split(',') info = [x.strip() x in data] x in data: print line[:start],x,line[end+1:]

here's found after taking @ code posted:

you're printing sre_pattern objects prefix , suffix in print line. should record matches prefix , suffix on every iteration of outer loop. calling match.group() homecoming entire match, not what's in parentheses. think want match.group(1) in cases. having pattern defined matches 1 string because searches sequentially through lines starting quotation mark followed rest of pattern. hence gets index first quotation mark, checks 1 time pattern, finds x1234567 moves on. i'm not sure why have backslashes before quotation marks in pattern, don't think special characters. in suffix, match first quotation mark not second, , suffix include stuff between quotation marks. the print statement insert spaces between items if utilize commas, should concatenate them using + instead.

and here ended regex:

#!/usr/bin/env python import re prefix = re.compile('^(.*?)"') quotes = re.compile('".*?(.*).*?"') pattern = re.compile('[a-z]{1}[0-9]{7}') suffix = re.compile('".*"(.*?)$') (i,line) in enumerate(open('myfile.txt')): pre = prefix.search(line).group(1) info = quotes.search(line).group(1) suf = suffix.search(line).group(1) match in re.finditer(pattern,data): print pre+match.group(0)+suf

hope helps, questions please ask. regex tricky beast @ best of times.

python regex

javascript - Make a div move using jquery -



javascript - Make a div move using jquery -

i'm trying create div move of 50px left right every 500 milliseconds next jquery code:

<div id="obj"></div> <script> function move(before){ var howmuch = before + 50; $("#obj").css("margin-left",howmuch + "px"); settimeout(move(howmuch),500); } settimeout(move(0),500); </script> #obj{ background-color:red; width:100px; height:100px; border-radius:10px 10px 10px 10px; -moz-border-radius:10px 10px 10px 10px; -webkit-border-radius:10px 10px 10px 10px; margin-left:0px; }

...

<!doctype html> <head> <meta charset="utf-8"> <title>test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> </head> <body> <div id="obj"></div> <script> function move(before){ var howmuch = before + 50; $("#obj").css("margin-left",howmuch + "px"); settimeout(move(howmuch),500); } settimeout(move(0),500); </script> </body>

but that's not working. when launch firefox or net explorer, box gets huge distance margin (much bigger width of screen), , noticed if run stackoverflow's snippet function box not move. problem?

you code has few mistakes, right way is:

var howmuch = 0; // start @ position 0, here global variable function move(before) { howmuch = before + 50; // add together 50 previous value $("#obj").css("margin-left", howmuch + "px"); // move settimeout(function() { //call next move, executing move function current position after 500ms move(howmuch) }, 500); } settimeout(function() { //start recursive funcion after 500ms, 0 start move(howmuch) }, 500);

class="snippet-code-css lang-css prettyprint-override">#obj { background-color: red; width: 100px; height: 100px; border-radius: 10px 10px 10px 10px; -moz-border-radius: 10px 10px 10px 10px; -webkit-border-radius: 10px 10px 10px 10px; margin-left: 0px; } class="snippet-code-html lang-html prettyprint-override"><!doctype html> <head> <meta charset="utf-8"> <title>test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> </head> <body> <div id="obj"></div> <script> var howmuch = 0; function move(before) { howmuch = before + 50; $("#obj").css("margin-left", howmuch + "px"); settimeout(function() { move(howmuch) }, 500); } settimeout(function() { move(howmuch) }, 500); </script> </body>

javascript jquery html settimeout

html - Determin if content of url has changed -



html - Determin if content of url has changed -

hello want save or content of url compare online version see if there changes. destination of url html page.

my simple approach be: store string , compare string don't think optimal way.

do have advices how accomplish in ios?

here article covers question https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers article ios side https://devcenter.heroku.com/articles/ios-network-caching-http-headers

you need utilize either etag or last-modified techniques.

html ios objective-c iphone web-services

Using Structures and Arrays in VB.NET -



Using Structures and Arrays in VB.NET -

my assignment requires me open text file containing client info using vb.net. actual assignment lengthy, iam stuck in part here.

here link question.please note not need assignment solution want on own, iam stuck in first part

https://www.dropbox.com/sh/amw9b6i0o47inau/aad9uzh4zubp5mkaekjitrx9a?dl=0

arrays vb.net structure variable-assignment

Java Regex to match Vietnamese chars -



Java Regex to match Vietnamese chars -

i have write regex restrict input field, allow vietnamese chars, english language chars , digits. know how restrict english language chars ([a-za-z]) , digits ([0-9]), don't know how restrict vietnamese chars.

can give me java regex match vietnamese chars?

vietnamese chars like: ể, ứ (edit: don't know of them. otherwise, can use[a-list-of-chars], or maybe there range, [a-d] instead of [abcd])

vietnamese alphabet

the intersection of vietnamese alphabet , english language alphabet (i.e. whatever mutual between 2 alphabets) alphabet of english language minus f, j, w , z.

in vietnamese, a, e, i, o, u, y considered vowels.

apart those, vietnamese utilize several other characters diacritics. below list uppercase of character (the lowercase version has 1-character-to-1-character mapping, unlike ß in german):

consonant:

Đ: latin capital letter d stroke

vowels:

Ă: latin capital letter breve Â: latin capital letter circumflex Ê: latin capital letter e circumfle Ô: latin capital letter o circumflex Ơ: latin capital letter o horn Ư: latin capital letter u horn

vietnamese has 6 tones, except first tone, other 5 tones indicated diacritic on vowels. tonal diacritics acute á, grave à, hook , tilde ã , dot below . since there (6 + 6) vowels times 5 tones diacritics, plus 6 vowels diacritic on first tone, there 66 glyphs of vowels diacritic(s):

here list of (67) consonants , vowels diacritic(s):

Á À Ã Ả Ạ Ă Ắ Ằ Ẳ Ẵ Ặ Â Ấ Ầ Ẩ Ẫ Ậ Đ É È Ẻ Ẽ Ẹ Ê Ế Ề Ể Ễ Ệ Í Ì Ỉ Ĩ Ị Ô Ố Ồ Ổ Ỗ Ộ Ơ Ớ Ờ Ở Ỡ Ợ Ó Ò Õ Ỏ Ọ Ư Ứ Ừ Ử Ữ Ự Ú Ù Ủ Ũ Ụ Ý Ỳ Ỷ Ỹ Ỵ

these characters spread across different latin blocks in unicode. handpicked these characters character map, , had careful not pick characters visually identical character above. sure, can print names of characters , check latin character rather greek or cyrillic.

string vietnamese_diacritic_characters = "ẮẰẲẴẶĂẤẦẨẪẬÂÁÀÃẢẠĐẾỀỂỄỆÊÉÈẺẼẸÍÌỈĨỊỐỒỔỖỘÔỚỜỞỠỢƠÓÒÕỎỌỨỪỬỮỰƯÚÙỦŨỤÝỲỶỸỴ"; (char c: vietnamese_diacritic_characters.tochararray()) { system.out.println(c + ": " + character.getname(c)); } combining character

vietnamese input methods such unikey has 2 modes: single code point mode ("unicode dựng sẵn"), , combining mark mode ("unicode tổ hợp").

as example, same character (u+1ee3), there can several ways specify it:

as single code point (1 code point): as combination of ơ (u+01a1) , combining dot below (u+0323) (2 code points): ợ as combination of o, combining hook (u+031b), , combining dot below (u+0323) (3 code points): ợ

you can re-create these character console of browser , check length:

["ợ","ợ","ợ"].foreach(function (e) {console.log(e.length);})

if want match 3 variations above, must list possible combinations , permutations specify character, and have characters diacritics listed above, and in both uppercase , lowercase.

easy enough?

even if reply yes, code become unmaintainable mess no 1 can understand.

canonical equivalence

since there more 1 ways specify same text , without transformation, not possible compare , ợ equal.

"ợ".equals("ợ") --> false

unicode standard hence define 3 ways specify above canonically equivalent, , define methods normalize string comparing purpose.

java pattern back upwards canonical equivalence

the reference implementation of pattern class (by oracle, used on windows , other platforms) has (partial) back upwards canonical equivalence matching using pattern.canon_eq mode. extremely buggy point of unusable seen in this , this bug report. @ time of writing, bug has been there on version since canon_eq "supported", , not fixed time soon. however, not totally broken, , can still create utilize of whatever offered option.

solution

below construction of pattern matching vietnamese + english language alphabet, :

string vietnamese_diacritic_characters = "ẮẰẲẴẶĂẤẦẨẪẬÂÁÀÃẢẠĐẾỀỂỄỆÊÉÈẺẼẸÍÌỈĨỊỐỒỔỖỘÔỚỜỞỠỢƠÓÒÕỎỌỨỪỬỮỰƯÚÙỦŨỤÝỲỶỸỴ"; pattern p = pattern.compile("(?:[" + vietnamese_diacritic_characters + "]|[a-z])++", pattern.canon_eq | pattern.case_insensitive | pattern.unicode_case);

the additional flags pattern.case_insensitive | pattern.unicode_case used create pattern matches case-insensitively unicode characters. pattern.case_insensitive lone makes pattern matches case-insensitively characters in us-ascii charset.

note order of characters in vietnamese_diacritic_characters significant. don't recommend changing order of characters unless understand implication.

the input should normalized canonical decomposition (nkd) or canonical composition (nkc) before matching performed on it. ensures combining marks in canonical order.

regardless of whether input preprocessed canonical composition or canonical decomposition, result looks same. running code in appendix should homecoming visually identical result sec , 3rd output:

bạn chính là tác giả của wikipedia mọi người đều có thể biên tập bài ngay lập tức chỉ cần nhớ vài quy tắc có sẵn rất nhiều trang trợ giúp như tạo bài sửa bài hay tải ảnh bạn cũng đừng ngại đặt câu hỏi hiện chúng ta có bài viết và thành viên

bạn chính là tác giả của wikipedia mọi người đều có thể biên tập bài ngay lập tức chỉ cần nhớ vài quy tắc có sẵn rất nhiều trang trợ giúp như tạo bài sửa bài hay tải ảnh bạn cũng đừng ngại đặt câu hỏi hiện chúng ta có bài viết và thành viên

failed attempts

here failed attempts, used explain why regex constructed shown above.

attempt 1

string vietnamese_diacritic_characters = "ẮẰẲẴẶĂẤẦẨẪẬÂÁÀÃẢẠĐẾỀỂỄỆÊÉÈẺẼẸÍÌỈĨỊỐỒỔỖỘÔỚỜỞỠỢƠÓÒÕỎỌỨỪỬỮỰƯÚÙỦŨỤÝỲỶỸỴ"; pattern p = pattern.compile("[a-z" + vietnamese_diacritic_characters + "]++", pattern.canon_eq | pattern.case_insensitive | pattern.unicode_case);

why don't include a-z single character class instead of putting in separate character class , alternate diacritic character class?

nope, result broken when seek match on canonical decomposition of input string. diacritics not matched @ all.

ba n chi nh la ta c gia cu wikipedia mo ngu o đe u co bie n ta p ba ngay la p tu c chi ca n nho va quy ta c co sa n ra t nhie u trang tro giu p nhu ta o ba su ba hay ta nh ba n cu ng đu ng nga đa t ca u ho hie n chu ng ta co ba vie t va tha nh vie n

attempt 2

string vietnamese_diacritic_characters = "ÁÀÃẢẠĂẮẰẲẴẶÂẤẦẨẪẬĐÉÈẺẼẸÊẾỀỂỄỆÍÌỈĨỊÓÒÕỎỌÔỐỒỔỖỘƠỚỜỞỠỢÚÙỦŨỤƯỨỪỬỮỰÝỲỶỸỴ"; pattern p = pattern.compile("(?:[" + vietnamese_diacritic_characters + "]|[a-z])++", pattern.canon_eq | pattern.case_insensitive | pattern.unicode_case);

the diacritic characters declared in character class, code should behave same when alter order of character... right?

nope, results broken when seek match on canonical decomposition of input string.

bạn chính là tác giả của wikipedia mọi ngươ đê u có thê biên tạ p bài ngay lạ p tư c chỉ câ n nhơ vài quy tă c có să n râ t nhiê u trang trơ giúp như tạo bài sư bài hay tải ảnh bạn cũng đư ng ngại đạ t câu hỏi hiẹ n chúng ta có bài viê t và thành viên

explanation

the reference implementation (oracle) implements pattern.canon_eq mode picking out characters in look can expanded multiple characters under canonical decomposition , perform textual transformation of regex. then, look compiled per normal.

the first pass transform regex doesn't parse look properly, exhibits crazy behavior simple matching seen in bug reports above.

fortunately, pattern class spits out regex after transformation if there unmatched ( in regex. therefore, can add together ( @ end trigger patternsyntaxexception , @ transformed regex string.

let's mess solution regex above , see regex string enters compilation step:

java.util.regex.patternsyntaxexception: unclosed grouping near index 596 (?:(?:[Đ]|ắ|Ắ|Ắ|ằ|Ằ|Ằ|ẳ|Ẳ|Ẳ|ẵ|Ẵ|Ẵ|ặ|Ặ|Ặ|ặ|Ặ|Ặ|ă|Ă|ấ|Ấ|Ấ|ầ|Ầ|Ầ|ẩ|Ẩ|Ẩ|ẫ|Ẫ|Ẫ|ậ|Ậ|Ậ|ậ|Ậ|Ậ|â|Â|á|Á|à|À|ã|Ã|ả|Ả|ạ|Ạ|ế|Ế|Ế|ề|Ề|Ề|ể|Ể|Ể|ễ|Ễ|Ễ|ệ|Ệ|Ệ|ệ|Ệ|Ệ|ê|Ê|é|É|è|È|ẻ|Ẻ|ẽ|Ẽ|ẹ|Ẹ|í|Í|ì|Ì|ỉ|Ỉ|ĩ|Ĩ|ị|Ị|ố|Ố|Ố|ồ|Ồ|Ồ|ổ|Ổ|Ổ|ỗ|Ỗ|Ỗ|ộ|Ộ|Ộ|ộ|Ộ|Ộ|ô|Ô|ớ|Ớ|Ớ|ớ|Ớ|Ớ|ờ|Ờ|Ờ|ờ|Ờ|Ờ|ở|Ở|Ở|ở|Ở|Ở|ỡ|Ỡ|Ỡ|ỡ|Ỡ|Ỡ|ợ|Ợ|Ợ|ợ|Ợ|Ợ|ơ|Ơ|ó|Ó|ò|Ò|õ|Õ|ỏ|Ỏ|ọ|Ọ|ứ|Ứ|Ứ|ứ|Ứ|Ứ|ừ|Ừ|Ừ|ừ|Ừ|Ừ|ử|Ử|Ử|ử|Ử|Ử|ữ|Ữ|Ữ|ữ|Ữ|Ữ|ự|Ự|Ự|ự|Ự|Ự|ư|Ư|ú|Ú|ù|Ù|ủ|Ủ|ũ|Ũ|ụ|Ụ|ý|Ý|ỳ|Ỳ|ỷ|Ỷ|ỹ|Ỹ|ỵ|Ỵ)|[a-z])++( ^

as can see, engine grab characters can expand under canonical decomposition, take outside character class , build alternation.

it still not clear happening same characters repeating in alternation, insert space between every character:

( ? : ( ? : [ Đ ] | ̆ ́ | Ă ́ | Ắ | ̆ ̀ | Ă ̀ | Ằ | ̆ ̉ | Ă ̉ | Ẳ | ̆ ̃ | Ă ̃ | Ẵ | ̣ ̆ | Ạ ̆ | Ặ | ̆ ̣ | Ă ̣ | Ặ | ̆ | Ă | ̂ ́ | Â ́ | Ấ | ̂ ̀ | Â ̀ | Ầ | ̂ ̉ | Â ̉ | Ẩ | ̂ ̃ | Â ̃ | Ẫ | ̣ ̂ | Ạ ̂ | Ậ | ̂ ̣ | Â ̣ | Ậ | ̂ | Â | ́ | Á | ̀ | À | ̃ | Ã | ̉ | Ả | ̣ | Ạ | e ̂ ́ | Ê ́ | Ế | e ̂ ̀ | Ê ̀ | Ề | e ̂ ̉ | Ê ̉ | Ể | e ̂ ̃ | Ê ̃ | Ễ | e ̣ ̂ | Ẹ ̂ | Ệ | e ̂ ̣ | Ê ̣ | Ệ | e ̂ | Ê | e ́ | É | e ̀ | È | e ̉ | Ẻ | e ̃ | Ẽ | e ̣ | Ẹ | ́ | Í | ̀ | Ì | ̉ | Ỉ | ̃ | Ĩ | ̣ | Ị | o ̂ ́ | Ô ́ | Ố | o ̂ ̀ | Ô ̀ | Ồ | o ̂ ̉ | Ô ̉ | Ổ | o ̂ ̃ | Ô ̃ | Ỗ | o ̣ ̂ | Ọ ̂ | Ộ | o ̂ ̣ | Ô ̣ | Ộ | o ̂ | Ô | o ̛ ́ | Ơ ́ | Ớ | o ́ ̛ | Ó ̛ | Ớ | o ̛ ̀ | Ơ ̀ | Ờ | o ̀ ̛ | Ò ̛ | Ờ | o ̛ ̉ | Ơ ̉ | Ở | o ̉ ̛ | Ỏ ̛ | Ở | o ̛ ̃ | Ơ ̃ | Ỡ | o ̃ ̛ | Õ ̛ | Ỡ | o ̛ ̣ | Ơ ̣ | Ợ | o ̣ ̛ | Ọ ̛ | Ợ | o ̛ | Ơ | o ́ | Ó | o ̀ | Ò | o ̃ | Õ | o ̉ | Ỏ | o ̣ | Ọ | u ̛ ́ | Ư ́ | Ứ | u ́ ̛ | Ú ̛ | Ứ | u ̛ ̀ | Ư ̀ | Ừ | u ̀ ̛ | Ù ̛ | Ừ | u ̛ ̉ | Ư ̉ | Ử | u ̉ ̛ | Ủ ̛ | Ử | u ̛ ̃ | Ư ̃ | Ữ | u ̃ ̛ | Ũ ̛ | Ữ | u ̛ ̣ | Ư ̣ | Ự | u ̣ ̛ | Ụ ̛ | Ự | u ̛ | Ư | u ́ | Ú | u ̀ | Ù | u ̉ | Ủ | u ̃ | Ũ | u ̣ | Ụ | y ́ | Ý | y ̀ | Ỳ | y ̉ | Ỷ | y ̃ | Ỹ | y ̣ | Ỵ ) | [ - z ] ) + + (

we can see bunch of same character repeating not same - different sequences represent same character.

with same method, allow analyze regex in effort 2 see why fails.

java.util.regex.patternsyntaxexception: unclosed grouping near index 596 (?:(?:[Đ]|á|Á|à|À|ã|Ã|ả|Ả|ạ|Ạ|ă|Ă|ắ|Ắ|Ắ|ằ|Ằ|Ằ|ẳ|Ẳ|Ẳ|ẵ|Ẵ|Ẵ|ặ|Ặ|Ặ|ặ|Ặ|Ặ|â|Â|ấ|Ấ|Ấ|ầ|Ầ|Ầ|ẩ|Ẩ|Ẩ|ẫ|Ẫ|Ẫ|ậ|Ậ|Ậ|ậ|Ậ|Ậ|é|É|è|È|ẻ|Ẻ|ẽ|Ẽ|ẹ|Ẹ|ê|Ê|ế|Ế|Ế|ề|Ề|Ề|ể|Ể|Ể|ễ|Ễ|Ễ|ệ|Ệ|Ệ|ệ|Ệ|Ệ|í|Í|ì|Ì|ỉ|Ỉ|ĩ|Ĩ|ị|Ị|ó|Ó|ò|Ò|õ|Õ|ỏ|Ỏ|ọ|Ọ|ô|Ô|ố|Ố|Ố|ồ|Ồ|Ồ|ổ|Ổ|Ổ|ỗ|Ỗ|Ỗ|ộ|Ộ|Ộ|ộ|Ộ|Ộ|ơ|Ơ|ớ|Ớ|Ớ|ớ|Ớ|Ớ|ờ|Ờ|Ờ|ờ|Ờ|Ờ|ở|Ở|Ở|ở|Ở|Ở|ỡ|Ỡ|Ỡ|ỡ|Ỡ|Ỡ|ợ|Ợ|Ợ|ợ|Ợ|Ợ|ú|Ú|ù|Ù|ủ|Ủ|ũ|Ũ|ụ|Ụ|ư|Ư|ứ|Ứ|Ứ|ứ|Ứ|Ứ|ừ|Ừ|Ừ|ừ|Ừ|Ừ|ử|Ử|Ử|ử|Ử|Ử|ữ|Ữ|Ữ|ữ|Ữ|Ữ|ự|Ự|Ự|ự|Ự|Ự|ý|Ý|ỳ|Ỳ|ỷ|Ỷ|ỹ|Ỹ|ỵ|Ỵ)|[a-z])++( ^

insert space between every character:

( ? : ( ? : [ Đ ] | ́ | Á | ̀ | À | ̃ | Ã | ̉ | Ả | ̣ | Ạ | ̆ | Ă | ̆ ́ | Ă ́ | Ắ | ̆ ̀ | Ă ̀ | Ằ | ̆ ̉ | Ă ̉ | Ẳ | ̆ ̃ | Ă ̃ | Ẵ | ̣ ̆ | Ạ ̆ | Ặ | ̆ ̣ | Ă ̣ | Ặ | ̂ | Â | ̂ ́ | Â ́ | Ấ | ̂ ̀ | Â ̀ | Ầ | ̂ ̉ | Â ̉ | Ẩ | ̂ ̃ | Â ̃ | Ẫ | ̣ ̂ | Ạ ̂ | Ậ | ̂ ̣ | Â ̣ | Ậ | e ́ | É | e ̀ | È | e ̉ | Ẻ | e ̃ | Ẽ | e ̣ | Ẹ | e ̂ | Ê | e ̂ ́ | Ê ́ | Ế | e ̂ ̀ | Ê ̀ | Ề | e ̂ ̉ | Ê ̉ | Ể | e ̂ ̃ | Ê ̃ | Ễ | e ̣ ̂ | Ẹ ̂ | Ệ | e ̂ ̣ | Ê ̣ | Ệ | ́ | Í | ̀ | Ì | ̉ | Ỉ | ̃ | Ĩ | ̣ | Ị | o ́ | Ó | o ̀ | Ò | o ̃ | Õ | o ̉ | Ỏ | o ̣ | Ọ | o ̂ | Ô | o ̂ ́ | Ô ́ | Ố | o ̂ ̀ | Ô ̀ | Ồ | o ̂ ̉ | Ô ̉ | Ổ | o ̂ ̃ | Ô ̃ | Ỗ | o ̣ ̂ | Ọ ̂ | Ộ | o ̂ ̣ | Ô ̣ | Ộ | o ̛ | Ơ | o ̛ ́ | Ơ ́ | Ớ | o ́ ̛ | Ó ̛ | Ớ | o ̛ ̀ | Ơ ̀ | Ờ | o ̀ ̛ | Ò ̛ | Ờ | o ̛ ̉ | Ơ ̉ | Ở | o ̉ ̛ | Ỏ ̛ | Ở | o ̛ ̃ | Ơ ̃ | Ỡ | o ̃ ̛ | Õ ̛ | Ỡ | o ̛ ̣ | Ơ ̣ | Ợ | o ̣ ̛ | Ọ ̛ | Ợ | u ́ | Ú | u ̀ | Ù | u ̉ | Ủ | u ̃ | Ũ | u ̣ | Ụ | u ̛ | Ư | u ̛ ́ | Ư ́ | Ứ | u ́ ̛ | Ú ̛ | Ứ | u ̛ ̀ | Ư ̀ | Ừ | u ̀ ̛ | Ù ̛ | Ừ | u ̛ ̉ | Ư ̉ | Ử | u ̉ ̛ | Ủ ̛ | Ử | u ̛ ̃ | Ư ̃ | Ữ | u ̃ ̛ | Ũ ̛ | Ữ | u ̛ ̣ | Ư ̣ | Ự | u ̣ ̛ | Ụ ̛ | Ự | y ́ | Ý | y ̀ | Ỳ | y ̉ | Ỷ | y ̃ | Ỹ | y ̣ | Ỵ ) | [ - z ] ) + + (

notice a ̂ | Â comes before a ̂ ̀ | Â ̀ | Ầ in regex. means a ̂ tried first on input ầ (a ̂ ̀), , repetition end when fails match in next iteration.

since order of alternation important, general rule, between 2 strings 1 string prefix of other, longer string should go first in alternation. in our case, need place characters more diacritics before character less or without diacritics.

same problem effort 1:

java.util.regex.patternsyntaxexception: unclosed grouping near index 589 (?:[a-zĐ]|ắ|Ắ|Ắ|ằ|Ằ|Ằ|ẳ|Ẳ|Ẳ|ẵ|Ẵ|Ẵ|ặ|Ặ|Ặ|ặ|Ặ|Ặ|ă|Ă|ấ|Ấ|Ấ|ầ|Ầ|Ầ|ẩ|Ẩ|Ẩ|ẫ|Ẫ|Ẫ|ậ|Ậ|Ậ|ậ|Ậ|Ậ|â|Â|á|Á|à|À|ã|Ã|ả|Ả|ạ|Ạ|ế|Ế|Ế|ề|Ề|Ề|ể|Ể|Ể|ễ|Ễ|Ễ|ệ|Ệ|Ệ|ệ|Ệ|Ệ|ê|Ê|é|É|è|È|ẻ|Ẻ|ẽ|Ẽ|ẹ|Ẹ|í|Í|ì|Ì|ỉ|Ỉ|ĩ|Ĩ|ị|Ị|ố|Ố|Ố|ồ|Ồ|Ồ|ổ|Ổ|Ổ|ỗ|Ỗ|Ỗ|ộ|Ộ|Ộ|ộ|Ộ|Ộ|ô|Ô|ớ|Ớ|Ớ|ớ|Ớ|Ớ|ờ|Ờ|Ờ|ờ|Ờ|Ờ|ở|Ở|Ở|ở|Ở|Ở|ỡ|Ỡ|Ỡ|ỡ|Ỡ|Ỡ|ợ|Ợ|Ợ|ợ|Ợ|Ợ|ơ|Ơ|ó|Ó|ò|Ò|õ|Õ|ỏ|Ỏ|ọ|Ọ|ứ|Ứ|Ứ|ứ|Ứ|Ứ|ừ|Ừ|Ừ|ừ|Ừ|Ừ|ử|Ử|Ử|ử|Ử|Ử|ữ|Ữ|Ữ|ữ|Ữ|Ữ|ự|Ự|Ự|ự|Ự|Ự|ư|Ư|ú|Ú|ù|Ù|ủ|Ủ|ũ|Ũ|ụ|Ụ|ý|Ý|ỳ|Ỳ|ỷ|Ỷ|ỹ|Ỹ|ỵ|Ỵ)++( ^

since alternations formed after original character class, vowels in [a-z] tried first, leading repetition terminating when encounters stray combining mark.

reference vietnamese alphabetical system common vietnamese input method optimized unicode composition , decomposition appendix

below source code of testing program.

demo on ideone

import java.util.regex.*; import java.text.*; class ideone { public static void main (string[] args) throws java.lang.exception { string vietnamese_diacritic_characters = "ẮẰẲẴẶĂẤẦẨẪẬÂÁÀÃẢẠĐẾỀỂỄỆÊÉÈẺẼẸÍÌỈĨỊỐỒỔỖỘÔỚỜỞỠỢƠÓÒÕỎỌỨỪỬỮỰƯÚÙỦŨỤÝỲỶỸỴ"; /* (char c: vietnamese_diacritic_characters.tochararray()) { system.out.println(c + ": " + character.getname(c)); } */ string tests[] = new string[3]; tests[0] = "bạn chính là tác giả của wikipedia!\n" + "mọi người đều có thể biên tập bài ngay lập tức, chỉ cần nhớ vài quy tắc." + "có sẵn rất nhiều trang trợ giúp như tạo bài, sửa bài hay tải ảnh." + "bạn cũng đừng ngại đặt câu hỏi.\n" + "hiện chúng ta có 1.109.446 bài viết và 406.782 thành viên."; tests[1] = normalizer.normalize(tests[0], normalizer.form.nfd); /* (char c: tests[1].tochararray()) { system.out.printf("%04x ", (int) c); } */ tests[2] = normalizer.normalize(tests[0], normalizer.form.nfc); seek { pattern p = pattern.compile("(?:[" + vietnamese_diacritic_characters + "]|[a-z])++", pattern.canon_eq | pattern.case_insensitive | pattern.unicode_case); (string t: tests) { matcher m = p.matcher(t); while (m.find()) { system.out.print(m.group() + " "); } system.out.println(); } } grab (exception e) { system.out.println(e); } } }

java regex

sensor - how can I use magnetometer accelerometer data on IOS to determine the orientation of iphone -



sensor - how can I use magnetometer accelerometer data on IOS to determine the orientation of iphone -

how can utilize 3d magnetometer , accelerometer info on ios determine orientation of smart phone ? links reference welcome. thanks

i know old question, reply lacking, here link blog post talks that.

sensor android-sensors

angularjs - ngRepeat seems to use a random order instead of order given -



angularjs - ngRepeat seems to use a random order instead of order given -

i have json containing objects originating symfony controller.

i need loop on objects so

<li data-ng-repeat="course in courses"></li>

in app controller this

$scope.courses = {{ courses | serialize('json', serialization_context().setgroups(['identification', 'courselisting', 'portaloverview'])) | raw }};

the order okay when check scope variable 'courses' ng-inspect browser plugin.

screenshot : http://i.imgur.com/pky00uo.png

but still loop seems kinda random. lastly object keeps getting placed after 2nd child.

any ideas? need more info, ask. thanks!

okay, seems angular doesn't handle objects when given ng-repeat. transformed object of objects array of objects , objects rendered in right order.

var arrcourses = []; $.each($scope.courses, function(index, obj){ arrcourses.push(obj); }); $scope.courses = arrcourses;

angularjs symfony2

Neo4j creating relationships using csv -



Neo4j creating relationships using csv -

i trying create relationships between 2 types of nodes using csv file loaded. have created movies , keywords nodes. created indexes on :movie(title) , :keyword(word).

my csv file looks like:

"title"|year|"word" //header

"into wild"|2007|"1990s" //line title, year , keyword

"into wild"|2007|"abandoned-bus"

my query:

load csv headers "file:/home/gondil/temp.csv" csv fieldterminator '|' match (m:movie {title:csv.title,year: toint(csv.year)}), (k:keyword {word:csv.word}) merge (m)-[:has {weight:1}]->(k);

query runs 1 hr , shows error "unknown error". redundant error description.

i thought due 160k keywords , on 1m movies , on 4m lines in csv. shorten csv 1 line , still running 15 minutes no stop.

where problem? how write query creating relationships between 2 created nodes?

i can delete nodes , build database other way improve not delete created nodes.

note: shouldn't have hardware problems cause utilize super pc our faculty.

be sure have schema indexes in place speed looking start nodes. before running import a:

create index on :movie(title) create index on :keyword(word)

make sure indexes populated , online (check :schema command).

refactor cypher command 2 queries, create utilize of indexes - index consists of label , one property:

using periodic commit load csv headers "file:/home/gondil/temp.csv" csv fieldterminator '|' merge (m:movie {title:csv.title }) on create set m.year = toint(csv.year) merge (k:keyword {word:csv.word})

second pass on file

using periodic commit load csv headers "file:/home/gondil/temp.csv" csv fieldterminator '|' match (m:movie {title:csv.title }) match (k:keyword {word:csv.word}) merge (m)-[:has {weight:1}]->(k);

csv neo4j cypher relationships

css - How to create a transparent circle? -



css - How to create a transparent circle? -

this question has reply here:

transparent circle using css? 3 answers how create inverse transparent circle in css [duplicate] 2 answers

is there way effect in css ?

i seek play css cuts first layer.

div{ width:300px; height:300px; position:relative; overflow:hidden; } div:before{ content:''; position:absolute; bottom:50%; width:100%; height:100%; border-radius:100%; box-shadow: 0px 300px 0px 300px #448ccb; }

the simplest way utilize transparent div overflow hidden (the grayness one) within set circle box-shadow big spread.

class="snippet-code-css lang-css prettyprint-override">html, body{height:100%;} body{ background: url(http://web-vassets.ea.com/assets/richmedia/image/screenshots/fifa-street-london1web.jpg?cb=1330546446) 50% / cover; } .hascircle{ width:150px; height:300px; position:relative; overflow:hidden; float:left; } .hascircle:after{ content:" "; position:absolute; left:0; right:0; margin:100px auto; width:100px; height:100px; border-radius:50%; box-shadow: 0 0 0 1000px #444; } class="snippet-code-html lang-html prettyprint-override"><div class="hascircle"></div> <div class="hascircle"></div> <div class="hascircle"></div>

as can see above i've used :after pseudo element might prevent text in .hascircle visible (due overlapping pseudo-element), it's idea, can using real element like:

<div class="boxtransparentoverflow"> <div class="thetransparentcirclewithgrayspread"></div> text </div>

css css-shapes

Calling Flipkart Api in asp.net c# -



Calling Flipkart Api in asp.net c# -

i calling flip kart api in asp.net c# .but got next error : 401 authorization.

i included flip kart token , affiliate id in rest header per prerequisites , category

url also.so please tell me why getting error. calling restapi using httpclientrequest , asp.net framework 4.0

first need product category link list simple 'get' using url

https://affiliate-api.flipkart.net/affiliate/api/<your-affiliate-id>.<json or xml>

the response have list of various categorizes , url. these urls require http authentication headers (your affiliate-id , access token) in request. can add together :-

webclient wc = new webclient(); wc.headers.add("fk-affiliate-id", "blueskyvic"); wc.headers.add("fk-affiliate-token", "your access code"); string res = wc.downloadstring("https://affiliate-api.flipkart.net/affiliate/feeds/blueskyvic/category/v1:6bo-ul6.json?expiresat=1420832915393&sig=6c1167c0d141bd3edab28f9f2a980a30");//tv_video_accessories

the response have nexturl property give listing of next 50 items in category.

asp.net api

java - How to read manifest.mf from *.war/META-INF/MANIFEST.MF file? -



java - How to read manifest.mf from *.war/META-INF/MANIFEST.MF file? -

using maven compiled *.war file, contains:

- meta-inf - - manifest.mf - web-inf - - classes - - lib - - web.xml

using java.util.jar.manifest want read manifest file application version there in http://stackoverflow.com/a/21046257/1728511

but application.class.getresourceasstream("/meta-inf/manifest.mf") returns null.

application.class.getresource( "" ).getfile() returns %war%/web-inf/lib/javax.ws.rs-api-2.0.jar!/javax/ws/rs/core/

using spring, i've implemented applicationcontextaware interface applicationcontext instance.

and applicationcontext.getclassloader().getresourceasstream( "" ) returns %war%/web-inf/classes.

but don't need web-inf, need meta-inf directory. how it?

you mixing cases. meta-inf contains manifest.mf trying open resource stream on manifest.mf.

you have change

application.class.getresourceasstream("/meta-inf/manifest.mf")

to

application.class.getresourceasstream("/meta-inf/manifest.mf")

java spring maven web-applications

iis 7 - How to turn on MySQL Server in Windows 8 -



iis 7 - How to turn on MySQL Server in Windows 8 -

i installed mysql 5.6.21 in windows 8.1.

i unable turn on server after turning on laptop.

i used xamp previously. now, using iis. please help me this.

open

control panel>all command panel items>administrative tools>services

right click on mysql & select enable..

(optional) open properties & can take automatic..

mysql iis-7

SQL server how to do string comparison with left join -



SQL server how to do string comparison with left join -

i have 2 tables: entry table (one nvarchar column called entry) , disease table (one nvarchar column called disease).

i produce table has entry-disease combos entry.entry contained in disease.disease. however, want entries not have disease contained within of them still appear in results table {entry, blank}.

i know should like:

select entry disease entry, disease ...

not sure how write this, in advance

ok, figured out much:

select entry.entry, disease.disease new_table entry, disease charindex(entry, disease) > 0

how include entries have no match?

you can utilize left join in case. show entries , provide null value column disease.disease if entry not contained in cell of disease.disease.

select entry.entry, disease.disease entry left bring together disease on charindex(entry.entry, disease.disease) > 0

sql sql-server

angularjs - How to use a different routeProvider depending on a section of your site -



angularjs - How to use a different routeProvider depending on a section of your site -

suppose have multiple sections on site, depending on someones role.

/customer /manager /administrator

i wonder how set angular routes url's possible:

/customer /customer#/account /customer#/mybasket /manager /manager#/account /manager#/orders /administrator /administrator#accounts /administrator#settings

the "when" status of $routeprovider check on url after hash sign. how can first reroute based on first part of url? or how map unique routeprovider per url (/customer, /manager, /administrator) ?

the alternative have utilize html5mode=true , rid of # altogether. requires handling total page refresh in case server need homecoming right html.

this $location developer guide

server side

using mode requires url rewriting on server side, have rewrite links entry point of application (e.g. index.html). requiring tag of import case, allows angular differentiate between part of url application base of operations , path should handeled application.

angularjs angular-routing

word vba - VBA adding a list empty fields from a userform to a message box -



word vba - VBA adding a list empty fields from a userform to a message box -

i have created userform requires user input several strings or integers. trying message box come if several of mandatory boxes not filled in. want list empty fields skip fields filled in. know how loop if values integers of inputs strings. think dim c control, , know general layout of message box, stumped beyond that. please help don’t have write 6 separate conditional statements 6 separate message boxes!

the 6 form field names are: proposal_name, date_of_submission, cbocontraact_type, contract_neg_name, contract_neg_number, , validity_period

the general layout of message box had in mind follows:

msgbox "you have left next mandatory fields empty:" & vbcrlf & vbcrlf & "proposal_name" & vbnewline & "date_of_submission" & chr(10) & "cbocontraact_type" & chr(10) & "contract_neg_name" & chr(10) & "validity_period"

since concerned 6 fields, not go downwards path of looping through form controls, determining command type, checking missing value, etc.

here onclick command button might work you:

private sub command12_click() dim smissingvalues string smissingvalues = "" if nz(me!proposal_name, "") = "" smissingvalues = smissingvalues + vbcrlf + "proposal_name" if nz(me!date_of_submission, "") = "" smissingvalues = smissingvalues + vbcrlf + "date_of_submission" if nz(me!cbocontraact_type, "") = "" smissingvalues = smissingvalues + vbcrlf + "cbocontraact_type" if nz(me!contract_neg_name, "") = "" smissingvalues = smissingvalues + vbcrlf + "contract_neg_name" if nz(me!contract_neg_number, "") = "" smissingvalues = smissingvalues + vbcrlf + "contract_neg_number" if nz(me!validity_period, "") = "" smissingvalues = smissingvalues + vbcrlf + "validity_period" if smissingvalues <> "" msgbox "you have left next mandatory fields empty:" & vbcrlf & smissingvalues end if end sub

word-vba msgbox

sql server - Default_Schema not working -



sql server - Default_Schema not working -

i have default schema user xyzcorp\jshmoe set 'accounting'. when log xyzcorp\jshmoe , execute select schema_name() returns "dbo" instead of 'accounting'.

consequentially works:

select * accounting.userinfo

but doesn't:

select * userinfo

xyzcorp\jshmoe not sysadmin.

as note, above on our production server. on our dev server seems same (all login , user properties can see) work.

as you're finding, default_schema kind of fragile. recommendation not rely on mechanism object resolution rather qualify objects (e.g. accounting.userinfo instead of userinfo). said...

here couple of situations explain you're seeing:

the user fellow member of sysadmin group. according documentation, members of sysadmin dbo default schema regardless of database ownership. check sys.login_token view confirm or deny this

the user fellow member of windows grouping database principal (i.e. has entry in sys.database_principals) , has default_schema set. documentation clear how resolution works here well: if user belongs such group, group's default schema used. if user belongs multiple such groups, default_schema grouping the lowest principal id used (emphasis mine). so, if have same groups between dev , production servers, if created in different order, results different between 2 environments. check sys.user_token view see grouping memberships current user has.

so, assuming can't take initial advice of qualifying objects, check 2 conditions above.

sql-server

Liferay 6.2: Possibility to import Sass files from my theme into a portlets main.css -



Liferay 6.2: Possibility to import Sass files from my theme into a portlets main.css -

i’m diggin liferay theming sass.

one thing know is: how create utilize of variables defined in theme within custom portlet.

because want have generic theme related styles within theme , portlet specific styles within portlet increment maintainabilty und portability.

lets have follwing file within theme: css/_ aui_variables.scss

within file have overridden default values of bootstrap variables defined in parent theme: _styled/css/_aui_variables.scss

of course of study create utilize of these variables in portlet specific sass files place within portlets main.css (which compiled sass parser well).

please allow me know possible.

when trying import variables in portlets main.css via:

@import "foobar-default-theme/css/_aui_variables";

my console in eclipse (liferay ide) shows me next error message:

file import not found or unreadable: foobar-default-theme/css/_aui_variables. load paths: /users/mkuehnel/documents/projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/root/html/css/common /users/mkuehnel/documents/projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/25-foobar-top-navigation-portlet/css /users/mkuehnel/documents/projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/root/web-inf/lib/sass /users/mkuehnel/documents/projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/liferay/ruby/gems/compass-0.12.2/frameworks/blueprint/stylesheets /users/mkuehnel/documents/projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/liferay/ruby/gems/compass-0.12.2/frameworks/compass/stylesheets compass::spriteimporter /css/main.css:2 […]

any hints appreciated.

best regards, michael

sass liferay liferay-6 portlet liferay-theme

qt - Can QSGNode inherit QObject? -



qt - Can QSGNode inherit QObject? -

can qsgnode inherit qobject , connect signals , slots? have tried slot called when rendering done.

i had matrix of cells. using qml display them on bi dimensional listview (a listview had in each delegate listview). lacked performance changed scenegraph. problem info model. i'm passing qlist, column has qlist. each row has cells have signals. cells change. want notify render updates on signals. solution until have improve 1 create each cell trigger changed signal on respective column it's turn turn update flag on main qquickitem implementing scene.

ideas?

you should connect signals model qquickitem handles qsgnode instead of straight connecting qsgnode. qsgnode objects supposed handled within qsgrenderingthread.

qobjects 'live' in 1 thread. thread emit , receive signals. making qsgnode qobject, must pay attending emitting , receiving threads otherwise you'll symptoms ones describe. unless specify qt::directconnection when create connection, if signal emitted 1 thread , received object living in thread, signal converted message , dispatched later using qeventloop.

a practice have construction ones provided in qt examples :

qquickitem handles signal connections , stores properties. depending on has changed, qquickitem sends commands qsgnode recalculate parts of geometry. done through qquickitem::updatepaintnode()

qt scenegraph

jquery - colorbox: Sending user to another page -



jquery - colorbox: Sending user to another page -

i have colorbox data:

<a href="#div1">how select gift?</a> <div style="display:none"> <div class="" id="div1"> here text w/ <a href="to new page">foo</a> </div> </div> </div> <script type="text/javascript"> $('.div1').colorbox({inline:true, width:"50%"}); </script>

when user clicks on "foo", want user directed page "to new page" right colorbox seems collapse. what's right way prepare this?

thanks

not sure if best answer, here did , works:

<a href="to new page" class="external">foo</a> <script type="text/javascript"> $('.external').click() { location.href=this.getattribute('href'); homecoming false; })

jquery html colorbox

php - How do I open an mp3 file and check for frames to validate it? -



php - How do I open an mp3 file and check for frames to validate it? -

i can't seem find proper check if file mp3.

some files homecoming audio/mpeg , others application/octet-stream while playable media players.

someone suggested opening file , check valid frames. wondering how going start php. give me light.

i tried this, results not right.

$file = 'file_dir'; $finfo = finfo_open(fileinfo_mime_type); $mime = finfo_file($finfo, $file); echo $mime;

php validation mp3 mime-types

java - compatability of datatypes across client and server side(both implemented in different languages) of a SOAP web srvice -



java - compatability of datatypes across client and server side(both implemented in different languages) of a SOAP web srvice -

i working on soap web service(contract first approach, wsdl in place define operation parameters , datatypes). languages in client side code written , server side code written different. while working on same got below queries. have searched on net did not much help.

suppose there parameter "param" datatype "xxx". range of "xxx" datatype not match range of server side language. then, happen in case? how request parameter marshaled server side though datatype same range different?

if client side code generated in java using axis2, improve approach while making instance of stub class- each request instance of stub class should created or stub class instance should created 1 time throughout application , service calls should made using single stub instance?

does instantiation of stub create connection service prior calling service method? per knowledge not create connection till actual service phone call made , 1 time response received connection close (until http connection timeout). so?

thanks in advance.

java web-services soap axis2

vba - Change the font of specific words in cells -



vba - Change the font of specific words in cells -

i trying alter font of specific words in range of cells. in range of a2:q1000, if word risk or high in cell, font should alter reddish , bold. below code set far.

sub font_change() dim ddata range dim name string set ddata = sheets("sheet1").range("a2:q10000") each cell in ddata if cell = "risk" cell.font.color = 2 cell.font.bold = true elseif cell = "medium" cell.font.bold elseif cell = "hign" cell.font.color = 2 cell.font.bold = true end if next end sub

try this:

sub tests() each cell in range("a2:q1000") if ucase(cell.value) "*risk*" or ucase(cell.value) "*high*" cell.font.color = vbred cell.font.bold = true end if if ucase(cell.value) "*medium*" cell.font.color = vbred next cell end sub

vba

c - Checking each char in a string giving unexpected results -



c - Checking each char in a string giving unexpected results -

i'm making base64 encoder/decoder, have function encode input binary base64 representation. input string of 0's , 1's.

my if statement failing validate each char in string '0' or '1'. says every char not '0' or '1'. though is.

my code: (not total functions code...)

#include <stdio.h> #include <string.h> char *enc(char *); int main(void) { enc("1101010100100101001010010101001"); homecoming 0; } char *enc(const char *data) { int i; for(i = 0; < strlen(data); i++) { if(data[i] != '0' || data[i] != '1') { printf("index %d not 0 or 1\n", i); printf("instead is: %c\n", data[i]); } } homecoming null; }

this outputs every char not 0 or 1.

ideone: http://ideone.com/0mqnn4

if(data[i] != '0' || data[i] != '1')

if char not 0 or char not 1 -> true. think meant and:

if(data[i] != '0' && data[i] != '1')

"not or b" in english language translates "not (a or b)" in boolean logic, de morgan's laws, equivalent "(not a) , (not b)".

c string char base64

unsigned integer getting overflowed in c -



unsigned integer getting overflowed in c -

this question has reply here:

unsigned int in c behaves negative 8 answers

i wrote simple c programme find maximum positive number can reach using unsigned integer given below. size of integer on machine 4 bytes.

#include <stdio.h> #include <math.h> main() { unsigned int x = 1; int = 1; for(; <= 31; i++) { x = x * 2; } unsigned int y = pow(2, 31); printf("%d\n", x); printf("%d\n", y); }

both x, y getting overflowed , value -2147483648. thought should not overflow because on machines sizeof(int) = 4 bytes, unsigned int range should pow(2, 32) - 1. can 1 please allow me know why getting overflowed?

you want utilize %u unsigned int:

printf("%u\n", x); printf("%u\n", y);

c

develop android multiplayer game -



develop android multiplayer game -

i seek develop multiplayer game in android,so far developed game on client side , works fine,but got know how develop server side. how people can play in internet? game turns base,all need know start with,i have read articles can't understand if need pruchase server , how connect server via android.

thanks help.

you need server api multiplayer game,

for illustration 1st player moved position 25.

send post request http://example.com/move parameters(like postion,etc)

and other side can continuously check move

use php,mysql,slim frame work create api.

i found tutorial http://www.androidhive.info/2014/01/how-to-create-rest-api-for-android-app-using-php-slim-and-mysql-day-12-2/

android multiplayer

c# - No process on the other end of the pipe. Error after restoring DB -



c# - No process on the other end of the pipe. Error after restoring DB -

i restoring db stored procedure web app. accomplish set db single user mode restore replace overwrites current db. after restore set multi_user mode. appears work fine until navigate page runs query producting error. have tried this blog post linking error. after click page , page 1 time again error goes away. ideas what's going on here?

a transport-level error has occurred when sending request server. (provider: shared memory provider, error: 0 - no process on other end of pipe.) type: system.data.sqlclient.sqlexception source: .net sqlclient info provider stack: @ system.data.sqlclient.sqlconnection.onerror(sqlexception exception, boolean breakconnection) @ system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj) @ system.data.sqlclient.tdsparserstateobject.writesni() @ system.data.sqlclient.tdsparserstateobject.executeflush() @ system.data.sqlclient.tdsparser.tdsexecuterpc(_sqlrpc[] rpcarray, int32 timeout, boolean inschema, sqlnotificationrequest notificationrequest, tdsparserstateobject stateobj, boolean iscommandproc) @ system.data.sqlclient.sqlcommand.runexecutereadertds(commandbehavior cmdbehavior, runbehavior runbehavior, boolean returnstream, boolean async) @ system.data.sqlclient.sqlcommand.runexecutereader

i suspect issue pooled connection got killed , error returned when effort made reuse broken one. seek invoking sqlconnection.clearpool after restore.

c# sql sql-server

java - e's Datasource Not injecting in @controller in spring-mvc 3 -



java - e's Datasource Not injecting in @controller in spring-mvc 3 -

i trying develop spring-mvc 3 web application learning purpose. newbie i'am not in spring mvc.

so here problem datasource of admindao.java returns null in @controller class

@controller public class adminpanel { @autowired iadminservices admindao; @requestmapping(value={"/adminpanel.spring"},method=requestmethod.get) public string execute(@modelattribute login login){ homecoming "adminpanel"; .... }

here datasource injected null

her application context

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="org.postgresql.driver" /> <property name="url" value="jdbc:postgresql://localhost:5432/librarysystem" /> <property name="username" value="postgres" /> <property name="password" value="postgres" /> </bean> <bean id="admindao" class="in.kailash.dao.admindao"> <property name="datasource" ref="datasource" /> </bean> </beans>

my iadminservices.java

@component public interface iadminservices { public string save(user user); public string delete(user user,string id); public string edit(user user,string id); public list<user> viewall(); public string issue(); public string returnbook(); public string getstudentcardnumber(); }

admindao class implementing iadminservices.java

@service public class admindao implements iadminservices { datasource datasource; public admindao() { super(); } public void setdatasource(datasource datasource) { this.datasource = datasource; } @override public string save(user user) { seek { connection con = datasource.getconnection(); string sql = "insert borrower(cardno,name,address,phone) values(?,?,?,?)"; ... .... }

here's mvc-servlet.xml

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="in.kailash" /> <context:annotation-config/> <bean id="viewresolver" class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix" value="/web-inf/jsps/" /> <property name="suffix" value=".jsp"/> </bean> </beans>

here's web.xml

<web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns /javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>libsys</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>maincontroller</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>maincontroller</servlet-name> <url-pattern>*.spring</url-pattern> </servlet-mapping> <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/maincontroller-servlet.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> </web-app>

my main problem datasource null in @controller class. newbie farther comments how arrange classes in spring-mvc welcomed.

thanks in advance.

@sotirios patience reply. according suggestions have done changes in

web.xml

as

<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>libsys</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>maincontroller</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/maincontroller-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>maincontroller</servlet-name> <url-pattern>*.spring</url-pattern> </servlet-mapping> <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/applicationcontext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener>

somehow datasource getting injected. want confirm time have done right. , if find problem in bundle arrangement please comment

i'm going assume admindao class nested somewhere within bundle declared here

<context:component-scan base-package="in.kailash" />

if that's case, spring generate new bean type admindao since annotated @service. process bean, won't autowire datasource in because haven't asked to. admindao bean injected @controller, not 1 application context.

instead, seems want utilize admindao bean you've declared in application context.

you have 2 options:

remove @service annotation admindao class spring correctly uses admindao <bean> you've declared in application context. remove <bean> declaration admindao , add together @autowired datasource field or setter

java spring spring-mvc