Community Member
Member Avatar
Topic by Busuioc in Software Development
You're welcome, glad I could be of service. Reply by pty
Member Avatar

#include<iostream.h>
void main()
{
int a,b,r;
cout<<"a=";cin>>a;
cout<<"b=";cin>>b;
while (r!=0)
{
r=a%b;
a=b;
b=r;}
cout<<"cmmdc="<<a; First Post in Topic by Busuioc in Software Development
Member Avatar
pty 316 Gave Reputation to cereal in how to popular a site .....
Topic by tara_1 in Search Engine Strategies
Hi,

if your target is worldwide, then provide an English version of the site: not only of the contents, but also of the links. See this for example:

http://iraniantranslate.com/%D8%AF%D8%B1%D8%A8%D8%A7%D8%B1%D9%87-%D9%85%D8%A7/

which on the browser bar displays `http://iraniantranslate.com/درباره-ما/`, but if I use the browser option *Copy link address* then I get the … Reply by cereal
Member Avatar
Topic by Aman_14 in Software Development
Ah ok. The original post didn't sound like a typical "do my homework" request. Reply by pty
Member Avatar
Topic by Aman_14 in Software Development
This problem was solved like 40 years ago.

$ sort -t" " -rnk4 data.tsv
ascon1 201707015 Jack 97.5 11.5 11.5 11.5
ascon1 201707013 Josh 79.5 11.5 11.5 11.5
ascon1 201707011 John 77.5 11.5 11.5 11.5
ascon1 201707012 Grld 70.0 11.5 11.5 11.5
ascon1 201707014 Jess 67.5 11.5 11.5 11.5

* … Reply by pty
Member Avatar
pty 316 Replied To a Post in How to increase the traffic for my website??
Topic by Matt_25 in Search Engine Strategies
There is only one way, one rule and one method. It's called *write some good content*. Content is key, and if it's good enough to capture an audience you've cracked it.

You're not going to appeal to everyone. Write for the audience you want, concentrate on topics you're both knowledgeable … Reply by pty
Member Avatar
Featured pty 316 Replied To a Post in Up vote comment in mobile
Topic by diafol in Community Center
Yep can confirm this on Android with Chrome. Reply by pty
Member Avatar
Featured pty 316 Replied To a Post in Fixing my not-so-smart TV
Topic by pty in Hardware and Software
So, a quick update.

My [spare router](https://www.asus.com/uk/Networking/RTN56U/) that I tried using as a firewall [can't block https traffic](https://forums.anandtech.com/threads/cant-block-https-sites-with-asus-router.2338270/), which is unfortunate.

Luckily I had *Plan B*.

I switched the TV to point at my OpenDNS account, after a few hours I checked the logs

![voila](https://imgur.com/JbbqVVX.png)

[link](https://imgur.com/JbbqVVX.png), for some reason the … Reply by pty
Member Avatar
Featured pty 316 Replied To a Post in Fixing my not-so-smart TV
Topic by pty in Hardware and Software
That's what I thought. Although I believe I may have only done a *soft reset*, which is the only option available in the standard menus.

There might be a full on *as it was when it left the factory* factory reset locked away somewhere too. Reply by pty
Member Avatar
Featured pty 316 Replied To a Post in Fixing my not-so-smart TV
Topic by pty in Hardware and Software
Tried several factory resets with no joy, it appears to spring back to life at the same firmware version, 1201, as it was before. Samsung explicitly told me that it's impossible to revert to a previous version, even know I know that's a lie. Reply by pty
Member Avatar
Featured pty 316 Replied To a Post in Fixing my not-so-smart TV
Topic by pty in Hardware and Software
In addition to my post, something that made the experience worse was that when I contacted Samsung support they said

> Please be informed that the adverts or advertisements depend on the app that you have installed or downloaded from the apps panel.

So, their support teams have been trained … Reply by pty
Member Avatar
Featured pty 316 Created Fixing my not-so-smart TV
This isn't a typical hardware post, but I couldn't find anywhere better for it.

Last October, after my previous TV packed in, I bought a shiny new Samsung Smart TV. My shortlist of requirements was:

* Excellent picture quality, preferably 4k
* No advertising built into the UI
* Within … Topic by pty in Hardware and Software
Member Avatar
Featured pty 316 Replied To a Post in Fixing my not-so-smart TV
This isn't a typical hardware post, but I couldn't find anywhere better for it.

Last October, after my previous TV packed in, I bought a shiny new Samsung Smart TV. My shortlist of requirements was:

* Excellent picture quality, preferably 4k
* No advertising built into the UI
* Within … First Post in Topic by pty in Hardware and Software
Member Avatar
Featured pty 316 Replied To a Post in Parsing XML with Regex and preg_match_all
Topic by Gloak in Software Development
[Here's a comprehensive answer](https://stackoverflow.com/a/1732454/7649503) why parsing XML with regular expressions is a bad idea. @AndrisP put you on the right track. Reply by pty
Member Avatar
pty 316 Replied To a Post in Multi Master Marter replication
Topic by rchawdhari in Databases
Yes, it is possible, and how to do it is outlined in MySQL's excellent documentation.

However, you almost certainly don't need multi-master. You just don't. Reply by pty
Member Avatar
Featured pty 316 Replied To a Post in LG UltraFine 5K
Topic by Dani in Mac OS X
Are you definitely using a Thunderbolt 3 cable between your MBP and the 5K monitor?

Incidentally, slightly jealous, I need to get one of those monitors but I'm worried my 2013 MBP might not be beefy enough to drive it smoothly. Reply by pty
Member Avatar
pty 316 Replied To a Post in How to embed this in HTML
Topic by abdu_4 in Programming
[`script` tags](https://developer.mozilla.org/en/docs/Web/HTML/Element/script). Reply by pty
Member Avatar
Topic by SimonIoa in Web Development
The code I provided is in an entirely different language, you can't just paste Ruby into PHP!

Maybe ignore JavaScript for a while and [learn PHP](https://www.codecademy.com/learn/php) first. Reply by pty
Member Avatar
pty 316 Replied To a Post in Coupon Function - Javascript
Topic by peace_coder in Web Development
You're not actually adding them to the DOM. Look [here](https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML). Reply by pty
Member Avatar
Topic by SimonIoa in Web Development
Hard to tell what's going on without knowing what your server is doing and that you're sending requests to the port it's listening on.

Here's what I'd do, substitute my Ruby for your PHP. First, create a standalone, super-simple API. Here's an example

require 'sinatra'
require 'json'

# world's simplest … Reply by pty
Member Avatar
Topic by SimonIoa in Web Development
Like I said, access your API (even if it is only one function that returns `{"hello": "world"}`) using something less complicated. The tools I mention above are a good start. When you know that is working correctly and your `url` param is right, your server is listening on the right … Reply by pty
Member Avatar
pty 316 Replied To a Post in Wifi Software App
Topic by Marlon189 in Software Development
I'd start by leaning [DD-WRT](http://www.dd-wrt.com), then use that to build a [Captive Portal](https://en.m.wikipedia.org/wiki/Captive_portal). You'll need a [compatible router](https://www.dd-wrt.com/site/support/router-database). Reply by pty
Member Avatar
Topic by SimonIoa in Web Development
Ok, so if you run this with your browser's developer tools open, what errors do you see in the console? Reply by pty
Member Avatar
Hello, the functions are called in the XHR (status 200) but dont return anything as it should,. Even when i put an echo it doesnt return the echo. The path is correct

example

javascript

function userDetails(uid,apiBaseUrl,baseUrl,public_username,msgID,groupID)
{
var encodedata=JSON.stringify({"uid": uid,"public_username":public_username,"msgID":msgID});
var url;
url=apiBaseUrl+'api/publicUserDetailsTest';

ajaxPost(url,encodedata, function(data) {

if(data)
{
some code.... … Topic by SimonIoa in Web Development
Member Avatar
Topic by Bianca Zhang in Software Development
if any one still trying to know, in the mobile device there is no C drive, so just write without it on the path.


Imports System
Imports System.IO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oRead As System.IO.StreamReader
Dim Entire As … Reply by leonardo_4
Member Avatar
Topic by SimonIoa in Web Development
Your post doesn't make a lot of sense. What functions don't return anything? Where is `ajaxPost` defined? Does your API call actually work? Try accessing your API via another program like [Postman](https://www.getpostman.com/) or [HTTPie](https://httpie.org/). Reply by pty
Member Avatar
pty 316 Replied To a Post in How to use WHERE and LIKE with a variable
Topic by cainam29 in Databases
And the moral of the story is, don't try to `join` tables using manually-entered `string`/`varchar` fields. It just won't work. Some people will enter their name as 'Timothy' in some forms, 'Tim' in others and ocassionally 'Timmy'.

Your `user` table should have a automatically incrementing numeric `primary key`. Your tracker … Reply by pty
Member Avatar
pty 316 Replied To a Post in Need help with my Syntax Highlighting program
Topic by abdu_4 in Programming
I don't really understand the question, but if you mean you want to display code with syntax highlighting (rather than edit it, in which case rproffitt's answer is correct), then there are a few libraries for this, namely [rainbow](https://craig.is/making/rainbows) and [highlight.js](https://highlightjs.org/). Reply by pty
Member Avatar
Topic by rfrapp in Software Development
This looked interesting so I had a go. Did it in Ruby so it wouldn't be of use to anyone with Java, C or C++ homework :)

puts "enter a number:"
number = gets.to_i

# calculate the dimensions of the square
length = ((number-1) * 2) + 1

# create … Reply by pty
Member Avatar
Topic by ffej2ffej in Databases
It's annoying when people ask a straight up SQL question and wrap everything in `$LANGUAGE`.

To cut a long story short, what you need is [a join](https://dev.mysql.com/doc/refman/5.7/en/join.html). Reply by pty