Posts by Oralista de Sistemas • 23,115 points
435 posts
-
4
votes2
answers96
viewsQ: Search performance involving multiple disks
Supposing that a query using JOIN between two or more tables, such as: SELECT * FROM foo INNER JOIN bar ON foo.id = bar.id There is performance gain if the table data is in different HD’s (due to…
-
7
votes2
answers1160
viewsA: How to develop a private Restfull API?
I think you can define a key in the code yes, as long as the encryption algorithm is asymmetrical. It works as follows: you have a pair of keys, the public and the private. These names are arbitrary…
-
6
votes5
answers16703
viewsA: Fill left zeros in Javascript
Just do something like: var foo; // preencha esta variável com o seu texto. /* sério, preencha foo. */ foo += ""; // só por paranóia. Se foo não era string até aqui, depois desta linha será. while…
-
4
votes1
answer72
viewsA: Local Bank Storage Method
If you have SQL Server installed on the laptop, the ideal is for you to take a backup of the database on the development machine, and recover it on the laptop. It is the recommended procedure and…
-
15
votes3
answers1089
viewsQ: What are the pros and cons of indexing vectors by zero or one?
Most programming languages I know have zero as the first index of a vector. I know that several programming languages have content um as the first vector index. Until recently I thought this was…
-
4
votes2
answers615
viewsA: Split in VBA does not work
The problem is the third parameter. For official documentation of the method, the third parameter is the maximum amount of substrings you want. If not reported, or if the default value (-1) is…
-
9
votes2
answers6315
viewsA: Heap of Java memory
Everyone knows that computers are machines that work with binary code. All a computer handles are zeros and ones. So when you have a die in your program, you have a set of zeros and ones. But this…
-
4
votes2
answers213
viewsA: Apple forcing to develop app for iPhone and mandatory for iPad, is that right?
The problem ai is of text interpretation. Emphasis on the following points: 2.10: iPhone Apps must also run on iPad without modification, at iPhone Resolution (...) And Your app Did not run at…
-
4
votes2
answers1234
viewsA: How to generate a file in the same exe directory
Thereby: string caminho = System.Reflection.Assembly.GetExecutingAssembly().Location; Then you get the directory where the executable is. You can use the method GetDirectoryName class Path to get…
c#answered Oralista de Sistemas 23,115 -
3
votes2
answers2679
viewsA: Fill Dataset with Datatable
The Dataset class has a property called Bobby Tables. This property is a collection of tables. So just call the method Add of the collection. So: using System.Data; /* .. SNIP .. */ DataSet foo =…
-
4
votes2
answers1762
viewsA: How to return the position of an element in the Hashset?
A hashset is like a book, in which the keys are the summary and the values are the chapters. In other words... When you insert an element into a hashset, a hash object. Hence you have a structure…
-
13
votes4
answers2383
viewsQ: More important than important
My style sheets declare formatting for a class more or less like this: .foo div label { width: 100px !important; } This comes from a plugin. I would not like to change the plugin’s style sheets, but…
cssasked Oralista de Sistemas 23,115 -
9
votes2
answers14324
viewsA: Check whether the string is null or empty
I will assume that the language you use there is Java. You already know how to compare with null (for example, Nome != null). If the string is not null, you can see its length through your length…
-
3
votes3
answers2742
viewsA: Is there a better way to insert an option in select with jquery?
The right answer is a big one depends on. The way you exposed it is basically the pattern. Almost all examples of official documentation basically do this, use the method append to transform strings…
-
5
votes1
answer12649
viewsA: Algorithm that reads 50 numbers, calculates and shows the arithmetic mean, the largest and smallest number
The structure that makes "for i of 1 to 50 make"... is called loop (in English, loop). It’s something practically universal in programming and I believe you should be studying it these days. You…
algorithmanswered Oralista de Sistemas 23,115 -
1
votes0
answers59
viewsQ: How to search by distance
I have a database with coordinates of several locations. I would like to know how, from an informed location, to get only the places you are until a certain distance. I saw a similar question: How…
-
26
votes3
answers8812
viewsQ: How to determine the user’s approximate location by IP?
When I use search engines for certain searches, mainly related to maps or commercial establishments, these systems usually serve me results relevant to my geographical location. When I’m on the PC,…
ipasked Oralista de Sistemas 23,115 -
6
votes1
answer208
viewsA: Javascript loop
When you make a query of those in jQuery and calls the method val, you affect all the items that fit the query. That’s why all lines have the same text. JQuery objects have a function each, iterates…
-
1
votes1
answer114
viewsA: Selecting Specific Lists
You are working with the Sharepoint JCOM library. The list object definition for this library can be seen at this link: http://msdn.microsoft.com/en-us/library/office/jj245826(v=office.15). aspx…
-
4
votes3
answers1816
viewsA: Find sum of values in array
I’ve never programmed in PHP in my life. I’ll leave an algorithm here in javascript - I ask someone to create a new answer by converting to PHP (will have my upvote). First you take all possible…
-
3
votes3
answers1346
viewsA: Generating an image based on other images
In general, it is not possible to generate Javascript files when it runs in the browser. If this were possible, we would have a security breach. You can generate the file in PHP and go up to the…
-
11
votes3
answers212
viewsA: What is the reason for this IF/ELSE assignment?
In several languages (Javascript and C are also like this), it is common that the 0 is treated as equivalent to false in flow deviations (IF). This is for design. In the specific case of PHP, an…
-
3
votes3
answers261
viewsA: Mathematical combinatorics
Since you didn’t specify language, I’ll give you an example in Javascript: var result = {}; function MeDaUmNumero(arr) { result[arr.join(", ")] = true; if (arr.length === 1) { return arr[0]; } for…
-
5
votes2
answers90
viewsA: Extra information on a user login
If all you want is to have these values to use while the user is logged in - or if you want to use these values only in the next request - you can use the user session. The session is an object that…
-
3
votes2
answers44
viewsA: Table formats?
Uses a fieldset. The tag fieldset must necessarily have a daughter tag legend, which is his text. Looks exactly as you want, this tag was created for this. <fieldset>…
htmlanswered Oralista de Sistemas 23,115 -
1
votes2
answers499
viewsA: How to make the server return a page without the browser request
Let me focus on what I think is the key point of your question: (...) i wanted to leave a page with a message for example, "Validating, wait" (...). I’m no expert on MVC. I believe that if you force…
asp.net-mvcanswered Oralista de Sistemas 23,115 -
2
votes2
answers83
viewsA: Creation of a mailClient
There are two ways. If you open a telnet connection to an email server, you can pass the IMAP protocol commands via prompt. Try it, it’s fun! And if it’s possible with Telnet, it’s possible with...…
-
4
votes3
answers476
viewsA: How to see the implementation of a function?
Editing here, complementing the original answer below: The implementation of these functions and operators is a very complex thing, and if you are a beginner I recommend not stress about it now.…
canswered Oralista de Sistemas 23,115 -
3
votes3
answers794
viewsQ: Capture content to be pasted
I need to capture the content of a text that will be pasted into an input, before the glue happens. I’ve already captured the collage event: $(input).on("paste", function (evt) { /* evt contém tudo…
-
10
votes2
answers882
viewsQ: Standard for typifying errors/exceptions?
As far as I know, Javascript has no error typing. In C# and Java, it is possible to do things like: try { /* .. snip .. */ } catch (FooException foo) { /* .. snip .. */ } catch (BarException bar) {…
-
3
votes2
answers1101
viewsA: Distinct in the Plains does not work
Says the documentation of the Distinct: Returns the distinct elements of a sequence using the standard equality comparator to compare values. Emphasis on comparador de igualdade padrão. The standard…
-
2
votes1
answer111
viewsA: How to identify the type of data the user typed in a prompt or input?
If you want to ensure that what the user typed can be treated as a number, the functions parseInt and Number help you. If what the user typed cannot be converted to number, you will get the value…
-
1
votes1
answer924
viewsA: Access login protected page with C#
If you are going to request via C#, then one of the minimalist ways to do this is with the class System.Net.Webclient. You can authenticate using the properties Credentials and…
c#answered Oralista de Sistemas 23,115 -
9
votes2
answers181
viewsQ: Do not ask for credentials if user is not authenticated
I have a system with two sites in the same domain. The two sites are in separate folders of the same domain, more or less like this: http://renan/foo http://renan/bar The first site (let’s call it…
-
1
votes1
answer1654
viewsA: How to insert a data table into the database?
I’m a little rusty about it, but a little double Sqldataadapter with Sqlcommandbuilder can be a hand on the wheel. Anything of the kind: using (SqlConnection connection = foo /*assumindo que foo é…
c#answered Oralista de Sistemas 23,115 -
40
votes3
answers2698
viewsQ: What are covariance and countervariance?
I saw something like in this question and I know that this relates in some way to object orientation. What are they? How do they affect my code, and how can I use them to encode better?…
-
7
votes3
answers176
viewsQ: How to get the line separation of the system
Some operating systems (i.e.: Windows and BSD) like to break lines with Carriage Return (CR) followed by Line Feed (LF), or \r\n. Already GNU/Linux, OS X and other Unix-like usually break only with…
javascriptasked Oralista de Sistemas 23,115 -
10
votes5
answers680
viewsA: What to do when a UI element cannot be used by a user?
My personal opinion is the same as Joel Spolsky. Do not hide or disable. I’ll leave the translation here: A long time ago, it became fashionable and even recommended to disable menu items that…
uxanswered Oralista de Sistemas 23,115 -
19
votes8
answers34672
viewsA: Convert every first letter of every word into uppercase
How about something like: function titleize(text) { var loweredText = text.toLowerCase(); var words = loweredText.split(" "); for (var a = 0; a < words.length; a++) { var w = words[a]; var…
javascriptanswered Oralista de Sistemas 23,115 -
4
votes1
answer394
viewsA: How to make object design control faster in a C#form
You can put any logic you want asynchronously into a class object System.Windows.Forms.Form. But the screen update is done in an internal method that is synchronous. If you want to animate movement…
-
1
votes1
answer53
viewsQ: Alternative to File API for outdated browser
I need to read the binary of a file and post to a certain URL, but without storing the file itself to the server (I cannot store the file). To complicate - I would love to use the HTML5 file API for…
-
1
votes1
answer343
viewsA: How to reference the original software in a modification?
See what the original licence says about that: Redistribution and use in source and Binary Forms, with or without modification, are permitted provided that the following conditions are met:…
licenseanswered Oralista de Sistemas 23,115 -
34
votes2
answers2030
viewsQ: How does a birthday attack work?
I’ve heard of a technique called that, and something about exploring hash collisions. But how does this technique work, and where it can be applied?
-
5
votes1
answer1042
viewsA: How to get your site highlighted on the right side of Google
To appear there, you need pay Google for the privilege. The service is called Adwords. Worth it read the FAQ before deciding whether it is worth the cost-benefit.…
-
1
votes2
answers3994
viewsA: How to calculate total table value with Javascript?
Being very pedantic: your code makes the queries $('#calculaTotal tbody tr') and $('.total') every time the user hits a key. Keep it in variables that your code becomes more performatic, because…
-
13
votes4
answers2358
viewsA: How to count how many times a value appears in a table
Just use a dictionary keyed values in cells ;) Kind of: var dicionarioDeValores = {}; $("#table") .find("td") .each(function (index, elem) { var valor = $(elem).text(); if…
-
4
votes3
answers1523
viewsA: How to access one selector within another in jquery?
Two things: First, putting the jQuery code in the Jsfiddle Javascript block is a crime. If you look at the top left corner of the Fiddle, it has an option there to include jQuery automatically ;)…
-
3
votes1
answer846
viewsA: How to extend the storage capacity of char variables
You are using the following statement: struct dicionario { char palavra[21]; char definicao[51]; }; The definitions of your entries cannot be more than 50 characters long. Now let’s count... The…
canswered Oralista de Sistemas 23,115 -
1
votes2
answers691
viewsA: How to index an iframe in Google?
Google indexes content through its links. In other words, it doesn’t matter if it’s an iframe, a regular page, endpoint service etc... If someone already indexed has a link to that address, Google…
-
8
votes2
answers163
viewsA: What is differential inheritance?
Complementing the bfavaretto response. In languages like Java and . NET, instances are all bastard**, because only types are entitled to inheritance. In Javascript, everyone can "inherit" from…