Posts by Fernando Leal • 9,770 points
219 posts
- 
		1 votes1 answer82 viewsA: How to declare an extended type in TypescriptYou could do something like this (which will unite the definitions of the two statements, which seems to be your intention): let Bar: { c: boolean } & Foo; Then you can access the properties… typescriptanswered Fernando Leal 9,770
- 
		3 votes0 answers80 viewsQ: How to maintain synchronized tables in different databases?Problem I have a problem where I need to synchronize some tables from a legacy database to another simpler database that will be used by an external application. Attempts So I started to analyze… 
- 
		7 votes3 answers520 viewsQ: Why do line breaks between elements cause space between them?I was doing a few code organization here before commiting and realized that an indentation in HTML caused a problem in my layout, so I went to inspect to find out what I had done wrong besides… 
- 
		0 votes2 answers497 viewsA: Is there any other way than with HQL, to bulk update with Nhibernate?Currently with Nhibernate 5.0 the following functionality has been included: Modifying entities Inside the database, implementing something similar to the one sought in the question: Updating… 
- 
		0 votes2 answers1846 viewsA: How to create a static method in a public class?How do you have a dependency on ToastController, which is an available Ionic service to be injected, the correct would be for you to create another service to do your message handling. To accomplish… 
- 
		2 votes1 answer413 viewsA: Is it possible to create an object/class/interface that represents a Function signature?It is possible to use type aliases: type Expression<T> = (t: T) => void; Thus the signature of the method: class Test{ testMetadada<T>(expression: Expression<T>) { // ... } }… 
- 
		3 votes1 answer413 viewsQ: Is it possible to create an object/class/interface that represents a Function signature?Everything already works as expected in my code. What I want is to make it more verbose, making the signatures of the method more self-explanatory (I know I can use Docs comments for this, but I… 
- 
		2 votes3 answers2418 viewsA: How to make a rectangle of asterisks using for?With for you could do something like: int colunas = 7, linhas = 4; for(int l = 0; l < linhas; l++){ for(int c = 0; c < colunas; c++){ System.out.print("*"); // colunas } System.out.println();… 
- 
		2 votes1 answer236 viewsQ: Intercept all HTTP requests from angular2I’m looking for a way to intercept all HTTP requests from the angle and add a few headers. In versions prior to angular2 RC5 (before the NgModule) was that way, for example: class MyOptions extends… 
- 
		1 votes1 answer107 viewsQ: Entity Framework does not convert Firebird INTEGER to C#longI am doing some tests with Entity Framework mapping and migrating a database of a legacy system. Setting Where I have a table similar to that: TESTE -------------------------------------- ID INTEGER… 
- 
		1 votes1 answer451 viewsQ: How to define Generator (from Firebird) for an Entity framework 6 model field?For example: I have the following table: TABLE_EXAMPLO ----------- ID NAME And the following Generator: TABLE_EXAMPLO_GEN How I would map the entity so that the Entity Framework can call Generator… 
- 
		3 votes2 answers34 viewsA: If I return something within a using, will the resources be released?The answer is: will be released yes. the using in C# is a syntactic sugar, which is nothing more than a try ... finally at the end, where this your code: public void FuncNaoFazNada() { using(var acd… c#answered Fernando Leal 9,770
- 
		3 votes2 answers153 viewsQ: Keyword for C# equivalent to Java’s "Synchronized"Problem I am implementing a connection manager that implements the standard Singleton, managing a pool connections with unique keys for each new connection. So I’m having problems with the… 
- 
		2 votes3 answers15821 viewsA: REGEX - find expressions that DO NOT contain specific wordsYou can do the following: COM\s(?!REV|LIB) Example of the expression in operation. This expression will only select COM that is not preceded by REV or LIB. Explanation (Simple because I have no… 
- 
		2 votes2 answers1419 viewsA: Place table column value in an inputA simpler way to do this (assuming jQuery is an option) is to use the method .closest() jQuery, that returns in the tree DOM and selects the next parent element as selector. Something similar to… 
- 
		2 votes2 answers449 viewsA: How to create summation with "sum" with multiple queryover columnsSolution based in this OS response. You can use Projections.SqlFunction, to apply a projection customized in Projections.Sum, using the NHibernate.Dialect.Function.VarArgsSQLFunction to inform the… 
- 
		3 votes2 answers906 viewsA: Calculate difference between dates and change statusI will not answer you how to do this in the database, I will propose you a way that (in my opinion) is more suitable for calculated values. Where these calculated fields would not be fields saved in… 
- 
		1 votes1 answer217 viewsA: Slowness with FluentnhibernateNot necessarily will that be an answer, but maybe it’ll help you! Settings Some questions about your settings: How you are setting up the Nhibernate session? Is using which Schema? SchemaUpdate?… 
- 
		5 votes3 answers1037 viewsA: Where dynamic Linq to SQLI am working with this currently, and recommend using System.Linq.Expressions.Expression, Lambda and a little bit of Reflection for that reason. Example: string campo = "Campo"; string valor =… 
- 
		1 votes2 answers2275 viewsA: Circular reference between two projectsA possible solution if this is necessary for your solution is to modify the structure of your projects. Creating a third project ProjetoBase, to where you will pass all the Forms which are common… 
- 
		8 votes2 answers2209 viewsQ: How to Extend/Inherit Angular2 Component?Doubt I would like to create extensions for some components already implemented in Angular 2, without having to rewrite them almost completely, because the base component could undergo changes and I… 
- 
		2 votes2 answers2056 viewsA: Auto scroll down bar in chat div(window)You should apply a scrollTop with the new size to each message inserted in the chat, causing the scroll to be applied. You can use the method animate jQuery to apply a less abrupt effect to… 
- 
		1 votes0 answers409 viewsQ: Keep valid Angular2 routes(URL)I am starting the studies at Angular 2 and found a possible limitation that does not seem interesting for my application use case, because it seems to me it is not possible to reconstruct the state… angularasked Fernando Leal 9,770
- 
		0 votes2 answers174 viewsA: How in ASP.NET 5 is this property defined?What @Maniero said in your answer is correct! And that is internal process that is used to obtain the value of EnvironmentName. But to test your system in another environment at development time you… 
- 
		1 votes1 answer272 viewsA: You doubt with Fluentnhibernate mapping?This answer is not intended to solve the problem, but rather to point out flaws and suggest possible alternatives. Possible problems/failures Based on your clarifications in the comments, your model… 
- 
		1 votes2 answers76 viewsA: Split arguments with regexI’m not familiar with PHP, but I created an example in javascript that might help you understand the regular expression (follow the comments in the code): function splitArguments(arguments) { return… 
- 
		2 votes2 answers658 viewsA: Mapping Composite key nhibernate with Firebird bankThe problem is described in the log stack error in the following line: composite-id class must override Equals(), where to use and map a CompositeId (composite key) in your mapping, you should… 
- 
		2 votes4 answers728 viewsA: Dynamically assign functionYou can add an event to capture all events from click in the body, or restrict to a container where all the .box: document.querySelector(".container_boxs").addEventListener('click', function(e) {… 
- 
		2 votes1 answer132 viewsA: .load() without replacing, just addYou can request the page by AJAX ($.get(), for example with jQuery) and in callback Success add it to the page with a good understanding, something similar to that: $.get('ajax/test.html',… jqueryanswered Fernando Leal 9,770
- 
		1 votes0 answers61 viewsQ: Multiple update commands separated by ";" (dot and comma) in Sqlite!Problem I am trying to apply the following script/command to a version of my Sqlite database: UPDATE UF SET DATE_CREATE = DATE_UPDATE; UPDATE CIDADE SET DATE_CREATE = DATE_UPDATE; UPDATE CLIENTE SET… 
- 
		2 votes1 answer499 viewsA: Pick up CSS Specific Element with Sign +What you can do and consider the most usual and correct in this case where there may be an element between them or not, and in your case where you know and have control over the element… 
- 
		9 votes2 answers509 viewsQ: How to get the instance of the top/parent object in a javascript Function?I am implementing a method extension library of prototype, and if I do it simply everything works perfectly as you can see in the simple example below: String.prototype.append = function(value) { //… javascriptasked Fernando Leal 9,770
- 
		1 votes2 answers265 viewsA: Error Nhibernate System.Invalidcastexception - Manytoonetype to ComponenttypeIf my comment the question is true, you want to map a FK (SubClasse.ClassePrincipal.Codigo), as FK and also with PK, in SubClasse, right? I had this problem long ago and found this excellent… 
- 
		2 votes3 answers2346 viewsA: How to find 2 or more words in a text using jQuery?You could use regular expressions, and some logic to generate wildcards in your query. Something in this idea (follow the comments to understand the solution): function prepareQuery(query){ return… 
- 
		6 votes3 answers2089 viewsA: Calculate on which days of the week the days of the month fallI don’t know if I understand, but if you’re having trouble getting the day of the week that your Dates, you can use the method Date.prototype.getDay() which returns the value of the day of the week… javascriptanswered Fernando Leal 9,770
- 
		5 votes1 answer332 viewsQ: Documentation for creating files in PDF formatI am some time analyzing free libraries for creating PDF for use in commercial applications on Android, and so far I have not found one that meets all my expectations, functionalities and licenses.… 
- 
		3 votes1 answer710 viewsQ: Send HTML e-mail with Android formatting (style inline)I am trying to send a personalized email through new Intent(Intent.ACTION_SEND), containing in the email body a formatted HTML, but when selecting the Gmail application, for example, the whole style… 
- 
		6 votes1 answer488 viewsA: Replace with Fragment does not work properlyAs I quoted in the comment, "You’re giving replace in the Fragment, but you have to do replace in a FrameLayout". In fact the replace does not exchange the element but the content of the element. It… androidanswered Fernando Leal 9,770
- 
		12 votes1 answer2421 viewsQ: What is the best way to store money in Sqlite?Li that post on the lack of precision of double, and virtually every link in the post. Then I realized that this was a vulnerability of my software in production (since I have rounds to every corner… 
- 
		6 votes1 answer882 viewsQ: What safe way to check if an object is numerical?I am implementing some generic functions in a module of my system, and I want to treat in a certain situation if the record is numerical (I do calculations). Then searching some way to do without… 
- 
		3 votes2 answers1623 viewsA: Concatenate number sum to a stringSimply because there is a logic error in the first version. Where are you doing x + 1, and in the second version i + 1. I believe whatever you want to be i + 1. Also to a previous problem of… 
- 
		2 votes1 answer236 viewsA: Control User Agent to call iframeTo change the user agent of a iframe, or a page is possible with javascript as follows: Set the function to set the user agent: function setUserAgent(window, userAgent) { if… 
- 
		0 votes1 answer598 viewsQ: Capture events on volume buttonI’m trying to record and capture events on the volume buttons of Android, so I can start and stop a service. Researching I found several solutions using Broadcastreceiver, but it seems that none is… 
- 
		2 votes2 answers286 viewsA: How to Show Half of BackgroundYou can use the technique of gradient, where in his background-image you use the linear-gradient (that may not work on some older browsers), to make your background half transparent and half visible… 
- 
		3 votes2 answers1625 viewsA: Phpmailer - CSS does not appearWell your problem has no relation any problem with PHP or with Phpmailer, but rather that, style CSS does not work for all email providers. In your case the destination is gmail and this removes all… 
- 
		16 votes2 answers1619 viewsQ: Multi-core Cpus - Why doesn’t my application use all the processor cores?I have a doubt I can’t find a convincing answer. There is an application developed in Delphi 7, and in an extremely complex routine (it takes about 2 hours) we notice that it is only used for the… 
- 
		5 votes1 answer152 viewsA: What would Take and Skip be in Linq?There are two query filters LINQ or Lambda Expressions which has its SQL equivalents, in case they are executed on a ORM, as in your case Nhibernate: Consider this table in the examples: ID | NOME… 
- 
		4 votes3 answers276 viewsA: Why does it always return null?The problem is that its variable linha is not added to the document so that you can make the selection through document.getElementById('id1'), then to solve this without using jQuery, you must add… 
- 
		0 votes1 answer87 viewsA: How to popular a Jsonobject in hand?If you pass your String in JSON format to your Jsonobject object, you can do something like this: try { String stringJSON = "{interests : [{interestKey:Dogs}, {interestKey:Cats}]}"; JSONObject obj =… 
- 
		4 votes5 answers2182 viewsQ: How to select a full xml/html tag with Regular Expression even if there are identical tags internally?I am trying to do the following processing in a javascript string using ER (Regular Expression): With that input: um <b>negrito<b>negrito interno</b>externo</b> aqui…