Posts

Showing posts from March, 2015

java - Spring social - Implicit sign up is not working -

i spring social along spring mvc connect twitter . want achieve implicit sign up, if user new following spring social docs . getting following error, when application deployed error: org.springframework.web.context.contextloader - context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'springsecurityfilterchain' defined in class org.springframework.security.config.annotation.web.configuration.websecurityconfiguration: instantiation of bean failed; nested exception org.springframework.beans.factory.beandefinitionstoreexception: factory method [public javax.servlet.filter org.springframework.security.config.annotation.web.configuration.websecurityconfiguration.springsecurityfilterchain() throws java.lang.exception] threw exception; nested exception java.lang.illegalstateexception: springsocialconfigurer depends on org.springframework.social.security.socialauthenticationservicelocator. no single bean of type found i

php - How to target Facebook users with products they viewed without purchasing -

i trying work out issue weeks now. contacted facebook said contact stack overflow. how targeting facebook visitors same product after viewed , left website? for example: mr. visits example.com e-commerce site. views product goes product b , exits site. next day mr. see product b in right column/news feed ads. i have hunch has firing custom audience pixel product b id data not sure how implement code in fb custom audience pixel. also note: have configured product feed , product catalog work done. i think it's funny facebook seems try outsource product support stackoverflow... did have at https://developers.facebook.com/docs/marketing-api/dynamic-product-ads/product-audiences/v2.3 you need use custom audience pixel described at https://developers.facebook.com/docs/ads-for-websites/website-custom-audiences/getting-started with events described in first link. e.g. upon product view in website, product view content event should triggered: window._fb

kendo ui mobile position element at bottom -

i'm trying position element @ bottom of mobile page using kendo ui mobile. have tabstrip @ bottom, , don't want footer styling, unfortunately data-role="footer" won't cut it. i'vetried setting style="bottom:-1em;" doesn't work, places div before -1em. for bottom style work, should either use position: fixed or absolute. position fixed should position according viewport, regardless of element's container. position: fixed rather buggy on mobile platforms. position: absolute on other hand position element according positioned container, in order use it, can place element in footer. absolute position remove element page flow, won't affect positioning of tabstrip have there. footer doesn't have overflow: hidden, element can positioned outside of , on content if want.

javascript - AngularJS custom datepicker directive -

i make custom datepicker directive custom template. but have no idea how start building it... how include date data directive? i appreciate guide or give me advice work on more precisely. it might you! follow below steps html code sample: <label>birth date</label> <input type="text" ng-model="birthdate" date-options="dateoptions" custom-datepicker/> <hr/> <pre>birthdate = {{birthdate}}</pre> <script type="text/ng-template" id="custom-datepicker.html"> <div class="enhanced-datepicker"> <div class="proxied-field-wrap"> <input type="text" ui-date-format="yy-mm-dd" ng-model="ngmodel" ui-date="dateoptions"/> </div> <label> <button class="btn" type="button"><i class="icon-calendar"></i>

regex - How to remove HTML tags from string using asp.net (Bold,strong,font names etc etc) -

i using ckeditor enter details (the details contains html elements ). after details bind grid. in want show details without html tags in tooltip. protected void grdstepmain_rowdatabound(object sender, gridviewroweventargs e) { int = 0; if (e.row.rowtype == datacontrolrowtype.datarow) { foreach (tablecell cell in e.row.cells) { i++; string description = cell.text; if (cell.text.length > 8 && (i == 2)) cell.text = cell.text.substring(0, 8) + "...."; string newdescription = regex.replace(description, @"<[^>]+>|&nbsp;", "").trim(); cell.tooltip = regex.replace(newdescription, @"<[^>]+>|&nbsp;", "").trim(); } } } but not working please me. example: string str= " &lt;h1&gt;&lt;span style=&quot;font-family:

Installing MySQL Connector/C++ or MySQL++ on windows -

i've been trying hours either of these working , linked in visual studio (2012 express version) there no consistency installation instructions. site 1 , site 2 , site 3 , site 4 , site 5 , site 6 . it infuriating least. these folders exist when don't, other mention dependencies others not, include these directories , others include those; ridiculous how hard is. does know how install mysql/c++ library? , able give clear instructions on how so? because, me @ least, answer far no.

c++ - Create a single image from images array -

