mardi 31 mars 2020

Updating Database phpmyadmin with codeigniter4

Im sorry im new in CI4,

I want to update my database with a form. But it can not update where i want to, even i put code where in it, if i delete the where code, they will update all of my record in my database, please ive been reading the documentation of CI4 and i still cant understand why my code can not detect the where code.

here's my code to update it

//update data name / bio
            $name = $this->input->post('name');
            $email = $this->input->post('email');
            $bio = $this->input->post('bio');
            $data = [
                'name' => $name,
                'bio'    => $bio
            ];
            $this->db->set($data);
            $this->db->where('email', $email);
            $this->db->update('user');



Which approaches is better in using vue.js and laravel?

Which approach is better when we use react/vue with laravel: -react/vue as separate project -react/vue in the same project with laravel Why? And in what different condition we use these two different approaches?




Route [admin.distroyDish] not defined. (View: /home/abdalrazag/MyResutrant/resources/views/admin/manager.blade.php)

I am using Laravel 7 to build Restaurant system and I maked form that go to specific route and I get name route but it is display error as the title

this manager view

    <form method="post" action="" >
    @csrf
    <div class="form-group">
    <select class="form-control" name="dish">
    @for($i = 0 ; $i < count($InetialData['dish']) ; $i++))
    <option value="">                 </option>
    @endfor
    </select>
    </div>


and this my web Route file

    Route::get('/', function () {
    return view('welcome');
    });

    Auth::routes();

    Route::get('/home', 'HomeController@index')->name('home');



    Route::get('/manager','ManagerController@dashboard');

    Route::post('/manager','ManagerController@addItem');

    Route::get('/manager/{id}','ManagerController@deleteTable')->name('admin.deleteTable');

    Route::post('/manager','ManagerController@destroyDish')->name('admin.distroyDish');

    Route::post('/manager' ,'ManagerController@addIngrediant')->name('admin.addIngrediant');

    Route::get('/kitchen' , 'KitchenController@index')->name('kitchen.home');

   Route::get('/kitchen/{id}' ,'KitchenController@submitDish')->name('kitchen.submit.dish');

   Route::post('/kitchen','KitchenController@addIngrediant')->name('kitchen.addIngrediant');

and this ManagerController

    private function initData(){
     $InetialData = array(
        'category'=> DB::table('Category')->get(),
        'dish'   => DB::table('Items')->get(),
        'users'   => DB::table('users')->get(),
        'Ingrediant' => DB::table('Ingrediant')->get(),
        'IngrediantHistory' => DB::table('IngrediantHistory')->get()
    );


    return $InetialData;
    }

    public function destroyDish(Request $request){

    DB::table('Items')->where('id', '=',$request->dish)->delete();

    return redirect('/manager')->with('InetialData' , $this->initData());
    }

other route like kitchen is work why this route is not work ??




How to make a page that does not exist display a template file using .htaaccess file

I have seen this done before successfully but I am unable to replicate it. What I want to do it on my website I have a folder and in it is a template file lets call it template.html (folder/template.html).

What I am trying to do is if I was to link to folder/newpage.html, for example. the path will remain unchanged but it will display the contents off template.html.

This will allow me to dynamically update the details with details in my database vis js/php etc without having to create many pages when they will all essentially look the same, just different details.

I know it will involve the HTA access file, and I know how to redirect to another page. But keeping the page the same and just displaying the content of another is where I'm stuck.




What combination of services in AWS should I use for a system with high availability?

We are building a serverless system. Right now what we are using is Cognito for user authentication, S3 for static storage, API gateway, Lambda function and Aurora Serverless for this system. This system is quite simple, it includes user registration, no search, no join query. I wonder what else I can do to improve the availability.




Is it possible to change parent using javascript?

I need to change a div parent programmatically. For example

<body>
  <div id="div_a">
    <div id="child"></div>
  </div>

  <div id="div_b">
  </div>
</body>

I wonder if it is possible to change the div with id="child" parent to a div with id="div_b" ?

I have search, but nowhere close. But in case there is a similar question, please let me know.

Thank you




why my element aside working above navbar when i doing scrolling down on dekstop and element aside is not below on mobile devices?

so, i want to make the aside element below, just when it looks like it's made a mobile device. BUt this is an error, right on mobile device, not below, but instead still beside but the display element is missing. And then, on dekstop display, when i'm srolling down, for the elements outside the navbar. Please help me, thanks.

on dekstop ; enter image description here

on mobile devices enter image description here

CSS ;

aside{
    /* position: fixed; */
    /* float: right;
    width: 25%; */
    /* padding-left:25px; */
    /* overflow-x: auto;
    height: 100%; */


}
    .box{
        width: 15em;
        border: 1px solid #333;
        /* box-shadow: 4px 4px 2px #444; */
        padding: 8px 12px;
        flex-grow: 1;
        margin: 10px;
        border: none;

    }

    .content{
        float: left;
        width: 73%;
    }

    .flex-container{
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        margin-top: 50px ;
        margin-bottom: 50px; 
    } 
    .absolute{
        position: absolute;
        /* top: 0; */
        left: 1000px; 
    }

    @media screen and (max-width: 480px){

        .content, .flex-container, .box,  
        aside{
            width: 100%;
            padding:0;
        }
    }

HTML;

  <main >
<div class="content">
    <article id="Home" >
        <div class="home">
        <h4> Yuk Kenalan bentar sama Bojonegoro! </h4>
        <figure>
        <img src="assets/img/maps.png" class="featured-image" > 
        <!-- <figcaption>maps wilayah bojonegoro</figcaption> -->
        </figure>
        <p>Bojonegoro itu salah satu wilayah yang terletak di provinsi Jawa Timur, dan berbatasan langsung dengan Kabupaten Blora, Jawa Tengah. lohh
            Wilayah ini memiliki potensi alam yang kaya terutama dari hasil sumber daya alam seperti   tambang, migas, pertaniain, dan beragam kesenian traditional yang ada.
            Dulu, daerah ini pernah dikuasai kerajaan besar yaitu Majapahit yang beragama Hindu-Budha serta Demak yang beragama Islam.
            Maka, bisa kita simpulkan bahwa sejak zaman dulu kekayaan bumi Bojonegoro sudah banyak diperebutkan oleh banyak kerajaan. Sehingga budaya, tradisi, makanan khas Bojonegoro, terbentuk ari berbagai zaman yang pernah menguasai Bojonegoro.
        </p>

         </div>
    </article>
    <div class="flex-container">
    <article id="Kesenian" class="cards box">
        <div class="row">
        <div class="col-lg-3 col-6">
        <div class="art">
        <img src="assets/img/arts.png" height="150px" >
        <h3>Kesenian</h3>
         </div>
        </div>
        </div>

    </article>

    <article id="Kuliner" class="cards box">
        <div class="row">
        <div class="col-lg-3 col-6">
        <div class="art">
            <img src="assets/img/kuliners.png" height="150px">
            <h3>Kuliner</h3>
        </div>
        </div>
         </div>
    </article>

    <article id="Wisata" class="cards box">
        <div class="art">
            <img src="assets/img/wisata.png" height="150px">
            <h3>Wisata</h3>
        </div>

    </article>
    </div>

    <article id="kesenian" class="card ">
        <h4> Kesenian </h4>
        <p> Kesenian bojonegoro itu sangat banyak yee kan, kalau ga percaya coba jalanjalan kesana aja</p>
        <section>

            <h5>Tari Sandur</h5>
            <p>Seni tradisi Sandur biasa dilaksanakan setelah panen, hal ini dilakukan sebagai wujud terimakasih masyarakat atas panen yang diberikan oleh Tuhan YME kepada mereka. 
                <br> disebut Sandur karena dilaksanakan setelah panen berlangsung. Selain di Bojonegoro, Tuban juga memiliki kesenian ini, tapi dengan ciri masing-masing. </br>
                <br> <b>Prosesi yang dilakukan,sebagai berikut:</b><br>
                <ul>
                    <li> Pra pertunjukan</li>
                    <ol type="a">
                        <li>Proses Ritual Setren</li>
                        <p>Memerintah berkah dari leluhur, khususnya untuk properti pertenjukan terntentu, yakni Jaranan. Tali sumbang adegan atraksi <i>kalangking</i>,
                        <br>pecut untuk menyadakarkan tersebut di masukkan atau diinapkan dalam <i>cungkup</i> (makan leluhur) srta kelengkapan sesaji berupa kemenyan atau dupa. 
                    </p>
                        <li>Tujuan Umum</li>
                        <p> ritual setren ini bertujuan agar pertunjukkan Sandur yang dilaksanakan </p>
                    </ol>
                </ul>
            </p>
        </section>
    </article>
</div>


    <aside>
        <div class="absolute ">
        <article class="card">

            <header>
                <h2>INFORMASI LAINNYA</h2>

                <figure>
                    <img src="assets/img/me.jpg" height="200px"">
                </figure>
            </header>
           <section>
            <h3>Tentang Saya</h3>
            <table>
                <tr>
                    <th>Asal Sekolah</th>
                    <td>SMK NEGERI NGASEM</td>
                </tr>
                <tr>
                    <th>Asal Kota</th>
                    <td>BOJONEGORO</td>
                </tr>
                <tr>
                    <th>No. Tlp</th>
                    <td>086367985867</td>
                </tr>
            </table>
           </section>

        </article>
        </div>
    </aside>

</div>



Oscillator AnalyserNode

I'm trying to add AnalyserNode and visualize the output sound to a web audio example that I made but I can't figure out how. I think I am not passing the right source to the analyser (?)

