Posts

Showing posts from March, 2014

c++ - How to extend a line segment in open cv using python -

i having 2 end points of line segment , want extend line. found following algorithm through website lengthab = sqrt((a.x - b.x)^2 + (a.y - b.y)^2) c.x = b.x + (b.x - a.x) / lengthab * length; c.y = b.y + (b.y - a.y) / lengthab * length; but can't output while implement on program. need int value cx , cy in float. ![ a(x,y)=(200,140) , b(x,y)=(232,146) ][1] import numpy np import cv2 import math img = np.zeros((500,500,3), np.uint8) lenab = math.sqrt((200-232)**2+(158-146)**2) length = 100 cx = 232 + (232-200) / lenab*length cy = 146 + (146-158) / lenab*length cv2.line(img,(200,158),(cx,cy),(33,322,122),3) cv2.imshow('tha',img) cv2.waitkey(0) cv2.destroyallwindows() my o/p screen : traceback (most recent call last): file "e:/nan/inclined_line.py", line 9, in <module> cv2.line(img,(200,158),(cx,cy),(33,322,122),3) typeerror: integer argument expected, got float from error pas...

ruby - Multiple where clauses in rails searchkick -

i have basic question searchkick. if want join multiple statements in searchkick query using if statements. query-builder @product = product.all unless request.end_date.nil? @product = @product.search, where('created_at <= ?', request.end_date) end unless request.max_price.nil? @product = @product.search, where('price <= ?', request.max_price) end @product the above code works fine if request has either end date or max_price. if has both, throws error. there way construct or concatenate 2 statements. cannot product.search '*', where('created_at <= ?', request.end_date), where('price <= ?', request.max_price) because if statement important. you should check docs of searchkick, has or filter: https://github.com/ankane/searchkick where: { expires_at: {gt: time.now}, # lt, gte, lte available or: [ [{in_stock: true}, {backordered: true}] ] } for case, can deal ...

iis - SQL Server merge replication with Web Synchronization -

i have virtual machine in cloud runs sql server , database publishing merge replication. have followed steps outlined in microsoft documentation subscriber client getting stuck following error... the remote server 'xxxx.cloudapp.net' not exist, or has not been designated valid publisher, or may not have permission see available publishers. the client has created subscription , able connect server in order far , server exist , can communicated with. have given full permission access repldata directory users cannot see how permission problem. any ideas?

javascript - Trying to use grunt uncss to remove some css -

i have website inherited couple of gigantic css files analysing dust-me selector in firefox return me 2000 unused styles. to remove them i'm trying use grunt uncss, problem following error: grunt uncss running "uncss:dist" (uncss) task fatal error: uncss/node_modules/css: missing '}' near line 2429:5 -> .mobile-hidden { those configuration files package.json { "name": "tappr-registration", "version": "0.1.0", "devdependencies": { "grunt": "~0.4.5", "grunt-contrib-copy": "^0.7.0", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-nodeunit": "~0.4.1", "grunt-contrib-uglify": "^0.6.0", "grunt-processhtml": "^0.3.3", "grunt-uncss": "^0.3.7" } } gruntfile.js module.exports = function(grunt) { // project configuration....

c++ - unresolved external symbol while linking to boost statically -