hi i'm trying create single image multiple images in opencv. images use same size. what reshaping them single line , try merge them new image. i create new image size of 2 images , pass array recieve error exc_bad_access(code=1, address = ..) note: sizes of images correct size of single image : [170569 x 1] size of new_image : [170569 x 2] my code below. thank you int main(){ mat image[2]; image[0]= imread("image1.jpg",0); image[1]= imread("image2.jpg",0); image[0] = image[0].reshape(0, 1); //single line image[1] = image[1].reshape(0, 1); //single line int size = sizeof(image)/sizeof(mat); mat new_image(image[0].cols,size,cv_32fc1,image); } if understand need concatenate 2 image of same size 1 mat. wrote quick code perform task. u can change argument function pointer , add other handlers care variant size image. #include <iostream> #include <opencv2/opencv.hpp> #include <opencv2/hi

Lisp looping through a list in a function -

i have method , keep calling doing following (function1 (first lst)) (function1 (second lst)) (function1 (third lst)) this goes on five. i'm wondering if there function can create me, when created call 1 method instead of calling 5 times. given previous question recommend looking mapcar , reduce , try getting feel them. they take bit of getting used if more used loops better solution. for example: (mapcar #'function lst) will call function on each element of list returning list of results.

Counting String objects created by Java code -

how many string objects created following code? string x = new string("xyz"); string y = "abc"; x = x + y; i have visited many websites line of code creates 3 objects , creates 4. wanted know how many objects created after line of code executed. by end of run there 4 string objects: a string corresponds interned "xyz" literal its copy created new string("xyz") a string corresponds interned "abc" literal a string corresponds concatenation "xyz" + "abc" the real question attributing or of these objects program. 1 can reasonably claim few 2 or many 4 string s created code. though there 4 string objects in total, objects 1 , 3 may not created code, because in constant pool, created outside code's direct control.

cakephp - Cake php3.0 xampp 3.2.1 error -

hey had installed xampp on windows xampp control panel 3.2.1 , getting error : fatal error: must enable intl extension use cakephp. in g:\xampp\htdocs\hw\config\bootstrap.php on line 38 i had changed httpd.conf , uncomment line loadmodule rewrite_module libexec/apache2/mod_rewrite.so and change directory attributes : <directory /> options followsymlinks allowoverride order deny,allow deny </directory> to , restarted apache , still getting message fatal error: you must enable intl extension use cakephp. in g:\xampp\htdocs\hw\config\bootstrap.php on line 38 if have change ;extension=php_intl.dll extension=php_intl.dll (remove semicolon) in php.ini still same error comes. in both xampp , wamp, mcrypt , mbstring extensions working default. in xampp, intl extension included have uncomment extension=php_intl.dll in php.ini , restart server through xampp control panel. in wamp, intl extension “activated” default not working

Go embedded struct call child method instead parent method -

here sample of go code interface, parent struct , 2 children structs package main import ( "fmt" "math" ) // shape interface : defines methods type shapeinterface interface { area() float64 getname() string printarea() } // shape struct : standard shape area equal 0.0 type shape struct { name string } func (s *shape) area() float64 { return 0.0 } func (s *shape) getname() string { return s.name } func (s *shape) printarea() { fmt.printf("%s : area %v\r\n", s.name, s.area()) } // rectangle struct : redefine area method type rectangle struct { shape w, h float64 } func (r *rectangle) area() float64 { return r.w * r.h } // circle struct : redefine area , printarea method type circle struct { shape r float64 } func (c *circle) area() float64 { return c.r * c.r * math.pi } func (c *circle) printarea() { fmt.printf("%s : area %v\r\n", c.getname(), c.area()) } // genreric

email - Remove cell border in HTML mail in Outlook 2013 -

Image
i'm trying remove 3 cell borders table in html mail. current situation this: what have what want code: <html> <head> <style type="text/css"> body { font-family:calibri, arial, sans-serif; font-weight:normal; } table { font-family:calibri, arial, sans-serif; font-weight:normal; font-size:14px; border-color:#cccccc; border-collapse:collapse; width:700px; } table th { font-weight:bold; padding:10px 5px; border-style:solid; border-width:1px; word-break:normal; border-color:#cccccc; background-color:#f0f0f0; } table td { padd

xmpp - How to keep chat history locally on android? -