Here for the full code : https://jsfiddle.net/kepin95043/1ub0sjo3/

    <script>
        var fs = 2000;
        var gain = 0.2;

        class Sound {
            constructor(context) {
                this.context = context;
            }

            init() {
                this.oscillator = this.context.createOscillator();
                this.oscillator.frequency.value = fs;
                this.gainNode = this.context.createGain();
                this.oscillator.connect(this.gainNode);
                this.gainNode.connect(this.context.destination);

            }

            play(value) {
                this.init();
                this.gainNode.gain.setValueAtTime(gain, this.context.currentTime);
                this.oscillator.start();
            }

            stop() {
                this.gainNode.gain.exponentialRampToValueAtTime(0.001, this.context.currentTime + 1);
                this.oscillator.stop(this.context.currentTime + 1);
            }

        }

        var context = new AudioContext();
        var sound = new Sound(context);
        sound.init();
        var wave = 'sine';
        var state = 'paused';

        var waveSelectors = document.querySelectorAll('.waveform');
        var playBtn = document.querySelector('#play');
        var container = document.querySelector('.container');
        waveSelectors.forEach(function(button) {
            button.addEventListener('click', function() {
                cleanClass('active');
                wave = button.dataset.wave;
                sound.oscillator.type = wave;
                button.classList.add('active');
            })
        })

        playBtn.addEventListener('click', function() {

            context.resume().then(() => {
                console.log('Playback resumed successfully');
            });
            if (playBtn.text == 'Play') {
                sound.play();
                sound.oscillator.type = wave;
                playBtn.text = 'Pause';
            } else {
                sound.stop();
                playBtn.text = 'Play';
            }
        })

        function cleanClass(rclass) {
            waveSelectors.forEach(function(button) {
                button.classList.remove(rclass);
            })
        }

        function changeFs(val) {
            fs = val;
            var output = document.getElementById("fsValue");
            output.innerHTML = val;
            sound.stop();
            sound.play();
            console.log(val);
        };

        function changeGain(val) {
            gain = val;
            var output = document.getElementById("gainValue");
            output.innerHTML = val;
            sound.stop();
            sound.play();
            console.log(val);
        };

    var masterGain;
    masterGain = context.createGain();
    masterGain.connect(context.destination);

    // analyser
    var analyser = context.createAnalyser();
    masterGain.connect(analyser);

    var waveform = new Float32Array(analyser.frequencyBinCount);
    analyser.getFloatTimeDomainData(waveform);

    (function updateWaveform() {
      requestAnimationFrame(updateWaveform);
      analyser.getFloatTimeDomainData(waveform);
    }());

    var spectrum = new Uint8Array(analyser.frequencyBinCount);
    (function updateSpectrum() {
      requestAnimationFrame(updateSpectrum);
      analyser.getByteFrequencyData(spectrum);
    }());


    // oscilloscope
    var scopeCanvas = document.getElementById('canvas');
    scopeCanvas.width = waveform.length;
    //scopeCanvas.height = 200;
    scopeCanvas.height = scopeCanvas.width * 0.33;
    var scopeContext = scopeCanvas.getContext('2d');

    (function drawOscilloscope() {
      requestAnimationFrame(drawOscilloscope);
      scopeContext.clearRect(0, 0, scopeCanvas.width, scopeCanvas.height);
      scopeContext.strokeStyle="white"; // Green path
      scopeContext.beginPath();
      for (var i = 0; i < waveform.length; i++) {
        var x = i;
        var y = (0.5 + waveform[i] / 2) * scopeCanvas.height;
        if (i === 0) {
          scopeContext.moveTo(x, y);
        } else {
          scopeContext.lineTo(x, y);
        }
      }
      scopeContext.stroke();
    }());

    </script>

Could anyone help me to identify what I'm doing wrong? Thank in advance!

PS: Open it with Firefox. Does not work on Chromium based browsers for me.

Here is a working example: https://codepen.io/dennisgaebel/pen/YEwLaL




Why Flutter app does not run on chrome with the command flutter run -d chrome

I have been working on a project with Flutter and it works on mobile without issue. but when I want to run it on web using the command flutter run -d chrome the browser opens with a blank screen. when I inspect the page the console show the following errors.

Failed to load resource: the server responded with a status of 404 (Not Found)       dart_stack_trace_mapper.js:1 
Failed to load resource: the server responded with a status of 404 (Not Found)       require.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)       :59034/favicon.ico:1 



Making Netlogo avaliable via the Web

I am looking for suggestions as to how to make net logo available via the web. The interaction I want is to allow humans to participate in the model. Hence using netlogo web is not the solution. I am looking for suggestions as to how to achieve this. I will have to write an extension to collect information from the humans to feed the model. This can be achieved with an extension, however, how I hook up the users to the Netlogo is an open question. I am looking for some suggestions. The users would interact with the Netlogo via a web page. This could be developed via some intermediate technology. I have also thought about putting netlogo into a tomcat container in some way, but, I am not 100% sure what I am doing here. Some use of Node,js perhaps, but, beyond that I am struggling to fix an architecture. Can anyone assist.




Access Xing from python

I am trying to access my Xing account from a python script, so I can parse through the html pages and grab some informations.
Therefor I have to authenticate somehow. But I do not know how to do the login with the python library 'requests'.
My workaround is built with the library 'webbot'. But I am not very happy with this, because it requires a chrome browser and is a bit unstable. If I understand it right Xing closed their API in 2019. :(
My web-technologie knowlege is not that good. It seems to exsist some auth_token, but I do not know how to get it with 'requests' and even if that is what I need.

Maybe someone can give me a hint how to do this with 'requests' or another python library.

Thanks! :)




How to store data of a web application in client side which will accessible from any device?

I am creating an online shopping cart web application using the React.js and Spring boot technologies and in my application I need to implement a watchlist to the user which user can save their favourite products for future buying. So I thought that using the server side db is a wastage of resources, because it's not a very important detail to my web application,and I have already planned to store the shopping cart details in my db. So the problem here is I need to know how to store these details in the client side and then how to access all those data from any browser(Including different devices) ? Ex:Ebay watch list

I already red about the articles of local storage Api in React.js but in there also the limitation of only to a specific browser was there.




Possible doing java and php together in same web development?

As my question above, is it possible to use java language in one module (eg login module) and using php language in another module (eg shopping module)? Is that possible crash on each other? The database is the same. Thanks!




Best Practice Symfony / Doctrine - Multi-client management

I'm developing a platform with Symfony where my clients can each manage a database of users. This database of users is used on another application where they can connect and interact with different features.

The easy way to do it is to have an entity client and an entity clientUser with a OneToMany relation. clientUsers will be all together in one entity, and I'm not sure it's the best practice. In the same time, I'm scared of optimisation : if I have 10 clients with each 5000 users each, I will have a big entity of 50 000 users.

Right now I'm thinking of creating a new clientUser entity for each client, so they can have separate entity. for exemple if my clientName is 'ABC', I can create an entity clientUserABC. Then I can use DQL to interact with those separate entities.

It sounds like it works, but also very sketchy. Am I seeing the things right or I'm missing something ?

Thanks for helping




How to save username in global variable asp

I have online exam system I want to save username in global variable or any other thing that just can save it.
I want this username for get and set data on SQL database.
I'm using a global variable in class but it replace in every login.
any way to save username foreach user?

 public class GVar
{
    public static string user
    {
        get; set;
    }
    public static string mail
    {
        get;
        set;
    }
    public static string melli
    {
        get;
        set;
    }
    public static bool go
    {
        get;
        set;
    }

    public static System.Threading.Thread thread { get; set; }
}



Combining different UIs into one system (with possible switching between them) while most likely using webtechnology/python

first of all i am not sure if I am correct here with this question. Anyway, in the project I will be working on I should offer the possibility for "unifying" some already existing UIs so a user should be able to switch between them (maybe my using gestures or menus etc). Currently those UIs are implemented using different technologies, so e.g. one is webbased, one is done with GTK. *

So the goal is to find one shared base for them.

As a webbased UI is independant from the OS, I thought about making my solution webbased however I don't know much about the UIs yet. In general, they are very different regarding not only implementation but also design and complexity. One of the infos I have is, that it would be great if UIs can be developed using Python 2 as it is still mostly used by the developers of one of the UIs. So they are open to leaving old technology behind if I have a good recommendation that works for everyone and isn't too much hassle to switch to.

As I am still a beginner, I am struggling with what technologies to use.

It seems like anything webbased uses javascript and the frameworks I found for making python GUIs seem more outdated and less flexible compared to web technologies. Also I did not find out much about if a program can be integrated into a website or something like that. For most of them i don't know how relevant they are for my problem. So I would be glad to get some tips on what I could/should be using or where I should start searching.

Things I already found when searching are listed beneath.

  • electron which is also sometimes mentioned together with Python like here

  • django which seems to be for fullstack python web development if I am right

  • i know that the already webbased UI uses flask and vue.js; also I already used react.js for a small project if that could be helpful

  • this is one example where somebody starts programs via a web page (but I don't feel something like this would be a good fit, as switching between the UIs would probably not seem to be very fluid/consistent for the user.)

  • kivy was something I found for developing python GUIs (it also seems to be able to use multitouch which could be interesting)

  • as I said earlier one of the UIs is implemented via GTK so I found this similar question online

Thanks in advance. :)




What does "implentation of web site is done Horizonte" mean

To fetch the data from the widget how is it related to implentation of web site




Mock website - having trouble with responsive layout; muddles up when resizing browser

