2018-10-22         Doris

Retrieving post data from database not showing

I try to retrieve data from the database, fixed error messages but still data isn't showing up, http://localhost/webpage/info.php?post_id=76 (post id depends on the post that i click). Also, I am aware that some variables aren't showing, I am working on putting everything in place just the things that I placed don't show up. Also there is a connection to a database, only that I won't show whole file because its too big.Code of the function that gives problems screenshot of error: function single_post(){ if (isset($_GET['post_id'])) { global $con; $get_id = ...

 php                     1 answers                     86 view
 2018-10-22         Doris

Silverlight 3.0 : How do I get grid children by x:Name?

Let's assume that I've got XAML representing a Grid with some children in it, each child is a different control, with a x:Name. How do I "get" those controls from code by name ? If the code that you are writing is in the code-behind file for the xaml file, then Visual Studio should automatically generate member variables containing references to any named elements in the xaml file. So if you have a Button with x:Name="myButton", you can access this button via this.myButton.If you want to reference a named element from somewhere other than the code-behind file, you can ca...

 silverlight-3.0                     2 answers                     69 view
 2018-10-22         Doris

Use php with cURL in phonegap app

i have this code php with cURL and i need to show the result in my html5 app.<?php$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'http://www.taringa.net/top/posts/?fecha=3&cat=-1');curl_setopt($ch, CURLOPT_HEADER, false);curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $resultado = curl_exec($ch); curl_close($ch);function parsear($i,$f,$s) {list($crap,$y) = explode($i,$s,2); list($x,$shit) = explode($f,$y,2); return $x;}$topPostSemana = trim(strip_tags(parsear('class="icon points">','class="box sticky"', $resultado),'<a><span>'));$topPostSemana =...

 php                     2 answers                     77 view
 2018-10-22         Doris

How to create Many-to-Many within the same table in rails

I just want to create a table (Domains: which contains Domains) in Rails which contains various fields: Id, Name (it contains domains and subdomains) and TLD(Top Level Domain). example: account.referal.com, in this account and referral, will be stored as separate values in the Name and com will be stored in TLD field. and domains and subdomains should have a many to many relationship within the same table and should form a URL from the table based on the relationship.ask.facebook.com: ask => 1 facebook => 1Domains Table ID Name TLDDomain Relationship Parent. Chil...

 ruby-on-rails                     1 answers                     35 view
 2018-10-22         Doris

Can't delete a user due to an orphaned changelist

While trying to delete a user through the Perforce Admin program, I think that put us into an odd state where we can't delete the user due to an existing changelist, but we can't revert the changelist because the workspace no longer exists. Here is a chain of command line calls that illustrates the state we are now in:# try to delete the userC:\>p4 user -fd swilsonUser swilson has file(s) open on 1 client(s) and can't be deleted.# Show files opened for edit by swilsonC:\>p4 opened -u swilson//depot/ProjectName/UnityProjects/ProjectSettings/EditorSettings.asset#1 - edi...

 perforce                     1 answers                     11 view
 2018-10-22         Doris

scikit-learn - TypeError: fit() missing 1 required positional argument: 'y'

import numpy as npimport pandas as pddataset=pd.read_csv("/Users/rushirajparmar/Downloads/Social_network_Ads.csv",error_bad_lines = False)X = dataset.iloc[:,[2,3]].values. Y = dataset.iloc[:,4].valuesfrom sklearn.model_selection import train_test_splitX_train,X_test,Y_train,Y_test = train_test_split(X,Y,test_size = 0.25,random_state = 0) from sklearn.preprocessing import StandardScalersc = StandardScaler()X_train = sc.fit_transform(X_train)X_test = sc.transform(X_test)from sklearn.linear_model import LogisticRegressionclassifier = LogisticRegression()classifier.fit(X_trai...

 python                     2 answers                     22 view
 2018-10-22         Doris

AWS Lambda - NAT Gateway internet access results in timeout

I have a AWS Lambda function which: checks a Redis Elasticache instance, if the item is not found in the cache, goes to Google Places API service.The Redis instance is in a private subnet; so, to fetch it, I added the VPC and the subnet in which the instance resides. I also specified the security group which allows all the outbound traffic. The Network ACL is the default one which is supposed to all the inbound and the outbound traffic.When adding VPC to Lambda function like that via the console, it prompts: When you enable VPC, your Lambda function will lose default inte...

 amazon-web-services                     2 answers                     57 view
 2018-10-22         Doris

Login simulation. Dictionary with {["username"]: ["password"]} key:value pairs. How do I authenticate a user trying to log in?

Inside of a json file, each line stores the information of every different user that is created through separate classes. In the user_login file, retrieves this info and isolates username and passwords for each user to attempt to create a login page.File: user_loginimport jsonfilename = "users.json"with open(filename, "r+", encoding='utf8') as file: '''opens json file and separates it by line by storing each line into an array''' lines = file.readlines()login_info = {} '''array that will store usernames and passwords for each user(each line in the file is a user...

 json                     1 answers                     35 view
 2018-10-22         Doris

Merge duplicate rows and set values

I am quite new to scripting in google sheets but I searched on this forum and couldnt quite find an answer'.Via a script of a google ads script developer i have managed to create an export of all search terms activating my google ads. These keywords are getting compared to the keywords currently in my account. This way I can find missing keywords for my account, and underperforming keywords. This script outputs the keywords to a google sheets document, however if a keyword is present in multiple campaings and or adgroups, a seperate row for they keyword is created for each...

 google-apps-script                     1 answers                     68 view
 2018-10-22         Doris

SQL: Add UTC timestamp column to table from date and time

I have a table in Postgres that has a date column and time column. I would like to add a new column that has utc (or timestamp) values based on on the date and time columns. I tried the following: INSERT INTO mytable (utc) SELECT EXTRACT(EPOCH FROM (date || ' ' || time )::timestamp);But I get the error: ERROR: column "date" does not existSQL state: 42703Hint: There is a column named "date" in table "mytable", but it cannot be referenced from this part of the query.And there definitely are the columns date and time. Does anyone know how to add values to UTC column based...

 sql                     2 answers                     101 view
 2018-10-22         Doris

how to specify consumer group in Kafka Spark Streaming using direct stream

How to specify consumer group id for kafka spark streaming using direct stream API.HashMap<String, String> kafkaParams = new HashMap<String, String>();kafkaParams.put("metadata.broker.list", brokers);kafkaParams.put("auto.offset.reset", "largest");kafkaParams.put("group.id", "app1"); JavaPairInputDStream<String, String> messages = KafkaUtils.createDirectStream( jssc, String.class, String.class, StringDecoder.class, StringDecoder.class, kafkaParams, topicsSet );though i ...

 java                     2 answers                     57 view
 2018-10-22         Doris

Why is HEAD^ failing when HEAD~ is succeeding in command prompt?

I tried to run the following command:git checkout HEAD^and I got the outputMore? (I press Enter)More? (I press Enter)error: pathspec 'HEAD' did not match any file(s) known to git.What does this mean? If I run this command instead:git checkout HEAD~the checkout succeeds with no issues.I did confirm that HEAD currently only has one parent.Edit: I forgot to specify that I was running this in Command Prompt. This was, in fact, the issue since ^ is the escape character in Command Prompt. From this SO question, HEAD^ semantically means the parent of the current HEAD. There ma...

 git                     1 answers                     34 view
 2018-10-22         Doris

C# - Save multiple blobs into azure account

I've got a simple project that use M2mqtt client library to connect to HiveMQ broker. When a message arrives an event will fire, the fact is I can receive up to 100 messages per second and the program is able to processing just 20 messages per second. HiveMQClient.MqttMsgPublishReceived += HiveMQClient_MqttMsgPublishReceived;So, I have all the HiveMQ logs and telemetry and i can clearly see that the messages arrives in my application with the right rate (100 per second) but the strange thing is that the CPU of the PC where the client program is hosted runs at 10% of its cap...

 c#                     1 answers                     87 view
 2018-10-22         Doris

How can I get the types of entities in an SQLALchemy query

I know how to get the columns that would be returned from a select statement but how do I get the entities that would be returned from an sqlalchemy.orm.Query object?>>> sess = Session()>>> q = sess.query(Entity1, Entity2)>>> q.statement.c.keys()['e1_col1', 'e1_col2', ..., 'e2_col1', 'e2_col2, ...]I want [Entity1, Entity2] or something similar! You can try this:[e.mapper.class_ for e in q._entities]Although I would prefer not to use _entities attribute directly and find some other way to access it, but AFAIK there is none. [XXX]

 python                     1 answers                     60 view
 2018-10-22         Doris

How to know when an order gets open(date and time) in woocommerce

PHP:order status is wc_open and I am trying to find out the way to know when an order gets open(date and time).$order = wc_get_order( $nextorder->ID );$order->get_date_modified();I am using get_date_modified() but this method not giving correct answer because modified date changed if any change happens.Please help me. You need to do it like this:$order = wc_get_order($nextorder->ID);$order_date = $order->order_date; [XXX]

 php                     1 answers                     16 view
 2018-10-22         Doris

How to make Socket.IO serveClient option work?

I'd like to use client distrubuted with the socket.io package in client-side scripts.This is what I did:const IOserver = io.listen(server, { serveClient: true, path: "/socket.io.client.js" });But when I try to access socket.io client on that path http://localhost:1337/socket.io.client.js I get a 404 error.How to properly set up socket.io to serve client side JavaSript file? I think you are confusing what the path properties does. The path is the endpoint it should use to connect to your websocket server.You need to manage the installation of the frontend js client manual...

 javascript                     1 answers                     119 view

Page 1 of 144  |  Show More Pages:  Top Prev Next Last