Posts by Leonardo Bosquett • 1,440 points
45 posts
-
0
votes0
answers51
viewsQ: Facebook Graph API - different values for actions between Facebook and API
I’m using the Facebook API (Ads Insights) to return campaign actions. But the value returned by the API does not match any value shown in the Facebook post itself My Request in Javascript var d =…
-
0
votes1
answer499
viewsA: JSON returning Undefined value
The problem is because the json variable is an array: To access the values you need to access the index first, for example: var json = [ { "email": "[email protected]", "name": "Admnistrador", "role":…
-
8
votes3
answers3857
viewsA: Catch the last occurrence in a javascript string
Just use split() and take the last position of the array using pop(): let v = "xx_xxxxx_0001_ABCDE_TESTE_INTRODUCAO_VIDEO".split("_").pop(); console.log(v); Notes: There are no code validations The…
javascriptanswered Leonardo Bosquett 1,440 -
1
votes1
answer114
viewsA: Syntax error in SELECT MAX
The problem is the encoding of the accent in id_video: SELECT MAX(id_vídeo)FROM video; Most likely your file is with a different encoding than mysql client expects Example per command line: SELECT…
-
1
votes2
answers259
viewsA: Is it possible to customize an Alert?
Short answer: Not The browser Alert is a simple DOM alert, as described in W3C "show an alert to the user and wait for it to close"; as a rule: there is no specification, although browsers may even…
-
1
votes2
answers121
viewsA: Rename url with database contents
in a. htaccess file: RewriteEngine On RewriteRule ^orcamento orcamento.php # caso queria que /orcamento também responda RewriteRule ^(.*)\.orcamento orcamento.php?nome=$1 php budget.: $nome =…
-
1
votes1
answer127
viewsA: Problem for deletion of data from a spreadsheet
Probably the problem is with the file zone, as it is "locked" some features may be blocked by the Windows components Obs.¹ This spreadsheet is blocked and always when it opens it has to enable…
-
0
votes1
answer59
viewsA: I want to use 2 threads inside the foreach C#
I want to include _main.saida (along with input) in foreach.... has how to do this? Yes, just use the method Union (is in the System.Linq namespace) provided the two collections are of the same type…
-
1
votes1
answer964
viewsA: Relationship of two tables MVC C#
Assuming you use the Entity Framework and you have the following classes: public class Permissao { [Key] public int PermissaoId { get; set; } public string Name { get; set; } public virtual…
-
1
votes2
answers1169
viewsA: Remove HTML tags
Considering the performance, can also be done removing tags avoiding the use of regular expressions, which greatly increases the performance, here is an initial code (simple).…
-
7
votes1
answer834
viewsA: How is the life cycle of an ASP.NET 5 application?
OWIN OWIN sets a default between . NET servers and WEB applications. OWIN’s goal is to decouple the server and the application, and encourage the development of simple modules for a web application…
-
1
votes2
answers1631
viewsA: Make a combobox take C#
Pass objects in this case to Combobox: // crie uma classe que represente sua medida public class Medida { public string Representacao { get; set; } public double Valor { get; set; } // IMPORTANTE:…
-
1
votes1
answer101
viewsA: Is it possible to use Session in Windows Service?
You can store it in an object. "Service" is an instance of your class, so you can store anything inside it. public class MyTask { public void LongOperation() { // seu código que pode demorar aqui }…
-
3
votes1
answer2287
viewsA: Consume DLL C on VB6 or C#
C/C++ libraries have call convention (the way the method is handled by the CPU, its stack, etc.), this implies otmization. https://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx Anyway, your…
-
5
votes2
answers1891
viewsA: How to design a basic socket client application
Everything depends on the application you want to make, I will respond in a generic way so that you apply the use in different occasions. It is recommended to delegate connection management…
-
8
votes8
answers5853
viewsA: Recognize word repeats in String
I’m not very good at java, so I accept corrections in this code, but I think I’ve arrived at the result you want: See it running here on Ideone: http://ideone.com/8YvDnp import java.util.*; import…
-
1
votes3
answers220
viewsA: How to enable single-model Cascade
Whether you have conventions in the template (and some may not be removed) you can, yes, enable Calendar as you prefer, see only: public class Client { public int Id { get; set; } public string Name…
entity-framework-6answered Leonardo Bosquett 1,440 -
-1
votes1
answer956
viewsQ: Changing the X-axis view on a graph
I’m using the Google API to create some financial charts. Currently I have data in which the axis X (horizontal) represents the date and the axis Y (vertical) represents the quotation of the day:…
-
0
votes2
answers151
viewsA: Relationship between Middleware and Application Delegate
Your study is correct. when you use the following code snippet: // vNext app.Use((context, next) => { // algum funcionalidade } You’re just adding the function to an internal list. All items in…
-
3
votes1
answer1236
viewsA: Identify Area, Controller, and View Action
In a basic MVC project you can do the following: public class HomeController : Controller { public ActionResult Index() { var e = this.RouteData.Values; string controllerName =…
-
5
votes2
answers144
viewsQ: Javascript object return syntax
Using the Chrome console I used the following code (valid): function foo() { return { prop: "some value" }; } when the syntax style is changed is no longer valid ({ played to next line): function…
-
0
votes1
answer1646
viewsA: How to make flaps like Chrome
I suggest studying the creation of the controls themselves, there is a good project in Codeproject for this: http://www.codeproject.com/Articles/91387/Painting-Your-Own-Tabs-Second-Edition In the…
c#answered Leonardo Bosquett 1,440 -
4
votes9
answers2096
viewsA: How to assign a function with parameters to click without executing it?
I believe it is enough to change the syntax: function mostraProdutosGrupo(g,elemento) { //codigo que mostra os produtos elemento.unbind(); elemento.click(escondeProdutosGrupo); // aqui } function…
-
4
votes1
answer155
viewsQ: Syntactic Reader (Extension of Visual Studio 2013)
By syntactically reading a language in a Visual Studio extension project I can already read the following: <span class="myclass"></span> It is relatively easy to manage read states…
-
4
votes2
answers127
viewsA: Accent in comment field
As resolved in the comments: The issue was resolved by applying the charset standardization in the relevant fields: Code behind the page: call the function header with charset=utf-8 on all requests.…
-
5
votes2
answers176
viewsA: How important is it to use friendly URL?
Friendly URL is important in these cases: Better user view Not only of the URL in the browser tab while the user browses, but if he or she searches the page, share it with his or her colleagues via…
-
2
votes1
answer128
viewsA: Read tokens in infinite loop
I ended up finding the source of the infinite loop. m_source.SetText(source); This generates a future call to the parser himself TestScanner, was not a directly recursive call, which made…
-
5
votes1
answer128
viewsQ: Read tokens in infinite loop
I have a code that reads tokens a text. I’m using Visual Studio 2013 in an extensibility project. When reading the text through scanner and collect the tokens, the program enters an infinite loop:…
-
2
votes2
answers1597
viewsA: Remove JS file via JS
You can use functions located in variables and could even clean them (optionally) before loading the next js file: foo = function() { } foo = undefined; // isso limpa a função... porém é opcional, a…
-
2
votes1
answer127
viewsA: Performance in dynamic menus
Only request from the database The simplest way to do this in php is to load the menus differently, for example: save the array of menus in a file serialized in json, every time the site is loaded…
-
2
votes1
answer140
viewsA: Do not resize image
The code is ok, the image is being resized before it even reaches the server, using this command you will see what is being sent to the server and thus get around the problem:…
phpanswered Leonardo Bosquett 1,440 -
5
votes3
answers8001
viewsA: What is the right way to remove the edge with CSS?
See section 8.5.3 of this page of the W3C (regulatory body) available at this link: http://www.w3.org/TR/CSS2/box.html#propdef-border According to the same none is the property that defines that the…
cssanswered Leonardo Bosquett 1,440 -
2
votes2
answers470
viewsA: Updating data from a div?
Basically study the function $.ajax: $.ajax({ type: "POST", url: url, data: data, success: success, dataType: dataType }); Source: http://api.jquery.com/jquery.post/ You can do the following (I…
-
2
votes1
answer111
viewsA: Doubt in dynamic memory allocation
Yes, because both pointers point to the same memory region.. Keep in mind that the pointer only indicates where your data is, deleting B does not erase A, deletes the content also pointed by A.…
-
1
votes1
answer1456
viewsA: Upload php file to another server
You can use the ftp_put function if you want to upload these files via FTP. <?php $file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id =…
-
2
votes4
answers6348
viewsA: Detecting Line Break
the line breaking test in Javascript by Regex is n as Wakin said, see the test in the Chrome console: if you have problems with line breaks in different versions of S.o try this: var newExpression =…
-
3
votes3
answers601
viewsA: Remove: from xml generated by my web service
if you want a quick and practical way, use the Replace method of the String or Stringbuilder class (faster): string xml = new StringBuilder(xmlContent); xml.Replace("<a:", "<");…
-
0
votes2
answers4748
viewsA: Validate and change user password with PHP
Check your logic, seems to be using the logical operator && (E) with the intention of functionality || (OU) only switch operators on the first and second if a remark without being coarse:…
phpanswered Leonardo Bosquett 1,440 -
1
votes3
answers13356
viewsA: How to fix the position of an element inside a div with scroll( With css )
Put this in your CSS: .conteudoFixo { position: fixed; width: 300px; background-color:#FF00FF; }
-
1
votes2
answers513
viewsA: How to put between within a code query?
Gypsy is right, this approach is not correct by the possibility of SQL Injection, even if it is working. I suggest you read this article from MSDN:…
-
2
votes1
answer443
viewsA: Performance comparison on Android: Canvas vs Opengl ES
exactly as Guilherme’s comment proposed: Opengl has a lower level access than Canvas and will be faster. In the case of slowness in some devices may have many reasons ranging from poor programming…
-
4
votes3
answers637
viewsA: Deploying queues for Websocket
You can study the basic functionality of TCP, which provides for proper sorting of packages. as your connection is not persistent you will basically need a control within the package, an ID starting…
-
1
votes1
answer54
viewsA: Change mouse cursor using WINAPI
Check the Loadcursor function, it is very common for the error to be in the IDC_MEUCURSOR1 resource (value of Resource. h is one, real value of the resource is another)
-
1
votes1
answer881
viewsA: Mapping video card memory to access via Intel compatible x86 processor
To utilize the memory card are not these addresses, this process involves direct access to the video card through "hardware interruptions", you would call on your Assembly: int 0x00 ; o número…
-
3
votes1
answer150
viewsA: Static Code Analysis - Identify possible division by Zero
Visual Studio can from the syntactic analysis and construction of IL discover a possible division by 0. But this analysis does not assume the "state" of the program, that is, it is possible to…