Posts

Showing posts from July, 2013

java - JUNG - one edge never get's picked -

i using edge picking event see edge clicked. observed, see 1 edge never gets picked though edge being displayed. 1 click edge, display edge picked. in code below, 1 edge never picked after have tried clicking of them (its either 1 of them 3 edges). why so, or 1 experiencing ? also, edge seems appear correctly if rotate graph 180 degrees. package test; import edu.uci.ics.jung.algorithms.layout.circlelayout; import edu.uci.ics.jung.algorithms.layout.layout; import edu.uci.ics.jung.graph.directedsparsegraph; import edu.uci.ics.jung.graph.directedsparsemultigraph; import edu.uci.ics.jung.graph.graph; import edu.uci.ics.jung.visualization.visualizationviewer; import edu.uci.ics.jung.visualization.control.crossoverscalingcontrol; import edu.uci.ics.jung.visualization.control.defaultmodalgraphmouse; import edu.uci.ics.jung.visualization.control.modalgraphmouse; import edu.uci.ics.jung.visualization.control.scalingcontrol; import edu.uci.ics.jung.visualization.decorators.edgeshape; im...

java - Choose direction to start flood fill algorithm for loop detection -

i've implemented flood fill algorithm matrices in program, , i'd choose in direction starts. want detect loops created elements on grid: when there element @ given place on grid, 1 displayed in matrix. when there isn't anything, it's 0. , when elements won't moved, it's 2. flood fill algorithm starts on 1 , turns every 1 encounters 2. example: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 1 1 1 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 would become: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 0 0 0 0 0 2 0 0 0 2 0 0 0 0 0 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 here code: import tuio.*; import java.util.arrays; import java.util.scanner; tuioprocessing tuioclient; // create matrix static int[][] matrix = new int[10][10]; // these helper va...

jquery - Select all field values of an observable array in a comma separated string -

i've got observablearray this: self.displaymessagecollection = ko.observablearray(); i'm getting collection , pushing items displaymessagecollection this: self.displaymessagecollection.push({ messageid: msgid, loader: 'block', uploadopacity: 'uploadopacity', sentstatus: 'wait', chattype: self.tochattype() }); i need messageid field values comma seperated string array. i know can loop items , messageid values. want know if can query on observablearray , i.e. somehow single query field values comma seperated string? you can use built in map function on underlying array , , can use join function comma separated string: self.displaymessagecollection().map(function(i) { return i.messageid }).join(",") if need logic multiple times can create helper ...

Javascript OOP - Function within return function -

trying create function call called if other function has been called within same line. var processtrack = new function() { this.current = 1; this.max = 5800; this.min = 0; this.done = function(started, processing, cur, len) { cur = cur || 0; len = len || 1; var res = 0; if (started && !processing) res = ((this.current - 1 - this.min) / (this.max - this.min)).tofixed(2); else if (!started && processing) res = (this.done(true, false) + (this.step() * this.cur / this.len)).tofixed(2); else if (!started && !processing) res = ((++this.current - 1 - this.min) / (this.max - this.min)).tofixed(2); this.percentage = function() { return res * 100 + "%"; }; return res; }; this.step = function() { return 1 / (this.max - this.min); }; } what ideally want call processtrack.done(args).percentage() percen...

javascript - Before filter for all post requests in node.js -

i have below code in node.js app.js: var express = require('express') ,cors = require('cors') ,app=express(); var users = require('./routes/users'); //some other codes ..... app.use('/', routes); app.use('/users', users ); if request made /users/adduser , go users.js in routes folder. now want add filter capture post requests , validations , if conditions satisfied post should go handler. i.e if /users/adduser post request, before going method in users.js in routes folder, should able capture request , stop if condition not met. update 1 having app.use function, in result getting undefined not waiting till function returning value app.use(function (req, res, next) { req.db = db; if (req.method != "post") { next(); } else { var userdata = req.body; var result = check(userdata); if(result){ next(); } } }); functi...

python - Setting Cookie using pycurl, getting TypeError('invalid arguments to setopt',) -

i new python trying send session_id cookie using pycurl lib in python. below code line. reportcurl.setopt(pycurl.cookie, session_id) where "session_id" string. not sure doing wrong working on python version 2.7.2 unable make run on python 2.7.3. any idea invalid argument in setopt fuction? appeciate help. data application passes pycurl, such via setopt calls, must byte strings appropriately encoded. make sure session_id in correct format. http://pycurl.sourceforge.net/doc/unicode.html

