Data descripciones

APIs Requiring Usage Descriptions. Table 1 lists the different classes of privacy-sensitive data, and the APIs your app uses to access the data class. Using any of these data classes requires Providing A Usage Description.For examples of requesting user consent to access any of these data classes, consult the Additional Documentation section.. If you receive a rejection email from App Review ... Last week's report by the United Nations (UN) Independent International Fact-Finding Mission on the Bolivarian Republic of Venezuela provided further evidence of what the world has long recognized: the illegitimate Maduro regime will stop at nothing as it desperately clings to power. As the world has seen time and time again, regime thugs routinely harass, exile, unjustly The meta description is a snippet of up to about 155 characters – a tag in HTML – which summarizes a page’s content. Search engines show it in search results mostly when the searched-for phrase is within the description. So optimizing it is crucial for on-page SEO.In this post, I tell you the characteristics of a good meta description, and how Yoast SEO can help you with it. (Business Unit) Data Network Specialist: 2417 018 (Business Unit) Database Administrator: 2408 022 (Business Unit) Financial Advisor: 1129 020 (Business Unit) Information Systems Administrator: 2419 023 (Business Unit) Network Operations Specialist: 2422 016 According to Backlinko, unique meta descriptions have a major impact on CTR: “Writing unique meta descriptions for each page can increase your site’s organic CTR. We found that pages with a meta description had a 5.8% higher CTR compared to pages without a description.”. Search engines may automatically generate a snippet, but if that description doesn’t do a good job conveying what ... Text could be cut off, important details could be missing, and irrelevant page data could appear. Defining the text you want to use allows you to ensure the best, most relevant content appears. In this example, you can see how distracting it is when the description is cut-off and incomplete. - First data on stability and resistance of SARS coronavirus compiled by members of WHO laboratory network 4 May 2003 - Use of laboratory methods for SARS diagnosis 1 May 2003 ( French version) - Laboratory diagnostic testing for Severe Acute Respiratory Syndrome (SARS) coronavirus . Los cables Ethernet o los cables de red se utilizan muy a menudo para conectar switches Ethernet, routers y computadores en redes de área local. A simple vista, los cables Ethernet parecen ser… Reading data from a table and also writing data into that same table is somewhat an ill-defined task. In what order should the data be read and written? Should newly written data be considered when reading it back from the same table? MySQL refusing to execute this isn't just because of a limitation, it's because it's not a well-defined task. 3345 - Navigational, Measuring, Electromedical, and Control Instruments Manufacturing *Click to View Top Businesses by Revenue for 3345 – Complete Profiles*. NAICS Codes that fall under 3345 - Navigational, Measuring, Electromedical, and Control Instruments Manufacturing

10 Malentendidos sobre El Web Scraping

2020.06.09 10:53 melisaxinyue 10 Malentendidos sobre El Web Scraping

1. El web scraping es ilegal
Muchas personas tienen falsas impresiones sobre el web scraping. Es porque hay personas que no respetan el gran trabajo en Internet y usan web scraping herramienta robando el contenido. El web scraping no es ilegal en sí mismo, sin embargo, el problema surge cuando las personas lo usan sin el permiso del propietario del sitio y sin tener en cuenta los Términos de Servicio (Términos de Servicio). Según el informe, el 2% de los ingresos en línea se pueden perder debido al mal uso del contenido a través del raspado web. Aunque el raspado web no tiene una ley clara y términos para abordar su aplicación, está abarcado por las regulaciones legales. Por ejemplo:
2. El web scraping y el web crawling son lo mismo
El web scraping implica la extracción de datos específicos en una página web específica, por ejemplo, extraer datos sobre clientes potenciales de ventas, listados de bienes inmuebles y precios de productos. Por el contrario, el web crawling es lo que hacen los motores de búsqueda. Escanea e indexa todo el sitio web junto con sus enlaces internos. "Crawler" puede navegar por la web sin un objetivo específico.
3. Puedes scrape cualquier sitio web
A menudo que las personas solicitan scraping cosas como direcciones de correo electrónico, publicaciones de Facebook o información de LinkedIn. Según un artículo titulado "¿Es legal el web scraping?" Es importante tener en cuenta las reglas antes de realizar el web scraping:
Una persona puede ser procesada bajo varias leyes. Por ejemplo, uno raspó cierta información confidencial y la vendió a un tercero, ignorando la carta de prohibición enviada por el propietario del sitio. Esta persona puede ser procesada bajo la ley de Trespass a Chattel, Violación de Digital Millennium Copyright Act (DMCA), Violación de la Ley de Computer Fraud and Abuse Act (CFAA) and Misappropriation
No significa que no pueda scrape canales de redes sociales como Twitter, Facebook, Instagram y YouTube. Son amigables con los servicios de scraping que siguen las disposiciones del archivo robots.txt. Para Facebook, debe obtener su permiso por escrito antes de realizar el comportamiento de la recopilación automatizada de datos.
4. Necesitas saber cómo codificar
Una herramienta de web scraping (herramienta de extracción de datos) es muy útil para profesionales no tecnológicos como especialistas en marketing, estadísticos, consultores financieros, inversores de bitcoin, investigadores, periodistas, etc. Octoparse lanzó una característica única: web scraping templates que scrapers preformateados que cubren más de 14 categorías en más de 30 sitios web, incluidos Facebook, Twitter, Amazon, eBay, Instagram y más. Todo lo que tiene que hacer es ingresar las palabras clave/URL en el parámetro sin ninguna configuración de tarea compleja. El web scraping con Python lleva mucho tiempo. Por otro lado, una plantilla de web scraping es eficiente y conveniente para capturar los datos que necesita.
5. Puede usar datos scraped para cualquier cosa
Es perfectamente legal si extrae datos de sitios web para consumo público y los utiliza para análisis. Sin embargo, no es legal si scrape información confidencial con fines de lucro. Por ejemplo, scraping información de contacto privada sin permiso y venderla a un tercero para obtener ganancias es ilegal. Además, reempaquetar contenido raspado como propio sin citar la fuente tampoco es ético. Debe seguir de reglas sobre no enviar spam o cualquier uso fraudulento de datos está prohibido de acuerdo con la ley.
6. Un web scraper es versátil
Tal vez ha experimentado sitios web particulares que cambian su diseño o estructura de vez en cuando. No se frustre cuando se encuentre con sitios web que su scraper no puede leer por segunda vez. Hay muchas razones. No se activa necesariamente al identificarte como un bot sospechoso. También puede ser causado por diferentes ubicaciones geográficas o acceso de la máquina. En estos casos, es normal que un web scraper no pueda analizar el sitio web antes de establecer el ajuste.
7. Puedes scraping web a alta velocidad
Es posible que haya visto anuncios de scraper que dicen cuán rápidos son sus scrapers. Suena bien ya que le dicen que pueden recopilar datos en segundos. Sin embargo, si causas daños a la empresa, serás un delincuente y será procesado. Esto se debe a que una solicitud de datos escalables a una velocidad rápida sobrecargará un servidor web, lo que podría provocar un bloqueo del servidor. En este caso, la persona es responsable por el daño bajo la ley de "trespass to chattels" (Dryer y Stockton 2013). Si no está seguro de si el sitio web es scrapable o no, pregúntele al proveedor de servicios de desguace web. Octoparse es un proveedor de servicios de raspado web responsable que coloca la satisfacción de los clientes en primer lugar. Para Octoparse es crucial ayudar a nuestros clientes a resolver el problema y tener éxito.
8. API y Web scraping son lo mismo
API es como un canal para enviar su solicitud de datos a un servidor web y obtener los datos deseados. API devolverá los datos en formato JSON a través del protocolo HTTP. Por ejemplo, Facebook API, Twitter API, y Instagram API. Sin embargo, no significa que pueda obtener los datos que solicite. El web scraping puede visualizar el proceso ya que le permite interactuar con los sitios web. Octoparse tiene plantillas de web scraping. Es aún más conveniente para los profesionales no tecnológicos extraer datos al completar los parámetros con palabras clave/URL.
9. The scraped data only works for our business after being cleaned and analyzed
Many data integration platforms can help visualize and analyze the data. In comparison, it looks like data scraping doesn’t have a direct impact on business decision making. Web scraping indeed extracts raw data of the webpage that needs to be processed to gain insights like sentiment analysis. However, some raw data can be extremely valuable in the hands of gold miners.
9. Los scraped data solo funcionan para nuestro negocio después de ser limpiados y analizados
Muchas plataformas de integración de datos pueden ayudar a visualizar y analizar los datos. En comparación, parece que el scraping de datos no tiene un impacto directo en la toma de decisiones comerciales. De hecho, el web scraping extrae datos sin procesar de la página web que deben procesarse para obtener información como el análisis de sentimientos. Sin embargo, algunos datos en bruto pueden ser extremadamente valiosos en manos de los mineros de oro.
Con la plantilla de web scraping de Octoparse Google Search para buscar un resultado de búsqueda orgánica, puede extraer información, incluidos los títulos y meta descripciones sobre sus competidores para determinar sus estrategias de SEO; Para las industrias minoristas, el web scraping se puede usar para controlar los precios y la distribución de los productos. Por ejemplo, Amazon puede crawl Flipkart y Walmart en el catálogo "Electrónico" para evaluar el rendimiento de los artículos electrónicos.
10. El web scraping solo puede usarse en negocios
El web scraping se usa ampliamente en varios campos además de la generación de leads, el monitoreo de precios, el seguimiento de precios y el análisis de mercado para empresas. Los estudiantes también pueden aprovechar una plantilla de web scraping de Google Académico para realizar investigaciones de tesis. Los agentes inmobiliarios pueden realizar investigaciones de vivienda y predecir el mercado inmobiliario. Podrá encontrar personas influyentes de Youtube o Twitter para promocionar su marca o su propia agregación de noticias que cubra los únicos temas que desea al scraping los medios de comunicación y los RSS feeds.
submitted by melisaxinyue to webscraping [link] [comments]


2020.06.07 06:42 wcfaulkner La realidad alterna de La Luz del Mundo en México The alternate reality of The Light of the World in Mexico

