Posts

Showing posts from March, 2010

ios - Migrate Core Data from iCloud to local after user signed out from iCloud -

i have scenario: an app uses core data icloud the user kills app (it doesn't run not in background) after app killing, user signs out icloud on device the user starts app again, icloud account not there anymore, user wants icloud data there again in local store -> manual migration icloud local non-icloud store needs executed the question - safe ? safe icloud container and/or data still there after user signs out icloud on device ? talking scenario e.g. user not using app let's 1 month , in meantime signs out icloud. thanks lubos

new custom Drupal 7 trigger to ban ip -

i want make new custom system drupal 7 trigger ban ip of non-member trues access site content not exist , gets "access denied"or "page not found" the ban ip action available user action - not dblog entry or attempts access non-authenticated (a.k.a non-member) users i have looked @ custom trigger code available not see (or know how to) how use trigger on attempts access non-existent nodes any pointers appreciated i found there new module => https://www.drupal.org/project/tarpit - drupal 7

search - Searching for invoices with Paypal-PHP-SDK fails -

i'm unable search invoices based on invoice status. have tried following: //$searchstring = '[{ // "status" : "sent", // "page" : 0, // "page_size" : 0, // "total_count_required" : true // }]'; this above search string returns http response 500. $searchstring = '{ "status" : "sent", "page" : 0, "page_size" : 0, "total_count_required" : "true" }'; this above search string returns "{"name":"validation_error","message":"invalid request - see details.","debug_id":"e8b3b40ca05f4","details":[{"field&q

Math.h not working properly? -

i'm having strange problem has been driving me crazy while. part of code requires c++ calculate simple arithmetic using math.h, spitting out incorrect values! here section of code: for(int = 0; < data.size(); i++) { cout << (data[i][8]/dp)/2 << " : " << -log(tan(acos(data[i][8]/dp)/2)) << endl; } which gives following output: 0.5 : inf 0.5 : inf -0.5 : -37.3319 0.5 : inf -0.5 : -37.3319 0.5 : inf 0.5 : inf -0.5 : -37.3319 -0.5 : -37.3319 -0.5 : -37.3319 0.5 : inf -0.5 : -37.3319 -0.5 : -37.3319 0.5 : inf 0.5 : inf -0.5 : -37.3319 -0.5 : -37.3319 0.5 : inf 0.5 : inf 0.5 : inf 0.5 : inf -0.5 : -37.3319 -0.5 : -37.3319 -0.5 : -37.3319 -0.5 : -37.3319 0.5 : inf -0.5 : -37.3319 0.5 : inf -0.5 : -37.3319 -0.5 : -37.3319 -0.5 : -37.3319 0.5 : inf -0.5 : -37.3319 0.5 : inf -0.5 : -37.3319 -0.5 : -37.3319 -0.5 : -37.3319 0.5 : inf -0.5 : -37.3319 -0.5 : -37.3319 0.5 : inf 0.5 : inf -0.5 : -37.3319 0.5 : inf 0.5 : inf which of course, wron

c# - XML File Error Error : System.InvalidCastException: Specified cast is not valid -

i having problem code`using system; namespace cm18b { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { system.threading.thread.sleep(40000); configuration config = configurationmanager.openexeconfiguration(application.executablepath); string machineid = config.appsettings.settings["machineid"].value; //messagebox.show(machineid); double time = convert.todouble(config.appsettings.settings["time"].value); system.timers.timer timer = new system.timers.timer(time); timer.elapsed += ontimer; timer.enabled = true; this.windowstate = formwindowstate.minimized; } private void ontimer(object source, elapsedeventargs e) { var timer = (system.timers.timer)source; timer.stop();

security - Spring Boot: Not to use TLSv1.0 -

right spring boot application supports tls1.0 tls1.1 , tls1.2. how disable tls1.0 avoid beast attacks? below application.yml server: address: localhost port: 8443 sessiontimeout: 30 ssl: client-auth: need key-store: keystore.jks key-store-password: xxxx key-alias: dev-demo key-password: xxxx protocol: tls trust-store: truststore.jks trust-store-password: xxxx ciphers: tls_ecdh_anon_with_rc4_128_sha, tls_ecdh_ecdsa_with_rc4_128_sha, tls_ecdh_rsa_with_rc4_128_sha, tls_ecdhe_ecdsa_with_rc4_128_sha tls_krb5_export_with_rc4_40_md5, tls_krb5_export_with_rc4_40_sha tls_krb5_with_rc4_128_md5, tls_krb5_with_rc4_128_sha tls_dh_anon_with_aes_128_gcm_sha256, tls_dh_anon_with_aes_256_gcm_sha384 tls_dhe_dss_with_aes_128_gcm_sha256, tls_dhe_dss_with_aes_256_gcm_sha384 tls_ecdh_ecdsa_with_aes_128_gcm_sha256, tls_ecdh_ecdsa_with_aes_256_gcm_sha384 tls_ecdh_rsa_

java - Empty Entity after data retrieving from MySQL DB -

i have following entity import static javax.persistence.generationtype.identity; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.generatedvalue; import javax.persistence.id; import javax.persistence.table; import javax.persistence.uniqueconstraint; import org.hibernate.annotations.type; @entity @table(name = "privilege", uniqueconstraints = @uniqueconstraint(columnnames = "name")) public class privilege implements java.io.serializable { private static final long serialversionuid = 8357379972506504809l; private long privilegeid; private string name; private string description; public privilege() { } @id @generatedvalue(strategy = identity) @column(name = "privilegeid", unique = true, nullable = false) public long getid() { return this.privilegeid; } public void setid(long privilegeid) { this.privilegeid = privilegeid; } @column(name = "name", unique = true, length = 45) public strin

Apache Camel: How to rebuild the url based on the old one or the header -

i using route on camel starts server used access point request, re-directions, gateway database, etc. , want redirect request service in server , compose url based on request. have made processor gets header , puts in new url. new url not executed... here code: camelcontext context = new defaultcamelcontext(); connectionfactory connectionfactory = new activemqconnectionfactory("vm://localhost?create=false"); context.addcomponent("activemq", jmscomponent.jmscomponentautoacknowledge(connectionfactory)); context.start(); processor redir = new redirectprocess(); from("jetty:http://localhost:8080/middleware") .choice() .when(header("redir")).process(redir) .end() and processor public class redirectprocess implements processor { string value = null; string head; public void process(exchange inexchange) throws exception { head = inexchange.getin().getheader("redir").tostring(); came

In Verilog, how can I define the width of a port at instantiation? -

in verilog 2001 module, how can define width of port @ instantiation? for example, multiplier , module instantiates might this: module multiplier #(parameter width = 8, parameter width1 = 8, width2 = 8) ( output [width-1:0] product, input [width1-1:0] factor1, input [width2-1:0] factor2 ); parameter widthi = width1+width2; wire [widthi-1:0] intermediate_product; assign intermediate_product = factor1 * factor2; assign product = (intermediate_product >>> (widthi-width)); endmodule module user(); parameter width_of_product = 8; parameter width_of_factor_1 = 8; parameter width_of_factor_2 = 8; wire [width_of_product] product; reg [width_of_factor_1] factor1; reg [width_of_factor_2] factor2; multiplier #(width_of_product,width_of_factor_1,width_of_factor_2) m0(product, factor1, factor2); endmodule if widths of nets in user defined @ compile time, there way widths of ports in instantiation of multiplier can defined automatically? i'd inst

php - Windows alert javascript with redirect function -

this script <script> function myalert() { alert("you have changed username, logged out in order changes applied"); } </script> and button <input type="submit" value="save" name="btnpass" class="button" onclick="myalert()";/> i wanted know if there's way how add redirect script when "okay" button @ alert click. how can add on script? how can add on script? thanks! use confirm instead of alert the window.confirm() method displays modal dialog optional message , 2 buttons, ok , cancel. function myalert() { var confirmed = confirm("you have changed username, logged out in order changes applied"); // if ok button clicked if (confirmed) { window.location.href = 'google.com'; } return false; // stop form submitting }

c# - How to spy the class under test with AutofacContrib.NSubstitute -

i'm running unit tests in class library project nspec framework, autofaccontrib.nsubstitute v3.3.2.0, nsubstitute v1.7.0.0 (the latest of 1.8.2). the class under test instance built autosubstitute , in order automock needed dependencies. autosubstitute autosubstitute = new autosubstitute(); mainpanelviewmodel viewmodel = autosubstitute.resolve<mainpanelviewmodel>(); if working properly, class under test @ point invoke 1 of it's base class methods specific input parameter (the base class out of control): // ... base.activateitem(nextscreen); // ... so, test expectation, need check (spy) instance invokes base method: viewmodel.received().activateitem(arg.any<somespecificscreentype>()); here's problem: when try this, @ runtime nsubstitute complains can ran received() against object created substitute.for<>() . checked autofaccontrib.nsubstitute source code, not find way obtain instance automocking , @ same time wrap somehow in spy object

ios - setting a request header for an authorization token in afnetworking -

i want add authorization token header of request(within request want json information server) here code: afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; manager.requestserializer = [afjsonrequestserializer serializer]; //[manager.requestserializer setauthorizationheaderfieldwithtoken:token]; [manager.requestserializer setvalue:@"application/json" forhttpheaderfield:@"accept"]; [manager.requestserializer setvalue:@"application/json" forhttpheaderfield:@"content-type"]; [manager.requestserializer setvalue:@"4959a0bc00a15e335fb6" forhttpheaderfield:@"authorization"]; [manager get:@"http://domain.com/recipes.json" parameters:nil success:^(afhttprequestoperation *operation, id responseobject) { nslog(@"json: %@", responseobject); nserror *e=nil; recipesarray = [nsjsonserialization jsonobjectwithdata:responseobject options:nsjsonreadingmutablecontainers error:&

compilation - C++ compiler optimizations and short-circuit evaluation -

this question has answer here: is short-circuiting logical operators mandated? , evaluation order? 7 answers here code : b = f() || b; the function f() has side effect , must executed. normally, right operand can short-circuited , code should work. afraid compilators reverse 2 operands, since it's more efficient short-circuit function evaluation rather simple variable evaluation. know g++ -o3 can break specifications, don't know if code can affected. so, code risk-free? i knew is short-circuiting logical operators mandated? , evaluation order? question compilers optimizations, didn't know can't break standards (even if strange). but afraid compilators reverse 2 operands these expressions must evaluated left-to-right. covered in standard operators && , || , ? , , , . mention order, enforced sequence points. §5.14.1

mysql - Advanced SQL Queries in Outsystems -

Image
i have select list of projects user doesnot have access in given organization. i tried query select {project}.[number],{project}.[name] {project} inner join {projectparticipant} on {project}.[id]={projectparticipant}.[projectid] {project}.[tenant_id]=@tenantid , {projectparticipant}.[userid] <> @userid group {project}.[number], {project}.[name] order {project}.[number] but here lists projects within given organization. missing basic. tried using left outer join no use. me out it looks want rows in project table there no corresponding row in projectparticipant table given userid. this should trick: select {project}.[number],{project}.[name] {project} {project}.[tenant_id]=@tenantid , not exists ( select * {projectparticipant} {project}.[id]={projectparticipant}.[projectid] , {projectparticipant}.[userid] = @userid ) order {project}.[number]

SQL Server : spatial query result are not showing -

select distinct lu.objectid land_use_evw lu not exists (select land_use_evw.objectid land_use_evw, municipalities_evw land_use_evw.shape.stcentroid().stintersects(municipalities_evw.shape) = 1 ) i trying result opposite of below select land_use_evw.objectid land_use_evw, municipalities_evw land_use_evw.shape.stcentroid().stintersects(municipalities_evw.shape) = 1 = 0 didn't work therefore i'm trying come other idea. but result shows nothing. no errors or warning. found answer where not exists (select land_use_evw.objectid land_use_evw, municipalities_evw removing land_use_evw from land_use_evw solve problem

javascript - Trying to implement a simple slideshow - Wont work -

i´ve trying implement simple slideshow: http://codepen.io/rafaelcastrocouto/pen/doznmo but im not having sucess , dont know problem is, thing shows last image of slideshow, added path js file, checked if name correct, stil no luck. var seconds = 2; //time beetwen auto slide var delay = 8; //time restart auto slide var slider = $('#slider'); var images = $('#slider .images'); var controls = $('<div>').addclass('controls'); slider.after(controls); var width = images.width(); var slideclick = function() { var b = $(this); $('.controls div').removeclass('current'); b.addclass('current'); var index = b.index(); images.css('left', -1 * index * width); }; $('#slider .images img').each(function(i) { var img = $(this); img.css('left', * width); var button = $('<div>'); controls.append(button); if (i == 0) { button.addclass('current'

methods - ComboBox strategies to function -

i have 4 combo box same follows: select case combobox1.selecteditem case 0 str=str & "' and" case 1 str= str & "'" end case select case combobox2.selected item case 0 str=str & "' and" case 1 str= str & "'" end case similarly other 2 comboboxes have same body i want replace code block method call , implement select clause body in method body , call when required. please give me solution create method takes input combobox selected index i.e integer in method write follows: method1(int x) { select case x case 0 str=str & "' and" case 1 str= str & "'" end case } call method1 required.

javascript - Get asp.net RadioButtonList selected value with jQuery -

i want uncheck radiobuttonlist if click on listitem yet checked. code of radio: <div class="filtrodiv100" style="margin-top: 17px;"> <asp:radiobuttonlist id="rbttipi" runat="server" onclick="resetfun();" style="margin-top: 4px; margin-bottom: 8px;"> <asp:listitem value="industriale">&nbsp; addizionale regionale industriale</asp:listitem> <asp:listitem value="civile">&nbsp; addizionale regionale civile</asp:listitem> <asp:listitem value="sostitutiva">&nbsp; addizionale regionale sostitutiva</asp:listitem> <asp:listitem value="imposta">&nbsp; imposta gas</asp:listitem> </asp:radiobuttonlist> </div> my function: <script type="text/javascript" > functi

java - How I can signing the wsdl attribute with X509 certificate -

i have wsdl file , xsd. so have create new jva project, have import wsdl file, generate test client. now must call soap webservice. can connect throws ssl certificate (i have this) , must signing 5 attribute wsdl file. how can signing these attribute x509 certificate?

javascript - Updating $scope variables across controllers in AngularJS -

i'm new angular, apologies in advance predict simple question. i'm trying create comments system articles. have 2 angular controllers, 1 load comments when page loaded, , submit new comment server. these work fine, in success() method i'd update displayed comments show new comment. however, code @ present doesn't work , no method i've tried seems fix it. please?! i know different $scope variables, none of documentation i've read seems make clear. article.js // create app var articleapp = angular.module('articleapp', ['btford.markdown', 'ngsanitize']); // create controller articleapp.controller('displaycommentsctrl', function ($scope, $http) { $scope.loadcomments = function () { $http.get(routing.generate('article_comments', { id: window.articleid })).success(function (data) { $scope.comments = data.comments; }); }; $scope.loadcomments(); }); articleapp.controller('

asp.net - DropDownList doesn't work with the codebehind C# -

so tried make dropdownlist. working when inside aspx file, doesn't work inside codebehind. <asp:panel id="pnlchannel" runat="server"> <asp:sqldatasource id="sdschannel" runat="server" connectionstring="<%$ connectionstrings:monitor_sql %>" selectcommand="select * table"></asp:sqldatasource> <asp:dropdownlist id="ddlchannel" runat="server" datasourceid="sdschannel" autopostback="true" datatextfield="kanal"> </asp:dropdownlist> </asp:panel> then tried codebehind in c#: public panel getdropdownlist() { // create drop down list , data source panel pnlchannel = new panel(); pnlchannel.id = "pnlchannel"; dropdownlist ddlchannel = new dropdownlist(); ddlchannel.id = "ddlchannel"; listitem limdefault = new listitem(); sqldatasource sdschannel = new sqldatasource(); sdsc

adapter - webmethods oracle issue with nchar -

when try "select" statement using data type "nchar" column must pad input value before passing input value of adapter. happens because nchars in oracle have fixed length . know if there way bypass behavior can retrieve, example, record this: supposing name nchar(8) column select surname people name='joe' instead of obliged do select surname people name='joe ' this environment: webmethods 9.7 adapter 9.0 ojdbc7 either change column data type nvarchar(8) or use like operator as where name 'joe%' (or) use trim() function like where trim(name) = 'joe' (or) use rpad() function like where name = rpad('joe',8, ' ');

android - Two dynamic fragment on screen (back) -

i have application fragment. start 2 dynamic fragments on screen. on fragment b, have list. when click on item, change 2 fragments c , d. _____ _____ _____ _____ | | | c | | | | | _____ => _____ when back, have : _____ _____ | b | | d | | d | | b | _____ _____ _____ _____ when press button back, have top fragment change, fragment d stay visible whereas want see a/b. this class : public class mainactivity extends activity implements fragmentblistener, fragmentclistener { private static final string tag_fragment_a = "fragmentatag"; private static final string tag_fragment_b = "fragmentbtag"; private static final string tag_fragment_c = "fragmentctag"; private static final string tag_fragment_d = "fragmentdtag"; fragmentmanager fragmentmanager =

java - BitmapFactory open failed: ENOENT (No such file or directory) -

i trying take photo android camera intent shown in tutorial: http://developer.android.com/training/camera/photobasics.html#taskscalephoto the photo taken , safed @ given path. anyway i'm getting following error: 06-25 14:46:02.228 9070-9070/de.ema.flo.grapp e/bitmapfactory﹕ unable decode stream: java.io.filenotfoundexception: file:/storage/emulated/0/android/data/de.ema.flo.grapp/files/pictures/img_20150625_144559002.jpg: open failed: enoent (no such file or directory) create image: private file createimagefile() throws ioexception { string timestamp = new simpledateformat("yyyymmdd_hhmmsssss").format(new date()); file storagedir = getactivity().getexternalfilesdir(environment.directory_pictures); file image = new file(storagedir, "img_" + timestamp + ".jpg"); mcurrentphotopath = "file:" + image.getabsolutepath(); return image; } following code called after taking photo in intent @override publ

Not able to cast response to particular list object in Java -

i'm getting response webservice [{id=100, value=1815401000238}, {id=101, value=1815401000244}] here i'm casting value list object list<map<string, string>> leadids here i'm passing response method serviceutil.status(leadids); leadids has above response here method definition public response updatestatus(list<map<string, string>> leadids) { so can cast , iterate. ,it throws me error java.lang.classcastexception: java.util.linkedhashmap cannot cast java.util.map$entry what should casted? guess list object. try use list<linkedhashmap<string, string>> instead of list<map<string, string>> when doing casting

javascript - How do I call the start() & stop() methods in this to create functional audio controls? -

i have method audiobuffersourcenode holds audio file has been loaded. on line 136 line 13 below start() , stop() methods being used on audio node other things, can't thing. how call these methods play , pause audio. don't know correct way call start() & stop() methods have buttons or divs play/ pause audio , how use methods have volume slider , mute button. how go doing it? side note: told declaring variable 'audiobuffersourcenode' globally better practice, not sure how or meant or if has problem. so on line 13 start() , stop() methods being used on audio node. _visualize: function(audiocontext, buffer) { var audiobuffersourcenode = audiocontext.createbuffersource(), analyser = audiocontext.createanalyser(), = this; //connect source analyser audiobuffersourcenode.connect(analyser); //connect analyser destination(the speaker), or won't hear sound analyser.connect(audiocontext.destination); //then ass

uitextfield - how to send values to server in iOS -

i want send value server ,i getting message values inserted @ time of fetching value null, code sample. -(void)requestreturneddata:(nsdata *)data{ //activated when data returned nsdictionary *dictionary = [nsdictionary dictionarywithjsondata:data]; output.text = dictionary.jsonstring; value1textfield.text =[dictionary objectforkey:@"productdescription"] ; nslog(@"val1",value1textfield.text); value2textfield.text = [dictionary objectforkey:@"productid"]; value3textfield.text = [dictionary objectforkey:@"productimageurl"]; value4textfield.text = [dictionary objectforkey:@"productname"]; value5textfield.text = [dictionary objectforkey:@"productprice"]; value6textfield.text = [dictionary objectforkey:@"productrating"]; value7textfield.text = [dictionary objectforkey:@"productreviews"]; nslog(@"%@",dictionary); } -(void)gettest{