Posts

Showing posts from August, 2013

PHP files for users -

i'm trying understand concept i've been trying learn last couple days; i see many social networks using user's id in url after file (example: "socialnetwork.php?id=123") navigate user. i want make profile.php same thing instead of directing me homepage everytime. question: how can use user's id in database read out unique profile data them in single file? - furthermore, should add register_config.php file allow this? <?php //requiring pass api config require 'password_config.php'; require 'connect.php'; //variables post data //other variables $email = $_post['register_email']; $username = $_post['register_username']; $userlen = strlen($username); $password = $_post['register_password']; $passlen = strlen($password); $submit = $_post['register_submit']; $hash_password = password_hash($password,password_bcrypt); $query = "s...

ubuntu 12.04 - Nginx domain work without be into sites-enabled -

i have strange bug in nginx configuration. if stop nginx, every domains stop working, normal. if remove or comment include /etc/nginx/sites-enabled/*; (in nginx.conf) every domains stop working, normal. if rename sites-enabled folder, nginx wont restart , domain stop working, normal. if remove sites-enabled folder, nginx wont restart , domain stop working, normal. but if remove domaine sites-enabled folder, restart/reload nginx, domain still working. how possible ? there "config cache" somewhere ? ps: reboot server manytime, updated nginx , have exact same configuration in 1 server problem not appear. have deleted default config located in sites-enabled directory? way not critical issue.

c# - ListBox with Rounded Corners (Windows Store App) -

i have listbox inside flyout . there way of making listbox corners rounded? have searched , couldn't find anything. there style/ xaml template recommend? this code: <flyout> <flyout.flyoutpresenterstyle> <style targettype="flyoutpresenter"> <setter property="margin" value="30,30,0,0"/> <setter property="background" value="transparent"/> <setter property="borderbrush" value="transparent"/> <setter property="borderthickness" value="0"/> <setter property="minheight" value="300"/> <setter property="minwidth" value="200"/> </style> </flyout.flyoutpresenterstyle> <listbox x:name="allitemsview" width="200" height="auto" border...

Adding Bootstrap to Jekyll -

i'm new jekyll , pull in of twitter bootstrap functionality. has done and, if so, have advice? have gone jekyll-bootstrap, there no longer support it. have built jekyll site , hoping there's way pull in bootstrap. as jekyll natively supports sass, can use bootstrap-sass . i install bower install bootstrap-sass command. this installs bootstrap , jquery in bower_components folder. configuration in _config.yml add : sass: # loading path site root # default _sass sass_dir: bower_components/bootstrap-sass/assets/stylesheets # style : nested (default), compact, compressed, expanded # :nested, :compact, :compressed, :expanded works # see http://sass-lang.com/documentation/file.sass_reference.html#output_style # on typical twitter bootstrap stats : # nested 138,7kb, compact 129,1kb, expanded 135,9 kb, compressed 122,4 kb style: compressed javascript if want use javascript, in _includes/footer.html add : <script src="{{ s...

mysql - C# - Kerosene ORM - Can't find the default engine and the connection string -

i new c#/.net world , trying developp c# application using kerosene orm link mysql database. it's local database hosted wamp. to initiate connection database via keroseneorm need provide engine name , connection string. what engine name ? in kerosene code it's described : /// <param name="name">a string containing either invariant name of engine, or /// tail part, or name of connection string entry in configuration files, /// or null. in later case, name of default connection string entry used.</param> i don't know "engine" tried add connection string entry in app.config file : <connectionstrings> <clear /> <add name="localdb" providername="mysql.data.mysqlclient" connectionstring="server=localhost;database=bms;uid=root;pwd=root;" /> </connectionstrings> but rise exception "cannot find 'localdb' registered engine." so basically, "e...

javascript - How to use "change event" in bootstrap-wysiwyg? -

i using bootstrap-wysiwyg. i need event occur after text modified , input box blurred. i saw below code, isn't event want // bind event event $('#wysiwyg').wysiwyg('document').keypress(function(e) { // cancel keypress e.preventdefault(); // alert alert('keypress detected!'); }); i want event occur after text modified , input box blurred. event want similar ".change()" in jquery. i hope me.. thank you.. i know question bit old, here's how can in case still need solve issue in future. assuming you're using latest version of bootstrap-wysiwyg can you're wanting using following code: $('#wysiwyg').wysiwyg().on('change', function() { // code goes here }); you can download latest version here .

ocaml - Why are int32s/int64s slower than ints? -

i've read in reference doc of int32 module: performance notice: values of type int32 occupy more memory space values of type int, , arithmetic operations on int32 slower on int. use int32 when application requires exact 32-bit arithmetic. why int32s happen slower ints? because boxed or something? is because boxed or something? yes.

How to create a singleton service in Aurelia? -

i'm pretty new aurelia (only been using few days) , love it! i know how make service aurelia, how can make service singleton can share data between multiple viewmodels? thanks just inject it by default, di container assumes singleton instance; 1 instance app. however, can use registration decorator change this.

php - What is the mean of zendframework suggests installing -

Image
i install zend skeleton application this link , install via composer. composer notice: zendframework/zendframework suggests installing ext-intl (ext/intl i18n features (included in default builds of php)) zendframework/zendframework suggests installing doctrine/annotations (doctrine annotations >=1.0 annotation features) zendframework/zendframework suggests installing ircmaxell/random-lib (fallback random byte generator zend\math\rand if openssl/mcrypt extensions unavail able) zendframework/zendframework suggests installing ocramius/proxy-manager (proxymanager handle lazy initialization of services) zendframework/zendframework suggests installing zendframework/zendpdf (zendpdf creating pdf representations of barcodes) zendframework/zendframework suggests installing zendframework/zendservice-recaptcha (zendservice\recaptcha rendering recaptchas in zend\captcha and/or zend\form) please explain me above notice (it says suggests installing ). thank you! if want use op...

javascript - how to remove space from html using bootstrap -

Image
i trying make html page show in image having desktop item , mobile item .i using bootstrap css + angular . why white space come ..here code http://plnkr.co/edit/g8mp53rqlf562hekgmgt?p=preview here image var myapp = angular.module('myapp', ['ui.bootstrap','ionic']); //myapp.directive('mydirective', function() {}); myapp.controller('myctrl', myctrl); function myctrl($scope,$http) { $http.get("menu.json").success(function(data){ $scope.menu=data; }).error(function(){ alert('error') }) } secondly what use in bootstrap when display on desktop show three item in row show in desktop image below , if display on mobile device display vertically show in image mobile item desktop updated 1 http://plnkr.co/edit/g8mp53rqlf562hekgmgt?p=preview how come in single vertical column when user move desktop mobile version why white space come bo...

java - Resource Leak (Resource out of scope) -

hi here couple of lines in code. func(){ .... .... objectinputstream in = xstream.createobjectinputstream(is); return (useraccountvo)in.readobject(); } now giving warning "leaked_resource: variable in going out of scope leaks resource refers to" . can please explain it? and 1 more point. how got fixed via this: try(objectinputstream in = xstream.createobjectinputstream(is);) { return (useraccountvo)in.readobject(); } catch (ioexception e) { s_logger.error(e.getmessage()); return null; } in former case, not closing resource 'in' , may result in memory leak. therefore warning. while in later case, have put 'in' instantiation within try block adds implicit 'finally' close resource. hope clarifies.

c# - Implicit Verbs from Method name -

if create webapi controller , , populate methods prefixed http verbs, api able correctly imply verb should used on controller. public class testcontroller : apicontroller { public string getdata() { return "called method"; } public string postdata() { return "called post method"; } public string putdata() { return "called put method"; } } if replace post update , post method continues work implicitly. public string updatedata() { return "called updated method"; } is there list of possible prefixes on method , verb map to? additionally, possible define custom prefixes? instance, if wanted map method starting "search" post , can define this? if put routing following : config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{action}/{id}", defaults: new { id ...

scope - Python set won't perform union -

i have class member defined: self.myset = set() when perform myobject.myset.add('item') , using instance of class, works fine: print(myobject.myset) gives me {'item'} . however, when perform myobject.myset.union(yourset) , yourset not empty, won't work; print(myobject.myset) still prints empty set. why 1 method ( add ) working while ( union ) quietly (no exception thrown) failing? myobject.myset = yourset works, union in particular won't. i'm using python 3. set.union() not modify old set in-place, set.add() does. set.union() returns new set instead. myobject.myset = myobject.myset.union(yourset) this should trick. see python documentation on set.union() more information.

actionscript 3 - AS3 shuffling movieclips -

i've added basic targets , applying drag , drop puzzle pieces, im having trouble making shuffling aspect. in, after player completes or opens fla, each time start puzzle pieces in random places of stage. understand using arrays shuffling somehow im not sure how achieve this. i've stored instance of 19 puzzle pieces inside array have no idea array. other tutorials abit out of league , leaves head scratching. just started doing coding flash professional yeah, shuffling movie clips ie puzzles pieces appreciated. heres's code, im not posting whole thing since p1 p19 copy pasting: import flash.events.event; stage.addeventlistener(event.enter_frame, entframe) function entframe(e: event) : void { p1.addeventlistener(mouseevent.mouse_down, fl_clicktodrag); function fl_clicktodrag(event:mouseevent):void { p1.startdrag(); } stage.addeventlistener(mouseevent.mouse_up, fl_releasetodrop); function fl_releasetodrop(event:mouseevent):void { ...

c# - Is it poor practice to call RaisePropertyChanged() for each property in my ViewModel when I need to "refresh" or "update" the view? -

i use reflection grab property names in class of specific type or access level. run these through raisepropertychanged() "update" entire view. an instance on startup, when program starts , when viewmodel instantiated run ensure view showing correct data model. is there wrong doing this? code if guys want it: private void initializeviewmodel() { foreach (string name in miscmethods.getpropertynames(this)) { raisepropertychanged(name); } } public static ienumerable<string> getpropertynames(object yourclass) { foreach (propertyinfo property in getproperties(yourclass)) { yield return property.name; } } //uses reflection return properties in class private static ienumerable<propertyinfo> getproperties(object theobject) { return theobject.gettype().getproperties(system.reflection.bindingflags.public | system.reflection.bindingflags.flattenhie...

javascript - Google charts overflow in jquery accordion -

i trying make google chart fit in jquery accordion. i'm having annonying scrollbars everywhere, wanted fit in. tryed play overflow property , doesn't seems work. here code : <div id="accordion"> <h3>ticket timeline</h3> <div id='timelines' class='charts'></div> <h3>ticket booking</h3> <div id='booking' class='charts'></div> </div> and css : .charts{ margin:auto; width:100%; overflow-y:hidden; overflow-x:hidden; } any appreciated. thank in advance

ms access - c# KeyValuePair and database -

i doing c# application project whereby receptionist able book rooms customers. had created database whereby looks this id roomtype 1 nap 2 nap 3 nap 4 nap 5 nap 6 meeting_small 7 meeting_small 8 meeting_small 9 meeting_small 10 meeting_small 11 meeting_big 12 meeting_big 13 meeting_big 14 meeting_big 15 meeting_big also, use keyvaluepair link access database through button. receptionist have click on button select room. when button selected, database show that particular room taken. i tried code coding under button. keyvaluepair<string, string> selectedroom; selectedroom = new keyvaluepair<string,string>("nap", "1"); however, not sure if possible. can me out? thank you i had removed room number out

facebook graph api - FB OpenGraph og:image is not pulling images even if URL is rendering correctly -

fb opengraph og:image not pulling images if url rendering correctly. next time if share same url, pickup correct image. add, have added multiple og:image tags (4 tags specific) ensure 1 of images picked up. picking last og:image tag if share same url link correct image shown i.e. first og:image tag. please suggest. multiple og:image meta tags using http , https images urls you can trigger update scraped information hitting post /?id={object-instance-id or object-url}&scrape=true if content changed. also, can use url debugger see facebook scrapes url see https://developers.facebook.com/docs/sharing/opengraph/using-objects#update https://developers.facebook.com/tools/debug/

ios - Local Notification Banners Don't Appear -

i making app requires notifications sent user. far, have registered notifications in app delegate: let notiftypes: uiusernotificationtype = [.alert, .badge, .sound] let notifsettings = uiusernotificationsettings(fortypes: notiftypes, categories: nil) uiapplication.sharedapplication().registerusernotificationsettings(notifsettings) and call following code send notifications in view controller: let localnotification: uilocalnotification = uilocalnotification() localnotification.alertaction = "testing notifications on ios8" localnotification.alertbody = "here notification" localnotification.firedate = nsdate(timeintervalsincenow: 5) localnotification.soundname = uilocalnotificationdefaultsoundname uiapplication.sharedapplication().schedulelocalnotification(localnotification) if pull down notification center panel, notification shown, there no banner if out of app, , no notification shows on lock screen if phone off. how can notifications show ...

c# - Issue with Infragistics.Win.UltraWinToolbars.ToolPropsBase.ResetMaxWidth -

Image
currently migrating .net windows application framework 4.0 4.5 , application using infragistics controls. per requirement, migration includes should replace infragistics controls microsoft controls. view design form in 4.0 getting error below show call stack infragistics.win.ultrawintoolbars.toolpropsbase.resetmaxwidth() please me on how resolve , application using infragistics version 3.2 please refer below screen shot error. g

c# - How to order by value enumeration statuses? -

i have foreach , how can order last item on first palce , others stay are? foreach (statuses val in enum.getvalues(typeof(statuses))) { status.add(new statusmodel() { value = (string)val.tostring(), transkey = val.tostring() }); } you can use dirty trick: var ordered = status .orderbydescending(s => s.transkey == "valueyouwantatthetop"); probably more efficient option: var tomovetotop = status.first(s => s.transkey == "valueyouwantatthetop"); status.remove(tomovetotop); status.insert(0, tomovetotop);

sql - Group rows with similar strings -

i have searched lot, of solutions concatenation option , not want. i have table called x (in postgres database): anm_id anm_category anm_sales 1 a_dog 100 2 b_dog 50 3 c_dog 60 4 a_cat 70 5 b_cat 80 6 c_cat 40 i want total sales grouping 'a_dog', 'b_dog', 'c_dog' dogs , 'a_cat', 'b_cat', 'c_cat' cats. i cannot change data in table external data base supposed information only. how using sql query? not need specific postgres. use case statement group animals of same categories together select case when anm_category '%dog' 'dogs' when anm_category '%cat' 'cats' else 'others' end animals_category, sum(anm_sales) total_sales yourtables group case when anm_category '%dog' 'dogs' when anm_category ...

java - Integrating Box2D Body creation with an Entity-Component System -

background i developing game (using libgdx) , have learned entity-component systems. decided use ecs came libgdx, ashley. however, applies using box2d entity-component system. problem creating box2d body , attaching shape relatively complex. here basic example: bodydef bodydef = new bodydef(); bodydef.type = bodytype.dynamicbody; bodydef.position.set(0, 0); body body = world.createbody(bodydef); circleshape shape = new circleshape(); shape.setradius(1f); fixturedef fixturedef = new fixturedef(); fixturedef.shape = shape; body.createfixture(fixturedef); shape.dispose(); bodydefs , fixturedefs copied when bodies , fixtures created them, reusable. many of game objects have same shape, can share fixturedef: private static polygonshape shape = new polygonshape(); public static fixturedef platformfixturedef = new fixturedef(); static { shape.setasbox(1f, 0.2f); platformfixturedef.shape = shape; // side question, in situation, how should dispose of shape when...

logging - Log4Net in Asp.Net Correct Implementation -

i trying implement log4net file appender in asp.net. have been successful implementing it. not sure correct architecture implement it. i can add logger in each page , log information. however, thinking centralize logger class. may implement singleton pattern. wondering happen if request same page comes 2 different browsers. can implement thread static , every page instead of initializing own logger use centralize logger class log. i suppose log4net file appender or rolling file appender using queue mechanism write log file. because 1 handle of file can acquired write file. can me in regard. going right way or have issues down road when there tens , hundreds of requests coming different browsers. i recommend not use singleton, instead use logger each controller , class want log from. loggers cheap create , cached log4net - , more if declare them static within class - , having 1 per class can change logging per class or namespace changing log4net configuration @ runt...

javascript - Parse Promises, destroyAll(); not working? -

the second line in code below not executing during cloud job, why might case? prior line runs fine. parse.object.destroyall(apples).then(function() { return parse.object.destroyall(pears); //destroy pear objects. }, function(error) { status.error("failed destroy apples/pears."); }); status.success("successfully deleted " + results.length + " pears."); your status.success run synchronously before destroyall(pears) chance run try way parse.object.destroyall(apples).then(function() { return parse.object.destroyall(pears); //destroy pear objects. }).then(function() { status.success("successfully deleted " + results.length + " pears."); }, function(error) { status.error("failed destroy apples/pears."); });

c# - Understanding Delegates and Task -

i come conventional programming background. i not understanding few of new concepts though have tried lot , have interest learn, please bare me. public static task<tresult> foreachparallel<titem, tsubresult, tresult, tparam>(this ienumerable items, func<titem, tparam, tsubresult> map, func<tsubresult[], tresult> reduce, tparam param) { if (items == null) { throw new argumentnullexception("items"); } if (map == null) { throw new argumentnullexception("map"); } if (reduce == null) { throw new argumentnullexception("reduce"); } return task<tresult>.factory.startnew(() => { list<task<tsubresult>> tasks = new list<task<tsubresult>>(); foreach (titem item in items) { task<tsubresult> t = task<tsubresult>.factory.startnew(item2 => { var mparam = (tuple<titem, tparam>)item2; retu...

java - jacoco code coverage report generator showing error : "Classes in bundle 'Code Coverage Report' do no match with execution data" -

i generating jacoco report using jacoco:report tag. getting errors : [jacoco:report] classes in bundle 'code coverage report' no match execution data. report generation same class files must used @ runtime. [jacoco:report] execution data class xxxxx not match. [jacoco:report] execution data class yyyyy not match. the ant report target looks : <target name="report"> <jacoco:report> <executiondata> <file file="${jacocoexec.dir}/${jacocoexec.filename}"/> </executiondata> <!-- class files , optional source files ... --> <structure name="code coverage report"> <classfiles> <fileset file="./jar/abc.jar"/> </classfiles> ...

android - How to set profile picture obtained from facebook login to user profile in another activity -

i using facebook login in application. using profile class basic user info name, profile picture. here code snippet of method updateui() using update ui in login activity. private void updateui() { boolean enablebuttons = accesstoken.getcurrentaccesstoken() != null; profile profile = profile.getcurrentprofile(); if (enablebuttons && profile != null) { profilepictureview.setprofileid(profile.getid()); toast.maketext(login.this,"login success", toast.length_short).show(); greeting.settext(profile.getname()); url.settext(profile.getprofilepictureuri(60,60).tostring()); } else { profilepictureview.setprofileid(null); greeting.settext(null); url.settext(null); } } now want pass profile picture activity , set there rounded thumbnail. want know how that. here code of profile section in activity want set image. have put drawable...

c# - Setting a button to it's highlighted color state? -

is there way through scripting set button start @ highlighted color state rather it's normal color state? have 2 buttons select 2 different custom keypads , want 1 of them automatically selected on start, therefore i'd button associated keypad selected (in highlighted state). way this? you can try changing main color through script. you can create togglebutton, add image component , toggle component via script : toggle mytogglebutton = gameobject.find("mybuttonname").getcomponent<toggle>(); then add script button : mytogglebutton.onvaluechanged.addlistener(mybuttonaction); and mybuttonaction() method can : void mybuttonaction(bool state){ if(state) toggle.getcomponent<image>().color = color.green; else toggle.getcomponent<image>().color = color.ref; } or if don't want add image component toggle, can play mytogglebutton.colors by way, can choose initial state of toggle button, highlighted color ...

c++ - Access restrictions for template arguments -

the section n4296::14.3/3 [temp.arg] says: the name of template-argument shall accessible @ point where it used template-argument. [ note: if name of template-argument accessible @ point used templateargument, there no further access restriction in the resulting instantiation corresponding template-parameter name used. —end note ] all right, let's consider following example: template <class t> class x{ static typename t::s ts; }; class y { private: class vs{ class s{ }; }; x<vs> x; //1 }; demo template argument template x in instantiation @ //1 class vs . now, standard said it's this: the name of template-argument shall accessible @ point where it used template-argument . class vs accessible @ point //1 , therefore requirement held. inspite of fact standard said there's no further access restriction, code not compiled. why code not compiled? based on section provided, should be compiled. s ...

Moodle Local plugin adding course administration menu item : Display Course administration Menu -

i creating local plugin adds menu item course administration. i able add new menu item, on click of link when flow goes page ( in local plugin ) , course administration not available @ left. how display course administration ( , make open ) ? please help. it seems may have use navigation api , page api set course administration menu in plugin page. please refer: https://docs.moodle.org/dev/page_api https://docs.moodle.org/dev/navigation_api

android - Error updating Google Play Services from 6.5.87 to 7.5.0 -

Image
i'm trying update google play services lib 6.5.87 7.5.0 after change android version @ build.gradle: i'm getting following error: i had read error related appcompat i'm not using or including lib. this complete build.gradle: import java.util.regex.pattern buildscript { repositories { mavencentral() // configuration fabric jcenter() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' // fabric gradle plugin uses open ended version react android tooling updates classpath 'io.fabric.tools:gradle:1.+' } } apply plugin: 'com.android.application' apply plugin: 'io.fabric' // fabric gradle plugin, after android plugin dependencies { // 'jar' files in '/libs' folder compile filetree(dir: 'libs', include: '*.jar') compile 'com.facebook.android:facebook-and...

ios - How to use third party library by cocoaPods -

Image
i install third party library successfully. i try use third party library.so code in rootviewcontroller.h: #import "ddcollectionviewflowlayout.h" the error occurs: ddcollectionviewflowlayout.h file not found the question out of third party library. tried use afnetworking cocoapods , write code: #import "afnetworking.h" it works well.

ios - how to stop view disappearing when navigation controller left bar button pressed -

i rookie ios .in child view controller made modification in data. inserted done button store data , pop view controller navigation controller stack. if press navigation controller button automatically goes without saving data. if made modification in data , pressed button need show alert "modifications made sure want go back". if user press cancel button in alert view need stop view disappearing , still stand on same view controller.if have answer please me. i think way it - (void)viewdidload{ [super viewdidload]; [self.navigationitem setleftbarbuttonitem:nil]; [self.navigationitem sethidesbackbutton:yes]; uibutton *mybutton = [[uibutton alloc] initwithframe:cgrectmake(0, 0, 100, 44)]; [mybutton setimage:[uiimage imagenamed:@"back.png"] forstate:uicontrolstatenormal]; //back.png = image name [mybutton settitle:@"back" forstate:uicontrolstatenormal]; [mybutton settitlecolor:[uicolor blackcolor]...

php - cant get data to group in find in a cakephp HABTM -

i have habtm relationship of students , subjects. want display subjects associated student without repetition of student details. dont want student details keep repeating in data output. how student details shown below output once , subjects associated student output? group didnt work. didnt see answer in docs sure simple task do. http://book.cakephp.org/2.0/en/models/retrieving-your-data.html $this->student->recursive = -1; $joinoptions = array( // $options['joins'] = array( array('table' => 'students_subjects', 'alias' => 'studentssubject', 'type' => 'left', 'conditions' => array( 'student.id = studentssubject.student_id', ) ), array('table' => 'subjects', 'alias' => 'subject', ...

.net - Calling a method and throws exception saying i'm passing in too many values... but i'm not -

a bit of strange question. i'm calling method , passing in 13 paramaters. when run code throws , exception saying: "13 arguments passed 'lib.class::updateinformation'. 12 arguments expected method." i thought strange went method definition (through right click menu in visual studio) , counted number of parameters expecting , counted 13. now have either lost ability count overnight or there odd going on. ideas on whats going worng here? additional info: there no overloads method the types of 1 or more of values passing causing match wrong method signature. breakpoint , examine actual types of values passed, first last, , @ various method overload signatures. find match overload takes fewer parameters 1 intended call. assuming haven't accidentally passed parameters in wrong order, coerce values intended types should force match expecting.

spring - java.lang.NoClassDefFoundError: Could not initialize class org.springframework.core.io.support.VfsPatternUtils -

as working on wildfly 8, getting error java.lang.noclassdeffounderror: not initialize class org.springframework.core.io.support.vfspatternutils log: {"jbas014671: failed services" => {"jboss.undertow.deployment.default-server.default-host./sample" => "org.jboss.msc.service.startexception in service jboss.undertow.deployment.default-server.default-host./sample: failed start service caused by: java.lang.runtimeexception: org.springframework.beans.factory.beandefinitionstoreexception: unexpected exception parsing xml document servletcontext resource [/web-inf/applicationcontext.xml]; nested exception java.lang.noclassdeffounderror: not initialize class org.springframework.core.io.support.vfspatternutils caused by: org.springframework.beans.factory.beandefinitionstoreexception: unexpected exception parsing xml document servletcontext resource [/web-inf/applicationcontext.xml]; nested exception java.lang.noclassdeffounderror: not initialize cla...

git - libgit2sharp what is correct sha to supply to GitHub API merge pull-request? -

github api requires merge pull-request submitted put /repos/:owner/:repo/pulls/:number/merge with request body json { "commit_message": "blah", "sha": "{sha pull request head must match allow merge}", } following commit, push, create pr, libgit2sharp property supplies correct sha ? for current branch, appears branch.tip.sha correct value, i'm receiving response error : { "message": "head branch modified. review , try merge again.", "documentation_url": " https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button " } two different commits , shas come play when comes pull request. the tip of branch (the last commit you've pushed on branch) syntax: get /repos/:owner/:repo/git/refs/:ref (where :ref should of pull/{number}/head format) example: https://api.github.com/repos/libgit2/libgit2sharp/git/refs/pull/1123/head the virtual merg...

vba - MS Access 2010 Screen hangs when calling procedure via pass through query -

Image
i facing issue related performance in ms access 2010, calling procedure via pass through query, ms access screen hangs. if run procedure took 1 hour complete , come out successfully, if running through vba screen not responding. private sub abc_click() dim db database set db = currentdb() docmd.openquery "procedure", acviewnormal, acedit end sub i using user dsn please suggest me way ms access screeen not hang , comes out when procedure completes successfully. as procedure doesn't return can use async execute using adodb. you can find details here: running multiple async queries adodb - callbacks not firing when run procedure can track process via periodical requests progress table. of course procedure should modified show progress.

Can I set cassandra cluster with vnode using in one datacenter and another not -

i had cassandra cluster 1 datacenter , upgraded 1.0.7 2.1.8. however, old datacenter not use vnode settings because 1.0.7 not support it. right now, want add new datacenter of 2.1.8 version , want use vnode settings in new data center. can keep old datacenter not using vnode , new datacenter vnode settings? you try procedure listed here . "you cannot directly convert single-token nodes vnode. however, can configure data center configured vnodes enabled , let cassandra automatic mechanisms distribute existing data new nodes. method has least impact on performance."

angularjs - Angular Dynamic Routing With ASP.net MVC -

its quite obvious cant seem find answer. using angular asp.net mvc. can comfortably write views/templates using razor , link js file in controller. work fine user request page, served asp.net mvc runtime. problem starts when want spa. need define routes. ask forward url asp.net mvc , can return view reference angular controller in it, angular routing forces either use pre resolved controller or provide url resolve controller. there way controller can picked view has reference js file having controller definition , declared using ng-controller. way able use excellent convention based asp.net mvc routing angular spa , simpler developers having asp.net mvc background. summarize, dont want specify controller in route config , provide template url view subsequently has reference controller ,hence controller should resolved there. disappointed if not possible

symfony - Mimes Type not working for zip -

in symfony application, want set zip , rar file mime type during file upload it's not working tried code /* * @assert\file( * maxsize = "1024k", * mimetypes = {"application/zip,application/octet-stream * application/rar,application/octet-stream"}, * mimetypesmessage = "dossier sur form zip" * ) */ public $file; /** * @orm\column(type="string", length=255, nullable=true) */ public $path;

sql - Convert MySQL view to Postgres -

i've inherited need convert production mysql db on postgres. has been handled without issue using simple sql statements table/function creation (using navicat generate semi-automated conversion), hitting problem converting complex view. research suggests might due differences in how 2 dbs handle sub-queries (the statements), , perhaps it's syntax difference. business logic here unknown code-base has been inherited developer. running following (using laravel migrations / php script): select parent.is_owner is_owner, parent.brand first_name, parent.id id, (select count(c.id) campaigns c where(( (c.user_id = parent.id) or (c.user_id = child.id) ) , (c.campaign_status_id = 4) )) current_campaigns, (select count(c.id) campaigns c (( (c.user_id = parent.id) or (c.user_id = child.id) ) , (c.campaign_status_id = 5) )) past_campaigns, (select count(c.id) campaigns c (( ...

php update MySql record -

i trying use php simple api update column in record in database. however, stuck missing parameters error whenever try http://localhost/set_is_open.php?open=0&shop_id=2 here api: <?php header('content-type: application/json'); require_once 'db.php'; if(!isset($_get["open"]) || empty(trim($_get["open"])) || !isset($_get["shop_id"]) || empty(trim($_get["shop_id"]))) die(json_encode(array("error" => "missing request paramters."))); $isopen = trim($_get["open"]); $shop_id = trim($_get["shop_id"]); if(! $conn ) { die('could not connect: ' . mysql_error()); } $sql = 'update shops set is_open = isopen shop_id = shop_id'; mysql_select_db('shops'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('could not update data: ' . mysql_...

A query working on sql studio, but doesn't work on C# -

i have query , results when execute on sql studio: select teamname, count(*) nethoz_decision inner join nethoz_case on nethoz_decision.casedisplayidentifier = nethoz_case.casedisplayidentifier inner join maintik on maintik.counter = nethoz_case.tikcounter inner join teams on maintik.teamcounter = teams.counter nethoz_decision.decisionstatuschangedate between '2015-07-23' , '2015-07-28' group teamname but when execute on c# sqlcommand don't result. dataset empty , don't error. thought problem might on date. converting right? string date1 = string.format("{0:yyyy-mm-dd}", datetimepicker1.value); string date2 = string.format("{0:yyyy-mm-dd}", datetimepicker2.value.adddays(1)); using sqlcommand , type-safe parameters const string query = " select teamname, count(*) nethoz_decision inner join nethoz_case on nethoz_decision.casedisplayidentifier = nethoz_case.casedisplayidentifier inner join maintik on ...

When use Braces block in Java like this? -

Image
please see above picture (from wrox beginning spring book) i have question { } ? is constructor ? functional block ? block of "accountsmap" ? ? please explain feature in java ? name of feature ? it's instance initializer block gets executed each time create instance of class, no matter constructor used. executed prior code of executed constructor. see jls 8.6 more details.

How to compare 2 similar types in C# -

i want ask how compare 2 types in c#. my scenario is: nullable<int> rating; int needcomparetype; every time compare these two, return false result. there anyway me return true in case because int type have in both lines. my compare line is: if(rating.gettype() == needcomparetype.gettype()) edit: program code: public object this[string propertyname] { { propertyinfo property = gettype().getproperty(propertyname); return property.getvalue(this, null); } set { propertyinfo property = gettype().getproperty(propertyname); iformatprovider culture = new system.globalization.cultureinfo("fr-fr", true); if (property.propertytype == typeof(system.datetime)) { property.setvalue(this, convert.todatetime(value, culture), null); } else if (property.propertytype == typeof(int)) { p...

mysql - Jena connection to external databases -

i have read articles commenting apache jena engine , have found interesting. @ site have found in order store triples, tdb used. in case, know if, jena application possible load data external databases such mysql or postgresql ones, or "closed" product , can interact tdb , fuseki frameworks. at moment, don't know if jena engine framework act traditional java war particularities of processing rdf files. any apreciated. if mean, connect existing non-rdf data in mysql or postgresql, no. need (dynamically or statically) have conversion layer between database , jena. d2rq can provide that. if mean, use mysql or postgresql store rdf, yes. see jena sdb. however, tdb faster , scales better.

unity3d - Set player score with playerprefs -

i need save players score display highscore , keep each time game either restarted or scene restarted. have following: public class score : monobehaviour { public static int score = 0; static int highscore = 0; public text text; public static void addpoint(){ score++; if (score > highscore) { highscore = score; } } void start(){ text = getcomponent<text> (); score = 0; highscore = playerprefs.getint ("highscore", 0); } void ondestroy(){ playerprefs.setint ("highscore", highscore); } void update () { text.text = "score: " + score + "\nhigh score: " + highscore; } } this causes score , highscore incremented each time hit trigger gain point. use trigger if hit object restart scene. void oncollisionenter2d(collision2d col) { if (col.gameobject.tag == "enemy") { print ("you collided!"); collided = true; rb.gravityscale = 10; rb.d...