I am doing a mock website for learning but I am struggling understanding certain concepts. At the moment it is particularly to do with the responsiveness of the website. I am not sure I have done the layout wrong or just haven't included the key code.

If anyone wouldn't mind just has a quick look at what I have so far, please?

Thank you!

    body {
        background-color: #F5F5F5;
        background-size: cover;
        margin: 0px;
    }
    #header_main {

        font-family:'Jacques Francois Shadow';
        color: #111;
        font-size: 30px;
        text-align: left;
        padding-left: 10px; 
        padding-bottom: 35px; 
        padding-top: 5px; 
        text-shadow: 2px 2px 5px #708090;
        text-decoration: underline; 
        height: 100px; 
        width: 100%; 
        margin-top: -40px; 
        background-color:#DCDCDC; 

    }

    ul {
        list-style-type: none;
        margin: 0px;
        padding: 0px;
        overflow: hidden;
        background-color: #708090;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3)  
    }


    li a { 
        float: right;
        display: block;
        color: white;
        text-align: center;
        padding: 8px 10px;
        font-size: 20px;
        font-family: "Courier New", Courier, monospace;
        text-decoration: none;
    }

    li a:hover{
        background-color: black;
        color: #FF8C00; 
    }

    .active {
        background-color: #FF8C00;
        color: black;
    }

    #top_side {
        width: 100%;
        height: 20px;
        background-color:#FF8C00;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3)  
    }

    #middle_head {
        width: 520px; 
        text-align: center; 
        height: 50px;
        font-size: 20px;
        font-family: 'Jacques Francois Shadow';
        text-shadow: 2px 2px 5px #708090;
        text-decoration: underline;
        border-left-style: solid;
        border-right-style: solid;
        border-radius: 5px;
        border-width: 1px; 
        margin-top: 80px; 
        margin-left: 700px; 
        text-shadow: 2px 2px 5px #708090;
    }

    #img_1 {
        width: 900px;
        height: 500px; 
        margin-left: 110px;
        margin-top: 70px;
        border-style: solid; 
        border-color: black;
        border-width: 1px; 
        border-radius: 5px; 
    }

    #header_1 {
        text-align: center; 
        font-size: 20px; 
        border-bottom-style: solid;
        border-color: black;
        border-width: 1px; 
        font-family: 'Jacques Francois Shadow';
        text-shadow: 2px 2px 5px #708090;
    }

    #left_side {
        float: left;
        margin-left: 60px; 
        width: 300px;
        height: 100%;
        padding: 10px; 
        margin-top: 100px;
        border-left-style: solid;
        border-right-style: solid;
        border-color: black;
        border-radius: 5px; 
        border-width: 1px; 
    }

    #header_2 {
        text-align: center; 
        font-size: 20px; 
        border-bottom-style: solid;
        border-color: black;
        border-width: 1px; 
        font-family: 'Jacques Francois Shadow';
        text-shadow: 2px 2px 5px #708090;
    }

    #right_side {
        float: right;
        width: 300px;
        height: 100%;  
        padding: 10px; 
        margin-right: 80px; 
        margin-top: 100px;
        border-left-style: solid;
        border-right-style: solid;
        border-color: black;
        border-radius: 5px; 
        border-width: 1px; 

    }

    footer {
        margin-top: 100px;
        padding: 1px;
        text-align: center;
        background-color:#708090;
        opacity: 0.4;
        font-family: 'Arial';
        font-size: 20px;
        font-weight: bold;
    }


<!-- language: lang-html -->

    <!DOCTYPE html>

    <html lang="en"> 

        <head>

            <link href='https://fonts.googleapis.com/css?family=Jacques Francois Shadow' rel='stylesheet'>
            <link rel="stylesheet" type="text/css" href="css/style.css">
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <meta charset="utf-8">
                    <title>Crafty Photography | Home</title>    
        </head>

    <body>

        <header id="header_main">
            <h1>Crafty Photography | Home</h1>
        </header>

        <nav>
            <ul>
                <li><a href="contact.html">Contact</a></li>
                <li><a href="services.html">Services</a></li>
                <li><a href="gallery.html">Gallery</a></li>
                <li><a href="about.html">About</a></li>
                <li><a class="active" href="home.html">Home</a></li>
            </ul>
        </nav>

        <div id="top_side"></div>

        <div id="middle_head"> 
            <h2>Welcome to Crafty Photography</h2>
        </div> 

        <div id="left_side"> 
            <h2 id="header_1">Anyone is welcome here!</h2> 
            <p>Here at Crafty Photography we love to just take pictures. It can be just 
            of you in a beautiful scene. Or it can be of your family. We will do cater the 
            session to your specifications. Nothing is impossible. So have a look around and 
            see what takes your fancy!</p>
        </div>


        <div id="right_side"> 
            <h2 id="header_2"> We love to take your photo!</h2> 
            <p> Here at Crafty Photography we love to just take pictures. It can be just 
            of you in a beautiful scene. Or it can be of your family. We will do cater the 
            session to your specifications. Nothing is impossible. So have a look around and 
            see what takes your fancy! </p>
        </div>

        <img id="img_1" src="images/img_woman.jpg" alt="Womam with Camera">

        <footer>
            <p>Crafty Photography Copyright 2020</p> 
        </footer>

    </body>

    </html>

<!-- end snippet -->



Connect Shopify store page to your subdomain

How to connect a specific page of your Shopify store page to your domain?

Important, not the shop itself, just a specific path/page. For example:

https://the-landing-test.myshopify.com/blogs/news -> https://journal.landing.com




Can this code works on outlook email content?

Dear,<br/>Elearning提醒您,您有新的评估项目需要参加,详情如下:<br/>项目名称:<a target='_blank' href='http://test-elearning-k8s.djicorp.com/l01oe006R' >testblk22</a><br/>填写时间:2020-03-31 18:04 — 2020-03-31 19:03<br/>请您尽快登陆<a href=https://test-elearning-k8s.djicorp.com/qsm/html/oemIndex.userIndex.do>Elearning评估中心</a>完成评估问卷哦。<br/>

I'm focusing on the hyperlink now ,the first just dont works and on the other way it displays as plaintext




WebRTC vs Zoom SDK

We need to develop MVP of video-conference/chat application. And we chose the Zoom and WebRTC. Does anyone have experience with these two frameworks? And which of them should be preferred in building a fast and reliable solution? Do we need a backend in both cases?




Image.network rotates image

I have the problem, that Image.network shows an Image rotated in the webapp. But if I open the same url in a browser, the orientation is correct.

In my webap

In the browser

Can somebody help me?

My Code:

import 'package:flutter/material.dart';
import 'package:firebase/firebase.dart' as fb;
import 'dart:js' as js;

class NetworkImageError extends StatefulWidget {
  @override
  _NetworkImageErrorState createState() => _NetworkImageErrorState();
}

class _NetworkImageErrorState extends State<NetworkImageError> {
  String DownloadUrl='https://upload.wikimedia.org/wikipedia/commons/a/ad/Placeholder_no_text.svg'; //Placeholder

  GetURL()async{
    var _DownloadURL = await fb
        .storage()
        .refFromURL('gs://myBucket')
        .child('Pb_0000.png')
        .getDownloadURL();
    setState(() {
      DownloadUrl=_DownloadURL.toString();
    });
  }

  @override
  void initState(){
    GetURL();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: GestureDetector(
            onTap: (){
              js.context.callMethod("open", [DownloadUrl]);
            },
            child: Image.network(DownloadUrl)),
      ),
    );
  }
}



.htaccess change wordpress hompage but keep the link

example.com/wp or example.com/wp/

<- This is what homepage link used to be like and I'm trying to keep it this way. But I want the server to serve some static page from another subfolder as a front page (but to keep all the other wp contents at the same places)

My static page (several of them tbh) are stored in root/subf1/

I was able to redirect to the desired subfolder, but the path also shows up in the URL. Is it possible to change example.com/subf1 to example/wp?

Here's my current htaccess. Maybe I need to create another one in a static page folder?

<IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^(www.)?example.com$
      RewriteCond %{REQUEST_URI} !^/subf1/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ /test/page/$1
      RewriteCond %{HTTP_HOST} ^(www.)?example.com$
      RewriteRule ^(/)?$ /subf1/index.html [L] 
 </IfModule>

RedirectMatch "^/wp$" "https://example.com/subf1/"

Thank you a lot for your time




how remeber different languages in web development [closed]

I am learning web development and follow the path like HTML, CSS and then javascript but the problem I am facing is that HTML/CSS is not taking much time to learn but when we dive into javascript it takes a lot of time and when we finally finished javascript, HTML/CSS vanished from our mind... HTML tags, CSS properties feel not learned... I have tried to find a solution but cant be. What is the solution to that?




lundi 30 mars 2020

Pyppeteer. Chromium browser stops loading pages after set period of time

I'm trying to write a program using Pyppeteer and asyncio that would take screenshots of different websites. But every time I ran the program after about 20 seconds an error occured (Runtime Error: Session closed. Most likely the page has been closed"). Later I found out that it is a known bug of pyppeteer and found a patch for it on github:

def patch_pyppeteer():
    import pyppeteer.connection
    original_method = pyppeteer.connection.websockets.client.connect

    def new_method(*args, **kwargs):
        kwargs['ping_interval'] = None
        kwargs['ping_timeout'] = None
        return original_method(*args, **kwargs)

    pyppeteer.connection.websockets.client.connect = new_method
patch_pyppeteer()

However, even though the Error stopped ocurring the browser kept loosing connection with the internet after the same period of time and the page.goto(url) function never returned control. Is there still any way to fix this problem?

Here's a part of my own code:

