Posts by anmaia • 2,420 points
49 posts
-
4
votes2
answers755
viewsQ: What does the dereferenced compilation error mean in Java?
In a test code (in Java), whose goal was to convert a string in one another string between upper and lower case letters, I received the following error at the time of compilation: error: char cannot…
-
0
votes1
answer800
viewsA: Build complex Lambda Expression
The query you are wanting to build (perhaps) is not (is) necessary. You can achieve the same result using the join among the collections items and sValues. See an example below: var result = from x…
-
8
votes3
answers2984
viewsQ: How to name a unit test when using TDD?
It is common to use nouns to name: classes (Car, Vehicle, Notafiscal); action verbs (infinitive or not) for method names (Calculartotal/Calculatotal, Lertodasaslinhas, Closeconnection, Abra…
-
4
votes2
answers19011
viewsA: Change Javascript text
Change to: <text id="txtrect" x="5" y="35" font-family="Verdana" font-size="11" fill="white" > Rect </text> and document.getElementById("txtrect").innerHTML="teste"; That should solve…
javascriptanswered anmaia 2,420 -
2
votes1
answer260
viewsQ: System.Outofmemoryexception - Parser for large files
I created a simple grammar to interpret a file whose format is much like a JSON. However, when I try to parse the file I get the exception Sytem.OutOfMemoryException. This is because of the file…
-
1
votes1
answer1269
viewsA: Could not load file or Assembly '.. ' or one of its dependencies. - Add a blank space on web.config back to work for hours
This problem is related to . dll CHAT_Megacorretor, Version=1.0.0.0, Culture=pt-BR, PublicKeyToken=null undetected. Review the settings for pool which is linked to its application. Perhaps the pool…
-
6
votes1
answer699
viewsQ: What tools are available for code coverage in . NET in Visual Studio?
I have developed systems using TDD in .NET. Recently, the company I work with, bought the version of Visual Studio 2013 Pro and, in this version we do not have the code coverage tool (code…
-
1
votes2
answers96
viewsA: Insert into multiple tables
Your problem happens because of the delimiters. You need to change the delimiter (;) for a moment, so that your program can pass the text from the Procedure to Mysql. For more details, see mysql…
-
1
votes2
answers460
viewsA: Build possible combinations
Another way to generate this arrangement would be by using the Selectmany. See an implementation: // Não utilizei objeto criado por você para facilitar o exemplo. var categoriaA = new[] {…
-
1
votes1
answer58
views -
1
votes1
answer1103
views -
1
votes1
answer87
viewsA: How to define data that will be shown in gridView
Everything you have done is correct, but there are still some adjustments: Apply the property AutoGenerateColumns of gridview for false. Create the columns in html and apply the respective property…
-
35
votes2
answers31112
viewsQ: When to use ANSI and when to use UTF-8?
Is it more advantageous to use an ANSI type instead of a UTF-8 type or vice versa? Is there any gain in performance or storage between types?
-
1
votes2
answers721
viewsA: How do I direct an Action to a view inside a folder?
Use: return View("caminho/para/sua/pasta/NomeDaView"); For example: Controller: MyController Action: MyAction Link: MyController/MyAction View: Views/MyController/PastaQualquer/MyAction public…
-
1
votes2
answers7725
viewsA: Copy content from a div by clicking a button
To do the same with jQuery is the following: $("#link").text($("#btCopia").text()) This code snippet will copy the value of btCopia for link. Suggestion Modify your html and javascript to capture…
-
1
votes1
answer1394
viewsA: Updating Div of data from a Json file without flashing the screen
In this case, to not "blink" the screen, you should call the javascript several times and not the location.reload(). Change the setTimeOut function to Chara Callback and place the callback call at…
-
0
votes2
answers76
viewsA: Error using store Procedure - Entity
Some column is returning null when you run the trial. Run the Procedure directly in the database, see if it has any value returning nulo Adapt your process to not return null.…
-
1
votes6
answers1170
viewsA: Why is it not possible to define an interface with static methods?
There are basically two types of methods: instance methods and static methods (class methods). This concept belongs to the object-oriented paradigm, is not particular to any language. Because static…
-
36
votes4
answers67145
viewsA: Composition and aggregation: what are the differences and how to use them?
The difference between composition and aggregation is related to the existence of objects. This difference is not addressed by the object-oriented programming languages (at least not conventional…
-
1
votes1
answer131
viewsA: Migrations Entity framework method
Is there a way to execute the migrate.exe manually, in command line. For example: Migrate.exe MyApp.exe /startupConfigurationFile="MyApp.exe.config" /targetMigration="update-database" To create a…
entity-framework-6answered anmaia 2,420 -
5
votes1
answer650
viewsA: "Listen" directory using Java
You can use the Watch Service API. See an example of how to do: import static java.nio.file.StandardWatchEventKinds.*; Path dir = ...; try { WatchKey key = dir.register(watcher, ENTRY_CREATE,…
-
3
votes4
answers29756
viewsA: How to change dates from the American format y/m/d to d/m/y?
Maybe you can use the locale. Take an example: <?php /* Define o local para Holandês(usar pt_BR para o Português(Brasil) ) */ setlocale (LC_ALL, 'nl_NL'); /* Mostra: vrijdag 22 december 1978 */…
-
2
votes3
answers20150
viewsA: Converts negative number to positive
According to the suggestion of @Olimon F. and solving in just one line int i2 = -1; int x = ((i2 < 0) ? -i2 : i2); System.out.println(x); // output: 1
-
5
votes1
answer365
viewsA: What does "introspection at runtime" mean?
Type introspection allows the program to examine the structure of a type or object at runtime. For example, at runtime, it is possible to know if a type X has a specific method/function. An example…
-
3
votes1
answer1469
viewsA: Block access to files from certain directories if not authenticated
Add in your web.config file the following directive: <location path="Caminho/Para/Pasta/Publica"> <system.web> <authorization> <deny users="?"/> </authorization>…
-
4
votes2
answers490
viewsA: How to persist the status of a queue of requests?
Actually, in my opinion, the order attribute is not part of a class Pedido. The best modeling would be to create a class ItemFila. See a proposal below. Suggested implementation class Fila{…
-
2
votes1
answer664
viewsA: How to create redirects by country?
You can use some features. When the browser has access to geolocation You can use javascript to get the request geolocation. However, you will have to know that longitude A and latitude B, is part…
-
5
votes3
answers1376
viewsA: How to return most common words from a text with PHP?
Try it like this: print_r(array_count_values(str_word_count($texto, 1, "óé"))); Upshot: Array ( [Hoje] => 1 [nós] => 1 [vamos] => 1 [falar] => 1 [de] => 2 [PHP] => 2 [uma] => 1…
-
0
votes1
answer521
viewsA: Visual Studio 2010 and Connection with Banco Access
It seems that this problem occurs in x64 versions. Try to install the Microsoft Access Database Engine 2010 Redistributable. More details about the problem here.…
-
3
votes9
answers166445
viewsA: How to hide/show a div in HTML?
Maybe it’s just a few syntax errors. See an example below: document.getElementById("minhadiv").style.display = 'none'; In this case, minhadiv is the id of the div.…
-
1
votes1
answer2270
viewsA: Print position of a matrix
Change: scanf("%d",&maior); To: scanf("%d",&matriz[i][j]); You are not reading the correct value.
-
1
votes1
answer155
viewsA: Syntactic Reader (Extension of Visual Studio 2013)
In his parser, if you are using regular expression to identify the tokens and C#, you must enable the option Multiline (m) when executing the match of tokens according to your standard. I’ve had to…
-
1
votes3
answers1945
viewsA: Gridview Templatefield
I did some more research and I realized you used this example to create columns dynamically in your gridview. To find the correct control in the cell, a few steps are needed: 1.Apply a custom…
-
1
votes3
answers1945
viewsA: Gridview Templatefield
Maybe your problem is at the time of Textbox rendering. I made an example with the data you sent (HMTL + C#). In this example, I changed the way to add custom fields to gridview. See below: Same…
-
1
votes1
answer65
viewsA: Delete From does not work on C#
Possible mind the where is not finding any record. To test better, put a break point on the line String strSql = "Delete from Cliente where codcliente=" + Session["_uiUserID"]; and take the result…
-
0
votes1
answer562
viewsA: Filling with Dynamic Templatefield
Using the common form of DataBinder.Eval doesn’t really work for field names that contain .. The alternative forms are: ((System.Data.DataRowView)Container.DataItem)["C.json"] or…
-
3
votes2
answers2257
viewsA: How do I get the class name in a static context?
I do not believe it is possible to get the name of the base class via reflection when this class is static. You will need to have a direct reference to the class you want to know the name of. This…
-
1
votes1
answer627
viewsA: Image upload using Webservice C#
To upload a photo, you can use the Webinvoke annotation, which allows you to create WCF endpoints in REST format. Follow the code passage to the explanatory: [WebInvoke(UriTemplate =…
-
1
votes3
answers266
viewsA: Pagination of Text
A suggestion, with a more elegant form in javascript would be: var text = 'O texto de 5000 palavras foi omitido aqui, mas está em um exemplo no fiddlejs logo abaixo'; var re = /\s+/; function…
-
1
votes2
answers186
viewsA: DB Dinamico Mongodb
mongoDB is a document-driven database, so it is Nosql. It means that nay it is necessary to have a rigid structure for each record, you can adjust it/modify it in the format you want. mongoDB…
-
4
votes1
answer112
viewsA: Model with dynamic type properties
Use the dynamic C#. public dynamic procodigo { get; set; } In that case, you don’t have to worry about which type will be stored. Both decimal how much int worked perfectly. For more information see…
-
3
votes2
answers343
viewsA: Regex in Javascript: grouping
Your problem is in while and in the regular expression you are using. To run it multiple times, you have to use the option g. See more details on the website of Mozilla. Use the regular expression:…
-
1
votes1
answer92
viewsA: Problem to add item in Tree with Extjs
You must get the train .getRootNode();, which is a Ext.data.NodeInterface of your Tree. With the NodeInterface, you have the methods: appendChild, getChildAt, getChildAt. By combining these methods,…
-
31
votes8
answers16426
viewsA: Why is using "SELECT * FROM table" bad?
SELECT * FROM Tabela is considered a bad practice because the fields that should be designed for the return of the query are not specified. Every time you use *, it is necessary that the database…
-
0
votes2
answers104
viewsA: When concatenating into LINQ returns error
Your problem may be with the variable usuario Change: telefone1 = "(" + usuario.DDD + ")" + usuario.Telefone To: telefone1 = usuario == null ? "não informado" : "(" + usuario.DDD + ")" +…
-
5
votes2
answers1137
viewsQ: Standards for user authorization/permission
There are other standards for user authorization/permission other than the Role-based access control standard implemented by Microsoft for technologies. NET?
-
0
votes4
answers5635
viewsA: Make a regex to remove characters
The most efficient way in javascript is: var val = "/Date(1402369200000)/"; var re = "/-?\d+/"; console.log(re.exec(val)); // output: ["1402369200000"]
-
2
votes2
answers558
viewsA: Jquery does not mount date correctly
Use: var x = "/Date(1402369200000)/"; var re = /-?\d+/; var m = re.exec(x); var d = new Date(parseInt(m[0], 10)); console.log(d); // output: Tue Jun 10 2014 00:00:00 GMT-0300 (Hora oficial do…
-
4
votes1
answer194
viewsA: Date is coming in wrong format
The value /Date(1402369200000)/ is in (Unix) epoch format (see wikipedia). To convert Date to javascript use: var x = new Date(1402369200000); console.log(x); // output: Tue Jun 10 2014 00:00:00…