vendredi 31 août 2018

Laravel Undefined Variable in View from database

i tried to show some data from database to my view. But i get undefined variable error.

Route::get('pages/tab-content-games', 'Admin\TournamentCrudController@get_data');

and this is my function

public function get_data(){
    $data['data'] = \DB::table('tournament')->get();
    return view('pages.tab-content-games', ['data' => $data]);
}

in tab-content-games.blade.php i just print the variable



can someone helped me, what part i'm doing wrong. thankyou




Scraping data from a table or list?

I want to scrap table data from this website

https://escapehunt.com/uk/birmingham/booking

i am trying this code, please help me.

<?php

include('simple_html_dom.php');

$html = file_get_html('https://escapehunt.com/uk/birmingham/booking');

foreach($html->find('td[class="cbgridfirst"]') as $element){
echo $element->innertext . '<br>'; 

} 
?>




How to disconnect session in opentok?

I am using opentok for web and my issue is how to disconnect from current session. I wanna know the steps in detail.

Thank you.




redirecting urls of a certain pattern to another site

I have a website. The root directory of my site in cpanel was like this: www.example.com/b. But, I have changed my root directory to www.example.com/s. Now I want to redirect every url of the pattern like www.example.com/b, www/example.com/b/c/text/php etc. to this url: www.example.com/s. Is there any way to do this in cpanel?




how can i make control panel for a website to change (texts,etc..)?

i wonder how can i make a control panel for a website

cause the costumer want to change the photo's and text's without need to talk with a programmer to change it, so i want to make control panel so he can change it easy

Notes: *sorry for my bad english *i don't know if it's called control panel or something else




building private physical Database server

am a sysadmin, but haven't worked on a large project befoer and am trying to build a large, scalabe and secure database server for a medium-sized enterprise. whats the most preferable server and database to use?




OWL ontologies on the cloud

My goal is to make a web application that imports an owl ontology that we created in e.g. protege that represents a learning domain e.g. "Math".

The admin of the web app will then create lessons/learning targets using a subset of that ontology (for example "multiplication of 2 integer numbers").

What tools will allow me to create a sub-ontology of the imported one and perhaps edit it, create individuals etc. on the web? I will need this sub-ontology to be downloadable. Is there a java jena alternative for the web? perhaps a php library?

Thanks in advance




Can I run commands, get/edit files on a UNIX server from a web page without a web service?

I am trying to connect to a unix server be able to edit/fetch a yaml file and also be able to run bash scripts on the server. I want to be able to do this from a web page, am I able to do this using javascript or php or do I need a web service to perform these actions?




Spring security auto authorization for a given IP

Is it possible in the Spring Security to (well it is Java, of course possible, so quesiton is - is it possible in some relatively painless way) automatically authorize all requests from local host (OK, some given IP) as a request that belongs to a given test user.

For instance in some filter - take all requests, check IP and if it comes from local host say something like spring.authorizeAs("user")




How to process on OutputStream revceived from a download API before return to client

After I called api InputStream downloadFiles(FileIDListPojo var1, String var2, String var3), I want to do some more actions before write the inputStream into servletOutputStream and return to client.

Basically I will send several requests, and combine them together into one response and return to client. You may wonder why I don't sent requests together, it's because I want to put each response stream into a folder (or zip) first then put the folders into one returned ZipOutputStream.

What I currently did is loop the procedures below for all requests.

  1. prepare a temp ByteArrayOutputStream tempOs = new ByteArrayOutputStream();

  2. add a zip folder to tempOs ZipOutputStream zipStream = new ZipOutputStream(tempOs);
    zipStream.putNextEntry(new ZipEntry("folder name.zip"));

  3. get inputStream from hue-drive and write it into tempOs input = hueDriveFileClient.downloadFiles(fileIDListPojo, sessionToken, encoding); IOUtils.copy(input, tempOs);
  4. write tempOs to response stream response.getOutputStream().write(tempOs.toByteArray());

Unfortunately I cannot get the correct zip file, it seems that files are not put into a folder, but written into one... So I want to ask if you can have a look and give some advice?




jeudi 30 août 2018

screen sharing with twilio without extension

In my web applicatio i need functionality to share screen in video call. i'm using twilio and my video call functionality is working fine. i have seen link from twilio to share screen. (https://www.twilio.com/blog/2018/01/screen-sharing-twilio-video.html) but i need to develop chrome extension for screen sharing in chrome. is there any way by which i can develop screen sharing without extension ?




Passing data to server from web javascript and perform delete operation

I am new to http triggers. I am developing an admin website using firestore. Now what I want is, if the admin wants to delete a user from firebase authentication by using below code.

admin.auth().deleteUser(uid)
  .then(function() {
    console.log("Successfully deleted user");
  })
  .catch(function(error) {
    console.log("Error deleting user:", error);
  });

For that we need admin. we can get the admin by below line. We have to write those above codes in Node.js(functions).

const admin = require('firebase-admin');

Now my html page design is, I have a button in html page. When I press that button I can get the related user uid. Now my problem is how to send that uid to server(node.js) and perform delete action. I have no idea on this.




Screen sharing from mobile device to web portal

I want to share an android mobile device screen to the web portal. Is there any library for both sides (android and web)? I have searched alot but did not find any answer.




Python, Web Scraping avoid security of web page

I am doing my first steps in web scraping. Come across such issue: Want to scrape data from ticketmaster.com But it seems that security system is recognize me. I have tryed to ue proxy servers, fake-useragents. I want to click on button1 and go To page2, click button2 go to page3, etc.

Thanks in advance




Slate: push to database and show in web

Could anyone help me about push the content of editor using slatejs to database and get that content to show in website? Thank you so much




What is the most efficient system for System Users with Plesk Webspaces

I am attempting to start a web hosting business, and I am using the Plesk API to create the subscription, but I am wondering what the optimal method to creating system users is. Do I just use random strings for the username and password?enter image description here




Is there any recommend (or fast) python web server framework

I currently building an online judge system. I use django and django-rest to build to restful api backend, and use it to handle submission CRUD something like that.

After the django received a submission, it will pass it to Celery, and in the Celery task, it will make a request to my judge server.

And my problem is which python web framework should I choose to implement this judge server.

<client> → <django rest> → <Celery> → <!!! judge server !!!> → <judger sandbox>

Because I have a sandbox library which can be import in python like this

import _judger
_judger.run( bash command or something like that here )

And it will be multiprocess inside each requeste, because each submission has multiple test case to execute.

And I need a reliable and fast (less overhead on networking) framework to build a server to wrap the sandbox, is there any good suggestion? Thanks a lot.




How to trigger a button automatically that is within an embedded site?

I have a twitter timeline embedded on my site and I want it to automatically scroll to the way bottom of my timeline. Auto scroll is working, but the embedded version of twitter has a "Load More Button" that needs to be activated in order for the timeline to scroll any further down.

Here is what I have tried so far

Some other things I have tried is getting the class name using the google developer tools, but that doesn't seem to work either. I am not sure if I can actually access those because those classes are not directly stated in my HTML file. Currently I am thinking that I need to first get the class name of the embedded timeline, then from there in the same function access the load more button HTML class.

I am open to any suggestions, thank you!




Request header somehow being persisted

I'm working on a site and I noticed that the request headers for a 'get' request is the same on all future refreshes after a login.

I'm not setting any request headers in that get call.

Where is this value stored + can I access it?




Change bootstrap 3 arrow tooltip width

I´m having an issue with Bootstrap 3 tooltip, I want to change the arrow width and height.

I changed the class

.tooltip.right .tooltip-arrow
{
    border-right-color: #8BA6D5;
    border-width: 40px;
}

- Result:

Current

What i want:

enter image description here




about django's list_fields in making models for friends list, in project about making SNS

i'm amateur django student. i'm making web-SNS like instagram. So, i should make models that contains one user's all friends. so i try to use list for containing user's friends. like this photo

enter image description here

yeah, i know i can't use and build list by using that way. how to make use list for save user's friends list? or Is there more good idea for saving user's friends list in user(not User, just real user)'s model?




Fail to receive Set-Cookie in response header

I'm developing an app which makes http request to a server and expects Set-Cookie in the header

Now when I send a HTTP POST request using proxy (like Charles and mitmproxy) to the endpoint I can get Set-Cookie in the response header correctly, but if I turn off the proxy and make request directly, then everything else is same, but the Set-Cookie is missing in the response header.

Request with proxy:

POST /_bm/_data HTTP/1.1
Host: www.wsy-test.com
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Content-Type: text/plain;charset=UTF-8
Cookie: anonymousId=4DD95464BB44EF9BB078C84D1F7BB93E
Origin: https://www.wsy-test.com
Referer: https://www.wsy-test.com/landing/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36

{"request_id":"username"}

Response with proxy:

HTTP/1.1 201 Created
Content-Length: 22
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type,Authorization
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: https://www.wsy-test.com
Allow: POST, OPTIONS
Cache-Control: no-cache, no-store
Connection: keep-alive
Content-Type: application/json
Date: Thu, 30 Aug 2018 05:55:12 GMT
Expires: Thu, 30 Aug 2018 05:55:12 GMT
Pragma: no-cache
Set-Cookie: _a=BGYUKVYTCT567VGHJD; expires=Fri, 30 Aug 2019 05:55:12 GMT; max-age=31536000; path=/; domain=.wsy-test.com

{
  "success": true
}

Request without proxy:

