Posts by hugofsousa • 608 points
30 posts
-
0
votes1
answer222
viewsA: Use custom css (Rails and windows)
In your 'Assets/stylesheets/application.css' you should have *= require_tree . *= require_self And in your 'views/layout/application.html.erb' <%= stylesheet_link_tag 'application', media: 'all',…
ruby-on-railsanswered hugofsousa 608 -
6
votes3
answers3123
viewsA: format ľ%d' expects argument of type ěint', but argument 2 has type ěchar *' - What is it? How to tidy up?
%d is to show inteiros If you want to show char, you should use %s
-
2
votes1
answer241
viewsQ: Rollback transaction does not work as expected
I’ve recently been implementing a sequence of requests in Visual Basics, and would like to give a rollback when any fail. So I did it this way: Public Class DAO Dim connection As New MysqlConnection…
-
0
votes1
answer1993
viewsA: How to leave a fixed footer in the Android layout?
It would be interesting you put your xml, to identify where you went wrong. But since the question is a general one, here is my answer: Utilize RelativeLayout. Whatever you wish to center within it…
-
1
votes2
answers187
viewsA: Counter on model
First thing, when you insert the self It is a method he turns into a static method, static in the Java, that is, you should call it so: Carro.count. If you want an id, simply use the id of the car:…
-
1
votes2
answers659
viewsA: How to use the Clipboard to copy and paste
Use a TextView with the property android:textIsSelectable=true <TextView android:id="@+id/text_to_copy" android:layout_width="wrap_content" android:layout_height="wrap_content"…
-
0
votes1
answer38
viewsA: How to redirect to the same object position after update
Well, I didn’t quite understand the logic of showing only 1 in index, it would be more interesting to use the show of the item in question. But anyway, to your question. Go to the controller…
-
1
votes1
answer113
viewsA: Query with select and find in Rails
Do it this way: @organization = Organization.find(actual_organization.id, :select => [:required_project_type, :required_folder_type])
-
4
votes1
answer127
viewsA: List within Spinner Layout
Declare in your strings.xml file <string-array name="options"> <item>Aberto hoje</item> <item>Não importa</item> </string-array> And his spinner: <Spinner…
-
1
votes2
answers4016
viewsA: Creating more than one Android Studio table (Sqlite)
Friend, using database to persist data is very common, and for this has some alternatives. You can build an API, which you query, and enter data. Using a server, with the language you want.…
-
2
votes2
answers109
viewsA: How to associate a variable to an ID?
There are a few options. What I advise would be to use a simple Hashmap. Map<Integer, Button> buttonsHash = new HashMap<Integer, Button>(); public Button getButton(int position){ return…
-
1
votes1
answer34
viewsA: Remote error: true using in RAILS, to POST a JS file
Got a little confused the question, but what I understand is that you want the method index be a POST instead of GET. By default the method index is used for requisitions GET. So what I recommend is…
-
0
votes5
answers597
viewsA: JSON.stringify() method
Being membro your Json described in the question, you should first take the values. The problem is not specifically in the method JSON.stringify() var projetos = [] for(var i = 0 ; i <…
-
1
votes2
answers67
viewsA: Posting of a website
You should first buy a domain, which on average costs $30 a year. It depends on where you buy it (Register.br, Godaddy ...) And then depending on the language you will hire a server to host your…
-
0
votes1
answer42
viewsA: PHONEGAP AJAX catching ip along with the url
I did, by simply altering the dataType: "json" for dataType: "jsonp". There was another error, but then another question. From Jsonp
-
0
votes1
answer42
viewsQ: PHONEGAP AJAX catching ip along with the url
I’m making a simple request using phonegap: $.ajax({ type: "GET", dataType: "json", url: "http://mydomain.com/request", data: params, success: function(result){ }, error: function(e, data, status,…
-
0
votes1
answer433
viewsQ: JQUERY functions with named callbacks
I would like to create a function with Jquery so that I can pass only the callback name and function specification, as well as the $.ajax function, which as an example, I do: $.ajax({ ... success:…
-
2
votes1
answer290
viewsQ: MYSQL to POSTGRESQL via SED
I am looking for a way to migrate my backup from a Mysql database to Postgresql. The simplest way I found was using sed upon backup, but it hasn’t worked. It was like this: 1 - performing a backup 2…
-
2
votes2
answers1432
viewsA: Get the value by a comparison between C#Arrays
A more trivial method would be to go through both arrays: List<string> diferentes = new List<string>(); for (int i = 0; i < diretorios.Length; j++) { bool existe = false for (int j =…
c#answered hugofsousa 608 -
0
votes3
answers303
viewsA: Convert date difference to string
Use with the date_diff function: $differenceFormat = "%H:%i:%s" $datetime1 = date_create($data_inicio); $datetime2 = date_create($data_fim); $interval = date_diff($datetime1, $datetime2); $sql =…
phpanswered hugofsousa 608 -
4
votes6
answers9622
viewsA: Transform json array into php array
When you try to run $infor->Players->list; you are trying to access a Objeto. But how are you reading one Objeto Json, you should read it this way: $players = $infor["Players"]; $players_list…
-
2
votes1
answer54
viewsA: dropdpwn menu does not work on touch
Try adding this meta to your code header: <meta name="viewport" content="width=device-width, initial-scale=1.0"> If it still doesn’t work, try to find the bootstrap.min.js file, and find the…
-
1
votes2
answers775
viewsA: Calculate values (R$) from quantity
You can simplify the code a little more: $valor_unidade = 0.50; $item = "R$" . number_format($valor_unidade * $mc_quantia); And as in number_format documentation, you can format the variable as you…
phpanswered hugofsousa 608 -
1
votes2
answers761
viewsA: Error - Binary XML file line #30: Binary XML file line #30: Error inflating class Fragment
You are returning null in view creation. Try: public class Fragment1 extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup conteiner, Bundle saveInstanceState){…
-
1
votes1
answer152
viewsA: Meaning of Warning: Possible overdraw
declares your theme in the archive: res/values/Styles.xml <style name="MeuTema" parent="android:Theme"> <item name="android:background">@color/md_elegance_green</item>…
-
0
votes2
answers679
viewsA: Rename column with Rails using Migration
Probably the error is in some old Migration you made by adding a column with the wrong name. Tries to execute the command rake db:rollback after identifying the error. For example, if you added a…
-
1
votes2
answers298
viewsA: Jquery - Next div when clicking on a link
You put 2 ;(dot and comma) Substitute $( ".download a" ).click(function(e){ $( ".download a" ).html($( ".titulo a" ).text();); }); For $( ".download a" ).click(function(e){ $( ".download a"…
jqueryanswered hugofsousa 608 -
2
votes1
answer2041
viewsQ: HEROKU connect to mysql database
I’m doing reverse engineering on a system, and what I want is to use the same database as the old system. But I am not able to connect the system database in production with this base. And because…
-
0
votes2
answers1200
viewsA: Loading/Loading screen
Use Progressbar, with the indeterminateOnly true, and with the Widget style.ProgressBar.Horizontal, thus: <ProgressBar android:id="@+id/progress" style="?android:attr/progressBarStyleHorizontal"…
androidanswered hugofsousa 608 -
4
votes1
answer88
viewsQ: Doubt with scenes (Scene)
I’m starting to use scenes in my application, and I’m constantly having the same problem, but now I couldn’t solve. So I have 2 scenes, and in the onCreate I take my views, for example: editText =…
androidasked hugofsousa 608