Search Results

Search found 384 results on 16 pages for 'juan carlos coto'.

Page 11/16 | < Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • C# Code Smells. What are the most common and how to fix them?

    - by Carlos Loth
    Hi, One thing I'd like to hear from you guys is what are the code smells that you see most often happen on C# code and how to fix them. I'm working on defining a code-review process for my team and I'd like to include a section with the most common C# code smells and a possible fix for each of them. I'd like the assistance of the community on that, so others can reuse this list for further reference. What are the most common smells you have seen on C# code? How did you fix them?

    Read the article

  • As3 printing problem, blanks swf after print or cancel

    - by Carlos Barbosa
    Hey all! ok back at another issues in as3 printing Code: //Function to print entire screen function printFunction(event:MouseEvent):void { var myPrintJob:PrintJob = new PrintJob(); var oldScaleX:Number = root.scaleX; var oldScaleY:Number = root.scaleY; //Start the print job myPrintJob.start(); //Figure out the new scale var newScaleX:Number = myPrintJob.paperWidth/root.width; var newScaleY:Number = myPrintJob.paperHeight/root.height; //Shrink in both the X and Y directions by the same amount (keep the same ratio) if(newScaleX < newScaleY) newScaleY = newScaleX; else newScaleX = newScaleY; root.scaleX = newScaleX; root.scaleY = newScaleY; //Print the page myPrintJob.addPage(Sprite(root)); myPrintJob.send(); //Reset the scale to the old values root.scaleX = oldScaleX; root.scaleY = oldScaleY; } I cant seem to find anything thats really helpful with this. When i click cancel on the print dialog box, i get error below and it blanks out my swf.

    Read the article

  • Saving several Monticello packages at once

    - by Juan Barreda
    I am working with Pharo Smalltalk. Suppose you want to save your own group of packages into a local repository, you know that your packages are prefixed with "MyPrefix". What's the right message to do it? In code: | myPkgs | myPkgs := MCPackage allInstances select: [: mcPkg | mcPkg name beginsWith: 'MyPrefix' ]. myPkgs do: [ : myPkg | myPkg ??? ]. It would be too difficult to script that one for a web based repository?

    Read the article

  • Google Visualization API Geomap: How to handle marker click events?

    - by Carlos da Costa
    Hello. I initially have the Google Visualization API Geomap on a world view (options['dataMode'] = 'regions') and I capture the 'regionClick' event when a country is clicked like so: google.visualization.events.addListener( geomap, 'regionClick', function (e) { var rowindex = data.getFilteredRows([{column: 0, value: e['region']}]); var location = data.getValue(rowindex[0], 3); location.href = "?ISO=" + e['region'] + "&Location=" + location; }); I then draw the map zoomed into the country in markers mode (options['dataMode'] = 'markers'). However, I can't seem to capture any events when the markers themselves are clicked. The documentation ( http://code.google.com/apis/visualization/documentation/gallery/geomap.html#Events ) only refers to 'select' and 'regionClick' events neither of which are fired in this case. (Tested using Chrome 9, and IE 8.) Has anybody had any success in doing this? Many thanks.

    Read the article

  • Integrating my new program with Windows

    - by Carlos
    I've written a log parser, with some generous and insightful help from the SO community: http://stackoverflow.com/questions/2906630/keeping-the-ui-responsive-while-parsing-a-very-large-logfile Now, I'd like to be able to right click one of these logs, select "MyNewLogParser" from "Open With.." and see it open in my new program. This would require me to Change something about my XP installation to show my program in the dropdown list Change the program so that it knows to open the selected file and run the parsing. What do you call these things, and how is it done? I don't know what to search for...

    Read the article

  • Add an event to HTML elements with a specific class.

    - by Juan C. Rois
    Hello everybody, I'm working on a modal window, and I want to make the function as reusable as possible. Said that, I want to set a few anchor tags with a class equals to "modal", and when a particular anchor tag is clicked, get its Id and pass it to a function that will execute another function based on the Id that was passed. This is what I have so far: // this gets an array with all the elements that have a class equals to "modal" var anchorTrigger = document.getElementsByClassName('modal'); Then I tried to set the addEventListener for each item in the array by doing this: var anchorTotal = anchorTrigger.length; for(var i = 0; i < anchorTotal ; i++){ anchorTrigger.addEventListener('click', fireModal, false); } and then run the last function "fireModal" that will open the modal, like so: function fireModal(){ //some more code here ... } My problem is that in the "for" loop, I get an error saying that anchorTrigger.addEvent ... is not a function. I can tell that the error might be related to the fact that I'm trying to set up the "addEventListener" to an array as oppose to individual elements, but I don't know what I'm supposed to do. Any help would be greatly appreciated.

    Read the article

  • 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

  • Deactivate Air app created in AS3 after next monday?

    - by Carlos Barbosa
    Hi, i have an application deployed in Air, written in AS3 that client wants to install and test, i have developed a simple license app, but he is pushing for a full license witch he said he will fully paid on next monday. How would you create a procedure in AS3 to deactivate application next monday? How secure will it be? will simply changing machine date will bypass this?

    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

  • Getting Segmentation Fault in C++, but why?

    - by Carlos
    I am getting segmentation fault in this code but i cant figure out why. I know a segmentation fault happens when a pointer is NULL, or when it points to a random memory address. #include <iostream> #include <fstream> #include <cmath> using namespace std; //**************************** CLASS ******************************* class Database { struct data{ string city; float latitude, longitude; data *link; }*p; public: Database(); void display(); void add(string cityName, float lat, float lon); private: string cityName; float lat, lon; }; //************************** CLASS METHODS ************************** Database::Database() { p = NULL; } void Database::add(string cityName, float lat, float lon){ data *q, *t; if(p == NULL){ p = new data; p -> city = cityName; p -> latitude = lat; p -> longitude = lon; p -> link = NULL; } else{ q = p; while(q -> link != NULL){ q = q -> link; } t = new data; t -> city = cityName; t -> latitude = lat; t -> longitude = lon; q -> link = t; } } void Database::display() { data *q; cout<<endl; for( q = p ; q != NULL ; q = q->link ) cout << endl << q -> city; } //***************************** MAIN ******************************* //*** INITIALIZATION *** Database D; void loadDatabase(); //****** VARIABLES ***** //******* PROGRAM ****** int main() { loadDatabase(); D.display(); } void loadDatabase() { int i = 0; string cityName; float lat, lon; fstream city; city.open("city.txt", ios::in); fstream latitude; latitude.open("lat.txt", ios::in); fstream longitude; longitude.open("lon.txt", ios::in); while(!city.eof()){ //************************************ city >> cityName; //* * latitude >> lat; //Here is where i think is the problem longitude >> lon; //* * D.add(cityName, lat, lon); //************************************ } city.close(); latitude.close(); longitude.close(); } This is the error am actually getting in console

    Read the article

  • How does TopCoder evaluates code?

    - by Carlos
    If you are familiar with TopCoder you know that your source-code gets a final "grade/points" this depends on time, how many compiles, etc, one of the highest weighted being performance. But how can they test that, is there some sort of simple code (java or c++) to do it that you could share for me to evaluate and hopefully write my own to test the programs I write for University? This is sort of a follow up question to this one where I ask if shorter code results in best performance. P.S: Im interested in both of how topcoders knows performance and writing code to test performance.

    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

  • Regex problem ...

    - by carlos
    hello i have the next regex Dim origen As String = " /c /p:""c:\mis doc umentos\mis imagenes construida\archivo.txt"" /cid:45 423 /z:65 /a:23 /m:39 /t:45rt " Dim str As String = "(^|\s)/p:""\w:(\\(\w+[\s]*\w+)+)+\\\w+.\w+""(\s|$)" Dim ar As Integer Dim getfile As New Regex(str) Dim mgetfile As MatchCollection = getfile.Matches(origen) ar = mgetfile.Count When i evaluate this it works, and gets the /p:""c:\mis doc umentos\mis imagenes construida\archivo.txt"" that basically is the path to a file. But if I change the origen string to Dim origen As String = " /c /p:""c:\mis doc umentos\mis imagenes construida\archivo.txt""/cid:45 423 /z:65 /a:23 /m:39 /t:45rt " Check that the end of the file is follow by "/cid:45" whitchs makes de patter invalid, but insted of getting a mgetfile.count = 0 the program is block, if i make a debug I got a property evaluation failed. Thanks for your comments !!!

    Read the article

  • What's the life-time of a thread-local value in Python?

    - by Carlos Valiente
    import threading mydata = threading.local() def run(): # When will the garbage collector be able to destroy the object created # here? After the thread exits from ``run()``? After ``join()`` is called? # Or will it survive the thread in which it was created, and live until # ``mydata`` is garbage-collected? mydata.foo = object() t = threading.Thread(target=run) t.start() t.join()

    Read the article

  • SQl Server: serializable level not working

    - by Zé Carlos
    I have the following SP: CREATE PROCEDURE [dbo].[sp_LockReader] AS BEGIN SET NOCOUNT ON; begin try set transaction isolation level serializable begin tran select * from teste commit tran end try begin catch rollback tran set transaction isolation level READ COMMITTED end catch set transaction isolation level READ COMMITTED END The table "test" has many values, so "select * from teste" takes several seconds. I run the sp_LockReader at same time in two diferent query windows and the second one starts showing test table contents without the first one terminates. Shouldn't serializeble level forces the second query to wait? How do i get the described behaviour? Thanks

    Read the article

  • factory girl - know when an attribute is overridden in factory

    - by carlos
    Is there any way to determine if attributes are overridden in a factory and adjust the behavior of the factory based on those overrides? The evaluator passed into the callbacks contains a __override_names__ method. Unfortunately, by the time it is passed to the callback, every attribute configured by the factory is included in the array returned. Moreover, the Evaluator is marked as api private.

    Read the article

  • How can I tell which TextBox had focus last?

    - by Carlos
    I have an MVVM application with various TextBox controls and a virtual keypad. (This application is to run on a touch screen system, with no keyboard). To change the value of a TextBox, the user has to touch the TextBox and then use the virtual keypad to enter a number. How can my VM know which TextBox to change when it gets the command from the keypad?

    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

  • access custom group

    - by Carlos
    I have my Access 2007 database configured to use "Custom" groups in the navigation pane. I've grouped all my tables in a way that makes sense. However, whenever I update a link table, it loses its grouping. I have not been able to find a way to avoid this. Since it seems to be unavoidable, I'd like to simply have a macro that adds the table back to the right group programatically. I have not found any examples on how to do this. Any suggestions?

    Read the article

  • ASP.NET 4.0 Route expression builder inside Listview control

    - by Carlos Lone
    One of the features of ASP.NET 4.0 is Route Expression builder which allows you to set up hyperlinks like this: <asp:HyperLink runat="server" NavigateUrl="<%$ RouteUrl:RouteName=productos,categoria=Cereales,id=2 %>" >Productos</asp:HyperLink> Now I'm wondering if I can use this sort of syntax inside a ListView Control, I know is possible, but the tricky thing is that I want to genereate de route key value dynamically. So instead to write id=2 I would like to write id=<%# Eval("CategoryID") % . Can I do that?, if so, how should I write it. Thanks for your help!

    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

  • 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

  • Algorithm for generating an array of non-equal costs for a transport problem optimization

    - by Carlos
    I have an optimizer that solves a transportation problem, using a cost matrix of all the possible paths. The optimiser works fine, but if two of the costs are equal, the solution contains one more path that the minimum number of paths. (Think of it as load balancing routers; if two routes are same cost, you'll use them both.) I would like the minimum number of routes, and to do that I need a cost matrix that doesn't have two costs that are equal within a certain tolerance. At the moment, I'm passing the cost matrix through a baking function which tests every entry for equality to each of the other entries, and moves it a fixed percentage if it matches. However, this approach seems to require N^2 comparisons, and if the starting values are all the same, the last cost will be r^N bigger. (r is the arbitrary fixed percentage). Also there is the problem that by multiplying by the percentage, you end up on top of another value. So the problem seems to have an element of recursion, or at least repeated checking, which bloats the code. The current implementation is basically not very good (I won't paste my GOTO-using code here for you all to mock), and I'd like to improve it. Is there a name for what I'm after, and is there a standard implementation? Example: {1,1,2,3,4,5} (tol = 0.05) becomes {1,1.05,2,3,4,5}

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >