Posts

Showing posts from February, 2015

Adjusting style of the dialog widget from jquery-ui -

i trying make customizations in dialog widget jquery-ui. accomplish this, include css file follow content in jsp page: .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; background-color: black; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 0; white-space: nowrap; width: 90%; overflow: hidden; text-overflow: ellipsis; text-decoration-color: white; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 20px; margin: -10px 0 0 0; padding: 1px; height: 20px; } which take example available in official page ( http://jqueryui.com/dialog/ ), has no effect in dialog when run application (it's displayed same way, css or without it). the complete code jsp page using dialog this: https://github.com/klebermo/webapp_horario_livre/blob/master/webcontent/web-inf/jsp/acesso/start.jsp someone knows doing wrong?

javascript - FullCalendar events do not hold color change -

i changing events in fullcalendar ( http://arshaw.com/fullcalendar/docs/event_data/ ) doing following: eventclick: function (event) { if ($(this).css('background-color').match(/^(?:green|#fff(?:fff)?|rgba?\(\s*0\s*,\s*255\s*,\s*0\s*(?:,\s*1\s*)?\))$/i)) { $(this).css('border-color', 'red'); $(this).css('backgroundcolor', 'red'); } else if ($(this).css('background-color').match(/^(?:red|#fff(?:fff)?|rgba?\(\s*255\s*,\s*0\s*,\s*0\s*(?:,\s*1\s*)?\))$/i)) { $(this).css('border-color', 'blue'); $(this).css('backgroundcolor', 'blue'); } } but find once change event color (or several event colors) , drag event day, events change color original colours. how can prevent this??? how can make evet persist color once changed? ...

excel - Using SUMPRODUCT, but exclude return if criteria cell is blank -

i have large array. in column there discreet numbers, 1,2,3 etc. numbers used in array (e through gf) register person has been assigned number column many items register in array. what want in column c how many times registration number (from column a) appears in array, have count of total item registrations. i used formula (found on forum): =sumproduct ((e3:gh199="cell")*1) "cell" cell reference column i'm looking in array (the discreet number). problem need account more entries have, there blank cells in column a, formula returns number of blank cells in array. need add correct instruction if cell criteria in blank, not return value. why not use countif ? example if "cell" a1 =countif(e$3:gh$199,a1) if a1 blank return 0 if there blanks in e3:gh199 if want return blank if a1 blank add if function this: =if(a1="","",countif(e$3:gh$199,a1))

Perl trouble accessing array within hash -

i've looked around answer question haven't found one; in advance help. i'm trying construct hash of arrays , randomly generate arrays hash. hash length 3, , each array pair of values: undef %pairs; $pairs{'one'} = @pair1; $pairs{'two'} = @pair2; $pairs{'three'} = @pair3; @keys = keys %pairs; @keys = shuffle(@keys); push (@file1, @{$pairs{$keys[0]}}); push (@file2, @{$pairs{$keys[1]}}); push (@file3, @{$pairs{$keys[2]}}); the following call doesn't return anything: print stdout @{$pairs{$keys[0]}}; although next call correctly return length of array (i.e. 2): print stdout $pairs{$keys[0]}; what doing wrong here? you not assigning arrays, assigning size: $pairs{'one'} = @pair1; when in scalar context, array returns size, , scalar context. want either: $pairs{'one'} = \@pair1; # use direct reference $pairs{'one'} = [ @pair1 ]; # anonymous reference using copied values or ...

ruby on rails - How can I retrieve data onscreen from an external API without tying up a request? -

i have rails 3 application lets user perform search against 3rd party database via api. potentially bring quite bit of xml data. also, api busy serving requests other users , have nontrivial delay in response time. i run 2 webservers can't afford have delayed request obviously. use sidekiq process long-running jobs, in cases i've needed haven't had return value screen. i use pusher communicate user when background job finished. checking out, don't know if can used kind of data want push screen. right pops dialog boxes messages send it. i have thought of pretty kooky stuff, running request via sidekiq, sending results session object or file, using pusher kick off kind of event grab data , populate screen it. seems kind of rube goldberg-ish. i appreciate or insight can offer problem! i had similar situation not long ago , way i've fixed using memcache , threads. i've thought using sidekiq, sidekiq ideal if don't expect use data right a...

MvvmCross iOS presenter IMvxTouchView.ViewModel is null -

i working on project involves mvvmcross. ios, use custom presenter inherits mvxtouchviewpresenter. public override void show(imvxtouchview view) { var viewcontroller = view uiviewcontroller; if (viewcontroller == null) throw new mvxexception("passed in imvxtouchview not uiviewcontroller"); if (_masternavigationcontroller == null) showfirstview(viewcontroller); else _masternavigationcontroller.pushviewcontroller(viewcontroller, true /*animated*/); var myviewmodel = view.viewmodel; //do staff myviewmodel } my problem in cases myviewmodel null @ moment. created later on ... when viewcontroller loaded. looks timing problem... interesting fact code worked @ previous mvvmcross project. i tried use : var myviewmodel = view.reflectiongetviewmodel (); unfortunately result same :( having idea how fix or work around problem ? mvvmcross creates viewmodel part of bas...

ruby, why using a module inside a module? -

trying perform remoteauthetication devise, ran example (almost official one, since devise wiki limited refer this document ). all classes implement authentication algorithm "double" enclosed either devise, models or devise, strategies. here devise, models example: module devise module models module remoteauthenticatable extend activesupport::concern def remote_authentication(authentication_hash) # logic authenticate external webservice end end end end first question: how can explain ruby newbie (as am), maybe coming language, such java, rationale of sort of namespace? while namespaces in different flavours common among programming languages, particular way of using them new me. in other languages 1 wouldn't use same namespace of thirdy party library (such devise in case) even when implementing interfaces or extending classes provided it . but here see devise itself, in bits, defines module devise module models ...

c++ - How do i enable 'std=c++0x' from command line? -

i trying generate random numbers following discrete distribution , found link: http://www.cplusplus.com/reference/random/discrete_distribution/ i compiled example given them , got error c:\users\anand\desktop>g++ random.cpp -o rand in file included c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/random:3 5:0, random.cpp:3: c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/c++0x_warning.h:32:2: err or: #error file requires compiler , library support upcoming iso c++ standard, c++0x. support experimental, , must enabled -std=c++0x or -std=gnu++0x compiler options. random.cpp: in function 'int main()': this tells need enable '-std=c++0x'. can done in ide how do via cmd? like this: g++ -std=c++0x random.cpp -o random.exe for worth, compiler quite out of date. update modern version.

c++ - Declare the same non-member function twice? -

i have class , class b i define non member method using , b double operator*(const a& a, const b& b); is declare a.h , b.h @ same time since can considered belong both , b? is declare a.h , b.h @ same time since can considered belong both , b? it possible declare since declaration, , not definition. other that, personal taste whether so, or put common header, , on.

How to set property of a view in layout XML file in Android? -

for example, using android.support.v4.view.pagertabstrip , want call settabindicatorcolor choice of color. how in layout xml file? best thing can consult documentation. pagertabstrip here . there's summary section can check xml attributes defined class. in case, can see there attributes inherited viewgroup , view . none of them sets tab indicator color. this means need set in code. let's @ example there attribute, e.g. orientation linearlayout . there's entry android:orientation attribute tells how set in xml.

performance - C++ cross-platform equivalent of Windows' QueryPerformanceCounter() -

to measure execution time of portion of c++ code on windows, tend use queryperformancecounter() high-resolution timer. example of can found in this vcblog post on stl performance . with aim of writing cross platform c++ code, functions/classes use same purpose? assuming modern compiler, you're looking std::chrono::high_resolution_clock

javascript - Removing the class of a nav li - properly -

the basic visuals question available @ http://sevenx.de/demo/bootstrap-carousel/inc.carousel/tabbed-slider.html - in case wanted take peek it. but here what's going on. the html & css behind tabbed-carousel below. (i've shortened brevity purposes. ) <style> #mycarousel-100 .nav small { display:block; } #mycarousel-100 .nav { background:#eee; } #mycarousel-100 .nav { border-radius: 0px; } </style> <div class="container"> <div id="mycarousel-100" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"><!-- wrapper slides --> <div class="item active"> panel 1 content </div><!-- end item --> <div class="item active"> panel 2 content </div><!-- end item -->...

php - Javascript & problems -

i have following code: var artist = document.getelementbyid("txtboxartist").value; when value plain text, e.g. biffy clyro, artist = biffy clyro when value contains &amp; , e.g. mumford & sons, artist = mumford i send artist value using ajax, , recover value on php page this: var data = "nametitle=" + title + "&nameartist=" + artist; [...] $nameartist=$_post['nameartist']; why happen , how avoid it? giving me lots of problems & symbol... thank all! i guess can encode valiables before sending them this: artist = encodeuricomponent(artist); title = encodeuricomponent(title); var data = "nametitle=" + title + "&nameartist=" + artist; hope helps.

How do I initialize a typescript object with a JSON object -

i receive json object ajax call rest server. object has property names match typescript class (this follow-on this question ). what best way initialize it? don't think this work because class (& json object) have members lists of objects , members classes, , classes have members lists and/or classes. but i'd prefer approach looks member names , assigns them across, creating lists , instantiating classes needed, don't have write explicit code every member in every class (there's lot!) these quick shots @ show few different ways. no means "complete" , disclaimer, don't think it's idea this. code isn't clean since typed rather quickly. also note: of course deserializable classes need have default constructors case in other languages i'm aware of deserialization of kind. of course, javascript won't complain if call non-default constructor no arguments, class better prepared (plus, wouldn't "typescripty way"...

python - If Statements To Find Area and Perimeter -

print "this find area or perimeter of rectangle " print "do want find area(a) or perimeter(p) of rectangle?" a= raw_input(" want find ") if raw_input = (a) print "what length of rectangle?" b = int(raw_input("the length of rectangle ")) print "what width of rectangle?" c = int(raw_input("the width of rectangle ")) d = (2 * b) + (2 * c) print d if raw_input = (p) print "got it. length of rectangle?" x = int(raw_input("the length of rectangle ")) print "what width of rectangle?" y = int(raw_input("the width of rectangle ")) z = x * y print z how can program code a area , p perimeter? this odd, cannot check see if raw_input() something. , also, == test equality, = assign. here want: print "this find area or perimeter of rectangle " print "do want fi...

php - Mobile firefox and mp3 support -

i'm trying build website user uploads mp3 files. when testing, mobile firefox player disappears when play button in clicked. understand firefox can play ogg files. can use convert uploaded mp3 files ogg format in order have full support of mp3 playing throughout web , mobile browsers. any explanation how soundcloud manages have full support of files of mp3 in firefox mobile. thanx do not convert these files. trust me. firefox can play mp3 files yet tricky hack. hack done soundmanager2. go check out. offers best compatabilty browsers. definately want website! i assuming soundcloud similar soundmanager2. have no idea how works, audio definately tricky go in web dev. if anything, best guess flash fallback... also converting audio files msy taxing bandwidth.

html - Fix navigation bar after scrolling to first section using Bootstrap -

i want navigation bar become sticky after scroll first section id placed (think of single page website, want navigation become fixed person scrolls first "section") here's html far: <div class="container"> <nav class="navbar navbar-default navgui" role="navigation"> <div class="container-fluid"> <!-- brand , toggle grouped better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="index.html"...

c - Posix call 'read' does not read entire file -

while programming files stumbled upon strange difference between c library 'fread' function , posix call 'read'; 'read' reads few bytes of file while 'fread' reads whole file. code reads 1024 + 331 bytes, , 'read' returns 0: char buf[1024]; int id = open("file.ext", 0); int len; while((len = read(id, buf, 1024)) > 0) println(len); while code reads whole file expected, around 11kb: char buf[1024]; file* fp = fopen("file.ext", "rb"); int len; while((len = fread(buf, 1, 1024, fp)) > 0) println(len); can tell why 'read' doesn't read whole file? edit2: sorry, using windows mingw, , reading binary file edit: complete example: #include <io.h> #include <stdio.h> int main() { char buf[1024]; int len; // loop 1 int id = open("file.ext", 0); while((len = read(id, buf, 1024)) > 0) { printf("%d\n", len); } close(i...

c++ - Using the ceil() function more advanced -

i aware of ceil function does, rounds numbers up. so; 1.3 2.0 , 5.9 6.0. want round steps of 0.5. so; 1.3 1.5 , 5.9 6.0. possible? thanks!!! y = ceil(x * 2.0)/2.0; should need: x x*2.0 ceil(x*2.0) y ------------------------------ 1.3 2.6 3.0 1.5 1.6 3.2 4.0 2.0 5.9 11.8 12.0 6.0

php - How to fix unexpected $end error? -

hello iam learning create portal news using php, followed step step on book tutorial.but give me return error :( iam check again , again syntax line line , code equal tutorial in books. think can not found error. grateful if me.. <link rel="stylesheet" type="text/css" href="style.css"/> <?php include 'koneksi.php'; $table1=berita; $table2=kategori; $id=1; $hal = $_get[hal]; if(!isset($_get['hal'])){ $page = 1; }else { $page = $_get['hal']; } $max_result = 2; echo $page; $from = (($page * $max_result) - $max_result); $sql=mysql_query("select * $table1, $table2 $table1.id_kategori , $table1.id_kategori=$table2.id_kategori order tanggal desc limit $from, $max_result;"); while($tampil=mysql_fetch_array($sql)){ $data=substr($tampil['isi'],0,200); ?> <div class="box"> <p align="justify"> <img src="<?=$tampil[gambar];?>" align="left"...

Redirection on direct access to PHP script -

i'm building website contains considerable amount of object-oriented php code. keep code clean, each class stored in single file named [classname].class.php , require_once 'd in script file. being form evaluation script, has redirections based on post variable prevent dummy execution , database errors. how make trying access .class.php files gets redirected related html page, keep usable include , require ? you can either put outside public_html folder deny access/redirect using filename patterns in .htaccess build small php code in (the top of every class file) looks variable initialised in index. if it's not there, redirect. if need further explanation on of these, ask.

Configuring puppet third party modules -

i creating masterless provisioning puppet. have installed third party module alongside custom module called my_module : puppet module install maestrodev/rvm now in modulepath i've got following: my_module rvm some_dependencies after gets interesting. want configure module per puppetforge documentation . the question put newly created configuration? in my_module/tests/init.pp file? in kind of overriding module? please forgive me noob question, i've searched documentation particular scenario pretty hard , couldn't find anything. if going create set of pp files, given in documentation, it's suggested put them in single directory (named "manifest" convention) when run puppet "apply" command on directory, puppet parse pp files in alphabetical order , execute them ex: puppet apply /etc/.../puppet/manifests for execution of single file: puppet apply /etc/.../puppet/manifests/johndoe.pp reference: http://docs.puppetlabs....

wpf - Conditional cell editing in xamDataGrid -

i'm using xamdatagrid. want disable cell status column, if value dbnull. issue seems fieldsettings, i'm not able pass correct value cell converter. here code : xaml : <window.resources> <dbnullconverter:dbnulltobooleanconverter x:key="nulltobooleanconverter" /> </window.resources> <grid> <dockpanel> <igdp:xamdatagrid x:name="griddata" datasource="{binding path=tempdatatable}"> <igdp:xamdatagrid.fieldlayoutsettings> <igdp:fieldlayoutsettings autogeneratefields="true"/> </igdp:xamdatagrid.fieldlayoutsettings> <igdp:xamdatagrid.fieldsettings> <igdp:fieldsettings allowedit="true" /> </igdp:xamdatagrid.fieldsettings> <igdp:xamdatagrid.fieldlayouts> <igdp:fieldlayout> <igdp:field name="stat...

What unit is "advanced" stored in for True Type fonts table "hmtx"? -

i running simple script wrote " advance " of true type fonts. font in specific new times roman. kind of values i'm getting back, { "a" : 1479 "a" : 909, "b" : 1366, "b" : 1024 "c" : 1366, "c" : 909, "n" : 1479, "n" : 1024, "m" : 1821, "m" : 1593, "." : 512, } i'm using perl library font::ttf, can find manual here . and, here script, use strict; use warnings; use autodie; use font::ttf::font; $f = font::ttf::font->open('/usr/share/fonts/truetype/msttcorefonts/times_new_roman.ttf') || die $!; $json = json::xs->new->ascii->pretty->allow_nonref; @chars = ( '.', '-', 'a'...'z', 'a'...'z', 0..9 ); %db; foreach $char ( @chars ) { $ord = ord($char); $snum = $f->{'cmap'}->ms_lookup($ord); $f->{'hmtx'}->read; $sadv =...

html - How to get my forms' Javascript error function to cancel form submission and insert error message? -

i have been reading several posts realted matter here on stack overflow , been reading w3 schools tutorials on javascript , html forms. i creating xhtml form required fields users submit personal data (name, address, phone). want onsubmit attribute pass each input value argument external javascript function website_form_error() . <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <head> <script src="http://othermindparadigm.com/web_frm_err.js" type="text/javascript"></script> </head> <body> <p class="mid" id="frm_responder">&nbsp;</p> <form action="/webformmailer.php" method="post" onsubmit="javascript:website_form_error(document.getelementbyid('name').value,document.getelementbyid('address').value,document.getelementbyid('phone').value)...

scrollbar - how to add scroll bar in android on justified textview -

i adding scrollbar on text view below last few lines of text cropped , not visible. why happening , how solve this? xml- <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/back"> <com.abc.xyz.textviewex android:id="@+id/etext1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textsize="@dimen/betxt" android:textcolor="#ffffff" android:layout_marginleft="@dimen/activity_margin" android:layout_marginright="@dimen/activity_margin" android:layout_marginbottom="@dimen/activity_margin" ...

matlab - determine number of bins for histogram -

Image
according link http://en.wikipedia.org/wiki/freedman%e2%80%93diaconis_rule and link https://stats.stackexchange.com/questions/798/calculating-optimal-number-of-bins-in-a-histogram-for-n-where-n-ranges-from-30 function m=histogram_bins(y); m=floor(2*iqr(y))/(length(y)^(1/3)); end but data histogram_bins(z) ans = 1.5791 i have tried histogram bins 2 , following picture but not correct separation,so how can fix it? let consider following example data see means seperation histogram_bins(b) ans = 17.4452 histogram(b,100,18) % dont pay attention 100

c# - Reading text file from Windows and writing on a Linux Server in C -

i working on client-server application. client project designed in vs 2012 c#, , server side coding done in c. basic aim client app read file , send server , server app write on server. text file sent contains data ls.db abs.tst=8745566 xyz.xys=2239482 kpy.llk=0987789 but when written on server written abs.tst=8745566xyz.xys=2239482kpy.llk=0987789 the application reading number of sent bytes. there bytes missing @ end when file written. server size file has 6bytes missing when checked properties of client file , server file have given client , server code below kindly guide me how can solve issue client code in c# string[] lines = system.io.file.readalllines("local.db"); var binwriter = new system.io.binarywriter(system.io.file.openwrite("l2.db")); foreach (string line1 in lines) { sslstream.write(encoding.ascii.getbytes(line1.tostring())); } sslstream.write(encoding.ascii.getbytes("eof")); linux based server cod...

Facebook Graph API - See user which liked our page -

i want create entrance app events @ congress. users liked our company-facebook page before should allowed enter. i reading around last days, not possible (only if user logged in facebook connect on our site) see via graph api, users liked our page? have email adress (over external registration form), not facebookid. i'm wondering if there solutions outside, didn't found... it's not possible list of users have liked page. but since having email_ids of users have liked page, left 1 thing - searching users email_id unfortunately has been disallowed facebook. see here . says- the ability pass in e-mail address "user" search type removed on july 10, 2013. search type returns results match user's name (including alternate name). for future ref, if have application, can query /me , save facebook ids.

chef - error in installing knife-ec2 plugin -

while installing knife-ec2 plugin.i facing following issue: root@ip-10-ggg-ff-abc:/opt/chef/embedded/bin# gem install knife-ec2 error: error installing knife-ec2: mime-types requires ruby version >= 1.9.2. i think error clear... one of gems knife-ec2 requires ruby version (1.9.2 or higher). running version of ruby less 1.9.2. upgrade ruby in omnibus package or use ruby version manager install newer ruby.

javascript - Unexpected issue in Css3 html5 Div alignement when applying border-left -

i'm trying produce report using html5 , css3 got unexpected behavior. need understand why div not aligned css3 .linediv{ border-left: 5px solid #ff0000; background:whitesmoke;height:30px; margin-top: 10px; } /* */ .titlediv {border-bottom:5px solid orangered;border-top: 4px solid #ffffff; text-align: center; ;background:gainsboro;height: 50px; font-size: 18px;color:#2f4f4f ; font-family: calibri, candara, segoe, "segoe ui", optima, arial, sans-serif; font-weight:bold; text-shadow: 1px 1px white;} .maindiv{ margin: auto;height: 600px;width: 600px; border: 1px solid gray; } .bodydiv { margin: 10%; align-content: center; } .labelp { float: left; margin-top: 7px;width: 80px; border-right: 1px solid white;vertical-align: middle; text-align:left; font-size: 15px;color:#2f4f4f ; font-family: calibri, candara, segoe, "segoe ui", optima, arial, sans-serif; font-weight:bold; text-shadow: 1px 1px white; } .labeltxt {display: inline-block; ; marg...

backbone.js - how to present json data on Highchart -

Image
[{"seep":"iw-b-(l)","date":" 27-jul-13","reslevel":79.215,"flowrate":1320.25}, {"seep":"iw-b-(l)","date":" 28-jul-13","reslevel":79.25,"flowrate":1320.833333}, {"seep":"iw-b-(l)","date":" 29-jul-13","reslevel":79.275,"flowrate":1321.25}, {"seep":"iw-b-(l)","date":" 30-jul-13","reslevel":79.29,"flowrate":1321.5}, {"seep":"iw-b-(l)","date":" 31-jul-13","reslevel":79.315,"flowrate":1321.916667}, {"seep":"iw-b-(l)","date":" 1-aug-13","reslevel":79.365,"flowrate":1322.75}, {"seep":"iw-b-(l)","date":" 2-aug-13","reslevel":79.38,"flowrate":1323}, {"seep":"iw-b-(...

Displaying two digit numbers in assembly? -

i new assembly programming. in of examples @ classwork required add 2 numbers , display sum, find cryptic display sum when 2 digit number. here's code. mov al,num1 mov bl,num2 add al,bl add ax,3030h mov dl,ah mov ah,02h int 21h mov dl,al mov ah,02h int 21h mov ah,4ch int 21h while addition might result in packed number, how unpack , display 2 different numbers in decimal? i'm new assembly. think you. .model small .stack 100h .data msg1 db "enter number 1:$" msg2 db "enter number 2:$" msg3 db "sum is:$" no1 db 0 no2 db 0 mysum db 0 rem db 0 .code mov ax,@data mov ds,ax ;print msg 1 mov dx,offset msg1 mov ah,09h int 21h ;read input no1 mov ah,01h int 21h sub al,48 mov no1,al ;print new line mov dl,10 mov ah,02h int 21h ;print msg2 mov dx,offset msg2 mov ah,09h int 21h ;read input...

r - Sort factor using an other factor -

i use tutorial tu plot heatmap using ggplot2 http://learnr.wordpress.com/2010/01/26/ggplot2-quick-heatmap-plotting/ now i'd order vertical factor using onother factor same length. strains x1 x2 x3 origin name 4 2 4 see does have idea how work? thanks if have column in nba , instance nba$country , can adjust ordering in original by nba$name <- with(nba, reorder(name, country)) if have alternative annotation want order by, you'll need match in. instance if have player-country data.frame (pc), then nba$name <- reorder(nba$name, pc$country[match(nba$name, pc$name)])

c++ - Mergevec.obj: 10 unresolved linking errors (OpenCV samples collection for haartraining) -

using this tutorial , i'm trying merge different vectors created using opencv_createsamples can haartraining. i'm compiling mergevec.cpp using vs 2010 command line interface: cl /ehsc mergevec.cpp but 10 unresolved externals errors, here: /out:mergevec.exe mergevec.obj mergevec.obj : error lnk2019: unresolved external symbol _cvfree_ referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z) mergevec.obj : error lnk2019: unresolved external symbol _cvreleasemat referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int *,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z) mergevec.obj : error lnk2019: unresolved external symbol _cvwaitkey referenced in function "void __cdecl icvappendvec(struct cvvecfile &,struct cvvecfile &,int*,int,int)" (?icvappendvec@@yaxaaucvvecfile@@0pahhh@z) mergev...

jQuery File Upload - validate filesize and extension -

i'm using jquery file upload, code is: $(function(){ var ul = $('#upload ul'); // initialize jquery file upload plugin $('#upload').fileupload({ maxfilesize: 500, acceptfiletypes: /(\.|\/)(gif|jpe?g|png)$/i, formdata: { action: 'ja_upload_doc', cv_id: $('#cv_id').val(), first_name: $('#first_name').val(), last_name: $('#last_name').val(), }, // element accept file drag/drop uploading dropzone: $('#drop'), // function called when file added queue; // either via browse button, or via drag/drop: add: function (e, data) { // automatically upload file once added queue var jqxhr = data.submit().success(function (result, textstatus, jqxhr) { console.log('done'); ...

sql - Passing an integer array to mysql procedure -

i want create stored procedure receives array of integers , other input, example: create procedure test (field1 varchar(4), field2 varchar(4), array varchar (255)) and in stored procedure want use this: ... some_field in (array) ... the problem in way getting rows correspondence first integer in array. is there way make work (i tried use find_in_set did same in )? the call making testing stored procedure call test (12, 13, '1, 2, 3') . find_in_set() works, can't have spaces in string of numbers. demo: mysql> select find_in_set(2, '1, 2, 3'); +---------------------------+ | find_in_set(2, '1, 2, 3') | +---------------------------+ | 0 | +---------------------------+ mysql> select find_in_set(2, '1,2,3'); +-------------------------+ | find_in_set(2, '1,2,3') | +-------------------------+ | 2 | +-------------------------+ so should either form list no spaces bef...

Set analyzers for _all field with NEST -

as described in _all field elasticsearch documentation . the _all fields allows store, term_vector , analyzer (with specific index_analyzer , search_analyzer) set. is there way specify index_analyzer , search_analyzer attributes on _all field mapping nest? specifically, able set following index: { "model": { "_all": { "index_analyzer": "ngram_analyzer", "search_analyzer": "whitespace_analyzer" } ... } i did not see allow in fluent mappings. can set manually if not via fluent mapping? starting nest 1.0 can this: var result = this._client.map<elasticsearchproject>(m => m .allfield(a=>a .enabled() .indexanalyzer("ngram_analyzer") .searchanalyzer("whitespace_analyzer") .termvector(termvectoroption.with_positions_offsets) ) ... ...

javascript - Circular canvas with bound that fills based on click and drag points? -

i'm incredibly new javascript, sorry if idea isn't using proper vocab y'all can me great! does know how make circular canvas allows users fill portion of circle based on click , drag points within circle? i think make circular canvas them color in, i'd make don't have scribble on circle color in. a demo: http://jsfiddle.net/m1erickson/lvgwv/ you can use context.arc command draw pie wedge. listen mouse events , in mousedown set beginning angle of wedge: function handlemousedown(e){ e.preventdefault(); mousex=parseint(e.clientx-offsetx); mousey=parseint(e.clienty-offsety); // put mousedown stuff here var dx=mousex-cx; var dy=mousey-cy; begin=math.atan2(dy,dx); isdown=true; } in mousemove can set ending angle of wedge: function handlemousemove(e){ if(!isdown){return;} e.preventdefault(); mousex=parseint(e.clientx-offsetx); mousey=parseint(e.clienty-offsety)...

Enable Cache On Azure CDN -

i setting azure cdn, , having trouble setting cache-control header. i used cloudberry explorer setup sync between server folders , cdn. working well. files copied cdn no problem. under tools > http headers > edit http header set value cache-control be: public,max-age=604800 however, not appear having effect (according both fiddler , page speed). any tips on setting cache-control header azure cdn appreciated. i had issue myself , needed update cache-control header on thousands of files. prevent caching issues in sites, re-deploy these files every release new path. i able patch different suggestions online , landed on following solution, use deploying 1 of production apps. you need 2 files, , script assumes they're in same directory on computer: a text file listing of files in container (see example below) the powershell script the text file (file-list.txt) the file should in example format below full file path deployed cdn container. not...

python - No Such Resource 404 error -

i want run index.html. when type localhost:8080 index.html should executed in browser. giving no such resource. specifying entire path of index.html. please me out.?? from twisted.internet import reactor twisted.web.server import site twisted.web.static import file resource = file('/home/venky/python/twistedpython/index.html') factory = site(resource) reactor.listentcp(8000, factory) reactor.run() this related difference between url ending slash , 1 without. appears twisted considers url @ top level (like http://localhost:8000 ) include implicit trailing slash ( http://localhost:8000/ ). means url path includes empty segment. twisted looks in resource child named '' (empty string). make work, add name child: from twisted.internet import reactor twisted.web.server import site twisted.web.static import file resource = file('/home/venky/python/twistedpython/index.html') resource.putchild('', resource) factory = site(resource) reactor.li...

c# - Using properties for lists -

i'm trying use property prevent first value of list ever being less zero: private list<int> _mylist = new list<int>(); public list<int> mylist { { return _mylist; } set { if (value[0] < 0) { value[0] = 0; } _mylist = value; } } add in code: if(buttonpressed) { mylist[0] -= 1; } however can press button , decrease value through zero. what missing? you never enter property, reserved setting value of actual list rather lists elements. best bet write method reduce items count void adjustcount(int value) { if(mylist[0] + value >= 0) mylist[0] += value } if(buttonpressed) { adjustcount(-1); }

Is entity framework 6.1 (prerelease) view generation okay to use for production -

i've been dealing ef in project 5+ years. it's database-first , because of huge overhead migration dbcontext result in, i'm still dancing objectcontext. nice see improvements of runtime performance delivered in each release, though know last official release missing view generation mechanisms because of mapping api been hidden. fine relatively simple entity models, i'm having complex one, warm time not acceptable. i've installed 6.1 beta , looks generated views job, , i'm thinking of making part of project's next delivery. question 6.1 prerelease version: beta because of not promised 6.1 backlog done(were, though, things completed , tested) or beta because extent, still being developed? i'm hoping first case scenario , maybe can me figuring out, kind of feedback welcome(don't tell me "beta beta", know :) ). thanks! like suggested @abatishchev, i've installed ef 6.1.0 rtm instead.

apache - Configuring CakePHP .htaccess in Cpanel ~temp/ URL -

i'm trying set cakephp 2.x in cpanel (hostmonster) while domain of site still pointing older server. in order pull site without domain (for demo), have use http://[hosting-ip-address]/~mysite . this default .htaccess file located in root (the 1 before app/ folder): <ifmodule mod_rewrite.c> rewriteengine on rewriterule ^$ app/webroot/ [l] rewriterule (.*) app/webroot/$1 [l] </ifmodule> if leave is, 404 error. when remove .htaccess file or leave blank, site content loads, without css. site files located in /home2/mysite/public_html/ folder. tried adding rewritebase different combinations (~mysite, mysite, mysite/public_html), no avail. try in htaccess file:- <ifmodule mod_rewrite.c> rewritebase / rewriteengine on rewriterule ^$ app/webroot/ [l] rewriterule (.*) app/webroot/$1 [l] </ifmodule> hope work!

JavaScript/jQuery: Select specific option trigger file input -

i'm searching way have html select box arbitrary number of options , have last option "upload new item" , trigger file input element i've hidden css (display:none). my problem can't work , i've tried various of different functions , methods. to test i've tried same thing regular text link (a href) works fine. in addition i've tried test change event on select trigger other events works. won't accept click trigger of file input element. you can see different tests , approaches here: http://codepen.io/mestika/pen/rvnek edited i'm on mac running maverick in google chrome cheers