async def take_screenshot(page, domain, ip_addr, counter, browser):
    url = 'https://' + domain
    fname = 'Screenshots\\'+str(counter) + "_"+domain+'_'+ip_addr + '.png'
    try:
        await page.goto('https://'+domain)
        await page.screenshot({'path':fname})
    except Exception as e:
        print('Error while taking a screenshot')
        print(str(e))
        exit_program(browser)

async def main():
    counter = 0
    domains, black_list, output_file = await open_source_files(sys.argv)
    print('Launching browser')
    browser  = await launch(headless=False)
    page = await browser.newPage()
    while(True):

        domain = await read_domain(domains, browser)
        if (domain == -1):
            break
        print('Getting the amount of pages')
        amount = await get_pages(page, browser, domain)
        print('Reading IP addresses')
        ip_list = await get_ipaddr(domain, page, browser)
        await delete_domain_from_hosts(domain, browser)
        for ip in ip_list:
            print('Flushing DNS cache')
            flush_dns()
            print('Writing in hosts')
            lin = await write_in_hosts(ip, domain, browser)
            hosts_flag = ip
            print('Taking screenshot')
            await take_screenshot(page, domain, ip, counter, browser)
            print('Deleting from hosts')
            await delete_from_hosts(lin, browser)
            hosts_flag = None
            counter+=1
    await browser.close()
    domains.close()
    black_list.close()
    output_file.close()
    exit(0)

patch_pyppeteer()
asyncio.get_event_loop().run_until_complete(main())



How to fix: Uncaught (in promise) Error: Invalid elementID: Length of the string: [1,255]. ASCII characters only. in agora.io SDK

I updated my agora.io SDK from '2.4' to '3.0.2' and the message below appear on console log.

Uncaught (in promise) Error: Invalid elementID: Length of the string: [1,255]. ASCII characters only.
at s (AgoraRTCSDK.min.js:2)
at Object.t.play (AgoraRTCSDK.min.js:8)

Anyone could help me with that?

Thanks a lot




Python urllib.request.urlopen() only return when given 'timeout' parameter, otherwise freeze forever

I'd encountered a strange problem when using urllib.request.urlopen function. When I call the function without given the timeout parameter, it just freeze forever (or really really long time), but once I provide the timeout parameter, eg. timeout = 1, the function just return exactly after the interval of timeout without any problem.

As shown in the gif below. (I was using Ipython prompt)

screen record scene of the problem




How to extract and print the text inside all tags in a table with python

I would like to extract text (number) from inside all tags within a table in python. I am new to coding python so excuse the messiness in my code. Here is my code for this section.

r = requests.get(saurl)
soupsa = BeautifulSoup(r.text, 'html.parser')
cases_table = soupsa.find('table')
for state in cases_table.find_all('tbody'):
rows = state.find_all('tr')
for row in rows:
    numcases = row.find('class="numeric"')
    aunumcases = row.find('td class="numeric"')
    print(aunumcases)

The html table that i am trying to scrape looks like this.

<tbody>
      <tr>
        <th>
          Location
        </th>
        <th class="text--align-right">
          Confirmed cases*            </th>
      </tr>
      <tr>
        <td>
            <p>Australian Capital Territory</p>
        </td>
        <td class="numeric">
            <p><span>78</span></p>
        </td>
      </tr>
      <tr>
        <td>
          <p>New South Wales</p>
        </td>
        <td class="numeric">
          2,032            </td>
      </tr>
      <tr>
        <td>
          <p>Northern Territory</p>
        </td>
        <td class="numeric">
            14            </td>
      </tr>
      <tr>
        <td>
          <p>Queensland</p>
        </td>
        <td class="numeric">
          689            </td>
      </tr>
      <tr>
        <td>
          <p>South Australia</p>
        </td>
        <td class="numeric">
          305            </td>
      </tr>
      <tr>
        <td>
          <p>Tasmania</p>
        </td>
        <td class="numeric">
          65            </td>
      </tr>
      <tr>
        <td>
          <p>Victoria</p>
        </td>
        <td class="numeric">
          821            </td>
      </tr>
      <tr>
        <td>
          <p>Western Australia</p>
        </td>
        <td class="numeric">
          355            </td>
      </tr>
      <tr>
        <td>
          <p><strong>Total**</strong></p>
        </td>
        <td class="numeric">
          <strong>4,359</strong>
        </td>
      </tr>
    </tbody>

The problem is when i run the code and print 'aunumcases' it returns 'none'. Any help would be really apriciated!




How to stop overlapping text in html/css?

When I minimize my window my text overlaps onto another section of my website. How do I stop that? I'm also not that great at coding.

This is an image of my screen/window

Is ther also a way to format the sides of my text paragraphs?

Download my code here.




Build a webpage similar to dropbox-debug or fastly-debug

Does anyone know how would one develop webpage similar to dropbox-debug.com or fastly-debug.com?

I know most of the information can be retrieved via Javascript but information like PoP latency needs some server side implementation I guess.




How to move marker along routing path?

I want to move marker along curved path.I do receive LatLong every minute. for example A, B are received LatLong locations. I need right way to make it happen. I could move using leaflet.animateMarker

but it moves from A point to B which is bad when the path is curved. curved path. Please advise if you have any idea about how to move the marker along curved path? thanks in advance!




Using JS to make a text file and store it on the web

I am working on a basic social media platform. I want to be able to type in a title and body for a post, then save it as a .txt file on the web, using JS. I never used JS before. Does anybody know how to do this?

GitHub Link




Pull data from a website to some kind of file

I have a solar system that has a hub that will track what the panels are putting out. The hub has a web interface. I also have a server that I use as a media center. It's running Ubuntu server 16.??.

I've found several things to pull this data via a desktop, but I know it should be simple to do with the server, since it's running all the time.

What I'm thinking is something that checks the page every hour then plots it to a file I can open in excel or something simple like that.

I might not know enough to ask the question properly. Let me know what you would need to know. Help me help you... um help me.

Thank you for at least reading this.




How to insert into one-to-many relationship in MySQL using PHP form?

I want to add more than one student to a specific department (in my case I chose software engineering department, id = 1)

The "stage" must also be chosen for each student.

My SQL tables:

students                             departments                         stages
==================                ==================                ================              
id_student(PK)                        id_dep(PK)                      id_stage(PK)
student_name                       department_name                    stage_number
student_lname
student_mail
student_phone
student_user
student_pass
student_inreg_date
id_dep(FK)
id_stage(FK)

And the HTML FORM:

<form action="add_student.php" method="POST">
   <div class="form-row">
      <div class="form-group col-md-6">
         <label for="inputName">Name</label>
         <input type="text" class="form-control" name="std_name">
      </div>
      <div class="form-group col-md-6">
         <label for="inputLname">Last Name</label>
         <input type="text" class="form-control" name="std_lname">
      </div>
   </div>
   <div class="form-row">
      <div class="form-group col-md-6">
         <label for="inputDepartment">Department</label>
         <input type="text" class="form-control" name="department" value="Software engineering" readonly>
      </div>
      <div class="form-group col-md-6">
         <label for="inputStage">Stage</label>
         <select class="custom-select mr-sm-2" id="inlineFormCustomSelect" name="std_stage">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
         </select>
      </div>
   </div>
   <div class="form-row">
      <div class="form-group col-md-6">
         <label for="inputEmail">E-mail</label>
         <input type="email" class="form-control" name="std_email">
      </div>
      <div class="form-group col-md-6">
         <label for="inputPhone">Phone Nr.</label>
         <input type="tel" class="form-control" name="std_phone">
      </div>
   </div>
   <div class="form-row">
      <div class="form-group col-md-6">
         <label for="inputUser">Username</label>
         <input type="text" class="form-control" name="std_user">
      </div>
      <div class="form-group col-md-6">
         <label for="inputPassword">Password</label>
         <input type="password" id="password" class="form-control" name="std_pass">
         <input type="checkbox" onclick="myFunction()">Show Password
      </div>
   </div>
   <button type="submit" class="btn btn-primary" name="submit">Add</button>
</form> 

How must be the PHP code to insert into these tables?




Not using user = models.OneToOneField(User,on_delete=models.CASCADE)

I am creating the registration,login, logout which requires only email and password. When I use user = models.OneToOneField(User,on_delete=models.CASCADE) it gives me an error because it requires username too. How can I take only email and password from User and save it to user?




Apache Ubuntu 18.04 http and www issue

I want to open my site as https://ananasma.com for all redirects... My site is not opening at all for 4 of the redirects. Really need some help...

ananasma.com (not working)
www.ananasma.com (not working)
http://ananasma.com (not working)
http://www.ananasma.com (not working)
https://ananasma.com
https://www.ananasma.com

I have following code in .htaccess file and 000-default.conf file. Please help.

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^ananasma.com$
RewriteRule ^(.
)$ https://ananasma.com/$1 [L,R=301]

Site is working with https but its not opening with http and www.ananasma.com or ananasma.com




How do I prevent data duplication for Firebase Realtime Database, Web, JavaScript

This is my database structure for the Users. How can I prevent the "ICNumber"(Identification Number) to be registered more than once? This is my database structure As you can see in the picture, there are 2 same Identification number are registered successfully.

This is the rule in my RealTime Database I tried putting this piece of code but it doesn't seem to work. Is there any way I can do the prevention in my Javascript or any correct way in my Firebase Rule?




Images appear fine when I preview HTML page directly, but appear broken when same page is returned from flask

working on a small project, for which I have an HTML page. For now it is a static page, with everything hard-coded.

When I preview it locally, it appears fine. But when the same page is returned from flask using render_template, the image link appears broken.