POST /_bm/_data HTTP/1.1
Host: www.wsy-test.com
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Content-Type: text/plain;charset=UTF-8
Cookie: anonymousId=13456C21159F9E36D723EF992BF7999C
Origin: https://www.wsy-test.com
Referer: https://www.wsy-test.com/landing/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36

{"request_id":"username"}

Response without proxy:

HTTP/1.1 201 Created
Content-Length: 22
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type,Authorization
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: https://www.wsy-test.com
Allow: POST, OPTIONS
Cache-Control: no-cache, no-store
Connection: keep-alive
Content-Type: application/json
Date: Thu, 30 Aug 2018 05:56:13 GMT
Expires: Thu, 30 Aug 2018 05:56:13 GMT
Pragma: no-cache

{
  "success": true
}

I don't have special configurations in Charles proxy. This issue confused me for a long time.




Can't get php code to work. Echo displays the word "echo"

Taking an internet programming class and our first assignment was to grab input from an html form and echo it out in a php page. After many frustrating attempts to get this to work, I just tried to make a php page that echoes out "hello world" but not even that worked. It echoed out "echo 'hello world';"




How to edit text in a SVG file? (not programmatically)

I'm trying to edit a .svg file i found in a website template i recently downloaded.
The file code is this one:

<?xml version="1.0" encoding="UTF-8"?>
<svg width="52px" height="10px" viewBox="0 0 52 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Stacked</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" font-size="12" font-family="ProximaNova-Bold, Proxima Nova" font-weight="bold">
        <text id="Stacked" fill="#000000">
            <tspan x="0" y="9">Stacked</tspan>
        </text>
    </g>
</svg>

What i want is to simply change the text. I was expecting to do it by changing the inner text of the TSPAN tag you can see at the end of the file. But nothing happens, even if I change text from a SVG editor.

So, my question is: what is the proper way to achieve my goal? Is it even possible to change text in a SVG file?




How do I support emojis in internet explorer?

I'm developing a chatbot, and I need to support internet explorer 11+. The chatbot uses emojis, such as 🤔and 🤷‍ , copied from https://getemoji.com/. In chrome, ff, edge and safari, they look great, with the exception that sometimes a woman symbol appears after the 🤷‍emoji. In internet explorer all the emojis are black-white - they look boring, and most of them don't work. Do you guys know a good polyfill, so all the emojis look nice?




How to use session in python? [on hold]

I am just wondering how can I use session inside the python code. Can someone provide me a reference link or a script to resolve my query?




Framework Javasript

Hello good afternoon.

Does anyone know what Javascript framework is this?

framework JS




Confusing about create a sub-domain

I have a little confusing about creating a sub-domain. In my mind, to create a sub-domain we just came to domain provider website and create it, then create a record to point the sub-domain to an IP host (this IP may be different than the main domain IP), and this 2 hosts (main domain's host and sub domain's host) can be 2 different web server.

But when I read some guide on the internet, and have a confused that why they create sub-domain in the host provider panel (may be called cPanel), then point it to the directory in host (regular in public_html folder). Is this just for a server to serve some static files purpose? Or I've missed something.

Anyone who knows it please explain to me. Many thanks.




Creating ad overlays on video players

I am currently developing my own streaming website and I want to create on-click pop up ads over the video player, which users will have to open before watching the video. You probably know what I'm talking about, I don't want to overdo it like lots of video streaming websites, but I'm looking for how to make them since I can't find a tutorial anywhere. I am currently using Javascript. Help will be very appreciated! :)




How to remove the first marker after I search again as location center on google maps javascript?

can help me about my problem. I want to search location center of the city, the problem is when i choose one of all cities, example i choose South Jakarta city, and then marker will display the city, after that, when i choose again, why the marker show double or so on of marker? Like this..correct result, this is correct. But when i want to search another city again, the picture will show like this.. incorrect result This is link from my javascript code... https://s.id/29-uk

please if you understand what i mean.




mercredi 29 août 2018

webpack-dev-server cannot get /?

This is my webpack.config.js

devserver:

devServer: {
   contentBase: path.join(__dirname, 'dist'),
   compress: true,
   port: 9000
},

output:

 output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'js/[name].min.js',
    },

package.json

"scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "watch": "webpack --watch",
        "start": "webpack-dev-server --open",
        "build": "webpack --env.production"
}

the browser always cannot get / when I ran npm start.

git bash

git bash result

browser console

browser console




How can I do a curtain effect on a web like showed in the image?

curtain effect

Hello I need to make this effect in a photo viewer, I have no idea how to make it, please any help?




Mobile Version of gh-pages Branch

I've been working on a web project using three.js that is being hosted by GitHub pages. This project without a doubt requires a full desktop/laptop computer in order to be properly ran, it simply won't load on mobile. In order to get a working version for mobile visitors I essentially had to completely cut down on the functionality and rework a majority of the code.

What I want to know is if there is a way to load the mobile version for mobile users when visiting the standard site? I'd like to accomplish by redirecting to another address however I'm more than welcome to other suggestions.

For further clarity I'm using the gh-pages branch of my main repository to host the main branch. Currently I have the mobile version of the site under the mobile branch of that repository. You can find all that here.

I'd like to note that I found a similar question, however the responses to the question simply state to make the website with a mobile responsive theme which is impossible for me.




How to get total sum of various digits based on dropdown selection in web dev

How can I get the total sum of the values of various text field based on various drop down selections.




Seeking advice for making social network like Medium (got lost in many techstacks and frameworks out there)

I am one of those aspiring ambitious youngsters wondering which tech stack to choose for developing a simple social network for sharing ideas (with the same purpose as Medium or alikes but in "Farsi").

I got my head busy with Lynda Learning Paths for becoming a web developer... took some courses in JS, CSS and HTML and didn't finish any of those yet.

For the back-end, I have faced a not-so-easy problem which is, which language/framework/tool to choose for

  1. Rapid Development
  2. ease of coding and deployment as I'm the only member of the team and have to build both front- and back-end.
  3. Least learning over-head as I need to quickly bring something online to test the product and not waist my time and energy finding that no market exists for this product.

I searched every where that I could, and at the very first I put the W/LAMP stack aside as I felt that PHP and MySQL are a bit old-school. Then read about node's "Exquisite Speed" and "Website Integrity" as both Front and back-end are built upon a same foundation.

So I went on with the conventional JS frameworks for this project but didn't find that to be too easy to either learn or code and got lost in many-many big names Gulp Node React Angular Npm Vue and ... although I have currently half-watched a node js essetial training and started a new React js course. (I read somewhere that angular is to complex sometimes, I wanted to continue with MERN stack.)

Then, in last three days I have been playing around with ruby and found love with syntax and the whole concept of it. haven't really used rails but based on comment and reviews it seems that it's a perfect match for my needs, the problem is that I feel it's a dying language and as I put my whole summer into learning JS frameworks and basic web knowledge, I'm not quite motivated and distressed of learning something completely new and not assured of the outcome.

Also I know python, the computational side of it mostly, but I'm familiar with its OOP syntax. but have no experience with Django or Flask.

To end this long long story the question is: What Should I do based on the above mentioned factors shall I continue learning node along side with react to fulfill the task or should I switch to ruby and learn the whole the Rails platform from the very beginning. or shall I freshen my old python skills and dive into Django or Flask.




How to handle device plug/unplug with Web MIDI?

I am working on an online musical score reading trainer, a prototype is available here. I was able to implement access to previously connected MIDI keyboard, however, I am struggling to implement a hot plug/unplug scenario.

My last take looks like this:

    setupDevices(inputs){
    let deviceName = '';

    inputs.forEach((value, key, map) => {
        if (value.connection === 'open' || value.connection === 'pending' ){

            value.open().then((midiInput) => {
                console.log(`Opened ${midiInput.name}`);
                midiInput.onmidimessage = midiController.onMIDIMessage;
            }, null);
        } else {
            value.onmidimessage = null;
        }
    });

    if (deviceName.length === 0) {
        deviceName = 'none';
    }

    document.getElementById('connectedDevice').setAttribute('value', deviceName);
},

onMIDISuccess(midiAccess) {
    midiAccess.onstatechange = (evt) => {
        console.log('MIDI config changed');
        midiController.setupDevices(evt.currentTarget.inputs);
    };
}

When debugging all the promises get called with good looking arguments, but I am not able to receive any key down messages. Also console.log(Opened ${midiInput.name}) gets called many more times than expected:

midiController.js:57 MIDI config changed
midiController.js:40 Opened KOMPLETE KONTROL - 1
midiController.js:57 MIDI config changed
midiController.js:40 Opened KOMPLETE KONTROL - 1
midiController.js:57 MIDI config changed
midiController.js:40 Opened KOMPLETE KONTROL - 1
midiController.js:40 Opened KOMPLETE KONTROL EXT - 1
midiController.js:40 Opened KOMPLETE KONTROL - 1
3
midiController.js:40 Opened KOMPLETE KONTROL EXT - 1
midiController.js:57 MIDI config changed
midiController.js:40 Opened KOMPLETE KONTROL - 1
midiController.js:40 Opened KOMPLETE KONTROL EXT - 1
midiController.js:57 MIDI config changed
midiController.js:40 Opened KOMPLETE KONTROL - 1
midiController.js:40 Opened KOMPLETE KONTROL EXT - 1
2
midiController.js:40 Opened Komplete Kontrol DAW - 1
midiController.js:57 MIDI config changed
midiController.js:40 Opened KOMPLETE KONTROL - 1
midiController.js:40 Opened KOMPLETE KONTROL EXT - 1
midiController.js:57 MIDI config changed
midiController.js:40 Opened KOMPLETE KONTROL - 1
midiController.js:40 Opened KOMPLETE KONTROL EXT - 1

 (all this gets printed just after I just turned the controller on). Any hints?




