Márcio

0

votes
1

answer
5

views

What is the pyplot equivalent of seaborn barplot?

I want to convert this barplot: sns.barplot(x='Pclass', y='Survived', data=train_df) using the built-in plot function from Pandas dataframe or pyplot How can I translate this seaborn barplot into a pyplot bar chart?
Marcio
1

votes
3

answer
80

views

podspec JSQMessagesViewController non-modular header

I want to use JSQMessagesViewController as a dependency to my swift pod. When I build my example app I get the old non-modular header error related to the JSQSystemSoundPlayer but I don't know how to get around it with XCode 7. Podspec: s.dependency 'JSQSystemSoundPlayer' s.dependency 'JSQMessagesVi...
Marcio Arantes
1

votes
1

answer
42

views

Is there a better way to write test statements in mocha?

In the code below I am trying to assure that a certain page was rendered after the user clicked a link. I'm not sure if this is the correct way to make this assertion or if there is a better way to write it, perhaps with another inner it statement. Can this test be improved in any way? describe('Use...
Marcio
1

votes
3

answer
582

views

How can I replace an element of a list using an index in PROLOG

I need do this: replace(L,P,E,R), where L is the current list, P is the position where the element will be insert, E is the element to insert and R is the return, the new list. Example: L = [1,2,3,4,5], replace(L,2,'@',R). R = [1,2,'@',4,5] I tried this, but nothing happens, the list continuous to b...
Marcio
1

votes
1

answer
403

views

CSS background attachment fixed + fixed background size width

I am trying to add a 'strip' of an image to the left top of the div as a background with a fixed attachment property. Here it is: https://jsfiddle.net/mvfariajr/recLr6yf/ HTML: TESTING CSS: #wrapper { width: 100%; height: 500px; background-color: #ccc; } #container { text-align: center; margin: 0 au...
Marcio
1

votes
1

answer
547

views

setting translatesAutoresizingMaskIntoConstraints to all subviews

Anybody know the implications of setting translatesAutoresizingMaskIntoConstraints to false for all subviews? Consider the following: extension UIView { public func setAutoresizingMaskIntoConstraintsForAllSubviews() { for v in self.subviews { v.translatesAutoresizingMaskIntoConstraints = false } } }...
Marcio Arantes
1

votes
1

answer
364

views

Build last commited SQL Script VSTS

I'm new to VSTS and I want to know how to always build only the latest committed SQL Script. Example: I committed example.sql from my repository, the VSTS Build needs to get only the 'example.sql' zip it and publish the artifact to get ready to release. How can I do that?
Márcio Esteves
1

votes
1

answer
141

views

How to convert hexadecimal to binary in a matrix in r?

I have an matrix with hexadecimal number, like that: [,1] [,2] [,3] [1,] 'FA' 'F8' 'D0' [2,] 'CE' '17' '6A' [3,] '0E' 'D6' '22' If I try convert to binary, with hex2bin(matrix) (library BMS) give me: [1] 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 0...
Márcio Mocellin
1

votes
2

answer
497

views

How to add a custom field in django model form?

I'm trying to add a readonly field in a form. The model Folder is registered in admin site. The FolderAdminForm defines the custom field statistics. There isn't statistcs field in the Folder model, I just want to put some readonly data on the form. This data is defined in the template. But I get a e...
1

votes
1

answer
89

views

How to inject multiple EJB in a JUnit test class

I'm trying to test a class that has multiples EJB that are connected with other EJB. How do i inject all EJB from that class into a JUnit test class? Thank you
Márcio
1

votes
3

answer
11.6k

views

How to read the json response when a 422 (Unprocessable Entity) error occur in C# Visual Studio

I'm sending some JSON data to a web service using 'PUT' method, but I'm having 422 unprocessable entity error. How can I actually see the server response in JSON? I digged deep into the exception but i still can't find the json response. Ex: JSON Request: { customer: { name: 'asd', address: 'test'...
Márcio Duarte
1

votes
4

answer
2k

views

Reload div using jquery load function working only once and how to pass a variable

I have very limited knowledge with scripts so I hope you guys can help me with a simple solution to a small problem that I have... I'm using the following jquery function to refresh a div with new content when a link is clicked $(function() { $('#myButton').click(function() { $('#loaddiv').fa...
Marcio Reisinho
1

votes
2

answer
8.5k

views

Convert a BufferedImage into a 2D array