i using openfire , asmack chat application. i able send , receive messages using asmack library. can tell me how keep these messages in local(android) storage, whenever user opens application next time, can see previous chat history ? there api provided asmack/smack ? simply register packet listener , interceptor , log messages backing store of choice.

Is it an Android's potential support package for Material Design? -

does package named "design" can find in android support sources meant supporting material design: if yes, how use in android studio because doesn't work compile 'com.android.support:support-design:+' the package name wrong try with: com.android.support:design:22.2.0

ios - Overwrite animation duration in Appcelerator -

i developing game has timer bar running across screen while playing. when game ends want timer bar stop running. have following animation: var startanimation = ti.ui.createanimation({ right: "0dp", duration: 20000, curve: titanium.ui.animation_curve_linear }); //animate progress bar $.timegoalprogress.animate(starthighscoreanimation); which want overwrite with: var stopanimation = ti.ui.createanimation({ right: "100dp", duration: 1 }); $.timegoalprogress.animate(stopanimation); but duration of animation not overwritten second duration. happens right value replaced new right value, duration stays 20000. does know how overwrite duration of animation? use sdk version 3.5.1 , developing ios.

ios - How to send sms programatically in background without open sms popup? -

i want send sms functionality in background without open popup sms any framework or sdk that i have used ctmessagecenter ( coretelephony framework) not working code: bool success = [[ctmessagecenter sharedmessagecenter] sendsmswithtext:@"test 1234..." servicecenter:nil toaddress:@"+1234567890" withmoretofollow:no]; if(success){ nslog(@"message sent"); }else{ nslog(@"message not sent"); } any other way pls let me know. no, don't allow sending sms or email without user interaction, trick, rejected

apache - Hadoop client not able to connect to server -

i set 2-node hadoop cluster, , running start-df.sh , start-yarn.sh works nicely (i.e. expected services running, no errors in logs). however, when try run application, several tasks fail: 15/04/01 15:27:53 info mapreduce.job: task id : attempt_1427894767376_0001_m_000008_2, status : failed i checked yarn , datanode logs, nothing reported there. in userlogs, syslogs files on slave node contain following error message: 2015-04-01 15:27:21,077 info [main] org.apache.hadoop.ipc.client: retrying connect server: slave.domain.be./127.0.1.1:53834. tried 9 time(s); retry policy retryuptomaximumcountwithfixedsleep(maxretries=10, sleeptime=1000 milliseconds) 2015-04-01 15:27:21,078 warn [main] org.apache.hadoop.mapred.yarnchild: exception running child : java.net.connectexception: call slave.domain.be./127.0.1.1 slave.domain.be.:53834 failed on connection exception: java.net.connectexception: connection refused; more details see: http://wiki.apache

android - Hide RecyclerView scrollbar -

how can remove scrollbar in recyclerview? i've tried mrecyclerview.setscrollbarsize(0); it's not working. (actually, doesn't anything, whatever value set). put android:scrollbars="none" <android.support.v7.widget.recyclerview android:id="@+id/recyclerviewid" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="none" > </android.support.v7.widget.recyclerview>

c# - How do i arrange 3 numbers from biggest to smallest without using 5 if's -

i receive 3 numbers , i'm supposed display them biggest smallest, know how 5 if statements i'm pretty sure there's more efficient way this, don't know is. int = int.parse(console.readline()); int b = int.parse(console.readline()); int c = int.parse(console.readline()); if (a > b) { if (a > c) { console.writeline("{0},{1},{2}", a, b, c); } else { console.writeline("{0},{1},{2}",c,a,b); } } it's quite simple. store numbers in array , sort array: var arr = new[] { a, b, c }; array.sort(arr); array.reverse(arr); console.writeline("{0}, {1}, {2}", arr[0], arr[1], arr[2]); you can use following (which quite bit faster, harder understand if you're beginner): var arr = new[] { a, b, c }; array.sort(arr, new comparison<int>((x, y) => y.compareto(x))); console.writeline("{0}, {1}, {2}", arr[0], arr[1], arr[2]); in case, skip call array.reverse because you

asp.net xmlhttprequest...Ajax Content -

i'm using asp.net c# xmlhttprequest read external web page content. when i'm getting page content see part of text (content) , not whole content. did search , find out of page content loading ajax (after page loading) , thats why cant it. i'm using httpwebrequest my question is: how can whole page content