ESPAÑOL
La realidad de la situación actual de Naasón Joaquín García en Estados Unidos se vive de manera diferente en México. Un miembro de la iglesia en México entra a este Reddit, y en los relatos, encuentra una realidad alterna de la iglesia que creía conocer al 100%, ese es el principal motivo por el que cree que todo lo que se expone en este grupo es falso. En diferentes canales de Youtube se dice que la feligresía cree ciegamente en Naasón porque son idolatras, pero yo creo que es porque toda la historia no les es familiar, no conocen a ningún implicado, no conocen a Alondra ni a Susana, por eso a Silem se le facilita decir que no las conocemos, porque es cierto, para la iglesia en México ellas son unas desconocidas. En Agosto, durante las Santas Cenas, había una clara línea divisoria entre la juventud mexicana y la estadounidense, tan sólo en el conocimiento que tenían los dos grupos sociales acerca de la familia Joaquín; la iglesia en Estados Unidos siempre ha hablado de Naasón Joaquín como alguien muy cercano, es obvio, al parecer siempre lo tuvieron allá de ministro, conocidos siempre hablaban de de él como el hombre que los animó a irse a la obra o de unirse a la plantilla de Berea Vision. La iglesia en México siempre vio a Naasón como un príncipe de una familia real, un personaje de linaje divino, y muy lejano para el ser terrenal. Eso me da la impresión que su bastión original siempre fue USA y que el centro de las cosas que pasaron siempre fue la iglesia de Los Ángeles. El objetivo de este texto, no es extenderme demasiado en estas descripciones, más bien, lo que intento es que me digan si estoy en lo correcto en la manera en la que identifico esa frontera, barrera o línea divisoria que hay entre la iglesia de USA y México, barreras que hacen a estas dos iglesias diferentes. Por favor, ayúdenme a responder estas preguntas:
  1. ¿Creen ustedes que la iglesia en México vive de la misma manera el arresto y encarcelamiento de Naasón? (Yo creo que no, creo que en USA la mayoría encuentra más familiar la situación dado que los sucesos por lo que lo detuvieron tuvieron su punto de acción en USA. En México no, para la juventud en las iglesias mexicanas todo lo que leen aquí y en los medios les suena como un escenario lejano difícil de creer porque los nombres de los implicados son extraños)
  2. En México ¿Creen que la también hay una brecha o barrera entre la iglesia de Hermosa Provincia y las demás iglesias en todo México? (Esta pregunta es por que siempre se nos ha dicho que la iglesia de HP es como la hermana mayor. Amistades de HP me han contado historias increíbles sobre la juventud de HP, sobre los incondicionales e hijos de ministros, referente a fiestas que se llevaban a cabo días antes del 14 de Agosto, fiestas donde había alcohol, y libertades sexuales, quizá alguien aquí sepa más)
  3. Un comentario. Yo creo que hay dos clases de feligreses en la iglesia: 1. El feligrés común, ese que se congrega tres veces al día y 2. Feligreses de la élite, esos que conocen de cerca a la familia Joaquín y que conoce sus perversiones, que son amigos de los Joaquín, ellos saben todo, pero jamás lo contarían a un feligrés común, creo que tienen intereses de todo tipo anlazados con la familia Joaquín.
