Posts by Maria • 1,795 points
50 posts
-
1
votes2
answers955
viewsA: Merge array by replacing equal results
Response from: How to merge an array by replacing the equal numbers ? var array1 = [2, 2, 3]; var array2 = [2, 4, 4]; var array3 = [array1[0]]; for(i = 1; i < array1.length; i++) { var tem =…
javascriptanswered Maria 1,795 -
4
votes1
answer233
viewsA: How do ORDER BY with information that may vary?
Put it like this: $sel = DBRead('artigos', null ,'*', "ORDER BY $mudanca ASC"); I mean, double quotes! Inside single quotes PHP does not interpret anything it puts what is in it as a text only,…
-
2
votes1
answer2295
viewsA: Multiple files for upload
Download the package jQuery-File-Upload, and make a webform page with this content: 1 - Webformupload.Aspx On this page pay attention to the references you should add on your page: <script…
-
5
votes1
answer5057
viewsA: Popover or Tooltip Bootstrap with long text
Place different: $(function(){ $('.btn-text-pop').popover({html:true}); $('.btn-text-too').tooltip(); }); Because, first he’s running an event click to add popover on the button referent, why it…
twitter-bootstrapanswered Maria 1,795 -
5
votes7
answers762
viewsA: Randomize results with PHP
For no repetition use this code: Online Example: Ideone <?php $array_number = array(); for($i = 1; $i <=9; $i++) { $value = rand(1,9); while (in_array($value, $array_number)) { $value =…
-
3
votes1
answer67
viewsA: Image breaks the title
1) Solution Was added: .lectures h3 { height: 50px; } In the full Css code: .lectures { width: 300px; overflow: hidden; margin: 20px; padding-right: 22px; font-family: 'Aleo'; display: inline-block;…
-
2
votes4
answers2358
viewsA: How to count how many times a value appears in a table
I decided to do it in pure Javascript, just to have one more search option: <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Tabela</title> <script…
-
0
votes2
answers462
viewsA: How to use HTML5 data- attributes with Asp.net MVC?
Create a Idictionary, that represents an even value structure where the elements could be the options of the helpers of MVC ASP.NET @{ IDictionary<string, object> options = new…
asp.net-mvc-5answered Maria 1,795 -
4
votes1
answer1925
viewsA: Cake PHP Relationship - 3 Tables
Create three Models in the folder app/Model in its application Cakephp. Note: Class name is the same name as the file, i.e., class Estado generates a file Estado.php and so on. Do not forget to…
-
0
votes1
answer601
viewsA: Disable checkbox checked in listview
Use the event ItemCheck which will have the desired effect (i.e., it will be simulated like this, as this object could not change its status if it is already checked), where after setting as checked…
-
8
votes3
answers6948
viewsA: How to crop an image to the center when uploading it
Download the package Jcrop and make two pages like this: Home: (Crop.php) <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Arquivo</title> <link…
-
3
votes4
answers2214
viewsA: SQL query return total of days in a month on two dates
With the change of strategy, I made the SQL edition to calculate so: If the months are different it makes two calculation of the month of entry and the month of exit. If the months have differences…
-
6
votes2
answers2817
viewsA: Merge two tables with PHP
Make a INNER JOIN of the tables just below: Definition of INNER JOIN: when table A has in a table B the same code of its relation. In the tables below the field ID of users if relates field ID_USER…
-
3
votes3
answers8785
viewsA: How to pass an Object to another page using Angularjs?
Working with HTML5 there is the implemented feature window.sessionStorage which is intended to store information as long as the browser session exists, that is, until you close the browser. In this…
-
1
votes1
answer97
viewsA: Problem with Adodb’s Insert_id function
And if you manage your mistakes that way: include("adodb5/adodb-exceptions.inc.php"); include("adodb5/adodb.inc.php"); $db = NewADOConnection('mysql');…
-
2
votes2
answers1465
viewsA: Automatic date field fill in application
Through the various alternatives below follows an example by sending the information of the controller for your reference view. Class Model public class Professor { public int Id { get; set; }…
-
1
votes1
answer152
viewsA: Load records from different tables as Anonymous type Entity framework
As reported by the OP of the question, I did a simulation by fictitious data... int Id = 1; // id do produto; var resultado = contexto.ItemEntrada .Include("Produto") .Include("Entrada")…
-
3
votes2
answers907
views -
1
votes2
answers464
viewsA: Error class expected!
Code modifications: public static void main(String[] args) { String[] nomes = new String[5]; int [] idades = new int[5]; int maisJovem = 0; String showInputDialog = ""; for (int i = 0; i <= 4;…
-
1
votes2
answers101
viewsA: Query of N records by Item
Following @Cristianoavilasolomon’s reply I think it is valid to show the SQL complete. SELECT ID, PLACA, DATA, VALOR,ROWS FROM ( SELECT ID, PLACA, DATA, VALOR, ROW_NUMBER() OVER(PARTITION BY PLACA…
-
3
votes3
answers1099
viewsA: catching Description with Enumdropdownlistfor Asp.net mvc5
I rewrote the extensive Static method. using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Web; namespace System.Web.Mvc { public static…
asp.net-mvc-5answered Maria 1,795 -
0
votes1
answer175
views -
1
votes7
answers367
viewsA: Is there a problem if I leave a php file containing only HTML code?
There are two factors that implicate this question: 1) The site following a programming standardization, it is good to follow the extension .php. 2) The page and/or site may be vulnerable even with…
-
0
votes5
answers1449
viewsA: Sorting in query - Leave last registration in first and then sort by a field
Thus: The first Select takes the information of the last record, while the second makes the total ordering by the name field, when joining the tables it already does what the question expects the…
-
1
votes5
answers6853
viewsA: Convert Date field data to Mysql month
Recording at base in some field: update tabela1 set dataextenso = (CASE month(data) when 1 then 'Janeiro' when 2 then 'Fevereiro' when 3 then 'Março' when 4 then 'Abril' when 5 then 'Maio' when 6…
-
0
votes3
answers1650
viewsA: How to make a POST that passes beyond the form, a file?
Yes there is, for demonstration I made some changes to your equal form in the illustrative figures below, and the examples are for WebForms and MVC ASP.NET. 1 - MVC View: @{ Layout = null; }…
-
1
votes1
answer258
viewsA: How to create subfolders for Api on Asp.net webapi?
The only thing that came to me at the time is the creation of Area, as: Within the Controller of Area Vow has a DadosController which is a WebApi, follows the code: public class DadosController :…
asp.net-web-apianswered Maria 1,795 -
2
votes1
answer597
viewsA: Pick up value on a checkbox checked item
According to http://bootsnipp.com/snippets/featured/checked-list-group, follow example right below: Html <div class="col-xs-6"> <h3 class="text-center">Colorful Example</h3>…
-
1
votes2
answers406
viewsA: Error Mysql Connection Asp.net MVC
Put it like this: Direct Connectionstring in Constructor [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))] public class Contexto : DbContext { public Contexto() :…
-
1
votes2
answers839
viewsA: How to check if a class implements a C#interface?
With Reflection it is easy to identify if the object of a class has been implemented with the interface IDisposable, even, one can verify if there are more implementations in this way Class public…
-
3
votes2
answers83
viewsA: Responsibilities of the View
Utilise for, foreach, if, switch, etc. are normal practices in ASP.NET in their Views. There is no performance loss and the security part is not affected, what the internet user has as a result in…
-
2
votes3
answers1517
viewsA: How to use Skip and Take with Pagedlist Helper
Internally the PagedList, automatically makes the Skip and Take, and it only brings the data needed to generate the page. In its algorithm it calculates the amount of page and as per the parameter…
-
2
votes1
answer1309
viewsA: Work with Angularjs in master page Asp.net
Very practical example on the subject, it doesn’t really change much. 1 - Masterpage.aspx <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="SiteMasterPage.master.cs"…
-
1
votes1
answer183
viewsA: Set width for nicEdit editor
Define in your textarea in his style the width: in the value of 100% or pixel the desired value (300px), example: <textarea name="area" style="width: 100%;"> Some Initial Content was in this…
-
2
votes1
answer980
viewsA: C# creating a property in a Usercontrol
Syntax error I believe: Inverts the Set cboLista and value and take the tests! public ComboBox Combo { get { return cboLista; } set { cboLista = value; } } Good a hint when doing this should concern…
-
4
votes2
answers379
viewsA: Json format on return
Basically to its layout would be like this: return Json(new { rows = new object[] { new { data = new string[] { "1", "NomeTeste", "Descricao Teste" } } } }, JsonRequestBehavior.AllowGet); If it’s a…
asp.net-mvc-5answered Maria 1,795 -
2
votes3
answers13793
viewsA: Date in dd/mm/yyyy format?
In SQL itself you use date_format same example right below: $sql = mysql_query("SELECT date_format(Nascimento,'%d/%m/%Y') Nascimento, Batismo, Comunhao, Emissao FROM cartao LIMIT $inicial, $numreg…
-
3
votes1
answer1330
views -
2
votes2
answers576
viewsA: How to create 1-N class relationships with more than one property and even subtype?
Expected effect on the question, not a good practice, but, follow the question: [Table("Arvore")] public class Arvore { public Arvore() { } [Key]…
-
2
votes1
answer219
viewsA: Consultation in a Relationship Many to Many in Laravel 4
It would go something like this: This is the best way to use, ie with Query Builder since the Eloquent is half-cast. DB::table('associados_modulos') ->join('modulo',…
-
2
votes8
answers6579
viewsA: Check user browser in PHP
Code adjustment of reply SO-En: if(preg_match('/(?i)msie [1-10]/',$_SERVER['HTTP_USER_AGENT'])) { // aqui é igual ou menor que 10 } else { // aqui maior que 10 } Question reference: SO-EN - PHP: If…
-
7
votes3
answers6508
viewsA: Difference in postgresql date months
Exists in Postgresql a Function Age which in my view portrays well the difference between dates. SQL below also demonstrates the result of months difference between two dates: SELECT ((ANOS * 12) +…
postgresqlanswered Maria 1,795 -
0
votes3
answers1909
viewsA: Try/catch does not show correct message
Simulating his example Marlon Tiedt, I found that it worked: Note: I made the mistake by writing errorURL. try { Uri resultadoURL; bool resultado = Uri.TryCreate("errorURL", UriKind.Absolute, out…
-
1
votes2
answers539
viewsA: Entity Framework - Bank Compatibility
Mysql is one of the banks that Entity Framework with the Data Provider offered by mysql website, works correctly. The function of these Data Provider is to provide differences imposed on databases,…
-
4
votes3
answers2562
viewsA: Sort SQL by 1,2,3 instead of 1,10,2,3
As it was not passed the layout of the table I put name and table in the relative places: SQL SELECT SUBSTRING(nome, 0, CHARINDEX('-', nome)), nome FROM tabela ORDER BY CONVERT(INT, SUBSTRING(nome,…
-
2
votes2
answers4504
viewsA: How to read xml with c#
Another way is Xdocument and Linq. var resultado = (from x in System.Xml.Linq.XDocument.Parse(System.IO.File.ReadAllText(".\\Db.Xml")) .Descendants("tb") let simbolo = x.Element("simbolo").Value let…
-
7
votes2
answers432
viewsA: Create a set method for different variables
There are some forms, and they follow the pattern of Object-Oriented Programming and are: 1 - Default with Get/Set: public class Character { private String name; private int intellect; private int…
-
2
votes2
answers190
viewsA: Code abstraction
Well I will contribute with a specific example, I would do so basically: A relationship of 1 to N (1 to many), between Questions and Questionsitens, where the Question would be registered and then…
-
1
votes2
answers446
viewsQ: jQuery Mobile, what are your closest competitors?
I’m using jQuery Mobile to build a simple interaction with a local system. Although good recommendations I am going through problems and have some moments that the application of nothing hangs, does…
-
6
votes1
answer5108
viewsQ: How to sort an array of numbers from largest to smallest?
There is the function sort, but it sort from minor to major, and I’d like to sort from major to minor. There’s some function in javascript for that? Code with sort: var numeros =…