Following is the structure of directory:

/
-server.py
--templates/
---org_dashboard.html
---img_avatar.png

Im attaching screenshots as well as code snippets from return function, and the corresponding HTML code.

Python/flask code:

@app.route('/org_dashboard', methods=['GET', 'POST'])
def org_dashboard():
    return render_template('org_dashboard.html')

Corresponding HTML code with image path:

<div class="card-columns">
<div class="card">
      <img src="img_avatar.png" alt="Avatar" style="width:100%">
      <div class="container">
        <h4><b>John Doe</b></h4>
        <p>Architect & Engineer</p>
      </div>
    </div>
</div>

When returned from localhost by flask. Notice the link appears broken: Click here to view image

When viewed directly by opening the HTML file. Image appears fine Click here to view screenshot




How to fix an unexpected end of file error in php source code [duplicate]

I am just creating a login page. On this page when I try to login by entering username and password, it shows me unexpected end of file error. Please, anyone correct what is the mistake in the source code.

I have closed html tags. I have closed PHP and also parenthesis. Still, I am getting same kind of error.

<html>
<body bgcolor="#00CCFF">
<center>
<?php
$email=$_POST[ 'email' ];
$pwd=$_POST[ 'pwd' ];
$sql="select * from tblsocialconnect where email='$email' and password='$pwd'";
$dbserver="localhost";
$dbusername="ff_user";
$dbpassword="123";
$dbname="ff_user";
$dbconn=mysqli_connect($dbserver,$dbusername,$dbpassword);
$db=null;
$db=mysqli_select_db($dbname,$dbconn);
$resultval=mysqli_query($sql,$dbconn);
if(mysqli_num_rows($resultval)<=0){
?>
<br /><p style="color:red">Invalidusername or password</p><br/>
<a href="socialmediaconnect.php">Click to go back</a>
<?php}
else 
echo"<h1>Authenticated successfully</h1>";
mysqli_close($dbconn);
?>
</center>
</body>
</html>

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\login2\handlelogin.php on line 29




Transitive Peering between TWO VPCs AND a VPN

The configuration I am trying to work with:

Network A (VPC) <-> Network B (On Premise Network) is connected using Site to Site VPN

Network A (VPC) <-> Network C (VPC) is connected using VPC Peering

Is it possible to reach Network B from Network C ?

Refer Image below...

enter image description here




How to customize Firebase auth handler UI

I'm working on a React project and I've implemented authentication using firebase/auth package. For identity provider login I use firebase.auth.GoogleAuthProvider, firebase.auth.FacebookAuthProvider and firebase.auth.OAuthProvider passed into signInWithPopup method

  switch (type) {
    case LoginType.GOOGLE:
      provider = new firebase.auth.GoogleAuthProvider();
      scopes = ['profile', 'email'];
      break;
    case LoginType.FACEBOOK:
     ...    
    }
  }

  for (let scope of scopes) {
    provider.addScope(scope);
  }

  const { user } = await firebaseApp.auth.signInWithPopup(provider);

It works great, but now I need to adjust graphic of auth handler available at https://my-project.firebaseapp.com/__/auth/handler a bit.

The change I need is to replace default material design loader (at the screenshot) with the project loader. Does anybody know or have experiences with how to accomplish that?

Firebase auth handler with default loader screen




after using function in JavaScript external CSS is not working

I use some javascript code and external CSS code. it works correctly until im use to put all js code inside to a functions. now CSS colour is not working properly now. what I need to do?




Test case written for url resolver using resolve() in django application not working

I am trying to write test cases for simple user login and registration system in django. First, I was thinking of writing test cases for the urls. The only test case I have written so far is

from django.test import SimpleTestCase
from django.urls import reverse, resolve, path
from main.views import homepage, register, login_request, logout_request
import json

# Create your tests here.

class TestUrls(SimpleTestCase):

      def test_list_is_resolved(self):
          url = reverse('homepage')
          self.assertEquals(resolve(url).func,homepage)

The default urls.py is

 from django.contrib import admin
 from django.urls import path, include

 urlpatterns = [
      path('tinymce/',include('tinymce.urls')),
      path("",include('main.urls')),
      path('admin/', admin.site.urls),
           ]`

The main application urls.py is

 from django.urls import path
 from . import views

 app_name='main' # here for namespacing the urls

 urlpatterns = [
      path("", views.login_request, name="login"),
      path("homepage/",views.homepage, name="homepage"),
      path("register/", views.register,name="register"),
      path("logout", views.logout_request, name="logout"),
        ]`

Now every time I am running the tests, I am getting the following error.

(myproject) C:\Users\rohan\mysite>py manage.py test
System check identified no issues (0 silenced).
E
======================================================================
ERROR: test_list_is_resolved (main.tests.test_urls.TestUrls)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\rohan\mysite\main\tests\test_urls.py", line 11, in test_list_is_resolved
    url = reverse('homepage')
  File "C:\Users\rohan\Envs\myproject\lib\site-packages\django\urls\base.py", line 87, in reverse
   return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
  File "C:\Users\rohan\Envs\myproject\lib\site-packages\django\urls\resolvers.py", line 677, in 
_reverse_with_prefix
  raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'homepage' not found. 'homepage' is not a valid 
view 
function or pattern name.

----------------------------------------------------------------------
 Ran 1 test in 0.015s

FAILED (errors=1)

I am not being able to find any error. What is wrong here?




Using service workers to both use cache *and* update in background

I understand that ServiceWorkers can grab responses out of cached network requests.

That said, is it possible to have these workers continue to update the cache in the background?

Consider the following scenario: a user logs into an app where they have cached data, and is immediately greeted with "Welcome, <cached_username>!"

Is it be possible for the service worker to continue to make the network request after serving a cache match? The user could've updated their username to new_username on another device, and it would be great to get the UI eventually consistent.

I still want to make network requests, while also utilizing ServiceWorkers for that speedy initial render.




TypeError:'caller', 'callee',and 'arguments' properties may not be accessed on strict mode

my website in code igniter and I'm calling the following service.js from controller

            postCarouselId: function (data) {
             return $http.post(ServiceUrl + '/carousel_id',{
                param:data,
                headers: {'Content-Type': 'application/x-www-form-urlencoded'}
             });
            },

controller:

 CampaignsServices.postCarouselId($scope.myCarouselId).success(function () {
        debugger
        CampaignsServices.getCarouselDetails().success(
            function (data) {
                debugger
                $scope.CarouselDetails = data;
                $scope.loading=false;
            }).error(function (data) {
            console.log(data);
        });
    });

I remove 'use strict'; but still return the same, postCarouselId failed with error below. and getCarouselDetails has been never called

TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.invokeGetter (:1:142) at Object.postCarouselId (http://localhost/palpay-angular/app/js/services.js:957:17) at Constructor. (http://localhost/palpay-angular/app/js/controllers.js:4618:27) at invoke (http://localhost/palpay-angular/app/lib/angular/angular.js:3760:17) at Object.instantiate (http://localhost/palpay-angular/app/lib/angular/angular.js:3771:23) at http://localhost/palpay-angular/app/lib/angular/angular.js:6881:28 at link (http://localhost/palpay-angular/app/lib/angular/angular-route.js:909:26) at nodeLinkFn (http://localhost/palpay-angular/app/lib/angular/angular.js:6309:13) at compositeLinkFn (http://localhost/palpay-angular/app/lib/angular/angular.js:5720:15) at publicLinkFn (http://localhost/palpay-angular/app/lib/angular/angular.js:5625:30)

could any one help please




dimanche 29 mars 2020

How Can I Extract Local Traffic Data From Google Maps To Beat Competitors?

please tell me. Is Google Map Extractor useful and affordable or any other easy method to collect data from Google Maps.




Is there any way to limit an account login with only one device?

I am trying to build an application. That for every OS platforms. Here I am thinking of one account for only one device. I don't know is it possible or not. I tried searching for this. We are not able to get device id for every OS, IP address changes by time and network, Limited access of MAC address in some OS... If there any way to do this, please give me an advice.

Thank you.




Web Bluetooth Api - Why I can't detect mobile bluetooth

I am trying to connect my website to my phone bluetooth but every time I scan bluetooth devices any phone bluetooth is not on the list it means web bluetooth api cant detect phone bluetooth. how can I solve it ?




What is the purpose of _eacs and eacv web cookie?

I have a DNN website, I try to collect all the cookies that my website are using for me to have an information what the specific cookies do. And I found out that there are two cookies that finds me interesting, the _eacs and _eacv. I search on the internet and I can't find a an information about these two cookies. Anyone has an idea what is the purpose of those two cookies?




How to make a Form submit work on mobile?

I have a form:

<form @submit.prevent="login">
  <input
    type="email"
    v-model="email"
    class="form-control"
    name="email"
    placeholder="email"
  />
  <input
    type="password"
    class="form-control"
    name="password"
    v-model="password"
    placeholder="password"
  />
  <button type="submit">Login</button>
</form>

This works perfecly on the desktop browsers, but when trying to use the Login button on mobile devices, nothing seems to happen.

Here is the method login:

login() {
  this.$store
  .dispatch("login", {
    email: this.email,
    password: this.password
  })
  .then(() => {
    this.$router.push("/dashboard");
  })
  .catch(err => {
    console.log(err);
  });
}

If anyone can please help me with this.




I want to publish my React Web App in Apache production server, but when I try the routes doen't work well

I was execute this command:

$ npm run-script build

The initial page works well, but any link with routes (t.i. like "login") doesn't work.

How I can change the script "build" or correct that?

Any light?




What is the best way to create django app for language learning

I currently want to create an app built on Django. I had some experience with this framework a year ago but I gave up eventually. And now I want to go back to development. And so I decided to create an app for learning 500 most used words in the English language. I've basically made everything look nice and smooth, but I got stuck in the back-end part.

And I seek advice, how to create an interactive app for the flashcard web app. What libraries are used in the most advanced Django apps(I'm okay with reading a lot of material), how to authorize with google accounts, how to collect data from users and know the statistics of the app.

I've read the documentation, watched a lot of tutorials, but they basically teach the low skill stuff and nothing else.

My question is if you were to create an advanced Django app for memorizing 500 frequently used words in the English language, what would you use?. How would you do it?. In what order?




How to open pywebview inside kivy application?

I want to open the google webpage inside kivy application, without creating a new window. How can i do this? So far, the code creates a new window for the google page, i haven't managed to display it inside the first page... I am using pywebview to open the web page. I have this code:

import plotly.graph_objs as go
import webview
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.widget import Widget

Builder.load_file('example.kv')

class Wv(Widget):
    def create_webview(self):
        webview.create_window('Hello world', 'https://www.google.com/')
        webview.start()

    def print_me(self):
        print("PUSH button")
        self.create_webview()


class ServiceApp(App):
    def build(self):
        print('something')
        return Wv()


if __name__ == '__main__':
    ServiceApp().run()

And example.kv:

<Wv>:
    button:button
    Button:
        id:button
        text:"push me"
        on_release:root.print_me()




font for minimize and maxmize buttons in html

I want to write the code of windows calculator in HTML and I need to use font for minimize and maximize buttons. what should I use? I know the font for close that is &#10006;.




Getting commodity prices android

Good morning,

I want to do an android native app using java that can get and display cotation of agricultural commodities like corn, soy and living cattle. The problem is that I've never worked with others database, and I don't know how to do it.

I've already had a lot of research but I've only got confused because people say to not use yahoo finance, then people say to use it. Long story short I don't know exactly how to do it or what api I should use if I should use and I'm needing someone to guide me on how to do it or just specify what I should been searching for.

There's anyone here that could help me?

thanks




Change value of search bar after clicking a anchor

I'm currently working on a website where i'm using a custom search suggestions manager. But I don't know how I can change the value of the first input section after what I click on. Anyone have any ideas?

<form method="POST" class="search-bar header-search-bar">
            <input id="searchTerm" class="search-bar-input header-search-bar-input" type="text" placeholder="What are you looking for?" autocomplete="off">
            <input class="search-bar-btn header-search-bar-btn" type="submit" value="Search"></input>
            <div id="header-search-bar-suggestions-placeholder"></div>
            <ul id="quickipedia_output"></ul>
            <script>
                var yb = { id : function(str){return document.getElementById(str)} };

                var tag = '';

                yb.id('searchTerm').onkeyup = function(e){
                    if(!e.keyCode.toString().match(/^(37|38|39|40|13|16|17|18|224)$/)){
                        if(tag!==''){ document.body.removeChild(tag); }

                        tag = document.createElement('script');
                        var term = yb.id('searchTerm').value;

                        tag.src = 'http://en.wikipedia.org/w/api.php?action=opensearch&limit=10&format=json&callback=yaComplete&search='+term;
                        document.body.appendChild(tag);

                        var div = document.getElementById('search-bar-suggestions-dynamic-placeholder')
                        if (!document.getElementById('header-search-bar-suggestions-placeholder').contains(div)){
                            yb.id('header-search-bar-suggestions-placeholder').innerHTML += '<div id="search-bar-suggestions-dynamic-placeholder" style="z-index: 9; border-top-left-radius: 4px; border-top-right-radius: 4px; background: white; width: 555px; height: 70px; box-shadow: 0 0.5px 6px 0 rgba(32,33,36,0.28); margin-left: 29.98em; margin-top: -4.4em;"></div>';
                        }
                    }
                    var input = yb.id('searchTerm');
                    setTimeout(function(){ 
                        while(input.value == ''){
                            yb.id('search-bar-suggestions-dynamic-placeholder').remove();
                        }
                    }, 150);
                };

                var yaComplete = function(data){
                    yb.id('quickipedia_output').innerHTML = '';
                    for(var i=0; i<5; i++){
                        if(data[1][i]){
                            // Add classes and id's to the p, b, and a elements to style them
                            yb.id('quickipedia_output').innerHTML += '<a href="http://en.wikipedia.org/wiki/' + data[1][i] + '" target="_blank"><li><div>' + data[1][i] + '</div></li></a>' + data[2][i];
                        }
                    }
                };
            </script>
        </form>



Overflow-x doesn't scroll over entire width

I'm working on a card game and need to be able to scroll through all cards if the windows width is not wide enough.

HTML:

 <div id="hand">
    <div class="wrapper">
      <div class="card">
        <!-- Cards content -->
      </div>
      <div class="card">
        <!-- Cards content -->
      </div>
      <div class="card">
        <!-- Cards content -->
      </div>
      <!-- Repeat until 20 cards -->
    </div>
 </div>

CSS

    div#hand {
        position: fixed;
        bottom: -200px;
        left: 0;
        width: 100vw;
        height: auto;
        display: flex;
        justify-content: center;
        overflow-x: auto;
        overflow-y: visible;

        >div.wrapper {
            display: flex;
            flex-direction: row;
            margin-left: 200px;
            margin-right: 200px;

            div.card {
                cursor: pointer;
                position: relative;
                width: 230px;
                height: 350px;
                margin: 0;
                border-radius: 3px;
                border-style: dotted;
                border-width: 5px;
                border-color: #fff;
                box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
                margin-top: 60px;
                bottom: 0;
                display: inline-block;

                transition: 0.4s;

                &:not(:first-child) {
                    margin-left: -160px;
                }

                &:hover:not(:last-child) {
                    margin-right: 160px;
                }

                &:hover {
                    bottom: 60px;
                }
            }
        }
    }

This results in the following being rendered: Cards being rendered

That's cool and all but the issue comes when I make the browser width smaller: Cards not being rendered correctly

I'm currently scrolled all the way to the left but notice how the card with number one on the first picture is not visible. If I scroll to the right the last card is being shown without an issue: Cards on the right looking fine

Is there a way that the scrollbar actually scrolls through every card? I tried adding a margin to left and right or adding a padding to the parent div but nothing seems to work :c

Thanks for your help in advance ^^




how to set a time for other tags that contains a dynamic jquery fade

i wrote a fadeToggle() for an input in a div tag so the height of div tag will change with fading content. i can set timing for input but for div tag that has input in it, simply i can't do anything to set a timing for being match with fading input




How to Upgrade to the latest version of Django

The current version of python which is currently running in my system is 3.7.4 while the django is 1.11 due to which i recieve alots of errors , can someone explain how to Upgrade Django to the Latest version ??




What is the error in a below written php source code for drop down list of date of birth?

I am trying create login web page.This is the code written to display drop down list for date of birth.But I am not getting day and year in the drop down list.If i write all the 31 days then I will get days.But it is not working for for loop in php. Please guide me in this.

 <select class="biginput" name ="day">
    <option> Day </option>
    <?php for($i=1;$i<=31;$i++)
          {
              echo "<option value=$i>$i</option>";
          }
    ?>
</select>
<select class="biginput" name="year">
    <option>Year</option>
    <?php for($i=date("Y");$i>=date("Y")-90;$i--)
              echo"<option value=$i>$i</option>";
    ?>
</select>

Output: I am getting only blank list instead of days and year. Output




CK Editor doesn't send data to Firebase Database(Empty Fields)

Hello all, I have created a Web Form to upload data(Rich Text) to Firebase Database,

But sometimes data is entered to Database and other Times the Fields in the Database is completely Empty. Can Anyone suggest me the solution as I am new to Web Dev.

Here is my WebForm Code (Rich Text is only in Description):

Image desc here

  <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Firebase</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
    <div class="row">
        <div class="container">
            <h2>Job Adder</h2>
            <div class="alert alert-success success-message" style="display:none;">Form submitted successfully.</div>
            <form id="contactForm">

                <div class="form-group">
                    <label for="exampleFullName">Enter Date :</label>
                    <input type="text" class="form-control fullname" id="exampleFullName" placeholder="Enter Date here" required>
                </div>

                 <div class="form-group">
                    <label for="post">Enter Post :</label>
                    <input type="text" class="form-control post" id="post" placeholder="Enter Job Post here" required>
                </div>


                <div class="form-group">
                    <label for="exampleEmail">Title :</label>
                    <input type="text" class="form-control email" id="exampleEmail" placeholder="Enter Title here" required>
                </div>


                <div class="form-group">
                 <script src="ckeditor/ckeditor.js" type="text/javascript"></script>
                    <label for="exampleSubject">Description :</label>


                    <textarea type="text" class="ckeditor" id="exampleSubject" placeholder="Enter description here" cols="0" rows="10" required>
                      </textarea>
                </div>

                <div class="form-group">
                    <label for="salary">Salary :</label>
                    <input type = "text" class="form-control salary" id="salary" placeholder="Enter salary here"  required>
                </div>






                <div class="form-group">
                    <label for="exampleMessage">Apply here:</label>
                    <input type = "text" class="form-control message" id="exampleMessage" placeholder="Enter direct link here"  required>
                </div>
                <button type="submit" class="btn btn-primary">Submit</button>
            </form>
        </div>  
    </div>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    <script src="https://www.gstatic.com/firebasejs/7.6.1/firebase-app.js"></script>
    <script src="https://www.gstatic.com/firebasejs/7.6.1/firebase-database.js"></script>
    <script src="js/main.js"></script>
</body>
</html>

Here is my Javascript code :

     var firebaseConfig = {
    apiKey: "AIzaoYRpaXDGoM",
    authDomain: "web-adder.firebaseapp.com",
    databaseURL: "https://web-adder.firebaseio.com",
    projectId: "web-adder",
    storageBucket: "web-adder.appspot.com",
    messagingSenderId: "1049",
    appId: "1:1066659099549:web:2162a723574",
    measurementId: "G-4PFY"
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);


 // Reference messages collection
var messagesRef = firebase.database().ref('WebView Test');

// .child("Categories").child("Academic Jobs");

$('#contactForm').submit(function(e) {
    e.preventDefault();

    var newMessageRef = messagesRef.push();
    newMessageRef.set({
        date: $('.fullname').val(),
        post: $('.post').val(),
        title: $('.email').val(),
        description: $('.ckeditor').val(),
        salary: $('.salary').val(),
        link: $('.message').val()
    });

    $('.success-message').show();

    $('#contactForm')[0].reset();


// CKEDITOR.instances.msg.setData('');

    window.location.reload();
});



How do I get rid of this line in Atom?

https://i.stack.imgur.com/QwxcA.png

I don't know how to remove this line. It gets in the way of my text. I've looked in settings to see if there was an option to turn it off but I didn't find it.




how to make a div boarder point outwards

this is a common pattern I have seen in messaging apps, can you suggest me how to achieve this top corner edge pointing outward, in CSS and HTML if possible.enter image description here




How to fix "if statements" in "return part" of class component in React Js?

I am new to react. I want to return components on the basis of multiple conditions. But in this code in return section if statements are not working and I'm getting error. How can I fix that?

    render() {
        console.log(this.state.filterField);
        const filteredXpGreater = this.state.peoples.filter(person => {
            return person.randomXp > 3;
        })
        const filteredXpLess = this.state.peoples.filter(person => {
            return person.randomXp <= 3;
        })
        return (
            if (this.state.filterField.includes("Above 3 Years of Experience")) {
                <div className='App'>
                <Filter radioSelected1={this.onRadioSelected1} radioSelected2={this.onRadioSelected2} checkedMale={this.onCheckedMale} checkedFemale={this.onCheckedFemale} />
                <Cardlist data={filteredXpGreater} />
            </div>
            } else if (this.state.filterField.includes("Above 3 Years of Experience") {
                <div className='App'>
                <Filter radioSelected1={this.onRadioSelected1} radioSelected2={this.onRadioSelected2} checkedMale={this.onCheckedMale} checkedFemale={this.onCheckedFemale} />
                <Cardlist data={filteredXpLess} />
            </div>
            } else {
                <div className='App'>
                <Filter radioSelected1={this.onRadioSelected1} radioSelected2={this.onRadioSelected2} checkedMale={this.onCheckedMale} checkedFemale={this.onCheckedFemale} />
                <Cardlist data={this.state.peoples} />
            }
        )
    }
}



4 years of web development experience but not employable, what to do? [closed]

I have 4 years of web development experience, working on my own 4-6 hours a day Mon - Fri. I was doing well just with advertisment boards, but recently it's not that easy anymore so I started looking for a normal job. I discovered that I do not fit the perfect profile even as a Junior web developer.

Here's the issue. I specialize in wordpress, I've developed more than hundred websites. Small websites, online stores, booking sites. I can do almost anything a client wants. I know a vast amount of plugins for almost any ocassion. I can do all of that very fast and with a decent design. My websites are mobile friendly etc. They meet all the requirements.

My aim was to deliver what client wanted, I've never learnt anything not task related. Because of that I'm very efficient. I know CSS very well, but jQuery and back end languagues only to the degree that tasks I've had required me to do so. I do not write things from the scratch, I only modify modules to meet client requirements.

If were a CEO of a company, I would consider a person like me as a huge asset to the company, delivering what's required quickly and efficiently and knowing about many things related to the job. But employers I've met so far don't think that way. They want candidates to do coding tests which of course I can not do well and require coding knowledge even if it's not task related. I wonder for what? Most clients want just simple websites.

Am I wrong and it's just employers I've met so far? Is it easy to find a job as a web developer? If not, what should I learn now to become employable as quickly as possible? What else should I do?




samedi 28 mars 2020

How can I write TCP queries on my server? What I have written wrong?

I need to send TCP queries on my server (I want to make capability multiple connections, later), but my server don't receive anything and I haven't got any error. Server should receive every message of client. Anybody shouldn't disconnect ever. Client should have capability to send second message after first without reconnection.

server.php

<?php

$address = 'localhost';
$port = 10000;

set_time_limit(0);

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket\n");
socket_bind($socket, $address, $port) or die("Could not bind to socket\n");
socket_listen($socket, 3) or die("Could not set up socket listener\n");

$clients = [];

while (true) {
    $newSocket = socket_accept($socket) or die("Could not accept incoming connection\n");
    if (is_resource($newSocket)) {
        //socket_set_nonblock($newSocket);
        echo "New client connected\n";
        $clients[] = $newSocket;
        socket_read($newSocket, 1024, PHP_NORMAL_READ) or die("Could not read input\n");
        sleep(1);
    }
}

client.php

<?php

$address = 'localhost';
$port = 10000;

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket\n");
socket_connect($socket, $address, $port) or die("Could not connect to server\n");

while (true) {
    $input = readline();
    $input .="\n";
    socket_write($socket, $input, strlen($input)) or die("Could not send data to server\n");
    sleep(1);
}



Selenium does not react on alert

Chrome version: 80.0.3987.149 Selenium version: 3.141.0

The idea behind program is to open new window with video, collect information from confirmation box (automatically appears when window is opened) and accept the confirmation. Problem is that program hangs when new window appears.

try:
    browser.find_element_by_xpath("//*[contains(text(), 'VOD')]").click()
except NoSuchElementException:
    continue

main_handle = browser.current_window_handle

for handle in browser.window_handles:
    if handle != main_handle:
        browser.switch_to.window(handle)
        print('I switched to: %s' % (browser.current_window_handle)) # this line is not printed

try:
    WebDriverWait(browser, 3).until(EC.alert_is_present())
    alert = browser.switch_to.alert
    alert_text = alert.text
    alert.accept()
except Exception as e:
    print('Exception: ', e)



django.core.exceptions.FieldError: Cannot resolve keyword 'ModelList' into field. Choices are: borrows, dept_list, dept_list_id, email_ads is

  1. question

i am a beginner of Djanog, i am experiencing a problem of django.core.exceptions.FieldError: Cannot resolve keyword 'ModelList' into field. Choices are: borrows, dept_list, dept_list_id,.....

sometime it shows django.core.exceptions.FieldError: Cannot resolve keyword 'PcStatus_id' into field

  1. i have try to remove the files on migrations folder excuted python manage.py makemigrations and migrate ,and reload nginx, restart uwsgi,

  2. issue will appear again after the server run normally for a moment. the issue is not heppen immediately after the server up, also ,

  3. i have try to rename the field name, but this is not helpful for solving the issue. could you please help chech where is wrong, where does the issue come from ?

    '''python

model.py

 class pc_list(models.Model):
        host_name=models.CharField(max_length=64, unique=True)
        service_tag=models.CharField(max_length=45,unique=True)
        #hosttype_list=models.ForeignKey('hosttype_list', to_field='id',default=1, on_delete=None)
        ModelList=models.ForeignKey('ModelList',to_field='id',on_delete=None)
        host_spec=models.CharField(max_length=45)
        price=models.FloatField(default=0)
        receive_date=models.DateField(auto_now_add =False, default='2018-01-01')
        user_list = models.ForeignKey('user_list', to_field='id',  on_delete=None, default=180)
        seat_no = models.IntegerField(default=14000)
        PcStatus=models.ForeignKey('PcStatus', to_field='id',  on_delete=None, default=2)
        studio = models.CharField(max_length=45, default='-')
        site_list=models.ForeignKey('site_list', to_field='id', on_delete=None)
        asset_code = models.IntegerField(default=1)
        remark=models.TextField(max_length=200, default='-')
        mac=models.CharField(max_length=15, default='-')
        class Meta:
            ordering = ('host_name',)

        def __str__(self):
            return self.host_name


    class PcStatus(models.Model):
        statusname=models.CharField(max_length=45,default='--')
        def __str__(self):
            return self.statusname

    class ModelList(models.Model):
        name = models.CharField(max_length=40)
        hosttype_list = models.ForeignKey('hosttype_list',to_field='id',on_delete=False)

        def __str__(self):
            return self.name
        class Meta:
            ordering = ('name',)

    **view as below**

    class pcDataView(FeedDataView):

        token = pc_listTable.token

        def get_queryset(self):
            siteid = self.request.session.get('current_site')
            hosttypeid=self.request.session.get('hosttype_id')
            if hosttypeid ==0:
                return super(pcDataView, self).get_queryset().filter(site_list_id=siteid , ModelList__hosttype_list_id__in=(1,2,3,12)).exclude(PcStatus_id=4)
            else:
                return super(pcDataView, self).get_queryset().exclude(PcStatus_id=4).filter(Q(site_list_id=siteid)&Q(ModelList__hosttype_list_id=hosttypeid))

'''




Why we use "p1Index = -1" and "len=p1.parentNode.childNodes.length"?Please tell me wheater "p1.parentNode.childNodes" point to same thing?

<!DOCTYPE html>
<html>
    <head>
        <title>DOM Range Example</title>
        <script type="text/javascript">
            function useRanges() {
                var range1 = document.createRange(),
                    range2 = document.createRange(),
                    p1 = document.getElementById("p1"),                
                    p1Index = -1,
                    i, len;

                for (i=0, len=p1.parentNode.childNodes.length; i < len; i++) {
                    if (p1.parentNode.childNodes[i] == p1) {
                        p1Index = i;
                       break;
                    }
                }

'

I find it in the javascript for web developer

here we can see p1Index = -1,why we don't use p1Index=0 ? '




Problems uploading php blog factory niche wordpress blog website w/ importbuddy

I have a php site blog I had built and I wanted to know generally how to upload it to godaddy hosting?? But this is the situation: It came with instructions. I followed the instructions and still can't seem to get site to work? The blog has word press theme and wp files. I followed this website instructions. https://www.youtube.com/watch?v=pIZPLFZ4QkI The only thing I could figure I was doing wrong was Data base info was not up to date on the wp-config.php file so I changed it and still it is not working? What am I doing wrong and is there another way to upload it to godaddy hosting? enter image description here




How to disconnect React and Redux from it's `devtools` in production?

As its name suggests devtools should be visible or accessible only during development and not in production. I don't want my end users playing with the Redux and React state and dispatcher or seeing what's going on under the hood.

Is there a way to hide Redux and React Devtools or disconnect it in the production build?

Edit 1: Extended the question for React as well




Create a website that displays the heart rate in a graph from Apple Watch, FitBit etc. How do I do this?

The title pretty much says it all. I wanted to create a website that involves taking data from a fitbit/Apple watch or any device that records heart rate automatically and analyses and displays it. How would I be able to do this, which API should I use? Which device is best?




Hii can anyone tell me what are multi-service access technologies?

Hello can you direct me what are multi-service access technologies and something in general about them.

I have to write a paper on this subject so if anyone here can help me what to pay attention to




Flutter web firebase storage from iphone

I followed this tutorial for firebase storage for flutter web: https://dev.to/happyharis/flutter-web-firebase-storage-2ac1

But I have 2 questions: 1) the upload does work from an android browser but not from iPhone. Do you know why? 2) the images, that I upload from android are rotated in firebase. Do you know why?