c - Why does the `sqrt()` print the desired output when I use `float`s instead of `double`s? -

#include <stdio.h> #include <math.h> double hypotenuse( double side1, double side2 ); int main( void ) { double a, b; printf( "enter values of 2 sides: " ); scanf( "%f %f", &a, &b ); printf( "\nthe length of hypotenuse is: %f", hypotenuse( a, b ) ); getchar(); getchar(); return 0; } double hypotenuse( double side1, double side2 ) { double c; c = (side1 * side1) + (side2 * side2); return sqrt( c ); } the above program works when use float a, b; instead of double a,b; . why? in code, use scanf( "%f %f", &a, &b ); but %f used float ,not double . try %lf double .

javascript - understanding transition function by ALEX MACCAW -

hey guys new js , reading article provided referance in bootstrap.js transitions : css transitions using jquery now if go part says programmatic transitions, thats part tried implementing . fiddle here . but somehow code famious article does't work . why ? code below : $(document).ready(function () { var defaults = { duration: 4000, easing: '' }; $.fn.transition = function (properties, options) { options = $.extend({}, defaults, options); properties['webkittransition'] = 'all ' + options.duration + 'ms ' + options.easing; console.log(properties); $(this).css(properties); }; $('.element').transition({ background: 'red' }); }); found solution in transition.js i need have code below : var transendeventnames = { webkittransition : 'webkittransitionend', moztransition : 'transitionend', otransition

apache - htaccess redirect urls with parameters to specific directory -

i want redirect specific urls from http://www.domain.com/com/page.asp?id=99 https://www.domain.com/de/directory/ and urls from http://www.domain.com/com/page.asp https://www.domain.com/de/ ive tried redirects cant done right. please me! rewritecond %{query_string} id=5 rewriterule (.*) https://www.domain.com/de/directory/? [r=301,l] works, biggest problem urls in cms https://www.domain.com/cms redirected if contain id try: rewriteengine on rewritecond %{query_string} ^id=99$ rewriterule ^page\.asp$ /de/directory/ [l,r] rewriterule ^page\.asp$ /de/ [l,r]

jquery - SQLIte insertion looping trough text -

