Posts

Showing posts from January, 2013

SQL Server error on update command - "A severe error occurred on the current command" -

running following query in sql server management studio gives error below. update table_name set is_active = 0 id = 3 a severe error occurred on current command. results, if any, should discarded. the logs have been truncated there update trigger isnt issue the transaction count 0 (@@trancount) i have tried same update statement on couple of other tables in database , work fine. dbcc checktable('table_name'); gives dbcc results 'table_name'. there 13 rows in 1 pages object "table_name". dbcc execution completed. if dbcc printed error messages, contact system administrator. i had same error, , down corrupted index. re-indexing table fixed problem. i realise thread year old, thought worth mentioning incase comes across in future (like did).

cryptography - Modify of AES S-Box -

is there way change standart s-box , inv. s-box of aes algorithm pair of s , inv s -boxes? standard s-box , inv. s-box here: http://en.wikipedia.org/wiki/rijndael_s-box the possible explanation sboxinv not inverse of sbox. simple check reveals sbox[5e] = 6a, whereas sboxinv[6a] = 68 (and not 5e should be).

kendo ui - KendoMobile dataSource didn't initialize properly -

Image
i'm developping little kendomobile webapp. problem quite simple : anytime try initialize datasource setting array data option, datasource remains empty. here array (screen safari dev console) : console.log("fournisseursarray -> "); console.log(fournisseursarray); now structure of objects : in opinion both seems correct in fact : when use objects array, shows me want guess works fine. but if simple, wouldn't have here, so... this how declare datasource : datasourcemap = new kendo.data.datasource({ data: fournisseursarray }); finally when put log on datasource : console.log(datasourcemap); if knows problem, i'll him share knowledge me the kendo ui data source remain empty unless call read or fetch methods. in short call fetch or read before accessing data.

ios7 - Customise UITableViewCellEditControl -

