Posts by Miguel • 29,306 points
758 posts
-
2
votes2
answers328
viewsA: Do you know about cookies?
I’m not sure what values you want to store in cookies. But here are some features that are handy for working with customer-side cookies: Activate cookie: // entra como argumentos: o nome que quer…
-
2
votes1
answer434
viewsA: How to transform AJAX with Jquery into pure Javascript?
native version: var xmlhttp; var nome; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new…
-
2
votes1
answer2197
viewsA: fixed menu with jquery on certain scrolling (scroll) of the page
Okay, do it like this: Add an identifier to your <img>: HTML <img class="imgTopo" src='https://static.cineclick.com.br/sites/adm/uploads/banco_imagens/31/602x0_1439644246.jpg'/> We…
-
2
votes2
answers2008
viewsA: How to split an array and write to the PDO database
It generates this unwanted output because it is always overwriting the value of $list, ie, will always print the $list generated in the previous line: I think this logic will be better: $user =…
-
1
votes2
answers672
views -
0
votes2
answers109
viewsA: Multiple keys and values, Dictionary compreension
I got it, it was a misunderstanding in the syntax: results = {i: {'code':dictLines[i][0], 'value':dictLines[i][-1]} for i in dictLines} Output: {'Romanian new leu': {'value': '0.3287', 'code':…
-
1
votes2
answers109
viewsQ: Multiple keys and values, Dictionary compreension
I have been playing with python, Dict and list compreensions. I made this little script: import requests url = 'http://www.bankofcanada.ca/en/markets/csv/exchange_eng.csv' resp = requests.get(url)…
-
0
votes4
answers340
viewsA: Is there a way to set width specified in html as the max-width of this element in css?
With CSS: div.page-left-col img { max-width: 400px !important; /* isto deve-se sobrepor aos styles inline */ width:100% !important; /* isto deve-se sobrepor aos styles inline */ }…
-
1
votes2
answers162
viewsA: How do I get the size of the user resized window?
Do you just want this to happen if the 'suffer' window resizes? You should also catch the resize event from the window: function hide_show(width_window) { if(width_window < 400) { $('#facebook,…
-
3
votes2
answers5296
viewsA: Counter Javascript de clicks
You can do it like this: function criaCounter(init) { var count = init || 0; return function() { count++; var badges = document.getElementsByClassName("badge"); for (var i in badges) {…
-
0
votes1
answer39
viewsQ: Pre-program parameters to be removed from an object
I’m making an application, I wonder if php has any way to preprogram the properties to remove from an object: EX: $_datatableCollumns = array( 'id' => array( 'name' => 'ID', 'obj_param' =>…
-
2
votes1
answer507
viewsQ: Problem with . htaccess, subdomain
I have on my site (root) a Windows installation, IE, in the public_html folder I have a file . htaccess with: <IfModule mod_deflate.c> <FilesMatch "\.(html|php|txt|xml|js|css)$">…
-
0
votes1
answer264
viewsQ: Stop function (clearInterval), inside the object does not work
I have this object, it works well but I wanted to add a property to stop, this is not working: JS: var kissesAni = { init: function () { kissesAni.callAni(); }, callAni: function(){…
javascriptasked Miguel 29,306 -
1
votes1
answer341
viewsQ: INNER JOIN 3 tables with pivot table
Part of my database consists of these three tables. And I’m trying to come up with an SQL query that tells me the clients by sellers (sellers), i.e., for example: João (sellers) sells to 4 stores…
-
1
votes1
answer83
viewsA: Flot Charts, default x-axis from two days ago until now (last 48 hours)
To present only the last two days, but to be able to see the previous ones if you want: JS: var minX = new Date(); minX.setDate(minX.getDate() - 2); ... xaxis: { mode: 'time', timeformat:…
-
3
votes1
answer83
viewsQ: Flot Charts, default x-axis from two days ago until now (last 48 hours)
I have an app that features a chart whose dados from the database, where the date columns store a Unix timestamp, the data is received as a JSON. This graph works well but I would like the X axis to…
-
0
votes1
answer1771
viewsA: Change authentication table, Laravel 5
I figured out why not. The problem is in middleware should also be the dynamism of changing the table for authentication, IE, in the controller we have to change the auth.table which by default is…
-
0
votes1
answer1626
viewsQ: Array to string Conversion, Orange Validation
I have the following code: HTML: <form method="POST" enctype="multipart/form-data" action="/admin/dashboard/category/{{$action}}"> ... <fieldset class="form-group"> <label…
-
0
votes1
answer1771
viewsQ: Change authentication table, Laravel 5
I’m making a platform that will have 3 authentication systems, one for ordinary users, one for admins, and one for workers. I thought changing the model and table in config->auth would be enough…
-
2
votes3
answers16117
viewsA: How to transform a string composed of numbers into an integer list?
The reason for this is that a = ["1", "2", "3", "4"] are four strings (four keys each containing a value), of which a[0] = "1", a[1] = "2" etc... In the above example, a = ["1, 2, 3, 4"] you only…
-
0
votes2
answers522
viewsQ: My page in maintenance, without being visible to admin
I have now started working on a wordpress site, but my client would like to put a page in fully customized maintenance. I’ve been looking at some plugins but none of them gives me total freedom to…
-
1
votes1
answer500
viewsQ: Flash Session does not work, Laravel 5.1
I’ve done this several times but for some reason now it’s not working, I can’t grab the flash from the view session Userscontroller: public function login_page(Request $request) { $title = "login";…
-
1
votes1
answer67
viewsQ: Escape "/" with htaccess and/or php
I have a little MVC made by me. With urls of this type index.php?route=admin/produto/adicionar, but I wanted to withdraw index.php?route=, I already got some lines .htaccess stay that way…
-
2
votes2
answers71
viewsQ: Problem with user inputs
I have the following code: public class FlagApplication { private Scanner keyboard; .... private void insertNewRegistry(){ System.out.println("insira os dados de pessoa: nome, peso, altura, idade,…
-
0
votes0
answers20
viewsQ: Parameters sent after function is over
It’s probably a beginner’s question, but I’d like to understand what it’s for, with an even better example, what parameters are sent after a function is executed. For example, in this piece of code:…
-
0
votes1
answer132
viewsQ: Auto load of multiple directories
I have these functions: core/init.php: ... spl_autoload_register(function($class) { require_once ('libs/'.$class.'.php'); }); --- controllers/Images_controller.php require_once "core/init.php";…
-
0
votes2
answers566
viewsA: htaccess hide MVC model parameters
I got: htaccess: RewriteRule ^(.*)$ index.php?route=$1 [L] RewriteRule ^([^/]+)(/)([^/]+)$ index.php?route=$1&user=$3 [L] index php.: $router = new Router(); if(isset($_GET['route'])) { $route =…
-
4
votes2
answers566
viewsQ: htaccess hide MVC model parameters
I have the following URL: http://192.168.1.67/plays/mvc/index.php?route=profile&user=mikas.28 On which route = PAGE and user = USERNAME.USERID I have the following htaccess Options -Multiviews…
-
4
votes2
answers137
viewsQ: Form safety
I have the following code: PHP (server): if(isset($_POST['subdate']) && !empty($_POST['date'])) { $daysOff = array(); $get_date = explode(',', $_POST['date']); foreach ($get_date as $date) {…
-
2
votes2
answers223
viewsQ: Problem with overflow
I am making a site, whose menu is 'fullpage'. The problem is that if the menu (page) is less than 670px (min-height: 670px;) would like the menu (#menuWrapper) keep scroll so you can scroll and see…
-
0
votes1
answer32
viewsQ: .htaccess remove vars name from url but leave vars
Right now I have the Urls: www.meudominio.com/?route=service&serv_name=cascais_proxima&id=1 and www.meudominio.com/?route=ticket&serv_id=1&ticket=A but I’d like you to stay:…
-
0
votes1
answer38
viewsQ: Mysql database access design
I am investigating good implementations that allow easy adaptability for connection to my db. I would like to receive feed backs and suggestions for improvements to this design. As an example: how…
-
1
votes2
answers1998
viewsQ: Installation of Android studio on Ubuntu
It is the first time I install android-studio, installed with the commands: sudo apt-add-repository ppa:paolorotolo/android-studio sudo apt-get update sudo apt-get install android-studio At first…
-
1
votes1
answer801
viewsQ: Encoding, bytes conversion - strings
I have a problem, I’ve been researching but all the solutions I find don’t work. The problem is that I am accessing a page (.txt) and cannot convert it from bytes for string, to be able to work the…
-
2
votes2
answers61
viewsQ: Transform into json
I have a string: {name:"Sara", daypart:"day", href:"/questions/ask", bg:"su", temp:"calor", realfeel:"hot", text:"cloudy"} Basically I’m looking for a quick way to turn this into JSON, I mean, quote…
-
2
votes2
answers1486
viewsQ: Compare strings to accents, UTF-8
Something is escaping me here, I am doing Curl to a weather page, if the results have accents and comparing with exactly the same string in full this condition returns false (not equal). This is…
-
4
votes2
answers185
viewsQ: Explode() 'manual' in PHP
Just for the challenge and the taste of programming I’m trying to recreate the function explode() in PHP. This is what I have so far: function explode_by_me($divideBy, $str) { $element = "";…
-
1
votes0
answers83
viewsQ: Do not let the scroll stay in the middle, stay in one element or another
Before too I wanted to apologize for the title of the question, I could not find a better way to explain. What I want is a 'normal' page, which has for example: 5 sections, I wanted in the scroll we…
-
0
votes1
answer114
viewsQ: Differences between SELECT, Count and Empty to work DB data
I, out of curiosity would like to know the differences between 3 seemingly equal things to count (Rows, lines) and get data from a table, in Mysql/PHP: 1st: Return the number of Rows first, and only…
-
1
votes2
answers479
viewsQ: Fancybox with Facebook share button
I would like to add a facebook share button to overlay Fancybox 2.1.5 on instagram photos. At the moment I have a button like that works but that’s not what I want, what I really wanted was a button…
-
2
votes1
answer519
viewsQ: Ping - store positive results in a list
I have this code, it’s working fine, but the problem is that I would like to save the hits (ping with feedback) in a list, but I don’t know how to do this screening successes/failures. import…
-
1
votes1
answer1714
viewsQ: Write to file, replace words/numbers
I have this code that is supposed to read a file and delete all the numbers that are there, the file is like a list of words, Ex: "Ana n Bruno n 123 n 10 n ...". A line has letters or numbers, never…
-
4
votes2
answers152
viewsQ: Permutations and files
I’m working on a game that involves permutations, to create a list of words, in several separate files. Problems start to arise when I require words with more than 4 letters, as the corresponding…
-
4
votes3
answers154
viewsQ: Optimization of PHP functions for database querys
I often see different functions in PHP for each query. I wonder if there is any other way to do the following, in a connection with PDO: function get_user_data($table, $columm, $required) { $db =…
-
6
votes1
answer237
viewsQ: Recursive function for integer number input
I have this code but it doesn’t work very well, I mean, if it’s whole at first numOfValues is correct, but if it is not gets the type None, for what remains in memory is the first input (which is…
-
3
votes1
answer552
viewsQ: Insert data into mysql, commit() does not work
I wanted to enter in the database definitely. But with this code I am not able, the record is saved but does not commit(): import MySQLdb def conn(): try: db =…
-
0
votes1
answer183
viewsA: Migration, remove accents from all names in a column in the database
I did it. After thinking and thinking I discovered that as I sent the data to the database as HTML entities with the function htmlentities() by security (eg: htmlentities(só) = só) when I…
-
0
votes1
answer183
viewsQ: Migration, remove accents from all names in a column in the database
I want to make a modification to a data series of a column in the database, remove the accents so I’m doing this function in php. The problem is that none of the functions I discovered work. The…
-
2
votes1
answer53
viewsQ: Automatic slider plus controls. Divergence between the two
I am doing an automatic fadein/out slider but I would like to implement controls as well (next/Prev), the problem is that I cannot connect these two features. For example: if you are in slide1 and I…
-
1
votes1
answer101
viewsA: Classic slider for sliding/dragging
Is resolved: HTML: <div class="button" id="testNext">»</div> <div class="button" id="testPrev">«</div> <div id="test"> <div id="imgs"> <div…