hi trying import pieces of long text sqlite table have following problem. i use bellow code in order read long text stored in test db. var mycollectoridlength = 0, mybill, line = 0; notesdb.transaction(function(t) { t.executesql('select * billtest;', [], function(t, bulkdata){ mybill = bulkdata.rows.item(0); and loop through long text , try insert pieces of db. for (i = 1; <= ((mybill.testtext.length)/126); += 1) { alert(line) // alerts 1, 126, 252 ... t.executesql('insert or ignore buildings (buildingcode, buildingaddress, buildingcollect, buildingpay) values (?,?,?,?);', [mybill.testtext.substr((line+0), 5).trim(), mybill.testtext.substr((line+44), 40).trim(), 0, 0], function(){ alert(line) // alerts 10962 (87 * 126) }); line = * 126; } but line inside executesql not sync loop. sqlite insertion executed after loop. how can solve it???

ios - Making a single copy of a singleton -

a design question: i have singleton (in objective-c doesn't matter) the singleton class (object) data structure many classes access, , single (hence - singleton) now want add ability undo - saving snapshot of state of object - can go it. what need break singleton-ness of object (need 1 copy of it). not allow me share conveniently between classes. ideas? "the singleton class (object) data structure many classes access, , single" i think easier make singleton object have collection of data structure. create copies of data structure instead of copies of singleton.

How to match two curves in time in matlab? -

i new in matlab , face problem. have 2 datasets, let's (t,y1) , (t,y2). measurements of same experiment 2 different methods. there time delay between two. y1 , y2 values should correspond in time. have idea how can this? thank much. as long time points equal both y1 , y2 , xcorr should tell when alignment maximal. [r,lags] = xcorr(y1,y2); [~,idx] = max(r); y2_shift = lags(idx); %// amount of shift needed correct y2

plsql - Simple Procedure raise ORA-06502 -

there's simplified version of code keep raise me ora-06502: declare p_filter varchar2(300) := '2012'; p_value varchar2(300) := '12345.000'; w_new_value number(13,3) := null ; w_count number(4) := null ; begin select count(*) w_count dual p_filter = p_filter; --- more filters if w_count != 0 w_new_value := p_value / w_count; else w_new_value := p_value; end if; -- end; / someone can give me help? database details nls_language = italian nls_territory = italy nls_currency = � nls_iso_currency = italy nls_numeric_characters = ,. nls_calendar = gregorian nls_date_format = dd-mon-rr nls_date_language = italian nls_characterset = we8iso8859p15 nls_sort = west_european nls_time_format = hh24:mi:ssxff nls_timestamp

mongodb - Meteor: record in db updating, but data not changing on screen -

here's simplified version of have in 1 of templates: {{#each datarecord}} {{#if editingnow}} <tr class="datarow"> <td><button class="updaterecord" id="{{this._id}}">sav</button></td> <td><input type="text" id="{{this._id}}" value="{{this.f}}"></td></td> </tr> {{else}} <tr class="datarow"> <td><button class="edit" id="{{this._id}}">edit</button></td> <td>{{this.f}}</td> <td><button class="deleterecord" id="{{this._id}}">del</button> </td> </tr> {{/if}} {{/each}} editingnow returns value of boolean session variable starts out false. when page loads, user sees value of 'f' field each record , edit button. edit button flips session variable true , data shown using input element. user can edit

How to consume a Chunked HTTP Stream with Apache Camel? -

i have issue consuming chunked http rsvp stream using camel. the stream here , can find more information @ end of this page i have created simple route such: from("http4://stream.meetup.com/2/rsvps").log(org.apache.camel.logginglevel.info, "meetupelasticsearch.log", "json rsvp ${body}") but nothing happens no message consumed. tried adding camel timer before because not sure can use http4 component directly in from result same. can me please? you cannot use http4 component in from() directive. however, there several ways call url , retrieve result: one create timer , call http4 component to() this: from("quartz2://httppoll/mytimer?trigger.repeatcount=0") .to("http4://stream.meetup.com/2/rsvps") .log("body is: ${body}") .to(mockdestination); another way use content enricher pattern if want example aggegates results 1 stucture. note well, if url dynamic must use recipientlist()

php - how to union all this query code in codeigniter -

"table 1" $this->db->select('referral1.*, client.*, employee.* '); $this->db->from('client'); $this->db->join('referral1', 'client.referral_id = referral1.referral1_id', 'inner' ); $this->db->join('assign_psychotherapist ', 'assign_psychotherapist.a_referral_id = client.referral_id', 'inner' ); $this->db->join('employee ', 'assign_psychotherapist.a_psychotherapist_id = employee.empid', 'inner' ); $this->db->where("referral_status ='assigned' or referral_status ='accepted' "); $this->db->order_by("referral_date", "desc"); "table2" $this->db->select('referral1.*, client.*, volunteer.* '); $this->db->from('client'); $this->db->join('referral1', 'client.referral_id = referral1.referral1_id&

android - How to add empty spaces after custom listview? -

my problem, in custom listview last element 'select' button overlap cart icon. my question, how add empty space after end of custom listview? you can set linear layout listview. , can use linear layout footer(cart icon). when setting linear layouts, can add layour weights ,so can arrange listview , cart icon clearly. if want more clarifications inform me

javascript - Object undefined when declared before setInterval function -

this question has answer here: how access correct `this` inside callback? 6 answers i'm new typescript, coming java , having knowledge of javascript. i'm learning ts making old snake game! i have class gui should draw canvas. in contructor start creating snake object. later on start game loop in snake should moved... but loop function not work, because of error. "uncaught type error: cannot read property 'move' of undefined." i suspect has setinterval function works 'asyncronously' or i'm not sure... seems kind of fundamental javascript problem. any highly appreciated! module gui { export class gui { snake:model.snake; loop:any; constructor() { // snake this.snake = new model.snake(); // attach key event document.addeventlistener("keydow

java - Convert XML document render to hard-code as HTML -

i have requirement publish html file xml file html file show hard-coded values specific point in time present on xml file (i.e. independent of xml changes after html doc created). example: xml file <dvd> <name>titanic</name> <price>10</price> </dvd> <dvd> <name>avatar</name> <price>12</price> </dvd> now need convert these html document whereby values hardcoded html example html file <html> <body> <h1>dvd list</h1> <table> <tr ...> <th>name</th><th>price</th> <td>titanic</td><td>10</td> <td>avatar</td><td>12</td> i have tried using xslt provides render of xml document updated according xml changes. require point-in-time html document referring values on xml. perhaps there easy way existing technologies, or simple custom java code? it looks didn't search hard enoug

Making Conditional Formatting for a SUMIF filter in Google Sheets relative? -

i have handy little google sheet formula applies color given summed total can't formula relative. suspect either easy genius fix or impossible in sheets. help? sorry can't post images, here's rough simulation of table a1 - b4 john doe | 25% martha roe | 25% john doe | 75% jane doe | 25% in table above, i'm using conditional formatting "format cells if..custom formula is..." , formula sums values in column b john roe , martha roe (column a) , turns both name , value cell red if value exceeds 100%. use formula below: =sum(filter(b$1:$b4,a$1:a$4 = a1)) >= 100% (full credit spreadsheetpro.net's article intro sumifs, countifs, & averageifs functions in google spreadsheet.) unfortunately, when use conditional formatting approach , drag formula next cell in row, still thinks mean a1 (not a2); it's applying original formula multiple rows. right need manually change formula each cell. maddening. what i'd have update relat

c# - SharpSsh Command Execution -

Image
i trying create ssh client using c#. using tamir.sharpssh library. having issues sending command , getting appropriate response server. the way have been testing sending on ls command, followed cd.. command, followed ls command again -- see whether or not cd.. command being executed properly. however, there no difference between first ls command , second ls command. not entirely sure doing wrong. perhaps using wrong ssh type. have provided code , output getting. have added output expect. using tamir.sharpssh; namespace sshnetexample { class program { static void main(string[] args) { sshexec ssh = null; try { console.write("-connecting..."); ssh = new sshexec(host, username, password); ssh.connect(); console.writeline("ok ({0}/{1})", ssh.cipher, ssh.mac); console.writeline("server version={0}, client versio

optimization - Algorithms for bucketizing integers into buckets with zero sums -

suppose have array of integers (both negative , positive) a[1 ... n] such elements sum zero. now, whenever have bunch of integers sum zero, call them group , want split a in many disjoint groups possible. can suggest paper discussing same problem? it sounds problem consists of 2 np-complete problems. the first finding subsets solve subset sum problem. problem have exponential time complexity (as implied amit in comments), reasonable extension of subset sum problem theoretical standpoint. example, if can solve subset sum problem dynamic programming , generate canonical 2d array result, array contain enough information generate possible solutions using traceback. the second np-complete problem embedded within problem integer linear programming problem. given possible subsets solving subset sum problem, n total, want select select 0<=n<=n, such value of n maximized , no element of repeated. i doubt there publication devoted describing problem because see

c# - Xamarin StreamWriter -

could hep me doubt have? i have embedded resource text file, , when try use streamwriter write on it, error: "a system.argumentexception thrown. can not write stream." this code: var assembly = assembly.getexecutingassembly(); var resourcename = "supermimo2.products.txt"; using (stream stream = assembly.getmanifestresourcestream(resourcename)) using (streamwriter writer = new streamwriter(stream)) { writer.writeline(txtlines.text); } could tell me can do? thanks attention! android , ios packages/bundles signed , not writable. write file, have use 1 of appropriate file system folders provided os. for ios, refer guide: http://developer.xamarin.com/guides/ios/application_fundamentals/working_with_the_file_system/ for android, can do var path = environment.getfolderpath(environment.specialfolder.applicationdata); var filename = path.combine(path, my_file_name); if want include file app , write it, first need include asset in app'

python - why variable doesn't store stuff when inside a def funct -

i'm new programming! when do: >>>x = "heyy" >>>def hello(): x = "hi" >>>hello() >>>print(x) heyy why x still "heyy"? there anyway can turn x = hi global variable? without using "return" , putting new variable? like: >>>x = "heyy" >>>def hello(): x = "hi" return x >>>y = hello() >>>print(y) hi basically want change contents of x hi instead of heyy when run hello() you can use global keyword so def hello(): global x x = "hi" but note bad practice , return should used ever possible. because there every chance of value of variable getting corrupted in of methods

c++11 - C++ parameter pack fails to expand -

i'm playing variadic templates , can't understand why following code won't compile (gcc 4.9.2 std=c++11): it's example, need similar kind of use in code , fails well: template<int i> class type{}; template<typename ... tlist> class a{ public: template<int ...n> void a(type<n> ... plist){ } }; template<typename ... tlist> class b{ public: template<int ... n> void b(type<n> ... plist){ a<tlist...> a; a.a<n...>(plist ...); } }; and use example: b<int, int, int> b; b.b<1,7,6>(type<1>(),type<7>(),type<6>()); i following error: file.cpp: in member function ‘void b<tlist>::b(type<n>...)’: file.cpp:58:9: error: expected ‘;’ before ‘...’ token a.a<n...>(plist ...); ^ file.cpp:58:24: error: parameter packs not expanded ‘...’: a.a<n...>(plist ...);

opengl - GLSL vertex shader gl_Position value -

i'm creating game uses orthogonal view(2d). i'm trying understand value of gl_position in vertex shader. from understand x , y coordinates translate screen position in range of -1 1, i'm quite confused role of z , w , know w value should set 1.0 for moment use gl_position.xyw = vec3(position, 1.0); , position 2d vertex position i use opengl 3.2. remember opengl must work 3d , it's easier expose 3d details create new interface 2d. the z component set depth of vertex, points outside -1,1 (after perspective divide) not drawn , values between -1,1 checked against depth buffer see if fragment behind drawn triangle , not draw if should hidden. the w component perspective divide , allowing gpu interpolate values in perspective correct way. otherwise textures looks weird.

javascript - select method fails in Firefox and Chrome -

when user enters "junk" in input field 1, blur event triggers function notify them of error , select() 's field triggering error. works fine in ie , safari firefox , chrome skip right on select() . if use firebug step through code, works designed. here sample of code: function checkforjunk(fld) { if (fld.value == 'junk') { alert('please take out junk'); fld.select(); } } <form name="junk" action="junk.htm" method="post"> input1: <input type="text" name="morejunk" value="" onblur="checkforjunk(this);" /> <br> input2: <input type="text" name="evenmorejunk" value="" onblur="checkforjunk(this);" /> </form> it works fine me on chrome when put select in settimeout settimeout(function() { fld.select(); }, 1);

Calculator HTML form using Javascript -

i have little issue. that's code , don't know have made wrong. try complete simple html form calculate given number in text input html element. function rebate(){ var rebate_a,rebate_b,total,final; var = document.myform.rebatenum.value; if( <= 3000 ) { final = a; } else if ( (a > 3000) && (a <= 10000 ) ) { rebate_a = (a-3000) * 0.02; total = rebate_a; final = - rebate_a; } else if ( (a > 10000) && (a <= 30000 ) ) { rebate_a = (7000 * 0.02) + (a-10000) * 0.03; total = rebate_a; final = - rebate_a; } else if ( (a > 30000) && (a <= 40000 ) ) { rebate_a = (7000 * 0.02) + (20000 * 0.03) + (a-30000) * 0.05; total = rebate_a; final = - rebate_a; } else if( (a >= 40000) && (a < 50000 )) { rebate_a = (7000 * 0.02) + (20000 * 0.03) + (10000 * 0.05) + (a-40000) * 0.06; rebate_b = 25; total = rebate_a +

salesforce - Schedule a batch at certain hours -

i made schedulable batch want run @ hours, let's 6, 12 , 18. i'm writting hours in custom setting cs_schedule__c. how can call cs apex , hours? thanks in advance. here page outlining how retrieve custom settings in apex depending on if it's list or hierarchy custom settings. as far scheduling, can in apex if wish, so: classtoschedule schcls = new classtoschedule(); string sch = '20 30 8 10 2 ?'; string jobid = system.schedule('name of job', sch, schcls); the sch string cron expression represent time runs. check out cron expression builder more info. instead of using numbers build string data in custom setting.

android - webview shouldOverrideUrlLoading doesn't work as expected? -

i have webview loads real url https://example.com i open links according pattern in second webview. i have following code: public boolean shouldoverrideurlloading(webview view, string url) { // handle external url boolean openinnew = manageurl (url); log.i("openurl", url + " : " + openinnew); if (openinnew) { this.callback.openwebview2 (url); return true; } else { return false; } } the second webview shows correctly external url want load. the problem found happens original webview, redirected empty blank page (with loading icon). is possible keep first webview in original page? thought shouldoverrideurlloading should enough. maybe forgot something, appreciate. thanks lot.

php - Inserts about 30 times MYSQL -

this php supposed insert "d2" based on if day selected in "d1". inserts 30 times each row in "d1". use while time , never run problem, idea why happen? $query = mysqli_query($connection, 'select * '.$settings["d1"]); while($query_array = mysqli_fetch_array($query)){ $connection_main = mysqli_connect($settings["hostname"], $settings["mysql_user"], $settings["mysql_pass"], 'u_db_main_'.$query_array['id']); $dayofweek = strtolower(date('l')); $query2 = mysqli_query($connection_main, 'select * '.$settings_main["d1"].' '.$dayofweek.' ="1"'); while($query2_array = mysqli_fetch_array($query2)){ mysqli_query($connection_main, "insert ".$settings_main["d2"]." (c1) value ('".$query2_array['data_1']."')"); $id = mysqli_insert_id($connection_main);

c# - Must declare the scalar variable "@UserName" -

i have make simple login not crash when insert browser (") needed parameterize query string reason im gettin error saying: must declare scalar variable "@username" here code private void dosqlquery() { try { sqlconnection conn = new sqlconnection(configurationmanager.connectionstrings["rolaconnectionstring"].connectionstring); conn.open(); string checkuser = "select * userdata username = @username"; sqlcommand com = new sqlcommand(checkuser, conn); com.parameters.addwithvalue("@username", txtusername.text.trim()); int temp = convert.toint32(com.executescalar().tostring()); conn.close(); if (temp == 1) { conn.open(); string checkpassword = "select password userdata username = @username"; sqlcommand passconn = new sqlcommand(checkpassword, conn); com.parameters.addwithvalue("@username&q

javascript - Google maps being loaded multiple times? -

in page: http://sitesdemo.mghospedagem.com/ivam-entregas/3/33209.html i tried disabling few javascript related google maps, chrome console still pointing me same errors, saying have multiple instances of google maps loaded. i'm getting errors not calculating shipping, or not being able use map, blah blah blah. can me find part of javascript have edit fix this? here log: failed load resource: server responded status of 404 (not found) main.js:61 uncaught typeerror: undefined not function main.js:60 have included google maps api multiple times on page. may cause unexpected errors.main.js:60 yl 33209.html:9 uncaught referenceerror: j not defined vm603:10 uncaught typeerror: cannot set property 'geometry' of undefined 33209.html:1 uncaught referenceerror: j not defined 33209.html:9 uncaught referenceerror: j not defined 33209.html:3 uncaught referenceerror: j not defined 33209.html:6 uncaught referenceerror: j not defined http://sitesdemo.mghospedagem.com/ivam-e

android - AR complex CAD model tracking -

i need 3d-cad model tracking. i have develop android application tracks predefined cad models parts of car, e.g. stand in front of car engine hood opened , application should tell have (perhabs refill fluid) visual support arrows or cicles. following youtube video describes intention https://www.youtube.com/watch?v=4le_iocfnl0 i have tried metaio sdk when try transform cad models metaiocreator edge , surface models cannot recognize part of model. think because models detailed (~400.000 polygons each). in addition test purpose reduced polygons lower count (~7.000 polygons), when create edge , surface model load models in test application test device (samsung galaxy tab s) laggs extremly , not possible track model. so ask if right way because don't think so.. perhaps give me advice tracking method should use of. so far used metaiosdk hybrid 3d tracking witch mix edgebased , featurebased trackingmethod. there annother method witch better reach goal? i've read opencv (w

Why wont java let me have this else if statement? -

i dont seem understand why java not allow me have else if statement in solve method under while loop, tells me syntax error. thought condition after else if statement correct syntax not working me. //class solve simple n queens problem backtracking, without using recursion in 1-d array. public class nqueens { private int n; private int board[]; public nqueens(int n) { this.n = n; this.board = new int[n]; for(int = 0; i<n; i++) { this.board[i]=-1; } } //checks place attack queens in same column, or diagnol public boolean safeplace(int row, int col, int [] board) { (int = 0; i<row; i++) { if((board[i] == col)|| (i-row)==(board[i]-col)|| (i-row)==(col-board[i])) return false; } return true; } //solves n queens problem using backtrac