Posts

Showing posts from February, 2011

javascript - D3, remove the .enter created div "bubble.selectAll("circle").remove();" -

javascript - D3, remove the .enter created div "bubble.selectAll("circle").remove();" - i new d3js, , learning own, what planing is, create circle , erase after creation, , after 800 ms, create 1 time again wise goes. i need know, doing wrong here. <html> <head> <script src="http://d3js.org/d3.v3.min.js"></script> <meta charset=utf-8 /> <title>js bin</title> </head> <body> <script> var bubble = d3.select("body") .append("svg") .attr("width", '400px') .attr('height', '400px') .selectall(".circle"); //animat(); function animat(){ bubble.data([1,2,3,4,5]) .enter() .append("circle") .attr("cx", function(d,i) { homecoming d*10*(i+1); }) .attr("cy", function(d,i) {

java - Added Gson to the pom.xml but is not found -

java - Added Gson to the pom.xml but is not found - i have added gson pom.xml. here it. when phone call gson gson = new gson() , seek search in maven repository doesn't found element. why? wrong? <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <parent> <artifactid>volaconnoi_webapp</artifactid> <groupid>it.volaconnoi</groupid> <version>1.0-snapshot</version> </parent> <groupid>it.volaconnoi</groupid> <artifactid>volaconnoi_webapp-ear</artifactid> <version>1.0-snapshot</version> <packaging>ear</packaging> <name>volaconnoi_webapp-

Matlab Arduino Using analog inputs as outputs -

Matlab Arduino Using analog inputs as outputs - i need utilize arduino analog inputs digital outputs a0 a1 a2 a3 a4 a5. digitalwrite(a0, 0) doing job when utilize arduino programme in matlab couldnt find way this.i tried if a0 taken 14 digitalwrite(14, 0) , didnt work. know how pin mapping thing in matlab? briefly equal of digitalwrite(a0, 0) in matlab? function test_openingfcn(hobject, eventdata, handles, varargin) % take default command line output test handles.output = hobject; % update handles construction guidata(hobject, handles); global a; set(handles.pushbutton1, 'userdata', 0); a=arduino('com3'); a.pinmode(2,'output'); a.pinmode(3,'output'); a.pinmode(4,'output'); a.pinmode(5,'output'); a.pinmode(6,'output'); a.pinmode(7,'output'); a.pinmode(8,'output'); a.pinmode(9,'output'); a.pinmode(10,'output'); a.pinmode(11,'output'); a.pinmode(12,'output'); a.pinmode

Using emacs in batch mode to dump a file with syntax highlighting? -

Using emacs in batch mode to dump a file with syntax highlighting? - i'd utilize emacs in kind of batch mode render file syntax highlighting , exit. specifically, want dump fontified buffer ansi escape codes shows reasonably syntax-highlighted on terminal. there way this? the ansi-lpr.el library seems kind of along lines of want, output isn't colorified. can't figure out how on final hurdle — there lot of modules digest ansi escape codes emacs text properties (e.g. ansi-color.el) haven't found reverse. if can point me does, think can piece rest. alternatively, i've seen hacky approaches this answer (using script , capturing output) in experiments approach has seemed unlikely fruitful — tons of undesirable command sequences mixed in highlighted text. the overarching motivation here utilize emacs in $lessopen pipe syntax highlighting when page files. in case you're going it, i've tried , "just page files in emacs" not acceptable me.

Dynamically insert new row using javascript, but how to save these multiple row in php/mysql -