El fin de este escrito es para hacer del conocimiento de todos ustedes, que en México se cree que tenemos información diferente a la que se tiene en las iglesias de Estados Unidos. Leyendo este reddit, veo que la intención de muchos de ustedes es ayudar a las almas realmente honorables, a salir de este engaño. Yo les puedo constatar que antes del COVID-19, las iglesias se seguían llenando, no había un claro declive de feligresía en México, al contrario, se sigue adorando a Naasón y se sigue dando la cara por él.
No doy mis datos personales por la razones que ustedes ya conocen, si estás en contra de la iglesia pierdes todo. Creo fielmente que si la iglesia de USA comienza a entablar conexiones con los hermanos de México, ellos abrirán los ojos antes de lo que creen.
Dios les bendiga.
----------------------------------------------------------------------------------------------------------------------------------------------
ENGLISH
The reality of the current situation of Naasón Joaquín García in the United States is experienced differently in Mexico. A member of the church in Mexico enters this Reddit, and in the stories, he finds an alternate reality of the church that he believed he knew 100%, that is the main reason why he believes that everything that is exposed in this group is false. In different YouTube channels, it is said that the parishioners blindly believe in Naasón because they are idolaters, but I think it is because the whole story is not familiar to them, they do not know any involved, they do not know Alondra or Susana, therefore Silem It is easy for him to say that we do not know them, because it is true, for the church in Mexico they are unknown. In August, during the Holy Suppers, there was a clear dividing line between the Mexican and the American youth, only in the knowledge that the two social groups had about the Joaquín family; the church in the United States has always spoken of Naasón Joaquín as someone very close, it is obvious, apparently, they always had him there as a minister, my acquaintances always spoke of him as the man who encouraged them to go to "la obra" or to join the Berea Vision headcount. The church in Mexico always saw Naasón as a prince of a royal family, a personage of divine lineage, and very distant for the common humans. That gives me the impression that it is original headquarter was always the USA and that the center of things that happened was always the church in Los Angeles. The objective of this text is not to elaborate too much on these descriptions, rather, what I am trying to do is that your tell me if I am correct in the way in which I identify that border, barrier or dividing line that exists between the church in the USA and Mexico, barriers that make these two churches different. Please help me answer these questions:
  1. Do you think that the church in Mexico lives the same way the arrest and imprisonment of Naasón? (I think not, I think that in the USA the majority find the situation more familiar since the events that arrested him had their point of action in the USA. Not in Mexico, for the youth in the Mexican churches everything they read here and in the media it sounds like a distant scenario difficult to believe because the names of those involved are strange)
  2. In Mexico. Do you think that there is also a gap or barrier between the church of Hermosa Provincia and the other churches throughout Mexico? (This question is why we have always been told that the HP church is like the "hermana mayor". HP friends have told me incredible stories about HP's youth, about the "incondicionales" and sons of ministers, about parties that were taking days before August 14, parties where there was alcohol, and sexual liberties, maybe someone here knows more)
  3. A comment. I believe that there are two kinds of members in the church: 1. The common member, the one who congregates three times a day and 2. The elite members, those who know the Joaquín family closely and who know their perversions, who They are friends of the Joaquín family, they know everything, but they would never tell a common member, I think they have interests of all kinds linked to the Joaquín family.
The purpose of this writing is to make it known to all of you, that in Mexico it is believed that we have different information than that available in the churches of the United States. Reading this reddit, I see that the intention of many of you is to help really honorable souls, to get out of this deception. I can confirm that before COVID-19, the churches continued to fill up, there was no clear decline in membership in Mexico, on the contrary, we continue to worship Naasón and continue to stand up for him.
I do not give my personal data for the reasons that you already know, if you are against the church you lose everything. I believe faithfully that if the US church begins to make connections with the brothers in Mexico, brothers and Sisters of México will open their eyes sooner than they think.
God bless you.
by: authorless
submitted by wcfaulkner to exlldm [link] [comments]


2020.04.01 06:24 TulkasNuuk Need some expert eye to see why this code aint working

Hi community!
I have just started a new project for web scraping https://mercadolibre.com.ar that is an equivalent to ebay in Argentina.I took the example online as I am starting to learn Python. It seems that the code is missing some references and I have been able to solve 4/5 lines. The last one is line 125 that it seems that is searching for a specific variable call that doesnt exist or work properly.
Any ideas on how to make it work?Help is appreciated as I am learning this to be able to build a project.

''' SCRAPPER MERCADOLIBRE - API --------------------------- Version: 2.0 Autor: Juan Jose Sisti Ultima Revision: 2018-03-26 Descripcion: Bajada de datos desde mercadolibre, utilizando el acceso via API POST que proveen. El proceso esta preparado para descargar dos tipos de elementos, inmuebles y vehiculos Se puede configurar modo DEBUG (set_debug(true)) para solo procesar los primeros elementos, esto tambien activa el modo "verbose" con salida detallada Requisitos de instalacion: - Python 3.x - Libreriras (incluye los comandos de instalacion) pip install numpy pip install pandas pip install pyodbc ''' from time import gmtime, strftime # Para obtener la fecha actual import pandas as pd import requests # Bajada de datos URL class inmueble: mercadolibre_id = 'MLA79242' tabla = 'mercadolibre_inmueble' # Utilizada para la carga en SQL columnas = ['fecha', 'producto_latitud', 'producto_longitud', 'url', 'tipo_propiedad']
# Conversion de json a dataframe y rearmado de datos para que sea formato tabla def adapt(self, items): data = pd.DataFrame(items) data = data.groupby(['id']).first().reset_index() # Elimina duplicados largo = data.shape[0] for i in range(0, largo): if (i % 100 == 0): print("Procesando: " + str(i) + " de " + str(largo)) try: # La fecha es la fecha de ejecucion, como este es un proceso diario, la necesitamos # para poder identificar las diferentes corridas data.loc[i, 'fecha'] = strftime("%Y_%m_%d", gmtime()) data.loc[i, 'mercadolibre_id'] = data.loc[i, 'id'] data.loc[i, 'producto_latitud'] = data.loc[i, 'location']['latitude'] data.loc[i, 'producto_longitud'] = data.loc[i, 'location']['longitude'] data.loc[i, 'url'] = data.loc[i, 'permalink'] dataAttr = pd.DataFrame(data.loc[i, 'attributes']) if (dataAttr.loc[dataAttr['id'] == 'PROPERTY_TYPE']['value_name'].count() > 0): data.loc[i, 'tipo_propiedad'] = dataAttr.loc[dataAttr['id'] == 'PROPERTY_TYPE']['value_name'].item() else: data.loc[i, 'tipo_propiedad'] = 'DESCONOCIDO' except Exception as e: print('Error adaptando: ' + str(i) + ' - ' + str(data.loc[i, 'mercadolibre_id']) + ' - ' + ' -- %s' % e) pass data = data.fillna('') # Los nulos los completamos con un string vacio return data[self.columnas]
class mercadolibreAPI: debug = False # Limita el procesamiento a los primeros elementos del primer indice, habilida la salida por pantalla de mensajes query = None objeto = None ml_url = 'http://api.mercadolibre.com/sites/MLA/search?category=' items = [] pd.options.display.float_format = '{:.2f}'.format
def set_debug(self, debug): self.debug = debug if self.debug: print("Modo Debug ENCENDIDO")
def request_get(self, url): if self.debug: print("Procesando url: ", url) try: return requests.get(url).json() except: return None def search(self, objeto: object) -> object: self.objeto = objeto() url = self.ml_url + self.objeto.mercadolibre_id + '&_PublishedToday_YES' print("Buscando: " + url) if (self.debug): paginators = 5 else: paginators = round(self.request_get(url)['paging']['total'] / 50) + 1 # Limito un poco los paginators, solo me traigo las primeras XX paginas # if(paginators>200): paginators = 200 for offset in range(0, paginators): url = self.ml_url + self.objeto.mercadolibre_id + '&_PublishedToday_YES&limit=50&offset=' + str(offset * 50) jsdata = self.request_get(url) if jsdata is not None: self.items = self.items + jsdata['results'] self.adapt()
def adapt(self): o = self.objeto self.items = o.adapt(self.items)
def export(self, tipo='csv'): if tipo.lower() == 'sql': self.export_sql() elif tipo.lower() == 'csv': self.export_csv() else: print("No existe el metodo de exportacion: " + tipo.lower())
def export_sql(self): ## No implementado return None def export_csv(self): archivo = "indice_" + self.objeto.mercadolibre_id + ".csv" if (self.debug): print("Guardando archivo", archivo) self.items.to_csv(archivo, sep=";", decimal=",")
ml = mercadolibreAPI() ml.set_debug(False) ml.search(inmuebles) ml.export() print("Fin")
submitted by TulkasNuuk to learnpython [link] [comments]


2020.03.10 17:00 Bajoelbalaclava React component not rendering after useRef object gets updated

I have the following component which should generate a d3 bar chart and update it every 3 seconds. It receives a dataset from its parent every 3 seconds. Right now, it generates the chart but it does not update it. I can confirm that the dataset is updated and received every 3 seconds and then useEffect is triggered. I have tried to set intervals and replace useRef but it did not work.
Below you can see the code. Note that the original one can be found here: https://stackoverflow.com/questions/60614395/react-component-not-rendering-after-useref-object-gets-updated In this version, I did not used useState and I rendered the "ref" variable. The result was the same though...
Any idea? Any other way I should structure this kind of component to generate D3 elements? Let me know if you need more info. Thanks

import React, { useState, useRef, useEffect } from "react"; import * as d3 from "d3"; export const BarChart = ({ dataset }) => { const ref = useRef(); const [chart, setChart] = useState(ref); useEffect(() => { if (dataset && dataset[0].valor) { const svgHeight = 200; const svgWidth = 350; const barPadding = 30; const barWidth = svgWidth / dataset.length; const svgElement = d3 .select(ref.current) .attr("width", svgWidth) .attr("height", svgHeight); svgElement .selectAll("rect") .data(dataset) .enter() .append("rect") .attr("y", d => svgHeight - d.valor - 40) .attr("x", (d, i) => i * barWidth) .attr("height", d => d.valor) .attr("width", barWidth - barPadding) .attr("fill", d => (d.valor > 47 ? "blue" : "red")); svgElement .selectAll("text.one") .data(dataset) .enter() .append("text") .text(d => `${d.valor} %`) .attr("x", (d, i) => i * barWidth) .attr("y", (d, i) => 25) .attr("class", "one"); svgElement .selectAll("text.two") .data(dataset) .enter() .append("text") .text(d => `${d.descripcion}`) .attr("x", (d, i) => i * barWidth) .attr("y", svgHeight - 20) .attr("class", "two") .style("font-size", "10px"); setChart(ref); } }, [dataset, chart, ref]); return (
{dataset[0].valor}
); };
submitted by Bajoelbalaclava to learnreactjs [link] [comments]


2020.02.24 21:35 fenchai Flutter Provider is not Updating my Widget even though I tested the data is right?

This is a repost from my post on stackoverflow, hopefully someone can help.link
problem: I am trying to build a widget that gets data from a JSON file, but I am not sure why the provider is not updating the widget. (no errors while debugging, simply no update on the widget happens.)
This is the widget that is supposed to show the JSON data.
class CatalogPage extends StatefulWidget { @override _CatalogPageState createState() => _CatalogPageState(); } class _CatalogPageState extends State with AutomaticKeepAliveClientMixin { @override bool get wantKeepAlive => true; // needed for keepAlive @override Widget build(BuildContext context) { super.build(context); // needed for keepAlive bool _loading = Provider.of(context, listen: true).getLoading; List _catalogItems = Provider.of(context, listen: false).getCatalogItems; return Scaffold( body: _loading == true ? Center( child: CircularProgressIndicator(), ) : ListView.builder( itemCount: _catalogItems.length, itemBuilder: (context, index) { return Card( child: ListTile( title: Text(_catalogItems[index].code.toString()), ), ); }, )); } @override void initState() { print('hi from catalogPage!'); Screen1Provider().updateJsonCatalog(); super.initState(); } } 
this is the provider data for the above widget
class Screen1Provider with ChangeNotifier { int _catalogPageIndex = 1; int _medidasPageIndex = 0; List _itemsCatalog = []; List _itemsMedidas = []; List _itemsExcluded = []; bool _loading = true; int get getCatalogPageIndex => _catalogPageIndex; bool get getLoading => _loading; void setLoading(bool boolean) { _loading = boolean; notifyListeners(); } void setCatalogPageIndex(int index) { _catalogPageIndex = index; notifyListeners(); } void setItemsCatalog(data) { _itemsCatalog = data; print('> setItemsCatalog'); print(_itemsCatalog[0].code); //printing correctly here as well getItemsCatalog; } List get getItemsCatalog { print('> getItemsCatalog'); if (_itemsCatalog.length > 0) { print(_itemsCatalog[0].desc); //printing correctly here as well } return _itemsCatalog; } void setItemsMedidasGroup(data) { // _itemsMedidas.addAll(data); // _itemsMedidas = data; } void setItemsExcluded(data) { // _itemsExcluded.addAll(data); // _itemsExcluded = data; } void updateJsonCatalog() { print('updating catalog'); setLoading(true); _itemsCatalog.clear(); _itemsMedidas.clear(); _itemsExcluded.clear(); getJsonCatalog().then((data) { setItemsCatalog(data[0]); // setItemsMedidasGroup(data[1]); // setItemsExcluded(data[2]); setLoading(false); print('> is loading?: $_loading'); }); } // Function to get catalog in json Future getJsonCatalog() async { print('trying to download catalog...'); List _returnList = []; String _url = 'https://www.dropbox.com/s/qubo8rigrkkvnqm/DummyJsonTest.json?dl=1'; try { var r = await http.get(_url); var jsonData = json.decode(r.body); // this is used to prevent Price error when it's empty // messes up with double.parse formulas String tempPrice; for (var header in jsonData) { if (header["CODIGO"] == '') { // skip if empty continue; } if (header["PRECIO"] == '') { tempPrice = '0.00'; } else { tempPrice = header["PRECIO"]; } CatalogItems item = CatalogItems( header["CODIGO"], header["DESCRIPCION"], header["INVENT"], double.parse(tempPrice).toStringAsFixed(2).toString(), header["COD.ALT."], header["DESC.ALT."], header["GRUPO"], (double.parse(tempPrice) * 0.8).toStringAsFixed(2).toString(), ); // only add if item in CatalogItems.groups if (CatalogItems.groups.contains(header["GRUPO"])) { _itemsCatalog.add(item); } else if (CatalogItems.medidaGroups.contains(header["GRUPO"])) { _itemsMedidas.add(item); } else { _itemsExcluded.add(item); } } } catch (e) { print('error'); print(e); } finally { // this triggers even if catalog failed to download } // below will NOT trigger if an error was catched print('no errors while downloading JSON'); print('${_itemsCatalog[0].code}${_itemsCatalog[0].desc}${_itemsCatalog[0].price}'); // prints correctly here _returnList = [_itemsCatalog, _itemsMedidas, _itemsExcluded]; return _returnList; } } 
Please let me know if there could be a better way to do this as I am just learning about the provider.
EDIT: link of the project [https://www.dropbox.com/sh/k8v8d730p0qmbvl/AABG1jcPC_Zpu7O2yLk_idmxa?dl=0\]\[1\] please comment out the assets on pubspec.yaml file if there are errors.
EDIT2: added dummy json data link to the project so feel free to just run it. Otherwise this is the json data:
[{"CODIGO": "13271190", "DESCRIPCION": "A/A CHE TRAX 13- GITY 2014- SONI 13396514 95152912 52420930 CUK2", "INVENT": "890", "PRECIO": "3.54", "COD.ALT.": "AC9205", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27274-7J125 SET", "DESCRIPCION": "A/A NIS PATHFINDER NEW 2015 - 2PC 27275-1N605", "INVENT": "637", "PRECIO": "4.42", "COD.ALT.": "AC2503 SET", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27274-EA000 SET", "DESCRIPCION": "A/A NIS FRONTIER VQ40 YD25 PATHFIADER D40 VITARRA J20 27274-EL00A 27277-4JA0A", "INVENT": "1072", "PRECIO": "4.25", "COD.ALT.": "AC2507SET", "DESC.ALT.": "27277-4JA0A GRAN VITARRA J20", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27274-EB700-F SET", "DESCRIPCION": "A/A NIS NAVARA D40T DELGADA 2 PCS CA18320", "INVENT": "1117", "PRECIO": "4.22", "COD.ALT.": "AC22005 SET", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27275-1N601", "DESCRIPCION": "A/A NIS FRONTIER VQ25D -02 QG 16 ZD30 QD32", "INVENT": "314", "PRECIO": "4.95", "COD.ALT.": "AC2502SET", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27277-00A26", "DESCRIPCION": "A/A NIS TIIDA C13 HR16 15- JUKE 2015- HR16DE VERSA 27277-1KA0A", "INVENT": "2061", "PRECIO": "3.65", "COD.ALT.": "AC0182", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27277-1HA0A", "DESCRIPCION": "A/A NIS QASHQAI 13- VERSA 14- MARCH 13- ALMERA 11- K1267 27277-4BA0A", "INVENT": "1777", "PRECIO": "3.82", "COD.ALT.": "AC2513", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27277-1KK0A", "DESCRIPCION": "A/A NIS VERSA 2015- HOT", "INVENT": "2642", "PRECIO": "4.95", "COD.ALT.": "", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27277-3JC1B", "DESCRIPCION": "A/A NI MURANO 14- PATHFINDER 2013- QR25D ALTIMA 12-", "INVENT": "451", "PRECIO": "4.65", "COD.ALT.": "AC0208", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27277-4BA0A", "DESCRIPCION": "A/A NIS XTRAIL 13- RENAULT CA18361 27277-1HA0A", "INVENT": "426", "PRECIO": "3.71", "COD.ALT.": "A2514", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}, {"CODIGO": "27277-4KH0A", "DESCRIPCION": "A/A NI URBAN NV350 12- PASTROL 10- PATHFHANER 16- OF", "INVENT": "1420", "PRECIO": "3.89", "COD.ALT.": "27277-5JJ0A", "DESC.ALT.": "", "GRUPO": "10.FILTRO A/A"}] 
Edit3: Improved debugging prints, verified boolean trigger is correct. But widget is still not updating (CircularProgressIndicator() should only show if boolean is false, but it keeps spinning forever)
I/flutter ( 5948): hi from catalogPage! I/flutter ( 5948): updating catalog I/flutter ( 5948): trying to download catalog... I/flutter ( 5948): > getItemsCatalog I/flutter ( 5948): no errors, done I/flutter ( 5948): 13271190A/A CHE TRAX 13- GITY 2014- SONI 13396514 95152912 52420930 CUK23.54 I/flutter ( 5948): > setItemsCatalog I/flutter ( 5948): 13271190 I/flutter ( 5948): > getItemsCatalog I/flutter ( 5948): A/A CHE TRAX 13- GITY 2014- SONI 13396514 95152912 52420930 CUK2 I/flutter ( 5948): > is loading?: false 
submitted by fenchai to Flutter [link] [comments]


2020.02.10 21:46 Blubari Been trying to upload data to an sql database for a while now

Been trying to upload data to an sql database for a while now
Hi! Sorry if this doesn't belong here, I just learned about this subreddit. I'm making a laravel app that is about uploading data (mainly, ""templates"" of data) to an sql database, said database should look like this:
Sorry for the spanish
The table "plantillas" still doesn't exist, so the relation is User->Proyecto(project)->Texto_Descripcion_Plantilla->Texto_Descripcion.
The code I have to upload the data is in the following picture (I've used both the commented and uncommented) and got an error, these errors to be exact:
https://preview.redd.it/m7tqrbjdo5g41.png?width=1366&format=png&auto=webp&s=da32285312271ca0e5e6751082ca479649373a2e

https://preview.redd.it/n398skijq5g41.png?width=1366&format=png&auto=webp&s=7feaf8ec5c6c5731da7f11e725fd43108a92acab

https://preview.redd.it/rcwq15ryq5g41.png?width=1366&format=png&auto=webp&s=6ff868995eeac764f066153c73cea33b3f6d9c4f

This is what I have in the main classes:
Proyectos/Projects


Texto_Descripcion_Plantillas


Textos_Descripcion

Is this an error with the belongsTo/hasMany?
I've already asked in stack overflow but I didn't receive any answers, if this doesn't belong here please do tell and I'll delete it inmediately
submitted by Blubari to laravel [link] [comments]


2019.08.08 18:33 betogm Using sorted() on a list of class objects messes up the list's original order

Hello, allow me to explain what I mean with my question:
I have a Python script that reads a large tab-delimited text file, over 1 million lines long with 40 columns each line, and I was given the task to take this file and convert it to an Excel file. Another task it's supposed to do is sort the data by a specific column.
To make this easier for me I decided to put each line in a class containing all 40 columns as class variables and append this class to a list of classes, though I'm not sure if this is the best way to do it.
After appending all I need to append in the list I call the sorted() function to sort it, this is how it looks:
sorted(amazonias, key = lambda x: x.price)
It sorts as expected, however I noticed that the column order changed drastically. Instead of seeing columns as:
1, 2, 3, 4,....,40
I see them as:
10,5,2,4,8,5,.....,37 (approximation, I'm not sure if that is the actual order but you get the drill)
I don't know why this happens and much less how to fix it. Can you please help me? Thanks!

Code:


import csv import sys import warnings import os warnings.filterwarnings('ignore') class AmazonInventario: `def __init__(self, titulo, descripcion, listingId, sku, price, cantidad, opendate,` `url, marketplace, productType, shippingFee, note, condition, category1, browsePath,` `storefront, asin1, asin2, asin3, international, expedite, boldface, productId, placement,` `addDelete, pendingQuantity, fulfillmentChannel, businessPrice, QuantityPriceType,` `LowerBound1, QuantityPrice1, LowerBound2, QuantityPrice2, LowerBound3, QuantityPrice3,` `LowerBound4, QuantityPrice4, LowerBound5, QuantityPrice5, shippingGroup):` `self.__titulo = titulo` `self.__descripcion = descripcion` `self.__listingId = listingId` `self.__sku = sku` `self.__price = price` `self.__cantidad = cantidad` `self.__opendate = opendate` `self.__url = url` `self.__marketplace = marketplace` `self.__productType = productType` `self.__shippingFee = shippingFee` `self.__note = note` `self.__condition = condition` `self.__category1 = category1` `self.__browsePath = browsePath` `self.__storefront = storefront` `self.__asin1 = asin1` `self.__asin2 = asin2` `self.__asin3 = asin3` `self.__international = international` `self.__expedite = expedite` `self.__boldface = boldface` `self.__productId = productId` `self.__placement = placement` `self.__addDelete = addDelete` `self.__pendingQuantity = pendingQuantity` `self.__fulfillmentChannel = fulfillmentChannel` `self.__businessPrice = businessPrice` `self.__QuantityPriceType = QuantityPriceType` `self.__LowerBound1 = LowerBound1` `self.__QuantityPrice1 = QuantityPrice1` `self.__LowerBound2 = LowerBound2` `self.__QuantityPrice2 = QuantityPrice2` `self.__LowerBound3 = LowerBound3` `self.__QuantityPrice3 = QuantityPrice3` `self.__LowerBound4 = LowerBound4` `self.__QuantityPrice4 = QuantityPrice4` `self.__LowerBound5 = LowerBound5` `self.__QuantityPrice5 = QuantityPrice5` `self.__shippingGroup = shippingGroup` `"""titulo"""` `@property` `def titulo(self):` `return self.__titulo` `@titulo.setter` `def titulo(self, value):` `self.__titulo = value` `@titulo.deleter` `def titulo(self):` `del self.__titulo` `"""descripcion"""` `@property` `def descripcion(self):` `return self.__descripcion` `@descripcion.setter` `def descripcion(self, value):` `self.__descripcion = value` `@descripcion.deleter` `def descripcion(self):` `del self.__descripcion` `"""listingId"""` `@property` `def listingId(self):` `return self.__listingId` `@listingId.setter` `def listingId(self, value):` `self.__listingId = value` `@listingId.deleter` `def listingId(self):` `del self.__listingId` `"""sku"""` `@property` `def sku(self):` `return self.__sku` `@sku.setter` `def sku(self, value):` `self.__sku = value` `@sku.deleter` `def sku(self):` `del self.__sku` `"""price"""` `@property` `def price(self):` `return self.__price` `@price.setter` `def price(self, value):` `self.__price = value` `@price.deleter` `def price(self):` `del self.__price` `"""cantidad"""` `@property` `def cantidad(self):` `return self.__cantidad` `@cantidad.setter` `def cantidad(self, value):` `self.__cantidad = value` `@cantidad.deleter` `def cantidad(self):` `del self.__cantidad` `"""opendate"""` `@property` `def opendate(self):` `return self.__opendate` `@opendate.setter` `def opendate(self, value):` `self.__opendate = value` `@opendate.deleter` `def opendate(self):` `del self.__opendate` `"""url"""` `@property` `def url(self):` `return self.__url` `@url.setter` `def url(self, value):` `self.__url = value` `@url.deleter` `def url(self):` `del self.__url` `"""marketplace"""` `@property` `def marketplace(self):` `return self.__marketplace` `@marketplace.setter` `def marketplace(self, value):` `self.__marketplace = value` `@marketplace.deleter` `def marketplace(self):` `del self.__marketplace` `"""productType"""` `@property` `def productType(self):` `return self.__productType` `@productType.setter` `def productType(self, value):` `self.__productType = value` `@productType.deleter` `def productType(self):` `del self.__productType` `"""shippingFee"""` `@property` `def shippingFee(self):` `return self.__shippingFee` `@shippingFee.setter` `def shippingFee(self, value):` `self.__shippingFee = value` `@shippingFee.deleter` `def shippingFee(self):` `del self.__shippingFee` `"""note"""` `@property` `def note(self):` `return self.__note` `@note.setter` `def note(self, value):` `self.__note = value` `@note.deleter` `def note(self):` `del self.__note` `"""condition"""` `@property` `def condition(self):` `return self.__condition` `@condition.setter` `def condition(self, value):` `self.__condition = value` `@condition.deleter` `def condition(self):` `del self.__condition` `"""category1"""` `@property` `def category1(self):` `return self.__category1` `@category1.setter` `def category1(self, value):` `self.__category1 = value` `@category1.deleter` `def category1(self):` `del self.__category1` `"""browsePath"""` `@property` `def browsePath(self):` `return self.__browsePath` `@browsePath.setter` `def browsePath(self, value):` `self.__browsePath = value` `@browsePath.deleter` `def browsePath(self):` `del self.__browsePath` `"""storefront"""` `@property` `def storefront(self):` `return self.__storefront` `@storefront.setter` `def storefront(self, value):` `self.__storefront = value` `@storefront.deleter` `def storefront(self):` `del self.__storefront` `"""asin1"""` `@property` `def asin1(self):` `return self.__asin1` `@asin1.setter` `def asin1(self, value):` `self.__asin1 = value` `@asin1.deleter` `def asin1(self):` `del self.__asin1` `"""asin2"""` `@property` `def asin2(self):` `return self.__asin2` `@asin2.setter` `def asin2(self, value):` `self.__asin2 = value` `@asin2.deleter` `def asin2(self):` `del self.__asin2` `"""asin3"""` `@property` `def asin3(self):` `return self.__asin3` `@asin3.setter` `def asin3(self, value):` `self.__asin3 = value` `@asin3.deleter` `def asin3(self):` `del self.__asin3` `"""international"""` `@property` `def international(self):` `return self.__international` `@international.setter` `def international(self, value):` `self.__international = value` `@international.deleter` `def international(self):` `del self.__international` `"""expedite"""` `@property` `def expedite(self):` `return self.__expedite` `@expedite.setter` `def expedite(self, value):` `self.__expedite = value` `@expedite.deleter` `def expedite(self):` `del self.__expedite` `"""boldface"""` `@property` `def boldface(self):` `return self.__boldface` `@boldface.setter` `def boldface(self, value):` `self.__boldface = value` `@boldface.deleter` `def boldface(self):` `del self.__boldface` `"""productId"""` `@property` `def productId(self):` `return self.__productId` `@productId.setter` `def productId(self, value):` `self.__productId = value` `@productId.deleter` `def productId(self):` `del self.__productId` `"""placement"""` `@property` `def placement(self):` `return self.__placement` `@placement.setter` `def placement(self, value):` `self.__placement = value` `@placement.deleter` `def placement(self):` `del self.__placement` `"""addDelete"""` `@property` `def addDelete(self):` `return self.__addDelete` `@addDelete.setter` `def addDelete(self, value):` `self.__addDelete = value` `@addDelete.deleter` `def addDelete(self):` `del self.__addDelete` `"""pendingQuantity"""` `@property` `def pendingQuantity(self):` `return self.__pendingQuantity` `@pendingQuantity.setter` `def pendingQuantity(self, value):` `self.__pendingQuantity = value` `@pendingQuantity.deleter` `def pendingQuantity(self):` `del self.__pendingQuantity` `"""fulfillmentChannel"""` `@property` `def fulfillmentChannel(self):` `return self.__fulfillmentChannel` `@fulfillmentChannel.setter` `def fulfillmentChannel(self, value):` `self.__fulfillmentChannel = value` `@fulfillmentChannel.deleter` `def fulfillmentChannel(self):` `del self.__fulfillmentChannel` `"""businessPrice"""` `@property` `def businessPrice(self):` `return self.__businessPrice` `@businessPrice.setter` `def businessPrice(self, value):` `self.__businessPrice = value` `@businessPrice.deleter` `def businessPrice(self):` `del self.__businessPrice` `"""QuantityPriceType"""` `@property` `def QuantityPriceType(self):` `return self.__QuantityPriceType` `@QuantityPriceType.setter` `def QuantityPriceType(self, value):` `self.__QuantityPriceType = value` `@QuantityPriceType.deleter` `def QuantityPriceType(self):` `del self.__QuantityPriceType` `"""LowerBound1"""` `@property` `def LowerBound1(self):` `return self.__LowerBound1` `@LowerBound1.setter` `def LowerBound1(self, value):` `self.__LowerBound1 = value` `@LowerBound1.deleter` `def LowerBound1(self):` `del self.__LowerBound1` `"""QuantityPrice1"""` `@property` `def QuantityPrice1(self):` `return self.__QuantityPrice1` `@QuantityPrice1.setter` `def QuantityPrice1(self, value):` `self.__QuantityPrice1 = value` `@QuantityPrice1.deleter` `def QuantityPrice1(self):` `del self.__QuantityPrice1` `"""LowerBound2"""` `@property` `def LowerBound2(self):` `return self.__LowerBound2` `@LowerBound2.setter` `def LowerBound2(self, value):` `self.__LowerBound2 = value` `@LowerBound2.deleter` `def LowerBound2(self):` `del self.__LowerBound2` `"""QuantityPrice2"""` `@property` `def QuantityPrice2(self):` `return self.__QuantityPrice2` `@QuantityPrice2.setter` `def QuantityPrice2(self, value):` `self.__QuantityPrice2 = value` `@QuantityPrice2.deleter` `def QuantityPrice2(self):` `del self.__QuantityPrice2` `"""LowerBound3"""` `@property` `def LowerBound3(self):` `return self.__LowerBound3` `@LowerBound3.setter` `def LowerBound3(self, value):` `self.__LowerBound3 = value` `@LowerBound3.deleter` `def LowerBound3(self):` `del self.__LowerBound3` `"""QuantityPrice3"""` `@property` `def QuantityPrice3(self):` `return self.__QuantityPrice3` `@QuantityPrice3.setter` `def QuantityPrice3(self, value):` `self.__QuantityPrice3 = value` `@QuantityPrice3.deleter` `def QuantityPrice3(self):` `del self.__QuantityPrice3` `"""LowerBound4"""` `@property` `def LowerBound4(self):` `return self.__LowerBound4` `@LowerBound4.setter` `def LowerBound4(self, value):` `self.__LowerBound4 = value` `@LowerBound4.deleter` `def LowerBound4(self):` `del self.__LowerBound4` `"""QuantityPrice4"""` `@property` `def QuantityPrice4(self):` `return self.__QuantityPrice4` `@QuantityPrice4.setter` `def QuantityPrice4(self, value):` `self.__QuantityPrice4 = value` `@QuantityPrice4.deleter` `def QuantityPrice4(self):` `del self.__QuantityPrice4` `"""LowerBound5"""` `@property` `def LowerBound5(self):` `return self.__LowerBound5` `@LowerBound5.setter` `def LowerBound5(self, value):` `self.__LowerBound5 = value` `@LowerBound5.deleter` `def LowerBound5(self):` `del self.__LowerBound5` `"""QuantityPrice5"""` `@property` `def QuantityPrice5(self):` `return self.__QuantityPrice5` `@QuantityPrice5.setter` `def QuantityPrice5(self, value):` `self.__QuantityPrice5 = value` `@QuantityPrice5.deleter` `def QuantityPrice5(self):` `del self.__QuantityPrice5` `"""shippingGroup"""` `@property` `def shippingGroup(self):` `return self.__shippingGroup` `@shippingGroup.setter` `def shippingGroup(self, value):` `self.__shippingGroup = value` `@shippingGroup.deleter` `def shippingGroup(self):` `del self.__shippingGroup` `@classmethod` `def all(self):` `return [value for name, value in vars(self).items()]` amazonias = [] headers = [] linea = 1 with open(sys.argv[1]) as file: `file_reader = csv.reader(file, delimiter='\t', quoting=csv.QUOTE_NONE)` `for line in file_reader:` `if linea > 1:` `precio = line[4]` `if line[39] != "free shipping skus":` precio = float(precio)+6 `amazonias.append(AmazonInventario(line[0], line[1], line[2], line[3], precio, line[5],line[6],line[7],line[8],line[9],line[10],line[11],line[12],line[13],line[14],line[15],line[16],line[17],line[18],line[19],line[20],` line[21],line[22],line[23],line[24],line[25],line[26],line[27],line[28],line[29],line[30],line[31],line[32],line[33],line[34],line[35],line[36],line[37],line[38],line[39])) `else:` `headers = line` `linea = linea+1` #amazonias.sort(key=lambda x: x.price, reverse=False) sorted(amazonias, key = lambda x: x.price) #import pdb; pdb.set_trace() numArchivo = 1 lineaArchivo = 2 documentsFolder = os.path.expanduser(r'~\Documents') fileSample = open(documentsFolder+"\ConteoInventarioMilybro\ArchivosExcel\excel"+str(numArchivo)+".txt","a+") fileSample.write('\t'.join("%s" % str(item) for item in headers)+"\n") for amaz in amazonias: `attrs = amaz.__dict__.values()` `fileSample.write('\t'.join("%s" % str(item) for item in attrs)+"\n")` `if lineaArchivo == 1000001:` `numArchivo = numArchivo + 1` `fileSample.close()` `fileSample = open(documentsFolder+"\ConteoInventarioMilybro\ArchivosExcel\excel"+str(numArchivo)+".txt","a+")` `fileSample.write('\t'.join("%s" % str(item) for item in headers)+"\n")` `lineaArchivo = 2` `else:` lineaArchivo = lineaArchivo + 1 fileSample.close() 
submitted by betogm to learnpython [link] [comments]


2019.07.10 20:32 Deloquito Final Project: How to add a Filter By dropdown menu in a sqlite3 table header

i am developing a web app in python using flask and a sqlite3 database. It is a web app for anonymous bullyng reports in schools. In a route called tablatestigos i want to display a table with the information of the database. The headers of the table are "Escuela", "Curso", "Victima" and "Descripcion del hecho" but i want to make that "Curso" header to be a dropdown menu (like a Filter By header) and if you select for example the course 5A, it should display ONLY the table rows of that course. I managed to create the table correctly and add that dropdown menu with all the courses in the header in html but i don't know how to connect it properly to the database so when i click in a certain "curso" it shows me only the rows for it. I don't want the webpage to refresh everytime a course is selected, i want it to happen dinamically.
This is my python and flask code:
@app.route("/tablatestigos", methods=["GET", "POST"]) @login_required def tablatestigos(): escuela = session["user_id"] hechos = db.execute("SELECT * FROM testigos WHERE escuela = :escuela", escuela=session["user_id"]) if not hechos: return apology("No se han recibido reportes aún.") return render_template("tablatestigos.html", hechos=hechos) 
html:
{% extends "layout.html" %} {% block title %} Reportes de Testigos {% endblock %} {% block main %} 
{% for hecho in hechos %} {% endfor %}
Escuela Curso Victima Descripción del hecho
{{ hecho.escuela }} {{ hecho.curso }} {{ hecho.victima }} {{ hecho.hecho }}
{% endblock %}
I thought of implementing ajax but i don't know how to connect it with the database to ONLY display the rows of the selected course and hide the otyhers.
Thanks in advance :)
submitted by Deloquito to cs50 [link] [comments]


2019.06.25 19:24 IMLL How can i insert more images in the article box?

so i have my code like this in the form:

titulo:







descripcion:



contenido:



and here's the action code that carga.php contains:
getMessage(); die(); } $titulo = $_POST['titulo_tema']; $texto = $_POST['cont']; $desc = $_POST['descripcion']; $nomb = $_FILES['banner']['name']; $tempo = $_FILES['banner']['tmp_name']; $dir = 'banners/' . $nomb; $consulta = $conexion->prepare("INSERT INTO temas(titulo, contenido, banner, descripcion) VALUES('$titulo', '$texto', '$nomb', '$desc');"); if(empty($titulo) or empty($texto) or empty($desc)){ header('location:insertar.php'); } else { move_uploaded_file($tempo, $dir); $consulta->execute(); header('location:temas.php'); } ?> 
what i need to do is that in the form my site has for creating articles i wanna see if it's possible to insert images through the text, i was thinking that maybe uploading manually the pages on somewhere else and then using the test button right after the post one could be used to add a string like "" to the content textarea and just rewrite in it the name of the image with the format, but when i did so instead i set the text in the textarea to only contain said string, is there a better way to do that or is there another way to do what i'm asking for?
submitted by IMLL to PHPhelp [link] [comments]


2019.03.27 12:49 Pipiyedu Postprocess field data in wtforms

It's posibble to postprocces the sanitized data in a wtforms field?
For example, I have the following Forms:
class ComponentesForm(Form): descripcion = StringField() area = FloatField(validators=(NumberRange(min=0.01), )) class OtherForm(Form): componentes_paredes = FieldList(FormField(ComponentesForm)) 

The 'componentes_paredes' field data is a list containing dicts. I want to procces this data and convert it into a unique dict (I don't have repeated keys). I know that can be done outside of wtforms, but I don't want to do this in the views. This is posibble?
submitted by Pipiyedu to flask [link] [comments]


2019.03.07 13:15 OneOverNever Importing Data from Web

Hey everyone!
I'm currently importing data from the WEB via Power BI and I'm stumbling on some steps.
1) I don't know how to make my function bring in more than one page of results.
2) I don't know understand if refreshing the query will bring in new results or override my old ones.
3) (as an extension of 2) If refreshing a query brings in new results, how would I go about adding a datetimestamp to each row so I can differentiate and count?
For 3) I've used the design view to teach Power BI how to fill the information I need from the webpage.
Code looking like this:
let Source = Web.BrowserContents("https://www.bumeran.com.aempleos-argentina.html"), #"Extracted Table From Html" = Html.Table(Source, {{"Trabajo", ".col-md-10 > A"}, {"Proveedor", ".nombre"}, {"Ubicacion", ".ubicacion:nth-child(3)"}, {"Sinopsis", ".descripcion"}}, [RowSelector="[id*=""\.html\?indiceAviso\=""]"]) in #"Extracted Table From Html" 
I understand that in order to add a timestamp, I'd need to DAX something in there, right?
Can I get some help with that, please? Thanks :)
EDIT - the whole code formatting thing is not working out too well, trying to fix it fixed
submitted by OneOverNever to PowerBI [link] [comments]


2019.03.04 17:28 nyohasstium Buscando Senior Developer

La empresa donde trabajo esta buscando desarrolladores. Aqui les dejo la descripcion que pasaron internamente.

Role responsibilities
Build and maintain a portfolio of web applications and services
Create and maintain excellent code (PHP, React, Node)
Provide technical leadership within the team
Participate in architectural reviews and design sessions
Promote technical excellence and continuous improvement

ESSENTIAL
Experience with building scalable web applications
Significant PHP and JavaScript development experience
Excellent data skills
Good awareness of secure coding practices
Experience of Agile delivery, and Scrum in particular
Excellent spoken and written English language skills

DESIRABLE
AWS (or cloud computing in general)
Docker (or containers in general)
Laravel, React, Node
MySql, ElasticSearch
AI technologies (e.g. SageMaker, RASA, TensorFlow)

Los que esten interesados, dejen un mensaje. O mandenme su CV en ingles con su oferta (el monto que deseen).
submitted by nyohasstium to vzla [link] [comments]


2019.02.06 20:54 Gabotron_ES Issue increasing item quantity in vuex cart

Hi everybody, I'm making my own shopping cart for learning js and vue, I'm suing vuex modules for state management and persist data in local storage. Everything works fine but adding X ammount of items acts really irregular(sums doesn't seem right, sometimes it decreases quantity instead of increasing.);
My shopping cart can hold different discounts (products).
One discount object looks like this (Iaravel spits this in JSON from): "id" => 1 "slug" => "descuento-muy-wow" "url" => "/descuentos/descuento-muy-wow" "title" => "Descuento muy wow" "body" => "Descripcion del contenido
" "originalPrice" => "12.99" "finalPrice" => "10.99" "discountPercent" => 15 "people" => 1 "codesToGenerate" => 10 "image" => "/uploads/file-06-02-2019-01-17-VFL-247.jpeg" "isVisible" => 1 "expireDate" => "2019-02-06 02:17:20" "created_at" => "2019-02-06 01:17:14" "updated_at" => "2019-02-06 01:17:20"

Method getDiscountData takes a discount as argument, then adds a new quantity property and sends it t the vuex action addProductToCart, then a mutation increments the cart item quantity by by this.quantity.
This is how I add items to cart and increase item quantity, I'm ALMOST POSITIVE that the error is in how I do the sum , in the mutation INCREASE_ITEM_QUANTITY; ``` const mutations = {
ADD_PRODUCT_TO_CART(state, product) { state.cartItems.push(product); }, INCREASE_ITEM_QUANTITY(state, product) { let index = state.cartItems.findIndex(item => item.id == product.id); state.cartItems[index].quantity = parseInt(state.cartItems[index].quantity) + parseInt(product.quantity); }, 
``` This is my component where click event is registered:
``` ```
submitted by Gabotron_ES to vuejs [link] [comments]


2019.01.09 04:08 diyobd2 TabScan S7 on Megane: read and clear codes successfully!

Tested! TabScan S7 is confirmed to work for French vehicles. Here take Renault Megane (Probado Se confirma que TabScan S7 funciona para vehículos franceses. Aquí toma Renault Megane)
OBD connection (Conexión OBD)
📷
Board status (Estado del tablero)
📷
Diagnoses (Diagnosticos)
📷
Turn on ignition with the key (Turn on ignition with the key)
📷
Euro - Renault (Euro - Renault)
📷
Car type: Megane / Scen (Tipo de carro: Megane/Scen)
📷 📷
Injection (Inyeccion)
📷 📷
Code: EF017
State: Meoria
Description: WATCH INFORMATIÓN - Failo corona volante motor
(Codigo: EF017
Estado: Meoria
Descripcion: INFORMATICION TESTIGO - Failo corona volante motor)
📷
Please turn on, off (Por favor, encender, apagado)
📷
Please turn off and wait 5 seconds (Por favor, apague y espere 5 segundos)
📷 📷
📷 📷
Please, password (Por favor, clave)
📷
Reading the problem code
Please wait...(Leyendo ei codigo deproblemaPor favor espera...)
📷
No problem code (No hay codigo de problema)
📷
Parameters (Parametros)
📷 📷
Reading of the data flow
Please wait...
(Lectura dei flujo de datos
Por favor espera...)
📷 📷 📷
Engine regime (Regimen motor)
📷 📷 📷
Tension oxygen sensor antenrior
(Tension sonda de oxigeno antenrior)
📷 📷 📷
TabScan S7 on Megane: read and clear codes successfully!
submitted by diyobd2 to u/diyobd2 [link] [comments]


2018.08.13 17:58 TheNerdBuddha Me gano la vida como Freelancer AMA (no programadores tambien bienvenidos)

Hola /Argentina!
En otro post Trabajar desde casa demostraron interes en como me gano la vida de manera Freelance y les gusto la idea de un AMA, ergo aqui estoy.
Background: Hice hasta 3ero en Ingenieria en Sistemas pero no puedo programar ni que mi vida dependa de ello. Como no sirvo para programar (intente varias veces con varios idiomas C#, Java, Python, Ruby, no hubo caso) me tire para el lado de las bases de datos y analisis de datos. Entre a trabajar en una gran corporacion cuando estaba en 1ero de la facu (si si, estan desesperados por gente en el rubro) y me fui haciendo mas o menos ducho en entender como los datos se mueven dentro de grandes corporaciones.
Mi ultimo rol en una corporacion fue haciendo ETL (Extract, Transform and Load) definicion de Wiki: A process in database usage and especially in data warehousing. Para hacer eso usabamos herramientas corporativas en las cuales no hay un mercado para trabajo Freelance.
Lidiando con una gran depresion en el año 2016 me echan (si yo hubiera sido mi jefe me hubiera echado antes) y tuve que arrancar de 0 (casi) para ganarme la vida. Intente ser consultor de Google Analytics (GA) pero no logre conseguir ni un solo cliente.
Luego me di cuenta si voy a una herramienta premium de analiticas, los clientes son mas propensos a pagar tarifas premium (GA es gratis) por lo que empece a trabajar con Mixpanel. Me lei la documentacion y busque trabajos en Upwork que digan Mixpanel, leia la descripcion e implementaba lo que ellos necesitaban en mi pagina (por 5 USD tenes tu pagina donde probar cosas ... UNA GANGA).
Respondi trabajos tratando de ir mas alla de un simple hey yo puedo ayudarte con esto, por ejemplo le daba tips de cosas que tenian mal en el enfoque de lo que pedian, o les decian si te dicen que lo pueden hacer asi, no lo hagas hacelo de esta manera que es mejor. Tratando de posicionarme con un experto para que paguen premium·
Empezaron a salir mis primeros clientes, arranque cobrando 500 USD por implementacion y la ultima que hice la cobre 1900 USD, para que se den una idea una implementacion me tomaba 100 horas al comienzo y al final me tomaba 20 horas.
Trabajando con clientes empece a notar que mas que analiticas necesitan entender que funciona dentro de su Marketing Funnel y que no.
Marketing Funnel: is a consumer focused marketing model which illustrates the theoretical customer journey towards the purchase of a product or service.
Por lo que a fines del año pasado me converti en un consultor de ejecutivos para ayudarlos en la toma de decisiones para incrementar las ventas. Les digo esta campaña funciona MUY bien, duplica el budget. Esta no funciona, matala. Etcetera.
Como los puedo ayudar?
- Como competir con freelancers que cobran la mitad que vos.
- Como armar paquetes de servicios
- Como negociar con clientes remotos
- Como convertir lo que hacen hoy en una oferta para que puedas venderle a otras empresas.
TLDR: Hace 2 años trabajo Freelance, actualmente hago Data Analysis para mejorar Marketing Funnels. Te ayudo a que arranques.
EDIT: Gente me ausento hasta mañana, tengo que trabajar (si si todo muy lindo pero trabajo tambien). A todos los que no les pueda contestar les contestare mañana al mediodia.
Espero que les haya servido,
Saludos.-
submitted by TheNerdBuddha to argentina [link] [comments]


2018.05.30 03:03 ericpap Problem using Forms (both template and reactive)

Hi. I'm trying to create my first complex form on my angular project, and i'm trying both approach: template and reactive forms (with validators).
Right now, i'm having problems with both of them, so maybe someone can give a hand or advice of wich can better fit my project.
My backend is an API Rest on NET Core, and data is sent i JSON format. I got an angular service that get the data from the API. My data object are pretty large, with more that 30 properties each.
Now about Reactive Forms, I found two problems:
1) I need to re-create the entire data object as FormControl and FormGroup collection wich is a nigthmare, like this:
this.data=new FormGroup({ 'iD_Articulo': new FormControl({value:null, disabled:true}), 'iD_Grupo': new FormControl(null, Validators.required), 'iD_SubGrupo': new FormControl(), 'iD_Unidad': new FormControl(), 'descripcion': new FormControl('', [Validators.required, Validators.minLength(3)]), 'codigo': new FormControl(), ............ }); 
2) My FormGroup collection need to have all the properties that my model have, in order to setValue to work even if i don't need to show it on my form
With Templates Forms I got two problems.
1) Some controls in PrimeNG library, like Autocomplete, don't work as espected when a field is required
2) When i need to validate a field, i have to name it 3 times (name, ngmodel and # to be able to reference it on error label), like this:

Please help! Thanks!
submitted by ericpap to Angular2 [link] [comments]


2018.04.21 21:47 HarryCallaghan Huge memory consumption exporting data to excel/csv

Hi, I'm having problems with the memory usage exporting data into xlsx/csv. I have this workflow:
The biggest recordset a user can get is around 10K rows and 10 columns, so It's like 100K cells.
The problem is that the memory usage is huge. I can reach Heroku mem quota limit in about 5 to 10 requests for reports depending on the search parameteres used. I have tried a lot of things:
The relevant snippets are as follow:
orders_controller.rb
def index orders = request.query_string.present? ? Order.search(params, current_user) : Order.pendientes if params[:button] == 'report' build_report(orders) Order.connection.clear_query_cache else @orders = orders.order("#{sort_column} #{sort_direction}").page(params[:page]).per(params[:paginas]) end end private def build_report(orders) # if the report > 1000 rows, render csv, else render xlsx using axslx-rails gem. if orders.count > 1000 send_data orders.to_csv(col_sep: "\t").encode("cp1252"), :filename => 'report_pedidos.xls' GC.start else render xlsx: 'index.xlsx.axlsx', locals: {orders: orders}, filename: "report_pedidos.xlsx" GC.start ObjectSpace.garbage_collect end end 
order.rb
def self.to_csv(options = {}) csv_attribute_names = %w[codigo posicion sap_cod descripcion planta_nombre ref_prov n_nec uds_pedidas f_emision uds_recibidas orden_trabajo desc_ot ceco desc_ceco ubicacion plazo] CSV.generate(options) do csv csv << csv_attribute_names find_each do order csv << order.attributes.values_at(*csv_attribute_names) end end end 
submitted by HarryCallaghan to rails [link] [comments]


2018.04.03 13:27 mcnulty79 Improve performance of simple searching method

Hi,
I have been building an app these days. The functionality is nothing fancy at all, I have to connect to a client's SOAP webservice, fetch some data, save it into my pg database and build a search functionality based on this data.
The search has to be performed on two tables, both combined are like 80K rows. It needs to look for every word in the input text in several fields from these two tables, which have a classical assocation one to many.
Previous to get my hands dirty I was looking at the choices I had to get the functionality done (ransack, searchkick, scoped_search etc), but I ended up trying first just vanilla Active Record and I was very surprised to find that I could achieve the functionality way easier than I thought and with an acceptable response time, about to 400ms active record time for the most expensive queries in local. I made a post about that a few weeks ago.
So the problem is, the performance of this app in Heroku is way worse than in local (I'm developing using a vagrant box btw). On average, queries take 2-3 times longer than in local, so the user experience goes from acceptable to poor. I was wondering If someone could help to improve my query. I'm also worried about how the background job that fetchs the data is also way les performant than in local and about some issues with the memory, but that's a different story though.
The relevant snippets are these:
part_master.rb where the search method is implemented:
class PartMaster < ApplicationRecord has_many :part_variants, foreign_key: 'sap_cod', primary_key: 'sap_cod' has_many :locations, foreign_key: 'sap_cod', primary_key: 'sap_cod' scope :con_stock, -> { where("stock > 0") } scope :planta, -> (planta) { where planta_cod: planta} def self.search(params) recordset = PartMaster.joins(:part_variants).all recordset = recordset.con_stock if params[:stock].present? recordset = recordset.planta(params[:planta]) if params[:planta].present? recordset = search_keywords(params[:search], recordset) recordset end private def self.search_keywords(query, recordset) keywords = query.to_s.strip.split if query keywords.each do keyword recordset = recordset.where('part_masters.sap_cod ILIKE :q OR unaccent(descripcion_maestro) ILIKE unaccent(:q) OR fabricante ILIKE :q OR ref_fabricante ILIKE :q OR fabricante_prov ILIKE :q OR ref_prov ILIKE :q', q: "%#{keyword}%") end recordset.distinct.order(:sap_cod) end end 
end
And this is the call to the method from the controller:
 def index parts = params[:search].present? ? PartMaster.search(params) : PartMaster.none @parts = parts.page(params[:page]).per(50) end 
EDIT. Added schema.rb for the tables involved in the search method:
 enable_extension "plpgsql" enable_extension "unaccent" create_table "part_masters", force: :cascade do t t.string "sap_cod" t.string "descripcion_maestro" t.string "ref_fabricante" t.string "fabricante" t.float "stock" t.float "precio_medio" t.integer "planta_cod" t.string "planta_nombre" t.string "unidad_medida" t.string "grupo_compras" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["descripcion_maestro"], name: "index_part_masters_on_descripcion_maestro" t.index ["fabricante"], name: "index_part_masters_on_fabricante" t.index ["ref_fabricante"], name: "index_part_masters_on_ref_fabricante" t.index ["sap_cod"], name: "index_part_masters_on_sap_cod" end create_table "part_variants", force: :cascade do t t.string "sap_cod" t.string "prov_cod" t.string "infotipo" t.string "fabricante_prov" t.string "ref_prov" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["fabricante_prov"], name: "index_part_variants_on_fabricante_prov" t.index ["ref_prov"], name: "index_part_variants_on_ref_prov" t.index ["sap_cod"], name: "index_part_variants_on_sap_cod" end end 
Thank you in advance!
submitted by mcnulty79 to rails [link] [comments]


2018.03.20 23:56 ericpap PrimeNG scrollable TurboTable container problem

Hi. I'm new at PrimeNG for Angular. I'm trying to use turbotable in scrollable mode with dynamic columns. The problem is that if I set Scollable to true, and create the grid inside a div ui-g, the grid excede the card's DIV boundaries, wich looks horrible. If I (like the example below) create a div container with Overflow:auto, the grid respects the card limits, but I have to scroll all the way down to see and interact with the horizontal scrollbar, wich is also annoying.
So the question is wich is the correct container for a scrollable TurboTable to scroll only the grid itself?
This is my HTML code:
{{col.header}}
{{rowData[col.field]}}
And this is my Angular Code:
import { Component, OnInit } from '@angulacore'; import {SelectItem, MenuItem } from 'primeng/primeng'; import { ApiService } from '../../services/api.service' @Component({ selector: 'app-articulos', templateUrl: './articulos.component.html' }) export class ArticulosComponent implements OnInit { selectedArts: any[]; articulos: any[]; cols: any[]; constructor(private apiService: ApiService) { } ngOnInit() { this.articulos = this.apiService.getArticulos(); this.cols = [ { field: 'ID_Articulo', header: 'ID', width:'100px', align:'center' }, { field: 'Codigo', header: 'Código', width:'300px', align:'left' }, { field: 'Descripcion', header: 'Descripción', width:'500px', align:'left' }, { field: 'Grupo', header: 'Grupo (nivel 1)', width:'300px', align:'left' }, { field: 'SubGrupo', header: 'Grupo (nivel 2)', width:'300px', align:'left' }, { field: 'Venta', header: 'P. Venta', width:'200px', align:'left' }, { field: 'PesoKG', header: 'Peso (Kg)', width:'200px', align:'left' }, { field: 'StockActual', header: 'Stock', width:'200px', align:'left' }, { field: 'Ubicacion', header: 'Ubicación', width:'300px', align:'left' } ]; } } 
Thanks!
submitted by ericpap to Angular2 [link] [comments]


2017.10.30 17:16 betogm “Load more” feature doesn't fully work

I have a problem with a page showing all 5000 records of a database table. One of the suggested solutions was to add a "Load More" button that will dynamically add more records to the page using AJAX. I decided to do just that using this page as my basis.
This feature works to some extent. I have stumbled upon two big problems:
My guess is that the response AJAX sends is too much so the page doesn't know what to do but I am not sure on that one.
Can you please help me? Thanks!
PHP Main page section:
0 count($filEstatus) > 0 count($filPaises) > 0 count($filGuia)>0))) $_GET['cancelar']) { $tablaO=listadoFaltantes($filProveedor, $filEstatus, $filMargin, $valor, $filGuia, $pais, $paisu, ($start == -1 ? $registroPorPagina : $count), ($start == -1 ? $pagina : 1)); if(mysqli_num_rows($tablaO)>0) { $i = 0; $e = 1; if($pagina > 1) $e = 1*($registroPorPagina*($pagina-1))+1; $CantidadTres = 1; while($registroO=mysqli_fetch_assoc($tablaO)) { $fechaCambio = $registroO['art_fecha_cotizado']; $entregado = false; $estatusOrden = "Buenot2"; if(!$entregado) { $date = date("Y-m-d"); $diff = abs(strtotime($date) - strtotime($fechaCambio)); $years = floor($diff / (365*60*60*24)); $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); if(ceil($days)>=3) { if(ceil($days) == 3){ if(isWeekend(date('Y-m-d',strtotime("-1 days"))) isWeekend(date('Y-m-d',strtotime("-2 days")))) { if ($e%2!= 0) { $estatusOrden = "bueno"; }else{ $estatusOrden = "Buenot2"; } }else{ if($registroO['art_id_proveedor'] == '?' OR $registroO['art_id_estatus'] == 'SC') { $estatusOrden = "tardio"; $CantidadTres = $CantidadTres + 1; }elseif ($e%2!= 0){ $estatusOrden = "bueno"; } } }else{ if($registroO['art_id_proveedor'] == '?' OR $registroO['art_id_estatus'] == 'SC') { $estatusOrden = "tardio"; $CantidadTres = $CantidadTres + 1; }else if ($e%2!= 1){ $estatusOrden = "Buenot2"; } } }else{ if ($e%2== 0) { $estatusOrden = "bueno"; }else{ $estatusOrden = "Buenot2"; } } }else{ if ($e%2== 0) { $estatusOrden = "bueno"; }else{ $estatusOrden = "Buenot2"; } } $estatus = $registroO['art_id_estatus']; if($estatus != 'CF') { switch($estatus) { case 'EC':$color='ffffff'; break; case 'SC':$color='ffffff'; break; case 'CE':$color='ffffff'; break; case 'AP':$color='ffffff'; break; case 'PA':$color='ffffff'; break; case 'PB':$color='ffffff'; break; case 'RE':$color='ffffff'; break; case 'ER':$color='ffffff'; break; case 'RO':$color='background-color: #ff6699 !important;'; break; case 'EO':$color='background-color: #67a22a !important;'; break; case 'LE':$color='background-color: #92d050 !important;'; break; } if($registroO['art_id_proveedor'] == '?' and $registroO['art_id_estatus'] == 'ST') { $colorLetra = 'color: #212020;'; }else{ $colorLetra = 'color: #000;'; } if($registroO['art_cortado'] != '0') { if($registroO['art_cortado'] == '1') { $VeriCortado = ''; $listaVeriCortado = listadoArticulosQueFueronCortadosDeEste($registroO['art_id_verificador']); while($regVeriCortado = mysqli_fetch_assoc($listaVeriCortado)){ $VeriCortado .= $regVeriCortado['art_id_verificador']."\r\n"; } $cortado = ''; }else{ $cortado = ''; } }else{ $cortado = ''; } $ordenart= $registroO["art_id_orden"]; $provedorart = $registroO["art_id_proveedor"]; $ISBNar = $registroO["art_ISBN"]; $SKU1 = $registroO["art_SKU"]; $letra3 = substr($ISBNart, 1, 6); $letra4 = substr($SKU1, -5); $letra5 = $ordenart.$provedorart.$letra4.$letra3; //$sumF = listadoSumaFaltantes($provedorart); $master = listadoMaster($ISBNart,$provedorart); $mast = $master['mast_precio']; $verificador = $registroO['art_id_verificador']; $detalleDeposito = detalleDepositoArtProv($provedorart,$verificador); $dep_id = $detalleDeposito['dep_id']; $sumFCred = listadoSumaFaltantesDeposito2($provedorart, $dep_id); $sumF = listadoSumaFaltantesDeposito($provedorart, $dep_id); $TipoPago = $sumFCred['pro_id_tipoPago']; $total = $registroO['art_cantidad'] * $registroO['art_cost']; $nuevo_texto = wordwrap($registroO['art_titulo'], 22, "
"); if($registroO['est_descripcion'] == 'Recibido en oficina') { echo ''; }else{ echo ''; } echo ''; if($registroO['art_id_proveedor'] == '?') { echo''; }else{ echo''; } if($registroO['art_Confirmacion'] == '2' or $registroO['art_Confirmacion'] == '0') { if($registroO['art_id_proveedor'] != '?') { echo''; }else{ echo''; } }else{ echo''; } echo''; if($mast != null) { echo''; }else{ echo''; } echo ''; if($registroO['art_Confirmacion'] == '1' or $registroO['art_Confirmacion'] == '0') { if($registroO['art_id_proveedor'] != '?') { $CostoH = DetalleCostoSKU($SKU1); if($CostoH['cost_costo'] != NULL) { echo ''; }else{ echo ''; } }else{ echo''; } }else{ echo''; } echo ''; if($estatus == 'CE' OR $estatus == 'PA') { if($estatus == 'CE') { echo ''; } if($estatus == 'PA') { if($TipoPago == 'TC' OR $TipoPago == 'CD') { echo ''; }else{ echo ''; } } }else{ echo ''; } $MarginPro1 = $registroO['art_MarginProf']; //$MarginPro1 = number_format($MarginPro1, 10, '.', ''); $MarginPro = substr($MarginPro1, 0, 1); if($MarginPro1 == '' OR $MarginPro1 == NULL) { echo''; }else{ if($MarginPro == '0') { //$calrCosto = explode(".",$MarginPro1); //$cal1 = $calrCosto[1]; //$Calr = substr($cal1, 0, 2); if($MarginPro1 <= .5) { echo''; } if($MarginPro1 > .5) { echo''; } }else{ echo''; } } echo''; if($registroO['est_id'] != 'EC' && $registroO['est_id'] != 'SC') { echo ''; }else{ echo ''; } echo ''; $i++; $e++; } } } } ?>
VERIFICADOR ORDEN ISBN-13 ISBN TITULO SKU QTY CANT CONF PRECIO EN DLL PVP COST COST CONF TOTAL TOTAL PROVE MARGIN PROF ESTATUS INVENTARIO FECHA CAMBIO PROVEEDOR NOTA
'.$e.' '.$cortado.' '.$verificador.' '.$registroO['art_N13'].' '.$registroO['art_ISBN'].' '.$nuevo_texto.' '.$registroO['art_SKU'].' $'.number_format((float)$registroO['art_precio'],2,'.','').'$'.$mast.'$'.number_format((float)$registroO['art_master'],2,'.','').'$'.number_format((float)$registroO['art_cost'],2,'.','').' $ $ $'.number_format((float)$total,2,'.','').'$'.number_format((float)$sumF['cantindad'],2,'.','').'$'.number_format((float)$sumFCred['cantindad'],2,'.','').'$$'.$MarginPro1.''.$MarginPro1.''.$MarginPro1.''.$registroO['est_descripcion'].' '.$registroO['art_status_recoleccion'].' '.$fechaCambio.'
Load More '; if(count($filProveedor) > 0) { for($i=0;$i"; } } if(count($filEstatus) > 0) { for($i=0;$i"; } } if(count($filPaises) > 0) { for($i=0;$i"; } } if(count($filMargin) > 0) { for($i=0;$i"; } } foreach($pais as $p){ echo ""; } if($valor != '' ) echo ''; if($paisu != '') echo ''; } ?>
AJAX:
$('.load-more').click(function(){ var row = Number($('#row').val()); var allcount = Number($('#all').val()); var filProveedora = document.getElementsByName("filProveedor[]"); var filProveedor = []; for(var i = 0; i < filProveedora.length; i++){ filProveedor.push(filProveedora[i].value); } var filEstatusa = document.getElementsByName("filEstatus[]"); var filEstatus = []; for(var i = 0; i < filEstatusa.length; i++){ filEstatus.push(filEstatusa[i].value); } var filPaisesa = document.getElementsByName("filPaises[]"); var filPaises = []; for(var i = 0; i < filPaisesa.length; i++){ filPaises.push(filPaisesa[i].value); } var filMargina = document.getElementsByName("filMargin[]"); var filMargin = []; for(var i = 0; i < filMargina.length; i++){ filMargin.push(filMargina[i].value); } var paisesa = document.getElementsByName("pais[]"); var paises = []; for(var i = 0; i < paisesa.length; i++){ paises.push(paisesa[i].value); } var paisu = document.getElementById("paisu"); if(paisu) paisu = paisu.value; var valor = document.getElementById("valor"); if(valor) valor = valor.value; var e = document.getElementById('e').value; var i = document.getElementById('i').value; var rowperpage = ; row = row + rowperpage; if(row <= allcount){ $("#row").val(row); $.ajax({ url: 'include/getDataFaltantes.php', type: 'post', data: {row:row, filProveedor : filProveedor, filEstatus : filEstatus, filPaises : filPaises, filMargin : filMargin, paises : paises, paisu: paisu, valor : valor, e : e, i:i}, beforeSend:function(){ $(".load-more").text("Loading..."); }, success: function(response){ // Setting little delay while displaying new content setTimeout(function() { // appending posts after last post with class="post" //$(".post:last").after(response).show().fadeIn("slow"); console.log(response); $(".post").append(response); var rowno = row + rowperpage; // checking row value is greater than allcount or not if(rowno > allcount){ // Change the text and background $('.load-more').text("Hide"); $('.load-more').css("background","darkorchid"); }else{ $(".load-more").text("Load more"); } }, 2000); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("Status: " + textStatus); alert("Error: " + errorThrown); } }); }else{ $('.load-more').text("Loading..."); // Setting little delay while removing contents setTimeout(function() { // When row is greater than allcount then remove all class='post' element after 3 element $('.post:nth-child(3)').nextAll('.post').remove(); // Reset the value of row $("#row").val(0); // Change the text and background $('.load-more').text("Load more"); $('.load-more').css("background","#15a9ce"); }, 2000); } }); 
getDataFaltantes.php is the same as the tbody of the table in the previous code.
submitted by betogm to learnprogramming [link] [comments]


2017.07.25 03:52 W4r3n1 Oferta de trabajo virtual

¡Hola! Estoy comenzando un ecommerce relacionado a los videojuegos y necesito alguien que pueda asistirme con algunas tareas y cosas del día a día.
Los horarios serían completamente conversables, sin presión de tiempo pero si requieren responsabilidad y orden
Las tareas a realizar serían principalmente manejo de redes sociales, redacción de descripciones de productos, edición básica de imágenes e ingreso de data a distintos portales (Mercadolibre, Wordpress, entre otros)
Principalmente se utilizaría Google Drive para compartir archivos, sheet de Google para separar tareas a realizar y Skype para coordinarnos de vez en cuando
Las tareas no requieren ningún tipo de habilidad excepcional más que un buen manejo computacional (El resto todo puede aprenderse), una muy buena ortografía (Importante) por lo que lo ideal sería una persona joven autodidacta
Escribir un mail con una descripción laboral / CV a [email protected], se recibirá automáticamente una encuesta corta
Si tienes algún conocimiento que pueda servir, como WooCommerce, algún lenguaje de programación, algún nivel avanzado de diseño o de marketing digital recuerda mencionarlo en descripción breve
submitted by W4r3n1 to vzla [link] [comments]


2017.03.03 18:58 betogm Can't import Excel sheet to MySQL

I am working on a page that will read an Excel file and put its contents into a MySQL table via PHPExcel. The page reads the file correctly and the correct information is being taken.
I am facing a big problem, however, when I try to import said data into a MySQL table for record-keeping. I can see the data being placed into the query, but when I execute it the data is not present on the table. Can you please help me? Thanks!
PHP code for Excel Read:
load($archivo); $worksheet = $excelObj->getSheet(0); $lastRow = $worksheet->getHighestRow(); $row = 2; //echo ""; for($row = 2; $row <= $lastRow; $row++){ //echo ""; $id_proveedor = $worksheet->getCell("AC".$row)->getValue(); $shipping = $worksheet->getCell("K".$row)->getValue(); $ean = $worksheet->getCell("E".$row)->getValue(); $isbn = $worksheet->getCell("F".$row)->getValue(); $descripcion = $worksheet->getCell("G".$row)->getValue(); $sku = $worksheet->getCell("I".$row)->getValue(); $cost = $worksheet->getCell("AJ".$row)->getValue(); $order_price = $worksheet->getCell("J".$row)->getValue(); $master = $worksheet->getCell("AI".$row)->getValue(); $quantity_purchased = $worksheet->getCell("L".$row)->getValue(); $total_price = $worksheet->getCell("M".$row)->getValue(); $condition = $worksheet->getCell("AH".$row)->getValue(); $tracking = $worksheet->getCell("AD".$row)->getValue(); InsertarFaltantesExcel($verificador, $order_id, $id_proveedor, $shipping, $ean, $isbn, $descripcion, $sku, $cost, $order_price, $master, $quantity_purchased, $total_price, $condition, $tracking); //echo ""; } echo ""; //echo "
"; $verificador= $worksheet->getCell("A".$row)->getValue(); //echo ""; $order_id = $worksheet->getCell("B".$row)->getValue(); //echo "
"; ?>
Function that inserts into table:
function InsertarFaltantesExcel($verificador, $order_id, $id_proveedor, $shipping, $ean, $isbn, $descripcion, $sku, $cost, $order_price, $master, $quantity_purchased, $total_price, $condition, $tracking){ conectar(); $instruccion = "INSERT INTO articulos(art_id_verificador, art_id_orden, art_id_proveedor, art_shipping, art_N13, art_ISBN, art_titulo, art_SKU, art_cost, art_precio, art_master, art_cantidad, art_total, art_condition, art_tracking) VALUES('".$verificador."', '".$order_id."', '".$id_proveedor."', '".$shipping."', '".$ean."', '".$isbn."', '".$descripcion."', '".$sku."', '".(strcmp($cost,'')==0 ? 0 : $cost)."', '".$order_price."', '".$master."', '".$quantity_purchased."', '".$total_price."', '".$condition."', '".$tracking."')"; return ejecutarInstruccion($instruccion); } 
submitted by betogm to PHPhelp [link] [comments]


Representación descriptiva de conjuntos - YouTube 'Crear descripcion tecnica' Primera Parte LOS 5 SCP MAS RAR0S Y PELIGR0SOS DEL MUNDO #21 - YouTube Descripción, Selección, Desplazamiento y Opción Guardar en Excel 2013 (FREE) GBF DaDa + Lil Dude Type Beat: 'Every Day'  Prod.TMajor Noke Bonastre - YouTube Blender 2.7 – Cambiar el idioma de la interfaz ESTADÍSTICA - Ejercicios Resueltos - Paso a Paso - Nivel 1 ...

How to create the right meta description • Yoast

  1. Representación descriptiva de conjuntos - YouTube
  2. 'Crear descripcion tecnica' Primera Parte
  3. LOS 5 SCP MAS RAR0S Y PELIGR0SOS DEL MUNDO #21 - YouTube
  4. Descripción, Selección, Desplazamiento y Opción Guardar en Excel 2013
  5. (FREE) GBF DaDa + Lil Dude Type Beat: 'Every Day' Prod.TMajor
  6. Noke Bonastre - YouTube
  7. Blender 2.7 – Cambiar el idioma de la interfaz
  8. ESTADÍSTICA - Ejercicios Resueltos - Paso a Paso - Nivel 1 ...
  9. Registrar, Listar, Editar y Eliminar registros de una Base Datos MySQL - PHP - AJAX

Si sigues tutoriales en inglés y aún no tienes muy por la mano dónde está cada cosa, mejor no actives el botón “Interface”… solo el de “Tooltips” y “New Data” (descripciones y ... Registrar, Listar, Editar y Eliminar registros de una Base Datos MySQL - PHP - AJAX $$$$$ Tarjeta prepago Pyoneer $$$$$ Registrate y obtén $25 en tu tarjeta prepago pyoneer. Si eres desarrollador ... en este vídeo veras las ventanas y configuración principal para el funcionamiento de la aplicación Perímetro, que te ayudara a crear Descripciones tecnicas, solicitala al correo ... For business inquires [email protected] free for non profit demo use All FREE BEATS can only be used for non-profitable, non-commercial projects and nothing besides that. I must also be ... ESTADÍSTICA : Matemáticas-Aritmética : El Profesor Campos te explica como resolver las preguntas de estadística de nivel secundario y preuniversitario en la ... #scp #directo12horastwitch directos cada noche en TWITCH: https://www.twitch.tv/nicocoretwitch únete a mi canal de Youtube: https://www.youtube.com/channel/U... SUSCRÍBETE: http://bit.ly/VN7586 (NO OLVIDES DAR UN ¨LIKE¨) VISITA: http://math2me.com FB: http://bit.ly/FBmath2me G+: http://google.com/+math2me Twitter: ht... Si sigues tutoriales en inglés y aún no tienes muy por la mano dónde está cada cosa, mejor no actives el botón “Interface”… solo el de “Tooltips” y “New Data” (descripciones y ... How to create Data Entry Form in Excel - Ms Office? - Duration: 5:06. Vicky's Blog Recommended for you. 5:06. House Relax Spring Summer Mix - Duration: 1:01:30.