Aeonix 71 Posting Whiz

Unfortunately both of these are also found in Google. The first didn't affect anything, the second made website redirect unto itself back in the day.

I'll try it anyways, maybe it's different, I don't know, it still looks cryptic to me xD

(couple seconds later), yep, those work exactly same: "The www.---.com page isn’t working

www.---.com redirected you too many times."

Nevermind, it looked like 6th and 7th line did something that caused redirection. Now it works. Thanks :)

Finally, no worries.

Aeonix 71 Posting Whiz

Don't worry, I'm from Haarlem, North-Holland :D

Aeonix 71 Posting Whiz

I already tried couple solution from Google, but some of them didn't work (at all), others resulted in weird bug, where HTML page was loaded, but assets (CSS and images) didn't. Other times there were too many redirects and page freaked out. I have account on Cloud Flare, but both HTTP and HTTPS sites are accessible and changing setting that should redirect users to HTTPS, doesn't work.

So my question is how can I use .htaccess to redirect from (example)

http://www.daniweb.com and http://daniweb.com
to
https://www.daniweb.com

To sum it up, if not HTTP, move to HTTPS, and to subdomain www.
"If not starts with https://www move to https://www". Except in "htaccess"-language.

Aeonix 71 Posting Whiz

Apparently .htaccess ain't mess that it looks like. Just create .htaccess file, and put in it Deny from all, from now on every request going to any file in the folder and every sub-folder is denied with 403 Forbidden, which is good enough.

In your main page, you define a constant, then in your include files, you check to see if the constant has been defined - if not, it appears that the user is trying to access your include file directly, so you throw them to a page of your choice, else, everything is fine and the code in the include executes.

Yea, I already got that, you explain just what I had.

Aeonix 71 Posting Whiz

I don't understand this attitude at all. It seems completely counterproductive for a web designer. If I am trying to sell this WiFi product and I hire a web designer to get people to buy my WiFi product, if Jim can't read it, Jim isn't going to buy it. By using those fonts, I've lost Jim as a potential customer. Why would Jim "adapt" to me? I'm trying to sell my product to Jim. I want to make it as easy and pleasant as possible for him to learn about my product. Thus if I want him as a customer, I need to adapt to him, not vice-versa. If I don't, he'll simply go to one of my competitors.

Well, sadly enough, target is majority, not everybody. When candidates for President go on a race, they wish for 100% of reach, but have requirement of 50.00001%. Same for advertisement, they surely wish everybody could see and read their page, but why risk? Let's make sure only majority reaches the product. They'd rather choose "surely 40%" than "maybe 100%".

I know that you're about to respond with same argument, I'm not playing devil's lawyer here. Just putting some insight from their point of view. I still remain with #FFF and #222 for life.

Aeonix 71 Posting Whiz

https://jsfiddle.net/mvuy7q60/

Using JavaScript (and jQuery). How can I assure that there's only one line shown (instead of entire content of item), and if it's longer than one line, end first line on "..."?

Something like this: https://jsfiddle.net/tt9psxz3/

Aeonix 71 Posting Whiz

At the end of the day, I end up in:

menu div#memberArea div#dropdown-trigger div#dropdown-content div#form div#authSubmitButtons input#authRegisterButton.

And now many people recommend shortening it down, sure! But as soon as I drop out elements I don't feel like the code explains itself as good. This very long nasty string, as bad as it is, still explains very well it's purpose without comments. Deleting a part of it may make it way harder to the point where you ask yourself "Why do I try to explain it, if it's name should explain itself, but it makes it harder?" or "Why not make it two-depth long, if I'm shortening it anyways?".

Could anybody explain me how they manage their CSS code? Because this gets really depressing when you have 12-depth long selector.

P.S.: Yes, I have been through Google and it's links. None of mentioned "improvements" are for my problem. Nobody mentioned super long selectors.

Aeonix 71 Posting Whiz

What do you mean by true 404? A redirect to the 404 error page defined by the server?

A true fake 404 error. So that whatever encounters "the query", gets literally told that this file doesn't exist. One that will always trigger (This page doesn't exist) in every browser instead of just some.

