Posts by sergiopereira • 2,865 points
89 posts
-
1
votes1
answer132
viewsA: Import Python Reportlab
Usually this type of error happens when using a different Python than the Python in which lib was installed. How are you using virtualenv, check that the virtualenv of your project is enabled before…
-
0
votes2
answers205
viewsA: Typeerror: 'float' Object has no attribute 'getitem'
The problem line is this: bullets_array.append( math.atan2(mouse_position[0] - player_x, mouse_position[1] - player_y) ) In it you are adding a single float array. For the rest of your code, you…
-
10
votes3
answers483
viewsA: Is it Unviable to use Domain-Driven Design working alone?
I believe that this question does not have an objective answer but I will give my opinion anyway. More than team size, the choice of application architecture is more related to the size and…
-
0
votes1
answer67
viewsA: Error with webforms "Process with an Id of is not running"
Something went out of sync in Visual Studio. Try to change the port the URL of your application. Search for Project URL on the flap Web of the project properties and change the number. It does not…
-
4
votes1
answer4215
viewsA: Error while decrypting string
As the error message says, a string encoded in base-64 cannot be of any size. The size is always multiple of 4. What I suspect may be happening is that when you create the URL to Dependente, you are…
-
1
votes1
answer86
viewsA: What web service can I use when developing an app?
There are several alternatives to what you are looking to create. The best recommendation will depend on your experience with which operating systems and programming languages. By way of example, I…
web-serviceanswered sergiopereira 2,865 -
6
votes3
answers1335
viewsA: How to use an object to add to an attribute?
Try to add a method __toString to his class Cliente, guy: public function __toString() { return $this->nome; } So you can pass $ana in place of 'ana' hassle-free: $ana = new Cliente('ana'); $dog…
-
1
votes2
answers108
viewsA: When starting an application, perform Windows task
You can create a service that monitors the list of active processes and detects the presence of the application in question. If you are going to use . NET, the list of processes can be accessed with…
windowsanswered sergiopereira 2,865 -
4
votes1
answer236
viewsA: Monitoring REST API status
I don’t know if there is any standard solution for this type of problem. I can suggest simply using Polling, like: import threading import thread jobs = set() def iniciar_job(dados): global jobs…
-
2
votes3
answers400
viewsA: Problems with regular expressions (friendly url)
The first expression can be adjusted to not capture / in the product: ^carrinho\/produto\/([^\/]+)?$ So it won’t hit with the long Urls that have amount, leaving them for the second expression,…
-
2
votes1
answer216
viewsA: Save data to client for later use
Of course there are other options but it may be that using a table in the bank is really the best. Think about this scenario: the user opens the page on the work computer, creates such analysis,…
-
5
votes1
answer57
viewsA: Fonts do not load correctly on IE8
Try putting each font style in a separate link: <link href='http://fonts.googleapis.com/css?family=Ubuntu:300' rel='stylesheet' type='text/css'> <link…
cssanswered sergiopereira 2,865 -
1
votes1
answer49
viewsA: How to use Twisted on Mac OSX?
My first suggestion is whenever you choose another door, like 8000. In OSX usually only processes executed with root can open doors below 1024. This can be changed but I do not recommend. If you…
-
3
votes2
answers286
viewsA: Is it good practice to always manage mistakes with exceptions?
My practice in any language that has exceptions is guided by a principle: when the method has no way to fulfill what its name promises, end in exception. But note that this does not include type…
-
2
votes2
answers794
viewsA: How to model user system
A widely used alternative is to separate the concepts of User and Person in their own classes. Thus, user contains data relating to the use of your application, such as login, password, date of last…
-
1
votes1
answer853
viewsA: Time interval query in mongodb using pymongo
A lot will depend on what kind of data are datahora, self.horaInicioand self.now. If datahora be saved in Mongodb as ISODate, which is the most common, so you can use datetime in self.horaInicioand…
-
3
votes1
answer302
viewsA: How to move a chart (Highcharts) using the arrow keys?
That’s not too hard. Highcharts has a very rich object that you can manipulate. I upgraded your fiddle with a solution to move sideways with the keyboard. The key to the solution was to first ensure…
-
2
votes4
answers787
viewsA: CSS transparency
It’s kind of hard to do what you want with just CSS, without tampering with HTML, but depending on the rest of your current HTML, this might work or just need a few tweaks: #seu-elemento { z-index:…
cssanswered sergiopereira 2,865 -
1
votes1
answer1338
viewsA: How to clone a javascript object? By copying and not by reference?
If your object has no sub-objects then you only need a "shallow" clone. If the object has sub-objects that you also want to manipulate, then you need a "background clone". I would recommend using a…
-
3
votes1
answer1469
viewsA: How to make a site multilingual and identify the country of origin?
The user’s preferred language is probably the one configured in the browser, which is usually the language (and locale) of the operating system. You can check this language in the header (header)…
-
7
votes1
answer1582
viewsA: How does authentication work in a stateless Restful environment?
When it comes to Restful, the same mechanisms used in HTTP apply. On the other hand, although many web applications use cookies, it would be strange to use them in an API. Thus, the most common is…
-
1
votes1
answer232
viewsA: Reading file in Objective C
You can use strtok: while(fgets(linha, 80, arquivo) != NULL) { strtok(linha, "\n"); //...resto do seu código } Or even leave for the brute force: while(fgets(linha, 80, arquivo) != NULL) { size_t…
-
1
votes1
answer80
viewsA: Pelican: How to define the layout of each page similar to Jekyll?
The page template can be chosen along with the rest of the page metadata, like: Title: Meu Artigo Date: 2014-09-18 10:20 Modified: 2014-09-18 18:40 Tags: opiniao, tecnologia Category: artigos Slug:…
-
2
votes1
answer895
viewsA: Read more than one file tab
That way it works right for me: wb = open_workbook('arquivo.xls', formatting_info=True) for ws in wb.sheets(): print ws.name, ws.cell_value(1, 1)
-
3
votes1
answer692
viewsA: Mongo-hacker error while installing
To install packages from npm globally (the -g that you used) it is necessary to elevate yourself to super user. Use the sudo for that reason: sudo npm install -g mongo-hacker…
-
2
votes2
answers1011
viewsA: Problems with saving data in form-model Django
Note that the status of the reply was 200 which means that there was some mistake form validation and that most likely a render() was executed at the end of the request. If there was no validation…
-
1
votes1
answer120
viewsA: Can you format a Python Traceback?
This does not seem to me a traceback. Apparently someone passed an object WSGIRequest as if it were a Exception or an error message (string) already formatted. Then Python simply converted to string…
pythonanswered sergiopereira 2,865 -
1
votes1
answer180
viewsA: Run JS inline inside the return of an AJAX
I believe that PJAX should rather be running its blocks <script type="text/javascript">...</script>. Do you have an example of a block that is not running? You placed the attribute…
-
1
votes3
answers226
viewsA: Picking Indentation with Regular Expression
It works. var resultado = seuTexto.match(/^marcacao(\s\s+.+$)+/m )[0]; Edit: This answer was dated before the OP explained the whole problem. Hence the simplicity of Regexp. The problem as currently…
-
1
votes1
answer37
viewsA: Catching Event Detail from Elastic Beanstalk with Python and Boto
You can keep asking for events until your Nvironment status changes from "Updating" for "Ready". To browse events, use describe_events: eb = boto.connect_beanstalk() resposta =…
-
8
votes2
answers14405
viewsA: Run Javascript function in event by clicking a button inside a table
The problem seems to me that you are trying to find the buttons to wait for clicks before the buttons exist on the page, since they are added later, via ajax. The simplest solution would be to use…
-
1
votes1
answer217
viewsA: Cakephp problems with . htaccess
I’m guessing that file is in the main directory (app) of your new project. Edited: Your htaccess is on the host root. The .htaccess Voce posted is rewriting more Urls than it should. Try changing…
-
0
votes3
answers1185
viewsA: icone does not stand next to input bootstrap
Your HTML looks right. I even made that fiddle to demonstrate. Experiment with other column sizes such as col-sm-12 and col-lg-12. Another possibility is that there are other styles in your own CSS…
-
5
votes3
answers1568
viewsA: How does the licensing of Open-Source programs work?
In fact you have no way to prevent someone from copying your program and passing as the real author, especially with all available code. What you can do is declare a license to use your code in the…
-
1
votes2
answers659
viewsA: Add thousandths to jquery counter
The logic of this plugin is not the clearest, but if you look well, it keeps the desired date (eventDate) and the current date (currentDate) in seconds when dividing the original values by 1000. To…
-
1
votes1
answer659
viewsA: Request ajax in a Google Chrome app
A Chrome App is more protected than an extension. Google keeps improving the Chrome Apps SDK, but the last (and only) time I tried to make an App to test, it wasn’t allowed to access external Urls…
-
0
votes2
answers1215
viewsA: Is it possible to assign Objectid() to subcollections in Mongodb?
This is a matter of document design. Roughly, there are two routes to follow: include the subdocument (artigo) within the root document (usuario) link/reference the secondary document (artigo) in…
-
1
votes2
answers675
viewsA: How to enable the "Add Controller" option in the menu?
Create a new MVC 5.1 project. If the option works in this new project, open the new file .csproj in a text editor and look for the tag <ProjectTypeGuids>. It contains the list of Guids of…
-
36
votes7
answers21276
viewsA: Best kind of data to work with money?
Decimal. Never use floating point types (float, single, double, etc.) Another known alternative is to store the values in cents, such as int's or long's. That is, instead of storing 12.34 (real) you…