i need help please , i have a site with joomla but the URLs accept inyection just befor the www

i have a web site with joomla CMS , but i have a very BIG PROBLEM , when i acces to my site , with any number or caracter example : https://55.www.mysite.com or if i write any other caracter before the www. like this example : https://ddd.mysite.com , and the site work and generate a duplicated content , in th html code to , the canonical url is not the original... and that is duplicated content , i need help please...




AWS architecture - Web application (Diagram)

I am in the process of setting up a medium sized AWS infrastructure for a web project. I may be overthinking a couple things and therefore wanted to ask the community for opinions. Any input is appreciated.

Please see the graphic: here

Explanation (from left to right):

  1. My domain is hosted on GoDaddy and will simply route to Cloudfront in order to globally cache static content.
  2. Cloudfront will point to Route53 which is responsible for routing the user to the closest region based on Geoprximity and/or Latency
  3. Each region will have an availability load balancer pointing to an EC2 instance (different availability zones for disasters fallback)
  4. From there, each EC2 instance writes to a single MySQL database. Static content is loaded from a S3 bucket.
  5. This MySQL database replicates/synchronizes itself across availability zones and regions and creates read-replicas
  6. If an EC2 instance has a read-request, it contacts another Route53 router that forwards the read-request to a load-balancer (in each region) based on where the request is coming from (geoproximity/latency). The only alternative I see here would be to directly point read-requests from a European EC2 instance to a European load-balancer. (vice versa for US)
  7. The load-balancer in each region will then decide from which database to read based on health or amount of requests
  8. Each EC2 instance can also trigger a LAMBDA function through an API Gateway.

What am I missing? Is this too much? What are the ups and downs of this construct?

Thank you all so much!




My div containers keep shrinking with the browser

Whenever I shrink my browser size all of my divs also resize despite the grid-columns being there as you can see when it is supposed to reach till the end of the page like normal div auto re-sizing I have used CSS grid and everything works fine in except for this problem as it will cause parts of the page to go black you will see what i mean when you visit the website (https://ift.tt/2MXzqrQ) it is supposed to look like this like this

The following is my HTML and CSS for the page.

/*

    font-family: 'Anton', sans-serif; -----------------BOLD

    font-family: 'Fjalla One', sans-serif; ------------REGULAR

*/
*{
        margin: 0;
}
body{
        background: black;
}
.logo{
        font-size: 40px;
        font-family: 'Anton', sans-serif;
        color: #ffc800;
        line-height: 100px;
}
.header {
        grid-area: hd;
  height: auto;
}
.header{
        display: grid;
        grid-template-columns: 700px 250px 250px 250px 250px auto;
        grid-template-rows: 95px;
        grid-template-areas: "hd hd hd hd hd";
        font-family: 'Anton', sans-serif;;
        font-size: 30px;
        margin-bottom: 20px;
        border-bottom: 2px solid #ffc800;
}
.header{
        background: black;
}
.header a{
        color: #ffc800;
        text-decoration: none;
        line-height: 100px;
}
.hme{
        grid-column-start: 2;
}
.vids{
        grid-column-start: 3;
}
.header a:hover {
        -webkit-transition: all ease-in-out;
        -moz-transition: all ease-in-out;
        -ms-transition: all ease-in-out;
        -o-transition: all ease-in-out;
        transition: all ease-in-out;
        color: transparent;
        text-shadow: 0 0 1px rgba(255,255,255,0.9), 2px 0px 0px #00FFD7, -1px 0px 0px #FF0000;
        padding: 0 0 0 -1px;
}
/*----------------------------------------------------------------*/
.main{
        grid-area: mn;
}
.main{
        display: grid;
        grid-template-columns: 250px 500px 1fr 1fr;
        grid-template-rows: 400px 400px;
        grid-template-areas: "mn mn mn mn mn";
        color: white;
        margin-bottom: 50px;
}
video{
        background: url(./clientback3);
        overflow: auto;
}
.others{
        color: #ffc800;
        font-family: 'Anton', sans-serif;
        font-size: 100px;
        line-height: 700px;
        z-index: 2;
        grid-column-start: 2;
        grid-column-end: 4;
        min-width: 646.5px;
}
.artnam{
        color: #ffc800;
        font-family: 'Anton', sans-serif;
        font-size: 50px;
        grid-column-start: 2;
        grid-column-end: 4;
        z-index: 1;
        min-width: 615.5px;
}
.mnvid:hover{
        autoplay: 1;
}
/*-------------------------------------------------------------*/
.intro{
        grid-area: int;
}
.intro{
        display: grid;
        grid-template-columns: 120px 120px 120px 120px 120px 120px 120px 120px 120px 120px 120px 120px 120px 120px 120px 120px;
        grid-template-rows: 20px 60px 50px 250px 80px;
        color: #ffc800;
        background: url(./clientback3.jpg);
}
.vpap{
        grid-column-start: 1;
        grid-column-end: 17;
        grid-row-start: 2;
        font-family: 'Anton', sans-serif;
        font-size: 50px;
        text-align: center;
        text-decoration-style: underline;
        padding-bottom: 20px;
}
.abtinf{
         font-family: 'Fjalla One', sans-serif;
         grid-row-start: 4;
         grid-column-start: 2;
         grid-column-end: 15;
         font-size: 25px;
}
/*-----------------------------------------------------------*/
.recproc{
        grid-area: rcp;
}
.recproc{
        display: grid;
        grid-template-columns: 250px 360px 360px 360px 360px;
        grid-column-gap: 50px;
        grid-template-rows: auto auto auto;
        color: #ffc800;
        font-family: 'Anton', sans-serif;
        font-size: 25px;
        background-image: url(projback.jpg);
}
.projtitle{
    grid-column-start: 3;
    text-align: center;
    margin-bottom: 20px;
    color: #ffc800;
        font-family: 'Anton', sans-serif;
}
.firstvid{
    grid-column-start: 2;
    margin-bottom: 50px;
}
.secvid{
        grid-row-start: 2;
        grid-column-start: 3;
        margin-bottom: 50px;
}
.thrdvid{
        grid-row-start: 2;
        grid-column-start: 4;
        margin-bottom: 50px;
}
.frthvid{
        grid-row-start: 3;
        grid-column-start: 2;
        margin-bottom: 50px;
}
.fthvid{
        grid-row-start: 3;
        grid-column-start: 3;
        margin-bottom: 50px;
}
.sthvid{
        grid-row-start: 3;
        grid-column-start: 4;
        margin-bottom: 50px;
}
/*---------------------------------------------*/
.wyus{
        display: grid;
        grid-template-columns: 300px 150px 250px 250px 250px 250px;
        grid-template-rows: auto auto auto auto 75px;
        background: url(./clientback3.jpg);
        font-family: 'Anton', sans-serif;
        color: #ffc800;
}
.whyustit{
        grid-column-start: 2;
        padding-top: 50px;
        font-size: 50px;
        padding-bottom: 25px;
}
.whyusinfop1{
        grid-row-start: 2;
        grid-column-start: 2;
        grid-column-end: 6;
        font-size: 25px;
        padding-bottom: 20px;
        font-family: 'Fjalla One', sans-serif;
}
.whyusinfop2{
        grid-row-start: 3;
        grid-column-start: 2;
        grid-column-end: 6;
        font-size: 25px;
        padding-bottom: 35px;
        font-family: 'Fjalla One', sans-serif;
}
.butcont{
        grid-row-start: 4;
        grid-column-start: 2;
        font-size: 25px;
        color: black;
        text-decoration: none;
        border: 2px #2a2a2a;
        background: #2a2a2a;
        color: white;
        border-radius: 6px;
        color: #ffc800;
}
.butcont:hover{
        -webkit-transition: all ease-in-out;
        -moz-transition: all ease-in-out;
        -ms-transition: all ease-in-out;
        -o-transition: all ease-in-out;
        transition: all ease-in-out;
        color: transparent;
        text-shadow: 0 0 1px rgba(255,255,255,0.9), 2px 0px 0px #00FFD7, -1px 0px 0px #FF0000;
        padding: 0 0 0 -1px;
        border: 2px #ffc800;
        background: #ffc800;
}
/*------------------------------------------------*/
.footer{
        display: grid;
        grid-template-columns: 250px 75px 250px 250px 250px 250px auto auto 1fr;
        grid-template-rows: 100px 60px 100px;
        background: black;
        color: #ffc800;
        font-family: 'Anton', sans-serif;
        border-top:  2px solid #ffc800;
}
.follow{
        grid-column-start: 2;
        margin-top: 25px;
}
.instalogo{
        grid-column-start: 2;
        grid-row-start: 2;
        height: auto;   
        width:  50px;
}
.insat{
        grid-row-start: 2;
        grid-column-start: 3;
        font-size: 25px;
        margin-top: 15px;
        font-family: 'Fjalla One', sans-serif;
}
.devby{
        grid-column-start: 7;
        margin-top: 25px;
}
.jbdevlgo{
        height: auto;
        width: 500px;
        grid-column-start: 7;
        grid-column-end: 9;
        grid-row-start: 2;
}
<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Murshed</title>
        <link rel="stylesheet" type="text/css" href="style.css">
        <link href="https://fonts.googleapis.com/css?family=Anton|Fjalla+One" rel="stylesheet">  
</head>
<body>
                <div class="header">
                        <h1 class="logo">THEGREATMURSHED</h1>
                <a href="./home.html" class="hme">Home</a>
                <a href="./videos.html" class="vids">Videos</a>
                <a href="./enquiry.html" class="enq">Enquiries</a>
                <a href="./socials.html" class="schls">Socials</a>
                <a href="./Photoshoots.html" class="phtos">Photoshoots</a>
        </div>
        <div class="main">
                <video width="auto" height="800" controls="1" loop="5" autoplay="1" id="video1" allow="autoplay" muted="1">
                <source src="./covervid.mp4" type="video/mp4">
        </video>
        <h1 class="others">GET RIGHT REMIX</h1>
        <p class="artnam">Dockem & Malone ft. Ayo Beatz</p>
        </div>
        <div class="intro">
                <h1 class="vpap">ABOUT US</h1>
                <p class="abtinf">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sit obcaecati quae modi amet at aperiam rerum facilis error impedit culpa. Magnam earum odio quia maxime minima, excepturi, at omnis dolorum delectus consectetur atque? Exercitationem ipsam possimus cupiditate aspernatur iure, dignissimos aperiam adipisci. Sapiente inventore quo dolorem labore quaerat ab quasi, at vel recusandae blanditiis eveniet iusto animi rem quia provident unde tempora sequi mollitia accusamus, sit vitae fuga et expedita. Non nulla pariatur numquam distinctio harum maxime doloremque est aspernatur suscipit ex, esse voluptatem. Laudantium explicabo incidunt ab, eum aperiam tenetur consequuntur odio, necessitatibus consequatur reprehenderit porro! Eius odit, possimus earum quasi architecto atque corrupti consequuntur sequi, nobis iste tempore ut rerum! Inventore adipisci, ex perspiciatis laudantium dicta natus rem eligendi, quae earum incidunt voluptates sapiente! Ipsa similique nobis unde illum sed esse earum in doloremque tenetur, fugiat fuga, facilis dolor quis accusamus, autem quasi eveniet incidunt natus consectetur ipsam.</p>
        </div>

    
</script> 
        <div class="recproc">
                <h1 class="projtitle">Projects</h1>
                <iframe width="360" height="315" src="https://www.youtube.com/embed/Ztt1zS1EuIE" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen class="firstvid">
                </iframe>
                <iframe width="360" height="315" src="https://www.youtube.com/embed/EoeEmNrYJgo?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen class="secvid"></iframe>
                <iframe width="360" height="315" src="https://www.youtube.com/embed/iAMq_sXkXxA?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen class="thrdvid"></iframe>
                <iframe width="360" height="315" src="https://www.youtube.com/embed/Jb6huXOpkyc?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen class="frthvid"></iframe>
                <iframe width="360" height="315" src="https://www.youtube.com/embed/7ha6xYSOHeQ?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen class="fthvid"></iframe>
                <iframe width="360" height="315" src="https://www.youtube.com/embed/Atr-sLswEUE?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen class="sthvid"></iframe>
        </div>
        <div class="wyus">
                <h1 class="whyustit">Why Us</h1>
                <p class="whyusinfop1">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Qui perferendis aut exercitationem nobis vitae omnis totam eum vero tempore sit quod, vel porro sequi, dignissimos ut quidem maxime nulla. Praesentium placeat velit similique minima nam, quibusdam voluptates at veritatis, aliquam ratione, alias deleniti quaerat. Fuga neque reiciendis ipsa animi, vitae architecto iusto, at facere totam provident in enim aperiam quod.</p>
                <p class="whyusinfop2"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit reiciendis laboriosam debitis non est culpa sapiente incidunt eligendi consequatur totam exercitationem harum unde minima nesciunt cumque et quod molestias voluptates animi delectus dolores quasi voluptate, blanditiis iste. Fugit omnis, harum?</p>
                <a href="./enquiry.html" class="butcont">Contact Us</a>
        </div>
        <div class="footer">
                <h1 class="follow">Follow</h1>
                <img src="./instalogo.png" class="instalogo">
                <p class="insat">@thegreatmurshed</p>
                <h1 class="devby">Developed By</h1>
                <img src="./jbdevlogo.png" class="jbdevlgo">
        </div>
</body>
</html>



Drawing Web App - best programming language?

I'm new here so please be kind.

I have basic programming skills in Java and HTML and CSS.

My goal is to build a drawing web app like this one: https://www.youidraw.com/apps/painter/

Which programming language would be up to the task. I'm open to learning a new one. Are there any frameworks or libraries, which make this easier?

Thanks in advance for answering :)