Look, to me it's easier to move the includes scripts into a separated directory, then use .htaccess to deny direct access to that directory, so it cannot be accessed through the browser. This solution does not require to modify the scripts, so nothing like the header() 404 statement, if really needed you could force it through .htaccess and send a more appropriate 403 or even 404. It's even better if you move the includes directory to the parent of the public_html directory, which if correctly set, is not accessible by the browsers, that way you don't even need to use .htaccess file to define what is accessible and what not.

Well there's a problem, every time I use .htaccess, I mess up something. It's not a safe tool for me. I explode everything. It's like Trump and Clinton combined, it hurts, is a huge error and probably will end up deleting the world. And now for serious. I barely use .htaccess, last time I tried that (just by copy-pasting snippets) it went all wrong (thousands of redirects until browser gives up) and bad news alround. On top of it .htaccess doesn't appear in …

Aeonix 71 Posting Whiz

-sigh-

Why is it so, that when there's an issue, people look all around :D, but not on the issue.

Here's a short post:
http://stackoverflow.com/questions/409496/prevent-direct-access-to-a-php-include-file#409515

That's why. It's a file with function nobody from outside this server should be able to access.

Aeonix 71 Posting Whiz
<?php

    if (!defined("include")) {
        header ($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404);
        die;
    }

I want to include this file, as if it's not included, it should send browser 404 Not Found and end executing script (without true and 404 doesn't work either). While Opera fools itself, Firefox doesn't. It shows just super-empty document (not 404, but also not even standard CSS stylesheet). How do I successfully send "404 Not Found" to ALL browser. How do I do this successfully?

Aeonix 71 Posting Whiz

I have to ask. Did you try .001 instead of .05?

I did try, but that's too slow. That's the thing, bringing it down to very low values works, but not because it's somehow more optimized but probably because human eye cannot notice that jitter. jQuery's animate on the other hand has not a single problem animating in .5, so I don't know what the issue is.

Aeonix 71 Posting Whiz

What is inside requestAnimationFrame() function?

According to JavaScript specifications:

The window.requestAnimationFrame() method tells the browser that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint. The method takes as an argument a callback to be invoked before the repaint.

There are 2 dependent events in your fading -- decreasing/increasing value of opacity and the time interval.

There's only one event. Decreasing value of opacity.

Aeonix 71 Posting Whiz

He finished his PhD/post doc work and took a job in Silicon Valley (time suck)

People are finishing their PhD's and I can't create single JavaScript without help :D. *cries and laughs in the corner*

Aeonix 71 Posting Whiz

Mike's been a power-force and recent no-show.
But I just looked up his profile, he hasn't posted since June 2015... did something happen?
Or do people disappear on DaniWeb everyday?

https://www.daniweb.com/members/787121/mike-2000-17

I know we're not his parents, he's strong independant viking but do you just forget people like that?

Aeonix 71 Posting Whiz

<rant>
Knowing Google, their spying and fact that they want to put spybox in your network. I'm pretty happy that you can't see the "Pre-Order" button.
</rant>

As when it comes to the topic, designers are paid to make website beautiful not visible for everybody. When I'm looking at faraway board, I can't really complain at my myopia (near-sightedness), people tell me to get glasses. I guess we live in the world where we need to adapt, or fail. Luckily we don't get eaten alive, like in bad old times.

Aeonix 71 Posting Whiz

No jQuery!

This is script that I got from Chris Buttery website. Or at least part of it:

    function fadeOut(el){
        el.style.opacity = 1;

        (function fade() {
            if ((el.style.opacity -= .05) < 0) {
                el.style.display = "none";
            } else {
                requestAnimationFrame(fade);
            }
        })();
    }

The problem is that when I run it, it does work perfectly, but it jitters a lot. I can literally point out moments when that 5% of opacity is removed. Any ideas? It's not optimization of script, nor it's my weak computer. This script is about as clean as it gets and my laptop isn't trash either, so there must be something worth adding.

Aeonix 71 Posting Whiz

The index.js file refered to, I'm assuming, is nothing to do with your script. navigator.getBattery() should be used these days to get the system battery info: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getBattery

The thing is, I don't use Navigator or getBattery or getBattery() at all. I don't know why it's ever there. If you look at the JS file you will notice there's no such command at all.

Just had a look. As your js refers to many dom elements, it's a little bit difficult to make sense of it.

