Posts by Fernando Leal • 9,770 points
219 posts
-
13
votes3
answers4038
viewsA: What is the difference between using virtual property or not in EF?
I agree with the reply by @Maniero,and I have a few points to add. Although not working effectively with EPH, I know he’s like Nhibernate (ORM similar to EF), creates a derivative class named proxy,…
-
4
votes0
answers58
viewsQ: Why do numbers(long, int) starting with 0 end up having other values?
I was doing some tests on a phone number formatter when I tried this entry for a long: 033222221111L, compiled normally (Yes, in the real world it would not make sense an entry like this, if it is a…
javaasked Fernando Leal 9,770 -
4
votes2
answers6847
viewsQ: How to avoid abrupt page breakage when printing an html table
I am developing an html page to be printed later. But when printing I could notice that the break of pages in the middle of tables, are getting strange and abrupt, as can be seen in the following…
-
3
votes0
answers682
viewsQ: How do you create PDF file from ZERO (without frameworks)?
Well, I’m analyzing some possibilities to generate PDF’s on Android (offline), and none is fully satisfying, either by the license, features, large size framework, or support version of Android…
-
1
votes4
answers347
viewsA: Is there any way to detect if there are any asynchronous calls being run?
You can simply chain your calls, only to call the next one when you’ve finished the previous one, I don’t know if this meets your needs, but it’s a way: $(function(){ $.ajax({ // request 1 type:…
-
0
votes5
answers7848
viewsA: What is the difference of string vs string?
string is an alias (shortcut) for System.String. So, technically, there’s no difference. It’s like int vs. System.Int32. It is generally recommended to use string, whenever you are referring to an…
-
3
votes5
answers1879
viewsA: What is the difference between an explicit cast and the operator as?
One launches Exception, and the other only returns null if they fail. private void textBox1_Leave(object sender, EventArgs e) { TextBox textBoxTemp = (TextBox)sender; // se por algum acaso, o objeto…
-
2
votes1
answer174
viewsA: How to find exact Regexp and do this using constructor syntax?
According to information you specified in the comments, what you need is a solution apparently as is (Follow the comments in the code): // SOLUÇÂO ----------------------------- // informe as…
-
1
votes2
answers102
viewsA: Search in related table
The error you posted is already explicitly telling you what the error is. The following is the table produtos should also contain a column called descricao, right? Then how are you not using alias…
-
2
votes2
answers952
viewsA: Enum as Hibernate Parameter Namedquery
I don’t know if I understand you very well. Change your Enum to constants, because Annotation does not allow receiving instance parameters. As quoted in that and in that issue of the OS. public enum…
-
1
votes1
answer165
viewsA: My Repeater does not render in the browser
As quoted in comments apparently what it lacks is to set the Datasource and apply a Databind(). You have to define a data source (Datasource) to the Repeater, then for each item of the list set in…
-
4
votes2
answers1713
viewsA: HTML5 tables - subdivide column
You must use the colspan and rowspan to merge the columns you need, and create a <tr> for column subheadings. Something similar to this: <div> <table border="1px"> <thead>…
html5answered Fernando Leal 9,770 -
1
votes2
answers132
viewsA: Equivalent of onCreate()
What you can do is simply call your onCreate on the initialization of your class (which by the comments already seem to suit you), since in the constructor you will already have the instance of the…
androidanswered Fernando Leal 9,770 -
5
votes2
answers179
viewsQ: Object type for Time type data (Ex: 1 min 56 seconds) in Android/Java?
I need to work with times, such as a chronometer (not my case), which at the end of its execution would have to keep its value. So I thought of some possibilities like: java.utils.Date: only that…
-
5
votes3
answers3470
viewsA: GROUP BY last entry
Only use MAX and MIN operators; SELECT min( t.id ), t.protocolo, min( t.status ), min( t.alteracao ), max( t.datahora ) FROM tabela AS t GROUP BY t.protocolo; Something similar to this in MYSQL.…
-
25
votes4
answers49363
viewsA: What is console.log?
console.log is one method among several others available for the browser debug console. List of other console methods. console.log is used to issue registration information in general. For example:…
javascriptanswered Fernando Leal 9,770 -
1
votes2
answers146
viewsA: Mapping a List<long> in LINQ to SQL - Windows Phone 7.1
I was able to solve the problem (with the tips of @Ciganomorrisonmendez, but with some important modifications in relation to the collections), as follows: I created a new entity to represent the…
-
2
votes2
answers146
viewsQ: Mapping a List<long> in LINQ to SQL - Windows Phone 7.1
Problem I’m starting an application for Windows Phone 7.1, and I’m implementing the database, only I came across a situation that I couldn’t find any example of similar situation to try to solve,…
-
0
votes1
answer263
viewsA: Failed to create a site in iis 8
You have to use a user with read and write privileges to C:/inetpub. Or give your current user privileges to that folder. In IIS, before having the connection tested you must inform this user: in…
-
2
votes1
answer1351
viewsA: How to save objects list in Android
There are some ways to record/persist data on Android to retrieve it later, as demonstrated here in the documentation: The most commonly used are: Sharedpreferences Which is a place where you can…
-
-1
votes1
answer878
viewsQ: Create advanced route in Angular.js
I’m trying to get my router, work a little differently. Today he is like this, for example: $routeProvider. when('/cliente', { templateUrl: '/cliente', }). when('/login', { templateUrl:…
-
10
votes2
answers1623
viewsQ: What is the real concept and usefulness of POCO classes?
I am studying and developing a new project and the little studying on Windows Phone 7.1, I saw that they suggest/ indicate the use of classes POCO, for database mapping (It seems to me that Windows…
-
3
votes1
answer641
viewsA: Constructor class Abstract
You have to create a constructor with the same structure in the sub class, something similar to this: public class BandeiraAplicacao : AplicacaoGenerica<Bandeira> { public…
-
2
votes1
answer283
viewsQ: Is there any way to set Nhibernate not to parameterize a query?
Problem I have an appointment with Linq Nhibernate in which subquery I need to concatenate the results with a separator to compare it with the query is similar to the following:…
-
2
votes4
answers1944
viewsQ: Run query that concatenates parameters (@p) in Firebird
I need to run a query where the value to be concatenated must be passed as a parameter for the query. SELECT t.id || @p || t.nome FROM Test t; But when executing this query it returns the following…
-
2
votes6
answers1855
viewsA: How to create link with Hover showing strokes on the sides
I would solve this problem using Pseudo CSS Classes and Pseudo Elementos. Using the pseudos: :Hover, ::after, and ::before. Would create a rule similar to that: ul > li > a:hover::after{…
-
2
votes1
answer405
viewsA: Box in the middle of the page according to the resolution
I’m not sure I understand your question, but from what I understand you want to keep yours form always in the center of the screen no matter the resolution of the screen, and that it fits your…
-
1
votes2
answers462
viewsA: How to use HTML5 data- attributes with Asp.net MVC?
Has a parameter called htmlAttributte of the kind object, virtually every component I know has this parameter available in your constructor, with it you can set the attributes html of the component,…
asp.net-mvc-5answered Fernando Leal 9,770 -
11
votes2
answers468
viewsA: What is the equivalent of if($_POST) on . Net (ASP.Net MVC)?
In ASP.Net MVC, there are the markings in the action which indicate whether they will receive Type requests GET or POST. Like for example this: [HttpPost] // Pode-se utilizar também [HttpGet], para…
asp.net-mvcanswered Fernando Leal 9,770 -
6
votes2
answers1442
viewsQ: Is it possible to get some value from the browser that identifies the user’s machine?
Problem I am searching for some way to identify and validate workstations, and would like to get some value from the machine that is not changeable, such as the IP that can change. I tried to get…
-
2
votes1
answer190
viewsQ: What characters can I not use for cookie names?
I’m developing a new authentication system to decrease complexity and increase security. And I’m developing a system where some authentication cookies will have randomly generated names for each…
-
0
votes3
answers9349
viewsA: Disable all inputs from a form using css only?
I developed a solution (type == POG), which solved my particular problem, and will only work if used with a div overlay on content that does not allow direct user handling with the form, my solution…
-
3
votes3
answers9349
viewsQ: Disable all inputs from a form using css only?
Problem I’m implemented some controls in a prototype, and I’m creating a dashboard overlay to represent background processing, loading asserts server, search data on the server, finally to represent…
-
3
votes2
answers361
viewsA: Load Javascripts to Webview Android Kitkat
From API 19 the method loadUrl, does not run more script and should only be used for URL’s. For this purpose was added to the Webview the method public void evaluateJavascript (String script,…
androidanswered Fernando Leal 9,770 -
2
votes2
answers125
viewsA: How to loop with regex in javascript?
I’m not sure I understand, your problem. But if I understand you want to search a given sentence for two blank spaces in a row and replace them with ".."? Right? If so, just change the replace thus:…
-
5
votes3
answers407
viewsA: Generate setters only in class constructor or generate outside constructor
Although there are already good answers, with good explanations, had no examples to exemplify the question, so I’ll post my answer with a simple example to try to add value to the question.…
-
3
votes2
answers7414
viewsA: Manipulating String in Java
You can use regular expression for this purpose. Split The method split of String Java accepts regular expression. See here in the documentation. Something like that: [.;,:!?] (is a group of…
-
4
votes2
answers909
viewsQ: Convert List<T> to T... dynamically in a method call
I’m in need of something that seems to be simple, but I’ve been doing some research and trying and I haven’t found anything that helps me. Problem I have a list of the kind List<T> I receive…
-
2
votes4
answers3610
viewsA: Receive an array in the controller from javascript
You must specify that it is an array like this and pass each value as a parameter, only all with the same name, for example: /?arr[]=foo+bar&arr[]=baz&arr[]=foo Or still for some cases (such…
-
1
votes1
answer2650
viewsA: Update with Inner query by selecting the same table
Your SQL is a little disorganized. And the error there is already giving a hint, "you are not specifying the target table, where you will update". From what I understand you want to update the table…
-
5
votes1
answer120
viewsQ: Is it possible to call the Internal (no visibility operator) method from a class inherited from another package?
Problem I’m trying to create some extra behaviors in some native Android components. For that I am creating a class above the Android component and rewriting some situations I intend to have a…
-
2
votes1
answer655
viewsA: How to generate data for Graphics
There’s the library jLinno, I’ve used this library and it served me very well, I didn’t use the part of GROUP BY (but if you look at the source there is the group()) method, I’ve always used but the…
-
2
votes3
answers3288
viewsA: Working with delay’s on Android. Best approach?
Checking some native implementations of Android, to understand how it works and to be able to create some customizations in my implementation. I came across a native approach and attached to Android…
-
4
votes3
answers2716
viewsA: Is it possible to create a MAP<> within another MAP<>?
It is possible yes, you entered normally like this: Map<String, Map<String,Object>> mapTESTE = new HashMap<String, Map<String,Object>>(); Map<String, Object> segundoMap…
javaanswered Fernando Leal 9,770 -
7
votes9
answers2096
viewsA: How to assign a function with parameters to click without executing it?
After your comments, I would create an event manager, who would be responsible for getting the event (in case of a click), and calling the required function, based on some criteria. This would…
-
3
votes1
answer1426
viewsQ: Is it possible to create a Listview Android Horizontal?
Problem I need to implement a ListView horizontal, to create a horizontal navigation bar over my Product Gallery in my Sales Catalog. With the intention of making navigation but intuitive and easy…
-
0
votes3
answers1650
viewsA: How to make a POST that passes beyond the form, a file?
This is a question I had a long time ago and researching I arrived at the following answers/ conclusions: As far as my knowledge goes, currently the answer is no, it is not possible to send data…
-
4
votes2
answers1253
viewsA: Attach TXT file using Javamail
I believe you have to say explicitly that this "Bodypart" is an attachment, add this line: attachment.setDisposition(MimeBodyPart.ATTACHMENT); Or still try to do it that way (Full example): public…
-
2
votes3
answers1649
viewsA: Send email with STARTTLS porta 587
Comparing here to one of mine, configured with Javamail which has been working perfectly for some time, to TLS, the properties it has of different are: In my has:…
-
5
votes1
answer328
viewsA: Is it possible to set Android Camera resolution?
I never used this functionality, but already studying other features of the Camera, I saw that there was this possibility. There is a method in Camera.Parameters, who is called setPictureSize (int…