Kendo Angular Tabstrip wrapper

I want to wrap kendo tab strip to have all the tabs in one place and whenever I wanted to change the tab component just change one place. With that in mind I started to wrap kendo tab strip but it doesn't work. I'm really confused at this point. this is my code :
custom-tab-strip.html

<kendo-tabstrip>
  <ng-content></ng-content>
</kendo-tabstrip>

custom-tab-component.html:

<kendo-tabstrip-tab [title]="title" [selected]="selected">
  <ng-template kendoTabContent>
    <ng-content></ng-content>
  </ng-template>
</kendo-tabstrip-tab>

Where title and selected are inputs in this component.
At last I use these components as follows:

<app-custom-tab-strip>
    <app-custom-tab [title]="'title'" [selected]="true">
        test
    </app-custom-tab>
</app-custom-tab-strip>

Can anyone help me to find the problem of my code?




How can I block : from input

I have following code . I want to block : from input screen. How can I block : Please advice

       bValid = bValid && checkRegexp(corno, /^((?!\/|\\).)*$/g, '<?php echo get_lng($_SESSION["lng"], "E0034");/*Error: PO Number can not contain space, / , \\*/ ?>');
        bValid = bValid && checkspace(corno, /\s/, '<?php echo get_lng($_SESSION["lng"], "E0034");/*Error: PO Number can not contain space, / , \\*/ ?>');




Send user to another webpage and avoid 405 XSS Protection

I'm trying to filter some urls from a website and display it to the user on my site. When you click the url to the website from my site you'll recieve a 405 error from the website. But if you instead copy & paste the url into your own browser it'll work fine.

Is there a way to send the user from my site to the website without triggering XSS-protection?




Basic Primitives Family Diagram

I want to make an organizational diagram using basic primitives. there is a condition where an item have to skip a parent. In organizational diagram layout that can be done in this way :

https://www.basicprimitives.com/index.php?option=com_content&view=article&id=76&Itemid=120&lang=en

but i want to use family diagram layout. i have read all documentation and still got no answer. why i use family diagram layout ? because also there is a condition where an item have 2 parents. that condition can only be done in family diagram layout so i have 2 conditions : 1. an item must skip a parent (Solved by using organizational diagram layout) 2. an item have 2 parents (Solved by using family diagram layout) so i don't have solution to overcome those issues at once

anyone have a solution?




Using include from a different folder

i have a project using php; i have an include folder where i have my header.php and footer.php my style sheet and others are linked in the head tag of the header.php

i have another folder named calculator, now i include the header.php and footer.php in the index file of the calculator folder and it works but the css does not take effect

Here is the code in the calculator index file

<?php
    include '../include/header.php';
?>

    <form action="" method="post" enctype="multipart/form-data">
        <div class="form-group">
            <label for="exampleFormControlInput1">Name of Share</label>
            <input type="text" class="form-control" id="exampleFormControlInput1">
        </div>
        <div class="form-group">
            <label for="exampleFormControlInput1">Number of Shares</label>
            <input type="text" class="form-control" id="exampleFormControlInput1">
        </div>
        <div class="form-group">
            <label for="exampleFormControlInput1">Purchase Price</label>
            <input type="text" class="form-control" id="exampleFormControlInput1">
        </div>
        <button type="submit" class="btn btn-primary">Submit</button>
    </form>


    <?php
    include '../include/footer.php';
    ?>

please advise




Remove mongo array if nested array is empty

i have got a mongo array , in which i want to remove the whole block , if the nested array of that block is empty

I have attached the array below

{
        "_id" : ObjectId("5b17b991c440782b5a218cd1"),
        "vendor_view_id" : 741733,
        "product" : [
                {
                        "id" : ObjectId("5b86546540c1c414543e4333"),
                        "vendor_user_id" : ObjectId("5b17b992c440782b5a218cd2"),
                        "product_type_id" : ObjectId("5ae8348b7ae0d9538e45ab46"),
                        "condition_id" : [ ],
                        "shipping_cost" : 100,
                        "date_added" : "2018-08-29-08-08-05",
                        "date_status_change" : "2018-08-29-08-08-05",
                        "status" : 0
                },
                {
                        "id" : ObjectId("5b8654ba40c1c4145d1f5473"),
                        "vendor_user_id" : ObjectId("5b17b992c440782b5a218cd2"),
                        "product_type_id" : ObjectId("5ae834b17ae0d9538e45ab48"),
                        "condition_id" : [ ],
                        "shipping_cost" : 100,
                        "date_added" : "2018-08-29-08-09-30",
                        "date_status_change" : "2018-08-29-08-09-30",
                        "status" : 0
                },
                {
                        "id" : ObjectId("5b8655a840c1c415080b0a33"),
                        "vendor_user_id" : ObjectId("5b17b992c440782b5a218cd2"),
                        "product_type_id" : ObjectId("5ae834a67ae0d9538e45ab47"),
                        "condition_id" : [
                                {
                                        "_id" : ObjectId("5ae977da7ff1706f3b7dc47a"),
                                        "status" : 0,
                                        "date_added" : "2018-08-29-08-13-28"
                                }
                        ],
                        "shipping_cost" : 100,
                        "date_added" : "2018-08-29-08-13-28",
                        "date_status_change" : "2018-08-29-08-13-28",
                        "status" : 0
                }
        ]
}