Dynamically insert new row using javascript, but how to save these multiple row in php/mysql - i have create multiple row using javascript. how save these row in mysql. using type of code, not working. here code [http://jsfiddle.net/bb2pj/] , php code adding these value. ` include "config.php"; if(isset($_post['submit'])) { foreach ($_post['code1'] $key => $value) { $code1 = $_post["code1"][$key]; $product1 = $_post["product_name1"][$key]; $qty = $_post["quantity1"][$key]; $rate = $_post["amount_name1"][$key]; $total = $_post["total_name1"][$key]; $sql = mysql_query("insert testing(code,product,qty,rate,total)values('$code1','$product1','$qty1','$rate1','$total1')")or die(mysql_error()); } } ?>` from js fiddle code, trying post array of values each field

caching - How to Java cache in-Memory by group/tag data? -

caching - How to Java cache in-Memory by group/tag data? - i read java cache in-memory, , see solutions [ key => value ]. it's not plenty when need manipulate more pieces data. example: { key: "book1", //1 book id value: { id: 1, name: "book's name", author: "book's author", } }, { key: "book2", value: { id: 2, name: "book's name", author: "book's author", } }, { key: "book3", value: { id: 3, name: "book's name", author: "book's author", } } how of theme without know id build key : "book"+id. there way tag item, , can tag name. { key: "book3", tag: "recentbook" value: { id: 3, name: "book's name", author: "book's author", } } i expect offer soluti

c++ - structure overloading with dimension -

c++ - structure overloading with dimension - struct range { size_t ndim; size_t stworksize[3]; size_t stoffest[3]; inline range ( size_t work_size ) { ndim = 1; stworksize [0] = work_size; stworksize [1] = stworksize [2] = 0; stoffest [0] = stoffest [1] = stoffest [2] = 0; } inline range ( size_t work_size[2] ) { ndim = 2; stworksize [0] = work_size[0]; stworksize [1] = work_size[1]; stworksize [2] = 0; stoffest [0] = stoffest [1] = stoffest [2] = 0; } inline range ( size_t work_size[3] ) { ndim = 3; stworksize [0] = work_size[0]; stworksize [1] = work_size[1]; stworksize [2] = work_size[2]; stoffest [0] = stoffest [1] = stoffest [2] = 0; } } ; i hava construction defines above suggest me how overload dimension of constructor compiler gives me error range::range(size_t *) cannot overloader there method this

c# - MetadataType doesn't recognize IgnoreDataMemberAttribute -

c# - MetadataType doesn't recognize IgnoreDataMemberAttribute - i have entity auto generated entity framework database public partial class demand : entity { public string description { get; set; } public virtual icollection<demandusercomment> demandusercomments { get; set; } } then added metadatatype add together datacontract , datamemeber attributes entity (independent of db changes). [datacontract(isreference=true)] internal class demandmetadata { [ignoredatamember] public virtual icollection<demandusercomment> demandusercomments { get; set; } } [metadatatype(typeof (demandmetadata))] public partial class demand { } but [ignoredatamember] doesn't apply demand how can handle it? use [notmapped] attribute. see notmappedattribute class on msdn. c# entity-framework wcf metadata metadatatype

php - Checking sure data doesn't exist in a table in a database before inserting it -

php - Checking sure data doesn't exist in a table in a database before inserting it - i trying insert info table of 3 columns using php script. table named event contains these fields , data id(int) event(varchar) description (text) 1 lorem ipsum sit down dolor amet lorem ipsum dolor sit down amet, consectetur adipiscing elit...... but before insert trying check if info doesn't exist before insert in table. using next php script checking , inserting seems inserting info when info exists. problem , best way go this? <?php $event = "lorem ipsum sit down dolor amet"; $description = "lorem ipsum dolor sit down amet, consectetur adipiscing elit......"; if ($check = $db->prepare("select event, description event")) { $check->execute(); $check->bind_result($e, $d); $check->fetch(); $check->close(); } else

javascript - Image included in canvas does not appear on generated image -

javascript - Image included in canvas does not appear on generated image - i'm using canvas allow users "design" add together later transformed image displayed on website. in design, users can add together logo. i'm using function add together logo canvas: function canvaslogo(){ var x = 70; var y = 70; // var width = 500; // var height = 500; var imageobj = new image(); imageobj.onload = function() { var imagewidth = imageobj.width; var imageheight = imageobj.height; if (imageheight > imagewidth) { imagewidth = (imagewidth / imageheight) * 490; imageheight = 490; } else { imageheight = (imageheight / imagewidth) * 490; imagewidth = 490; } x = x + (500 - imagewidth) / 2; y = y + (500 - imageheight) / 2; roundedimage(70, 70, 500, 500, 30, 0, 0, 30); global.kanvas.ctx.clip(); global.kanvas.ctx.fillstyle = "white"; global.kanvas.ctx.fillrect(70, 70, 500, 500); glob

java - Caught ClassCastException in my mapReduce code -

java - Caught ClassCastException in my mapReduce code - here attached code, mash avro files big one. when run it, classcastexception caught, can help me out? thanks in advance! bobo public class filecompactiondriver extends configured implements tool { public static void main(string[] args) throws exception { int returncode = toolrunner.run(new filecompactiondriver(), args); /*terminate job*/ system.exit(returncode); } public int run(string[] arg) throws exception { /*setup configuration*/ configuration conf = this.getconf(); /*test if valid running command*/ if(arg.length !=2){ system.err.println("usage: filecompaction <input path> <output path>"); system.exit(2); } //creating job object configuration job job = job.getinstance(conf); job.setjobname("filecompactor"); job.setjarbyclass(filecompactionmapper.class); /*setup mapper , reducer classes*

python - Pandas optimization -

python - Pandas optimization - i wrote function process info pandas. profiling log using %prun of function posted @ bottom (only top few lines). want optimize code because need phone call function wrote more 4,000 times. , took 37.7 s run function once. it seems time consuming part nonzero of numpy.ndarray . since of operations based on pandas , wonder function in pandas rely on method heavily? my operations consisted dataframe slicing based on datetimeindex using df.ix[] , dataframe merges using pandas.merge() . i know it's hard tell without posting actual script, script long meaningful , operations advertisement hoc, can't rewrite little script post here. 16439731 function calls (16108083 primitive calls) in 37.766 seconds ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 7461 3.712 0.000 3.712 0.000 {method 'nonzero' of 'numpy.ndarray' objects} 244

mysql - SQL Insert Into multiple rows, but execute subquery only once -

mysql - SQL Insert Into multiple rows, but execute subquery only once - im trying optimize insert statement utilize subquery once, same value: heres illustration code insert table1 (id, number) values ((select other_id table2 somevalue = "test"), 12), ((select other_id table2 somevalue = "test"), 13), ..., ...; not sql-expert, doesnt approach, same subquery gets executed on every insert. is there alternative solution? also, know can select id beforehand , store in variable (pseudo-code-like): $var = mysql_query("select other_id table2 somevalue = 'test'") mysql_query("insert table1 (id, number) values ($var, 12), ($var, 13);") insert table1 (id, number) select other_id, number table2 cross bring together ( select 12 number union select 13 ) q somevalue = 'test' mysql sql subquery insert-into

python 2.7 - Scrapy first tutorial dmoz returning en error "TypeError: Can't use implementer with classes. Use one of the class-declaration functions instead." -

python 2.7 - Scrapy first tutorial dmoz returning en error "TypeError: Can't use implementer with classes. Use one of the class-declaration functions instead." - getting error when running first tutorial scrapy. scrapy : 0.22.2 lxml : 3.3.5.0 libxml2 : 2.7.8 twisted : 12.0.0 python : 2.7.2 (default, oct 11 2012, 20:14:37) - [gcc 4.2.1 compatible apple clang 4.0 (tags/apple/clang-418.0.60)] platform: darwin-12.5.0-x86_64-i386-64bit this file items.py: from scrapy.item import item, field class dmozitem(item) title=field() link=field() desc=field() my file dmoz_spider.py: scrapy.spider import basespider class dmozspider(basespider): name = "dmoz" allowed_domains= ["dmoz.org"] start_urls = [ "http://www.dmoz.org/computers/programming/languages/python/books/", "http://www.dmoz.org/computers/programming/languages/python/resources/" ] def parse(self, res

c# - how to retrieve back values from an ORed flag -

c# - how to retrieve back values from an ORed flag - assume im dealing createfilea i have public const generic_all int32 = &h10000000 public const generic_read int32 = &h80000000 public const generic_write int32 = &h40000000 public const generic_execute int32 = &h20000000 thus means if need read , write do generic_read | generic_write = 0c0000000h how api reverse or operation know flags contains ?, in words assume got value "0c0000000h" , need know accesses contains, operations should on number ? my point if have 100 flags , ored/anded them sick end complicated number, how retrieve flags used compose number ? the binary , operation can used test individual bits (aka flags). for instance bool b = (value & generic_read) != 0; evaluates true if generic_read ored value previously, regardless of other flags have been combined. if doesn't explain enough, perhaps http://en.wikipedia.org/wiki/bitwise_operation#and help.

jquery - Passing JavaScript array in View to Controller Razor -

jquery - Passing JavaScript array in View to Controller Razor - i need pass array form view action, how that? i‘ve read several blogs & q&a, no luck. below code. need “selectedvals” in “createscorelinkfile”. thanks in advance. <script> $('#btngetfile').on('click', function () { var selectedvals = ["12","233","121","34","34"]; location.href = '@url.action("createscorelinkfile", "home"'; }); </script> public filestreamresult createscorelinkfile() { edmgredataio objpdmdataioforgadireports = new edmgredataio(); string scorelinkdata = objpdmdataioforgadireports.getscorelinkreport(104488, 3582527, 2, "10-jul-2009", "01-jul-2009", 1); var bytearray = encoding.ascii.getbytes(scorelinkdata); var stream = new memorystream(bytearr

c# - How do I only encode and decode particular column in sql table and take it into stringBuilder? -

c# - How do I only encode and decode particular column in sql table and take it into stringBuilder? - i have 1 sql table mytable in table in 1 column having encoded html text want take text in decoded format , fill dataset . mytable name address text aaa ind '&amp;lt;/p&amp;gt;&amp;lt;p class=&amp;quot;msonormal&amp;quot; style=&amp;quot;margin: 0in 0in 6pt;&amp;quot;&amp;gt;&amp;lt;i&amp;gt;&amp;lt;span style=&#39;color: rgb(7, 44, 149); line-height: 115%; font-family: &amp;quot;segoe ui&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;&#39;&amp;gt;please note: computer generated.' now in c# tried fetch info mytable below stringbuilder sb = new stringbuilder(); sb.append(string.format("select * mytable")); sqldataadapter sqldataadapter = new sqldataad

java - Mute command with 2 arguments (ArrayIndexOutOfBoundsException) -

java - Mute command with 2 arguments (ArrayIndexOutOfBoundsException) - for reason having arrayindexoutofboundsexception on line 41. have been trying @ to the lowest degree hr figure out what's wrong code. trying create mute command, command should be: /mute [player] [enable/disable]. your help much apprechiated. package me.parat26.cmds; import me.parat26.admingui.messagemanager; import me.parat26.admingui.settingsmanager; import org.bukkit.bukkit; import org.bukkit.chatcolor; import org.bukkit.command.command; import org.bukkit.command.commandexecutor; import org.bukkit.command.commandsender; import org.bukkit.entity.player; public class mute implements commandexecutor { settingsmanager config = settingsmanager.getinstance(); messagemanager send = messagemanager.getinstance(); public static boolean chatdisabled = false; @suppresswarnings("deprecation") public boolean oncommand(commandsender sender, command cmd, string label, string[]

php - get_the_terms issue on foreach loop -

php - get_the_terms issue on foreach loop - i want show taxonomy name in post. utilize foreach loop not show thing me. here code. <?php global $post; $foo_home_url = site_url(); $url = "http://" . $_server['http_host'] . $_server['request_uri']; if(strpos($url, 'foo_cat')){ $foo_bc_cat = get_the_terms( $post->id , foo_post_taxonomy ); ?> <ul> <li><a href="<?php echo $foo_home_url; ?>">home</a></li> <?php foreach($foo_bc_cat $foo_tax_cat){ ?> <li><a href="<?php echo get_term_link($foo_tax_cat->slug, foo_post_taxonomy) ?>"><?php echo $foo_tax_cat->name ?></a></li> <?php } ?> </ul> <?php } ?> any idea. use code <?php global

elasticsearch - How to fetch 2 or more docs if a query matches at least once in the doc? -

elasticsearch - How to fetch 2 or more docs if a query matches at least once in the doc? - i new elasticsearch. there way write queries match , list out documnents matches available fields including mutual ones? i'll seek set example. i have scheme based on criteria give out recommendations. graph. eg: starting product, osname, architecture(machine), release, version & on. 1st match product , osname mutual search. later search if architecture x86 if true, add together doc result & if release of service pack 1 add together 1 time again result. @ end, result should contain both 3 & 4 docs both has mutual fields product , osname , 1 of query matches phrase "service pack 1" , other matces "x86" below 2 of recommendations if query satisfies criteria give doc. below doc has product & osname mutual fields. put /support/recommendation/3 { "recommendation":"suggested architecture 64 bit", "ty

sql - Converting batch output into String -

sql - Converting batch output into String - i have written simple script converts computer's date (format: mm/dd/yyyy) sql periodid (yyyymmdd). @echo off set %mydate%=%date:~10,4%%date:~4,2%%date:~7,2% however, output of %mydate% numeric (int). how can create %mydate%'s output becomes string? thanks in advance! sql batch-file scripting

java - How to determine touched time duration in android -

java - How to determine touched time duration in android - this question has reply here: android touch event determining duration 3 answers i'm beginner android. need determine touched time duration of android activity. example, when user touch , hold screen, after 5 seconds, need show toast(this scenario should done in user's touch time period. in other words not in action event). possible? tried this. public boolean ontouchevent(motionevent event) { int eventaction = event.getaction(); switch (eventaction) { case motionevent.action_down: presstime = event.getdowntime(); break; case motionevent.action_up: eventtime = event.geteventtime(); //toast.maketext(this, (eventtime - presstime)+"", 100).show(); if (presstime <= 5000) { toast t = toast.maketext(this, "5 se

csv - How to write quoted strings to files in C#? -

csv - How to write quoted strings to files in C#? - this question has reply here: writing string contains “ ” 6 answers i making new .csv file in c# using streamwriter , writing file writeline("stuff write") method. problem cannot seem write quoted strings, i.e. writeline(" "dog" ") "dog" quoted. tried using double quote method: writeline(@"""dog""") still didn't work (just wrote dog in csv file). how can write quoted strings files? i'm assuming you're opening in excel, why you're not seeing quotes - excel tries smart when open csv files, it's taking out quotes, though there in raw file. open result file in text editor, , you'll see quotes when writeline(@"""dog""") approach (or more mutual writeline("\"dog\"") ).

Distributing Swift iOS applications ad-hoc -

Distributing Swift iOS applications ad-hoc - i have 2 empty ios single view apps compiled ipa through xcode 6 beta 2. 1 objective-c, sec 1 swift. both of them have same code signing settings. when distributing advertisement hoc test flight or hockey, objective-c version installs without problem. swift 1 errors out 'unable download app moment'. i ran iphone configuration utility logs on , : jun 24 17:36:27 installd[3555] <notice>: 0x2c1000 handle_install_for_ls: install of "/var/mobile/media/downloads/-6680582027007079892/1462391056366119034" requested itunesstored jun 24 17:36:29 installd[3555] <notice>: 0x2c1000 mobileinstallationinstall_server: installing app com.myapp.stest jun 24 17:36:29 installd[3555] <error>: 0x2c1000 verify_signer_identity: misvalidatesignatureandcopyinfo failed /var/tmp/install_staging.hestzs/foo_extracted/payload/stest.app/stest: 0xe8008017 jun 24 17:36:29 installd[3555] <error>: 0x2c1000 do_preflight_

Template for canvas html5/jquery/javascript -

Template for canvas html5/jquery/javascript - i beginner @ html5, jquery/javascript. attempting create canvas (sort of windows paint application) , looking @ other users sample functions/code see whats going on , effort re-create it. $(function(){ var paint = new paint($('#surface').get(0)); // setup line template var templateline = new paint($('#toolbar #line').get(0), {'readonly': true}); templateline.shape = new line([10, 10], [50, 50]); templateline.place(templateline.shape); i unsure going on here. know new paint not internal built-in function. it? secondly whats difference between , $( document).ready(function(){ var canvas = $("#canvas").get(0); if (canvas.getcontext) { var ctx = canvas.getcontext("2d"); // take color ctx.fillstyle = "black"; ctx.strokestyle = color; ctx.fillrect(0, 0, 50, 50); } else { // browser doesn't back upwards canvas } }

How to catch an out of memory exception vb.net -

How to catch an out of memory exception vb.net - seems relatively easy question, have tried few things , not figure out how grab exception of type out of memory. here couple things have tried: try grab ex exception if ex = outofmemoryexception ' here end if end seek seek grab ex exception dim check new outofmemoryexception if ex = check ' here end if end seek i using display message when out of memory exception thrown, ideal (if possible) able grab type of exception when thrown. p.s - no cannot avoid type of exception because application , needs able run on older machines. first of all, not how handle exception of given type. instead, catch type: try … grab ex outofmemoryexception … end seek secondly, don’t handle outofmemoryexception . can’t, because ran out of memory , in situations there nil can it, except (carefully, without allocating more memory) logging error. outofmemoryexception (and stackoverflowexception )

java - spring propery initialization issue -

java - spring propery initialization issue - i have create service bean , declare variable . pseudocode : //one class @service @transactional(propagation=propagation.requires_new) public class customerservice { public map<long,boolean> somemap= new hashmap<>(); } //caller class @component @path("/maincontroller") class maincaller{ @autowired customerservice customerservice; @post @path("/process") public response processcustomer() { try{ //some processing }finally{ synchronized (customerservice.somemap) { //liee 64 //do work on map } } } i getting null pointer exception @liee dont understand this. far know spring creates bean after initializing properties. , declared somemap new variable should not null. why giving null pointer exception. error : com.sun.jersey.spi.container.containerresponse mapmappablecontainerexception severe: runtimeexception not

mysql - Another Resource ID PHP error, even though my other queries work -

mysql - Another Resource ID PHP error, even though my other queries work - despite looking @ answers given on other questions , looking , checking code errors, still not sure why i'm getting error. as mentioned in title, i'm getting "error" value returned says 'resource id $8'. the code in question is: $sql_plaats = "select * $tbl_plaats city_id ='".$city_id."'"; //plaatsen $result_plaats = mysql_query($sql_plaats); if($result_plaats === false) { die(mysql_error()); // todo: improve error handling } else { echo $result_plaats; // testing see if works. outputs: resource id #8 while ($row = mysql_fetch_array($result_plaats)) // won't work because $result_plaats = resource id #8 { echo '<div class="header_plaats">'; echo "<sup>plaats:</sup>"; echo '<a href="accomodaties.php?plaats='; echo $row{'city_id'}

java - Error creating entityManagerFactory due to error tying to scan -

java - Error creating entityManagerFactory due to error tying to scan <jar-file> - i next http://spring.io/guides/tutorials/data/3 ; not sure did wrong, maintain on getting exceptions don't understand. tried searching questions same exceptions no avail. stack trace: http://pastebin.com/wypqs6da persistenceconfig.java @configuration @enablejparepositories @enabletransactionmanagement public class persistenceconfig { @bean public datasource datasource() throws sqlexception { embeddeddatabasebuilder builder = new embeddeddatabasebuilder(); homecoming builder.settype(embeddeddatabasetype.hsql).build(); } @bean public entitymanagerfactory entitymanagerfactory() throws sqlexception { hibernatejpavendoradapter vendoradapter = new hibernatejpavendoradapter(); vendoradapter.setdatabase(database.hsql); vendoradapter.setgenerateddl(true); localcontainerentitymanagerfactorybean mill = new localcontain

c# - LINQ query for retrieving data from list -

c# - LINQ query for retrieving data from list - i have list collection of message objects. public class message { public int id { get; set; } public string body { get; set; } public string sender { get; set; } public datetime timestamp { get; set; } } i want 1 message recent timestamp each sender. how do using linq? var q = n in table grouping n n.senderinto g select g.orderbydescending(t=>t.timestamp).firstordefault(); c# linq

c# - Entity Framework: attached objects with children -

c# - Entity Framework: attached objects with children - as explained in topic if insert or update entity can utilize next approach: if (myentity.id != 0) { context.myentities.attach(myentity); context.objectstatemanager.changeobjectstate(myentity, entitystate.modified); } else { context.myentities.addobject(myentity); } context.savechanges(); the problem in case myentity has kid related objects , hence when seek update (myentity.id != 0) receive next exception: system.invalidoperationexception unhandled message=an object temporary entitykey value cannot attached object context. if remove kid objects (comment out) myentity works.. does know how solve problem? how can update myentity , save kid objects? thanks! edit: here solution problem: stackoverflow.com/a/7969372/282649 c# entity-framework

security - How safe is it to use Facebook as an identity provider? -

security - How safe is it to use Facebook as an identity provider? - we in process of creating new authentication scheme of our company web apps. considering allowing users login via facebook, google, live, etc. what thoughts on safety, privacy , security of allowing facebook access our users? people telling horror stories of facebook tracking them when not logged in facebook. has world chosen take ease of login on privacy protections? these fears myths? safety depends much on code implement it. prefer avoid logging in people twitter, because easy create false business relationship on twitter. now, facebook , google, , i've noticed nil particularly "dangerous" in terms of security. the odd phenomenon (at to the lowest degree far experience goes) that, when presented 2 options, i.e., possibility sign "stardard form" requires verification email (long procedure) , possibility click button , login google, yahoo, or facebook (fast , easy), users

typoscript append keywords from tt_products -

typoscript append keywords from tt_products - in typo3 4.4.2 i´m adding meta keywords tt_products this: page.meta.keywords > page.meta.keywords.cobject = records page.meta.keywords.cobject { tables = tt_products source.data = gpvar:tt_products|product conf.tt_products = text conf.tt_products.field = subtitle conf.tt_products.required = 1 conf.tt_products.crop = 200 | ... | 1 conf.tt_products.striphtml = 1 } after want append title of product meta keywords. i´ve tried := operator no luck: page.meta.keywords := page.meta.keywords.cobject = records page.meta.keywords.cobject { tables = tt_products source.data = gpvar:tt_products|product conf.tt_products = text conf.tt_products.field = subtitle conf.tt_products.required = 1 conf.tt_products.crop = 200 | ... | 1 conf.tt_products.striphtml = 1 } how can add together more keywords different database field? thanks, t book you can utilize coa instead of records within pag

php - Sort Posts By Category? -

php - Sort Posts By Category? - googled hours, cannot find solution. on theme have browse page pulls videos custom post type working with. if user makes 30 categories id users able sort videos using category buttons listed @ top. if click on horror id loop show horror videos. how can sort videos using categories within loop? browse page my category ul li a <ul class="sort-by-category"> <? $args = array( 'orderby' => 'name', 'parent' => 0 ); $categories = get_categories( $args ); foreach ( $categories $category ) { echo '<li><a class="browse-categories" href="' . get_category_link( $category->term_id ) . '">' . $category->name . '</a></li>'; } ?> </ul> <? // our variables $numposts = (isset($_get['numposts'])) ? $_get['numposts'] : 0; $

php - Preparing insert statement for multiple columns -

php - Preparing insert statement for multiple columns - i'm trying insert first name, lastly name, email , password db, of course of study want prepare statement first. searched around google , stack, couldn't find syntax inserting multiple columns, one. utilize in place of ? of prepare statement , bind_param(). here code: if(!($sql = $link->prepare("insert users(fname, lname, email, password) value(fname=?, lname=?, email=?, password=?))){ echo "prepare failed: (" . $link->errno . ") " . $link->error; } $sql->bind_param('?', $fname); $sql->bind_param('?', $lname); $sql->bind_param('?', $email); $sql->bind_param('?', $hashpass); $sql->execute(); edit: possible? have each separately? are using mysqli? looks are. if so, need phone call bind_param 1 time , in values part of sql set comma separated question marks represent each column: $query = "insert users(fna

javascript - Find class name of SVG element -

javascript - Find class name of SVG element - how can find class name of svg attribute? if div have been {reference div}.classname but, doesnt work same way svg element is there jquery or javascript method/attribute classes of svg element? see below have tried: here's jsfiddle: http://jsfiddle.net/ujp76/ <body> <svg class="c1"></svg> <script> window.addeventlistener("load", function () { var classname = document.queryselector("svg").getattribute("class"); console.log(classname); }); </script> </body> javascript jquery svg classname

c - GCC plugin: copying function's arguments -

c - GCC plugin: copying function's arguments - i develop gcc plugin instruments applications beingness compiled. applications written in c , built gcc 4.7 (4.8 , 4.9 option) on x86 linux system. my plugin implements compilation pass placed after "ssa" standard pass , operates on gimple representation. among other things, need implement next cannot figure out how correctly. when processing c function, need insert code @ origin copies arguments local variables create, future processing. my first naive implementation looked follows: tree p; gimple_seq seq = null; gimple_stmt_iterator gsi = gsi_start_bb(single_succ(entry_block_ptr)); (p = decl_arguments(current_function_decl); p; p = decl_chain(param)) { tree copy_par; copy_par = create_tmp_var(tree_type(p), null); add_referenced_var(copy_par); copy_par = make_ssa_name(copy_par, null); g = gimple_build_assign(copy_par, p); ssa_name_def_stmt(copy_par) = g; gimple_seq_add_stmt_with

c++ - VAO/VBO management - change all VBO data -

c++ - VAO/VBO management - change all VBO data - i have vao 3 vbos, containing model vertexes, normals , texture coordinates. i intend alter info in vbos quite often, 500ms 20ms update frequency. new model downloaded vbo can have less or more triangles previous one. buffer size change. i'm not expert in opengl tips if possible on how improve code. now, programme implemented follows: glbindvertexarray(*vao); if (mesh->haspositions()) { glbindbuffer(gl_array_buffer, vbo_pos); glbufferdata( gl_array_buffer, 3 * *point_count * sizeof (glfloat), points, gl_dynamic_draw ); glvertexattribpointer(0, 3, gl_float, gl_false, 0, null); glenablevertexattribarray(0); free(points); // free our temporary memory } if (mesh->hasnormals()) { glbindbuffer(gl_array_buffer, vbo_norm); glbufferdata( gl_array_buffer, 3 * *point_count * sizeof (glfloat), normals, gl_dynamic_draw

opengl - Normal mapping, confusion on space -

opengl - Normal mapping, confusion on space - up now, normal mapping encountered maps in world space extracted info texture , transformed them normal matrix. now wanted seek utilize normal map in tangent space, became confused. what i've in code up-to-now is vertex shader ... passedposition = modelviewmatrix*vec4(vertexposition,1.0); ... fragment shader vec3 v = normalize(-passedposition .xyz); // eye vector ... vec3 l_dir = passedposition .xyz - lights[i].lightposition.xyz; vec3 l = normalize(l_dir); ... and proceed lighting calculations. all tutorial came across alter lite directions , view vector tangent space (in vertex shared) , extract normal texture , maintain going (in fragment). issue here i'd avoid access lights info in vertex shared, questions are: does create sense pass fragment shared t,b,n vectors transform lite directions there? should consider access lighting info in vertex shared (i have array of lite struck has

java - how to check if an array 2D (arrayList of arrayList) contains an array of null value? -

java - how to check if an array 2D (arrayList of arrayList) contains an array of null value? - i have arraylist of arraylist , want check if array (sublist) contains null value. problem when first sublist contains null, works if sec sublist, doesn't work because first sublist contain object o arraylist<arraylist<type>> array = new arraylist<arraylist<type>>(); arraylist<type> sublist = new arraylist<type>(); (int = 0; <= array.size(); i++) { sublist=array.get(i); if (sublist != null) { (object o : sublist) { if (o != null) homecoming false; } } } homecoming true; i figure out that: if (o != null) homecoming false; makes loop goes out. how go on loop edit: public boolean containsonlynull(arraylist<type> sublist) { (object o : sublist) { if (o !

How can we allow users to manage some permissions but not all on a SharePoint site? -

How can we allow users to manage some permissions but not all on a SharePoint site? - we want users of 1 of our sharepoint site manage permissions on site not want them give permission called "manage permissions". because if so, users start assigning built in permission level “full control” themselves. how can accomplish this? please note users permission level "manage permissions" can create , alter permission levels on web site [ref: microsoft]. want them able create users, groups, , assign permissions on site users , groups. "we want them ... , assign permissions" realize can assigning total command these groups? isn't want avoid? manage permissions them, , allow them self manage grouping members. way can add together people "publishers" group... , net result user has "publish" permissions. solution 2 can extrapolated granular needs, don't explain how because wouldn't recommend it. sharepoin

android - Sending SMS in background from service while phone is sleeping -> RESULT_ERROR_NO_SERVICE -

android - Sending SMS in background from service while phone is sleeping -> RESULT_ERROR_NO_SERVICE - i'm developing gps tracking app sends geo-positions sms in conditions (time, distance). it works well, when there no gsm activity minutes (e.g. receiving sms or phone calls), sending sms fails smsmanager.result_error_no_service . not problem of bad signal, happens in areas signal contineously strong. for me seems phones (android 2.3 , 4.0.4) set sending hardware kind of sleep mode after several minutes when screen off , when phone call smsmanager.sendtextmessage android doesn't awake them. weird: when receive (unanswered) phone phone call or sms, sending sms works (i retry every 2 minutes in case of errors). sufficient unlock screen without doing anything. is there workaround? can tell android wake gsm before sending sms? (i haven't tried powermanager.partial_wake_lock because cpu running obviously.) android sms android-service gsm

linux - Bash - How to skip a column while writing to csv -

linux - Bash - How to skip a column while writing to csv - in next screenshot can see on first row, there country codes , each country code have 2 different related columns (mt & mo). how skip adding empty column after each country using bash script? here how write countries row: echo "'sg',,'id',,'au',,'my',," >> ${filename} as can see there ,, in between country codes facilitate reading output there way skip adding column end having whole column each country? need this: please advice, the csv format not provide way indicate cell spans several columns. in fact, doesn't provide way indicate formatting of kind. so if restricted using csv, cannot improve inserting empty cell. linux bash shell csv scripting

How to save different cube variables in matlab? -

How to save different cube variables in matlab? - i have loop , in each iteration creates cube of data, , want utilize them later in different loop. since in cube form, can not have them illustration a(:,j) each iteration j have vector. is there way have them after end of loop? how using num2str ? have illustration a1 , a2 , ... , can read them in next loop j (for illustration a(j=1) )? i have this: for j=1:n aj = something; end jj=1:n ajj end if understand correctly, sounds have go 4th dimension :) %# pre-allocate = zeros( <size of cube>, n); %# generate cubes j = 1:n a(:,:,:,j) = <your info cube> end %# utilize info cubes j = 1:n cube = a(:,:,:,j); end matlab

jquery - add href link to Tag in css -

jquery - add href link to <a> Tag in css - i have dynamic table .in info populates db ashyperlink records this script: function geterrorstatuslist() { }); $.ajax({ // parameters success: function (response) { //data gets in response var output = "<table class='table'><tr><th>mzillaid</th></tr>"; (var x = 0; x < obj.length; x++) { output += "<tr><td class='myclass' style='text-decoration:underline;'>" + obj[x].emid + "</td></tr>"; } output += "</table>"; $("#result").append(output); }, }); this working fine .this records generated hyperlink in output html as <a href="http://mzillaint.nokia.com/show_bug.cgi?id=87774">87774</a> ..i want set on css.i mean add together "a" tag in css , set href in like a { href://link genera

java - How to logout gmail using selenium script? -

java - How to logout gmail using selenium script? - i writing selenium script gmail login , logout functionality. able login using below code. //open gmail driver.get("http://www.gmail.com"); // come in userd id webelement element = driver.findelement(by.id("email")); element.sendkeys("xyz@gmail.com"); //wait 5 secs userid entered driver.manage().timeouts().implicitlywait(5, timeunit.seconds); //enter password webelement element1 = driver.findelement(by.id("passwd")); element1.sendkeys("password"); //submit button element.submit(); but not write script logout. yu please provide me script logout? thanks! try below code. driver.findelement(by.classname("gb_ta")).click(); // click flyout menu driver.findelement(by.classname("gb_71")).click(); // click sign out button java selenium automa

binary - MATLAB Decimal to ASCII -

binary - MATLAB Decimal to ASCII - i trying convert 3x8 matrix ascii equivalent , save text file. each row represents 8-bit binary number. steps follow create decimal value each row, utilize char() convert decimal ascii. this works ok alphanumeric inputs. input containing first 3 ascii characters (nul, soh , stx), resultant file empty. the code is: bin_3x8 = reshape(serial,8,[]).' dec = bin2dec(num2str(bin_3x8)) text = [char(dec).'] filesave = fopen(filename,'w'); fprintf(filesave,text); fclose(filesave); output: bin_3x8 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 dec = 0 1 2 text = the matlab console shows text conversion empty, think might because can not print these characters. if write info file, file empty well. any suggestions? you can seek native2unicode . set encoding ascii. matlab binary ascii

Is it possible to convert a simple grails application to OSGi bundle that can run in Adobe CQ? -

Is it possible to convert a simple grails application to OSGi bundle that can run in Adobe CQ? - i have simple grails 2.2.4 application lists bunch of items on page. have 1 controller , i'm not using database. now, want convert application osgi sling bundle can run under adobe cq. when prepare grails app creates war file...how can tweak such creates war/jar file osgi bundle? as example, came across slingbucks example. able built (jar) , upload jar adobe cq , able run within adobe cq. question i'm wondering if there way tweak grails app such can run bundle in adobe cq first install grails osgi plugin or jira grails plugin (more recent) grails install-plugin osgi then can follow instructions @ groovy site convert jar. grails osgi osgi-bundle sling grails-2.2

ruby on rails - Set ActiveAdmin filter default value -

ruby on rails - Set ActiveAdmin filter default value - i have simple filter in activeadmin boolean value. looks this filter :invisible, as: :select you may take "any", "true" or "false" , works fine. default value of filter "any", while need set "true". how can it? give thanks you. try : filter : invisible, as: :select, collection: [["yes", true], ["no", false]] this works fine me. obviously can edit "yes" - "no" string want. ruby-on-rails activeadmin

c# - Selectable evenly spaced grid of images -

c# - Selectable evenly spaced grid of images - i trying produce layout show me grid of images respond user clicks. expected layout 1 of image 1 image 2 image 3 image 4 image 5 image 6 image 7 image 8 image 9 my current xaml layout <grid x:name="contentpanel" grid.row="1" margin="12,10,10,10"> <listbox x:name="previewlistbox" horizontalalignment="left" margin="2,10,0,10" width="446"> <listbox.itemspanel> <itemspaneltemplate> <toolkit:wrappanel orientation="horizontal" /> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> <datatemplate> <grid horizontalalignment="center"> <grid.c

Best way to load assets in android java -

Best way to load assets in android java - i have 1 android activity lot of calculations , ok, in final version of project need load lot of bitmaps , sounds in same activity , gets lot slower should be.. activity chrashes itself. so, there advice how should load assets? should declare them in separate class, or what? basically load assets when need them , unload them if not need them. (lazy loading) because mobile has limited memory , imagining files big must careful on how manage files. for image recommend link , seek optimize image possible for sounds kindly @ class , give-and-take about loading sound files outofmemoryerror when loading big amount of info in android android soundpool – how check if sound file loaded? java android load assets