Posts by Fernando Leal • 9,770 points
219 posts
-
9
votes1
answer1392
viewsA: Event problems in dynamically created elements
Here’s the thing, if I understand what you want. Your code has the following problems: Your event selector on() is not prepared to work with dynamic elements; Your code html, You’re having some…
-
7
votes3
answers993
viewsA: How to simulate JSON responses?
If you are looking for a service you pass some parameters and it returns in format JSON? I believe it’s something similar to that website. Where that call: http://echo.jsontest.com/key/value/one/two…
-
2
votes3
answers3136
viewsA: Generate 32 character MD5 password with Cryptsharp
It is a necessity to use the library CryptSharp? Why I use the native library System.Security.Cryptography.MD5, and it works perfectly for me. If you can make that change! My implementation with…
-
4
votes1
answer2200
viewsA: Check if you have any checkbox checked and enable button
Remove the onchange="verificaChecks()" of inputs and do so with jQuery: $(function(){ $("[name='chk_IDDel']").change(function(){ var countSelected = $("input[name=chk_IDDel]:checked").length; var…
jqueryanswered Fernando Leal 9,770 -
1
votes3
answers255
viewsA: Insert input only if it does not yet exist
In fact, although there is already a good answer, the error in its solution and lack of concatenation in the check selector: // adicionei os operadores de concatenação de string '+'…
-
1
votes5
answers59481
viewsA: Take content from within a Div and put in Input value
With javascript pure, without the use of jQuery would be so: var produtosIntTitulo = document.getElementsByClassName("produtosIntTitulo"); var orcamentoAssuntoForm =…
-
15
votes1
answer3183
viewsA: Save value in Sharedpreference
Note the comments in the code, which explain what each line does. To save to Sharedpreferences: // recupera (ou cria) uma instância editável do arquivo de preferencia do Android, // pelo seu…
-
3
votes1
answer768
viewsQ: It is possible to create image thumbnails with pure Node.js
Well I found a library, which is great for image manipulation, and it works perfectly, in case the Graphicsmagick for Node.js, but there is a problem, because there are dependencies of other…
-
4
votes1
answer565
viewsA: How to transform Json into an object with dynamic fields using Gson on Android?
It is necessary to use Gson? Because Android has the Jsonobject, that already does something similar to what you want, transforming the string JSON, in a tuple object, you can do something similar…
-
7
votes3
answers3288
viewsQ: Working with delay’s on Android. Best approach?
Doubt I recently needed the use of a delay in my application to run certain code, after some time. Searching "over the internet", I found some "Gambi’s", and I found a somewhat new approach for me,…
-
1
votes1
answer70
viewsA: Method jQuery is not writing in BD
I believe that what may be happening is "Can’t bind Multiple Parameters to the request’s content web api post", where it is not possible to send multiple parameters in a post request, this occurs,…
-
2
votes2
answers7019
viewsA: Pass parameters through jquery to controller
You must pass the parameters with the same type and name so that the Router, find and pass the parameters. You should change the variable parameters like this: // cria objeto JSON para ser…
-
1
votes1
answer1032
viewsA: Action redirect another Action using Partialviewresult
Asp redirect, will not take effect for an ajax call, what you can do is redirect after the ajax call, with javascript. Something like that: function Open(url, redirect) {…
-
7
votes2
answers1074
viewsQ: Is it efficient to check file modifications by Hash?
Setting I need to implement a file change check between 2 points in my application. *¹ Point 1 - Server - I have a folder where are some product images; Point 2 - Mobile Device - I have a catalog…
-
6
votes4
answers2652
viewsA: Do an update with lambda
Update In the Nhibernate 5.0 the following functionality has been included: Modifying entities Inside the database, that implements something similar to the one sought in this question: Updating…
-
1
votes2
answers1122
viewsA: Sqldataadapter Query with Parameters
I believe you have to put that line before the if: adapter.SelectCommand = sqlCmd; For adapter.SelectCommand, must still be null when you try to access it. Would something like this: SqlCommand…
-
2
votes2
answers382
viewsA: Click on the button does nothing
Apparently you want to start a new screen (Activity). right? To start a new screen(Activity on android) you have to do so: public void chamaCadastro(){ Intent intent = new…
-
1
votes1
answer328
viewsA: Take Latitude and Longitude from an address
Try adding this permission to the manifest file: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> Translated of that response from the SOEN. The case appears to be…
androidanswered Fernando Leal 9,770 -
1
votes1
answer98
viewsA: Null Pointer with Location Manager
You have to do a check if the object is null before trying to access the method of it, something like that: if(location != null){ lat = location.getLatitude(); lng = location.getLongitude();…
-
3
votes2
answers497
viewsQ: Is there any other way than with HQL, to bulk update with Nhibernate?
I need to do a routine that will set one flag in several records that meet some requirements, and would like to keep this in control of the Nhibernate. However, I couldn’t find any way to do a mass…
-
4
votes1
answer226
viewsQ: How to make "OR" between Subquerys using LINQ C#
I would like to implement with LINQ C# (Using Nhibernate as ORM), the following query: return (from t1 in Session.Query<Tabela1>() join t2 in Session.Query<Tabela2>() on t1 equals t2.T1…
-
2
votes2
answers1834
viewsA: How to separate text icon in a <div>
I created a solution with some modifications in your example, check if it solves your problem, and if you watch it, check the updated example.…
-
4
votes3
answers8309
viewsA: What Java byte serves
The byte is a type of database (primitive), which is the basis of programming, is the lowest level data type of Java, with it possible to create any other type. 1(a) byte is composed of 8(eight)…
javaanswered Fernando Leal 9,770 -
8
votes3
answers8575
viewsA: Why is it recommended to use the "in" unit instead of "px" for fonts?
Why the unit of measurement em is relative to the font size, whereas the px is a unit of measure that is also relative, and its value is generated relative to the display device (midia). As quoted…
cssanswered Fernando Leal 9,770 -
1
votes2
answers402
viewsA: Alternative keyboard in input text
Do it: $(function(){ // vincule o evento o keydown em todos os input type text $(":text").keydown(function(e) { // se o evento entra aqui ele não se propaga. não sendo cancelado na função global…
jqueryanswered Fernando Leal 9,770 -
26
votes2
answers14336
viewsA: Some way to style "parent" element with CSS
There is currently no way to select the parent of an element in CSS. In the CSS specifications, CSS2 and CSS3, there is nothing in that sense, you will have to resort to Javascript (or jQuery,…
-
7
votes3
answers4153
viewsA: Common encryption algorithm between Java and C#
Well after analyzing the options pointed out by you, I implemented my solution using Pbkdf2 which was the following: In C#, I followed this example thus getting my implementation: // este retorna em…
-
3
votes2
answers3617
viewsA: My javascript function does not call controller action
Try switching your method signature in Controller to simple types, and enter the POST annotation explicitly: Example: [HttpPost] public ActionResult loginUsuario(string Usuario, string Senha) And to…
-
3
votes3
answers1285
viewsQ: Why new Alertdialog.Builder(getApplicationContext()). create() does not work?
I have been observing this problem for some time, and I always have to maintain an instance to Activity current, rather than maintaining only one instance to Context, and until then did not…
androidasked Fernando Leal 9,770 -
4
votes1
answer148
viewsA: Last Login Date and Time
You need to format your date because the time() brings the date in milliseconds since 01/01/1990. Try this: $lastlogdate=date('d/M/Y', time()); Source: epochconverter…
-
12
votes2
answers7696
viewsQ: Get the current date and time by internet in desktop application
I am implementing a system lock by date, and I need to get the current date of Brasilia for example, which would be the official time of Brazil, or the date in time zone -3. I believe that there are…
-
2
votes1
answer236
viewsA: PROBLEM WITH SQLITE - View with several selects
You can create views yes, follow the official documentation link Sqlite. And here a similar issue in the SOEN. Example: /* criar a view */ CREATE VIEW VIEW1 AS SELECT T1.*, T2.*, T3.* FROM TABELA1…
-
6
votes3
answers460
viewsQ: How to implement dynamic "Up Navigation"?
I’m trying to implement Up Navigation on my Android app but apparently I found no way to do that android:parentActivityName, set in the manifest, can be manipulated at runtime. What happens in my…
androidasked Fernando Leal 9,770 -
2
votes2
answers1056
viewsA: I can’t remove the fields I just planted
There are some problems in your code: The method .live jQuery was discontinued in version 1.7 of the library and should no longer be used, as shown in documentation. In its place you can use the…
-
2
votes3
answers1444
viewsQ: Organize XML’s layout in the Android project’s Resources(res)
Problem My project is growing and with it, the amount of files in the layout folder, and it is already becoming somewhat difficult to find a specific file, since they are not grouped in any way,…
-
2
votes3
answers28540
viewsA: Create an array with objects in Javascript
The problem is that you are setting the same "instance" of the item object, and it will be modified in all its references, since it is being declared in a global scope in javascript. In Javascript…
-
4
votes3
answers4045
viewsA: DBMS to Sqlite
I think you want one Database Manager for Sqlite? If this is the case I use and recommend the Sqlitestudio, I do not use anything incredibly advanced compared to Sqlite database, but it always met…
-
24
votes3
answers4153
viewsQ: Common encryption algorithm between Java and C#
Problem I am creating a Web Service in C# to be consumed by an Android application (Java), among other information I would like to pass the user credências to login offline on the app. But these…
-
2
votes1
answer820
viewsQ: How to create a query with Union using Nhibernate
I need to implement a query in nhibernate make a union between 2 tables. In sql, it would be something like that: SELECT T1.Id AS ID FROM TABELA1 AS T1 UNION SELECT T2.Id AS ID FROM TABELA2 AS T2 I…
-
3
votes1
answer295
viewsQ: Map a CHAR-like field in the database to a bool-like field in C#, with Fluentnhibernate?
In the database I have a field ATIVO of the kind CHAR(1), where 'T' = true and 'F' = false. Today, in my application I am circumventing this problem with a "gambiarra", where I mapped my attribute…
-
1
votes4
answers864
viewsA: How to set Background-image with SVG hosted elsewhere
I believe you want to set the background of div and not of iframe directly, because its variable guard the element is called div. If so you should change your seal to the following: var div =…
-
1
votes4
answers37227
viewsA: Calling one function inside the other, through a string
Try adding your functions explicitly to the object window as here: window.dyna = function(param) { alert("dyna " + param); } window["dyna"]("oi"); Some browsers this is not even necessary and would…
-
29
votes3
answers11642
viewsA: What is the definition of the term coupling?
Concept In a global aspect coupling is the degree of dependence between two "artifacts". Where artifacts can be entities, methods, component, tables, whatever is in the other. Low coupling - is when…
-
2
votes3
answers216
viewsA: CSS selector for tables
I think what you want is this: table, thead, tbody, th, td, tr:not('.tabela-isolada') { display: block; } :not() is a pseudo-class of denial. Note: Not supported by all browsers as specified in MDN…
-
4
votes2
answers1170
viewsQ: Why does the Gravity attribute of the Linearlayout.Layoutparams object not work like the View setGravity() method?
Problem I’m working on a UI library for android, where I set the layout parameters (height, width, weight and gravity) dynamically via code, in an object LinearLayout.LayoutParams but the attribute…
-
4
votes3
answers29445
viewsQ: How to check if the String is null or blank in Java / Android
I went through this problem implementing a simple library of database queries sqlite in android and would like to share the solution with the community, I believe it will be useful since I have…
-
2
votes3
answers29445
viewsA: How to check if the String is null or blank in Java / Android
This is my class utils: public class StringUtils { // Verifica se a String é null ou vazia ou só tem espaços em branco public static boolean isNullOrBlank(String s) { return (s == null ||…
-
11
votes2
answers7686
viewsQ: How the android:Ems attribute works (Textview)
I would like to understand how this attribute works (android:ems). I saw something citing that he acts on the source of the text, but I did not understand how. I tried to do some tests, and did not…
-
0
votes3
answers542
viewsA: Receive a Model per parameter in a function
Maybe it is more interesting to save the list of identifiers. Something like that: @model List<long> Clique <a href="@Url.Action("downloadListaISCC", "Alertas", new { ids = Model…
-
1
votes1
answer559
viewsA: What would be an alternative to the "obsolete" showDialog function?
In the documentation Android says the following: This method was deprecated in API level 13. Use the new Dialogfragment class with Fragmentmanager Instead; this is also available on Older Platforms…