Search Results

Search found 60 results on 3 pages for 'luiz claudio duarte'.

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

  • dynamically double image size

    - by Edan Duarte
    I have an embarrassingly simple question: How can I display an image at double its size without hard coding the width and height attributes? Here's what I tried, but I ended up having to just enter 1000 for width and height. Is something wrong with my function? Thanks! <img onload="double(self.id);" name="bigPic" id="bigPic" src="album1.jpg" height="1000" width="1000"/> function double(id) { var img = document.getElementById(id); var dblWdth = img.width * 2; var dblHt = img.height * 2; img.height = dblHt; img.width = dblWdth; }

    Read the article

  • OpenId + Facebook Connect

    - by Claudio Redi
    Hi! I have a request for implementing a login system using local credentials + openId + facebook-connect. So a user could sign up/sign in using any of the 3 possibilities. I think that allowing OpenId AND facebook connect adds some flexibility in one had, but in other hand adds some restrictions since you have to integrate all different logic and make existing differences transparent for users. What do you think? Any good reference for managing federated login using both external mechanisms? Any well known site doing it right now?

    Read the article

  • Iphone NsMutableArray Count

    - by Claudio
    I have a struct SystemStruct *sharedStruct = [SystemStruct sharedSystemStruct]; implemented as a singleton, to share 3 Arrays. the problem is that when i try to count the array's objects the system crash. es: This code Crash: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { SystemStruct *SharedStruct = [SystemStruct sharedSystemStruct]; return SharedStruct.path.count; } This Code Work: SystemStruct *SharedStruct = [SystemStruct sharedSystemStruct]; NSLog(@"%d", SharedStruct.path.count); How can i return the correct array count?

    Read the article

  • Wrong line number on stack trace

    - by Claudio Redi
    Hi! I have this code try { //AN EXCEPTION IS GENERATED HERE!!! } catch { SqlService.RollbackTransaction(); throw; } Code above is called in this code try { //HERE IS CALLED THE METHOD THAT CONTAINS THE CODE ABOVE } catch (Exception ex) { HandleException(ex); } The exception passed as parameter to the method "HandleException" contains the line number of the "throw" line in the stack trace instead of the real line where the exception was generated. Anyone knows why this could be happening?

    Read the article

  • Does Chrome always adds an XLS extension on a vnd.ms-excel mime type?

    - by Claudio
    It seems that a simple download of a PHP generated CSV file (with a vnd.ms-excel mime type for the sake of opening it with (Open)Office readly upon the "Save as..." dialog, when present) always gets the unwanted .xls extension when the UA is Google Chrome. The file would then be named as myfile.csv.xls. Firefox behaves correctly. I wonder if it is a bug, a feature or a misunderstanding of some references. Thank you.

    Read the article

  • Matplotlib and WSGI/mod_python not working on Apache.

    - by Luiz C.
    Everything works as supposed to on the Django development server. In Apache, the django app also works except when matplotlib is used. Here's the error I get: No module named multiarray. Exception Type: ImportError Exception Value: No module named multiarray Exception Location: /usr/share/pyshared/numpy/core/numerictypes.py in <module>, line 81 Python Executable: /usr/bin/python Python Version: 2.6.4 From the python shell, both statements work: import numpy.core.multiarray and import multiarray. Any ideas? Thanks As I'm looking over the numpy files, I found the multiarray module, which has an extension of 'so'. My guess, is that mod_python is not reading these files.

    Read the article

  • Convert string to JSON using Python

    - by Luiz Fernando
    Hi, I'm a little bit confused with JSON in Python. To me, it seems like a dictionary, and for that reason I'm trying to do that: json = """{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } } """ But when I do print dict(json), it gives an error. How can I transform this string into a structure and then call json["title"] to obtain "example glossary"? Thanks.

    Read the article

  • IFrame causing javascript code to not execute

    - by Claudio Redi
    Does anyone know why this code doesn't work. This means, the alert is NOT fired <iframe/> <script type="text/javascript">alert('hello');</script> While this code with the alert BEFORE the Iframe works perfeclty. This means the alert is fired <script type="text/javascript">alert('hello');</script> <iframe/> Seems that no javascript placed after the iframe is executed, I don't find any logic to this.

    Read the article

  • How to access an array collection that within another?

    - by luiz
    Example, I have the field named city in the Customers table, and a table named cities I attach the table values town in the city, namely: city id = 15 sao paulo to cities It aims to do this, pulling the two array collection and then working in action script and putting the datagrid? Thanks in advance, ha days looking for the solution.

    Read the article

  • Python encoding - Nothing works

    - by Luiz Fernando
    I've been looking the answers here in this web site, but nothing have worked so far. The problem is: In the database, strings are saved like that one: at &#8730;s = 7 TeV with. And the reason is that the "escape" JavaScript function was used. I was not able to "unescape" these strings in Python yet. I tried to use "eval", "decode", "re.sub" and others, but without success. So please, which function can I use to get it right?

    Read the article

  • Calculate and display distance between userlocation and known point in Table View

    - by Claudio
    Hi, I have a table view with a list of hotel, and i want put in cell.detailTextLabel.text the distance beetween userlocation and hotel. How can obtain the coordinates of userlocation? I see on web that i need to use CLLocationManager but i don't understand how and where implement in my table view. Then,to get the distance,i do a "getDistancefrom" between userLocation and the coordinates of the hotel ? Thanks

    Read the article

  • PHPUnit: Testing if a protected method was called

    - by Luiz Damim
    I´m trying to test if a protected method is called in a public interface. <?php abstract class SomeClassAbstract { abstract public foo(); public function doStuff() { $this->_protectedMethod(); } protected function _protectedMethod(); { // implementation is irrelevant } } <?php class MyTest extends PHPUnit_Framework_TestCase { public function testCalled() { $mock = $this->getMockForAbstractClass('SomeClass'); $mock->expects($this->once()) ->method('_protectedMethod'); $mock->doStuff(); } } I know it is called correctly, but PHPUnit says its never called. The same happens when I test the other way, when a method is never called: <?php abstract class AnotherClassAbstract { abstract public foo(); public function doAnotherStuff() { $this->_loadCache(); } protected function _loadCache(); { // implementation is irrelevant } } <?php class MyTest extends PHPUnit_Framework_TestCase { public function testCalled() { $mock = $this->getMockForAbstractClass('AnotherClass'); $mock->expects($this->once()) ->method('_loadCache'); $mock->doAnotherStuff(); } } The method is called but PHPUnit says that it is not. What I´m doing wrong? Edit I wasn´t declaring my methods with double colons, it was just for denoting that it was a public method (interface). Updated to full class/methods declarations. Edit 2 I should have said that I´m testing some method implementations in an abstract class (edited the code to reflect this). Since I can not instantiate the class, how can I test this? I´m thinking in creating an SomeClassSimple extending SomeClassAbstract and testing this one instead. Is it the right approach?

    Read the article

  • AuthenticationType Negotiate vs NTLM

    - by Claudio Redi
    I have the same code base used on 2 different sites hosted on the same server (IIS 7.5). For some reason, when I check the Identity.AuthenticationType property on the code behind of an http handler I see NTLM for 1 site and Negotiate for the other. This is causing some problems and I need both of them to use NTLM. Could you help me to figure out why this difference? So far I see both IIS sites are configured on the same way but of course there is at least 1 difference that I couldn't detect. Thanks!

    Read the article

  • How to pass an array in AS3 to an array in php?

    - by luiz
    Hello friends, I have the following array as3 example: var arrayDefinitionsargsAmfPhp:Array = new Array(); arrayDefinitionsargsAmfPhp['tabela'] = "controls"; arrayDefinitionsargsAmfPhp['width'] = "100"; sending him to the remote object for php, example: async = bridge.getOperation(amfphpFunction).send(arrayDefinitionsargsAmfPhp); In php I try to get the array like this: function retornamenu($tableInBd) { $arr = array($tableInBd); $tableInBdname = $arr['tabela']; $widthInBdname = $arr['width']; But unfortunately these variables $tableInBdname and $widthInBdname not come to php, can someone help me with an example? Thank already

    Read the article

  • Connecting an overloaded PyQT signal using new-style syntax

    - by Claudio
    I am designing a custom widget which is basically a QGroupBox holding a configurable number of QCheckBox buttons, where each one of them should control a particular bit in a bitmask represented by a QBitArray. In order to do that, I added the QCheckBox instances to a QButtonGroup, with each button given an integer ID: def populate(self, num_bits, parent = None): """ Adds check boxes to the GroupBox according to the bitmask size """ self.bitArray.resize(num_bits) layout = QHBoxLayout() for i in range(num_bits): cb = QCheckBox() cb.setText(QString.number(i)) self.buttonGroup.addButton(cb, i) layout.addWidget(cb) self.setLayout(layout) Then, each time a user would click on a checkbox contained in self.buttonGroup, I'd like self.bitArray to be notified so I can set/unset the corresponding bit in the array. For that I intended to connect QButtonGroup's buttonClicked(int) signal to QBitArray's toggleBit(int) method and, to be as pythonic as possible, I wanted to use new-style signals syntax, so I tried this: self.buttonGroup.buttonClicked.connect(self.bitArray.toggleBit) The problem is that buttonClicked is an overloaded signal, so there is also the buttonClicked(QAbstractButton*) signature. In fact, when the program is executing I get this error when I click a check box: The debugged program raised the exception unhandled TypeError "QBitArray.toggleBit(int): argument 1 has unexpected type 'QCheckBox'" which clearly shows the toggleBit method received the buttonClicked(QAbstractButton*) signal instead of the buttonClicked(int) one. So, the question is, how can we specify, using new-style syntax, that self.buttonGroup emits the buttonClicked(int) signal instead of the default overload - buttonClicked(QAbstractButton*)?

    Read the article

  • Improving performance in this query

    - by Luiz Gustavo F. Gama
    I have 3 tables with user logins: sis_login = administrators tb_rb_estrutura = coordinators tb_usuario = clients I created a VIEW to unite all these users by separating them by levels, as follows: create view `login_names` as select `n1`.`cod_login` as `id`, '1' as `level`, `n1`.`nom_user` as `name` from `dados`.`sis_login` `n1` union all select `n2`.`id` as `id`, '2' as `level`, `n2`.`nom_funcionario` as `name` from `tb_rb_estrutura` `n2` union all select `n3`.`cod_usuario` as `id`, '3' as `level`, `n3`.`dsc_nome` as `name` from `tb_usuario` `n3`; So, can occur up to three ids repeated for different users, which is why I separated by levels. This VIEW is just to return me user name, according to his id and level. considering it has about 500,000 registered users, this view takes about 1 second to load. too much time, but is becomes very small when I need to return the latest posts on the forum of my website. The tables of the forums return the user id and level, then look for a name in this VIEW. I have registered 18 forums. When I run the query, it takes one second for each forum = 18 seconds. OMG. This page loads every time somebody enter my website. This is my query: select `x`.`forum_id`, `x`.`topic_id`, `l`.`nome` from ( select `t`.`forum_id`, `t`.`topic_id`, `t`.`data`, `t`.`user_id`, `t`.`user_level` from `tb_forum_topics` `t` union all select `a`.`forum_id`, `a`.`topic_id`, `a`.`data`, `a`.`user_id`, `a`.`user_level` from `tb_forum_answers` `a` ) `x` left outer join `login_names` `l` on `l`.`id` = `x`.`user_id` and `l`.`level` = `x`.`user_level` group by `x`.`forum_id` asc USING EXPLAIN: id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 Using temporary; Using filesort 1 PRIMARY <derived4> ALL NULL NULL NULL NULL 530415 4 DERIVED n1 ALL NULL NULL NULL NULL 114 5 UNION n2 ALL NULL NULL NULL NULL 2 6 UNION n3 ALL NULL NULL NULL NULL 530299 NULL UNION RESULT ALL NULL NULL NULL NULL NULL 2 DERIVED t ALL NULL NULL NULL NULL 3 3 UNION r ALL NULL NULL NULL NULL 3 NULL UNION RESULT ALL NULL NULL NULL NULL NULL Somebody can help me or give a suggestion?

    Read the article

  • Translate model fields' attributes from a Database with Django?

    - by Luiz C.
    I'm trying to create a Model that has fields that have the following attributes translatable: verbose_name and choices. I can easily do this by tagging the strings and using the i18l middleware. The problem is that I don't want to define the translation in po/mo files. Is there a way to pull this data from a database table? If so, any examples? There are some options out there that offer model content translation. That is not my case. I need to translate the verbose_name, choices and error_messages from database.

    Read the article

  • Best options for image resizing

    - by Claudio Redi
    Hi, I have resize images exceeding a max size. Methods I tried so far are not good enough :-( System.Drawing.Image.GetThumbnailImage generates very poor quality images in general. Playing with options like this one I can generate better images in quality but heavier than the original one. Probably the second option (or something similar) is the best option and I would need to resize using the proper options. Any advice?

    Read the article

  • DFS Backtracking with java

    - by Cláudio Ribeiro
    I'm having problems with DFS backtracking in an adjacency matrix. Here's my code: (i added the test to the main in case someone wants to test it) public class Graph { private int numVertex; private int numEdges; private boolean[][] adj; public Graph(int numVertex, int numEdges) { this.numVertex = numVertex; this.numEdges = numEdges; this.adj = new boolean[numVertex][numVertex]; } public void addEdge(int start, int end){ adj[start-1][end-1] = true; adj[end-1][start-1] = true; } List<Integer> visited = new ArrayList<Integer>(); public Integer DFS(Graph G, int startVertex){ int i=0; if(pilha.isEmpty()) pilha.push(startVertex); for(i=1; i<G.numVertex; i++){ pilha.push(i); if(G.adj[i-1][startVertex-1] != false){ G.adj[i-1][startVertex-1] = false; G.adj[startVertex-1][i-1] = false; DFS(G,i); break; }else{ visited.add(pilha.pop()); } System.out.println("Stack: " + pilha); } return -1; } Stack<Integer> pilha = new Stack(); public static void main(String[] args) { Graph g = new Graph(6, 9); g.addEdge(1, 2); g.addEdge(1, 5); g.addEdge(2, 4); g.addEdge(2, 5); g.addEdge(2, 6); g.addEdge(3, 4); g.addEdge(3, 5); g.addEdge(4, 5); g.addEdge(6, 4); g.DFS(g, 1); } } I'm trying to solve the euler path problem. the program solves basic graphs but when it needs to backtrack, it just does not do it. I think the problem might be in the stack manipulations or in the recursive dfs call. I've tried a lot of things, but still can't seem to figure out why it does not backtrack. Can somebody help me ?

    Read the article

  • How to show a UINavigationController with an UIButton on the Iphone?

    - by Claudio
    Hi, in my application the first view is an UIView with a couple of uilabel and an uibutton to do the login. I would to show an uinavigationcontroller with a table after the login, so with the action of the button. I know how to set up a working Navigation Controller starting with the Xcode Template but i dont know how to load this as a "Second View" Any help?

    Read the article

  • Virtual Brown Bag: Ruby Newbies, Mockups, There *is* an I in SOLID, fuv

    - by Brian Schroer
    At this week's Virtual Brown Bag meeting: Claudio pointed us to Try Ruby! and Rails For Zombies, two sites to educate Ruby newbies We looked at the free version of Balsamiq, and other online mockup sites George walked us through a refactoring to isolate roles and adhere to the Interface Segregation Principle (the "I" in SOLID) We laughed at fuv, the code editor for "real programmers" For detailed notes, links, and the video recording, go to the VBB wiki page: https://sites.google.com/site/vbbwiki/main_page/2011-02-10

    Read the article

  • Google I/O 2012 - Writing Efficient Drive Apps for Android

    Google I/O 2012 - Writing Efficient Drive Apps for Android Alain Vongsouvanh, Claudio Cherubino This session goes through how to write Drive apps that synchronize files with Android devices. We'll also go into how to open files on Android devices, or create new files from this environment. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 234 5 ratings Time: 52:45 More in Science & Technology

    Read the article

< Previous Page | 1 2 3  | Next Page >