i'm trying build application , statically linking boost 1.57 6 linking errors: >link : warning lnk4044: unrecognized option '/static'; ignored 2>shaderprogram.obj : error lnk2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@yaabverror_category@12@xz) referenced in function "void __cdecl boost::system::`dynamic initializer 'native_ecat''(void)" (??__enative_ecat@system@boost@@yaxxz) 2>shaderprogram.obj : error lnk2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@yaabverror_category@12@xz) referenced in function "void __cdecl boost::system::`dynamic initializer 'errno_ecat''(void)" (??__eerrno_ecat@system@boost@@yaxxz) 2>shaderprogram.obj : error lnk2019: unresolved external sy...

angularjs - $HTTP service in Angular.js -

i new in angular.js , , learning it. i looking on $http service send ajax request. i got 3 ways send ajax request form angular.js . these here ajax calls via $http service. jsonp calls via $http service. rest type calls. actually getting confuse these 3 process, better me use. which more efficient , reliable me implement in project? my main aim make high throughput. any suggestion helpful me. if beginner recommend go $http. pretty straight forward , simple use , serves of regular development tasks. other 2 requires fair amount of understanding though same job making ajax calls.

android - virtual device of genymotion statred but displaying white screen...? -

Image
can 1 guide me solve issue... have install free version of genymotion 2.3.1 v along virtual box. created virtual device listed one....virtual device started show white screen. image of virtual device attached here. i have tried following solution 1)setting of network adapter configuration(network ip address, dhcp server etc) setting doesn't solve problem..thanks in advance. 2)re-install genymotion do following if have intel graphics driver. please try update graphics card driver latest 1 first below link intel drivers auto update download link updated and please make sure color setting 32 bits after updated driver, , try start virtual device again.

javascript - Angularjs mouse enter event -

i change ng-mouse enter event if user hoovered more second on spot event fire seems ng-model-options="{ debounce: 1000 }" not working event any ideas ? <button ng-mouseenter="myevent()" ng-mouseleave="myevent2()" > </button> $scope.flag=false; $scope.myevent = function() { $scope.flag=true; $timeout(function(){ if($scope.flag) { // logic here } }, 1000); } $scope.myevent2 = function() { $scope.flag=false; } here can set timeout on mouseenter , , check if flag made false mouse leave, logic execute if user has not done mouseleave 1 sec .

jquery - Bootstrap Date picker not showing dates after response -

i have form 2 text fields filled date. recently, upgraded bootstarp , used bootstarp date-picker 2 text box fields. before this, had jquery date picker these fields. use spring mvc submitting form. so, when submit form before integration of bootstrap, return model , jsp show user entered date in fields. these fields became empty after upgrading bootstrap. idea on why bootstrap! thanks help.

php - how to solve error {"message":"Could not authenticate you","code":32} -

i want fetch public posts twitter. create app in twitter , gather consumer key (api key) ,consumer secret (api secret) ,access level,access token,access token secret,access level , write program. @ run time shows error {"message":"could not authenticate you","code":32} . create class twitterapi keys private set post. create function setgetfield() public function setgetfield($string) { if (!is_null($this->getpostfields())) { throw new exception('you can choose or post fields.'); } $search = array('#', ',', '+', ':'); $replace = array('%23', '%2c', '%2b', '%3a'); $string = str_replace($search, $replace, $string); $this->getfield = $string; return $this; } create function getgetfields() collect field twitter. public function getgetfields() { return $this->getfield...

salt - Check HMAC-SHA1 without key in C# -

i generating hmac-sha1 without key in c# , returns every time different hash same value, how can match hashes, my code https://dotnetfiddle.net/3a3tip is possible or not match these hashes? i think hmac-sha1 not possible without key right? if above 'yes' why c# allow generate without key , how doing? yes, because using parameterless constructor build hmacsha1 instance, , msdn says hmacsha1() - initializes new instance of hmacsha1 class randomly generated key. just add constant key , you'll same hash every time. e.g. var hmacsha = new hmacsha1(encoding.utf8.getbytes("yourconstantkey")); and answering questions: yes, use same key 2 generations. yes. it generates random key you

location - iOS indoor positioning app and WiFi signals -

i'd develop indoor positioning system ios using wifi signals instead of ibeacon . read here feature introduced. says: you can sign learn more how can work apple enable indoor positioning @ venue. provide basic information venue started. and leads apple maps connect , provide information regarding venue you'd want enable indoor positioning. sent request weeks ago , have no response yet, since have large amount of requests , prioritizing according several conditions. however, i'm not sure if request through apple maps connect more information apple of how develop indoor positioning app, or because yo need granted explicit permission that, or why. has completed process? on other hand, information dealing indoor positioning, apart ibeacon related, sample code . to make sure: wifi-enabled indoor positioning available starting ios 8? developing enough, or needed request kind of specific permission enable indoor positioning based app wifi signals? thanks in ...

Rails 4 - current_page? with query parameter -

i've method in application.rb def current_page(path) "active" if current_page?(path) end then in view, lets request_uri http://www.example.com/stories , can call <%= link_to "all stories", stories_path, :class => "#{current_page(stories_path)}" %> but how if request_uri has http://www.example.com/stories?featured=true ? how call in view? because current_page? method compare passed-in path doesn't have ? current url deleting query params. for example, if you're @ http://www.example.com/stories?featured=true , , have current_page(stories_path) , you'll still compare http://www.example.com/stories (stories_path) http://www.example.com/stories (your current url without featured=true ). i have idea, you'll have ? in end of normal url.you can change code <%= link_to "all stories", stories_path + '?', :class => "#{current_page(stories_path + "?")}" %> i...

pdf generation - How to display a Java List<> in PDF document using itext 5.3.0? -

{ list<integer> list=new arraylist<integer>(); list.add(10); list.add(20); com.itextpdf.text.list = new com.itextpdf.text.list(list);document.add(a); } it showing error argument in list match parameter. there no constructor in class takes java.util.list parameter. please refer javadoc . you may want work itext's list directly: com.itextpdf.text.list = new com.itextpdf.text.list(); a.add("10"); a.add("20"); if working existing java.util.list have iterate on items add them: com.itextpdf.txt.list = new com.itextpdf.text.list(); list<integer> integerslist = getlistfromdb(); for(integer item : integerslist) { a.add(item.tostring()); }

How to integrate Selenium Webdriver with Cucumber -

i looking integrate selenium webdriver cucumber. please let me know if has implemented same. you need cucumber-jvm. after when write feature files need define steps definitions using selenium (this pom based project or direct api call). below links on how go implementing this links http://cukes.info/install-cucumber-jvm.html http://cukes.info/running.html snippets feature sample feature: page verification scenario: verify page given user navigated page , user signup user should redirected login when user click "https://page.com/userlogin/" user should verify "login" , close browsers steps definition public class stepsdefinitions { webdriver driver = null; @given("^user navigated \"([^\"]*)\"$") public void gotosite(string link) throws throwable { driver = new firefoxdriver(); driver.navigate().to(link); } @when("^user click \"([^\"]*)\"$") public void clicksignup(string ...

jQuery hover in function -

my script works fine without $this, when delete $this, on hover script display submenus. explain me make mistake? $(function () { var timeoutid; $(".mainmenu li").hover(function () { if (!timeoutid) { timeoutid = window.settimeout(function () { timeoutid = null; $(this).find('.submenu').slidedown('slow'); }, 1500); } }, function () { if (timeoutid) { window.cleartimeout(timeoutid); timeoutid = null; } else { $(".submenu").slideup('slow'); } }); }); my html: <div id="a"> <ul class="mainmenu"> <li> cars <ul class="submenu"> <li><a href="#">white</a></li> <li><a href="#">black</a...

ruby on rails - When to use Devise vs. Creating my own Authentication -

as stated in title, when should devise used , when should i, instead, implement own authentication. in essence, i'm wondering whether created authentications in tutorials (such this one) secure , safe. if don't need email confirmation, recoverability, etc. (a lot of "jazz" associated devise), account information secure if created own? if still may confused answer i'm looking – is devise should use whenever possible/whenever have accounts? or should decision? note: i'm not referring devise, authentication gems may replaced. i used use gems devise until rails added has_secure_password activerecord. roll own since in end need custom stuff makes hard implement in existing library. ryan bates have excellent video on topic here .

Refresh data in Wicket DataView -

i have dropdownchoice , dataview @ page. dataview should show data according item selected in dropdownchoice. how can achieve this? thanks propertymodel can change text of label in pretty simple way. there som way dataview? not looking ajax refresh. lot in advance your dataview uses dataprovider values show. if add dataview (or parent) ajaxrequesttarget refetch values dataprovider . need make sure changing selection in dropdownchoice update dataprovider . e.g. dropdown.add(new ajaxformcomponentupdatingbehavior("onchange") { @override protected void onupdate(ajaxrequesttarget target) { dataprovider.setselecteditem(dropdownmodel.getobject()); target.add(dataview); //o dataview's parent } }); update mydataprovider { private someobject selecteditem; @override public iterator<? extends someotherobject> iterator(long first, long count) { return this.service.findallforitem(this.selecteditem).iterator(); } //+...

c++ - Allocating memory using new returns same memory address -

class abc { int x ; }; int main() { abc *a = new abc ; cout<< static_cast<void*>(a) << endl ; delete ; cout<< static_cast<void*>(a) << endl ; abc *b = new abc ; cout<< static_cast<void*>(b) << endl ; delete b ; cout<< static_cast<void*>(b) << endl ; return 0; } why prints same address , though deleted old memory . assign null after deletion , prints same address. even address of , b same . real time scenario : function1 -> arr[p] = new x ptr1 = arr[p] using ptr1 function2 -> ptr2 = arr[p] delete ptr2 arr[p] = new x ( new data) in real scenario ptr1 should invalidated since compiler assign same address to arr[p] in function2 ptr1 still works . why should not happen? once you've deleted memory @ particular address, memory manager @ liberty re-use address next time ask new memory. indeed common optimisation used memory ma...

node.js - store files in mongodb using mongoose -

i new node , mongodb. developing app nodejs, express , mongodb. want read csv/xlsx file file input field , store in mongodb using mongoose. having difficulties. using angularjs in front end. can give me suggestions procedure should go through? specific code great help. i used busboy module store files in specific folder. here code in routes: router.post('/fileupload', function (req, res) { var fstream; req.pipe(req.busboy); console.log(req.pipe); console.log(req.busboy); req.busboy.on('file', function (fieldname, file, filename) { console.log("uploading: " + filename); fstream = fs.createwritestream('./files/' + filename); file.pipe(fstream); fstream.on('close', function () { res.redirect('back'); }); }); }); and frontend: <form method="post" action="/fileupload" enctype="multipart/form-data"> <input type=...

mongodb - W: Size of file /var/lib/apt/lists/http.debian.net_debian_dists_jessie_main_binary-amd64_Packages.gz is not what the server reported 9101219 9117278 -

i installing mongo client , started following error message w: size of file /var/lib/apt/lists/http.debian.net_debian_dists_jessie_main_binary-amd64_packages.gz not server reported 9101219 9117278 this in response following run command in dockerfile . run apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7f0ceb10 && \ echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list && \ apt-get update && \ apt-get install -y mongodb-org-shell how ought resolve this?

serialization - Rails ActiveModel Serializers render not null attributes -

i want use serializer renders not null attributes class personserializer < activemodel::serializer attributes :id, :name, :phone, :address, :email end is possible. many thanks. solution: class personserializer < activemodel::serializer attributes :id, :name, :phone, :address, :email def attributes hash = super hash.each {|key, value| if value.nil? hash.delete(key) end } hash end end from version 0.10.x of active_model_serializer gem, have override method serializable_hash instead of attributes : # place method inside nullattributesremover or directly inside serializer class def serializable_hash(adapter_options = nil, options = {}, adapter_instance = self.class.serialization_adapter_instance) hash = super hash.each { |key, value| hash.delete(key) if value.nil? } hash end

chef - Error resolving cookbook -

i went through many similar threads none answers problem. have mysql 4.1.2 recipe . when run in opsworks gives me error. when run similar recipe in local ubuntu works fine. have done heavy tweaking version number of dependencies, still no solution. can cause of problem ? cookbook repo @ github ================================================================================ error resolving cookbooks run list: ================================================================================ missing cookbooks: ------------------ not satisfy version constraints for: mysql your version of database cookbook requires mysql >= 5.0.0 have 4.1.2 .

polymorphism - Java Override a private function Dont showing polymorphic behaviour -

public class shape { final private void print() { system.out.println("in class shape"); } public static void main(string[] args) { shape shape=new rectangle(); shape.print(); //calling shape class function //giving output in class shape } } public class rectangle extends shape { public void print() { system.out.println("in class rectangle"); //super.print(); } } ques: why private function don't show polymorphic behaviour ? , still overriding final method? calling base class funtion why? a private function not visible nor callable children; hence these 2 different functions. there nothing overwrite perspective of child class, because not aware parent has print() function.

.net - How to get the path of an antivirus installed in my system from my C# program? -

my c# program needs open antivirus installed in machine. as of have hardcoded path follows: system.diagnostics.process.start("c:/program files (x86)/myantivirus/myantivirus.exe"); however path varies 32 , 64 bit machine. cannot run same code on 64 bit windows 8.1 machine. is there way path of antivirus installed in machine program machine independent? instead of hardcoding path antivirus, can ask windows path is. antivirus programs report windows. windows wont report users no antivirus installed. using wmi can query windows path. var searcherprevista = new managementobjectsearcher(string.format(@"\\{0}\root\securitycenter", environment.machinename), "select * antivirusproduct"); var searcherpostvista = new managementobjectsearcher(string.format(@"\\{0}\root\securitycenter2", environment.machinename), "select * antivirusproduct"); var previstaresult = searcherprevista.get().oftype<managementobject>(); var p...

SAS do loop with array -

i first store character elements of array size 3. data _null_; array fruit[3] $10 ("apple" "orange" "lemon"); call symput("fruit1", fruit1); call symput("fruit2", fruit2); call symput("fruit3", fruit3); run; i print element of array fruit , %put &fruit1; %put &fruit2; %put &fruit3; is possible using do-loop? i prefer sql method create variables. here's 2 ways display macro variables, 1 using data step , 1 using macro loop: *generate sample data; data have; input fruit $20.; cards; apple banana grapes ; run; *create macro variables; proc sql noprint; select fruit :fruit1-:fruit1000 have; quit; *store number of macro variables; %let nobs=&sqlobs.; %put &nobs; *display macro variables in data step; data _null_; i=1 &nobs.; have=symget(catt("fruit", i)); put have; end; run; *display ma...

how can i set different menus on different pages in wordpress? -

i trying setup diffrent menu diffrent page like. in home page need main menu link this <a href='#home'>home</a> <a href='http://example.com/product'>product</a> <a href='#services'>services</a> <a href='#conact'>contact us</a> in product page <a href='http://example.com/#home'>home</a> <a href='http://example.com/product'>product</a> <a href='http://example.com/#services'>services</a> <a href='http://example.com/#conact'>contact us</a> i using 1 page theme please me logic development. thanks it impossible answer question without seeing more code, in abstract sense can achieved quite easily. yatendra pointed out, need register 2 menus in functions.php file: function register_my_menus() { register_nav_menus( array( 'home-menu' => __( 'header menu' ), 'product-me...

compilation - Java Compiling Error: -

i working along atm case study deitel java how program 9th edition. the case study @ chapter 13, page 546(in case has book , check),i sure code 100% book suggested. i have code set when try run program giving me this: error: not find or load main class come.example.atm.atmrun when tried compile class using terminal class path gave me error: localhost:atm user$ javac atmrun.java atmrun.java:5: error: cannot find symbol atm theatm = new atm(); ^ symbol: class atm location: class atmrun atmrun.java:5: error: cannot find symbol atm theatm = new atm(); ^ symbol: class atm location: class atmrun 2 errors this class running: straight forward cant seem find problem. help? package come.example.atm; public class atmrun { public static void main (string[] args){ atm theatm = new atm(); theatm.run(); } } update: when run .class file bin directory of project using command java atmrun this: ex...

nginx - Redirect all subdirectories to the parent directory -

example case: http://example.com/parent/any/subdirectorry/here http://example.com/parent/random http://example.com/parent/can/be/anything i want of above showing content of http://example.com/parent/ if there index.htm file in parent, instance; when visit first url should seeing index.htm file (with loaded dependencies). i have looks it's working; sadly doens't allow page load dependencies since rewrites everything: rewrite ^/parent/.+ /parent/index.html last; any appreciated.

c++ - Is it possible to stop SWIG generating the module class for Java? -

i've created c++ class want able construct , call methods on java. here (in file called test_swig_cpp_java.h): #ifndef test_swig_cpp_java_h_ #define test_swig_cpp_java_h_ class goonjavaconstructme { public: void oohcomeoncallmeyouknowyouwantto(); }; #endif i created module file swig (called test_swig_module.i) , put in it: %module test; %ignore ""; %rename("%s") goonjavaconstructme; %rename("%s") goonjavaconstructme::oohcomeoncallmeyouknowyouwantto; %{ #include "test_swig_cpp_java.h" %} %include "test_swig_cpp_java.h" i ran following command swig stuff: swig -c++ -java test_swig_module.i and listed files had in directory not 2 created - here list: goonjavaconstructme.java test.java testjni.java test_swig_module_wrap.cxx great, have cxx ( test_swig_module_wrap.cxx ) file need compile in c++ code , on java side, class want call has been nicely created ( goonjavaconstructme.java ) , can see jni declarat...

Strange behaviour of firebase transaction -

Image
my firebase looks this: this test code (coffee script): firebase = require 'firebase' ref = new firebase 'https://my_firebase.firebaseio.com/items' ref.once 'child_added', (snapshot) -> childref = snapshot.ref() console.log "child_added", childref.tostring(), snapshot.val() childref.transaction( (data) -> console.log 'transaction on data', data return if !data or data.my_key isnt 'my_val' data.my_key = 'new_val' return data , (err, commited, snapshot) -> if err console.error 'error', err return console.log 'commited? '+commited console.log 'server data', snapshot.val() , false ) and output: child_added https://my_firebase.firebaseio.com/items/item1 { my_key: 'my_val' } transaction on data null commited? false server data null same happens when third parameter of transaction(...) true. ...

ios - Swift UnsafeMutablePointer<Unmanaged<CFString>?> allocation and print -

i'm new swift , have difficulties deal pointers of unmanaged cfstring (or nsstring). i'm working on coremidi project implies usage of unsafemutablepointer?> can see in function : func midiobjectgetstringproperty(_ obj: midiobjectref, _ propertyid: cfstring!, _ str: unsafemutablepointer<unmanaged<cfstring>?>) -> osstatus my problem want allocate buffer receive content of property (_str) call function above, , print content in console using println. at moment wrote : // first midi source (i know exists) var midiendpoint : unmanaged<midiendpointref> = midigetsource(0) //c reate "constant" of 256 let buf = nsmutabledata(capacity: 256) // allocate string buffer of 256 characters (i'm not sure want) var name = unsafemutablepointer<unmanaged<cfstring>?>(buf!.bytes) // call function fill string buffer display name of midi device var err : osstatus = midiobjectgetstri...

javascript - how to get complete parent node name in js tree while selecting the child node -

i getting child tree name want complete hierarchy of parent node names. below code shows how child node , print value in particular div element: $(document).ready(function () { $('#bdeviewnew').on('changed.jstree', function (e, data) { var i, j, r = []; (i = 0, j = data.selected.length; < j; i++) { r.push(data.instance.get_node(data.selected[i]).text.trim()); $('#treebreadcrumbs').html(r.join(', ')); } }); }); now prints value of child node, e.g. child a . want follows, if tree structure shown below: parent child 1 child child b child 2 child c child d so if click on child a want div content updated parent > child 1 > child as of getting child a only. please let me know how can correct output. i tried shown below path of parent node: $(document).ready(function() { $('#bdeviewnew').on('changed.jstree', function(e, data) { var ids =...

How to store password in ldap server using java -

i need store password in ldap server using java code.i have specify of encryption method available ldap while storing password.how it?? 1) store password in char[] instead of string strings immutable in java , there no way can erase content of string because modification in string result in new string. strings cached in string pool pose security risk of exposing password in clear text has access memory of java application. accident core dump of java application, generating memory dump in /tmp can put passwords in real threat. using char[] can erase convents setting blank or other character reduces security risk of exposing password. see why char array better string storing password in java more detail 2) use encrypted password in application 1 step further earlier tip, instead of storing password or sensitive information in clear text store them in encrypted or hashed format. reduces risk of exposing password stranger how has access of application memory while performing...

c++ - pthread memory leak with stack variables -

i have noticed when call method using thread in form ////main code///// pthread_t thread; pthread_create(thread,function,data); ////////////////// void* function(void* data){ //work data on heap via vector on stack std::vector<double> variable (100,1.2345); //do contents of thread pthread_exit(null); } despite having no calls new (except implicitly in vector variable) memory leak amount of memory usage going linearly number of times call function in way. however if this void* function(void* data){ { std::vector<double> variable (100,1.2345); //do contents of thread } pthread_exit(null); } the memory leak doesn't occur. it seems pthread_exit(null) doesn't clear stack variables @ end of normal function return (i correct right?!) putting them within own scope ensures freed. however, seems massive kludge. how ensure stack variables (and contents on heap in terms of containers) cleared when exiting pthrea...

javascript - Mark up ASP.net validator -

i have created simple webform using designer in asp.net (vs2013). system works well, had use few textboxes , custom validation controls toolbox. form checks client sided if input correct , shows error message if not. however errormessage gets shown on page in ugly red text atm. mark-up error message, example use jquery fade-in function on error or use custom javascript hook in emited js asp. what , best way this? code: <%@ page language="c#" autoeventwireup="true" codefile="registreren.aspx.cs" inherits="registreren" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <script type="text/javascript" src="scripts/jquery.js"></script> <title></title> <link href="websitestyle.css" type="text/css" rel="stylesheet" /> </head> <body> <form id="form1...

android - How to update canvas draw text instead of redraw canvas -

i able draw text on canvas on motion view problem when draw text & go next draw on same canvas draw text getting disappear mean screen getting redraw because of invalidate want keep previous draw , make new draw on same canvas how going ? @override protected void ondraw(canvas canvas) { paint hint = new paint(); path = new path(); mtextpaths = new arraylist<path>(); log.v("getting mtextpaths", mtextpaths.tostring()); int m; if (strgettile != null) { (m = 0; m < strgettile.length(); m++) { system.out.println(strgettile.charat(m)); char convertst = strgettile.charat(m); charactertostring = character.tostring(convertst); // canvas.drawtext(charactertostring, x, y, hint); // canvas.drawtext(charactertostring, m // * width + x, m * height + y, foreground); //its working in // cross // canvas.drawtext(charactertost...

codeigniter - Codeignite 404 error -

i ham writing follow codeigniter code, keep getting 404 error. thoughts? funding_controller.php class funding extends ci_controller { function __construct() { // call model constructor parent::__construct(); } public function index() { $this->load->model('funding_model'); $data['funds'] = $this->funding_model->getall(); $this->load->view('funding_list', $data); } } funding_model.php class funding extends ci_model { function __construct() { // call model constructor parent::__construct(); } function getall() { $query = $this->db->get('funds'); return $query->result(); } } funding_list.php foreach($funds $row) { echo $row->opportunity_name; echo "<br />"; } the default route points funding_controller. thoughts? controller name , class name sho...

Delete all emails from Exchange 2007 account -

we have overweight bloated email account on exchange 2007 running on sbs 2008 needs emptying, not deleting. unfortunately there no monitoring in place , it's slowing entire network down (another long story)... what easiest , efficient way remove emails offending email account please? thanks you need grant access , setup shell scripts in exchange management shell. use these shell commands make job easier. http://community.spiceworks.com/how_to/show/892-delete-emails-in-exchange-2007

How do I change the transaction settings for Spring Data repositories globally? -

i'm using spring data application repositories. interface myuserrepository extends jparepository<myuser, long> { … } spring data adding transactional repositories default propagation.required if i'm not mistaken. how can set propagation.mandatory repositories in aop. don't want set annotation every repository. idea behind forbid using repositories out of transactional scope used through services. i'm using aop other services not working correctly repositories proxied. you can create custom repository base interface , annotate settings need: @norepositorybean @transactional(propagation = propagation.mandatory) public interface baserepository<t, id extends serializable> extends pagingandsortingrepository<t, id> { } now let of application repositories extend base repository interface , you'll go.

javascript - How to load only the content area, skip header and footer loading again in new pages over clicking links -

im using basecamp, , when click on menu links, loads inner body content alone, still url changes, wonder, ive examined in network tab, , see there each link click triggers request , gets body part, no headers/footer loading, amazed flow. where in other sites(even in stackoverflow) loads page beginning, cache or other stuff loads there lil flicker if examine clearly. do guys have idea how works, there frameworks helps way? because works extremely fast , no flicker @ in header menus, , specially while browsing in mobile gives feel using application(mobile app loads content) please let me if have idea how flow works. thanks in advance here's full explanation of why fast: stacker: turbolinks/pjax technique instant page loads russian-doll caching: low-hassle, automated way aggressive caching

jquery - Submit form with ajax in wordpress -

i trying create jquery function send html form ajax. build standard html form post method , trying create jquery part , there problem. here code: $(document).ready(function() { $('form').submit(function() { var formdata = $('form').serialize(); var href = 'http://stravomat.michalfolprecht.com/wp-admin/admin-ajax.php'; $.post(href, formdata, function(resp) { console.log(resp); if ( resp.success ) { console.log('success'); } else { console.log('alert'); } }); // stop form submitting normal way , refreshing page event.preventdefault(); }); }); i have php part on same page form , standard wordpress custom page template. jquery code in custom file , linked wordpress header. not know if should use ajax url or use url page. when try use code console log give me number 0 that's all. can me this? thanks reply. michal. a...

sql server - Join 3 tables in a stored procedure -

i have 3 tables in role has number of permission resides in roledetail table have find out permissionname, roleid, rolename, roledescription these tables: [role], permission, roledetail table [role] has these columns: roleid, rolename, roledescription and table permission has these columns: pemissionid, permissionname while table roledetail has these columns: roledetailid, permissionid, roleid i want display columns roleid, rolename, roledescription, permissionname based on given permissionid roledetail table , here have far alter procedure usp_getroledetails @proleid int begin set nocount on; select r.roleid,r.rolename,r.[description],permissionname [role]r inner join roledetail d on d.roledetailid = r.roleid inner join permission p on p.permissionid = d.permissionid r.roleid = @proleid end go i think want this select roleid,rolename,roledescription,permissionname roledetail inner join [role] on roledetail.roledetailid = role.r...

ios - Presenting a new viewController doesn't seem to unload the previous -

the game i'm developing consists of main menu, , game viewcontroller separately. however when moving game screen menu screen, seems if class files previous viewcontroller still in effect? for example, players start game tapping anywhere on screen whilst in game viewcontroller, causes new bar "launched", in turn plays small tone varies depending on direction. when returning main menu after game on (achieved pressing button present menu viewcontroller), tapping anywhere on menu screen seems start game again game viewcontroller? by this, mean bar launch sound played, despite there being no code available in main menu viewcontroller play said sound, pressing play on menu take game screen, game has been reset, until tapping again, sound plays implying new bar launched, despite images being invisible. i made sure that, when leaving view, wipe subviews view, whenever screen loaded there's nothing being covered up. tried dismissing previous view controller, nothin...

javascript - Login with Amazon - Button widget links to error page -

Image
i'm trying integrate amazon's "login , pay amazon" payment method webshop. followed steps developer docs: http://docs.developer.amazonservices.com/en_uk/apa_guide/apaguide_gettingstarted.html the problems starts @ beginning. inserted code head part, , button widget (explained in getting started > step 1). when click button in shop, popup shows following error: it says there problem handling of order (although expected login screen). , amazon fix problem. error since first time clicked button, , that's week ago. , can't find statements error. is there have done wrong? think setup right (client-id, seller-id, return-url, scope- , popup-parameters). onerror function isn't called, can't debugging. what causes error? have setup allowed javascript origins in application console? might cause problem.

javascript - How to debug firefox performance? -

i have web application loads fast in chrome, in firefox appears spend 10-20 seconds frozen input. during time there nothing showing loading in network tab, , having profiled using performance tab there isn't meaningful output. during time reports different scripts running, nothing take 30 seconds reporting. ff reports 0fps doesn't otherwise report ff doing anything. is there more can try work out firefox doing during time?

c++ - Don't allow to maximize/show the application in QML -

i have application in qml/c++ shouldn't able maximized/showed user. should stay minimized whole time , when receives message server should maximize itself. possible in qml? looking everywhere , not able find similar issue. you can start window window.hidden flag , show when signal received. simple example: import qtquick 2.3 import qtquick.window 2.2 window { id: mainwindow visibility: window.hidden width: 400 height: 300 text { text: qstr("hello world") anchors.centerin: parent } timer { id: timer interval: 5000 ontriggered: { console.log("signal received"); mainwindow.visibility = window.maximized } } component.oncompleted: { console.log("window created"); timer.running = true; } } } pay attention - havn't test code in qml viewer, start window anyw...

java - How can I show a JTable in a dialog box in NetBeans? -

i have had few problems trying table show in netbeans. here code trying use. aware loop wrong , fix @ later date. runtime error following code , can't work out. object[][] data = null; string[] columnnames = {"type", "grade", "height", "width", "length", "reinforced bottom", "reinforced corners", "sealable", "quantity"}; jtable table = new jtable(); public void showtotalorder(){ for(int i=0; i<boxes.size(); i++){ for(int j=0; j<1; j++){ data[i][j] = boxes.get(i).getname(); data[i][j+1] = boxes.get(i).getgrade(); data[i][j+2] = boxes.get(i).getheight(); data[i][j+3] = boxes.get(i).getwidth(); data[i][j+4] = boxes.get(i).getlength(); data[i][j+5] = boxes.get(i).getreinforcedbottom(); data[i][j+6] = boxes.get(i).getreinforcedcorners(); data[i][j+7] = boxes.get(i).getsealable()...

javascript - fail to start typescript compiled file -

i have converted big js project typescript (as c# programmer) using in phantomjs. problem interpreter (phantomjs) fails while executing js file. d:\my\phantomjs-1.9.7-windows\phantomjs.exe --load-images=false --ssl-protocol=any --web-security=no --cookies-file=cookies c:\users\alex\projects\robot\bo.js typeerror: 'undefined' not object (evaluating 'b.prototype') the code is: var __extends = this.__extends || function (d, b) { (var p in b) if (b.hasownproperty(p)) d[p] = b[p] function __() { this.constructor = d; } __.prototype = b.prototype; // <<< here d.prototype = new __(); }; so. think problem related inheritance. have 1 encountered problem? appreciated. thanks. the common cause of error loading files in wrong order... example... file a class exampleclass { somemethod() { alert('hello world'); } } file b class examplesubclass extends exampleclass { } if load file b before file a , exac...