Posts by Daniel • 1,222 points
72 posts
-
1
votes2
answers57
viewsA: Use @import in Less by passing variable as parameter
Using variables Interpolation it Works: @import "my_folder/@{theme}";
-
0
votes2
answers57
viewsQ: Use @import in Less by passing variable as parameter
I’m making a mixin in Less and need to use @import passing a variable as parameter. Example: change-Theme.Less .change-theme(@theme) { @import @theme; // Another code goes here } Theme.Less @import…
-
1
votes2
answers286
viewsQ: Convention for use of Pouchdb with Couchdb
I am developing a simple application with pouchDB and couchDB and have the following questions: In a normal, relational database (mysql for example) I would have several tables. The equivalent…
-
3
votes1
answer120
viewsQ: Add Time by converting to Ruby for seconds
I am trying to find the average difference between the creation date and the last update of the records of a table as follows: tickets = Ticket.all.where('updated_at IS NOT NULL') t =…
-
0
votes3
answers27524
viewsA: Place button side by side
Use the bootstrap Just add your css and its classes to your components. <html> <head> <meta charset="utf-8"> <title>JS Bin</title> <link rel="stylesheet"…
-
1
votes3
answers10752
viewsA: How to debug a website on mobile devices?
If debugging is javascript only you can use http://jsconsole.com/
-
0
votes1
answer108
viewsQ: Autoload error when using Highchartsphp
I’m including in my Komposer "ghunti/highcharts-php": "~3.0" and after that my autoload stops working resulting in the fatal error below, which could be? Fatal error: Call to Undefined method…
-
2
votes1
answer90
viewsA: $http Angularjs Return not expected
Try this way in service: angular.module('vaultfactor').factory 'CompanyService', ($http, $q) -> getCompanies: -> $http.get "/companies" And where to use the list:…
-
1
votes1
answer322
viewsQ: Error in readImage using Imagick()
I am trying to convert a pdf into image using the Imagick library as follows: <? header('Content-type: image/jpeg'); $imagick = new Imagick(); // O myfile se encontra na mesma pasta do arquivo…
-
0
votes3
answers319
viewsA: Search for information by content and not by array position
Do you really need to turn into array? If you don’t need regular expression, it is much more effective. Below follows example in php, just convert to Asp. $str = "Como eu faço para separar uma…
-
1
votes1
answer535
viewsA: Problem with ng-click + Angularjs menu
One way that can work is this: <li ng-repeat="x in menu"> <a href="{{x.Link}}" ng-click="vm.runFunction(x.Id)">{{x.Nome}}</a> </li> In your controller (example in coffee…
-
0
votes2
answers189
viewsA: Why does Netbeans suggest improving the for?
In that particular case it is for the sake of good practice and conventions. Ex: The way you did j < selectionPaths.length; if by an oversight put the sign = instead of < you would be…
-
3
votes1
answer1306
viewsA: Dynamic menu using Angularjs
You can provide an object with your menu items from your controller and then use ng-repeat to draw the menu. class MyCtrl constructor: -> @itens_menu = [ {label: 'Menu1', href: 'url1'}, {label:…
-
2
votes4
answers11103
viewsA: How to get the last days of the month in PHP
Take a look in this project, and you’ll find some date operations you need in addition to other features like masks, validations etc. Example to take the last day of the month: $minha_data = new…
-
2
votes1
answer99
viewsQ: Problem with Ruby Gem Chartkick
After the change to daylight time I’m encountering a problem with the Gem Chartkick. I rode my query as follows: Ticket.unscoped.where('created_at >= ? ', Time.now -…
-
1
votes1
answer71
viewsA: Angularjs Directive using class
Found the answer, the angular Directive method expects a function, I really can’t make a class, but if I want to use a class I can do so: class MyDirective constructor: -> return { restrict: "E"…
-
0
votes1
answer71
viewsQ: Angularjs Directive using class
I need to create a directive but for the sake of organization I would like to do it in a class, but it’s making a mistake that I can’t identify. Here’s what I got: My class: class MyDirective…
-
0
votes3
answers1816
viewsA: Find sum of values in array
This solution was the most effective for arrays with many elements. $notas = [ 999 => 8, 456 => 4, 789 => 5, 123 => 2, ]; asort($notas); function remove_maiores_que($total, $numeros) {…
-
5
votes3
answers1816
viewsQ: Find sum of values in array
I need to develop an algorithm that finds a specific value of the sum of some elements of an array. Ex: I have an array with 50 different values and have a given value "X". I know that the sum of…
-
2
votes3
answers261
viewsA: Mathematical combinatorics
Thanks those who contributed, based on Renan’s algorithm converted into php and managed to find what I expected, thank you very much. $result = array(); MeDaUmNumero(array(1, 2, 3, 4), $result);…
-
6
votes3
answers261
viewsQ: Mathematical combinatorics
I have a list of ex numbers: [1, 2, 3, 4] and I need to know all possible combinations of that list reminding me that the list may contain n elements, someone has some code or could help me? For…
-
1
votes1
answer2788
viewsQ: Change username on Ubuntu
I formatted my Ubuntu and misspelled the name. I tried to fix by changing the files /etc/hostname and /etc/hosts but still can’t get what I want. When I open the terminal appears like this:…