Thanks!




Host the SSL on different server than the website web hosting

I want to use CERTBOT on my web hosting server "Hostinger" but they don't allow me to, they want me to pay for the free ssl !, and I used to use CERTBOT on my VPS, and I am thinking if there is a way to use my VPS to host the SSLs and the webhosting to host the websites!, is that possible ?




I can't understand the htaccess issue. Can you solve the problem on my website? [duplicate]

Link view of my website before applying htaccess http://www.x.net/mag/haberler.php?id=11

I want it to look like this: http://www.x.net/mag/haberler/what-is-the-matrix

This section is the news page of the website. News should appear with a news name, not an id. The information about the table in the database are as follows. Table name: haberler id,haber_baslik (news_name) etc.




How can I use cypress to assert that an image is the correct one?

I'm trying to test a case where a user can insert a URL for their profile and want to make sure that the right image is loaded up. Is there a way where I can assert that the picture's href is the right one? Thanks in advance!




Manage web server with several APIs

I want to do a web page with several endpoints, each endpoint correspond to a full functional API with front and back (its own requests).

My porpoise is have a main web server that redirects you to the other APIs but with login security, meaning that once you try to go to an endpoint if you are not logged in it will redirect you to a login endpoint where is an API in charge of generate a token. Also all the APIs should not being accessible without go through the main web server.