I have a BufferedImage wich represents a 2048X2048 pixels tiff image. I wish to retrieve such array (int [2048][2048] from the BufferedImage. How should I proceed?
Marcio
1

votes
1

answer
433

views

Way to analyse PHPUnit tests with Webgrind or other PHP profiling tool?

Profiling an entire application can be good for macro optimizations. But sometimes I want to optimize a specific package or library without other components interacting, with total isolation. So I was thinking if phpunit has output for profiling tools like Webgrind? Or at least is there a way to gen...
marcio
1

votes
4

answer
74

views

Dealing with asynchronous function

I have just started programming with JS and Node, and I haven't got used to asynchronous stuff yet. Basically, i have the following code: for (var i=0, len=sources.length; i
Márcio Paiva
1

votes
2

answer
1.1k

views

VerilogHDL - Error connecting Array with non-Array expressions

I am struggling with my code, which is a Carry-Save Multiplier. module csm (A,B,So,Co); parameter n = 8, m = 16; input [7 : 0] A,B; output [m-1 : 0] So; output Co; // carry out wire [7:0] CARRY [7:0]; reg [8:0] SUM [8:0]; assign So = {SUM[7][7],SUM[6][7],SUM[5][7],SUM[4][7],SUM[3][7], SUM[2][7],SUM...
Márcio Moura
1

votes
1

answer
1.2k

views

How can i mock underscorejs in unit testing? [angularjs]

I added underscore as a module to my application. I'm doing unit testing now and i don't know how i can mock underscorejs. underscorejs module var underscore = angular.module('underscore', []); underscore.factory('_', function () { // assumes underscore has already been loaded on the page return win...
Marcio
1

votes
1

answer
575

views

protractor can not find element with id

I'm using protractor and i can not understand why when i try to get something by css it works but if i try to get it with id it does not work. Error message on the btnLogin line TypeError: undefined is not a function Some part of the code browser.get('http://localhost:3000/#!/signin'); expect(elemen...
Marcio
1

votes
3

answer
394

views

Combinations in a range of numbers in C++

I would like to build a C++ program that show all the possible combinations depending on the number of elements taken by a N factor. Let's suppose a vector vec[6] with elements 1 2 3 4 5 6 on it. Using the combination formula, 6! / 4! (6 - 4)! = 15 possibilities I want to generate a function which...
Marcio
2

votes
1

answer
285

views

Ideas to implement “vote” ContentType-based app

I want to create an app to allow the voting of any model (thumbs up and thumbs down, pretty much like SO in it's questions and answers), using ContentTypes (like the comments framework or the tags examples in docs). I just set up the models and templatetags, it's possible to get the count of votes a...
Marcio Cruz
1

votes
1

answer
509

views

Navigate through SAS Project's OutputDatasets using C#

I've been trying to navigate through a SAS Project's output datasets using the SAS.EG.Scripting library for C#, but I keep getting an empty collection of datasets, even though the dataset is correctly generated on SAS Server. I tried to follow the steps explained on this article, which is the only...
Márcio Alves
2

votes
3

answer
125

views

Should an array be ordered server side or client side [closed]

This is a general and technology free question. But if this has different answers for different technologies, please focus on cassandra as No SQL DB, node.js as server side technology, Java as client side technology, and JSON to describe the array of objects. What is the best practise to order an ar...
Marcio Oliveira
2

votes
4

answer
7k

views

How to submit an ASP.NET MVC form using javascript and still validate on client side?

I have an ASP.NET MVC 2 form that is working perfectly, doing client side validation (using Data Annotations). Whenever users click on the submit button, client side validation kicks in before the form is actually posted back to the server. This is the actual code, really basic stuff: Now here is my...
Marcio Gabe
5

votes
1

answer
175

views

How to represent this complex data structure with Go structs?

So I decided to give Go another chance but got stuck. Most Go struct examples in documentation are very simple and I found the following JSON object notation that I don't know how to represent with Go structs: { id: 1, version: '1.0', method: 'someString', params: [ { clientid: 'string', nickname: '...
marcio
2

votes
0

answer
868

views

How do i redraw map unsing ngmap

i use ngmap to draw the google map and every time i change the screen and go back the map is partialy drawed. I already try this solution: How do I force redraw with Google Maps API v3.0?. This is my code: Controller: (function() { 'use strict'; angular .module('jhipsterApp') .controller('Ubicacion...
Marcio.Rezende
6

votes
2

answer
2.3k

views

How do I traverse a hdf5 file using h5py

How do I traverse all the groups and datasets of an hdf5 file using h5py? I want to retrieve all the contents of the file from a common root using a for loop or something similar.
Marcio
19

votes
6

answer
10.6k

views

Web app in tvOS

Apple has released it's SDK for apple tv yesterday. Most apps for TVs are web based (html, javascript and css) and I would like to port an existing tv web app to the tvOS. The SDK in Xcode shows no Webview implementation like in iOS for creating apps based in html, javascript and css, however, accor...
Marcio Oliveira
4

votes
1

answer
117

views

Js Library into browser

Since web browsers want to make the web faster. I know google has his hosted libraries. But why not integrate them on the browser directly? Problem nowadays is that if you navigate from one page that has jQuery to another page with jQuery since the url is different that same js is cached for that...
Marcio
20

votes
6

answer
74k

views

How to find my php-fpm.sock?

I'm running Wordpress with: Nginx + PHP-FPM + APC + W3 Total Cache + PageSpeed. After 3 days researching and configuring, I succeeded to make it work. I configured PHP-FPM to run via 127.0.0.1:9000. But now I want to configure via Socket. The problem is that I can't find the socket path in my serve...
Márcio
1

votes
1

answer
627

views

C solving memory leaks using Valgrind

So I have a php, ruby and python background and got started with C. I'm using Valgrind to check if my programs are not doing silly things but I get this kind of output quite frequently: 14072== 14158== HEAP SUMMARY: 14158== in use at exit: 137,084 bytes in 196 blocks 14158== total heap usage:...
marcio
4

votes
1

answer
245

views

RE2C How to discard current matched rule and keep trying?

Can a rule be conditionally discarded after being matched and continue to try other rules with lower precedence? {rule} { if(condition) { return TOKEN; } // discard // continue and try the other rules below... } {other_rule} { return OTHER_TOKEN; } ... PS: condition depends on other resolutions that...
marcio
21

votes
1

answer
381

views

Make Read the Docs include autodoc documentation for special-members?

I have a module with two documented global special-members. Running Sphinx locally creates documentation that includes their docs, but Read the Docs doesn't. It uses the built-in type's documentation instead. I have tried both styles: #: and docstring after the definition. I have read autodoc's docu...
Márcio
5

votes
10

answer
347

views

Class member organization

What is the best way to sort class members? I'm in conflict with a team member about this. He suggests that we should sort the members alphabetically. I think it's better to organize in a semantic manner: important attributes first, related methods together, etc. What do you think?
Marcio Aguiar
2

votes
5

answer
2.6k

views

Best practices in PHP using $_POST and $_GET variables

Considering a project where will work more than one developer and that will receive constant update and maintenance, what of the two codes below can be considered the best practice in PHP, considering Readability and Security? If we talk in performace, the second option will probably be a little bet...
1

votes
2

answer
52

views

Getting 'undefined' when a property is initialized in the constructor of a prototype

I started to use prototype and i got the expected result if i use the code: $(document).ready(function() { var MyObject = new MyClass(); MyObject.assign(); MyObject.console(); }); function MyClass() { var myProperty; }; MyClass.prototype = { assign: function() { this.myProperty = 'Hello world!'; },...
Marcio Mazzucato
21

votes
2

answer
7.7k

views

How to programmatically check if running on HHVM?

I need to run a given package on both HHVM runtime and traditional PHP runtime. My question: is there a way to check programmatically if current environment is HHVM? Something like this:
marcio
2

votes
1

answer
401

views

Call visual studio modal dialog

I'm developing some visual studio package projects(vsix) and I need to show a modal dialog box preventing clicks behind it. Something like visual studio About dialog box. Clicks behind this dialog are denied while it is being shown. I did try it using Forms.Form.showDialog but it works only in the v...
Márcio Gonzalez
2

votes
3

answer
4.8k

views

Use different icons in JFrame and Windows taskbar

Is there a way to use different icons on JFrame and Windows taskbar? When I set JFrame.setIconImage(img) this same image is use as Windows icon. Can I use different icons to the JFrame and Windows taskbar?
Marcio Barroso
6

votes
1

answer
3.2k

views

Hide the file names from the Inno Setup progress page

How can I hide or remove the names of files being installed from the label above the installation progress bar leaving only 'ex: install'? It appears as the files are being unpacked. LabelCurrFileName.Caption := ExpandConstant('{cm:ExtractedFile} ') + MinimizePathName( CurrentFile, LabelCurrFileNam...
Marcio
2

votes
1

answer
817

views

Stop parent function or method in JQuery

I have the following code: $('#add-button').click( function(add_color) { $.each( $('input[name='color[]']'), function () { if( color_selected == $(this).val() ) { alert( 'Color already choosen' ); return false; } }); alert('Here is the end of add-button'); }); I need to stop the code if return false...
Marcio Mazzucato

View additional