(weeps)
http://s000.tinyupload.com/index.php?file_id=05490825331841135346
The password is obtain @nd code.com together (look at the red text only).
Click on the green name. It's the download link.
This is entire project source-file. There is no database connection required per-se.
The thing that you look for is the email field in Authorization dropdown, and the
second thing is opacity: 0-hidden span that has red text. The line that I pointed
out in my first post, well, that's the one that doesn't seem to work. No errors, no obtrustions,
no missing references, it just doesn't do this, breakpoint stops on animate({}), then it
just couple times around jquery library and it passes on while doing nothing.

Aeonix 71 Posting Whiz

I have seen somewhere that document.getElementById("xyz") by pure JavaScript is about 3 times faster than having $("#xyz"). I'm not certain on validity. But it doesn't hurt anybody if I do it this way, on top of it, it's easier for me, as I see exactly what this does instead of looking for # and ..

Aeonix 71 Posting Whiz

I hate sharing my code, but I don't have any other option. I tried everything to prevent it, but I need to find out what's wrong about it.
http://pastebin.com/zMjne7P0

User focusses out input field (line 83)(I tried inputting ";" for tests, which should return error, as it's invalid name). And the entire big function executes well, it understands that the field is not empty, so it just goes on, it notices that it's not alphanumeric. And here's the problem. Line 71 doesn't get executed, the if (isFirstError) {} is considered a true statement (like it should). And it should execute everything function within, so it kinda "does", except I see no effect whatsoever, the opacity is still 0 and I haven't seen it even flikker in browser.

Regardless of existence of lines 30 and 31, the problem is still there.

The only error (warning) I get is:
navigator.battery is deprecated. Use navigator.getBattery() instead. index.js:50 wtf?

Aeonix 71 Posting Whiz

Missing colon after c I guess.

While replacing names of variables. I accidentally deleted the comma after c. But in the real script with real names, it is there.

However, should it be a semi-colon or comma instead of a colon?

I don't get it. If you're asking about error, I'm 100% certain it says this (copy-paste):
index.js:7 Uncaught SyntaxError: Unexpected token :.
If you're talking about array, so far Googlable elements told me that JavaScript elements and variables are seperated by , ..

Now that you mentioned, it turns out I got wrong tutorial from the internet. The array should be

array = { elementWithoutQuotes: true, secondElement: "secondvalue" }

Aeonix 71 Posting Whiz
$(document).ready(function () {
    var a, b, c
        d = new RegExp("/^[a-z0-9]*$/"),
        e = true,

        f = [
            "g": false,
            "h": false,
            "i": false,
            "j": false,
            "k": false
        ],

I changed names of variables for reasons.

Uncaught SyntaxError: Unexpected token :
Line 7. Which is "g": false,. Am I missing something?

Aeonix 71 Posting Whiz

exampleArray.push("this is an item");

I a thing. But there are also 10 other items within.
So I never truly know where that item is (which enumeration).

Is there a way of saying

exampleArray.delete("this is an item"); where it will remove item with "that" content?

(JavaScript question)

Aeonix 71 Posting Whiz

That's the problem, I don't know which part of CSS causes the thing to go bonkers and I'd rather not dump entire CSS (nothing special or secret, but still).

The only thing that is screenshot: http://tinypic.com/view.php?pic=2uptf0j
The one on the left is regular, wanted, expected behavior.
But on first page load you get the one on the right.
Only after hard refresh it remains in it's place, and no other refreshes after it (soft or hard; huehuehue) affect it anyhow.

"Flying blind", well I was kinda hoping someone knew "Top 10 Most Known Bugs That Cause Element To Fly Off-Screen".

Aeonix 71 Posting Whiz

I don't know if I'm even posting in the right section.

When I open a new tab (after closing all other tabs) and I input address of project site. Elements pops out of parent element (it's 50% of bottom is visible, while rest is through the top of the window). When I refresh the page, everything goes back to normal. The element is right on it's place (about 100px under the top of the window).

Is there any specific reason that such thing could happen, or is it really CSS? Because CSS is valid, but the browser interprets it weirdly first time and then after refresh it interprets it right.
I don't know what to make out of it. Any ideas?

Aeonix 71 Posting Whiz

Sorry, but your snippet returns 'Hey!', I don't need it to return anything, I need it to execute mentioned function and return nothing.
That answer doesn't bring me closer to expectations.

And without punctionation and seperation it's hard to get by what you mean with "There you go now type in the body area this not in the script tags make a function that returns ot not just a button i know you returned false and that might be why".

Aeonix 71 Posting Whiz

Yep. In Kubuntu 16.04 LTS it's called "System Settings".
Done, thanks.

Aeonix 71 Posting Whiz

I'm on latest Kubuntu.

Here I am with English US keyboard input. But I'd like to install say Norwegian, Polish, Japanese, whatever.
I decide the easiest step. Which is to search "input". "Input Method" sounds promising. I run it.
Then I get window. That says:

Current configuration for the input method:
 * Active configuration: missing (normally missing)
 * Normal automatic choice: none (normally ibus or fcitx or uim)
 * Override rule: zh_CN,fcitx:zh_TW,fcitx:zh_HK,fcitx:zh_SG,fcitx:ja_JP,fcitx:ko_KR,fcitx:vi_VN,fcitx
 * Current override choice:  (en_US)
 * Current automatic choice: none
 * Number of valid choices: 1 (normally 1)
The override rule is defined in /etc/default/im-config.
The configuration set by im-config is activated by re-starting X.
Explicit selection is not required to enable the automatic configuration if the active one is default/auto/cjkv/missing.

Have no clue what it says or what it does. The only button up here is "ok".

After "Ok" another window pops up asking.

Do you explicitly select the user configuration?

* Select NO, if you do not wish to update it. (recommended)
* Select YES, if you wish to update it.

If I select "Yes", window disappears and nothing happens. When I select "No", a window pops up with following message.

Keeping the user configuration /home/kubuntu/.xinputrc as missing.
Automatic configuration selects: none
This does not set any IM from im-config.
This is the automatic configuration choice if no required IM packages are installed.
If a daemon program for the previous configuration is re-started by the X session manager, you may need to kill it …
Aeonix 71 Posting Whiz

<input id="aaa" onclick="scrollTo('registerBox'); return false;" formaction="register.php" type="submit" value="Register" />

If JavaScript is enabled (which it is, and it's working on other functions and triggers). Shouldn't it execute scrollTo("registerBox"); and don't do anything (return false;).
Am I missing something? I don't want it to formaction if JavaScript is enabled.

Aeonix 71 Posting Whiz

Indeed. That's why I'm seeking for alternative solution. How to detect "10994234" and 3242144122 as integers. Casting doesn't work as mentioned above (false positives).

Aeonix 71 Posting Whiz

That's the thing. I don't need it to return string or integer. I need it to return true if element is entirely integer (or integer within quotes "12943"), or false when it's not so. It's not about getting integers out of string, but checking if said variable is an integer.

Aeonix 71 Posting Whiz
<?php

$not_an_int = "sa';';';'sd12340asd";
$actual_int = "12341234";

var_dump(is_int((int)$not_an_int));
echo "<br />";
var_dump(is_int((int)$actual_int));
echo "<br />";
echo "<br />";
var_dump(is_int($not_an_int));
echo "<br />";
var_dump(is_int($actual_int));

?>

Returns:
true
true

false
false

Without casting, real integer is seen as false.
With casting, a non-integer is seen as true.

What would be a real method to detect both "2139481" and 29481932 as integers?

Aeonix 71 Posting Whiz

There are so many topics in your post that each one could take a session on its own.

I was actually hoping for that. The more I know, the better.

A lot of what you wrote is based on assumptions long gone.

We talking a decade or more?

When was the last time you were on a computer with just a single core?

Decade or so.

I have to make a big assumption is your run of the mill smart phone or PC.

I tried thinking of seeing how the I could affect computer hardware using assembly (send a sound? print a text? make a visible box? turn on light of camera? blink diode of my mouse?), nothing serious.

This means that assembler is not your best choice as there is no known system to that will take your code and thread/break it across the cores for more throughput.

So Assembly is monolithic only, it's not possible to somehow split it up?

This is possible with byte code systems (Java, others.)

Doesn't Java require working operating system and it's sub-tools to boot? On the other hand, wasn't that what Android relies on? Including some other low-level language?

Your assembler code is a "do this" code and your byte code says "do this as best you can."

Doesn't "do this as best you can" add overhead? It needs to go through a lot of possibilities. "Do …

Aeonix 71 Posting Whiz

Couple statements, couple answers.
I don't understand everything.
If I'm wrong, correct me, but don't be mean about it.
You weren't senior in your first steps either.
Some of these are guarranteed wrong,
because I want to taunt out the correct answer.

Statements:
S1. Assembly works 1 on 1 with the CPU. It's as "least as possible overhead" as possible that is still currently in active use.
Everything that has to do with usable lowest level and is still "cool" to use is Assembly. Operating systems, operating system installations, rescue CD, boot systems and lowest level (partitioning etc.) applications are made in Assembly in order to not make people insane by typing 1's and 0's. Assembly's so-called OP codes work in ratio 1 to 1 in binary, and is often pretended that Assembly is just language of processor. "You just don't go lower than that".

S2. Assembly has no security flaws.
As "hacking" (software cracking) requires a lot of working hardware and software. It's like trying to cut atom (Assembly written program) with an axe (software written in other languages on different machine). Assembly has no possible corruption as it has no networking access, it doesn't have faulty delimiters, it doesn't care about social engineering and the only actual way to make Assembly program behave like it shouldn't, is to directly and physically overwrite the data or intercept within processor itself. And if you try to intercept calls by wrong memory to …

Aeonix 71 Posting Whiz

Exactly that. Sometimes I bring back the idea to look up manual sometimes, instead of relying on own "knowledge".

Aeonix 71 Posting Whiz

Typical code works like this:

$(...).hover(function () {});.

But it also needs to go away when it's loses it's hover. Is there a shorter way to do that than:

$("#x").hover(function () { troll(); });
$("#x").mouseout(function () { untroll(); });

I just feel that smart people over at jQuery have thought of that and there must be a function that fuses them both.
I tried something like this:

$(xxx)
        .hover(function () {
            $(xxx).animate({"opacity": 1});
        })
        .mouseout(function () {
            $(xxx).css({"opacity": 0});
        });

But that has long history of failures (item doesn't animate, then goes back to 0, then goes to 1, then smoothly warps to 0, it doesn't work, long story).

addClass() and removeClass() are not an option. Due to other CSS properties like "display: none".

Et cetera. Et cetera. Et cetera. Et cetera.

Aeonix 71 Posting Whiz

It's so hard, yet so easy. Exactly that. Thanks.

Aeonix 71 Posting Whiz

User gives me a $_POST, I want to check whether keys (not the values) are there.
$_POST keys need to be newemail, firstPassword and secondPassword.

What I have tried:
if (in_array(array_keys($_POST), array("newemail", "firstPassword", "secondPassword"))) echo "Everything in order"..

How to make it actually work?

Aeonix 71 Posting Whiz

No. I just want to upload project that I'm working on (HTML, CSS, JS etc.) to my FTP client. But I guess OneDrive would be nice application too.

Aeonix 71 Posting Whiz

I hoped that there were alternative ways to burn USB, but I bought DVDs and installed Windows this way, then I just installed grub back, and now I'm where I wanted to be.

Aeonix 71 Posting Whiz

I have a machine, I have a hosting with FTP. On my venture I found out about lftp.
And the instructions are here: http://www.dangibbs.co.uk/journal/ftp-sync-usin-linux

Snippet is this:

open ftp://username:password@website.com
mirror -v --only-newer /home/local/path/ /website.com/public_html/

Do these things still work? Also, how do I loop it? I don't want to spam my computer with looping query, and execute 200000 mirrors in a second, when I'll update in 5 next seconds. Is there a way to make it automatic, so that I can leave it in background and let it go, I just want to update my files and have program update it on the FTP server.

Aeonix 71 Posting Whiz

Page you provided while interesting, shows only how to burn Linux on Linux, how to create multi-boot on Linux, how to create Windows PE on Linux and how to burn Windows on Windows. But not how to initiate booting of Windows NT on Linux. Nothing on alternative methods of burning Windows on Linux.

Not a real solution, but I appreciate the effort.

Aeonix 71 Posting Whiz

I'm sorry, but I don't know what to pull from your post. I'm on Kubuntu, I can't run the program from codeplex and virtual machines don't make partition changes to physical USBs.

So, everything is gone, I need to use 3rd party to get Windows forced onto my HDD? Well, that sucks.

Aeonix 71 Posting Whiz

(short version of the story)

I'm using Kubuntu in BIOS Legacy State as this was the only way I could see USB option in Boot Menu (F12). And it was the only way I could install Kubuntu from USB, from boot. I "burned" USB using OEM Windows 10 and told Kubuntu to take entire disk (effectively wiping out all bloatware).

If I enable BIOS UEFI mode, I see "No Bootable Device" icon because Linux and UEFI don't like one another(?), and already mentioned, list of bootable devices disappear (In Legacy Mode, there are 5 positions, HDD, USB, network etc., in UEFI mode, nothing, empty list).

I ran: dd bs=4M if=/path/to/win10.iso of=/dev/sdx && sync
with correct path and correct USB and it didn't work. Screen flickered couple times and the only thing I saw was Kubuntu's logo and it booting up. WinUSB is not a choice since it's seemingly offline, unetBootin never worked. I'm not aware of any such easy tools.

I don't know what to do, is it possible to install Windows 10 on Legacy BIOS from USB on Linux?

Any ideas? How can I successfully "burn" USB, boot it and actually install it?

Currently my computer is in Legacy BIOS mode, with enablable UEFI mode with Secure Boot disabled.

After dd I can easily reformat my USB (which means it's not hardware failure) and reuse it. Could someone knowledgable guide me?
I have two iso's actually, one from Windows 10 and one from Windows 7 (oldie but …

Aeonix 71 Posting Whiz

This is a self-join without a relation to either topics or members.

Oh, didn't notice xD

And yea, parenthesis is bad apparently. Thanks!

I understand INNER JOIN now (I think), that's so neato!!

Aeonix 71 Posting Whiz

I have something like this:

SELECT
    [SNAP!]
FROM (topics INNER JOIN members ON topics.author = users.id)
    (INNER JOIN forums ON forums.id = forums.parent)

But the query seems incorrect using a validator. The last line is invalid. What's wrong with it?

Aeonix 71 Posting Whiz

Maybe this way:
I need to select all the data from:
- forums.id parentForumId, forums.name parentForumName from forums where forums.id = topics.parentForum.
- members.id authorId, members.name authorName from members where members.id = topics.authorId.
Both, in query that looks something like this:

SELECT
    forums.id parentForumId,
    forums.name parentForumName,
    members.id authorId,
    members.name authorName,
    etc. etc. etc. etc.
FROM topics INNER JOIN members ON topics.author = members.id
WHERE topics.parent = $currentForum
ORDER BY topics.id DESC LIMIT $currentIndex, 10;
Aeonix 71 Posting Whiz

First off, I'm very ignorant of the MySQL scene or it's jargon. I didn't really understand the premise, pecifically the "slam" part and the "[SNAP!]" part, or the "pocket" part.

Oh no, they were my metaphores, do you really think respectable people over at MySQLi would use such low-grade terms? ;D

I do believe these answers are acceptable though, let me know your thoughts.

You'll have to wait, I'm really new to SQL, I need to make things crack and adjust to see if it works. Be right back.

Aeonix 71 Posting Whiz
SELECT [SNAP!]
FROM topics INNER JOIN members ON topics.author = members.id
WHERE topics.parent = [variable from PHP]
ORDER BY topics.id DESC LIMIT [variable from PHP], 10

Is what I have in pocket. I'd like to slam SELECT * FROM forums WHERE id = topics.parent. While keeping the functionality it already has.

Aeonix 71 Posting Whiz

Here's the problem DESC LIMIT (variable x 10) in case of 5 it would be DESC LIMIT 50. It will give last 50 results, I need 10 results after these 50.

Something like DESC LIMIT from (variable x 10) to (variable x 10 + 10)

Aeonix 71 Posting Whiz
SELECT blabla
FROM a INNER JOIN b ON a.a = b.b

Is what I have. However I'd like to sort the results DESC by ID. I'd like to select last [variable x 10] of items sorted by ID DESC. Variable provided by PHP (I'll sort things out, I just need help with the query itself).