I would like to delete the array block where product.condition_id is empty

So far i have tried this

$this->collection_name->collection->updateOne([
                                                 '_id' => $vendor_id,
                                                 ],
                                                        [
                                                        '$unset' =>
                                                                        [
                                                                                'product.$.condition_id' =>
                                                                                         [
                                                                                                '$size'=>0,
                                                                                         ]
                                                                        ]
                                                         ])



Webtool to get all the clickable elements based on id,tag or class

I am trying to make a web automation script in python, which will launch a browser login into the portal and click on few elements (buttons, pages..) based on the configuration supplied to the project.

I am using selenium and it has been working very good. But I am having few issues understanding the html of a page. I need to click on few buttons and pages but I am unable to find proper id, tag or a class of that particular elements as I am bit new to html.

Is there any tool available which I can download and it can list all the elements of a webpage based on id, tag class it is using. Thanks




mardi 28 août 2018

Outputstream start writing when inputstream starts reading

I want to send a big object (lets say 4G) over http.

We have a custom serializer that writes the object to an OutputStream. At the moment we write the object to disk and use that file for the inputstream which is used for the request.

Something like these lines:

private static Response sendObject(Object bigObject) throws IOException {
  File tempFile = File.createTempFile("x", "y");
  OutputStream out = new FileOutputStream(tempFile);
  CustomSerializer.serialize(bigObject, out);
  out.close();

  WebTarget resource = service.path("data");

  FormDataMultiPart multiPartEntity = new FormDataMultiPart();

  InputStream inputStream = new FileInputStream(tempFile);
  StreamDataBodyPart streamBodyPart = new StreamDataBodyPart(
        "data",
        inputStream,
        "data",
        MediaType.APPLICATION_OCTET_STREAM_TYPE);

  MultiPart multiPart = multiPartEntity.bodyPart(streamBodyPart);
  return resource.request(MediaType.APPLICATION_JSON_TYPE)
        .post(Entity.entity(multiPart, multiPart.getMediaType()));
 }

We save some memory because we don't serialize to a byte array in memory. Thats nice. But could I save the memory without writing to disk.

Could you write directly to the input stream without rewriting the CustomSerializer?

Could you write directly to the input stream while it reads into the request?

-

It is a little hard to explain, But I think I am after something like this pseudo code:

private static Response sendObject(Object bigObject) throws IOException {
  WebTarget resource = service.path("data");

  FormDataMultiPart multiPartEntity = new FormDataMultiPart();

  OutputStream outIn = new OutputInputStream() {
     public void openInputStream() {
        CustomSerializer.serialize(bigObject, this);
     }
  };
  StreamDataBodyPart streamBodyPart = new StreamDataBodyPart(
        "data",
        outIn.getInputStream(),
        "data",
        MediaType.APPLICATION_OCTET_STREAM_TYPE);

  MultiPart multiPart = multiPartEntity.bodyPart(streamBodyPart);
  return resource.request(MediaType.APPLICATION_JSON_TYPE)
        .post(Entity.entity(multiPart, multiPart.getMediaType()));
} 




Crawling google search url list with python

I'd like to scrape google search result url with python.

Here's my code

import requests
from bs4 import BeautifulSoup

def search(keyword):        
    html = requests.get('https://www.google.co.kr/search?q={}&num=100&sourceid=chrome&ie=UTF-8'.format(keyword)).text
    soup = BeautifulSoup(html, 'html.parser')
    result = []
    for i in soup.find_all('h3', {'class':'r'}):
        result.append(i.find('a', href = True) ['href'][7:])
    return result

search('computer')

Then I can get result. First url of the list is wikipedia.com which is,

'https://en.wikipedia.org/wiki/Computer&sa=U&ved=0ahUKEwixyfu7q5HdAhWR3lQKHUfoDcsQFggTMAA&usg=AOvVaw2nvT-2sO4iJenW_fkyCS3i', '?q=computer&num=100&ie=UTF-8&prmd=ivnsbp&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwixyfu7q5HdAhWR3lQKHUfoDcsQsAQIHg'

I want to get clean url, which is 'https://en.wikipedia.org/wiki/Computer' including all the other search result in this case.

How can I modify my codes?




Confused about how SPA's work

I need to build an app which has a register page and a login page, but then all of the real content which is presented after login can be worked on in a single page. For what I have understood from the concept of SPA's, only one page is allowed and all content is rendered according to user requests. Is my structure possible using the concept of SPA and mainly React Framework? If so, how?




Simply calling one JS function from another is not working

I have a ridiculously simple HTML document and JS file and I cannot figure out why this simple code is not working.

Here's the index.html:

<!DOCTYPE HTML>
<html>
    <head>
        <script src="scripts/ServerStatus.js"></script>
    </head>
    <body>
        <script>getStatus();</script>
    </body>
</html>

Here's ServerStatus.js:

function getStatus() {
    alert('Test 1');
    isOnline();
    alert('Test 3');
}

function isOnline() {
    alert('Test 2');
}

It only displays the "Test 1" alert, and then nothing. If I remove the isOnline() function call, it will display the "Test 1" alert followed by the "Test 3" alert without issues. Why is the function call causing the execution to just exit like that?




Converting gulp 3.0 task to gulp 4.0

I have a gulp script that was initially written for gulp 3.0. But after the update following task is failing due to a newer design. The following article describes this problem,

gulp 4.0

    gulp.task("tsbuild", ["lint", "lint-css", "tsbuild-vendor"], () => {
    runWebpack(configFile);
});

Above code is throwing following error,

