Search Results

Search found 84 results on 4 pages for 'cesar romero'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Updating a Safari Extension?

    - by Ricky Romero
    Hi there, I'm writing a simple Safari Extension, and I'm trying to figure out how to get the update mechanism working. Apple's documentation here is delightfully vague: http://developer.apple.com/safari/library/documentation/Tools/Conceptual/SafariExtensionGuide/UpdatingExtensions/UpdatingExtensions.html And here's my manifest, based on that documentation: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Extension Updates</key> <array> <dict> <key>CFBundleIdentifier</key> <string>net.rickyromero.safari.shutup</string> <key>Team Identifier</key> <string>TMM5P68287</string> <key>CFBundleVersion</key> <string>1</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>URL</key> <string>http://rickyromero.net/misc/SafariExtensions/ShutUp.safariextz</string> </dict> </array> </dict> </plist> I don't know where to get "YourCertifcateID," for example. And when I increment the values for CFBundleVersion and CFBundleShortVersionString, it doesn't trigger an update. I know Safari is hitting my manifest though, because I'm watching HTTP traffic. Thoroughly stumped. Any ideas, guys?

    Read the article

  • Language in a Sandbox in Rails

    - by Jon Romero
    I've found that there WAS a sandbox gem (created by the guys that made try ruby in your browser but it was compatible only with Ruby 1.8. Another problem is that I cannot find it anymore (it seems they stop serving the gem from the servers...). So, is there any secure way of running ruby in a sandbox (so you can run it from your browser)? Or an easy way to run (for example lua/python) in a sandbox (no filesystem access, no creation of objects etc) and be called from Ruby (Rails 2.2)? I want to make an application like try_ruby even without having a ruby underneath. But it has to be an easy language (I saw there was a prolog in ruby, even a lisp but I don't think they are easy to learn languages...). So, do you have any suggestions or tips? Or should I just start creating my own DSL in Ruby (if there is a solution in creating a somewhat safe system)? Thx

    Read the article

  • subclassing and data contracts

    - by Sergio Romero
    I'm playing with the following code: [ServiceContract] public interface IUserAccountService { [OperationContract] UserAccountResponse CreateNewUserAccount(UserAccountRequest userAccountRequest); } public abstract class BaseResponse { public bool Success { get; set; } public string Message { get; set; } } public class UserAccountResponse : BaseResponse { public int NewUserId { get; set; } } My questions are: Do I need to add the DataContract attribute to both the abstract class and the subclass? If the abstract class does not need the DataContract attribute, can I add the DataMember attribure to its properties?

    Read the article

  • Can't make my WCF extension work

    - by Sergio Romero
    I have a WCF solution that consists of the following class libraries: Exercise.Services: Contains the implementation classes for the services. Exercise.ServiceProxy: Contains the classes that are instantiated in the client. Exercise.HttpHost: Contains the services (*.svc files). I'm calling the service from a console application and the "first version" works really well so I took the next step which is to create a custom ServiceHostFactory, ServiceHost, and InstanceProvider so I can use constructor injection in my services as it is explained in this article. These classes are implemented in yet another class library: 4. Exercise.StructureMapWcfExtension Now even though I've modified my service this: <%@ ServiceHost Language="C#" Debug="true" Factory="Exercise.StructureMapWcfExtension.StructureMapServiceHostFactory" Service="Exercise.Services.PurchaseOrderService" %> I always get the following exception: System.ServiceModel.CommunicationException Security negotiation failed because the remote party did not send back a reply in a timely manner. This may be because the underlying transport connection was aborted. It fails in this line of code: public class PurchaseOrderProxy : ClientBase<IPurchaseOrderService>, IPurchaseOrderService { public PurchaseOrderResponse CreatePurchaseOrder(PurchaseOrderRequest purchaseOrderRequest) { return base.Channel.CreatePurchaseOrder(purchaseOrderRequest); //Fails here } } But that is not all, I added a trace to the web.config file and this is the error that appears in the log file: System.InvalidOperationException The service type provided could not be loaded as a service because it does not have a default (parameter-less) constructor. To fix the problem, add a default constructor to the type, or pass an instance of the type to the host. So this means that my ServiceHostFactory is never being hit, I even set a breakpoint in both its constructor and its method and they never get hit. I've added a reference of the StructureMapWcfExtension library to all the other ones (even the console client), one by one to no avail. I also tried to use the option in the host's web.config file to configure the factory like so: <serviceHostingEnvironment> <serviceActivations> <add service="Exercise.Services.PurchaseOrderService" relativeAddress="PurchaseOrderService.svc" factory="Exercise.StructureMapWcfExtension.StructureMapServiceHostFactory"/> </serviceActivations> </serviceHostingEnvironment> That didn't work either. Please I need help in getting this to work so I can incorporate it to our project. Thank you. UPDATE: Here's the service host factory's code: namespace Exercise.StructureMapWcfExtension { public class StructureMapServiceHostFactory : ServiceHostFactory { private readonly Container Container; public StructureMapServiceHostFactory() { Container = new Container(); new ContainerConfigurer().Configure(Container); } protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { return new StructureMapServiceHost(Container, serviceType, baseAddresses); } } public class ContainerConfigurer { public void Configure(Container container) { container.Configure(r => r.For<IPurchaseOrderFacade>().Use<PurchaseOrderFacade>()); } } }

    Read the article

  • Decode JSON with mochijson2 in Erlang

    - by Jon Romero
    I have a var that has some JSON data: A = <<"{\"job\": {\"id\": \"1\"}}">>. Using mochijson2, I decode the data: Struct = mochijson2:decode(A). And now I have this: {struct,[{<<"job">>,{struct,[{<<"id">>,<<"1">>}]}}]} I am trying to read (for example), "job" or "id". I tried using struct.get_value but it doesn't seem to work. Any ideas?

    Read the article

  • Trying to put a generic MyObj<T, U> into an IList where U can be different between objects

    - by Sergio Romero
    I have the following class definition: public interface IItem{} public class FirstObject<T, U> : IItem { public U SomeProperty { get; private set; } } IList<IItem> myList = new List<IItem>(); I did it like this because U can be of different types. Now I want to iterate the list and get my items back, the problem is that I do not know how to cast them back to their original type so I can read the value of SomeProperty. Thanks for your help.

    Read the article

  • How to get data from struts2 action with jQuery?

    - by Rafa Romero
    I have an Struts2 Web with GoogleMaps. I want to load a list of markers which are saved in a SQL DDBB. To do this, I tried with jQuery and Ajax. Here you are the code: loadMarkers.java public class loadMarkers extends ActionSupport implements ServletRequestAware,ServletResponseAware{ //Variables de sesion/cookie FunctionClass ses; protected HttpServletResponse servletResponse; protected HttpServletRequest servletRequest; private String userID=""; //Variables del marker private List<marker> markersList = new ArrayList<marker>(); public String execute() throws Exception{ FunctionClass friends = new FunctionClass(); //Leemos de la cookie for(Cookie c : servletRequest.getCookies()) { if (c.getName().equals("userID")) userID = (c.getValue()); } System.out.println("en el loadMarkers"); connectionBBDD con = new connectionBBDD(); markersList = con.loadMarkers(userID); return SUCCESS; } I want to use the markerList array in Javascript, to create the markers. This is the struts.xml file: <package name="jsonActions" namespace="/test" extends="json-default"> <action name="LoadMarkers" class="web.localizadroid.maps.loadMarkers"> <interceptor-ref name="basicStack"/> <result type="json"> <param name="root">markersList</param> </result> </action> </package> And here you are the Javascript (jQuery) code: function loadMarkersJ(){ alert("dentro"); $.ajax({ type : "post", url : "LoadMarkers", dataType: "json", success : function(data) { alert(data); var image = new google.maps.MarkerImage ('http://i53.tinypic.com/ettquh.png'); var jSon_Object = eval("(" + data + ")"); //For para analizar los datos (Json) obtenidos de la BBDD for (x = 0; x < jSon_Object.length; x++) { var markersArray = []; var myLatlng = new google.maps.LatLng(jSon_Object[x].lat, jSon_Object[x].lon); markerLoaded = new google.maps.Marker( { position : myLatlng, map : map, icon: image, title: "NOMBRE: " + jSon_Object[x].tarjetName + "\n" + "ANOTACIONES: " + jSon_Object[x].anotaciones + "\n" + "TIME: " + jSon_Object[x].time }); markersArray.push(markerLoaded); if (markersArray) { for (i in markersArray) { alert("entro en forColocaMarkers"); if (markersArray[i].getAnimation() != null) { markersArray[i].setAnimation(null); } else { markersArray[i].setAnimation(google.maps.Animation.BOUNCE); } markersArray[i].setMap(map); } } } } }); } From success : function(data) { to the end, is JavaScript code to create de markers, and this it's OK. The problem is whith ajax, because I don't get to obtain markerList Array by jSon data return...I think that the problem is in the url attribute from $.ajax...I tried loadMarkers.action and loadMarkers, but nothing happens. When I execute the web, only prints the alert alert("dentro"), the alert alert(data) never has been printed. I have forgotten to add the code where I call the Javascript function (loadMarkersJ). Here you are: <p><s:a action="LoadMarkers.action" namespace="/test" onclick="loadMarkersJ(this)">Cargar Marcadores S</s:a></p> Somebody can help me please?

    Read the article

  • Voice command in non-english Windows 7 Home Premium

    - by Cesar
    Is there a good software to add voice command to my Windows 7 machine? English voice command would work for me, but I am unable to get it via OS both because I use a pt-BR Windows 7, and becuse I only have the Home Premium version. Upgrading is too expensive for me. Do you recommend a good alternative. It could be either free or paid, as long it's good.

    Read the article

  • dd oflag=direct 5x fast

    - by César
    I have Centos 6.2 in server with this specs: 2xCPU 16 Core AMD Opteron 6282 SE 64GB RAM Raid controller H700 1GB cache NV - 2HD 74GB SAS 15Krpm RAID1 stripe 16k (OS Centos 6.2) sda - 4HD 146GB SAS 15Krpm RAID10 stripe 16k (ext4 bs 4096, no barriers) sdb -> /vol01 Raid controller H800 1GB cache nv - MD1200 12HD 300GB SAS 15Krpm RAID10 stripe 256k (For DB Postgres 8.3.18) (ext4 bs 4096, stride 64, stripe-width 384, no barriers) sdc -> /vol02 I'm benchmarking IO speed with dd, and view thah if in RAID10 12 disk exec: dd if=/dev/zero of=DD bs=8M count=10000 oflag=direct 10000+0 records in 10000+0 records out 83886080000 bytes (84 GB) copied, 126,03 s, 666 MB/s but if I remove "oflag=direct" option obtain about 80 MB/s. In read benchmark, results are similar: dd of=/dev/null if=DD bs=8M count=10000 iflag=direct 10000+0 records in 10000+0 records out 83886080000 bytes (84 GB) copied, 79,5918 s, 1,1 GB/s If remove iflag=direct obtain 150MB/s... I don't understand this huge differences, on other machines y don't have this behavior. Can I have some kernel parameter misconfigured? Thanks!

    Read the article

  • Apple file sharing: bind to a specific interface

    - by Cesar
    My customer have an office small office with just a wifi router. He use this router for internet connectivity and file transfer operations between the desktops. Recently the file transfer activity between desktop (all osx based) is increased a lot so he bought a switch (no connected to the router, too far away) for transfer the file over the cable instead over the wifi. Problem: How to bind the file sharing service just to the Ethernet interface and exclude the wifi interface ? (actually the service binds to the wifi automatically and there are no options about the interface binding)

    Read the article

  • Share one ssl certificate between multiples vhost

    - by Cesar
    I have a setup like this: <VirtualHost 192.168.1.104:80> ServerName domain1 DocumentRoot /home/domain/public_html ... </VirtualHost> <VirtualHost 192.168.1.104:80> ServerName domain2 DocumentRoot /home/domain2/public_html ... </VirtualHost> <VirtualHost 192.168.1.104:80> DocumentRoot /home/domain3/public_html ServerName domain3 ... </VirtualHost> <VirtualHost 192.168.1.104:443> ServerName domain3 SSLCertificateFile /usr/share/ssl/certs/certificate.crt SSLCertificateKeyFile /usr/share/ssl/private/private.key SSLCACertificateFile /usr/share/ssl/certs/bundle.cabundle ... </VirtualHost> I want to use domain3 certificate in the other domains, preferably without having to repeat all the <VirtualHost 192.168.1.104:443> config. In other words I want something like this: If the vhost has no explicit ssl config use cert for domain3 (/usr/share/ssl/certs/certificate.crt) Notes: 1.- I for sure will be setting more vhosts in the future 2.- I know (and don't care) of the ssl warnings the browser will show (hostname mismatch) If this possible? how?

    Read the article

  • How to properly test for constraint violation in hibernate?

    - by Cesar
    I'm trying to test Hibernate mappings, specifically a unique constraint. My POJO is mapped as follows: <property name="name" type="string" unique="true" not-null="true" /> What I want to do is to test that I can't persist two entities with the same name: @Test(expected=ConstraintViolationException.class) public void testPersistTwoExpertiseAreasWithTheSameNameIsNotAllowed(){ ExpertiseArea ea = new ExpertiseArea("Design"); ExpertiseArea otherEA = new ExpertiseArea("Design"); ead.setSession(getSessionFactory().getCurrentSession()); ead.getSession().beginTransaction(); ead.makePersistent(ea); ead.makePersistent(otherEA); ead.getSession().getTransaction().commit(); } On commiting the current transaction, I can see in the logs that a ConstraintViolationException is thrown: 16:08:47,571 DEBUG SQL:111 - insert into ExpertiseArea (VERSION, name, id) values (?, ?, ?) Hibernate: insert into ExpertiseArea (VERSION, name, id) values (?, ?, ?) 16:08:47,571 DEBUG SQL:111 - insert into ExpertiseArea (VERSION, name, id) values (?, ?, ?) Hibernate: insert into ExpertiseArea (VERSION, name, id) values (?, ?, ?) 16:08:47,572 WARN JDBCExceptionReporter:100 - SQL Error: -104, SQLState: 23505 16:08:47,572 ERROR JDBCExceptionReporter:101 - integrity constraint violation: unique constraint or index violation; SYS_CT_10036 table: EXPERTISEAREA 16:08:47,573 ERROR AbstractFlushingEventListener:324 - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update So I would expect the test to pass, since the expected ConstraintViolationException is thrown. However, the test never completes (neither pass nor fails) and I have to manually kill the test runner. What's the correct way to test this?

    Read the article

  • Why jquery have problem with onbeforeprint even?

    - by Cesar Lopez
    Hi all, I have the following function. $(function() { $(".sectionHeader:gt(0)").click(function() { $(this).next(".fieldset").slideToggle("fast"); }); $("img[alt='minimize']").click(function(e) { $(this).closest("table").next(".fieldset").slideUp("fast"); e.stopPropagation(); return false; }); $("img[alt='maximize']").click(function(e) { $(this).closest("table").next(".fieldset").slideDown("fast"); e.stopPropagation(); return false; }); }); <script type="text/javascript"> window.onbeforeprint = expandAll; function expandAll(){ $(".fieldset:gt(0)").slideDown("fast"); } </script> For this html <table class="sectionHeader" ><tr ><td>Heading 1</td></tr></table> <div style="display:none;" class="fieldset">Content 1</div> <table class="sectionHeader" ><tr ><td>Heading 2</td></tr></table> <div style="display:none;" class="fieldset">Content 2</div> I have several div class="fieldset" over the page, but when I do print preview or print, I can see all divs sliding down before opening the print preview or printing but on the actual print preview or print out they are all collapse. I would appreciate if anyone comes with a solution for this. Anyone have any idea why is this or how to fix it? Thanks. PS:Using a does not work either ( I assume because jquery using toggle) and its not the kind of question I am looking for.

    Read the article

  • Delphi connection to OpenEdge Progress-4GL Database

    - by Cesar Marrero
    Folks: Has anyone had success connecting to a Progress-4GL database with Delphi?   I've been unable to establish any connection with the ODBC driver provided by the vendor (Progress OpenEdge 10.1C Driver). I've entered (what I believe are) the right parameters, but keep on getting an error whenever I test the connection: "[DataDirect][ODBC Progress OpenEdge Wire Protocol driver] Socket closed." Background: I've been tasked to re-design a 13-year-old application, but the original programmer did not provide any supporting documents, passwords, configuration setup, etc. (I'm on my own)!   To make things worse, online help and useful documentation about Progress is scarce (I had never heard about this database until now). I want to examine the existing data, maybe create an ERD to familiarize myself with the schema, but I can't even access the data outside of the OpenEdge code. Any help is appreciated!

    Read the article

  • using JQuery on beforeprint event problem.

    - by Cesar Lopez
    Hi all, I have the following function. <script type="text/javascript"> window.onbeforeprint = expandAll; function expandAll(){ $(".fieldset:gt(0)").slideDown("fast"); } </script> For this html <table class="sectionHeader" ><tr ><td>Heading</td></tr></table> <div style="display:none;" class="fieldset">Content</div> I have several block of content over the page, but when I do print preview or print, I can see all divs sliding down, but on the print out they are all collapse. Anyone have any idea why is this? Thanks.

    Read the article

  • How to send mail from ASP.NET with IIS6 SMTP in a dedicated server?

    - by Julio César
    Hi. I'm trying to configure a dedicated server that runs ASP.NET to send mail through the local IIS SMTP server but mail is getting stuck in the Queue folder and doesn't get delivered. I'm using this code in an .aspx page to test: <%@ Page Language="C#" AutoEventWireup="true" %> <% new System.Net.Mail.SmtpClient("localhost").Send("[email protected]", "[email protected]", "testing...", "Hello, world.com"); %> Then, I added the following to the Web.config file: <system.net> <mailSettings> <smtp> <network host="localhost"/> </smtp> </mailSettings> </system.net> In the IIS Manager I've changed the following in the properties of the "Default SMTP Virtual Server". General: [X] Enable Logging Access / Authentication: [X] Windows Integrated Authentication Access / Relay Restrictions: (o) Only the list below, Granted 127.0.0.1 Delivery / Advanced: Fully qualified domain name = thedomain.com Finally, I run the SMTPDiag.exe tool like this: C:\>smtpdiag.exe [email protected] [email protected] Searching for Exchange external DNS settings. Computer name is THEDOMAIN. Failed to connect to the domain controller. Error: 8007054b Checking SOA for gmail.com. Checking external DNS servers. Checking internal DNS servers. SOA serial number match: Passed. Checking local domain records. Checking MX records using TCP: thedomain.com. Checking MX records using UDP: thedomain.com. Both TCP and UDP queries succeeded. Local DNS test passed. Checking remote domain records. Checking MX records using TCP: gmail.com. Checking MX records using UDP: gmail.com. Both TCP and UDP queries succeeded. Remote DNS test passed. Checking MX servers listed for [email protected]. Connecting to gmail-smtp-in.l.google.com [209.85.199.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to gmail-smtp-in.l.google.com. Connecting to gmail-smtp-in.l.google.com [209.85.199.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [209.85.135.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [209.85.135.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt1.gmail-smtp-in.l.google.com [209.85.133.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt1.gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [74.125.79.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [74.125.79.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt1.gmail-smtp-in.l.google.com [209.85.133.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt1.gmail-smtp-in.l.google.com. Connecting to gsmtp183.google.com [64.233.183.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to gsmtp183.google.com. Connecting to gsmtp147.google.com [209.85.147.27] on port 25. Connecting to the server failed. Error: 10051 Failed to submit mail to gsmtp147.google.com. I'm using ASP.NET 2.0, Windows 2003 Server and the IIS that comes with it. Can you tell me what else to change to fix the problem? Thanks @mattlant This is a dedicated server that's why I'm installing the SMTP manually. EDIT: I use exchange so its a little different, but its called a smart host in exchange, but in plain SMTP service config i think its called something else. Cant remember exactly the setting name. Thank you for pointing me at the Smart host field. Mail is getting delivered now. In the Default SMTP Virtual Server properties, the Delivery tab, click Advanced and fill the "Smart host" field with the address that your provider gives you. In my case (GoDaddy) it was k2smtpout.secureserver.net. More info here: http://help.godaddy.com/article/1283

    Read the article

  • Add calendar datepicker with Jquery on dynamic table.

    - by Cesar Lopez
    I am trying to add a Jquery calendar picker to a text box at the time of creation, but I cant find how. When I press a button, it will create a table, the element I want to attach the Jquery calendar picker is: var txtDate = createTextInput(i, "txtDate", 8, 10); txtDate.className = "datepicker"; this.newcells[i].appendChild(txtsDate); I tried adding at the end : txtDate.datepicker(); But does not work. Can anybody help? Thanks.

    Read the article

  • Add calendar datepicker with Jquery on dynamic table.

    - by Cesar Lopez
    I am trying to add a Jquery calendar picker to a text box at the time of creation, but I cant find how. When I press a button, it will create a table, the element I want to attach the Jquery calendar picker is: var txtDate = createTextInput(i, "txtDate", 8, 10); txtDate.className = "datepicker"; this.newcells[i].appendChild(txtDate); I tried adding at the end : txtDate.datepicker(); But does not work. Can anybody help? Thanks. Note: CreateTextInput is: function createTextInput(i, strName, size, maxLength) { var input = document.createElement('<input>'); input.type = "text"; input.name = strName; input.id = strName + i; input.size = size; input.maxLength = maxLength; return input; }

    Read the article

  • jquery input-validation (number characters and decimal places).

    - by Cesar Lopez
    I have several javascript functions to validate the input data in textbox, so it will limit the user to type into the textbox a range of numbers (eg. from 0 to 500) an x amount of decimals (eg. 1 or 2 or 3 ....). I am having some issues with the javascript functions because they are three separate functions and the alerts get a bit mixed up. I was wondering if there is a jquery function that will make it neat, effective and simple. Thanks.

    Read the article

  • How to “unbind” .result on Jquery Autocomplete?

    - by Cesar
    I have this code: $("#xyz").unautocomplete().autocomplete(dataVar, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }) .result(findValueCallback).next().click(function() { $(this).prev().search(); }); I call this code many times and the first call works correctly, but after he calls findValueCallback many times, not once more. The unautocomplete don't clear .result What I have to do for call findValueCallback once? Sample Code: var niveis01 = []; var niveis02 = []; var niveis03 = []; $(document).ready(function(){ carregaDadosNivel1(); }); function carregaDadosNivel1() { $.ajax({ url: "http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis01 = data; habilitaComboNivel1(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel1() { function findValueCallback1(event, data01, formatted) { ... carregaDadosNivel2(); ... } $("#nivel01").unautocomplete().autocomplete(niveis01, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback1).next().click(function() { $(this).prev().search(); }); } function carregaDadosNivel2() { $.ajax({ url: "http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis02 = data; habilitaComboNivel2(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel2() { function findValueCallback2(event, data02, formatted) { ... carregaDadosNivel3(); ... } $("#nivel02").unautocomplete().autocomplete(niveis02, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback2).next().click(function() { $(this).prev().search(); }); } function carregaDadosNivel3() { $.ajax({ url: ""http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis03 = data; habilitaComboNivel3(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel3() { function findValueCallback3(event, data03, formatted) { ... } $("#nivel03").unautocomplete().autocomplete(niveis03, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback3).next().click(function() { $(this).prev().search(); }); }

    Read the article

  • jquery function to convert datetime, split date time "2010-10-18 10:06" to return "18/10/2010" and

    - by Cesar Lopez
    Hi I was wondering if there is any jquery function around which can take this dateTime "2010-10-18 10:06" and convert and split it returning "2010/10/18" and "10:06". It would be also nice if the same function could either receive "2010-10-18 10:06" or "2010-10-18" only and return as mentioned above, or different formats besides "2010/10/18" like 18-10-2010" or and 18th of October 2010, giving the option but not that important, just curious about jQuery power dealing with dates. Thanks.

    Read the article

  • Application crash when using an NSTimer and pushViewController

    - by Cesar
    I'm using an NSTimer to implement a 3 seconds splash screen. If a don't use a timer the view it's correctly pushed but if I use the timer for adding a little delay the application crash with a EXC_BAD_ACCESS. I'm pretty sure the answer contains "memory management" but I can't get the point... @interface RootViewController : UIViewController { NSTimer *timer; } -(void)changeView:(NSTimer*)theTimer; @property(nonatomic,retain) NSTimer *timer; ... @implementation RootViewController @synthesize timer; - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [[self navigationController] setNavigationBarHidden:YES]; timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(changeView:) userInfo:nil repeats:NO]; } -(void)changeView:(NSTimer*)theTimer { NSLog(@"timer fired"); //Crash here, but only if called using a timer [[self navigationController] pushViewController:list animated:YES]; }

    Read the article

  • How to properly test Hibernate length restriction?

    - by Cesar
    I have a POJO mapped with Hibernate for persistence. In my mapping I specify the following: <class name="ExpertiseArea"> <id name="id" type="string"> <generator class="assigned" /> </id> <version name="version" column="VERSION" unsaved-value="null" /> <property name="name" type="string" unique="true" not-null="true" length="100" /> ... </class> And I want to test that if I set a name longer than 100 characters, the change won't be persisted. I have a DAO where I save the entity with the following code: public T makePersistent(T entity){ transaction = getSession().beginTransaction(); transaction.begin(); try{ getSession().saveOrUpdate(entity); transaction.commit(); }catch(HibernateException e){ logger.debug(e.getMessage()); transaction.rollback(); } return entity; } Actually the code above is from a GenericDAO which all my DAOs inherit from. Then I created the following test: public void testNameLengthMustBe100orLess(){ ExpertiseArea ea = new ExpertiseArea( "1234567890" + "1234567890" + "1234567890" + "1234567890" + "1234567890" + "1234567890" + "1234567890" + "1234567890" + "1234567890" + "1234567890"); assertTrue("Name should be 100 characters long", ea.getName().length() == 100); ead.makePersistent(ea); List<ExpertiseArea> result = ead.findAll(); assertEquals("Size must be 1", result.size(),1); ea.setName(ea.getName()+"1234567890"); ead.makePersistent(ea); ExpertiseArea retrieved = ead.findById(ea.getId(), false); assertTrue("Both objects should be equal", retrieved.equals(ea)); assertTrue("Name should be 100 characters long", (retrieved.getName().length() == 100)); } The object is persisted ok. Then I set a name longer than 100 characters and try to save the changes, which fails: 14:12:14,608 INFO StringType:162 - could not bind value '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' to parameter: 2; data exception: string data, right truncation 14:12:14,611 WARN JDBCExceptionReporter:100 - SQL Error: -3401, SQLState: 22001 14:12:14,611 ERROR JDBCExceptionReporter:101 - data exception: string data, right truncation 14:12:14,614 ERROR AbstractFlushingEventListener:324 - Could not synchronize database state with session org.hibernate.exception.DataException: could not update: [com.exp.model.ExpertiseArea#33BA7E09-3A79-4C9D-888B-4263314076AF] //Stack trace 14:12:14,615 DEBUG GenericDAO:87 - could not update: [com.exp.model.ExpertiseArea#33BA7E09-3A79-4C9D-888B-4263314076AF] 14:12:14,616 DEBUG JDBCTransaction:186 - rollback 14:12:14,616 DEBUG JDBCTransaction:197 - rolled back JDBC Connection That's expected behavior. However when I retrieve the persisted object to check if its name is still 100 characters long, the test fails. The way I see it, the retrieved object should have a name that is 100 characters long, given that the attempted update failed. The last assertion fails because the name is 110 characters long now, as if the ea instance was indeed updated. What am I doing wrong here?

    Read the article

  • Help to understand and recode javascript function to deal with special characters.

    - by Cesar Lopez
    Hi all, I am trying to rewrite a javascript function since I was told this function its a bit nasty peace of code and it could be nicely written by a very kind user from here. I have been trying to understand what the function does, therefore I could rewrite it properly, but since I dont fully understand how it works its a very difficult task. Therefore I am looking for help and directions (NOT THE SOLUTION AS I WANT TO LEARN MYSELF) to understand and rewrite this function in a nicer way. The function its been made for dealing with special characters, and I know that it loops through the string sent to it, search for special characters, and add what it needs to the string to make it a valid string. I have been trying to use value.replace(/"/gi,"/""), but surely I am doing it wrong as it crashes. Could anybody tell me where to start to recode function? Any help would be appreciated. My comments on the function are in capital letters. Code <script type="text/javascript"> function convertString(value){ for(var z=0; z <= value.length -1; z++) { //if current character is a backslash||WHY IS IT CHECKING FOR \\,\\r\\n,and \\n? if(value.substring(z, z + 1)=="\\" && (value.substring(z, z + 4)!="\\r\\n" && value.substring(z, z + 2)!="\\n")) {//WHY IS IT ADDING \\\\ TO THE STRING? value = value.substring(0, z) + "\\\\" + value.substring(z + 1, value.length); z++; } if(value.substring(z, z + 1)=="\\" && value.substring(z, z + 4)=="\\r\\n") {//WHY IS IT ADDING 4 TO Z IN THIS CASE? z = z+4; } if(value.substring(z, z + 1)=="\\" && value.substring(z, z + 2)=="\\n") {//WHY IS IT ADDING 2 TO Z IN THIS CASE? z = z+2; } } //replace " with \" //loop through each character for(var x = 0; x <= value.length -1; x++){ //if current character is a quote if(value.substring(x, x + 1)=="\""){//THIS IS TO FIND \, BUT HAVENT THIS BEEN DONE BEFFORE? //concatenate: value up to the quote + \" + value AFTER the quote||WHY IS IT ADDING \\ BEFORE \"? value = value.substring(0, x) + "\\\"" + value.substring(x + 1, value.length); //account for extra character x++; } } //return the modified string return(value); } <script> Comments within the code on capital letters are my questions about the function as I mention above. I would appreciate any help, orientation, advise, BUT NOT THE SOLUTION PLEASE AS I DO WANT TO LEARN.

    Read the article

< Previous Page | 1 2 3 4  | Next Page >