Search Results

Search found 341 results on 14 pages for 'juan diego'.

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

  • Rails 3 Timezone error

    - by Juan
    I am struggling with time zone support in Rails 3 beta and I would like to know if it is a bug or if I am doing something wrong. He is the problem: > Time.zone = 'Madrid' # it is GMT+2 = "Madrid" > c = Comment.new = #<Comment id: nil, title: "", pub_at: nil> > c.pub_at = Time.zone.parse('10:00:00') = Mon, 31 May 2010 10:00:00 CEST +02:00 > c.save > c = #<Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00"> > c.reload = #<Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00"> ruby-1.8.7-p249 c.pub_at = Mon, 31 May 2010 13:00:00 CEST +02:00 As you can see, the pub_at attribute is stored correctly in the database but when it is retrieved it adds 3 hours and I suspect that it is because it is using my local machine timezone that is in GMT-3. The same sequence of commands in rails 2.3.5 works perfectly. Any toughts? Should I report a ticket?

    Read the article

  • my first shader in WebGL

    - by Diego
    Hello, I am writing my first shader in WebGL. I was wondering if the GLSL language has any way to evaluate if an attribute or a uniform is null. According to the specs it does not support to do something like if (attributeX) { dothis(); } else{ dothat(): } And I think it would be a waste to write a bool attribute for each of these cases would be a waste. Another question: what happen during rendering when you don't pass along the uniforms or attribs to the shader? Thanks!

    Read the article

  • Double postback problem

    - by Juan Manuel Formoso
    Hi, I have a ASP.NET 1.1 application, and I'm trying to find out why when I change a ComboBox which value is used to fill another one (parent-child relation), two postbacks are produced. I have checked and checked the code, and I can't find the cause. Here are both call stacks which end in a page_load First postback (generated by teh ComboBox's autopostback) Second postback (this is what I want to find why it's happening) Any suggestion? What can I check?

    Read the article

  • How to use regular expressions to pull a substring? (screen scraping)

    - by Diego
    Hey guys, i'm really trying to understand regular expressions while scraping a site, i've been using it in my code enough to pull the following, but am stuck here. I need to quickly grab this: http://www.example.com/online/store/TitleDetail?detail&sku=123456789 from this: ('<a href="javascript:if(handleDoubleClick(this.id)){window.location=\'http://www.example.com/online/store/TitleDetail?detail&sku=123456789\';}" id="getTitleDetails_123456789">\r\n\t\t\t \tcheck store inventory\r\n\t\t\t </a>', 1) This is where I got confused. any ideas?

    Read the article

  • Multidimensional array (parent and childs)

    - by Juan
    I have a category system in a MySQL database with parents and childs. The database only stores the id of it''s immediate parent (or 0 if on root). Since the system allows multiple subcategories there are cases of multiple childs. For example [98] Storage [1] External [3] Pendrives [4] Portable hhdds [2] Internal [5] Sata hhdd [6] IDE hhdd [...] [99] Clothing The database would be id parent_id name 1 98 External 2 98 Internal 3 1 Pendrives 4 1 Portable 5 2 Sata 6 2 IDE 98 0 Storage 99 0 Clothing I also have a products table with a category id and I need to get a list of all the products in the first level of categories. For example: Product Category A 3 B 4 C 5 D 6 E 74 Should return 98: A, B, C, D 99: X, Y, Z... I'm stuck and I can't think of the logic to retrieve it in that way. I started by getting the IDs of all the categories that aren't in the first level by: while ($row = mysql_fetch_assoc($result)) { if ($row['parent_id'] != 0) { $level1[$i]['name'] = utf8_encode($row['categories_name']); $level1[$i]['id'] = $row['categories_id']; } $i++; } but I'm having a burnout and can't think of a way that would nest them. I thought some kind of while but it's infinite :P Any ideas please?

    Read the article

  • log4net one file per run

    - by Diego Mijelshon
    I need my application to create a log file each time it runs. My preferred format would be App.log.yyyy-MM-dd_HH-mm-ss. If that's not possible, I'd settle for App.log.yyyy-MM-dd.counter This is my current appender configuration: <appender name="File" type="log4net.Appender.RollingFileAppender"> <file value="App.log"/> <rollingStyle value="Date"/> <datePattern value=".yyyy-MM-dd_HH-mm-ss"/> <staticLogFileName value="false"/> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> </appender> But it creates a random number of files based on the date and time.

    Read the article

  • Asp.net MVC Ajax form that return Json to a javascript method.

    - by Diego Correa
    Hello guys, I have an ajax form that saves a object in the database then return a Message like this: return Json(new {Message = "Message!"}, JsonRequestBehavior.AllowGet); We are ok here, but I don't know HOW I'll get this result in the view to display in a jQuery modal. My ajax form is like the following and I want to get the result on the OnSuccess method: <%using (Ajax.BeginForm("Form", "Controller", new AjaxOptions() { OnSuccess = "MethodThatIWantToGetTheJson" })) Any ideas?

    Read the article

  • AddEvenLister fires off immediately after being attached

    - by Diego
    I want to know how to correctly add an Event Listener like onClick to a dynamic div. Here’s my snippet: var $menu = new Array(2); createDiv('yes'); function createDiv(title) { var $class = 'menuLink'; var $title = 'title'; for(var i=0; i<$menu.length;i++) { $title = 'title'; var newdiv = document.createElement('div'); newdiv.setAttribute('class', $class); newdiv.setAttribute('id', 'item'+i); newdiv.addEventListener('onclick', clickHandle(newdiv.id),false); if (title) { newdiv.innerHTML = $title; } else { newdiv.innerHTML = "No Title"; } document.getElementById('menu').appendChild(newdiv); showMenu(); } } function clickHandle(e) { if(e == 'item0') { alert('Link is' + ' ' + e); }else{ alert('Another Link'); } } Here's my problem, the snippet works fine, It creates my divs, adds id's values and all, but the event fires off as soon as the event is attached, so while the for loop is creating the divs the alert window says: Link is item0, and immediately after this it says: Another Link. Am I misunderstanding this? (I used this method zillions of times in AS3 with the expected result, just attached a function waiting for a click). What I want is that my Divs wait for the user to click on them, not to fire off immediately after of being attached. Thanks for any hint on this one. Greetings. Ps. IE doesn't support addEventListener, but I want to resolve this before cross to the IE sea of madness, but I will appreciate the IE approach as well. - I tried "onclick" and just 'click' into the addEventListener line, both with the same result described above.

    Read the article

  • How mature is java.lang.instrument?

    - by Juan Tamayo
    Hi Everyone, I'll be working on a project for instrumenting a relatively complex java application, and I'm planning to use java.lang.instrument to hook into the JVM and redefine classes before they're loaded. What is your take on this package? Is it well supported across JVMs? Does it work well with Hotspot? Thanks!

    Read the article

  • UUID collision risk using different algorithms

    - by Diego Jancic
    Hi Guys, I have a database where 2 (or maybe 3 or 4) different applications are inserting information. The new information has IDs of the type GUID/UUID, but each application is using a different algorithm to generate the IDs. For example, one is using the NHibernate's "guid.comb", other is using the SQLServer's NEWID(), other might want to use .NET's Guid.NewGuid() implementation. Is there an above normal risk of ID collision or duplicates? Thanks!

    Read the article

  • Question about DispatcherUnhandledException

    - by Diego Pacheco
    The problem in this code is that when it's run and I push "Yes" button, This is shown: This means that my application stopped working, I just want it to end. private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { string message = "An unhandled exception has ocurred, do you want close the app?"; MessageBoxResult currentMB = MessageBox.Show(message, "SomeTitleApp", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (currentMB == MessageBoxResult.Yes) { Application.Current.Shutdown(); } else { e.Handled = true; } }

    Read the article

  • Apply dynamic list of templates to an argument

    - by Diego Martinez
    I need apply a variable sequence of templates to an argument. example 1: arg:tpl1():tpl2():...:tplN() Suppose that i have other multi valued argument, and each value is the name for a dynamic template invocation. ¿What is the better form of apply all the templates from the list to my argument? tplNames : {name | <(name)(arg)>} not works, just apply a template ever to the same innitial value of my argument, i need the same result of example 1 but in a dynamic way. Thank you!!

    Read the article

  • Suddenly Facebook API stopped working on Windows Phone

    - by Juan Diego
    My code hasn't changed, it was working yesterday or so. I can oauth, get the token but then doing the following: WebClient wc = new WebClient(); wc.DownloadStringCompleted += result; wc.DownloadStringAsync(new Uri("https://graph.facebook.com/me&access_token=xxxTOKENxxx", UriKind.Absolute)); Returns a NotFound WebClient exception: "The remote server returned an error: NotFound." Strange thing is that when pasting that same url on Chrome or IE it does work(PC). Tried on Emulator and on 2 different real WP devices, even pasting the same url on the WP browser. Feels like facebook is rejecting Windows Phone for some reason? Anyone has an idea of what might be happening?

    Read the article

  • Optimize slow ranking query

    - by Juan Pablo Califano
    I need to optimize a query for a ranking that is taking forever (the query itself works, but I know it's awful and I've just tried it with a good number of records and it gives a timeout). I'll briefly explain the model. I have 3 tables: player, team and player_team. I have players, that can belong to a team. Obvious as it sounds, players are stored in the player table and teams in team. In my app, each player can switch teams at any time, and a log has to be mantained. However, a player is considered to belong to only one team at a given time. The current team of a player is the last one he's joined. The structure of player and team is not relevant, I think. I have an id column PK in each. In player_team I have: id (PK) player_id (FK -> player.id) team_id (FK -> team.id) Now, each team is assigned a point for each player that has joined. So, now, I want to get a ranking of the first N teams with the biggest number of players. My first idea was to get first the current players from player_team (that is one record top for each player; this record must be the player's current team). I failed to find a simple way to do it (tried GROUP BY player_team.player_id HAVING player_team.id = MAX(player_team.id), but that didn't cut it. I tried a number of querys that didn't work, but managed to get this working. SELECT COUNT(*) AS total, pt.team_id, p.facebook_uid AS owner_uid, t.color FROM player_team pt JOIN player p ON (p.id = pt.player_id) JOIN team t ON (t.id = pt.team_id) WHERE pt.id IN ( SELECT max(J.id) FROM player_team J GROUP BY J.player_id ) GROUP BY pt.team_id ORDER BY total DESC LIMIT 50 As I said, it works but looks very bad and performs worse, so I'm sure there must be a better way to go. Anyone has any ideas for optimizing this? I'm using mysql, by the way. Thanks in advance Adding the explain. (Sorry, not sure how to format it properly) id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t ALL PRIMARY NULL NULL NULL 5000 Using temporary; Using filesort 1 PRIMARY pt ref FKplayer_pt77082,FKplayer_pt265938,new_index FKplayer_pt77082 4 t.id 30 Using where 1 PRIMARY p eq_ref PRIMARY PRIMARY 4 pt.player_id 1 2 DEPENDENT SUBQUERY J index NULL new_index 8 NULL 150000 Using index

    Read the article

  • Datatypes for physics

    - by Juan Manuel Formoso
    Hi, I'm currently designing a program that will involve some physics (nothing too fancy, a few balls crashing to each other) What's the most exact datatype I can use to represent position (without a feeling of discrete jumps) in c#? Also, what's the smallest ammount of time I can get between t and t+1? One tick? EDIT: Clarifying: What is the smallest unit of time in C#? [TimeSpan].Tick?

    Read the article

  • How do I show an embedded excel file in a WebPage?

    - by Juan Manuel Formoso
    I want to allow an Excel report to be viewed embedded in a WebPage... is there a way? I don't want to use an ActiveX, or OWC (Office Web Components), I just want to open an existing file from the internet explorer application. I don't want users to download and then open it. Using an iframe wouldn't be a problem, but my preliminary tests weren't successful Any ideas? Is it at all possible?

    Read the article

  • How can I get the assembly last modified date?

    - by Juan Manuel Formoso
    I want to render (for internal debugging/info) the last modified date of an assembly, so I know when was a certain website deployed. Is it possible to get it though reflection? I get the version like this, I'm looking for something similar: Assembly.GetExecutingAssembly().GetName().Version.ToString(); ie: I don't want to open the physical file, get its properties, or something like that, as I'll be rendering it in the master page, and don't want that kind of overhead.

    Read the article

  • Magento - Mage::getModel not working on remote server

    - by Diego
    I'm struggling with an issue for which I can't find an explanation. I have two development environments that I use for my projects. I created a simple module for Magento and I tested it on one environment. After overcoming all Magento's complications, the module works as expected. This is on XAMPP. I then copied the module to the development Linux environment, on a hosted server, and it crashes miserably. I did some debugging, and I found out that a call to Mage::getModel() returns bool(false) instead of the instance of the Model I requested. I double checked all files and directories, and they match. Database is not involved (not from my side, at least, I don't need tables) and both environments have only me as a User, with Admin permissions. Any suggestion on where should I start looking is welcome, thanks.

    Read the article

  • How to justify text on a TextView made easy- Android

    - by Juan
    I'm looking for a simple way to forget that I'm using a WebView to have justified text in my TextView. Has someone made a custom view for this? I'm well aware that I can do something like this: WebView view = new WebView(this); view.loadData("my html with text justification","text/html","utf-8"); But it gets ugly when you want to set the size, the color or other common properties of the TextView, there must be a more convenient way of doing it.

    Read the article

  • GridView to excel after create send mail c#

    - by Diego Bran
    I want to send a .xlsx , first I created (It has html code in it) then I used a SMTP server to send it , it does attach the file but when I tried to open it " It says that the file is corrupted etc" any help? Here is my code try { System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); // Render grid view control. gvStock.RenderControl(htw); // Write the rendered content to a file. string renderedGridView = sw.ToString(); File.WriteAllText(@"C:\test\ExportedFile.xls", renderedGridView); // File.WriteAllText(@"C:\test\ExportedFile.xls", p1); } catch (Exception e) { Response.Write(e.Message); } try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("server"); mail.From = new MailAddress("[email protected]"); mail.To.Add("[email protected]"); mail.Subject = "Test Mail - 1"; mail.Body = "mail with attachment"; Attachment data = new Attachment("C:/test/ExportedFile.xls"); mail.Attachments.Add(data); SmtpServer.Port = 25; SmtpServer.Credentials = new System.Net.NetworkCredential("user", "pass"); // SmtpServer.EnableSsl = true; SmtpServer.UseDefaultCredentials = false; SmtpServer.Send(mail); } catch( Exception e) { Response.Write(e.Message); }

    Read the article

  • Twitter api and retweets

    - by Juan Manuel
    I'm trying to get the last tweet from the people I follow using the twitter api (http://api.twitter.com/1/statuses/friends.json&screen_name=[username]), but I noticed that if the user's last tweet is a retweet, the json data does not contain a "status" element. Using the "user timeline" api does not work either, the last tweet is the last non retweeted tweet. Is there a way to get the real last status, even if it's a RT, through the twitter API?

    Read the article

  • How can I do these operations in C?

    - by Juan Antonio
    Hello, I'm converting some assembly code to C to be able to use it with the current compiler environment I have to work with. I've reached 2 operations I don't know how to translate to C. Anyone know how to do it? In both, offset is an unsigned 32-bit integer and shift is a signed integer value. C_FLAG is a bool. OP1: __asm { __asm mov ecx, shift __asm ror offset, cl } OP2: __asm { __asm bt dword ptr C_FLAG, 0 __asm rcr offset, 1 } Thank you very much for your expertise. P.S.: I'm not the original developer, nor I have seen many x86 assembly code...

    Read the article

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