2018-10-22         Agnes

How to avoid being detected as bot on Puppeteer and Phantomjs?

Puppeteer and PhantomJS are similar. The issue I'm having is happening for both, and the code is also similar.I'd like to catch some informations from a website, which needs authentication for viewing those informations. I can't even access home page because it's detected like a "suspicious activity", like the SS: https://i.imgur.com/p69OIjO.pngI discovered that the problem doesn't happen when I tested on Postman using a header named Cookie and the value of it's cookie caught on browser, but this cookie expires after some time. So I guess Puppeteer/PhantomJS both are not ca...

 node.js                     2 answers                     28 view
 2018-10-22         Agnes

Type code in to a text input form, how?

i have this image upload script. <?php if(isset($_POST['submit'])){ if (isset ($_FILES['new_image'])){ $imagename = $_FILES['new_image']['name']; $source = $_FILES['new_image']['tmp_name']; $target = "temporary_images/".$imagename; move_uploaded_file($source, $target); $imagepath = $imagename; $save = "temporary_images/" . $imagepath; //This is the new file you saving $file = "temporary_images/" . $imagepath; //This is the original file list($width, $he...

 php                     2 answers                     34 view
 2018-10-22         Agnes

How to avoid SQL injection while giving the line break in textarea in PHP and MySQL?

What I want is when user give line break in description box ie: textarea in HTML then all the data is stored securely in SQL database, but if users give links then links becomes also text but when user give enter or line break in description textbox then it saves in the database and while retrieving it from the database the line break will show again.<textarea name"description" id="description" rows="4" cols="50">//In The text area the user enter the text. Here I want if user gives html links then links becomes text and if user give line break then line break store in...

 php                     2 answers                     75 view
 2018-10-22         Agnes

@font-face won't show my police

I'm starting to learn html and css,tried to use font-face command to show a police downloaded from font squirrel: I'm starting to loose hope.Overlooked in the forum searching for an answer but my will is tired actually. Pathway:css file:Please help me, even tho I might have been mistakingas the beginner I am... Thanks. Found the answer, font was not shown because I putted the '*' mark before font-face while it should have been before the font family entry. [XXX]

 font-face                     1 answers                     35 view
 2018-10-22         Agnes

How to block bots with IIS?

I have web.config for asp.net core configured like this to block bots MJ12bot|spbot|YandexBotI'm using IIS 7.5 with Url Rewrite Module 2.1 installed. <?xml version="1.0" encoding="utf-8"?><configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\myproject.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout"> </aspNetCore> <rewrite> ...

 asp.net                     2 answers                     81 view
 2018-10-22         Agnes

Translate unicode emojis to ascii emojis in Python

Is there a way to translate unicode emojis to an appropriate ascii emoticon in Python? I know the emoji library which can be used to convert unicode emojis to something like :crying_face:. But what I would need is to convert it to :'(Is there an elegant way to do this without having to translate every possible emoji manually? Another option would be to convert the ascii emojis also to their textual representation, i.e. :'( should become :crying_face:.My intermediate goal is to find a way to transform ascii and unicode emojis to a common representation. My final goal would ...

 python                     1 answers                     60 view
 2018-10-22         Agnes

Bundler http auth support

does anyone know if Bundler supports http auth? I'm pretty sure rubygems does (I think i read that somewhere) but I don't see anywhere in the docs where I might specify a username/pwd for a particular repoI'm trying to run my own private gem server so as not to expose sensitive code According to https://github.com/carlhuda/bundler/issues/300 you can set the proxy settings the same as in rubygems.set HTTP_PROXY=http://[username]:[password]@[proxyserver]:[port]http://dan-webb.co.uk/wordpress/?p=11OR# cat $HOME/.gemrcgem: --source http://[username]:[password]@[proxyserver]...

 ruby                     2 answers                     21 view
 2018-10-22         Agnes

rollmeanr issue with NA

for a base, let: library(zoo)x1=c(1,2,3,4)x2=rollmeanr(x1,2,fill=NA)x=cbind(x1,x2) x1 x2[1,] 1 NA[2,] 2 1.5[3,] 3 2.5[4,] 4 3.5But if there is a NA in the base, rollmeanr does not work anymore: x1[1]=NAx3=rollmeanr(x1,2,fill=NA)cbind(x1,x2,x3) x1 x2 x3[1,] NA NA NA[2,] 2 1.5 NA[3,] 3 2.5 NA[4,] 4 3.5 NAx3[3] should be 2.5 cause it has the 2 precedent data.Is there a way to work around this? zoo changed the behavior of rollmean around version 1.8-2 (https://cran.r-project.org/web/packages/zoo/NEWS): Changes in Version 1.8-2 The rollmean(x, k, .....

 r                     1 answers                     81 view
 2018-10-22         Agnes

Select2 JQuery's AJAX Method from example is not working

I want to create a search input field using select2.js 4.0.5. I looked at the select2 example and basically, want to learn by recreating them without using the template result (only return text).However, I cannot make it work. This is the closest I can get: myJSFiddle. $(document).ready(function() { $(".js-data-example-ajax").select2({ ajax: { url: "https://api.github.com/search/repositories", dataType: 'json', delay: 250, data: function(params) { return { q: params.term, // search term page: params.page }; }, ...

 javascript                     1 answers                     95 view
 2018-10-22         Agnes

How to reorder a table with the number of the columns with a specific value

I hava a table like this.ID F01 F02 FO31 1 0 02 1 1 03 1 1 1I Want the table reOrder like thisID F01 F02 FO33 1 1 12 1 1 01 1 0 0Because the row 3, have 3, one in it's row.row 2, have two, one in it's row.and row1 have, the one , one in it's row. If you mean physically reordering, don't do this. There is no "order" in a database table, unless you specify it with ORDER BY.SELECT*FROMyour_tableORDER BY F01 + F02 + F03 DESCIf you're looking for a specific value that is not 1, you can do it like th...

 mysql                     2 answers                     87 view
 2018-10-22         Agnes

SELECT TOP 1 in a many to many query

I have a faily simple many to many schema, which looks like this:alt text http://img406.imageshack.us/img406/8207/partialschema.pngWhat I'm trying to do is select all players with some arbitary conditions and I also want to select their most recent match, if they've played in one.What I've managed to do is:SELECT tblPlayer.PlayerId, tblPlayer.Surname, tblPlayer.Forename,(SELECT TOP 1 tblMatch.HomeClub + ' v ' + tblMatch.OpponentClub + ' ' + tblMatch.AgeGroup + ' (' + CONVERT(VARCHAR, tblMatch.MatchDateTime, 103) + ')' FROM tblAppearance INNER JOIN tblMatch ON tblAppea...

 sql                     3 answers                     54 view
 2018-10-22         Agnes

Unable to retrieve Stored Procedure Return value through Java

I'm trying to retrieve results from stored procedures written in sql server 2008 through JPA. I've come across a very absurd situation in which I am able to retrieve results from stored procedures that have a select statement at the end. In this case, I'm able to retrieve the results by calling storedProcedureQuery.getSingleResult(); However, if the stored procedure contains a return statement at the end returning a value, I'm unable to get any result and the same query returns a null pointer exception.The stored procedure which returns a value looks like:-CREATE PROCEDUR...

 java                     1 answers                     64 view
 2018-10-22         Agnes

How to import a Python class that is in a directory above?

I want to inherit from a class in a file that lies in a directory above the current one.Is it possible to relatively import that file? Inside a package hierarchy, use two dots, as the import statement doc says: When specifying what module to import you do not have to specify the absolute name of the module. When a module or package is contained within another package it is possible to make a relative import within the same top package without having to mention the package name. By using leading dots in the specified module or package after from you can specify how high ...

 python                     5 answers                     28 view
 2018-10-22         Agnes

Get accesstoken from azure in web with openidconnect

I have a desktop app where I authenticate users via Azure via AuthenticationContext.AcquireTokenAsync.With the result from this method I can get the access-token, send it to my WCF and in my WCF use JwtSecurityToken / ConfigurationManager< OpenIdConnectConfiguration > to validate the token.I've implemented login via Azure in a web app now by configuring it with app.UseOpenIdConnectAuthentication. So in my web app I dont explicitly call a method that returns a token. Rather I jack this in in asp.net's flow.But now I want to fetch the token in a method and send it for v...

 c#                     1 answers                     70 view
 2018-10-22         Agnes

Sqlalchemy One - Many and One-One in one table

I've got two models: User and Group.User can be in one group so:class User(db.Model):# other fieldsgroup_id = db.Column(db.Integer(), db.ForeignKey('group.id'))but on the other hand I would also have some info about user who create that specific group:class Group(db.Model):# other fieldsusers = db.relationship("User", backref='group')created_by = db.Column(db.Integer(), db.ForeignKey('user.id'))Result is:sqlalchemy.exc.CircularDependencyError: Can't sort tables for DROP; an unresolvable foreign key dependency exists between tables: group, user. Please ensure that the Forei...

 python                     1 answers                     44 view
 2018-10-22         Agnes

Bootstrap image stuck to top of screen

For a class I have to create a website that has a picture right below the navigation bar, but for some reason that I can't figure out, the picture is displaying within the navigation bar and not below it. Could someone please explain why this is happening and how to fix it? Thanks<div class="row"> <nav class="navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <ul class="nav navbar-nav" id="mainNav"> <li><a href="###">Locations</a></li> <li><a href="###">Special ...

 html                     4 answers                     7 view

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