All Questions

1
answer

How to display only the first row of a table?

I have a table with summaries about a particular client, where the first line is the main content to be displayed, and the rest is a mere complement. I know I could apply display: none , but I do not think that should be the best way to...
asked on 04.05.2016 / 21:14
2
answers

How to get the current path of a .sh script?

On Linux-based systems whenever I need to use the following command: #!/bin/bash BASEDIR=$(dirname "$0") echo $BASEDIR I have however read in different places that $(dirname "$0") is not supported by Mac OS X systems and BSD-based...
asked on 01.08.2016 / 17:51
1
answer

Why are you giving this static variable error?

Why are you giving this compile error and how can I resolve this?    Can not make a static reference to the non-static field service     
asked on 03.07.2016 / 21:21
1
answer

Upload file via POST to WebAPI

I need to upload a file to WebAPI , I'm using the following code to upload public void Enviar() { WebRequest request = WebRequest.Create(url); request.Method = "POST"; byte[] byteArray = File.ReadAllBytes(fileName); re...
asked on 16.09.2016 / 14:17
2
answers

How to only get the number after the comma

When I do the 162/11 calculation, the result is 14,72727272727273 . But when I use the code System.out.printf("%.1f", teste); , the number 14,8 is displayed. I would like a way to save only 8 in a int .     
asked on 10.08.2016 / 06:03
1
answer

How to avoid buffer overflow in C / C ++

The program below allows the occurrence of memory overflow, because it is possible to override the variable zero by placing a "large" value in the variable buffer . How to make a secure program by avoiding buffer overflow ? #include <...
asked on 05.08.2016 / 04:04
3
answers

Should I use Em everywhere or only in Fonts?

I know that in should be used instead of px in sources for good application performance on mobile phones, but I only use this in font size. Should I use in also in places like margins, paddings, line-height, etc? Thanks     
asked on 05.07.2016 / 14:23
1
answer

What is the difference between Ajax.BeginForm and Html.BeginForm in Asp.net MVC

Working with web in asp.net mvc , I saw that it is possible to use Ajax.BeginForm() and Html.BeginForm() . What is the difference between Ajax and Html ?     
asked on 08.07.2016 / 23:38
2
answers

Serialize Object to JSON

How do I convert an object to JSON? I even found some codes on the internet that even worked, but my object has some fields that are other objects and then the conversion did not reach the last level. Example: class Pessoa(object): c...
asked on 09.07.2016 / 02:23
1
answer

How to update fields with fields from another table?

I'm not able to update a table with the select of another. I have a mdl_user table that contains several columns and created another users_sg to copy some columns. I copied with INSERT INTO users_sg (id, username, firstna...
asked on 17.08.2016 / 16:03