r - Fill missing date values in column by adding delivery interval to another date column -

data: db1 <- data.frame(orderitemid = 1:10, orderdate = c("2013-01-21","2013-03-31","2013-04-12","2013-06-01","2014-01-01", "2014-02-19","2014-02-27","2014-10-02","2014-10-31","2014-11-21"), deliverydate = c("2013-01-23", "2013-03-01", "na", "2013-06-04", "2014-01-03", "na", "2014-02-28", "2014-10-04", "2014-11-01", "2014-11-23")) expected outcome: db1 <- data.frame(orderitemid = 1:10, orderdate= c("2013-01-21","2013-03-31","2013-04-12","2013-06-01","2014-01-01", "2014-02-19","2014-02-27","2014-10-02","2014-10-31","2014-11-21"), deliverydate = c("2013-01-23", "2013-03-01", "2013-04-14", "2013-06-04", "2014-01-03...

php - how to get rows that repeated X times or more? -

i have table contains data. have 'username' field in table stores users username. in table there possible user have many records. now, how can users username repeated more x times? (50 time or more example?) , after want delete rows each user in previous step need keep first x rows , need delete rows after row x each user. how can mysql , php? update: solve problem this: select username, count(*) numrecords table group username this take number of steps achive.. start building query count number of records each user select username, count(*) numrecords table group username then add: having numrecords > 5 to narrow down usernames more 5 records.. loop through records query above.. foreach($results $result){ // query db using `username` 'record keep' "select * table username = $result['username'] order someuniqueid limit 1" __execute query__ __store record id keep__ // delet...

sql - Dynamic Column Name In Cursor PLSQL -

i've been working on query in pl/sql. i've same named columns column1, column2, column3 . in cursor, how can value of these columns using dynamically name. example: for cursor_r in cursor_c loop begin if cursor_r.column1 = 'dummy1' myproc(cursor_r.column1); elsif cursor_r.column1 = 'dummy2' myproc(cursor_r.column2); elsif cursor_r.column1 = 'dummy3' myproc(cursor_r.column3); end if; end; end loop; thanks. you can use dynamical sql column names. see this

python - Google text to speech -

when trying access url http://translate.google.com/translate_tts?tl=en&q=hello it showing captcha page , saying "this page appears when google automatically detects requests coming computer network appear in violation of google policies." can tell me solution of problem. as said, it's violation of google policies.

c# - I want to shuffle 5 cards in an array -

i have 5 cards in gabeobject[] cards. want shuffle , save these cards gameobject[] cardshuffle. wrong code. shuffles same cards. how can make not shuffle same cards again? thank you. using unityengine; using system.collections; public class main : monobehaviour { public gameobject[] cards; public gameobject[] cardshuffle; int i=0; int j = 0; int save=0; int[] kayit = new int[10]; int kayit2; public gameobject[] player1; public gameobject[] player2; public gameobject[] player3; // use initialization void start () { kayit[0] = 20; while(i<5) { save = random.range(0, 5); (int = 0; < 5; a++ ) { if(kayit[a] == save) { kayit2 = save; } } if (kayit2 != save) { cardshuffle[i] = cards[save]; } else i--; kayit[i] = save; i++; } while (cards[j] != null) { player1[j] = cards[j]; ...

java - Spring MVC does not save to database from html form -

hello have build simple form should save data database when submit form data not saved. how resolve ? form in jsp <form method="post"> product name:<br> <input type="text" id="productname" name="product name"> <br> last name:<br> <input type="text" id="productserial" name="serial number"> <input type="submit" value="submit"> </form> controller @requestmapping(value = "/savenewcontact", method = requestmethod.post) public modelandview savecontact(@requestparam("productname") string productname,@requestparam("productserial") int productserial) { product product = new product(); product.setname(productname); product.setserial(productserial); productdao.savenewproduct(product); return new modelandview("redirect:/"); } dao imple...

javascript - How to determine if user is beginning new word in JS? -

how you, js or jquery, determine if user typing new word? what want do: i writing documentation tool autocompletion different types. if type f.e. @ populate java classes in box, # populate test classes, etc. don't want populate these values, if user writing email yourname@domain.com . need values populate when it's beginning of word. i aware of keydown, keyup events, etc. don't know how check kind of event properly. one way save every typed letter in variable , check if previous "letter" space , if was, know it's new word. best/most efficient way this? one way check what's before @ in input box, using selectionstart : onload = function() { var io = document.getelementbyid("io"); io.onkeypress = function(e) { if(e.charcode == 64 && ( io.selectionstart == 0 || io.value[io.selectionstart-1].match(/\s/))) document.getelementbyid("ac").innerhtml = "auto...

Can I have a program with 2 sockets in Java? -

this simple chat program in java. know can work done 1 socket wondering why not use 2 sockets? this executes not work intended. kindly see code , find error. please me new this. server code below. server.java import java.io.*; import java.net.*; public class server { public static void main(string[] args)throws ioexception { serversocket ss=new serversocket(10001); socket s=ss.accept(); socket s1=new socket("localhost",10005); datainputstream di=new datainputstream(s.getinputstream()); dataoutputstream dot=new dataoutputstream(s.getoutputstream()); bufferedreader br=new bufferedreader(new inputstreamreader(system.in)); string str1="",str=""; while(str1!="exit"){ str=(string)di.readutf(); system.out.println("message="+str); system.out.println("enter message:"); str1=br.readline();...

string - R: producing a list of near matches with stringdist and stringdistmatrix -

i discovered excellent package "stringdist" , want use compute string distances. in particular have set of words, , want print out near-matches, "near match" through algorithm levenshtein distance. i have extremely slow working code in shell script, , able load in stringdist , produce matrix metrics. want boil down matrix smaller matrix has near matches, e.g. metric non-zero less threshold. kp <- c('leaflet','leafletr','lego','levenshtein-distance','logo') kpm <- stringdistmatrix(kp,usenames="strings",method="lv") > kpm leaflet leafletr lego levenshtein-distance leafletr 1 lego 5 6 levenshtein-distance 16 16 18 logo 6 7 1 19 m = as.matrix(kpm) close = apply(m, 1, function(x) x>...

openssl - Does this image means SSLv3 is enabled? -

Image
i see there tlsv1/sslv3, protocol used tlsv1.2. any advice warming welcome. this particular test doesn't show sslv3. new, <ver> cipher is line version of openssl's internal cipher description, same sslv3 , versions of tls (to date), , different sslv2 (which nobody should using today, openssl still has code support unless build option specified). correctly identified, value in protocol: protocol version negotiated. but doesn't prove sslv3 disabled. server can support multiple protocol versions , choose 1 each connection, preferably , highest available, , servers do. openssl s_client default offers up to tlsv1.2, , server capable of tlsv1.2 agree that, server in case did. if client offers lower version server can either agree or reject it. poodle , similar attacks work tricking client offering sslv3 server agrees. if want test vulnerability, try s_client -ssl3 , see whether that produces session or not.

c# - Entity Framework creates new data in database instead of using exsisting one (even when I don't tell to do that) -

i'm facing strange problem. i'm making kind of dictionary, use 3 classes: word (for every single word), translation (that stores 2 words means same in different languages) , language (that stores information language). my server code webapi project. here c# api controller , 2 functions used it: //controller: // post: api/translations [responsetype(typeof(string))] [httppost] public async task<ihttpactionresult> posttranslation(translationsviewmodel tvm) { if (!modelstate.isvalid) { return badrequest(modelstate); } if (tvm.language1id == tvm.language2id) { return badrequest("languages have different"); } translation translation = tvm.totranslation(); db.translations.add(translation); await db.savechangesasync(); return ok("translation created succesfully"); } public translation totranslation(translationsviewmodel tvm) { translation translation = new translation { wordsl...

activerecord - Rails - Active Record: Find all records which have a count on has_many association with certain attributes -

a user has many identities. class user < activerecord::base has_many :identities end class identity < activerecord::base belongs_to :user end an identity has confirmed:boolean column. i'd query users have 1 identity. identity must confirmed false. i've tried this user.joins(:identities).group("users.id").having( 'count(user_id) = 1').where(identities: { confirmed: false }) but returns users 1 identity confirmed:false but have additional identities if confirmed true. want users 1 identity confirmed:false , no additional identities have confirmed attribute true . i've tried it's slow , i'm looking right sql in 1 query. def self.new_users users = user.joins(:identities).where(identities: { confirmed: false }) users.select { |user| user.identities.count == 1 } end apologies upfront if answered not find similar post. def self.new_users joins(:identities).group("identities.user_id...

c# - How to compare element values between two Ordered Dictionaries -

i trying compare values in elements of 2 ordered dictionaries. unable find right coding @ elements @ index 0 , convert them dictionaryentrys. trying use following code: dictionaryentry card1 = (dictionaryentry)(player1.hand[0]); dictionaryentry card2 = (dictionaryentry)(player2.hand[0]); if ((int)card1.value > (int)card2.value) { // stuff } the code passes intellisense, blows invalid cast. can code var card1 = player1.hand[0]; but won't allow me retrieve card1.value. far can tell, card1 needs converted dictionaryentry, , don't know how it. any appreciated. thanks. the indexer in ordereddictionary implemented follows: public object this[int index] { { return ((dictionaryentry)objectsarray[index]).value; } set { ... } } it's returning value, not key/value pair. that's why can't cast dictionaryentry . do comparison instead, casting return value of indexer directly int : if ((int)player1.hand[0] > (int)player2.h...

git push - Github Status : Error in Pushing...!! Aborting? -

i'm trying push build in github , keep on getting "aborting" status , have tried multiple times , experience same error.not sure,how solve issue ? or advice on great. commit successful username 'https://github.com': ######## password 'https://######@github.com': error: pack-objects died of signal 9 fatal: remote end hung unexpectedly fatal: remote end hung unexpectedly fatal: write error: bad file descriptor error in pushing..!! aborting. check if having large file in repo. instance, config 1 can help: git config --global pack.windowmemory "32m" it represents maximum size of memory consumed each thread in git-pack-objects pack window memory. you have ( as mentioned before ): git config http.postbuffer 52428800 you can use tool bfg repo-cleaner rid of large file.

symfony - Symfony2 RESTApi authentication architecture -

i'm planning on building single page applications polymer , angular. as symfony2 developer searched bundle provides me json token authentication feature restapi. so found 2 bundles: https://github.com/friendsofsymfony/fosoauthserverbundle and https://github.com/lexik/lexikjwtauthenticationbundle + https://github.com/gfreeau/gfreeaugetjwtbundle my main goal here log in user(username + password) without having redirect him other page, , of course give him access protected api methods what pros , cons of each 1 ? sry english.

coldfusion - How to pass parameters to scheduled task via cfschedule? -

is there way pass parameters or share data scheduled task? understand can pass serializable arguments quartz job, seems not available in cfschedule. options achieve this? the easiest way have .cfm file called cfschedule calls cfc , passes desired methods. if want more flexible solution, have scheduler.cfc allows have method called @ frequency want , have pass arguments method call. http://www.bryantwebconsulting.com/blog/index.cfm/2009/2/26/schedulercfc-10 it can gotten here. https://github.com/sebtools/com.sebtools/ the important thing have have scheduler instantiated application scope , .cfm called cfschedule runs: if have 1 method arguments needs called frequently, scheduler.cfc overkill on simple solution, if general problem need solve more frequently, can pay off nicely.

javascript - How do I log anything to the console from meteor shell? -

this github issue documents console doesn't output meteor shell. there workarounds? default console.log() statements output in app's stdout (not in shell). let's want print items collection: meteor.users.find().foreach(function (user) { if (...) console.log(user.emails[0].address; }); that won't print anything. here's i've tried: process.stdout.write() - doesn't print anything create string buffer, append want log it, , evaluate it. var output = ''; meteor.users.find().foreach(function (user) { if (...) output += user.emails[0].address + "\n" }); output; this works \n echoed literally, not line feed. evaluate expression in function. predictably, doesn't print anything. one workaround i've used run app in background, run shell in same window. i.e. meteor run & meteor shell that way, gets output in app's console gets printed window. admittedly, won't if want log specifi...

nopcommerce - How to extend existing pages, such as Customer or Shopping Cart, through plugins? -

i've read everywhere it's better write new plugin touch core code. problem i've not been able find documentation it's explain how modify pages plugin. the way understood it, display partial pages plugin, 1 needs tells display them return using method: public ilist<string> getwidgetzones() but if return more 1 zone, widget displayed in multiple zones. if want display bit of information on different zones? to start off, i'd extend the customer page. menu on page has 7 items: customer info, addresses, orders, downloadable products, in stock subscriptions, reward points, , change password. i'd add 2 more items: personal info , connections. when personal info clicked, customer able add info, such his/her photo. when connections clicked, user able see other have been doing. can point me documentation explain how 1 can extend existing pages, such customer , shopping cart, without touching core code. thanks helping i have read people s...

android - How to remove date from DatePicker toString method? -

i have started learning android through android's big nerd ranch guide. have written simple program in android let's user select date. while printing date using getdate().tostring() method, getting time. want remove time column. far, have tried passing datepicker, date, month, or year through intent, not working. code datepicker looks like: public dialog oncreatedialog(bundle savedinstancestate) { // super.oncreate(savedinstancestate); date=(date) getarguments().getserializable(extra_tag); calendar calendar=calendar.getinstance(); calendar.settime(date); int year=calendar.get(calendar.year); int month=calendar.get(calendar.month); int day=calendar.get(calendar.day_of_month); view view=getactivity().getlayoutinflater().inflate(r.layout.date_picker, null); datepicker datepicker= (datepicker) view.findviewbyid(r.id.date_button); datepicker.init(year, month, day, new datepicker.ondatechangedl...

php - Import Magento Orders into Openerp -

we in process of integrating magento 1.9.0.1 openerp 7.0 , using below extensions , addons, magento side - openlabs openerpconnector openerp side - magento integration addon openlabs i have done integration of magento openerp creating api user , role , can able import websites, store view , products openerp . cant able import sale orders magento openerp. the error message is, fault: <fault 101: 'product not exists.'> i have spent 3 days fix issue. no luck . suggestions welcome ! thanks in advance ! hi muthukumar sivasamy, their multiple solution proposed problem, check here patch , explanation. bests

.net - Selenium C# :: Which file type can be used for object repository for better performance? -

i creating automation framework using selenium c#, working on object repository part. know types of files can use object repository.currently thinking of using either xml or excel not sure 1 better performance wise, can of share views on , let me know if there other options. i planning use xmldocument reading xml , oledb connection reading excel. by object repository think mean different elements, locators , other required attributes, because far know selenium not have concept of object repository inherently. if so, need think going maintain repository, few thousand locators, rather performance maintainability major issue. also, think making isolated implementing interface, in future if decide change implementation because of issue, not impact framework. and xml, excel, text file(with delimiter), database, json file contenders this.

android - How to push up view when custom keyboard is open from bottom -

i created custom keyboard in application using keyboard tag. adding keyboard in relativelayout on screen like. keyboard customkeyboard = new keyboard(getactivity(), r.layout.keyboard); customkeyboard mcustomkeyboard = new customkeyboard(getactivity(), this); mcustomkeyboard.setkeyboard(customkeyboard); relativelayout rellaykeyboard.addview(mcustomkeyboard); initially set android:visibility="invisible" rellaykeyboard , once touch on edittext setting visibility view.visible . this keyboard working fine if there more edittext on screen coming on top of edittext . want push view once customkeyboard open on screen.

jquery - I'm trying to align my text values next to my slider bar but having issues -

i've been working on problem few hours now. (i'm terrible when comes css) i have these 2 jquery sliders values. i'm trying align "rooms: 0" , "bathrooms: 0" right next corresponding slider bar. .pricebox { width: 400px; margin:0px; height:50px; color: #ffffff; font-size: 20px; font-weight: 700; } .custom-slider { margin-bottom:10px; width: 70%; float: right; } .values { width: 30%; text-align: left; float: left; } #cleared{ clear: both; } <div class="pricebox"> <div id="slider-1" class="custom-slider"></div> <span>rooms: <div id="slider-1-value" class="values">0</div></span> <br /> <div id="slider-2" class="custom-slider"></div> <span>bathrooms: <div id="slider-2-value" class="values">0</div></span> </di...

Pixel filter HTML elements CSS -

i'm creating game using webgl. i'm working on menu design, , occured me 1 of great advantages have in using web technologies can use html gui. the game uses pixel art, in keeping art style want menu have pixelated buttons , text well. i'm wondering if using css filters or similar i'm able pixelate rendering of dom elements, or if i'll need create full button images beforehand (much less appealing). thanks!

android - How to opt-out an app from Doze mode? -

how opt-out app android m doze mode ? there standard way include , exclude apps doze , auto standby selectively @ run time ? how opt-out app android m doze mode ? you can't known mechanism. is there standard way include , exclude apps doze , auto standby selectively @ run time ? in theory, user can toggle "ignore optimizations" option in settings, put app on whitelist of apps should not go app standby mode. not affect doze mode. quoting somebody believe dianne hackborn : while device dozing, syncs , jobs turned off globally, putting app on whitelist not change behavior them. intended behavior, lack of free use of alarm manager. (one of key aspects of of these ways cause device wake up, , causes wake have significant impact on battery life in durations want last while dozing, not allowed.) while dozing, andallowwhileidle apis allow wake device @ once every 15 minutes; when not dozing raise once every minute. when device in idle ma...

list - R removing long duplicates from a vector -

suppose have a vector looks this, \n indicates new line: m # [1] aa\nbb\ncc\ndd # [2] aa\nbb\nee\ndd # [3] aa\nbb\nee\ndd # [4] aa\nbb\ncc\ndd # [5] aa\nbb\nff\ndd i want remove duplicates left with m # [1] aa\nbb\nff\ndd any suggestions? much the real data trying manipulate messy: head(m) [1] "ft motif 619..622\nft /note=gatc\nft /color=48 249 173\nft motif complement(619..622)\nft /note=gatc\nft /color=48 249 173\nft motif 8662..8667\nft /note=ctgcag\nft /color=90 236 150\nft motif complement(8662..8667)\nft /note=ctgcag\nft /color=90 236 150\nft motif 205..210\nft /note=accacc\nft /color=197 13 106\nft motif complement(205..210)\nft /note=accacc\nft /color=197 13 106\nft motif ...

php - How to convert an array into a key,value,... array? -

i have array: array ( [0] => item [1] => repaired wattles [2] => types [3] => non-wire [4] => estimated qty [5] => 124 [6] => actual qty [7] => 124 [8] => upload file [9] => example.jpg ) i need add next value previous. need this array ( [item] => repaired wattles [types] => non-wire [estimated qty] => 124 [actual qty] => 124 [upload file] => example.jpg ) i have along lines of this: $array = array( foreach($stri $string) { $stri[] => $stri[$val] $val = $string + 1; ); i know wrong. right here i'm stuck , don't know how code working want to. write simple for loop , increment counter 2 in each loop: $result = array(); ($i = 0; $i < count($arr); $i += 2) { // increment counter +2 if (isset($arr[$i]) && isset($arr[$i+1])) { // make sure if both indexes exists in array $result[$arr[$i]] = $arr[$i+1]; } } ...

javascript - How to make a popup screen when we click on certain text -

i working on dealership website.i new jquery , html. problem have webpage http://prospectingdesk.com/demo/index.html in page can quote moves , down if click on popup window. and if go newvehicle page in page there many car list my requirement if click on vin number appears in each car list navigate next page.but before need popup window same appeared in homepage. the problem manager told not touch body of code. new code creating popup added in header part seems. that quote code must dynamic . if copy code paste in other website quote must work please me out how friends. can more clarify this. per understanding need element through id or class , attach click event , write want. let's assume quote button have id 'quotebtn' code this. var quotebtn = document.getelementbyid('quotebtn'); quotebtn.addeventlistener('click', function() { /*code pop open goes here*/ }, true);

c# - facebook Email field is missing on AuhtenticationManager.GetExternalInfoAsync -

did of encountered issues on facebook api v2.4 whenever called authenticationmanager.getexternalinfoasync, info returns id , name. did not happened on of our apps on api v2.3. updated facebook package on nuget still no luck i tried checking returned facebook through fiddler (graph.facebook.com/me), can see 2 fields on returned json. i appreciate help. in advance! have @ answer @ facebook returning name , id of user you have specify each field graph api v2.4.

mb convert encoding - Prestashop website error. Website showing fatal error mb_convert_encoding -

i have prestashop website http://www.mumsnbabysupermart.com.au/ . website functional website stop working , shows fatal error. error is- fatal error : call undefined function mb_convert_encoding() in home/xxx/xxx/public_html/cache/smarty/comile/94/23/30/942330f3aff64545a59bff57a8a2078fb44cd308.file.heeader.tpl.php on line 78. i did googling found nothing. in website integrated australia post, eway , paypal. do have mb_string enabled on server? if not, you'll need contact service provider , ask enable it. think debug mode, too: http://doc.prestashop.com/display/ps16/performance+parameters may disable non prestashop modules , overrides. if still receive error, use "force compilation" in smarty , disable cache. did update prestashop recently?

object oriented analysis - In c++, declaring class variable as private is always good? -

in java, usually, recommended declare class variable private . wonder c++ is, java. if is, problem though (as think), class should have get() , set() functions , think quite bothering. if programming habits, gonna follow it. please share opinion. the thing talking called encapsulation. now, term, should able find proper definitions should able find reasons use. once gained understanding of reasons encapsulation, able weigh costs , benefits solving task have , decide whether use or not. btw, these principles independent of programming language use, although may take different forms in different languages.

In matlab, how to increase the dimension of a matrix? -

i have matrix a=(1 2; 3 4) , , want augment a b = (1 2 0; 3 4 0; 0 0 0) , can ? one way is: b = [[a, zeros(2,1)]; zeros(1,3)] but might clumsy in dynamic process, other ideas ? b=a b(3,3)=0 matlab fills other elements automatically zeros

c++ - How can I configure cmake to compile a file twice with two different compilers? -

i'm adding sycl/opencl kernel parallel c++ program built cmake. using sycl means need cmake compile c++ source file twice: once sycl compiler, , once project's default compiler, gcc. both compilations produce outputs need included when linking. i'm new cmake. i've added gcc compile , link steps project's cmakelists.txt, what's best way add sycl compile step? i'm trying "add_custom_command" option "pre_build", command run doesn't seem know paths provided normal compile , link steps: current working directory, include directories, source directories, etc. i'm having specify of these manually, , i'm having figure of them out first. it feels i'm doing hard way. there recommended (or @ least better) way cmake compile file twice 2 different compilers? also, there used sycl tag, it's disappeared. can recreate it, please? be aware pre_build works pre_build in visual studio 7, for other targets pre_li...

python - Text classification of websites -Appropriate classification algorithm - Labelled-LDA is best? -

basically, i'm extracting text data crawling business web pages , trying classify website type of business >>> restaurants, it, travel etc. i've looked naive bayes classifcation , lda algorithms and think labelled-lda way this, might wrong is there better option suited type of application? and please specify, if possible, opensource library best above i don't know lda, these 3 known classifiers: naive bayes classifier (as said) maximum entropy support vector machine the used library scikit-learn . there tutorial naive bayes classifiers scikit-learn here .

apache spark - How to partition data by multiple fields? -

lets have record 4 identifier variables: var1 , var2 , var3 , var4 , additional variable: var5 . i want perform reduce operation on records have same value in either 1 of identifier fields. i'm trying think how can implement kind of solution minimal amount of shuffling. is there option tell spark put records have @ least 1 match in identifier variables on same partition? know there option of custom partitioner i'm not sure if possible implement in way support use case. well, quite lot depends on structure of data in general , how priori knowledge have. in worst case scenario, when data relatively dense , uniformly distributed below , perform one-off analysis, way achieve goal seems to put 1 partition. [1 0 1 0] [0 1 0 1] [1 0 0 1] obviously not useful approach. 1 thing can try instead analyze @ least subset of data insight structure , try use knowledge build custom partitioner assures relatively low traffic , reasonable distribution on cluster @ same ti...

android - Realm database, add a arraylist of objects as a column for a class -

i worked migration far, using example realm. , adding simple column like: table persontable = realm.gettable(trip.class); long vehicleindex = persontable.addcolumn(columntype.string, "vehicle"); but need add arraylist 1 object: private arraylist<stopinfo> filteredlocations = new arraylist<>(); how can rezolve migration? first, in realm, if want have list field, realmlist thing use. see doc . second, add realmlist in migration: assume have realmlist<stopinfo> defined in model class private realmlist<stopinfo> stopinfolist; to add in migration: // in migration // create realmlist field long listindex = table.addcolumnlink(columntype.link_list, "stopinfolist", transaction.gettable("class_stopinfo"));

php - how to relate images to article id -

i creating website using php , mysql in want save part of images' name article id. eg: image_[$articleid]_1.jpg currently taking article id "querying last id article table , adding 1 it". i want know whether right way it, because giving article id images before inserting actual article database. in worst case scenario wondering happen if 10 users inserting article @ same time. does of know proper logic accomplish or doing right thing? yes, run trouble in situation. there 2 solutions this: use auto-increment column; insert new article database before creating image filename, , update new record afterwards. create lock on images table before start insert records, , release once you're done updating database. option 1 preferred option; allows concurrent use (nobody has wait before other users finished), , relieves of task of determining last id.

php - How to exclude some files and extensions from indexing? -

i have code indexing directories , files on site, need exclude files ( hidden_file.txt or hidden_folder ) , extensions ( .php example). how can that? this code, has hide variable, don't know how change purpose: <?php // checks see if veiwing hidden files enabled if($_server['query_string']=="hidden") {$hide="";} else {$hide=".";} // opens directory $mydirectory=opendir("."); // gets each entry while($entryname=readdir($mydirectory)) { $dirarray[]=$entryname; } // closes directory closedir($mydirectory); // counts elements in array $indexcount=count($dirarray); // sorts files sort($dirarray); // loops through array of files for($index=0; $index < $indexcount; $index++) { // decides if hidden files should displayed, based on query above. if(substr("$dirarray[$index]", 0, 1)!=$hide) { // gets file names $name=$dirarray[$index]; $namehref=$dirarray[$index]; $path =$_server['request_...

android - Cant post to CloudMQTT -

im not sure if right place post support email no longer working. when try create topic on websocket ui , click send, nothing comes under topic/message. have tried refreshing, different browsers, delete history. cloudmqtt but app can subscribe topic , publish message, , again not show in websocket ui. why be? sorry again if not right place post. thanks solution: it because behind firewall

javascript - How to add scrollbar inside container in accordion? -

i using accordion. here, accordion functionality working. want insert vertical, , horizontal scrollbar in body content. how add scroll bar inside of panel-body content. have included fiddle , code. fiddle html, body { background-color:#e9eaed; } .content { width:960px; height:0px; margin-right: auto; margin-left: auto; } .panel-group { width:430px; z-index: 100; -webkit-backface-visibility: hidden; -webkit-transform: translatex(-100%) rotate(-90deg); -webkit-transform-origin: right top; -moz-transform: translatex(-100%) rotate(-90deg); -moz-transform-origin: right top; -o-transform: translatex(-100%) rotate(-90deg); -o-transform-origin: right top; transform: translatex(-100%) rotate(-90deg); transform-origin: right top; } .panel-heading { width: 430px; } .panel-title { height:18px } .panel-title { float:right; text-decoration:none; padding: 10px 430px; ma...

javascript - How can i use requestAnimationFrame instead of translate3d? -

due behaviour of browser translate3d renders vector elements textures need use simple 2d translate, means performance harmed. tried find solution , requestanimationframe came up, can't figure out how use in case: $document.bind(events['move'], function(e) { $('.slide-panel.shown').find('.close-panel').trigger('click'); var valuex = gettransform($elem,'posx'), valuey = gettransform($elem,'posy'), zoom = gettransform($elem,'zoom'), translatex, translatey; if (is_touch_device()) { translatex = valuex + (e.originalevent.touches[0].pagex - mouse.x); translatey = valuey + (e.originalevent.touches[0].pagey - mouse.y); } else { translatex = valuex + (e.pagex - mouse.x); ...

android - How can I prevent OS to kill my MUSIC app (use MediaPlayer, service)? -

i using service in music application , needs run until application detroyed, problem gets killed os(my phone run android 4.2.2, , have 128mb of ram).so os alway kill app service when pess home button or button. i have searched on stackoverflow , tryed solution: @override public int onstartcommand(intent intent, int flags, int startid) { notify("service startcommanded"); myplayer.start(); return start_sticky; } but music restart begin position, done want happen ps: i'm vietnamese,so don't english.soory this,but don't have solution vietnam forums. alot granted service gets new intent every song tries play try use redeliver intent flag. http://developer.android.com/reference/android/app/service.html#start_flag_redelivery keep in mind won't make service restart in same start sticky, there maximum number of times tries restart it. in ondestroy find out in music play back, store value , seek position when start playback again. ...