throw new assert.AssertionError({ ^ AssertionError: Task function must be specified

I am building a complex web application and want to get rid of the error. Learning gulp is way out of my scope as I just need to build the web application. Can someone point me to the correct conversion of the above code snippet following Gulp 4.0 guidelines?




Inferred type-variable(S)

i need some help with this i don't get what to do i got those errors and i cant handle with them i've tried few things but nothing worked so far

Error 1:

Error:(56, 35) java: method exists in interface org.springframework.data.repository.query.QueryByExampleExecutor cannot be applied to given types; required: org.springframework.data.domain.Example found: java.lang.Integer reason: cannot infer type-variable(s) S (argument mismatch; java.lang.Integer cannot be converted to org.springframework.data.domain.Example)

Error 2:

Error:(60, 49) java: method findOne in interface org.springframework.data.repository.query.QueryByExampleExecutor cannot be applied to given types; required: org.springframework.data.domain.Example found: java.lang.Integer reason: cannot infer type-variable(s) S (argument mismatch; java.lang.Integer cannot be converted to org.springframework.data.domain.Example)

ArticleController.java

@Controller
public class ArticleController {
    @Autowired
    private ArticleRepository articleRepository;
    @Autowired
    private UserRepository userRepository;

    @GetMapping("/article/create")
    @PreAuthorize("isAuthenticated()")
    public String create(Model model){
        model.addAttribute("view", "article/create");

        return "base-layout";
    }

    //method calling for creating the article
    @PostMapping("/article/create")
    @PreAuthorize("isAuthenticated()")
    public String createProcess(ArticleBindingModel articleBindingModel){
        UserDetails user = (UserDetails) SecurityContextHolder.getContext()
                .getAuthentication().getPrincipal();

        User userEntity = 
        this.userRepository.findByEmail(user.getUsername());

        Article articleEntity = new Article(
                articleBindingModel.getTitle(),
                articleBindingModel.getContent(),
                userEntity
        );

        this.articleRepository.saveAndFlush(articleEntity);

        return "redirect:/";
    }

    @GetMapping("/article/{id}")
    public String details(Model model, @PathVariable Integer id){

        if(!this.articleRepository.exists(id)){
            return "redirect:/";
        }

        Article article = this.articleRepository.findOne(id);

        model.addAttribute("article", article);
        model.addAttribute("view", "article/details");

        return "base-layout";
    }
}

Here is my Article Entity

@Entity
@Table(name = "articles")
public class Article {
    private Integer id;
    private String title;
    private String content;
    private User author;


    public Article() {

    }
    //article constructor
    public Article(String title, String content, User author){
        this.title = title;
        this.content = content;
        this.author = author;
    }

    @Transient
    public String getSummary(){
        return this.getContent().substring(0, this.getContent().length() /2) + ". . .";
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(nullable = false)
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(columnDefinition = "text", nullable = false)
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @ManyToOne()
    @JoinColumn(nullable = false, name = "authorId")
    public User getAuthor() {
        return author;
    }

    public void setAuthor(User author) {
        this.author = author;
    }

}

ArticleRepository.java

public interface ArticleRepository extends JpaRepository<Article, Integer> {

}




How to tell website that electron is being used?

I have an app that was created, using electron framework. This app just opens internet page. Is it possible to let my internet page know if user uses electron app? I need to show user a bit different version of page, if electron framework is being used. Could you please propose a technique or method to do this? I will be very grateful for any information on this regard.




SSLv3 not supported by this version of OpenSSL

I am running a Qualys PCI compliant tool and I see many fixes in the report, one of them tells me to update the file default-ssl.conf and set the line SSLProtocol -ALL +SSLv3 +TLSv1 as follows. The problem is that Apache does not start, the journalctl -xe command sends me this message : SSLv3 not supported by this version of OpenSSL.

The Apache version is : Apache/2.4.29 (Ubuntu). The openssl version : OpenSSL 1.1.0g 2 Nov 2017

The Apache version is one of the latest so does the Openssl, any idea how to solve this issue?

Thanks,

jm




Automatize web actions without need to open the browser

I have to execute code of a web page (action of uploading files, a button for a popup, ..) without the need to open the browser, automate it in a code (JavaScript for example). Do you know if its possible and how?

Thank you




How to put the values from database to a specific row in the table

Here is the code for the fetching of the data from the database

<?php

                                      $uid  = $_SESSION['UID'];
                                      $result = mysqli_query($conn,"SELECT user.*,score.* from `user` join score ON user.USERID=score.USERID WHERE user.USERID=$uid ");

                                      if (!$result) {
                                          printf("Error: %s\n", mysqli_error($conn));
                                          exit();
                                      }
                                    while($row = mysqli_fetch_array($result))
                                    {
                                      echo "<tr>";
                                      echo "<td>".$row['SCORE']."</td>";
                                      echo "<td>".$row['AVERAGE']."</td>";
                                      echo "<td>".$row['POINTS']."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                      echo "<td>".'0'."</td>";
                                    }
                                     echo "</tr>";
                              ?>

Here is the database where i want for each actcode it will go to a certain row of the table of the output

Here is the current output where im getting all of the data from the database in the Lesson Exam Row. My desired output should be for example the actcode - number 1 should be in the lesson exam row, number 2 is for module 1, number 3 for module 2 and so on

Thank you in advance for your help.




Diplaying images in a java web project

So, i'm trying to do something simple: Display an image in my java web app.

I built a simple app for that, but i'm not succeeding, I tried all different I could find but no success.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>test page</title>
</head>

<body>
    <h1>testing internal libraries</h1>
    <img src="<%= request.getContextPath()%>/WebContent/images/cp.jpg" width=30 />
    <img src="<%= request.getContextPath()%>/images/cp.jpg" width=30 />
    <img src="../images/cp.jpg" width=30 />
    <img src="images/cp.jpg" width=30 />
</body>

</html>

enter image description here

enter image description here




Creating a browser agnostic or IE alternate internal button border for focus? (accessibility related)

Couple extra requirements I'm working under:

  • Needs to be reactive/mobile friendly

  • Needs to also be compatible with chrome, firefox, and ideally opera.

    <button class="outline">
    Lol A button
    </button>
    
    button{
      background-color: blue;
      color: white;
      padding: 15px;
    }
    .outline:focus{
      outline: 2px solid white;
      outline-offset: -6px;
    }
    
    

JS Fiddle example of what I'm doing now




How to put the values from database to a specific row in the table

Here is the code for the fetching of the data from the database

Here is the database where i want it for each actcode it will go to a certain row of the table of the output

Here is the output. for example actcode - number 1 is for lesson exam, number 2 is for module 1, number 3 for module 2

Thank you in advance for your help. i really need this right now.




How to make a textbox that can only input Text like name and space

Hello I'm wanna ask how to make a textbox that can only input Text like name and space in web, using php or javascript or other else

Thanks




questionnaire based filter wocommerce

i was looking everywhere about this, also in this forum but i have no answer for it.

So i planning to make questionnaire to filter product from wocommerce base on custom taxonomy like this one https://bluebottlecoffee.com/match .

I know how to make question, custom taxonomy but i cant find code to display product based on the filter that working. its really helpfull if someone can helpme through step by step.




Independent service which notify me when angular app doesnt work (Web workers?) [on hold]

Is Web worker good way to create independent service which will notify me when my angular app failed? I have angular app and I want to know when and for which user angular doesnt work(for example user just see blank page). Maybe is there other ways to create simple service which will work next to angular, and when angular crushed send me a log.

I hope I explain it enough, because english is not my native :) I just begginer and Im looking for proper solution for my problem. Thank you for every advice.




Mysterious PHP Function execution [duplicate]

This question already has an answer here:

First I will show only a part of my code,

index.html

<html>
<body>
    <?php require "PHP/music_lists.php"; ?>
    <script>
        var music = document.createElement('audio');
        music.src = 'data:audio/mp3;base64,<?php echo base64_encode(file_get_contents($current_music));?>';
        music.muted = false;
        function media_next_button_pressed() {
                document.getElementById("music-elapsed").value = 0;
                music.ontimeupdate = null;
                music.src = 'data:audio/mp3;base64,<?php getNextMusic();echo base64_encode(file_get_contents($current_music));?>';
                music.load();
                music.play();
                music.ontimeupdate = progressUpdate;
                document.getElementById('music-player-mini').getElementsByClassName('media-play-button')[0].style.background = 'url("../IMGS/pause-button.svg")'
        }
    </script>
    <button class='media-next-button' onclick="media_next_button_pressed()"></button>
</body>
</html>

music_lists.php

<?php
function getNextMusic() {
    fopen("abc.txt", "w");
}
?>

Problem
I am running the web page using Apache server and just when i open it in my browser it creates 'abc.txt', but why i have not even clicked anything.
Why is it happening ?

What I am trying to do
I am trying to make a music player.
I have the PHP function to provide me with a number +1 more than the previous one.
Like when i click it first time a variable $musicIndex stores 1, then on next click it should store 2 and so on. I am trying to do that using session.
But in reality, even before i click i get 1 in that variable and when i click next i still get 1. Then when i restart my browser and one that same page i get 2.




Angular JS $timeout and $scope function communication

I just find strange(for me) thing in angularjs. Why do these parts work differently?

Timeout is Working (alert after 8sec)

$scope.testfun = function(){
    alert(2);
}
$scope.activate = function(h,m,s){
    if(h != 0 || m != 0 || s != 0) $timeout($scope.testfun, 8000);
}

Timeout is NOT Working (alert momentally)

$scope.testfun = function(){
    alert(2);
}
$scope.activate = function(h,m,s){
    if(h != 0 || m != 0 || s != 0) $timeout($scope.testfun(), 8000);
}

Difference in $scope.testfun and $scope.testfun()




how to wrap the XML data in table of a HTML?

I have an HTML template where i need to display XML with tags inside th of a table. I tried the table-layout:fixed;word-wrap:break-word;width:100% for table tag, but it was dividing the table equally and text in th were not coming to new line as shown in below image.

 sample.html

<html>
 <body>
  <style>
   .queryTable {
    table-layout:fixed;
    width:100%;
    word-wrap:break-word;
   }
   th, .markHead{
    background-color:#124191;
    color:white;
   }
  </style>
 <h2>Sample Table </h2>
 <table border="1" class="queryTable">
  <thead>
   <tr>
   <th class="six wide">Table Name</th>
   <th class="six wide">Response Time (in sec.)</th></tr>
  </thead>
  <tbody>
   <th class="markHead" style="text-align:left;"><xmp>......Some XML....... 
   </xmp></th>
   <td>33.33</td>
   <th class="markHead" style="text-align:left;"><xmp>......Some XML....... 
   </xmp></th>
   <td>22.33</td>
   <th class="markHead" style="text-align:left;"><xmp>......Some XML....... 
   </xmp></th>
   <td>32.72</td>
   <th class="markHead" style="text-align:left;"><xmp>......Some XML....... 
   </xmp></th>
   <td>34.30</td>
   </tr>
  </tbody>
 </table>
 </body>    
</html>




Cannot access xampp website from other IP

You guys, I need help. Thank you so much. My problem is: I have 2 PC: A &B. - PC A, I set up xampp. IP of PC A is: 107.113.154.170. Firewall is turned off. On PC A, when I access on IE the link: 107.113.154.170, it's work, website display. - PC B, IP is 107.113.154.115. Ping ( from B to A, A to B) is ok. BUT: I can access the link 107.113.154.170 from PC B. Could you tell me what problem is?




Regex match text from div inside another div

i have this situation

    <div id="idName" class="className">
        <div>
          Text i need to match.
        </div>        
    </div>

I want to scrapp this text, i tried in this way but it does not work.

/class=\"className.*?<\/div>)/s

Any ideas?




Web Push Notification - ASP.NET

I want to make a push notification web app. I do it: https://developers.google.com/web/fundamentals/codelabs/push-notifications/

But when I reach to back-end side I can't do it. The library is this: https://github.com/web-push-libs/web-push-csharp

It seems complex to me. Please Help me. Thank You in Advance!




dialogueBox.show() doesn't work in Microsoft Edge browser

dialogueBox.show() works in google chrome browser but doesn't work in Microsoft Edge browser. What is the alternative?




lundi 27 août 2018

Node startup failed with error: internal.Node.run - Exception during node startup {} in Corda

Just now I started learning Corda and I am building my custom Cordapp. The nodes are being deployed properly but when I am trying to run the nodes in my custom cordapp they fail to start and closes. The logs and the error shown are given below:

*RPC admin connection address            : localhost:10048
E 13:15:07+0000 [main] internal.Node.run - Exception during node startup {}
 java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_181]
        at sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_181]
        at sun.nio.ch.Net.bind(Unknown Source) ~[?:1.8.0_181]
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[?:1.8.0_181]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:554) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1258) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:980) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:250) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:365) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
        at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_1

81]*

My build.graddle file is given below-

