Posts by pmargreff • 2,343 points
71 posts
-
1
votes2
answers335
viewsA: Rails + Materialize Select field
Your problem is not related to and Rails, but rather to materialize, according to the select documentation itself: You must initialize the select element as shown below. In addition, you will need a…
-
2
votes1
answer158
viewsA: Use of classes on the Materialize grid
The canvas is divided into 12 slices. So for my screen to be adaptable we have two arguments to be used, the first is the screen size that can be: s - small (small) m - average (medium) l - great…
-
2
votes3
answers186
viewsA: How to include columns in a Dataframe in Julia?
I think using the function map is more efficient by the question of composition, so you do not need to go through the DataFrame twice, one inicilizing and the other assigning a functional value.…
-
7
votes2
answers476
viewsA: How to pass parameters to an array in javascript?
If the object has already been created you can access using the array’s input and the key you want to access. Example: locations[0].lat = -51.00; to access the first element of Locations. To add new…
javascriptanswered pmargreff 2,343 -
3
votes4
answers11113
viewsA: What kind is appropriate for field that saves hours in mysql?
According to the Mysql documentation you have the following types to work with dates: Date Time Datetime Timestamp Year Below how the representation of data types is made: Type | Value DATE -…
-
0
votes5
answers3789
viewsA: NPM does not continue package installation
I recommend you lower the NVM, which is a version control to use more than one version of Node at the same time. Installation instructions are on README of the project. After intalar install the…
-
2
votes1
answer1528
viewsA: JSON and multiple lines
Yes, it is possible, I know two options to do this, the first would be to use an array of words: [ { "Numero":"0001", "Textos":[ { "letra": [ "Meu Jesus maravilhoso és,", "minha inspiração a…
-
1
votes2
answers32
viewsA: Regex in javascript
According to that question on Stack Overflow, the suggested simple way is: /^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/ But this expression as (reported in a comment) of response…
-
2
votes2
answers5579
viewsA: How to take only the number after the comma
For the value that follows after the comma take only the part after the comma (works with positive and negative): double valor_decimal = valor - (int)(valor); Or, if you prefer the arredontamento…
-
1
votes2
answers3964
viewsA: Angular edit the values of an object without changing the "original"
In his job edit create a new object by copying the user with the function create, as follows: var user_orginal = { a : 1 }; var user_clone = Object.create(foo); user_orginal.a; // 1 user_clone.a; //…
-
2
votes1
answer808
viewsA: Reversal of git pull
The most modern way to do this: git merge --abort And a little more correct way to do that: git reset --merge The ways described before the issue of the response would rule out local actions: git…
-
5
votes5
answers14272
viewsA: Add all the latest changes to the commit in git
Using: git add -A and git add --all you get the same result (actually the first and an abbreviation of the second). Another way would be to use er: git add * But for this to work you need to be in…
-
0
votes3
answers2776
viewsA: How to fill a select with angular using materialize
How are you using GET to take from an API accurate mount it with jQuery, I have worked with Materialize and to make it dynamically it is bugle, I’ve had to do "arm" on more than one project. The…
-
0
votes2
answers2568
viewsA: How to use Materialize with Angular?
The error you declared is caused by not adding Jquery to the page before trying to use it. The statement should work as follows: <script src="https://code.jquery.com/jquery-2.1.1.min.js"/>…
-
26
votes4
answers2243
viewsA: How do I implement wind in a trajectory equation?
Looking at your calculations we can see that you have two ways to do this, the easy (moving directly at speed) and the correct one is to create a endurance force. And also from what you see in your…
-
1
votes1
answer722
viewsA: Angular Material Datepicker does not work
The problem seems to be the lack of ng-controller declaration in html. every time you instance the controller in js of your app you need to indicate which page it will be used on your html, That’s…
-
3
votes3
answers11228
viewsA: How to timer in Javascript
You can use the function setInterval setInterval(function(){ alert("Olá"); }, 2000); Between the keys put the action you want to execute (an Alert in the example). and after the lock key specify the…
-
1
votes1
answer48
viewsA: Problem with module creation and localization by Angularjs
Your mistake is in the first two lines: <!DOCTYPE html ng-app="helloWword"> <html> You need to declare the app at the beginning of html and not in the file type declaration. Although a…
javascriptanswered pmargreff 2,343 -
2
votes1
answer252
viewsA: Complexity of Algorithms
What it is exactly to say that we have something with complexity log n ? Let’s say you have a balanced tree with 32 - 1 elements. This tree has 4 levels, if you want to add a new level, will…
-
0
votes3
answers397
viewsA: How to reverse date
If you are programming in a procedural way an option is to use the function date_format: $date = date_create("2016/05/08"); echo date_format($date,"d/m/Y"); If you are using the Object Orientation…
-
1
votes1
answer101
viewsQ: Redirect value from time function to file
I’m trying to use the time function on the terminal. When I try to use it only to display always I have the expected return. Commando: time ./main Exit: real 0m0.119s user 0m0.113s sys 0m0.006s But…
-
1
votes3
answers3857
viewsA: Angularjs take a data from the input that was filled in by a JS
The point is that you have to save that in your variable that does the midfield between your javascript and your html page. In Angularjs we use the variable $scope to access it on the javascript…
-
1
votes3
answers1078
viewsA: What is the best way to pass JSON per parameter in Angular JS?
One of the ways to do this is by using services. In your main.js (where routes, controllers and etc are declared) you can create a service with a getter and a setter. app.service('sharedThing',…
-
1
votes2
answers3408
viewsQ: Check if URL exists
I would like to know how to valid (know if there are) URL’s of social networks, I am using the AngularJS, AJAX and http requests but I can get the status of a URL I created in a mock, but I can’t…
-
1
votes1
answer337
viewsQ: Error importing structs from a header file
I need to use the following structures without changing their file implementations .h. typedef unsigned long int chave_t; typedef unsigned long int conteudo_t; typedef struct entrada_hash{ chave_t…
-
1
votes1
answer56
viewsA: Showing and hiding input
You can use jQuery to do it without much effort: In html start your input as hidden. <input type="text" id="seu-input" style="display:none"> Create a button to display the input: <button…
-
0
votes1
answer230
viewsQ: Overwrite asynchronous variable
I need to have control of the number of simultaneous asynchronous ajax calls, but I can’t override the control variable that stores the number of these calls. Every time an asynchronous call is…
-
1
votes1
answer2185
viewsA: Subtract days from current date with PHP
You can use the function date_sub as documented. Another option is the implementation by converting the dates to seconds, subtracting the seconds and then converting the result to the date type…
-
6
votes3
answers14615
viewsQ: Change remote git repository
I am using an online tool to make version control of my repository git, would like to change the remote to use another reference. How to change the remote repository (origin) git?…
-
7
votes3
answers14615
viewsA: Change remote git repository
There are some different answers to this question, but the one that best suited the situation was the following: git remote rm origin git remote add origin novo_repositório_a_ser_apontado.git…
-
0
votes2
answers879
viewsA: PHP - How to make left Join with more than one record in the other tables not return repeated values in the columns?
You can use the command DISTINCT after the operator SELECT and call the field that you do not want to be repeated, usually you do this in the ID, so it will not match all entries of the Cartesian…
-
7
votes2
answers12821
viewsQ: What it means *(int *)
I’m reading a code that has things like. *(int *)ptrArray = intN; *(float *)ptrArray= floatN; It is clear that different types are being assigned to the same type vector void*. The question is, what…
-
1
votes0
answers27
viewsQ: Finding Brackets via the Atom API
Using the code editor Atom I had the idea to make a simple but useful Feature for the same. But for this the first step is to find the beginning of the scope, for this I look for a couple of…
-
8
votes1
answer2417
viewsQ: Simulate boolean type in C
What is the most appropriate way to simulate the type bool in C? My teacher did it in a very simple way. #define bool int But I also found an excellent answer here (follows a copy of the code). //…
-
1
votes2
answers225
viewsA: Source code in Projects
Create a folder with the files you want to share among the various projects. Then open the desired project and right-click on the project and select Adicionar Item Existente da Pastas... add the…
-
4
votes2
answers339
viewsQ: Trade foreach for for
I need to change the following foreach() by a for(). The problem is that instead of arrays the loop runs through a dictionary. This is the code I want to transform for(): foreach (var joint in…
-
5
votes2
answers6790
viewsQ: Can an int equal null?
After seeing a question related to this, and many college colleagues with doubts linked to it, I decided to ask this question. The guy int may equal to null?…
-
8
votes2
answers6790
viewsA: Can an int equal null?
Short answer: No, a int will never be of value null Long answer: In java almost everything is an object, or Object, but not everything, and what is not an object is a primitive type (primitive). And…
-
4
votes1
answer669
viewsA: Multiple selection in Visual Studio
There is no native shortcut. But I found a plug-in that can be downloaded here, and has the following shortcuts. CTRL + D - Adds a cursor to the next selected word ALT + CLICK - Adds a cursor in the…
visual-studioanswered pmargreff 2,343 -
4
votes1
answer669
viewsQ: Multiple selection in Visual Studio
I would like to expand the cursor to the next word that is selected, it is similar to the CTRL + F but make a copy of the cursor to which the selected word was found, so you can change more than one…
visual-studioasked pmargreff 2,343 -
0
votes1
answer37
viewsA: Does the candescent NUI have support for the new Kinect?
The code has been ported and can be found here, but needs the following dependencies to function: OpenNI.net.dll, OpenNI64.dll, XnVNITE.net.dll and Microsoft.Kinect.dll (Kinect SDK V2 dll).…
-
2
votes1
answer316
views -
0
votes3
answers825
viewsA: Method parameter with abstract class
Java alone does not compare attributes or objects, but there is a method in the Object class that can be rewritten to create this comparison criterion. That method is the equals(). The equals()…
-
2
votes1
answer7212
viewsA: Return two values using Return
You can only change more than one variable by reference, and basically in Java it is not possible to pass parameters by reference. To do this, you need a class that has the amount of values you want…
-
1
votes4
answers1489
viewsA: Cleaning the Buffer after getchar
The function I use is similar to the one the user mutley suggested. void limpaBuffer(void){ char c; while((c = getchar()) != '\n' && c != EOF); } The difference is that in this case it can…
-
2
votes2
answers367
viewsA: Mining Text with Weka
If you want to divide the text into subStrings formed by this video will help you. Here the link for the documentation of the function that divides the text into word vectors. Here the link for…
-
1
votes1
answer362
viewsA: Deviation error in Assembly (MIPS)
In the MIPS pipeline architecture, shunt instructions change the PC at a time in which the next instruction has already been sought and is about to be executed (Machine Cycle Step 3); Therefore,…
-
2
votes1
answer362
viewsQ: Deviation error in Assembly (MIPS)
I need to transform the following c code to MIPS Assembly: int i; int vetor[8]; for(i=0; i<8; i++) { if(i%2==0) vetor[i] = i * 2; else vetor[i] = vetor[i] + vetor[i-1]; } By doing this I arrived…
-
6
votes1
answer316
views -
1
votes1
answer168
viewsQ: Division of a line into a number of segments
I need to divide a line into several segments, and all segments need to be formed by whole numbers. But sometimes the division of distância / segmentos results in a truncated number that does not…