Search Results

Search found 288 results on 12 pages for 'sergio tapia'.

Page 9/12 | < Previous Page | 5 6 7 8 9 10 11 12  | Next Page >

  • PHP and jquery restrict direct access

    - by Sergio
    Is it possible to restrict direct access to PHP file if I use jquery .load function like this one: $(document).ready(function(){ $("#second").load("testip.php"); }); In this case I want to restrict direct access to file testip.php that will instert data in database. Can I do it using some PHP function that will compare visitors IP address and server IP at "testip.php" file or there is some better way to do it?

    Read the article

  • HTML to Markdown with Java

    - by Sergio del Amo
    is there an easy way to transform HTML into markdown with JAVA? I am currently using the Java MarkdownJ library to transform markdown to html. import com.petebevin.markdown.MarkdownProcessor; ... public static String getHTML(String markdown) { MarkdownProcessor markdown_processor = new MarkdownProcessor(); return markdown_processor.markdown(markdown); } public static String getMarkdown(String html) { /* TODO Ask stackoverflow */ }

    Read the article

  • Entity Framework and Sql Server view question

    - by Sergio Romero
    Hi to all, For several reasons that I don't have the liberty to talk about, we are defining a view on our Sql Server 2005 database like so: CREATE VIEW [dbo].[MeterProvingStatisticsPoint] AS SELECT CAST(0 AS BIGINT) AS 'RowNumber', CAST(0 AS BIGINT) AS 'ProverTicketId', CAST(0 AS INT) AS 'ReportNumber', GETDATE() AS 'CompletedDateTime', CAST(1.1 AS float) AS 'MeterFactor', CAST(1.1 AS float) AS 'Density', CAST(1.1 AS float) AS 'FlowRate', CAST(1.1 AS float) AS 'Average', CAST(1.1 AS float) AS 'StandardDeviation', CAST(1.1 AS float) AS 'MeanPlus2XStandardDeviation', CAST(1.1 AS float) AS 'MeanMinus2XStandardDeviation' WHERE 0 = 1 The idea is that the Entity Framework will create an entity based on this query, which it does, but it generates it with an error that states the following: "warning 6002: The table/view 'Keystone_Local.dbo.MeterProvingStatisticsPoint' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view." And it decides that the CompletedDateTime field will be this entity primary key. We are using EdmGen to generate the model. Is there a way not to have the entity framework include any field of this view as a primary key? Thanks for help.

    Read the article

  • PHP - Counting matching arrays in array

    - by Sergio
    hi there, I have an array structure that looks like this: Array ( [0] => Array ( [type] => image [data] => Array ( [id] => 1 [alias] => test [caption] => no caption [width] => 200 [height] => 200 ) ) [1] => Array ( [type] => image [data] => Array ( [id] => 2 [alias] => test2 [caption] => hello there [width] => 150 [height] => 150 ) ) ) My question is, how can I get a count of the number of embedded arrays that have their type set as image (or anything else for that matter)? In practise this value can vary. So, the above array would give me an answer of 2. Thanks

    Read the article

  • Jquery display image problem

    - by Sergio
    Hello, I have PHP page where users can upload photos (using Ajax & PHP script). Those uploaded photos (thumbs) are shown after upload in DIV below upload field. Then, after hitting send button I want to clone that DIV at that same page at message board, bellow other messages with or without uploaded photos. When I try to do that with: var pht = $("#photos").clone().addClass('p_pht'); and try to display sent photos bellow sent message like this: $("div#wall").append('<div class=msg>'+ message +'</div><div class=n_pht>'+ pht +'</div>'); I get Jquery error message "[object Object]" in place where the photos should be displaying. What am I doing wrong?

    Read the article

  • Mysql data convert

    - by Sergio
    Is it possible to do DATE_SUB( ".$date." , INTERVAL 100 DAY ) if the type of the column where the date is stored is varchar(255) or I need to convert that column to "DATE" type?

    Read the article

  • Must issue a STARTTLS command first. Sending email with Java and Google Apps

    - by Sergio del Amo
    I am trying to use Bill the Lizard's code to send an email using Google Apps. I am getting this error: Exception in thread "main" javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first. f3sm9277120nfh.74 at javax.mail.Transport.send0(Transport.java:219) at javax.mail.Transport.send(Transport.java:81) at SendMailUsingAuthentication.postMail(SendMailUsingAuthentication.java:81) at SendMailUsingAuthentication.main(SendMailUsingAuthentication.java:44) Bill's code contains the next line, which seems related to the error: props.put("mail.smtp.starttls.enable","true"); However, it does not help. These are my import statements: import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; Does anyone know about this error?

    Read the article

  • Jquery .hide problem

    - by Sergio
    I'm using jquery to show animated MSN like window at the bottom of the page. Jquery code: $(document).ready(function() { $(" .inner").stop().animate({height:'142px'},{queue:false, duration:600}); $(' .close').click(function(event) { $(' .inner').hide(); }); $(' .inner').click(function() { location.replace("somepage.php"); }); }); The CSS: .close {height:14px; z-index:100; position: absolute; margin-left:174px; margin-top:12px; border:1px solid #F00;} .inner {position:absolute;bottom:0;width:201px;height:117px;right: 0; margin-right:10px; float:left; z-index:-1; display:block; cursor:pointer;} The problem that I have with this code is that the close button (showing at the right top corner of .inner DIV) can't fire Jquery .hide function. Why?

    Read the article

  • Filter a date property between a begin and end Dates with JDOQL

    - by Sergio del Amo
    I want to code a function to get a list of Entry objects whose date field is between a beginPeriod and endPeriod I post below a code snippet which works with a HACK. I have to substract a day from the begin period date. It seems the condition great or equal does not work. Any idea why I have this issue? public static List<Entry> getEntries(Date beginPeriod, Date endPeriod) { /* TODO * The great or equal condition does not seem to work in the filter below * Substract a day and it seems to work */ Calendar calendar = Calendar.getInstance(); calendar.set(beginPeriod.getYear(), beginPeriod.getMonth(), beginPeriod.getDate() - 1); beginPeriod = calendar.getTime(); PersistenceManager pm = JdoUtil.getPm(); Query q = pm.newQuery(Entry.class); q.setFilter("this.date >= beginPeriodParam && this.date <= endPeriodParam"); q.declareParameters("java.util.Date beginPeriodParam, java.util.Date endPeriodParam"); List<Entry> entries = (List<Entry>) q.execute(beginPeriod,endPeriod); return entries; }

    Read the article

  • Jquery username check

    - by Sergio
    I'm using this Jquery function for available username check. How can I fire this Jquery function only if the username field is greater of 5 characters? Jquery looks like: $(document).ready(function() { $('#usernameLoading').hide(); $('#username').blur(function(){ $('#usernameLoading').show(); $.post("usercheck.php", { un: $('#username').val() }, function(response){ $('#usernameResult').fadeOut(); setTimeout("finishAjax('usernameResult', '"+escape(response)+"')", 400); }); return false; }); }); function finishAjax(id, response) { $('#usernameLoading').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } //finishAjax Can I use something like this and how: var usr = $("#username").val(); if(usr.length >= 5) { }

    Read the article

  • Jquery menu with less code

    - by Sergio
    I'm using Jquery for menu created like: <div class="prof_info1">home</div><div class="prof_info2">info2</div><div class="prof_info3">info3</div> And Jquery code like: $(document).ready(function(){ $(".prof_info1").unbind("click").click(function(event) { $("#main").html('<img src="img/spin.gif" class="spin">'); location.replace("?&id=<?=$id?>") return false; }); $(".prof_info2").unbind("click").click(function(event) { $("#main").html('<img src="img/spin.gif" class="spin">'); $("#main").load('?a=2&id=<?=$id?>'); return false; }); $(".prof_info3").unbind("click").click(function(event) { $("#glavni").html('<img src="img/spin.gif" class="spin">'); $("#glavni").load('?a=3&id=<?=$id?>'); return false; }); }); Is there any easier way to do write this Jquery code and make it with less code? Something like if click somethind{ ... }elseif{ ....}

    Read the article

  • How to check if FORM Realm authentication failed?

    - by Sergio del Amo
    I use FORM Authentication. <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/loginPage.jsp</form-login-page> <form-error-page>/loginPage.jsp</form-error-page> </form-login-config> </login-config> I would like to use the same JSP for my form-login-page and form-error-page, for sake of code reuse. I use a Realm ( org.apache.catalina.realm.JDBCRealm ). In my JSP, I would like to display error messages if the authentication failed. Does Realm store anything in the request, which I could check?

    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

  • xml with special character, encoding utf-8

    - by Sergio Morieca
    I have a few simple questions, because I got confused reading all difference responses. 1) If I have an xml with prolog: and I'm going to unmarshall it with Java (for example: JaXB). I suppose, that I can't put CROSS OF LORRAINE (http://www.fileformat.info/info/unicode/char/2628/index.htm) inside, but I can put "\u2628", correct? 2) I've also heard that UTF-8 doesn't contain it, but anything in Unicode can be saved with encoding UTF-8 (or UTF-16), and here is an example from this page: UTF-8 (hex) 0xE2 0x98 0xA8 (e298a8) Is my reasoning correct? Can I use this form and put it in the xml with utf-8 encoding?

    Read the article

  • Can't find solution for CSS vertical align for Firefox

    - by Sergio
    I have a problem with DIV vertical align in Firefox The HTML code is: <div class="mess"><div class="rpl"><img src="img/16.png" width="16" height="16" border="0"></div><div class="pic"><img src="img/1.png" width="100" height="100" border="0"></div></div> The CSS looks like: .mess{ float:left; width:658px; border-top:1px solid #CCC;padding-top:5px; } .rpl{ position: relative;width:19px; float:left;top: 20%;display: table-cell; vertical- align: middle; padding-top:20px; } .pic{width:100px; float:left; padding-bottom:5px;margin-right:10px; } I'm trying to put "rpl" DIV at the vertical middle of the "mess" DIV. In IE it looks fine but I can't get it right in Firefox (always at the top of the "mess" div) I tried with display: inline,display: table-cell for "rpl" DIV but with no effect in FF. Is there any solution for vertical align for DIV in FF?

    Read the article

  • How to detect a click outside an element?

    - by Sergio del Amo
    I have some html menus, which i show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus area. Is something like this possible with jquery? $("#menuscontainer").clickOutsideThisElement(function() { // hide the menus });

    Read the article

  • Retrieve Grid Id on CellEdit JqGrid

    - by Sergio
    Hi guys, i was trying to do a Cell Editing based on this documentation http://www.trirand.com/jqgridwiki/doku.php?id=wiki:cell_editing I have two questions: How can i get the Index of my row posted to the server: The information i'm getting posted is the following: a) value of the cell b) RowId The thing is that the rowId doesn't help me. I need the actual Id of the information I'm displaying so i can do the server update with that Id. colNames: ['Id', 'Codigo', 'Nombre'], colModel: [ { name: 'Id', index: 'Id', width: 50, align: 'left', hidden: true }, { name: 'Codigo', index: 'Codigo', width: 55, align: 'left', editable: true, editrules: { number: true} }, { name: 'Nombre', index: 'Nombre', width: 200, align: 'left' }], I need the value of the column 'Id' to do my update. 2.I don't understand in the documentation how to manage an error from the server, so I can display the error message. Thank you very much! Notes: a) I've already asked in the forum of trirand, but no one reply it to me. b) If anyone has done this, it would help if help me pasting the code. c) I'm working on MVC 2 Asp.net

    Read the article

  • Jquery and PHP function

    - by Sergio
    How can I this PHP function include in jquery .html? PHP function: function trim_text($string, $limit, $break="<", $pad=" ...") { $words = explode(' ', htmlentities(strip_tags($string))); $countr = count($words); if ($countr <= 8) { return $string; }else{ // return with no change if string is shorter than $limit if(strlen($string) <= $limit) return $string; $string = substr($string, 0, $limit); if(false !== ($breakpoint = strpos($string, $break, $limit))) { if($breakpoint < strlen($string) - 1) { $string = substr($string, 0, $breakpoint) . $pad; } } $last_space = strrpos(substr($string, 0, $limit), ' '); $string = substr($string, 0, $last_space); $string = strip_tags($string); return $string.$pad; } } And the Jquery part of code where I want to in ".html" part somehow call this function is: $(" .text").html('<div>'+ message +'</div>'); What I want to do is trim this "message" text using PHP function. Is it possible?

    Read the article

  • Mysql query problem

    - by Sergio
    I have a problem with (for me to complicated) MySql query. Okay, here is what I need to do: First I need to check messages that some specific user received $mid=$_SESSION['user']; $stat1=mysql_query("SELECT id, fromid, toid, subject FROM messages WHERE toid = '".$mid."' AND subject != 'not readed' GROUP BY fromid ") or die(mysql_error()); while ($h = mysql_fetch_array($stat1)) { $whosend=$h['fromid']; Second thing that I need to do is check the status of the users (deleted or not) who sent the messages ("fromid") to my specific user ("toid"). This I must do from another table: $stat2=mysql_query("SELECT id, status FROM members WHERE id='".$whosend."' AND status ='1'")or die(mysql_error()); while ($s = mysql_fetch_array($stat)) { Then my problems begin to show up. How can I get the number of the users who sent messages to my specific user with status =1? Not the number of the messages but the total number of the users who sent them. Is there any easier way to do this query? I tried with join tables like $stat=mysql_query("SELECT memebers.id, memebers.status, messages.toid, messages.fromid,messages.subject,messages.id FROM members, messages WHERE messages.toid='".$mid."' AND members.status ='7' .... But even in this query I need to have id's of the user who sent messages before this query so there will be another query before this join tables.

    Read the article

  • Controlled execution of computationally expensive tasks

    - by Sergio
    Say you have an application where a user is typing some text and as she types you'd want to perform some expensive computations in the background (related to the text that is being typed). Although you would like to do lots of things, your main priority is that the system responsiveness stay at acceptable levels so the user doesn't notice such a heavy load. Is there a way (ideally platform/language independent) to control what algorithms should be executed in the background based on the system load and responsiveness?

    Read the article

  • How to Digitally Sign PDF files

    - by Sergio
    I have a digital certificate that identifies an user. I need to use it to Digitally sign pdf files. Does anyone have an example that does not uses a third party component? I need to get this done but it would be nice to fully understand how things are done. C# Examples please :)

    Read the article

  • What stage of normalization is this? (moving repeating data into separate table)

    - by Sergio
    Hi There, I have noticed that when designing a database I tend to shift any repeating sets of data into a separate table. For example, say I had a table of people, with each person living in a state. I would then move these repeating states into a separate table and reference them with foreign keys. However, what if I was not storing any more data about states. I would then have a table with StateID and State in. Is this action correct? State is dependant on the primary key of the users table, so does shifting it into its own table help with anything? Thanks,

    Read the article

  • Apache Email trace

    - by Sergio
    I'm using few PHP scripts for sending Email to website members. Is it possible to see at cPanel WHM mail statistic which PHP script was sent specific email using sendmail function? At section "View Relayers" I can see Time Sent, Message ID, Sender, Destination but not the script that fired this sendmail function.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12  | Next Page >