Posts by novic • 35,673 points
1,265 posts
-
1
votes1
answer121
viewsA: Convert UTF-8 string to C#standard format
So set it up like this: (upon comment) WebClient webClientSummonerInfo0 = new WebClient(); webClientSummonerInfo0.Encoding = Encoding.UTF8; Webclient.Encoding Property…
-
1
votes1
answer185
viewsA: Doubt about Sessions in the IC
The session will be destroyed after 7200 seconds, however I wanted whether when I update the page or access another page of my system, this time is renewed? If not, is there any configuration in the…
-
4
votes1
answer1308
viewsA: Create View in Mysql through Laravel
There is a yes and viable way to create Views with Database Migrations, but, it’s a forma textual: Commando: DB::statement, in place of Schema::create <?php use Illuminate\Support\Facades\Schema;…
-
2
votes2
answers461
viewsA: Result automatic calculation javascript Asp.net mvc
Make a separate function with this calculation code and place within the execution of the ready, to work at the exact time of page loading, follow the code below: <script…
-
1
votes1
answer623
viewsA: mysqli_query() does not return false
The result obtained with the return of mysqli_query can be a mysqli_result or bool (false). When the return is false, has some problem with the SQL, syntax error for example, when the return and…
-
1
votes1
answer192
viewsA: What is the difference between using Arrayiterator vs Simple Array?
In exhaust test to check the creation of instances and memory positions with the code: Observing: Test taken from this link of the site php.net with modification to create class Arrayiterator.…
-
1
votes1
answer672
viewsA: Setting Textbox for Currency
Create a método: public void ToMoney(TextBox text, string format = "C2") { double value; if (double.TryParse(text.Text, out value)) { text.Text = value.ToString(format); } else { text.Text = "0,00";…
-
3
votes1
answer709
viewsA: Take items from the JSON array
To key that you’re looking for, doesn’t always stay in the same place, so with a recursive function, sweep all elements of the array in search of the keys with a certain name. The function was also…
-
0
votes2
answers770
viewsA: How to display data in descending order?
In this specific case usort with a function would also solve: usort($array, function($a,$b){ return $b[0] > $a[0]; }); being $b[0] and $a[0] is the position of the values, then having the option…
-
1
votes1
answer994
viewsA: Format number in reportviewer?
The right thing would be: Format(Fields!terminal.Value.codigo, "0000"); References: Adding Style and Formatting to a Reportviewer Report Using Expressions in Report Viewer…
-
1
votes1
answer58
viewsA: Problems with the return of the hasMany relational
You have to carry the relationship: $lotes = LoteProduto::with('produto')->where('CdProduto', $id)->get(); foreach($lotes as $lote): $lote->produto ... endforeach; and that returns a list,…
-
2
votes1
answer83
viewsA: How to use an enumerator like Itemsource from a Combobox?
Add two settings inside Window xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:StyleAlias="clr-namespace:WpfApplication1" whereas WpfApplication1 the name of your app. Right after create…
-
8
votes1
answer1511
viewsA: Self relationship in Group table with Laravel and Eloquent?
Auto Relationship Laravel 1) the Migration corresponding to that table? To create the archive (the blank model) in the console do: php artisan make:migration Grupo Configuring: <?php use…
-
6
votes1
answer1511
viewsQ: Self relationship in Group table with Laravel and Eloquent?
I have a table of grupo with the fields: id (int not null auto-increment) Description (sweep) grupoid (int null) How would it be: 1) to migration corresponding to that table? 2) the creation of…
-
1
votes1
answer1625
viewsA: How to remove this warning Notice: Undefined index:
On the line 23: $posicoes = isset($_SESSION['respostas']) ? count($_SESSION['respostas']) : 0; The isset (isset($_SESSION['respostas']), checks whether the variable has been initialized, no longer…
-
2
votes3
answers2308
viewsA: Format double output with dot instead of comma
Make the conversion to String then use the command Replace of string class: <%#Eval("Latitude").ToString().Replace(",",".")%> References: String class String.Replace method (Char, Char)…
-
1
votes1
answer95
viewsA: Valid times
Always when using data type use datetime class and the class Dateinterval: $array = array( 0 => "08:00:00", 1 => "08:02:00", 2 => "08:04:00", 3 => "08:08:00", 4 => "08:10:00", 5 =>…
-
0
votes1
answer142
viewsA: Hiperlink + Eval + navigateURL
In the Navigateurl of component Hyperlink that is inside a ItemTemplate of component Listview do: NavigateUrl='<%#string.Format("https://pt.wikipedia.org/wiki/{0}", Eval("Cidade"))%>'>…
-
2
votes1
answer138
viewsA: View Datetime Content using Doctrine
If $usuario->getUserDthActivation() return a Datetime valid, you can improve the return by doing so: $usuario->getUserDthActivation()->format('d-m-Y H:i:s'); Reference: Datetime…
-
0
votes1
answer71
viewsA: Ignore property with Fluentnhibernate?
So an item is not mapped by Fluentnhibernate, hide the item in configuration class (ClassMap), example: using FluentNHibernate.Mapping; namespace Models { public class Client { public virtual int Id…
-
5
votes1
answer506
viewsA: I cannot insert into Mongodb using Java
The installation to work would be two .jar: mongodb-driver-core-3.0.4.jar Mongo-java-driver-3.0.0.jar Netbeans Development Environment Code worked after installing these two packages: import…
-
1
votes2
answers379
viewsA: ERROR - Catch Xelement C#
The file has namespace, and at the time of the search for elements he needs to be informed: XNamespace nameSpace = "http://www.portalfiscal.inf.br/nfe"; string xml =…
-
2
votes1
answer531
viewsA: Multidimensional array from mysql query
In comments, it is done at PDO, in itself has a way of grouping by a given field, where it must be the first item of SQL, being this field to array key: I want to group by grupoid, then, use…
-
2
votes1
answer481
viewsA: Shuffled fields in a form using Materialize
I did in this section below all the code, with the materialize: <link href="https://fonts.googleapis.com/icon?family=Material+Icons&.css" rel="stylesheet" /> <script…
-
3
votes1
answer615
viewsA: Default date to maturity - PHP
It would be a logic to always check the generated date is valid: <?php function parcelas($data, $numero) { $parc = array(); $parc[] = $data; list($dia, $mes, $ano) = explode("/", $data); for($i =…
-
1
votes2
answers228
viewsA: PHP - Return column sum at date specifies // PDO
To SQL basically would be like this: select (sum(p_line_a) + sum(p_line_l)) soma, p_data from items WHERE p_data = '2016-09-20' PHP $bsc_user = $pdo->prepare("select (sum(p_line_a) +…
-
1
votes1
answer616
viewsA: Migrations Hasmaxlength x Hascolumntype
Wasn’t the two of you supposed to create the same kind of field varchar? No, it is for him to create the type set by default by the bank SQLite that is Text. When responsibility is passed on to the…
-
2
votes1
answer1252
viewsA: Transforming image upload to Base64 - Standard
To turn a file of any kind, coming from a input type file using the classe Request present in the Laravel-5 public function store(Request $request) { $file = $request->file('BLOB'); $name =…
-
3
votes3
answers12463
viewsA: How to select last Mysql table record with last or another command?
If the table has a field auto increment ordain decreasing and limit the result in 1 line. SELECT registro FROM tabela WHERE coluna = 23 ORDER BY id DESC limit 1;…
mysql-workbenchanswered novic 35,673 -
8
votes1
answer6264
viewsA: Upload file via POST to Webapi
With Httpclient, saving a text file to a Controller WebApi: Sending: [HttpGet] public void Enviar() { string fileName = Server.MapPath("~") + "/Files/arq.txt"; using (HttpClient client = new…
-
0
votes1
answer352
viewsA: Entityframework does not recognize Config Web transformation
In the archive web.HML.config, would be in case a configuration file of your application when a publication (compilation) of your project was generated, then when a compilation was generated from…
-
2
votes3
answers496
viewsA: php function to invert data
I would do with operation date, has not if within the method and would be free depending on the settings: function data_format($format_ini, $value, $format_end) { $d =…
-
1
votes1
answer7692
viewsA: Laravel request validation
I don’t quite know how it was set up your Framework Laravel, but, I will try to clarify with an example: ChamadoRequest In class ChamadoRequest has validation for nome that is obligatory and email…
-
1
votes1
answer162
viewsA: Customization of Jquery Custombox
In Javascript with jQuery utilize $(document).ready that when loading the page, executes the Modal. Javascript: $(document).ready(function(){ Custombox.open({ target: '#modal', effect: 'fadein' });…
-
0
votes2
answers2123
viewsA: Laravel checkbox checked or not checked according to Database
There is then a relationship Muitos para Muitos (N:M), where the tables Produto and Cores has an intermediate table with its respective keys: Model Cor: <?php namespace App\Models; use…
-
2
votes2
answers601
viewsA: Is there an Laravel Blade Statement Tag (instead of just printing)?
Can be created a Directive of the Blade: Blade::directive("variable", function($expression){ $expression = str_replace(';','=', $expression); return "<?php $$expression; ?>"; }); To use in the…
-
3
votes1
answer114
viewsA: How to format and calculate 1,000,000 in PHP?
Take great care with values in Brazilian format, need to remove the "." and in place of "," put the "."; With str_replace where: first parameter passes a query array; second parameter pass a change…
-
2
votes1
answer305
viewsA: ajax is not returning success in Laravel
In Laravel is return within the method, then change echo for return: public function update(Request $request) { return "teste"; } If the information was actually sent to the Controller this will…
-
2
votes2
answers1450
viewsA: C#url shortener
Wrong or improper use of the method class format String that is wrong: when you want to format a string, put the numbering of 0 until the amount in case there are two, then, {0} and {1} See code…
-
1
votes1
answer107
viewsA: Entity Framework does not convert Firebird INTEGER to C#long
Change your class BaseModel for Generic, see below: public class BaseModel<T> { public virtual T Id { get; set; } } in your class: public class Teste: BaseModel<int> // ou long { public…
-
4
votes3
answers620
viewsA: How to print the amount of words in a string that gets a sentence in . NET?
Utilize Split and Length of the Array: Split divides a string into parts according to specification or specifications in its method. Length of the Array brings the amount of items contained in an…
-
1
votes1
answer451
viewsA: How to define Generator (from Firebird) for an Entity framework 6 model field?
With a Firebird database, a table was created with the following fields: /* Table: CLIENTE, Owner: SYSDBA */ CREATE TABLE "CLIENTE" ( "ID" INTEGER NOT NULL, "NOME" VARCHAR(50) CHARACTER SET WIN1251…
-
4
votes1
answer355
viewsA: Doubt : Search with Dropdownlist mvc 4 Razor Asp.net C# sql Server
It seems there are conceptual errors: In the controller below: public ActionResult Index() { EDGSiteEntities op = new EDGSiteEntities(); ViewBag.IdOperacao = new SelectList(op.Operacao,…
-
0
votes1
answer53
viewsA: doubt with Entity and limit
Error: A conversion error is happening List<TEntity> for TEntity, they are different and conversion is necessary. The Last() returns the last element on the list, and actually needs the 100…
-
0
votes1
answer363
viewsA: Null parameters in the controller when sending post via ajax
The form to make it work: Observing: placed in the form fields, their values. <form id="hiddenForms" method="POST"> <input type="hidden" id="idhiddenFormPlaca" name="namehiddenFormPlaca"…
-
3
votes1
answer3250
viewsA: Jquery - Popular table using array
In your specific case, and with researches done the Jquery-datatables needs a array and not a objeto, then it is to make one more command line to transform the objeto in array. Html: <table…
-
1
votes2
answers1297
viewsA: Retrieve data from another mysql table and quantity
I don’t know, but I think it would be that way: SELECT media.id, media.user_id, media.title, media.description, count(comments.id) quantidade_comentarios, count(media_likes.id) quantidade_likes FROM…
-
3
votes1
answer1705
viewsA: Calling a function in Views in codeigniter
Change the code as below: function sumContasReceber() { $somaCR = "SELECT SUM(valor) as SOMACR FROM lancamentos where baixado = 0 AND tipo = 'receita'"; return…
-
3
votes1
answer1321
viewsA: Creating datetime field with Laravel Collective
The method is datetime: Form::datetime('visivel_Ini', \Carbon\Carbon::now(), ['class'=>'form-control']) If you prefer the date in Brazilian format: Form::input('text', 'visivel_Ini',…
-
7
votes1
answer2227
viewsA: Relationship problems one for many
In the Eloquent, there is a pattern in the relationship keys, which is not mandatory, which is a convention of nome de tabela, underscore and chave, example: categoria_id. How not was followed and…