vendredi 26 octobre 2018

Problem in my custom setInterval() function in javascript

Here I made a custom setInterval function but it is not working as desired.

function interval(func,ti,f){
if(f==0||f==undefined){
    try{                  //calls the function provided as argument.
        func.call();
    }
    catch(err){                 //if error occurs
        throw err.toString();
        f=1; 
    }
    setTimeout(interval(func,ti,f),ti);
   }
}

the main idea behind this is that the user calls the function somewhat like this:

interval(()=>{
   console.log('hello world');
 },10000);

since I'm not passing the value of f so it is undefined so it satisfies and enters the if statement. now when try{} calls the function, it executes. The problem is that I am calling the SetInterval function by passing arguments as the function interval() and ti which is the time in milliseconds.

So it should call the function interval() after time ti but it is not doing so.

plz, help me out.




How to show a website as a wallpaper in Windows 10?

is there a way to show a webpage on the windows 10 desktop (as a wallpaper, not in the browser)? I'd like to show an URL to google calendar on the background.

I have no idea to get this done. (Is it configurable? Is there a solution in Python 3, c# or elsewhat?)

merlinuwe




When was the last time person visited my website

I want to display something to the user when he gets to my page only once a day. Is there way to know when the last time the user was in my website? (In user i mean person on my website - there is no authentication / login)




Apache server isn't starting on Xampp portable

It may seems as a repeated question but my problem is that I couldn't be able to start Apache server on XAMPP Portable, I'm am aware of the issues that some aplications can cause since they can use the ports where apache is supposed to work, so I decide to change the apache running ports on httpd.conf and httpd-ssl.conf files to Listen on 8080 and 8001 respectively, here are some screenshots of the changes,

http-conf1, http-conf2, httpssl-conf1, httpssl-conf2

In adition to that I also chage the configuration of the "Service & Port Settings" under XAMPP Control Panel, as shown in the folowing image,

xampp-ports

Although, I did all these changes I still can´t get the apache instance running, and keep getting the following error xampp-error, it's important to notice that I´m trying to start apache service in a company workstation and I don't have any admin rights, but I read that ports above 1250 didn't need any admin rigths to run services on them, so I don´t know what to do at this point, any suggestion from you guys would be really appreciated.

Thanks.




How to rearrange a constantly changing string on a website?

I'm not exactly sure how to solve this because I'm not super familiar with js so any help is greatly appreciated ☺️.

Anyways, here is a form used for booking a lodge.

The company Rentlio, is from Europe and thus they use European number formatting with the comma business. I really want to use their platform but I feel like customers will get spooked by this possibly. Is it possible with a little script, to change the value to read out $xx.xx instead of xx,xx $ ? Thank you.

I'm adding this to a website so the script can be added somewhere on there.

Thank you for any help!

Here is a screen-cap to make this post more interesting.

screen-cap!




Sharepoint Web Part clickable

i inserted a web part in our SP Page that contains an excel sheet. that sheet contains clickable shapes. when i checked it in web, the click function is not enabled/running. how should i make it work?




Store about and contacts in database

I want to know if it would make sense to store the website about text and contacts in a database instead of just writing it in the html, and how would I do that?

I've been thinking just one table for each with the information and no id (since I only really want to store one version of everything), but that doesn't make a lot of sense.

The about table should contain the text and the contacts should contain address, coordinates, email and phone number.

Any suggestions?

Thank you!