task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
    directory "./build/nodes"
    node {
        name "O=Notary,L=London,C=GB"
        notary = [validating : false]
        p2pPort 10006
        cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
    }
    node {
        name "O=PartyA,L=London,C=GB"
        p2pPort 10007
        rpcSettings {
            address("localhost:10008")
            adminAddress("localhost:10048")
        }
        webPort 10009
        cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
        rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
    }
    node {
        name "O=PartyB,L=New York,C=US"
        p2pPort 10010
        rpcSettings {
            address("localhost:10011")
            adminAddress("localhost:10051")
        }
        webPort 10012
        cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
        rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
    }
    node {
        name "O=PartyC,L=Paris,C=FR"
        p2pPort 10013
        rpcSettings {
            address("localhost:10014")
            adminAddress("localhost:10054")
        }
        webPort 10015
        cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
        rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
    }
}

task runExampleClientRPCJava(type: JavaExec) {
    classpath = sourceSets.main.runtimeClasspath
    main = 'com.example.client.ExampleClientRPC'
    args 'localhost:10008'
}




How to compress images coming from third party websites and CDNs?

I am following GTMetrix report suggestions in which the report has pointed out some images that should be compreseed BUT the problem is that the images are coming from third part sites! Either they are from FBCDN or from another site. So how can I compress/optimize these images?

e.g https://scontent.xx.fbcdn.net/v/t51.12442-15/33687098_2072367586314613_6533476226013593600_n.jpg?_nc_cat=0&oh=d255f481843f4f945397fedd0ff489ab&oe=5BB74460

The above image is loading from Facebook CDN.

https://manybot-thumbnails.s3.eu-central-1.amazonaws.com/fb135796882846/ca/big_5782ba5887c6f00cda566c1dcb114b06.jpg

The above image is loading in our website AWS

Another example : https://i.ytimg.com/vi/yXEpjTny9bg/hqdefault.jpg

Thanks




HttpContext.Current.Request.Url.Authority click not go

enter image description here

enter image description here

I took the Authority URL to pair with my PathAndQuery store and cast them to a string ,so it does not have a value and it appears on the view. But click on not action..

thanks all help




How to achieve like this 3d effect?

guys, i saw this effect @ QQ which is an IM used in China, this effect is so amazing, so i wanna know how to achieve it.

see the effect here




Being asked to use asp&iis to develop a website,what software should I use?

My computer doesn't have enough room for VS and Microsoft doesn't support WebMatrix now.I am a rookie and do not want to use notepad.Thank you for your replay.




File Not Found Exception with Config File

I am creating web application which requires Jdbc connectivity. I want to give the db details from a config file at the present working directory. For that i created a ReadConfigFile class. When i am running this class individually it gives me the correct present working directory. however when i m running the web application from the server, it shows me an incorrect present working directory and throws FileNotFound Exception. This is my code:

private static final String pwd=System.getProperty("user.dir");
private static final File configFile=new File(pwd+File.separator+"configFile.txt");

private static BufferedReader br;

public static String getDBHost() {
    String dbHost=null;
    try {
        br=new BufferedReader(new FileReader(configFile));
        String st;
        while((st=br.readLine())!=null) {
            if(st.trim().startsWith("DB Host: ")) {
                dbHost=st.trim().substring(9, st.trim().length());
            }
        }
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        System.out.println(e);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        System.out.println(e);
    } finally {
        try {
            if(br!=null) {
                br.close();
            }               
        } catch (IOException e) {
            // TODO Auto-generated catch block
            System.out.println(e);
        }
    }
    return dbHost;
}

Can anyone tell me what to do?




Who redirects Umlaut domain names in browser to transliterated domain name?

I have a domain that contains an Umlaut like that:

https://spaß.de

"ß" may be transliterated to "ss".

Now when I copy and paste this text into Chrome or any other browser, I'm taken to

https://spass.de

However, the 2 domains have different owners, and the owner of "https://spaß.de" will never get any traffic to his site.

Is there any authority that redirects Umlaut domains to transliterated domains, or is the browser responsible for this? I have tried all kinds of browsers, they all show the same behaviour.

Thank you for any insights.




How does an API detect I'm requesting from a phone?

I have a paid proxy api which gives me a proxy when doing

requests.get("https://api.proxy.com/get.php?apikey=blabla").json()

If I run this script on a computer I get a proxy, but if I install a python app on my phone and run this script I get 'Forbidden'.

I was just wondering how they detect that I'm sending this request from a phone? prepared_request doesn't help also. I can't find anything except Content-Length and whatever.

Thanks for your help!




Wouldn't CSS be more efficient if it used python syntax (IE no {} but tabs instead)? [on hold]

I was wondering if CSS would be more efficient if it used Python-like formatting (no {} but instead just tabs) and what really goes against converting to that?

Example: The browser could check if the first class it sees in the css is that kind of formatting:

.exampleClass
    color: red;
    background-color: gray;

Otherwise it'd use the default / "legacy" formatting. It could of course also be an even more converted version like

.exampleClass2:
    color = red
    background-color = gray

Or maybe a mixture in between? I'm not sure what would be best/most optimal but I'm quite curious if something like this has been tried and if not, why not?




Add step between cart and checkout on woocommerce?

I am looking for a free plugin that will let me add a page between the cart and checkout when purchasing a product on woocommerce wordpress/




web browsers without controls and addressbar

I've been trying to research for existing web browsers that do not have an address bar or additional controls on the UI. Ideally a web browser that has just the window frame. The reason is that I am writing a web application, which ideally I do not want the user to have the ability to navigate to other websites or have the ability to navigate backwards/forwards etc. Obviously I can write additional code that can prevent people from navigating other side/ backwards, etc, but ideally would like a clean Window for the user to work from.

So far i've explored the option of building a web browser UI using JavaFX. However the web application is built using Angular and the JavaFX web browser window flickers from time to time during a screen transition.

If there is anyone that can provide a recommendation of such a browser that would be greatly appreciated. Thanks.




How do I redirect a specific port in the IIS server to an other port

My URL Rewrite rule only works for port 80 in IIS .

The rewrite works for : http://localhost:80 --> http://localhost:8100

The rewrite works for : http://localhost:80/redirect --> http://localhost:8100

The rewrite doesnt work for : http://localhost:8080 --> http://localhost:8100

The rewrite doesnt work for : http://localhost:8080/redirect --> http://localhost:8100

My web.config is following:

<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
<system.webServer>
    <directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension, LongDate" />
    <rewrite>
        <rules>
            <rule name="Redirect to port 8100" stopProcessing="true">
                <match url="(.*)" />
                <conditions logicalGrouping="MatchAny">
                    <add input="{SERVER_PORT}" pattern="^8100$" negate="true" />
                </conditions>
                <action type="Redirect" url="http://{HTTP_HOST}:8100/{R:0}" />
            </rule>
        </rules>
    </rewrite>
 </system.webServer>
</configuration>

The web.config is only working on default http port 80/443 but not for an specific port.

Which changes has to be made in the web.config for working with all ports?




cors nginx configuration in ubuntu

