Posts by MeuChapeu • 5,875 points
107 posts
-
3
votes2
answers2501
viewsA: How to echo a php file?
You can use the function file_get_contents(), which will return the contents of the file in string form. Example: <?php $data = file_get_contents("AquiOLocalDoArquivo"); //no seu caso ficaria…
-
1
votes1
answer164
views -
2
votes1
answer10173
viewsQ: Centralize div container materialize
I got the following shit on mine HTML: <div class="image"> <div class="container center-align"> <h1 class="grey-text text-lighten-5">Análise de Sistemas</h1>…
-
0
votes2
answers1202
viewsA: Instantiate dll created in C# . net for VB6
In its project of DLL do the following: Configuration Properties -> Build configure the property Register for COM interop with the value True. And in your project VB add reference to Type Library…
-
1
votes1
answer2015
viewsA: Open PHP link in another browser
There are two functions in php that can help you exec() and shell_exec() Example using the exec: exec("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe http://www.google.com"); But this will…
-
6
votes2
answers8444
viewsQ: Pass generic list as parameter
You can pass a generic list by parameter? Ex: I have one List<Pessoa> and a List<object>. and I have my method: public void FaçaAlgo(List<T> lista) { } How can I make my method…
-
1
votes1
answer131
viewsA: Problem with Textbox Update c#
I made a quick example here: private void cmb1_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Converte o item selecionado em um item do combobox ComboBoxItem item =…
-
12
votes2
answers1626
viewsA: How to use and what is the user-select property for
In a simple way the user-selection serves to control the content that can be selected on the website. Values User-select accepts four values: text - text can be selected element - the text can be…
-
2
votes1
answer372
viewsQ: Hide Tray Icon Menu
I created a menu for my TrayIcon: However, if the user does not select an option, it is still visible. Would anyone know how to hide if the user clicks outside the menu area? Here’s the code I’m…
-
2
votes2
answers3939
viewsA: PHP MAILER - Error: The following Recipients failed
You have to wear it like this: $mail->addAddress("[email protected]"); // email do destinatario (para quem a mensagem devera ser enviada). $mail->addReplyTo('[email protected]',…
-
2
votes3
answers888
viewsQ: Range in Excel VBA
I have the following code snippet: ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:\Users\Contoso\Desktop\ArquivosDoContoso.csv", Destination:=Range _ ("$A$1")) In part Destination:=Range _…
-
1
votes1
answer781
viewsQ: Class for handling database connections
Some time ago I created the class below to do operations of CRUD in the database. Based on good programming practices, what would you change in class? and why? <?php Banco::getConexao(); abstract…
-
1
votes1
answer241
viewsA: Grab value from a button inside 'Contentcontrol'
I was able to solve it this way: I removed the <ContentControl> <Button Grid.Column="1" Grid.Row="2" x:Name="btnCinco" Click="btn_Click"> <Viewbox Margin="3"> <TextBlock…
-
1
votes1
answer241
viewsQ: Grab value from a button inside 'Contentcontrol'
I have the following code on XAML: <Button Grid.Column="0" Grid.Row="1" x:Name="btnSete" Click="btn_Click"> <ContentControl> <Viewbox Margin="3"> <TextBlock Text="7"/>…
-
5
votes4
answers374
views -
2
votes1
answer1252
viewsA: POO PHP Function Insert into MYSQL
In your case it would be something +/- like this: if ($_POST['status_atual'] != $_POST['status']) { //passe os dados pra um unico array. $dados = array(Coluna => valor id_edital =>…
-
9
votes1
answer395
viewsQ: Concat() VS Union()
What’s the difference between Concat() and Union() ? When to use Concat() and when to use Union() ? Can only be used in list ?…
-
5
votes5
answers4008
viewsA: Regex take from one point to the other within a text
I managed to solve using the Regex.Split(), with the regex @"From\s\-\s\w{3}\s\w{3}[^\n]*\n+". 1 - I am using regex because I want to pick up from the first From - Fri Mar 13 10:58:58 2015 Until the…
-
5
votes5
answers4008
viewsQ: Regex take from one point to the other within a text
I have the following text:: From: .... blabla bla Message: blablabalab //linha em branco From: .... blabla bla Message: blablabalab //linha em Branco From: .... blabla bla Message: blablabalab How…
-
4
votes1
answer734
viewsQ: Regex take more than one occurrence in a string
I have my regex (\d{2}). And I got my string 12 hoje vai 45 na serra pelada 55 ou 75. How do I get my regex to pick up all occurrences of the string? It’s only picking up the last one.…
-
4
votes2
answers105
viewsQ: Wrong date calculation
I have the following method: TimeSpan dt = dataFinal.Subtract(dataInicial); double anos = Math.Floor(dt.Days / 365.25); double meses = Math.Floor(((dt.Days - anos * 365.25) / 30)); return…
-
2
votes1
answer238
viewsQ: Dependency Error
I’m using the BackgroundWorker private BackgroundWorker BGWorker = new BackgroundWorker(); BGWorker.DoWork += BGWorker_DoWork; BGWorker.RunWorkerAsync(); private void BGWorker_DoWork(object sender,…
-
2
votes2
answers55591
viewsA: Limit html input
You can use the event onkeypress: <input type="text" maxlength="2" onkeypress="if (!isNaN(String.fromCharCode(window.event.keyCode))) return true; else return false;"> Every time a key is…
-
2
votes1
answer1421
viewsQ: Canvas occupy the entire screen with css
I have my canvas on Html5: <canvas></canvas> I want the canvas to occupy all available area of the browser, I tried to do as follows: canvas{ display: block; width: 100%; Height: 100%;…
-
1
votes1
answer370
viewsA: Displaying vector with foreach - PHP
You can do it like this: foreach(EmpregadoTO as $valor){ echo $valor->bairro; echo $valor->idStatus; ..... } PS: I don’t know if it will show the values, because as it was quoted in the…
-
1
votes1
answer338
viewsQ: Shortcut on clickonce User Startup
I have an app ClickOnce, I have the option to create a shortcut on Desktop, but there is a way to make it add a shortcut in Initialize Windows? Programmatically, the user when installing the…
-
0
votes3
answers1060
viewsQ: Implementation of generic CRUD
I have the following class CRUD that is generic: public abstract class CRUD { protected string tabela = null; protected object classe = null; public CRUD() {} public virtual void insert() { //código…
-
2
votes2
answers931
viewsQ: Select returns nothing at all
I have the following method: public DataTable Select(bool all = true, string campos = null) { if (all && campos == null) _sql.Append("SELECT * FROM "); else _sql.Append("SELECT " + campos +…
-
0
votes1
answer2145
viewsQ: How to limit characters in a textbox
How to limit the number of characters in a Textbox in xaml and via code behind?
-
31
votes3
answers57329
viewsA: Format double with mile and decimal
Try to use it this way: string.Format("{0:0,0.00}", somatorio); // saída = 43.239,11 Or so: string.Format("{0:N}", 43239,11)); // saída = 43.239,11…
-
10
votes3
answers667
viewsQ: What are these attributes in the properties?
What are the names of these "attributes" and what are they used for? Examples: in the declaration of a class: [ComVisibleAttribute(true)] public sealed class SerializableAttribute : Attribute in the…
-
6
votes2
answers4042
viewsQ: Get property values of a class
I have the following codes: private PropertyInfo[] ObterPropriedades(Type classe) { PropertyInfo[] properties = classe.GetProperties(); return properties; } private string[]…
-
0
votes1
answer1332
viewsA: WPF application. How to reference the image in the XAML code, so that another user can view it when running . exe project file?
You can do it like this: If you have a folder with the images inside use like this: <Image Source="Imagens\start.png" /> If your image is marked as resource use this way: <Image…
-
48
votes3
answers11626
viewsQ: What’s the use of the reserved word "Yield"?
What is the use of the keyword (reserved) yield? When and where it is used?
-
1
votes1
answer1271
viewsQ: Close only one Window
I created a window JanelaUm, every time I click on button this window is displayed. in the code-behind of JanelaUm have the event window_KeyDown with the following code: if (e.Key == Key.Escape)…
-
2
votes3
answers8663
viewsA: What is the difference between DOM and virtual DOM?
Code in Virtual Dom: var tree = virtualH('footer', { id: 'footer', className: 'footer' }, [ virtualH('span', { id: 'todo-count', className: 'todo-count' }, [ virtualH('strong', String(todosLeft)),…
javascriptanswered MeuChapeu 5,875 -
2
votes3
answers1471
viewsA: How do I use a constant within a class method?
You could do it like this: <?php include_once("Configuracao.php"); Class Foo { public function exibeFoo(){ echo FOO; } }
-
1
votes1
answer258
viewsA: Problem when trying to insert into mysql using PDO
You can do it this way: $sql = 'INSERT INTO contato (nome, email, titulo, obs) VALUES (:nome, :email, :titulo, :obs)'; try { $recebeConexao = $con->conectar()->prepare($sql);…
-
1
votes1
answer84
viewsQ: Pass variable through Converterparameter
I have the following code snippet: Visibility = "{Binding TipoDestinatario, Converter={StaticResource conversorTipoDestinatario}, ConverterParameter=}. You would need to pass a boolean variable…
-
1
votes3
answers1450
viewsA: Remote control of an Android is technically possible?
To answer your question: If this is possible, why companies like Teamviewer have not yet made a remote control client for Android? Yes there is client to access Android devices, made by Teamviewer…
-
3
votes2
answers1405
views -
0
votes3
answers242
viewsA: Show in alphabetical order table
Try something like that: <?php //retorna a consulta ordenada já $sql = "SELECT * FROM contact ORDER BY prenom"; //executa a query $query = mysql_query($sql); //percorre as posições da consulta…
-
3
votes1
answer422
viewsQ: WPF window does not exceed the screen
I have the following code: System.Windows.Point ponto = PointToScreen(Mouse.GetPosition(this)); JanelaAbrir.Left = ponto.X; JanelaAbrir.Top = ponto.Y; JanelaAbrir.ShowDialog(); It opens the Window…
-
2
votes2
answers947
viewsA: Using Regex to pick up a certain value
Good from what I understand you have a string /stringqualquer and would like to get the value of stringqualquer without the / in front. Correct? If that’s your problem it should solve:…
-
0
votes1
answer67
viewsA: How to use the PDO class in this situation
A certain time I did as follows: public static function selectAll($tabela, $condicao = NULL){ $sql = 'SELECT * FROM '.$tabela; if(!is_null($condicao)) $sql .= ' WHERE '.$condicao; try { $query =…
-
2
votes1
answer172
viewsQ: Interface, interlinking of layers
The use of the interface is only in the interlinking of layers? whenever I want to communicate for example the layer model with the presenter, I’ll need an interface?…
-
0
votes2
answers127
viewsA: Regular expression to create a line of a cock game (tic-tac-toe)
tries to use this way \|\s\|([OX\s]\|x\S). house with: | |O|x|, | |X|X|. but does not marry: |X| | |, |O| | |.…
-
27
votes3
answers51011
viewsA: How to send email from localhost using PHP’s mail function?
Well I’ll show you the way I did using gmail, Phpmailer and Wampserver. 1st enable the ssl_module in apache. To Enable open the file httpd.conf apache and look for the following line in the file…
-
49
votes4
answers5144
viewsQ: What does the "@" sign on C" mean?
I have the following string @"\\servidor01\arquivos". What is the function of @ in front of the string?
-
1
votes2
answers186
viewsA: How to make the id variable not repeat in the loop?
Well, I don’t know if that’s gonna help you, but I already did it once like this: public static function update($tabela, $dados, $condicao = NULL){ $sql = 'UPDATE '.$tabela.' SET '; foreach($dados…