is there easy way customise uitableviewcelleditcontrol . more specific want change images plus , minus sign. what have found far ( http://voidrant.tumblr.com/post/27760918492/customize-uitableviewcell-edit-mode-views ) can "searching" subviews in layoutsubviews , replace image there. it sounds hack, , afraid rejection, wandering there other way? i targeting on ios7

javascript - Give angular directive a model name to access it's scope in the parent -

i'm trying access isolated scope of directive using model attribute on it's element when use in html. eg. <div controller="parent"> <hello-world data-ng-model="hw"/> <input type="submit"/> </div> the controller parent: function($scope){ $scope.submit = function(){ alert($scope.hw.t); } }; the directive hello-world: app.directive('helloworld', function() { return { link: function(scope, element, attrs){ scope.t = 'test'; }, replace: true, restrict: 'e', scope: {}, template: '<h5>hello world {{t}}</h4>' }; }); t defined in isolated scope, because displayed correctly. however, when click submit button, error because hw undefined. (because hello-world scope isn't being assigned 'hw' scope variable of parent. how can let hw defined scope of hello-world directive? use case make date picker exposes date pic

ios - Update parent view from child view -

i using xcode 5 (ios sdk 7.0). trying update element inside parent view child view. i have following files: viewonecontroller viewtwocontroller inside viewonecontroller, adding viewtwocontroller subview following code: [self.view addsubview:viewtwocontroller]; i have uiimageview declated in viewonecontroller.h iboutlet uiimageview *box; i update backgound color of box viewtwocontroller. know can update background color following code. [box setbackgroundcolor:[uicolor redcolor]]; but works in viewonecontroller. have function called updatecolor viewtwocontroller. want update color of box function. one quick , not clean way call parentviewcontroller directly : [((viewonecontroller*)self.parentviewcontroller).box setbackgroundcolor:[uicolor redcolor]]; however larme suggested it, believe cleanest way use delegate, used notify change after user did something. here tutorial http://www.tutorialspoint.com/ios/ios_delegates.htm you have create delegate protoco

java - convert dynamic web project to maven project -

i try create dynamic web project in eclipse , convert project maven project. project has structure src\main\java src\main\resources src\main\webapp src\main\test when right click on project > configure > convert maven project, error message : errors occurred during build. errors running builder 'maven project builder' on project 'gestion'. not calculate build plan: plugin org.apache.maven.plugins:maven-war-plugin:2.3 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-war-plugin:jar:2.3 plugin org.apache.maven.plugins:maven-war-plugin:2.3 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-war-plugin:jar:2.3 not calculate build plan: plugin org.apache.maven.plugins:maven-war-plugin:2.3 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-war-plugin:jar:2.3 plugin org.apache.maven.plugins:maven-war-plugin:2.3 or 1 of dep

c++ fork() and address space -

complete gnu fork() noob here. need fork n processes exact same thing: allocate 2 arrays, initialize them , process data. tried code can simplistically compressed into: int main() { int = 0; double b = 0; double *a1, *a2; fork(); a1 = new double[10]; a2 = new double[10]; // initialize , process data in a1 , a2 using algorithm involving , b. } is fork() in right place in terms of creating copies of a1 , a2 each process copies of a , b ? or should declaration and/or initialization of a , b fall after fork() call? each process should have own a, b, a1 , a2 . address spaces of processes distinct , if in parent-child relationship.

ruby - How to scrape "data:image" URIs; Encountering Errno::ENAMETOOLONG? -

i having been trying write script scrapes page images way has been outlined in " save image files website ". i tested method page , worked fine, when inserting link scrape data:image uris, like: data:image/jpg;base64,/9j/4fejfoiejnfoejoiad//gaqtgfgrgregg2ljewmad/2wbdaagebaqeregrewgrwegufbqygbgygbgygb... i error beginning initialize': file name long , ending in (errno::enametoolong) . has found way deal situations this? data:image urls contain image inline base 64. need grab data , decode it: require 'base64' file.open(file.basename(uri),'wb'){ |f| f.write(base64.decode64(url[/base64,(.*)/, 1])) }

magento community forgot password not working -

i have inherited magento community site, @ point in it's history upgraded , seems 1 of upgrades did not run forgot password sql scripts. rp_token , rp_token_created_at attributes missing eav_attribute table. right if use forgot password feature , enter in email address in system magento throws error , blank page. i tried adding these fields in manually magento must doing work behind scene when adding attributes, question how can run upgrade scripts feature working? the scripts looks did not complete are: app\\code\\core\\mage\\customer\\sql\\customer_setup\\mysql4-upgrade-1.6.0.0-1.6.1.0.php these attributes not in eav_attribute table. // add reset password link token attribute $installer->addattribute('customer', 'rp_token', array( 'type' => 'varchar', 'input' => 'hidden', 'visible' => false, 'required' => false )); // add reset password link token creation date

c# - Trouble mocking return value of .Single() method in mocked repository -

scenario: learning how unit test. working on tests mvc action method nunit , fakeiteasy. have test verify method throws exception if passed id doesn't exist. action method calls repository wrapper method .single(), throw exception if nothing found. good. in test, following: create fake irepository using fakeiteasy create test data configure .single() wrapper method data test data problem: having issues testing this. problem when passed invalid id, exception thrown right in configuration code fake repository, instead of in action method itself. the reason why obvious. configuration code ran before action method gets executed, , configuration code calls .single() on test data... (intentionally of course) not contain invalid id. throws exception right , there, , never makes action method. what not sure about, how around this. exception needs thrown inside action method. don't know how configure return value in way avoids conundrum. code: controller code

how to send and make a php email form -

ok try every time can't i'm using xampp , thunderbird, tryed make email form people can contact me have code right won't send gmail doing wrong. , need make activation php can sign website. <form action="test1.php" method="post"> <p>name</p> <input type="text" name="name"> <p>email</p> <input type="text" name="email"> <p>phone</p> <input type="text" name="phone"> <p>request phone call:</p> yes:<input type="checkbox" value="yes" name="call"><br /> no:<input type="checkbox" value="no" name="call"><br /> <p>website</p> <input type="text" name="website"> <p>priority</p> <select name="priority" size="1"> <option value="low">low</option> <o

html5 - Invalid location of html tag <command> in Eclipse -

given code: <!doctype html> <html> <body> <menu id="html5menu" type="context" style="display:none" class="showcase"> <command label="rotate" onclick="alert('rotate')"></command> <command label="resize" onclick="alert('resize')"></command> <menu label="share"> <command label="twitter" onclick="alert('twitter')"></command> <hr> <command label="facebook" onclick="alert('facebook')"></command> </menu> </menu> </body> </html> i warning in eclipse: invalid location of tag (command). according examples have found in web tag being used correctly. eclipse 'false' warning or missing something?

list - Most efficient way to sort by multiple fields in Java -

i'm working on project have table in memory, example: field1 field2 field3 field4 field5 somevalue somevalue somevalue somevalue somevalue somevalue somevalue somevalue somevalue somevalue . . . . v what best way write function allow user specify non-predetermined permutation of fields sort? (ex./ sort field2, field1, field5). best method thought of far recursive function, gets ugly pretty quick, creating , managing 'subgroups' of rows within each column. can point me in more efficient direction before commit convoluted approach? by way, table stored list of arrays. the key thing realize here search algorithm stays same. thing changes actual comparison function. i recommend using standard sort in arrays or collections class, writing own custom comparable class or comparator , compare method use data user supplies. kind of interesting - i've ever written comparable classes use fixed data, use case them. all ne

perl regex: negative lookahead between two characters -

how include pattern between 2 characters in regular expression? say wanted print in below text apart words in between " " this "example". "is" "an" example. "this" example. this i've tried far, think i'm missing something: m/(?!"(.*)").*/g $s = 'this "is" "an" example'; @words = ($s =~ /"([^"]*)"/g); @words contains words between " "

Login in sencha touch 2 through go button of android phone -

how call function on tap of go button present in smartphones in sencha touch 2 ? you should able wire-up an event listener in application's launch function , inspect keyidentifier. can @ similar question here document.addeventlistener("keydown", ext.bind(onkeydown, this), false);

Unable to draw line over gridview elements properly through textview cells in Android -

Image
i implement word search app. part of implementation have come across canvas , drawing line on grid view cells( letters form word) indicate user touching finger on letters form word. i have succeeded partially of can draw line on letters of grid view line not through center of views of grid view. please can assist me valuable suggestions . have glance on below screen shot clear idea. edited: i'm posting code idea of how i'm implementing it. xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/root" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fff" > <relativelayout android:id="@+id/topbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:background="#a9e2f3" > <li

html - How to add Button over image using CSS? -

Image
i new in css sorry if question stupid or simple dont know how it. i need place button on image, how should looks: you see there blue button "kopit" thats it! style thing website 1 single image code looks like: css: #shop{ background-image: url("images/shop_bg.png"); background-repeat: repeat-x; height:121px; width: 984px; margin-left: 20px; margin-top: 13px; } #shop .content{ width: 182px; /*328 co je 1/3 - 20margin left*/ height: 121px; line-height: 20px; margin-top: 0px; margin-left: 9px; margin-right:0px; display:inline-block; } my html: <div id="shop"> <div class="content"> counter-strike 1.6 steam <a href="#"><img src="images/cssteam.png"></a></div> <div class="content"> counter-strike 1.6 steam <a href="#"><img src="images/cssteam.png"></a>&l

regex - Unknown UTF-8 character in PERL -

i want read string text file in perl the method used read : my $indpara = "c:\\users\\admin001\\desktop\\paratext.txt"; open(indpara, $indpara) || die "indesign paratext not found on location!"; $indesignpara = <indpara>; close indpara; when reading text, getting unknown unicode character ( &#65279 or &#xfeff ) @ starting of text, download text file used read below link https://mega.co.nz/#!r1payaha!vsnl2tbpwottthccroiogsxk4ok_0yvzsczs054w0uu i using komodo ide 8.5 , perl 5.16.3 kindly give idea overcome this thanks in advance vimal what have there bom . telling have not utf-8 file, utf-16 (be) file). the bom not part of data in file, can safely skip past , continue read data beyond it. however, should not treat data reading file utf-8, should treat utf-16 (be) , decode it appropriately.

ios - Get Local Document Video File but Black screen come again -

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *pathvideo = [documentsdirectory stringbyappendingpathcomponent:@"myvideo.mp4"]; nsurl *movieurl = [nsurl fileurlwithpath:pathvideo]; self.movieplayer = [[mpmovieplayercontroller alloc] init]; [self.movieplayer setshouldautoplay:yes]; [self.movieplayer setcontenturl:movieurl.absoluteurl]; [self.movieplayer setmoviesourcetype:mpmoviesourcetypefile]; [self.movieplayer setcontrolstyle:mpmoviecontrolmodedefault]; [self.movieplayer setfullscreen:no]; [self.movieplayer setscalingmode:mpmoviescalingmodenone]; self.movieplayer.view.frame = cgrectmake(40, 40, 240, 350); [self.view addsubview:self.movieplayer.view]; [self.movieplayer preparetoplay]; [self.movieplayer play]; let's try: nsarray *paths = nssearchpathfordirectoriesindomains(nsdo

Highcharts / Highstock step line without vertical "transition" lines? -

Image
is possible omit vertical lines "square wave" line? think call level line, here's illustration: the easiest way achieve use scatter chart custom "line" symbol: // define custom line symbol highcharts.svgrenderer.prototype.symbols.line = function (x, y, w, h) { return ['m', x, y, 'l', x - w * 2, y, 'm', x, y, 'l', x + w * 2, y, 'z']; }; if (highcharts.vmlrenderer) { highcharts.vmlrenderer.prototype.symbols.cross = highcharts.svgrenderer.prototype.symbols.cross; } $('#container').highcharts({ chart: { type: 'scatter' }, title: { text: 'look @ lines!!' }, series: [{ name: 'line symbol', data: [54.4, 29.9, {y: 129.2, radius: 8}, 144.0, 176.0, 135.6], marker: { symbol: 'line', linecolor: null, linewidth: 2 } }] }); note can adjust length of indi

Why can't this R call object in an expression be evaluated? (subsetting vs extracting from a call object) -

i trying understand r expression object, encountered difficulties. code snippet: a = 1 b = 2 x = expression(sin(a+b+1)) print(class(x[[1]][2])) eval(x[[1]][2]) results: #//////////////////////////////////////////////////// x = expression(sin(a+b+1)) #//////////////////////////////////////////////////// print(class(x[[1]][2])) [1] "call" #//////////////////////////////////////////////////// x = expression(sin(a+b+1)) #//////////////////////////////////////////////////// print(class(x[[1]][2])) [1] "call" #//////////////////////////////////////////////////// eval(x[[1]][2]) error in eval(expr, envir, enclos) : attempt apply non-function 2: eval(expr, envir, enclos) 1: eval(x[[1]][2]) x[[1]][2] call object, why can't evaluated? you should use [[ operator, , not [ . a <- 1 b <- 2 eval(x[[1]][[2]]) ## [1] 4 this because you'd extract information language object, , not subset (look inside 2nd element, , not return subsequence c

Manually chosen rendition is not taking effect on the brightcove player -

i'm changing video rendition using setrenditionselectioncallback explained here http://support.brightcove.com/en/video-cloud/docs/selecting-multi-bitrate-streaming-renditions . seems rendition choose never being displayed, when in brightcove debugger see messages like: attempting change rendition player expects play (110000b/s, 400x224) (800000b/s, 640x360) new rendition chosen external rendition algorithm. is there else should done update rendition being displayed? or know issue? i'm updating rendition index in setrenditionselectioncallback callback. thanks in advance here! :) i trying change dynamically rendition in progressive download account. in kind of accounts rendition selection possible @ start. it possible force rendition change progressive account using different method, restart playback (and download) beginning again. there's existing plugin doing that: https://github.com/brightcoveos/rendition-selector-plugin .

arrays - Explode String and convert it into time PHP -

i have string "monday, april 28, 6:00pm - 11:00pm." want parse individual variables can format , convert utc. also, want first part of time. figured way explode it.... $arraystring = explode(',', $string); //split string comma $starttime = explode(' - ', $arraystring[2]); //split time using - $times = $starttime[0]; $date = strtotime($times); echo date('g:ia', $date); //getting time i want output 06:00 pm (so can test if $date works later converting time utc). yet 1:00am. when try same month, gives me january. any suggestions? thanks! you creating $date reference time part of string, hence default january. if concatenate $arraystring[1] $times variable there. suggest @ datetime class result variable make time zone conversion easier.

api - how to update a column in force.com explorer -

select name, profileid, id, username user select query retrive data in force.com explorer now wan't update column how can this? update key word self not working here please give solution this. in advance in salesforce not write update query same in sql. please use update method update column of object. more information , sample please read following documents. https://www.salesforce.com/us/developer/docs/api/content/sforce_api_calls_update.htm

java - How do I wait and get the result from a Promise in the service layer in Play Framework 2.2.1? -

i need value promise returned method service layer. , need inside action<?> onrequest(request req, method actionmethod){} of global class extends globalsettings . need value returned promise before calling method service layer , before onrequest method of global class returns. i've method named await can't examples googled method coming from. i'm not sure if method can give me result. i'm doing in java. edit: added source code public class global extends globalsettings { @autowired private authorizationservice authorizationservice; @override public action<?> onrequest(request req, method actionmethod) { // simplicity's sake string username = req.getheader( "email" ); promise<boolean> promiseofboolean = this.getauthorizationservice().isuserregistered( username ); if( /* promiseofboolean true */ true ) { // here // return

Android EditText giving error on onclick method -

i trying read in contents of w_number_edit_text (a textbox) after login(a button) clicked. on onclick method can't seem access contents of w_number_edit_text . both textbox , button on fragment xml instead of main.xml . can tell me how fix problem. in short how access contents of edittext after button clicked? thank you code below: package com.example.medrec; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar; import android.support.v4.app.fragment; import android.app.alertdialog; import android.os.bundle; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.view.onclicklistener; import android.view.viewgroup; import android.view.window; import android.view.windowmanager; import android.webkit.webview.findlistener; import android.widget.button; import android.widget.edittext; import

oracle not in query takes longer than in query -

i have 2 tables each has 230000 records. when make query: select count(*) table1 field1 in (select field2 table2). it takes 0.2 second . if use same query changing in not in select count(*) table1 field1 not in (select field2 table2). it never ends . why ? its better user not exists, not in uses row search takes long

java - Fullcalendar and json -

i'm trying load events database. i'm using gae, java , jsp. problem in json response. if write directly in script output of json, s work correctly, ajax call no. method in java: public void caricadati(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { date start=javatimestamptodatetime(double.parsedouble(req.getparameter("start"))); date end=javatimestamptodatetime(double.parsedouble(req.getparameter("end"))); date afteraddingtenmins=new date(start.getdate() + (10 * 60000)); objectifyservice.register(appuntamento.class); list<appuntamento> listaa= ofy().load().type(appuntamento.class).filter("d >=", start).filter("d <=", end).list(); system.out.println(listaa); jsonobject j= new jsonobject(); for(appuntamento : listaa){ resp.setcontenttype("application/json"); // set content type of response jquery knows can expect. r

vbscript - Active component cant create obj error -

i trying script file transferring ,its works fine when clicking manually script.but when trying run scheduling task receiving error "active component cant create obj",i don't know went wrong in script? reference have script below. dim mysite set mysite = createobject("cuteftppro.teconnection") set fso = createobject("scripting.filesystemobject") mysite.protocol = "ftp" mysite.host = "www.domainname.com" mysite.login = "xxxxx" mysite.password = "xxx" mysite.useproxy = "both" mysite.connect mysite.uploadasync "c:\sampletest\abc.flv" mysite.remotefolder = "/test/abc.flv" mysite.disconnect mysite.close fyi machine windows 2008 64 bit system in cases issue raised 1 of following: user not have proper permission run scheduler user not have proper access folders/files listed application using running under different permission set logged in user , system account us

jquery - Retrieving data from javascript object -

Image
the image below screenshot of 2 objects in array. how can retrieve dates , string "" inside array? please consider if there more 1 object in array. i've created function far: function printdata(data) { $.each(data, function(i, item) { //console.log(item); $.each(item, function(j, c) { //console.log(c); $.each(c, function(k, l){ //console.log(l.v); }); }); }); //console.log(data.c.v); console.dir(data); } can tweak function want. edit: the object: data = new google.visualization.datatable(); data.addcolumn('datetime', 'start'); data.addcolumn('datetime', 'end'); data.addcolumn('string', 'content'); a listener lets users add events timeline, , add data timeline follows: var options = { "width": "100%", "height": "300px", "editable": true, "style": "box

c# - Memory leak in WPF code -

i have code, runs every time "primary menu" item clicked. fills out submenu stackpanel "buttoned" user controls. private void loadsubmenucontrols(int _menuid) { double _itemcount = 0; double _buttonheight = 61; //fill out user permissions //get information users //release events , bindintgs foreach (object _child in midmenu.children) { ((menubutton)_child).midmousepressed -= new menubutton.midmenumousebuttonpressed(menubutton_midmousepressed); ((menubutton)_child).datacontext = null; } midmenu.children.clear(); midscroll1.scrolltotop(); midmenu.height = midheight; midmenu.width = this.width / 3; foreach (datarow _row in _rxworksmenues.getmenuitems(_menuid)) { _itemcount++; mainscreenwpfuc.menubuttonviewmodel _butview = new menubuttonviewmodel(); _butview.applyviewmodel(_row,_itemcou

The Character Class in Java -

here short program counts letters of given word entered user. i'm trying figure out following lines in program: counts[s.charat(i) - 'a']++; // don't understand - 'a' doing system.out.println((char)('a' + i) // don't 'a' + does. import java.util.scanner; public class listing9_3 { public static void main(string[] args) { //create scanner scanner input = new scanner (system.in); system.out.println("enter word find out occurences of each letter: "); string s = input.nextline(); //invoke count letters method count each letter int[] counts = countletters(s.tolowercase()); //display results for(int = 0; i< counts.length; i++){ if(counts[i] != 0) system.out.println((char)('a' + i) + " appears " + counts[i] + ((counts[i] == 1)? " time&quo

Extra spacing in Vim when copying and pasting from Chrome -

this question has answer here: pasting code terminal window vim on mac os x 6 answers whenever copy text has been indented vim chrome, cascading indent instead of consistent one, so: def fn(x): """takes x input , returns y if x: return y becomes: def fn(x): """takes x input , returns y if x: return y how prevent (preferred), or how fix spacing using other vim commands (acceptable)? extra info vim 7.4, chromium 34 on arch linux copy method: highlight (mouse or otherwise) in chromium, ctrl-c , switch vim , insert mode, shift-ctrl-v . when paste using of terminal/os's default method (menu, co

How to create Map from Hibernate query list -

i have requirement create map hibernate query result. here need the query returns list of users. have create map list. map key dept id , map value list of users department. criteria criteria=session.createcriteria(user.class).list this return list[user1, user2,...] i want create map list map< dept1:[user1,user2,user3,..], dept2:[user1,user2,user3,..], .. .. > is there easy way this. you can using map collection feature of hibernate. but, may have query each department(sort of loop) , add final map. check map section in document .

php - String get from CDATA, returned 0 when was converted to "int" -

i text include in cdata looks in xml file: <?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://splashurl.com/nztqga8 <document> <name>opencellid cells</name> <description>list of available cells</description> <placemark><name></name><description><![cdata[lat: <b>3.378199</b><br/>lon: <b>-76.523528</b><br/>mcc: <b>732</b><br/>mnc: <b>123</b><br/>lac: <b>4003</b><br/>cellid: <b>26249364</b><br/>averagesignalstrength: <b>0</b><br/>samples: <b>10</b><br/>changeable: <b>1</b>]]></description><point><coordinates>-76.523528,3.378199,0</coordinates></point></placemark> </document> </kml> i cdata text usign next code in php : $ch = curl_init(); curl_setopt($ch, curlopt_returntran

cordova - phonegap facebook connect fail on iphone 4 and iphone 5 -

i'm developing ios app phonegap 3.4 connects facebook used plugin connect facebook: https://github.com/phonegap/phonegap-facebook-plugin everything works in emulators provided xcode 5.1. tested app on iphone 3gs , connection facebook still works. tested iphone 4s , facebook connection not work: fb.login not called. same happens on iphone 5s. no error in xcode console , in safari console under developer mode. the plugin out of date make sure set config.xml correctly <access origin="https://m.facebook.com" /> <access origin="https://graph.facebook.com" /> <access origin="https://api.facebook.com" /> <access origin="https://*.fbcdn.net" /> <access origin="https://*.akamaihd.net" /> <feature name="org.apache.cordova.facebook.connect"> <param name="ios-package" value="facebookconnectplugin" /> </feature>

Is there a ReadLine equivalent for a file in Go? -

i want readbytes until "\n" text file, not bufio. is there way without converting bufio? there many ways it, wrapping bufio suggest. if doesn't work (why not?), can go ahead , read single bytes this: full working example: package main import ( "bytes" "fmt" "io" ) // readline reads line delimited \n io.reader // unlike bufio, rather inefficiently reading 1 byte @ time func readline(r io.reader) (line []byte, err error) { b := make([]byte, 1) var l int err == nil { l, err = r.read(b) if l > 0 { if b[0] == '\n' { return } line = append(line, b...) } } return } var data = `hello, world! write 3 lines.` func main() { b := bytes.newbufferstring(data) { line, err := readline(b) fmt.println("line: ", string(line)) if err != nil { return } } }

algorithm - Fastest Cortex M0+ Thumb 32x32=64 multiplication function? -

does have (or can write) optimal inline assembly function arm cortex m0+ processor in thumb mode multiply 2 32-bit numbers , return 64-bit number? as m0+ not have long multiply, way can accomplished through primitive multiplication, compiler calls __aeabi_lmul performs 64x64=64 multiplication in 34 instructions. i'm hoping faster algorithm exists, given inputs 32 bits. so talking unsigned or signed multiplication? if signed doing 64x64=64 anyway not 32x32=64. if unsigned take source code gcc library function , modify since know upper halves of operands zero. or @ hackers delight (hackersdelight.org) , see if there algorithm implements faster gcc library.

android - What are the suggested Java options for JNI intensive program? -

i tried optimize jni intensive java program playing around java optimization options described here . however, far didn't find of them affect performance. can know suggested java options or guideline jni intensive program? or java options have no effect on jni intensive programs?

java - Play 2.2.2 (Scala), how to handle HttpServletRequests -

i new play , scala, , stuck problem, goes like: simple explanation, www.somesite.com/redirectedfoo //points below controller def redirectedfoo = action{ //the http request needs traced here, //and needs accessed java api method val obj=new samplemethod(--need http request obj argument--) //my problem play request , http request totally different 'objects', //and above method uses httpservletrequest obj, how handled in play } sorry couldn't provide proper explanation, for purposes, play wrong place be. play designed able run outside of servlet containers, , therefore implements api http requests not conform @ servlet api. you have 2 options: write own function converts play.api.mvc.request own implementation of javax.servlet.http.httpservletrequest . although httpservletrequest quite big interface dependencies on more big classes, information contained in play request should enough construct httpservletrequest . depending on use might leave or m

Mysql query in java -

i have service rest database generated in netbeans. creates entity classes each table . @entity @table(name = "users") @xmlrootelement @namedqueries({ @namedquery(name = "users.findall", query = "select u users u"), @namedquery(name = "users.findbyid", query = "select u users u u.id = :id"), @namedquery(name = "users.findbyname", query = "select u users u u.name = :name"), @namedquery(name = "users.findbytelephone", query = "select u users u u.telephone = :telephone"), @namedquery(name = "users.findbyyear", query = "select u users u u.year = :year")}) public class users implements serializable { private static final long serialversionuid = 1l; @id @basic(optional = false) @notnull @column(name = "id") private inte

Tetris block in C -

i have project college create tetris using dynamically allocated board representing empty part . . wanted create blocks each of pieces individually example o o o o block in tetris described in 2d dynamically allocated matrix that: tablo[0][((distx/2)-1)] = 'o'; /*tablo stands board(the 2d allocated matrix) , '(distx/2)-1' used start block top center of board */ printf("\n"); for(i=0;i<3;i++) { tablo[1][((distx/2)-1)+i] = 'o'; } so question is: is efficient? is there way make blocks , move them inside board matrix easier? with solution of blocks have bit of trouble finding way make them drop whole it's drawing tetris. plus told include hard mode tetris starts blocks or block parts on board difficult solution. its first time posting please tell me if need more information issue. thank time. here example of tetris game implemented in c http://www.gladir.com/coder/turboc/tetris.htm in first link shapes sto

android - Correct RelativeLayout usage please -

i have layout listview item , it's displayed incorrectly (book descr goes on last update date). can please me fix? if set android:layout_above="@+id/lastupdateddt" to bookdescr item whole text disappears... edit: i've updated sample according comments <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:descendantfocusability="blocksdescendants" android:layout_margin="10dp" android:background="@drawable/big_card_details" android:clickable="true" android:focusable="false"> <checkbox android:id="@+id/icon" android:layout_width="wrap_content"

android - How can i achieve CoverFlow view -

i want achieve overflow view dotted layout. using polidea cover flow library url [github] . using library images drawn @ center. i want achieve exact ui this. an excellent approach given @ https://github.com/davidschreiber/fancycoverflow where fancycoverflow in android app can used as fancycoverflow = new fancycoverflow(context); fancycoverflow.setmaxrotation(45); fancycoverflow.setunselectedalpha(0.3f); fancycoverflow.setunselectedsaturation(0.0f); fancycoverflow.setunselectedscale(0.4f); you can inflate fancycoverflow xml: <at.technikum.mti.fancycoverflow.fancycoverflow android:layout_width="match_parent" android:layout_height="match_parent" fcf:maxrotation="45" fcf:unselectedalpha="0.3" fcf:unselectedsaturation="0.0" fcf:unselectedscale="0.4" /> please visit also 1) https://github.com/deepwinter/android-coverflow 2) https://github.com/i7an

How to get a negative rownumber in sql server -

i have set of data datetime , calculatedon start @ current date getdate() , x amount of records before current date, , same amount after. if x = 50 50 prior , 50 in front of now. thinking rownumber() perfect this, cannot think of how number rows negative prior , positive future. also there issue of if there not 50 prior or future happen, come after. assume table has 2 columns : create table mytable ( id int not null constraint pk_mytable primary key, sometextiwant nvarchar(50) not null, calculatedate datetime not null ); results : if today 25/04 12:54 then id, sometextiwant, calculateddate -- 50 before now-- -----now here----- -- 50 after now-- you can use 2 cte's, 1 past , 1 future dates, use row_number asc , desc , multiply before -1 , concat all: with databefore ( select d.*, rn = (-1) * row_number() on (order calculatedon desc) dbo.tablename d calculatedon < getdate() ) , dataafter ( select d.*, rn = row_numbe

SSIS Help: Archive a file from the list of files that does not exist in SQL Table -

i create in ssis package, wherein, loop in list of files in directory or folder , check each files if exist in sql queried table. if filename not exist in table, archive in different folder. thanks advance help! =) you use each loop container can pointed said directory or folder , store file name (name , extension, qualified or name depending on requirement) in variable eg. loopvariable. use execute sql task inside container has prepared statement - if exists (select * [files] [filename] = ?)select 'yes' else select 'no' - in parameter pass loopvariable , result map variable fileexists. in precedence constraint editor use - expression - [user::fileexists] =="no" , connect file system task moves file archive folder. note: might need form file path in case not getting qualified name loop container.

java - Writing an encrypted PDF file using Cipher RSA -

in code below, grab existing pdf file, encrypt , output encrypted file. problem outputted file not work properly. creates file of 0 bytes. tried same code simple text file "sample.txt" , worked fine. outputted file created encryption. can tell me may doing wrong? work differently pdf files? public void encryptfile() throws nosuchalgorithmexception, nosuchpaddingexception, invalidkeyexception, certificateexception, keystoreexception, ioexception { fileinputstream fis = new fileinputstream("c:\\sample.pdf"); fileoutputstream fos = new fileoutputstream("c:\\sample_encrypted"); cipher c = cipher.getinstance("rsa/ecb/oaepwithsha-1andmgf1padding"); c.init(cipher.encrypt_mode, getsappubliccertificate().getpublickey()); cipheroutputstream cos = new cipheroutputstream(fos, c); byte[] buf = new byte[2048]; int read; while ((read = fis.read(buf)) != -1) { cos.write(buf, 0, read); } fis.close();