DENY all requests by default (PoLP) set $websocket_same_origin_policy "DENY"; ALLOW non-browser clients if ($http_origin = "") { enter code hereset $websocket_same_origin_policy "ALLOW"; } ALLOW browsers with matching Origin header and ServerName (only browsers reliably set a truthful Origin header) if ($http_origin = $scheme://$server_name) { enter code here set $websocket_same_origin_policy "ALLOW"; } location /ws { enter code here# DENY any request that violates the Same Origin Policy enter code hereif ($websocket_same_origin_policy != "ALLOW") { enter code here return 403; enter code here } enter code hereproxy_http_version 1.1; enter code hereproxy_set_header Upgrade $http_upgrade; enter code hereproxy_set_header Connection "upgrade"; enter code hereproxy_pass http://localhost:3030; }

enter code hereWhen I tested with an origin as empty, I will get the 400 code. An Empty origin should return 404, anyone help how to do it




Global footer on multiple static sites on same domain but different virtual machines and different platforms

Is it possible to make global footer on static sites (no db)?

They are on the same domain, but on different virtual machines.

They are made with:

  • Hugo with Laravel
  • Media wiki
  • Question2Answer

Thought about using JavaScript to get footer from one page and include it in other pages, but this will reduce performance. Are there any other ways?




Envato API - Confirm Purchase and get Info

I’m building a welcome page on wp dashboard for on of my themes, I want to build a registration proccess before buyer can do demo install. I’m a bit confused how I can make an API Server on my site that connect envato API similar to this https://my.fuelthemes.net/




Change the request method from POST to GET in a redirection from spring controller

I have a spring mvc controller, which accepts a post request and it needs to redirect to a URL (GET request).

@RequestMapping(value = "/sredirect", method = RequestMethod.POST)
public String processForm(HttpServletRequest request) {
    System.out.println("Ews redirect hit !!! ");
request.setAttribute(View.RESPONSE_STATUS_ATTRIBUTE,HttpStatus.MOVED_PERMANENTLY);

    return "redirect:https://www.google.com/";
}

And the class is annotated with @RestController. I am always getting 405, method not allowed for the redirect url. (i.e google.com).

As per docs (https://tools.ietf.org/html/rfc7238), it should allow the method to be changed . I am not sure what am I doing wrong? Can someone help




How to give different input with different onclick, javascript?

var array1 = [
   "a","b","c"
]
document.getElementsByClassName("class").onclick = myFunction;
function myFunction(){
    var array2 = document.getElementsByClassName("class");
    videoContainer.attribute=array1[0];
}

this would work, but is there a way to make it easier and link the class array length with the other array("array 1" and "array 2"), like a for loop or something else




Why does chrome take longer to reload a page when it's unresponsive?

I've noticed that whenever a webpage on chrome is becoming unresponsive (i.e. crashes) and you reload it, chrome takes a whole lot longer to reload than before.

Why is it doing that instead of just terminating the hanging process and reloading, leaving the user to wait?




Browser Sync set up gone wrong

I followed all the steps from https://browsersync.io/#install, up until the last one (start BrowserSync). I have a folder, called MyWebPage1, that has 3 sub-folders : HTML, CSS, JS. Now each of these sub-folders contains a file, called either index, either main, with the apropriate extension. What do I need to do in order to have my index.html page refreshed everytime I apply a change to the file itself, or to the css file, or to the js file (being given how I organized the files)? I spent almost 2 hours trying everything : entering all kinds of paths, reinstalling BrowserSync multiple times and typing all kinds of commands into the command prompt (now I know the description of what I've been through sounds a little bit unprofessional, but after all, I'm new to web developement, just a newbie learning in order to earn a job). I'd say I could use some help :D!




Run exe in custom URI protocol silent

I have registered a custom protocol handler in registry which is going to open files and directories from a SQL-Server FileTable Share on browser interactions. Everything works fine and the .exe is doing what it should be doing.

Unfortunately everytime I do this (originally .bat but stored as exe with @echo off) a command prompt windows pops up and stays until the exe finished its job.

Is there a possibility to pass the exe a specific parameter in registry to avoid the window and run silently? Heres my Handler: "C:\Program Files (x86)\Document Handler\openSharedDirectory.exe" %1

I've already tried something like /r.

Thanks in advance.




Python's web bot to make automated login script

I am trying to understand python's library web bot which can automatically login to a given website. Using their quick demo code, I am able to log in to my google account.

I am trying to login to Microsoft account but its failing on typing the password in the password box. I inspect the password text area:

<input name="passwd" type="password" id="i0118" autocomplete="off" class="form-control" aria-describedby="passwordError loginHeader passwordDesc" aria-required="true" data-bind="
                textInput: passwordTextbox.value,
                hasFocusEx: passwordTextbox.focused,
                placeholder: $placeholderText,
                ariaLabel: str['CT_PWD_STR_PwdTB_AriaLabel'],
                css: { 'has-error': passwordTextbox.error }" placeholder="Password" aria-label="Enter password">

This is the code snippet:

web.click('Next' , tag='span')
web.type('<mypassword' , into='passwd')
web.click('Sign in' , tag='span')

As the inspect contains autocomplete=off, I am thinking this is the reason it might not be able to enter the password in the password area.

Is it true that web bot will not work in case of autocomplete=off. Is there any other library which I can use to do this task. How can I resolve this?

Thanks




WebServer doesn't work until I switch the php version from 7.1 to 7.2 or 7.2 to 7.1

i'm a newbie here, I have an issue with a server that I couldn't find an explanation. the webserver stops working untill I switch the php version i'm using ISPCONFIG webpanel and I should conenct go to sites and switch the php version and than the web server starts working again.

let me know if u need more informations.

thanks in advance




dimanche 26 août 2018

Web Browser in hybris

I'm trying to integrate a web browser in hybris. i've tried in simple html for opening a browser as a pop up. I'm trying the same in hybris opening a web browser as a popup. Could that be acheivable. Please suggest me.




I'm having proble to load some image from db and css in laravel

I just made a project in laravel, some functions just worked normally, but in one .blade, the data didn't show up and the .css did't work.

<div class="row row-centered">
                @foreach ($profils as $profil)
                <div class="col-md-4" >
                    <div class="card" style="width: 18rem;">
                        <center>
                            <div class="card-img-top bg-secondary">
                                <img class="card-img-top" src="" width="150 "> 
                            </div>   
                        </center>
                      <div class="card-body" style="padding: 10px;">
                        <h5 class="card-title"></h5>
                        <p class="card-text"></p>
                        <p class="card-text"></p>
                      </div>
                    </div>
                </div>
                @endforeach
            </div>

But, it worked well in my teams laptop (firefox). Can you guys give some sugestions here, thanks




Changing root directory on multiple site setup using .htaccess

First of all, the following is an abstracted diagram of the folder structure.

www
├site01
│  └index.php
├site02
│  ├index.php
│  └style.css
└site03
   └index.php

Each subfolders are hosting its own websites. They are separate websites for separate services so they won't be refering or talking to each other. What I want to do is to set up .htaccess on each subfolders, to make each site to look at their respective subfolders as "/"(root) directory, instead of /www/, when resolving requests or directories. For example, if I was to link style.css from site02, I want the following line to work:

<link rel="stylesheet" href="/style.css">

I'd to this otherwise without using .htaccess if this was an on-premise or collocated server and I had full control. But since my client is using shared hosting, and I am tasked with migrating the sites that were previously being hosted on separate accounts into one account for "easier maintenance", it is not possible to set up multiple sites using apache setup, and would be extremely time-consuming to go through all the files and change the directories, hence this method.

I'd like to know if this is possible, and how it could be done. Thank you.




How does a Rail fragment cache benefit your app, i.e. prevent database calls?

The information in my header/footer is derived from a bunch of dictionary tables in my database, and the data is going to change extremely infrequently. I would think this is the perfect opportunity for caching, so that every page won't touch the database as far as rendering the header/footer is concerned.

The Rails guide gives an example of fragment caching so I'm thinking for my nav links would be something like...

<% @categories.each do |category| %>
  <% cache category do %>
    <li class="nav-link">
      <%= link_to category.name, category_path(category) %>
    </li>
  <% end %>
<% end %>

But I don't understand how this prevents contact with the database or optimizes anything. The controller is making the call for @categories before the view renders which means the SQL query is made every page request... some HTML is being cached, but is the rendering process really a significant saving even for a larger snippet?? I feel like the strain on the database is what you really want to be limiting especially if dealing with a lot of concurrent traffic.

What is the appropriate caching strategy for things like footer / navigation partials.?




How did you get more efficient learning web devellopement?

I'm a beginner/intermediate web developper,few mounth ago i took a 9 mounth course program who has pretty much go around web dev programming languages, and now i'm pretty confident to say that at least i can handle the basics of web programing.

So far i'm really enjoying what i'm doing, and i'm very motivated to continue on this way, but now i really want to push my carrier to the next level, so what i'm doing is to browse on the internet and try to find some well-build website and try to copy the way they are made, which i think is very usefull to test your knowledge, and your ability to visualise the code/design.

Which in this way i have some questions for the people whom have years of experience and are having a real carrier in this field:

[1] Is that the right way to really start being confident about your skills and pushing yourself to be better and better day after day ? ( copying well-build websites ) or do i need to do some challenges.

[2] Between working for myself ( starting a company ) or to work for somebody else which is the fastest way to became an elite develloper.

Tell me how did you guys have made it, i would really enjoy to read everyone's answer.

Thanks alot :)




How to create a full back-end web app? Is there a platform to do this?

I want to create a back-end web application.

Is there a platform, engine or structure to facilitate the creation?

What is needed basically?

1. User dashboard

  • User Login page
  • Restrict area with the app functionalities (the final user)
  • Account settings (change the name, email and password)

2. Admin dashboard

  • Admin login page
  • Create/delete/view access (User management)
  • List of online and offline users at the moment
  • Any other functionality to manage



open source Web tools for reading paper scanned PDF data

Looking for a opensource available tools for reading paper based surveys which are in the form of scanned PDFs. Thanks




Asking expert knowledge related to File Insert or Embedded into HTML File Php Java

I`m currently working on a project. it is a desktop application using java swing.There i have a option to send email with a email with a HTML link. in that link i have to embedded PDF file which is located in a desktop folder. this folder is static one.

few things need to be considered.

  1. PDF files cant put into a database(Major Requirement).
  2. There are 100+ pdf in a folder. these PDF files must go to a 100+ users one person only one file in an email.

Please give me a suggestion.




samedi 25 août 2018

python when a client is running, how to know its own port number and ip address

in udp client

sk = socket( AF_INET , SOCK_DGRAM )
host = 'you know receive's ip address'
port = 'you know receive's port'
message = 'whatever'
sk.sendto( message , ( host , port ) )

in udp receiver

message, clientAddress = serverSocket.recvfrom(2048)

i know clientAddress contains a pair which is client's ip and port number.

but that is because in client, the system will add a header in the message that contains itself(client) own ip and port, while running since in each computer, the ip and port of client may be differnent

but in client how do i know its ip and port before sendto(). When someone runs python client in a computer, which function should i use to know the actual ip and port of this compouter

any help would be much appreciated thankyou




JS web framework with transparent/autogenerated client-server data layer

I'm wondering if there's a JS web framework with transparent/autogenerated data layer? To save my time, so I don't have to write all the code by myself.

Let's say I'm writing React Blog app, and communicate with the server using REST API.

I need to write two pieces of data layer, the server side, and its client on the client side.

Something like code below:

1 The business logic itself, resides on the server side:

class BlogAPI {
  async getPosts() {
    const records = await db.query('select * from posts')
    return convertRecordsIntoPostObjects(records)
  }
}

2 Exposing business logic as REST API and writing its client on the client side:

// REST API, this code also resides on the server side.
httpServer.get('/posts', () => blogApi.getPosts())

// And writing a client for it, that code resides on the client side.
class BlogAPIClient {
  async getPosts() {
    http.get('http://server-api-endpoint.com/posts')
  }
}

I'm wondering if there are web frameworks where part 2 is somehow magically autogenerated, so I can save my time and write only the business logic.

P.S. Don't mention GraphQL, it's not what I'm asking.