Until now i have done it with Tornado Python for the main server using get_secure_cookie and set_secure_cookie for the security handle the token from the login API, also everything is in kubernetes for control what is expose to the outside and what doesn't.

For redirect to the API i create a specific handler for each api redirecting all their endpoints, but this generate a problem with css files, since, if this is my handler:

import requests
import tornado.web

class api1handler(tornado.web.RequestHandler)
    def get(self, key):
        r = requests.get("http://path_to_kubernete_service:port/key")
        self.write(r.text)

When the API's front request the css file it doesn't charge because tornado reads it as plain text.

Also some API's have complex requests with several post and get endpoints

My questions are:

How to handle css files problem or how to handle them in my context Is there any form for handle correctly redirection of requests.

Apart from all this, is my approach correct and/or optimal? A better approach? I am open to all kind of advices.




What is the real difference between a class and an id in HTML? [duplicate]

I studied that in Web Dev class is used to style multiple elements while id is used to style only one element while when I assign same id to multiple elements all those elements were styled.

So what is the real use of id when we can use class for the same work ?

Does id have any significance ?




My heroku website looks empty and no html files are rendering

I was trying to deploy my django website to heroku. Basically I have done everything step by step and no errors in deploying as well. But there is nothing in my webpage just a side panel is showing nothing else. No navigation bars, no buttons, no html renderings ... nothing. But when I viewed the source code the html codes are there. I can access different urls as well but nothing renders in the webpage its weird really. The website works perfectly in localhost but not in heroku. I need a fix for this, thanks. Here is how the webpage looks right now, enter image description here




Live video streaming web site

I 've been asked to develop a web site(application) to stream live videos that only authorized users can see these live streams. I have no idea which technologies to use to build this live video stream, can someone suggest any good services for this or technologies I have to use. Big help




What to learn to work with backend? I can't find some good infornation that can help me with this question

I need an advice for my problem: i don't know what to learn to work with back-end. Should i learn asp.net or some node? I know nothing about back-end, but i want to start working with it.




Choosing the proper languages/frameworks/tools based on countries?

It's obvious that programming languages, web frameworks can be ranked based on some facts, such as, year, country, or type of position(back-end, front-end, data science etc). What I want to know is that how can I know the right and marketable programming languages/frameworks/tools based on South Korean market? In other words, how I can get a job very quickly having (Java/Python/JavaScript) or something in South Korea?

Thanks in advance!




How Can I Change size of the circles?

I saw a code and i was trying to modify the size of the circles, but i don't know whither i can change it using js or css .Is there any way to change it ?

The full code is from: https://codepen.io/XTn-25/pen/NWqeBaz

hesr is js code:

/**
 * index.js
 * - All our useful JS goes here, awesome!
 Maruf-Al Bashir Reza
 */

console.log("JavaScript is amazing!");
$(document).ready(function($) {
  function animateElements() {
    $('.progressbar').each(function() {
      var elementPos = $(this).offset().top;
      var topOfWindow = $(window).scrollTop();
      var percent = $(this).find('.circle').attr('data-percent');
      var percentage = parseInt(percent, 10) / parseInt(100, 10);
      var animate = $(this).data('animate');
      if (elementPos < topOfWindow + $(window).height() - 30 && !animate) {
        $(this).data('animate', true);
        $(this).find('.circle').circleProgress({
          startAngle: -Math.PI / 2,
          value: percent / 100,
          thickness: 14,
          fill: {
            color: '#1B58B8'
          }
        }).on('circle-animation-progress', function(event, progress, stepValue) {
          $(this).find('div').text((stepValue * 100).toFixed(1) + "%");
        }).stop();
      }
    });
  }

  // Show animated elements
  animateElements();
  $(window).scroll(animateElements);
});



Course Search: can you tell me the name of the course that i need to follow in order to satisfy my requirement mentioned below

How do I approach a problem? for example: I want to develop a simple ticketing system website, very basic/ no complex or advanced feature.

Case study:

Requirement -- e.g simple ticketing system website using the MVC architecture.

Question:

How do I know my starting point? e.g what to create first: controller, views or database ?

How do I break the development into different components/tasks (the different categories) e.g what are the model i have to create, how many viewModel etc

How do I know what task to do next - e.g the order of the task. in what order to develop the app

In other word, I want to create a virtual schema of the whole system before implementing it.

can you tell me the name of the course that i need to follow in order to satisfy my requirement mentioned above.




How client server and deployed Java code connects each other?

Generally we learnt through http connection client server connection happens,my q is we deploy .class files in server say tomcat,do tomcat understands .class files? As I learnt .class files are byte code understood by jvm means as per my understanding everything(protocal-webserver-javacode )first converts to binary code and then communicates with each other,correct me if I'm wronge if so then please explain me in details and links to read more on it?




Is there a chrome API that gives me the status code of the website

If I go to the website, it either gives me the website or "This site cannot be reached". I wanna know the same thing in my chrome extension whether the site can be reached or not. How do I do this. Is there a chrome API I can use for the aforesaid task.




How to read an json files input, when the identifier contains a number [duplicate]

Hey I develope a php site where I read data from a weather api. The rain property of the json file is called 3h, so my script always throws an error:

$WeatherDataAPI is my decoded json object.

$valuesToday[$i]["rain"] = (float)$WeatherDataAPI->list[$i]->rain->3h;

and also the snow property

$valuesToday[$i]["snow"] = (float)$WeatherDataAPI->list[$i]->snow->5h;

Now when I write it like this Visual studio says: unexpected T_LNUMBER, expected T_STRING or T_VARIABLE

What should I do?




How to get google login API?

Hey can anyone help me get the google login api correctly for my website? i tried getting directly from here (https://developers.google.com/identity/sign-in/web/sign-in). After hitting the configure a project button and completing the steps i got client ID and client secret. I kept that the ids to my php theme and it didn't worked. I also tried clearing cache memory of my browser and the error is: here




vendredi 27 mars 2020

Runserver python django error when using python manage.py runserver

i am using Django/python as a framework , when i started to open my server on cmd by using code python manage.py runserver, this bug happened.

enter image description here