dimanche 30 septembre 2018

Spring websocket with sockJS only working in local machine

In my application, WebSocket is working fine in local. But when I deployed to an external server, I am getting the error,

WebSocket connection to 'ws://192.*..**/ws/279/asm4kjqd/websocket?token=Bearer%205jb20iLCJleHAiOjE1NDU5MTc2NTl9.ttG-utbulJyTjnAIYHunEsC03efxzJ7fePAvItBgdlE5jb20iLCJleHAiOjE1NDU5MTc2NTl9.ttG-utbulJyTjnAIYHunEsC03efxzJ7fePAvItBgdlE' failed: Error during WebSocket handshake: Unexpected response code: 200

My Config classes are,

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends WebSocketMessageBrokerConfigurationSupport
        implements WebSocketMessageBrokerConfigurer {

    @Override
    public void configureMessageBroker( MessageBrokerRegistry registry )
    {
        registry.enableSimpleBroker("/topic", "/queue");
        registry.setApplicationDestinationPrefixes("/user");
    }

    @Override
    public void registerStompEndpoints( StompEndpointRegistry stompEndpointRegistry )
    {
        stompEndpointRegistry.addEndpoint("/ws").setAllowedOrigins("*").withSockJS();
    }

    @Bean
    @Override
    public WebSocketHandler subProtocolWebSocketHandler()
    {
        return new CustomSubProtocolWebSocketHandler(clientInboundChannel(), clientOutboundChannel());
    }

    @Override
    public void configureWebSocketTransport( WebSocketTransportRegistration registry )
    {
        super.configureWebSocketTransport(registry);
    }

    @Override
    public boolean configureMessageConverters( List<MessageConverter> messageConverters )
    {
        return super.configureMessageConverters(messageConverters);
    }

    @Override
    public void configureClientInboundChannel( ChannelRegistration registration )
    {
        super.configureClientInboundChannel(registration);
    }

    @Override
    public void configureClientOutboundChannel( ChannelRegistration registration )
    {
        super.configureClientOutboundChannel(registration);
    }

    @Override
    public void addArgumentResolvers( List<HandlerMethodArgumentResolver> argumentResolvers )
    {
        super.addArgumentResolvers(argumentResolvers);
    }

    @Override
    public void addReturnValueHandlers( List<HandlerMethodReturnValueHandler> returnValueHandlers )
    {
        super.addReturnValueHandlers(returnValueHandlers);
    }

And from client side, I am connecting as follow,

let id = localStorage.getItem("userId")
        let url = `/ws?token=${localStorage.getItem("access_token")}`;
        // Web Socket connection starts here.
        let sockJS = new SockJS(url);
        let stompClient = Stomp.over(sockJS);
        stompClient.connect({},(function(){
            stompClient.subscribe(`${wsUrls.notify.url}/${id}`, (function(message){
                let parsedObj = JSON.parse(message.body);
                this.props.dispatch(storeWsNotifications(parsedObj));
            }).bind(this));
        }).bind(this));
    }

The websocket connection is getting established when I run the programm in local machine (localhost). But when deployed to the server I am getting above mentioned error. How to fix this?

Thanks




where and when to use aria-label?

The attribute aria-label when it is used on what situation, . which are the tags that supports this attribute . what are the situations to use this attribute . is there any rule to use this attribute.

please comment if question is unclear




How can I apply a CSS transformation to a div element in a specific angle?

I have two div elements of the same size. They overlap each other and each of them has a background image of an equilateral triangle pointing in one of two directions:

Triangles image

I would like to apply a transformation so that the right triangle is flipped and lands exactly on top of the left triangle. The rotation axis shall be the center of the gap between the sides that the two triangles almost share (marked in blue in the image). This way, the bottom right corner of the right triangle is supposed to land on the top left corner of the left triangle.

Right now I can rotate the right triangle only along one axis (using transform: rotateY(180deg)), but can't figure out how to get the right angle.

Any help is appreciated.




where/how to store database id in a secure way inside the html

If we have some items like store items and every item has an id that refers to the item in the database

so if someone clicks the item 1 then will get the item information that relates to the id 1 but it's going to be a problem if someone changes the id in the html tag

so how could we store the id in a secure way or is there another way to do the same thing




PHP Script stops running

When an answer is found in stage 3, the script stops running and does not proceed to the rest of the stages.The code should find an answer on the MYSQL server and cross-reference the answers, this section should find the search results.The positive part of the code is provided throughout the post. The code has 3 identical sections that search other tables on the server. When an answer is found, it appears that the code stops (a response is returned from the function) and does not execute the rest of the code (additional 2 extension functions continue later in the script)

if ($table=="cemetery")
                            {
                            $sql_search_fields_Cem[] = $colum." like '%$word%'";
                            $sql_search1="select cemetery_id from cemetery where  ";
                            $sql_search1.=implode(" OR ",$sql_search_fields_Cem);
                            $sql_search1.=implode (" ;");

                            $result3=$conn -> query($sql_search1);
                            if ($result3 -> num_rows >0)
                            {
                                while ($r3=$result3 -> fetch_assoc())
                                {
                                    if (resultIsExists($r4['update_date'] , $table))
                                    {
                                      echo "<br> return from func RIE <br>";
                                    }
                                }
                            }
                            else
                            {
                              echo mysqli_error ($conn). " No search results found for cemetery /r/n ";
                            }




preserving and recreating state via the URL

Imagine the following scenario:

The user goes to https://mywebsite.com, searches for something and hits [submit]. The results are displayed and the URL is now https://mywebsite.com/floobah?q=burp. The user clicks on an anchor which scrolls the page down to a div a choice of ways to visualize the result. The URL is now https://mywebsite.com/floobah?q=burp#viz. The user chooses the pie chart widget and displays the pie and associated data. The URL is now https://mywebsite.com/floobah?q=burp&chart=pie&sort=asc#viz.

Then the user sends the URL to a friend. When its recipient opens that URL, the state is restored exactly as what it was for the sender. In other words, the URL is parsed and the actions performed to restore the state… the query is performed, the page scrolls down to the viz section, the pie chart opens up and the associated data is shown sorted as requested.

I am doing this right now by parsing the URL and replaying all the steps. But surely there must be a library already for doing this, no? To sum, I want the state of a page encoded in the URL which can be shared and then recreated by the recipient of the URL bookmark.




How to appendChild an UL to a SPAN?

So, if we're going to append a LI to UL we should do this:

var list = document.createElement('li');
var ulist = document.createElement('ul);
ulist.appendChild(list);

what if I create a span, should I do this?

var list = document.createElement('li');
var ulist = document.createElement('ul);
var span = document.createElement('span');
span.appendChild(ulist);
ulist.appendChild(list);




Error message in nodejs: backend returned code 400, body was null

I am developing a web application using MEAN Stack with Angular 6. I am struggling with the following error for days. I have an input field which shows a color picker. It allows us to select the color. This is my color schema.

var mongoose = require('mongoose');

var rdaColorSchema = new mongoose.Schema({  
  colorMovementBox: {
      type : String,
  },
});
module.exports = mongoose.model('rdaColor', rdaColorSchema);

This is my back end.

router.post('/save', (req, res)=>{
    var rdaColorVal = new rdaColor(
        {
            colorMovementBox: req.body.colorMovementBox,
        }
    );

rdaColorVal.save((err,doc)=> {
    if(!err){

        res.send(doc);}
        else{
            console.log(err);
        }
        });
});

When I debug the project I can see color values in the front end(I have used an ngx-color picker to select colors). But the back- end gives following errors. error

I searched a lot about this error. But nothing worked.




Web crawler in flutter

Giving you a context, my goal is to make a flutter app that logs in my school's website and sends me a notification when monitoring of a given subject is available. The flutter part is not my doubt and may be really easy, but I have absolutely zero experience in crawling through the web in any language. What I did notice about the web page:

  1. When you open it, the browser sends, as cookie, Google Analytics stuff (seems like you're still able to login without sending those) and PHPSESSID. If you send no PHPSESSID, one is returned in response by set-cookie and it's totally functional.
  2. After submiting the form, your registration ("matrícula" in the website) and password ("senha" in the website) are sent as form data in a post to the same URL, but with a "?" at the end. PHPSESSID is also sent as cookie.
  3. This post seems to do nothing, returning status 200. Then another equal post is sent, returning status 302, then I'm able use the website.

The session is probably kept with PHPSESSID, since nothing besides that is provided to the server after already logged in.

I also reproduced these steps with Firefox's network tool (in web developer menu) without the website GUI (sending the first get and both posts manually) and could get access to the page, but when I try to do that in dart with same headers and form data, I always get status 200.

My code:

import 'package:http/http.dart' as http;

// same headers that firefox uses

final Map getHeaders = {
  'Host': 'grupofibonacci.com.br',
  'Connection': 'keep-alive',
  'Pragma': 'no-cache',
  // I probably should not set this User-Agent, but without it also doesn't work
  'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0',
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'Accept-Encoding': 'gzip, deflate',
  'Accept-Language': 'en-GB,en;q=0.5',
  'Cache-Control': 'no-cache',
  'Referer': 'http://grupofi.com.br/',
  'Upgrade-Insecure-Requests': '1'
};

final Map postHeaders = {
  'Host': 'grupofibonacci.com.br',
  'Connection': 'keep-alive',
  'Content-Length': '78',
  'Pragma': 'no-cache',
  'Upgrade-Insecure-Requests': '1',
  'Content-Type': 'application/x-www-form-urlencoded',
  // I probably should not set this User-Agent, but without it also doesn't work
  'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0',
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'Accept-Encoding': 'gzip, deflate',
  'Accept-Language': 'en-GB,en;q=0.5',
  'Referer': 'http://grupofibonacci.com.br/area_aluno.php?',
  'Cache-Control': 'no-cache'
};

void main() {
  final client = new http.Client();

  client.get(
    'http://grupofibonacci.com.br/area_aluno.php',
    headers: getHeaders
  ).then((getResponse) {

    // add the provided PHPSESSID to the post cookie
    final String phpSessionID = getResponse.headers['set-cookie'].split(';')[0];
    postHeaders.addAll({ 'Cookie': phpSessionID });

    client.post(
      'http://grupofibonacci.com.br/area_aluno.php?',
      headers: postHeaders,
      body: '''
        matricula=MY_REGISTRATION&
        senha=MY_PASSWORD&
        matricula_rec=&
        email_rec=&
        email_mat=&
        cpf=
      '''
    ).then((postResponse) {

      // first post does nothing and returns code 200 as usual

      client.post(
        'http://grupofibonacci.com.br/area_aluno.php?',
        headers: postHeaders,
        body: 'matricula=0808018&senha=burr1t0Fr1t0&matricula_rec=&email_rec=&email_mat=&cpf='
      ).then((secondPostResponse) {

        // this second also returns code 200 and does nothing

      });

    });

  });
}

This is as much specific as I can be. What I am doing wrong?




Read the data of the CSV file uploaded from the user

I'm trying to write a Python/Flask script that transforms a csv file into some other file. I've developed a UI so that user can upload a CSV file. I'm having a hard time trying to figure out how to read the data of that CSV file, uploaded from the user.

@app.route('/import', methods=['GET', 'POST'])
    def upload():
        if request.method == 'POST':
            file = request.files['file']
            if not file.filename:
                errors.append("Please select a file!")
            else:
                ...
                data = [GET CSV DATA HERE]
                process_data(data)

How could I get the data from the CSV file so that I could pass on the following method:

def process_data(file):
    with open(file, 'r') as csv_file:
        csv_reader = csv.reader(csv_file, delimiter=',')
        ...

Thank you in advance!




Flashphoner sound noise WebRTC

Hy,is there anyone using flashphoner? if there is, why is sound noise and not clean in device phone receiver? what do I need to fix?

Has anyone ever experienced like me?

thanks




Webscraping Using Beautifulsoup in Python

I am new to the Beautifulsoup package in Python and am getting some unexpected results when using the .findAll() function. I am needing to extract the string immediately to the right of /File/ from the light blue highlighted portion of this webpage:

enter image description here

Here is my Beautifulsoup/Python code:

enter image description here

The first two lines of code work fine, but pdf1 is empty. Can anyone shed some light on why the .findAll() function is not finding this a tag (I assume I am making a syntax error, just not sure where)?




My design cannot displaying in Edge Browser?

All background color of css cannot displaying in EDGE Browser !

How can i solve it and display in all browsers ?




How to get data from MySQL with PHP

Hello all I am tryin to build IOS app and I need to get data my MySQL database. I do not know php. I found a tutorial https://codewithchris.com/iphone-app-connect-to-mysql-database/ In section 3 where we create PHP service I copy it and edit for mine information. PHP code is like that

<?php

//create connection
$con=mysqli_connect("localhost","myuserid","mypassword","i4142489_wp1");

// Check connection
if (mysqli_connect_errno())
{
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

// This SQL statement selects ALL from the table 'Locations'
$sql = "SELECT * FROM treelibrary";

// Check if there are results
if ($result = mysqli_query($con, $sql))
{
    // If so, then create a results array and a temporary one
    // to hold the data
    $resultArray = array();
    $tempArray = array();

// Loop through each row in the result set
while($row = $result->fetch_object())
{
    // Add each row into our results array
    $tempArray = $row;
    array_push($resultArray, $tempArray);
}

// Finally, encode the array to JSON and output the results
echo json_encode($resultArray);
}

// Close connections
mysqli_close($con);

?>

I load it the my server and nothings pops up just the blank page... Is there any reason or where is my mistake. Thanks for helps. Have a nice day.




change the default distance in between the parallel axis in highchart

I am using the high-chart to draw the graph.

Code

Complete code is non JS_Fiddle

Highcharts.chart('container', {
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]

});

Graph: enter image description here

Problem: Problem is that i want to change the distance in between all parallel lines from 50 to 10 as you can see in the image. You can see the code on js_fiddle. I have been search for the solution more than 5 hours. Kindly help me.




Adding web based video subscription to my ios app

I have an existing one time purchase ios app which has bundled into it a set of learning videos. I also have a learning video annual subscription website. I want to bring in the video subscription website into my app but adding ios in app purchase. Which would mean that user will purchase the in app feature and then be able to view in app the videos from the subscription website. The challenge here is how do we communicate to the web server that a particular user has purchased the in app subscription and create an account on the website for the user. The subscription website currently requires the user to create an account and make payments after which he can see the videos. After inapp purchase we can let the user create an account and let him view the videos. How do we make it fool proof against unauthorized access by someone impersonating as an ipad/iphone user. Any thoughts will be helpful. Thanks




How to fetch an Array from MySQL with PHP

In my database I have POSTed following JSON with REST API:

{
    "author": "Someone",
    "hero_name": "Iron Man",
    "hero_desc": ["Iron", "Man"],
}

Now in myPhpAdmin Table, the entry says only Array for the hero_desc.

I cannot figure out how to get the actual items in that array.. for example to fetch Iron from hero_desc.

Here is how it gets returned with GET request:

{
    "id": "11",
    "user_id": "1",
    "author": "Someone",
    "hero_name": "Iron Man",
    "hero_desc": "Array",
}

I am quite new to PHP so I am worried that I would need to mess up my whole app architecture to get this to work. I though PHP can handle fetching arrays by default if it sees it's an JSON Array.




Redirect http to https, non www to www and main site to subfolder with htacess

I am trying to redirect my site to use https, www and subfolder redirect but I am failing to do so. I want multiple access codes, means a code that can redirect HTTP to https, non-www to www and main site to subfolder at the same time.

I want to redirect all the main domain traffic of https://nokiamobile.co.uk to https://www.nokiamobile.co.uk/forums

How can I do that with .htaccess in the root folder of the domain?




samedi 29 septembre 2018

What does substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], dirname(__FILE__))) mean in php?

While studying php, I found the source code below.

substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], dirname(__FILE__)));

I ran this and it came out with ''(empty string).

What does this mean?




How do I remove these whitespaces of my site?

I am making a shop for my server, the shop lets me edit only the css, which I am doing, but in the shop there is a giant white space to the right, top and bottom of the screen.

I tried looking for css solutions, non of them worked.

How do I fix this?

WEBSITE: http://purgepvp-mc.tebex.io/?theme=174117

**CSS*:*

        @import url(http://fonts.googleapis.com/css?family=Lato;
    @import url(http://fonts.googleapis.com/css?family=Futura);

    .header {

        background-size: cover;
        padding: 20px;
        margin: 0;
        background-image: url("https://i.imgur.com/eFt7yL2.jpg");        

    }

    .progress-bar {

      background-color: #592e89  

    }

    body > .container {
        width: 100% !important;
        padding: 0 !important;
        background: #757575;
    }


    .panel-heading {

        border-radius: 0px !important;
        border: 0px !important;
        height: 40px !important;
        background-color: #592e89 !important;
        color: #FFF !important;
        border-radius: 0px !important;


    }

    .logo {





    }

    .panel {

        border: none !important;
        border-radius: 0px !important;


    }

    .panel-body {


        color: #FFF !important;
        border-radius: 0px !important;
        background-color: #3a3a3a;

    }


    .content {


        border: none !important;


    }

    .navbar {

        border-radius: 1px;
        color: white;
        background-color: #592e89;
        border: none !important;

    }


    .donation-goal {

        font-weight: bold;

    }

    .nav {
        margin: 0 auto;
        text-align: center;
        display: block;
        width: max-content;
        float: initial;'
        font-weight: bold;'

    }

    .nav a, .nav li {
        color: #FFF !important;
        transition: all 0.2s linear;
        text-decoration: none !important;
        font-weight: bold;
    }



    .nav li:hover, .nav li:hover a {
        background-color: #3a3a3a;
        color: #FFF !important;
        text-decoration: none !important;
        border-radius: 20px;
        font-weight: bold;

    }






    @-webkit-keyframes pulse {
      0% {
        -webkit-transform: scale(1);
      }
      50% {
        -webkit-transform: scale(1.1);
      }
      100% {
        -webkit-transform: scale(1);
      }
    }

    @keyframes pulse {
      0% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.1);
      }
      100% {
        transform: scale(1);
      }
    }




    .logo img {
        content: url('https://i.imgur.com/S7Lfi8X.jpg');
        height: initial !important;
        width: 600px;
        margin: 0 auto;
        display: block;
    }

    .logo {
        width: 100% !important;
      animation: pulse 3s infinite;
      margin: 0 auto;
      display: table;
      margin-top: 50px;
      animation-direction: alternate;
      -webkit-animation-name: pulse;
      animation-name: pulse;
    }



    .footer {

        border-top: 5px solid #592e89;
        background-color: #3a3a3a;
        padding-bottom: 30px;
        font-weight: bold;

    }




Program to increase a single point a day

how can I write a program that increases one point a day and display the message you already have point when I try to increase a point again?




I just used "SELECT * FORM table1" but" java.sql.SQLSyntaxErrorException" [on hold]

this is my code.

    String username1 = request.getParameter("username");
    String password1 = request.getParameter("password");
    Class.forName("com.mysql.jdbc.Driver");
    Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/testjdbc?serverTimezone=UTC&characterEncoding=utf-8","root","123456");
    Statement stmt = connection.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FORM table1");
    while(rs.next()){
        out.println(rs.getString("username"));
        out.println(rs.getString("password"));
    }

when I run it, I get some error,I don't know why. I just used "SELECT * FORM table1",I'm sure table1 exists.

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FORM table1' at line 1
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1218)
    at org.apache.jsp.dologin_jsp._jspService(dologin_jsp.java:136)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at...




PHP rot13 with ASCII

I want to make simple encryption with rot13, but i don't want use function str_rot13(), because I want add numbers on it and I think str_rot13() isn't supported. I have found code like this and want to edit, but I don't know how

<?php 

$string = "Hello World 123";

for ($i = 0, $j = strlen( $string); $i < $j; $i++) 
{
    // Get the ASCII character for the current character
    $char = ord( $string[$i]); 


    // If that character is in the range A-Z or a-z, add 13 to its ASCII value
    if( ($char >= 65  && $char <= 90) || ($char >= 97 && $char <= 122)) 
    {
        $char += 13; 

        // If we should have wrapped around the alphabet, subtract 26
        if( $char > 122 || ( $char > 90 && ord( $string[$i]) < 97)) 
        {
            $char -= 26;
        }
    }
    echo chr( $char);
}

 ?>

this code have result "Uryyb Jbeyq 123". What I want is add number 0-9 on it, so encryption become rot18 -> a-z0123456789. Result of this so become "Zw336 E693v JKL"




Jsoup: Can't extract img tag

I'm trying to extract the image source of a few ads but I don't understand what i'm doing wrong :( The html tag that i want to extract looks like this: enter image description here

Code:

Elements pageSearchImg = page2.select("a[id^=item] > div[class=placeholder] > div[class=overflow_image] > img");
        for (int m = 0; m < pageSearchImg.size(); m++) {
                String img = pageSearchImg.get(m).attr("src");
                System.out.println(img);
        }

I guess there might be something wrong with a tag?




How do big websites use Python?

I'm planning a website that uses predictive technologies and machine learning to calculate probabilities. I created a code in python using some libraries where it predicted the name of a client based on the characteristics (age, sex, etc), I would implement this code in a web application where the official language of the site is not python (is not defined yet).

What I would like to know is: how can YouTube, Google, Instagram and Netflix be able to use python technology in websites or apps? With django? Or do they use something to externally implement the functions in python? If so, what is this technology called?

If possible, I would like to know the same about ruby on rails.




Store data on server without Database

I’m webGL engine developer (ThreeJS) in small company. We have some events in few weeks and my boss just told me that i have to make registration form as soon as possible, also one page should show names, lastnames and company of all registered members. Problem is that i’m very bad in databases and i have really small amount of time to re-learn it. How can i store registration data on Server without Database? I looked up on web and most instructions are unclear(because i’ve not worked on database before) and others are using localstorage (as far as i know its used for cacheing data)




Identify Google user from third party web application

I'm developing an Android application that connects to a web service written in PHP and saves/retrieves some user information.

I need a way to securely identify users of that application on the web server. I can easily use AccountManager to retrieve user email and send it to the web server, but what is the simplest way to authenticate it?

My web service doesn't use any Google services/APIs. The only thing that I need is to confirm (on web server side) that user@gmail.com is really user@gmail.com.




What is the best directory to put docker project on Mac

On ubuntu I was developed an php application on docker in /var/www/website_name directory.

/var/www it's the standard location on linux systems, but what is the best path on Mac OS for website project? I know I can use every location but maybe there is any better?




CSS and HTML coding - Big J's Deep Dish Pizza

I am trying to redesign a website using HTML and CSS with the help of my textbook, but I am running across an issue... There are certain contents of the website that do not appear the way they are supposed to like the figure shown in my textbook. I am not sure what I am doing wrong but my assignment is due tonight, I need help! auughh :/ I also had just got into a car accident yesterday and am suffering of a concussion so looking at the screen for long periods of time is very irritating to me D: down below in the comments I have included the CSS code and what my website looks like as well as what the website is supposed to actually look like.. I dont know what I am doing wrong? the white background in the back seems to have disappeared as well but I have followed all the steps. I am very confused.




Web design tool for free

Is there any good free web design tools available which also give a css file based on the design made?

I have used W3schools css file before but now I want to design the page on my own.




There are problems when i try to connect laravel with mongodb .. any Solution?

These are errors

There are problems when i try to connect laravel with mongodb .. any Solution ? Error Image Link




Electron: Why occurs 'Uncaught ReferenceError: require is no defined.'?

I have to occur some problem when I develop program by using 'Electron'.

First, I was typing require() code in 'main.js'.

const { app, BrowserWindow, globalShortcut, Menu, ipcMain } = require('electron')

Above code is no error from console. And I have creating another source file 'func.js'.

I was typing require() code in 'func.js'.

const { ipcRenderer, remote } = require('electron')

But above code is occur error from console.

So I don't know what is wrong. The ES6 script uses the import () statement, but I do not really know if there was an error in 'main.js', but I do not know why other files fail.




IIS site accessible using hostname, not accessible by ip

all works when ran like this: site.com/resource

but this: 192.168.1.14/resource

doesn't. here are the bindings & hosts file & ip listen list:

bindings: enter image description here

hosts file:

    # Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
192.168.1.14 www.site.com
192.168.1.14 site.com
#   ::1             localhost

ip listen list: (although i think this is negligible) 192.168.1.14

firewall turned down.

anyone can help with this?

thanks ahead




Our Web site is pretty? www.turkiyeemlak.com.tr

www.turkiyeemlak.com.tr

How is our web site's domain

What do you think about our website for that design,easy using vs.




Generate uuid v1 based ticks

Is that possible, to generate uuid v1 via date tick ? For example I have current ticks : 62135596800098765 can I get uuid in php?




Create React States Using Classes

I'm just starting with react. I've seen that most state are comprised of simple data such as object, string, numbers, etc... I was hoping to be able to use a renderless class to hold and control a state like this:

import React, { Component } from 'react';
import HumanPlayer from "./players/HumanPlayer";
import Money from "./Money";
import ComputerPlayer from "./players/ComputerPlayer";
import Deck from "./cards/Deck";
import HumanBoard from "./views/PlayerBoard";
import Score from "./views/Score";
import ComputerBoard from "./views/ComputerBoard";
import Controls from "./views/Controls";

class BlackJack extends Component {

  constructor(props) {
    super(props);
    const human = new HumanPlayer({
      money: new Money({
        currency: Money.USD,
        amount: 100
      })
    });

    super(human);
    const computer = new ComputerPlayer;

    this.state = {
      human: human,
      computer: computer,
      deck: new Deck
    };
  }

  render() {
    const me = this;

    return (
        <div className="BlackJack">
          BlackJack
          <HumanBoard player={me.state.human}/>
          <Score money={me.state.human.getTotal()}/>
          <ComputerBoard player={me.state.computer}/>
          <Controls/>
        </div>
    );
  }
}

export default BlackJack;

Is there a good way to do this or is this more of an anti-pattern?




Should i do NAT myself in establishing web RTC connection between two browsers over different network on internet?

I have implemented webRTC peer to peer connection and the code works fine in my local network . I have taken video stream and injected the stream over RTCPeer connection . It is showing the video of the remote host . SSL certificate is valid now before on my xampp it was being the issue and i hosted the js script on live website with ssl configured and i tested again but i am not able to see the remote host video and not getting any error over console . My question here is should i do NAT explicitly for webRTC code to work over internet or WebRTC does that for me.




vendredi 28 septembre 2018

Asking about Apache HTTP and TOMEE

I'm confused about these two components in relation to client-application server. From what I have understood so far, Apache HTTP is a module that displays the content of the website (Website is run by Tomee Service). So the diagram would be like:

   client ->apache http (front end) ->tomeeplus(web-service)
   client -<apache http (front end) <-tomeeplus(web-service)

am I right?
So the apache http responsiblity is to display the content of website is requested by the client. The requested url then goes to Application server (tomee) then extracts out the page and sends back to apache http and then displays on the client browser.

AM I right?




How to use Vuforia Web Services API with JavaScript?

I've trying several things but nothing is really working. There are some examples in Vuforia Web Services API documentation using PHP but there's nothing with JavaScript.




How to make sure that name fits in the designated space on the website

So I am building a quick small website. In the website, when the user is logging in, the website asks for the name. In my database, I have allocated a VARCHAR(255) for the username and restrict the first name to 50 characters when the user is logging in. However, I have no clue how to make sure that the any of the names being displayed on the website don't overflow their designated container. I don't want to use word-wrap: break-word and overflow: auto because I don't want to break up the name or hide part of it. I just want to make sure it fits in its container. How can I make sure that it fits? Thanks in advance.

Yang




FLASK listen / bind host to multiple IPs addresses

I want to serve my flask app, and bind to two hosts. first is localhost, 127.0.0.1, and also the LAN IP address (192.168.1.143)

I want to do something like this:

flask run --host=127.0.0.1 --host=192.168.1.143

or

flask run --host=127.0.0.1,192.168.1.143

but this does not work.

I do NOT want to listen on 0.0.0.0 (all interfaces) due to security reasons. I only want traffic coming from LAN and localhost.

I'm thinking I need to put apache or NGINX in front of my flask app, and do binding this way, but I am not sure how to do this, or where to search.

Any help would be appreciated.




PHP script fails to use gmail to send an email

ERROR MESSAGE : Connection: opening to smtp.gmail.com:465, timeout=300, options=array()
2018-09-28 22:35:36 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.gmail.com:465 (Permission denied) [path/vendor/phpmailer/phpmailer/src/SMTP.php line 325]
2018-09-28 22:35:36 SMTP ERROR: Failed to connect to server: Permission denied (13)
SMTP connect() failed

I have tried to use the smtp IP address. I tried different ports, 25 and some other one. I am using a digital Ocean server. They confirmed that they are not blocking any ports.

I am suspicious of my gmail account. Turn on less secure app. Did the captchat unlock. maybe google is killing the request. I also tried a different email

I followed the github guide. I simply changed my username, password and the emails information. I am using centos 7. I feel like the script ran well but something else on the networking side.




Internal website corrupts browser profile somehow

At work we have an internal website which seems to, at random and rarely, stop working for a particular browser on a users computer. Might be Firefox. Might be Chrome. Whichever. It might be the reports hang (tab thread goes to 100%, needs to be killed), might be an entity management bit which stops working. All seemingly at random.

Trying Incognito/Private doesn't fix it. Trying to clear the cached files & images doesn't help. Nothing in the Developer Tools console, the Network call is showing HTTP 200 return for the call, etc. Then I tried something interesting. On one persons Chrome browser, I tried "Open Guest Window". That worked.

My conclusion is, somehow, something corrupts a bit of the user profile which somehow only affects just our website. Am I off? Is there somewhere I can look to corroborate this hypothesis?

We're running some older version of Angular, older versions of Jetty with Spring/JAX-RS backend, etc.

I'm getting a bit desperate here, as a small bit of the site services external clients so they can see their stats, and we're getting reports from a couple of them that this is happening to them too. Any possibility that can be checked would be appreciated.




Is it possible to collect and display web page performance data using window.performance and/or PerformanceEntry

I've been looking into the the "PerformanceEntry" and "window.performance" objects in order to collect/display some statics on a page built for my support team.

Specifically I'd like to be able to tell:

  • How long the total page load took (from request to page is done loading)
  • How long the browser too to render the page
  • How long the transfer of the page took
  • How long the server worked on the request

For instance: Page Load: 2.39s Render time: .89s Transfer time: 1.30s Server side time: .2s

Is this information in the window.performance object? If so please help me understand how/where I can obtain this info as I've googled a bit for it and I don't see any good documentation explaining things.




Can I use web browser and javascript to implement client scoket program

Can I implement a BSD client socket program using web browser and javascript that would communicate with an embedded web server BSD socket program running in a microcontroller programmed in C to transfer large files? If so, should I be looking at socket.io or where do I start (I'm a beginner javascript programmer)? And will the programming be as straightforward as BSD client server socket program interaction in C?

Thanks. Jay




PHP REST API with nested routes

I want to create a pure PHP REST API and I am quite new in backend development field, but I am experienced software developer, so some concepts are known to me.

However, after watching several tutorials on how to create REST API with PHP, all instructors were using simpler examples, where no nesting exists.

Simple Example:

GET /api/category/read.php

However, I want to create something like this:

GET /api/{user_id}/{folder_id}/{file_name}/read.php

I am struggling to find any tutorial covering this with PHP. And I have spent several hours trying to figure it out by myself by trying to modify the code I have seen in Tutorial videos. I mean if I do like they do, this would mean manually creating folders in my Project Folder for each {user_id} and so forth for each sub-folder... but I do not think that such hardcoding is the solution.

I have found some SO questions here relating closely to my question, but none have satisfying answers - makes me wonder that this if this is possible to do at all. But it seems so common (for example, I know that GitHub API has just that support /{user}/repos) so I think it should be doable.

I would be really grateful if someone could help me out how to accomplish my goal. If not else, pointing to a tutorial / documentation that does just that is equivalently appreciated!




Compilation error "undefined" in sass-compiler for Visual Studio

I am getting this error when compiling valid SASS in my App.scss file.

enter image description here

If I delete the import statement, the error fires on the next import statement. If I rename the file (there is only one file to be imported - I checked in Windows Explorer), the erorr fires regardless of the name.




How do I make my user STUDENT retrieve and display classrooms he/she belong to?

I'm having a difficulty of retrieving and displaying the classes of a student user which he/she belong. In my web app, there are 2 types of user: Teacher and Student

Teacher
- can create and view classrooms

Student
- can join and view classrooms

These codes allows the user Teacher to create and display the classrooms:

  if(userRole.innerHTML == "Teacher"){
      var userRef = firebase.database().ref().child('Classes' + '/' + 
                                                             user.uid);
      userRef.on('child_added', function(data){
          var roomNames = data.val().TheClass;
          var Studentx = data.val().MyStudents;
          var studentRawList = '';

          for (var key in Studentx) {
              studentRawList += ('['+Studentx[key].Studentname + ']');
              var classD = data.val().ClassID;
              var ul = document.createElement('ul');
              document.getElementById('myList').appendChild(ul);
              var li = document.createElement('li');
              ul.appendChild(li);

              Object.keys(roomNames).forEach(function(key){
                  li.innerHTML += '<span onclick="clickDone(this)">'
                                  +roomNames[key]+'</span>
                                  <ul style="display:none">
                                  <li>Class Id : '+classD+'</li>
                                  <li><span onclick="clickDone(this)">
                                  Students :
                                  </span><ul style="display:none">
                                  <li>'+studentRawList+'</li>
                                  </ul></li></ul>';
                          })
                       })
                     }
                    }

These codes allows the user Student to join a particular classroom but will not display in the html.

function addclass(){

  var addclassID = document.getElementById("classroomID").value;
  var teacherUID =document.getElementById("teachID").value;
  var studentUID = user.uid;
  var studentName = user.displayName;
  var classRef = firebase.database()
                .ref().child('Classes').child(teacherUID);
  classRef.orderByChild("ClassID").equalTo(addclassID)
  .once("child_added", function(snapshot) {

      var studentsRef = snapshot.ref.child("MyStudents");
      studentsRef.child(studentUID).set({ Studentname: studentName });
    })

I tried to use these codes to allow the user Student to view/display the classes he/she joined:

else if(homeRole.innerHTML == "Student"){

var studentClassRef = firebase.database().ref()
                      .child('Classes' + '/' + user.uid);

    studentClassRef.on('child_added', function(data){

      var roomNamess = data.val().TheClass;
      var Studentxx = data.val().MyStudents;
      var classDD = data.val().ClassID;

      var ul2 = document.createElement('ul');
      document.getElementById('myLista').appendChild(ul2);
      var li2 = document.createElement('li');
      ul2.appendChild(li2);


      var studentRawLists= '';
      for (var keys in Studentxx) {
        if(studentxx[keys].Studentname == user.displayName){
          studentRawLists += ('['+Studentxx[keys].Studentname + ']');
      }    
          Object.keys(roomNamess).forEach(function(keyz){
            li2.innerHTML += '<span onclick="clickDone(this)">'
                             +roomNamess[keyz]+'</span>
                             <ul style="display:none">
                             <li>Class Id : '+classDD+'</li>
                             <li><span onclick="clickDone(this)">
                              Students :</span>
                             <ul style="display:none">
                             <li>'+studentRawLists+'</li></ul></li></ul>';

        })


    }
  })

I thought that if I use this line

    for (var keys in Studentxx) {
        if(studentxx[keys].Studentname == user.displayName){
          studentRawLists += ('['+Studentxx[keys].Studentname + ']');
      }  

the names that are match to the user Student name will be stored in the studentRawLists

What went wrong? Are there any alternative way of retrieving and displaying the classrooms for Students?

and the JSON:

{
  "Accounts" : {
    "FykyhzEZjndylFj3BbCnPqoTGDo1" : {
      "displayName" : "Dodong Advices",
      "email" : "advicenidodong@gmail.com",
      "status" : "Teacher"
    },
    "HOgdSlTed9V8g0kSZjizgODMDOe2" : {
      "displayName" : "Sweet Macaroni",
      "email" : "Sweet@gmail.com",
      "status" : "Student"
    },
    "yJif4ReTxCcGmo682xWSG3L5MKE3" : {
      "displayName" : "Purple Salad",
      "email" : "Purple@gmail.com",
      "status" : "Student"
    }
  },
  "Classes" : {
    "FykyhzEZjndylFj3BbCnPqoTGDo1" : {
      "-LMpvlBl3mEazhxaJwqb" : {
        "ClassID" : "6503-3503-6827",
        "Teacher" : "Dodong Advices",
        "TeacherID" : "FykyhzEZjndylFj3BbCnPqoTGDo1",
        "TheClass" : "StackMates"
      },
      "-LMrfIBg8v-hj1k8X2Qf" : {
        "ClassID" : "7583-2402-2757",
        "MyStudents" : {
          "HOgdSlTed9V8g0kSZjizgODMDOe2" : {
            "Studentname" : "Sweet Macaroni"
          }
        },
        "Teacher" : "Dodong Advices",
        "TeacherID" : "FykyhzEZjndylFj3BbCnPqoTGDo1",
        "TheClass" : "asdasd"
      },
      "-LMrfMV1aw3YNA0PfooR" : {
        "ClassID" : "8083-2712-3347",
        "MyStudents" : {
          "HOgdSlTed9V8g0kSZjizgODMDOe2" : {
            "Studentname" : "Sweet Macaroni"
          },
          "yJif4ReTxCcGmo682xWSG3L5MKE3" : {
            "Studentname" : "Purple Salad"
          }
        },
        "Teacher" : "Dodong Advices",
        "TeacherID" : "FykyhzEZjndylFj3BbCnPqoTGDo1",
        "TheClass" : "Trial"
      }
     }
    }
   }

So if I use the user Sweet Macaroni there should be 2 classrooms displayed in the HTML namely: Classroom Trial and asdasd and only 1 for the user Purple Salad




how to configure URL like this with specific name or something after padlock

how to configure URL like this with specific name or something after padlock

i mentioned about red color thing inside red color square




Turning off both browser autocomplete(history based) and autofill (context based)

I've a (generic) widget which provides its own suggestions to assist user in selecting a value for that form field. The problem is that browser autofill and autocomplete suggestions obstruct my widget's popup from making a selection.

From what I've observed while playing with google chrome browser, setting autocomplete="off" turns off the history based autocomplete feature. Setting autocomplete="some-value-browsers-don't-understand" turns off the context based autofill feature. I need to turn off both these features, and the problem here is that same autocomplete attribute on input element is being used for two different purposes by the browsers.

Is there a way to turn off both autocomplete and autofill feature of the browsers that works in all major browsers? If needed I can drop the name attribute on my input element if it can help achieve a solution for this. From my observations, even without the name attribute on the input element, the browser does try to provide autofill suggestions.

PS 1: This question is different from the ones answered earlier here in SO, the other questions don't address both these problems together.

PS 2: As per WHATWG spec, if the application provides its own autocomplete mechanism, then autocomplete="off" needs to be set on the input element. But obviously looks like google chrome (and possibly others) doesn't honor this.




Where is the best place to learn Web Programming

dear coders. I have a question . I love to code , but unfortunately this is kind of a hobby , not profession. I want to become a web developer and work that fulltime . My question is which is the best place to learn online , has anyone already did such a learning and can online learning really create a professional web developer. Also if you like donate to my campaign : https://www.gofundme.com/ffbzv-help-me-make-my-dream-a-reality




Two way binding in jsp

I have written a web application using spring mvc and angular.Now I want to convert the angular code to jsp.So, I want to simulate ng-model in angular to jsp.Is it possible to replace ng-model with some jsp equivalent?I want two way binding.If possible please Illustrate.




use php library without composer

Any1 got a idea how to use this library since i cant use composer?

https://github.com/unsplash/unsplash-php

since i never worked with composer before i dont now how to use this library

Crew\Unsplash\HttpClient::init([
   'applicationId'  => 'YOUR APPLICATION ID',
   'secret'     => 'YOUR APPLICATION SECRET',
   'callbackUrl'    => 'https://your-application.com/oauth/callback',
   'utmSource' => 'NAME OF YOUR APPLICATION'
]);


$search = 'forest';
$page = 3;
$per_page = 15;
$orientation = 'landscape';

Crew\Unsplash\Search::photos($search, $page, $per_page, $orientation);




IHTMLElement Click not advancing HTMLDocument to next page

I'm trying to navigate to page x of several pages of search results in Startpage.com. I can successfully parse the object to an IHTMLElement.getElementByID("2"); and I use it's Click() event to fire the javascript behind it. Still the document stays on the first page of search results.

private void GetNextPage(int i_page)
{
   HTMLDocument hdoc_Doc = (HTMLDocument)wb1.Document; // wb1 is at page one of search results
   IHTMLElement element_Page = hdoc_Doc.getElementByID(i_page.ToString());
   if (null != element_Page)
   {
       element_Page.click();
   }
   // Now check to see which titles are showing
   IHTMLElement element_OneCheck = hdoc.getElementByID("title_1"); // Page one search results
   IHTMLElement element_TwoCheck = hdoc.getElementByID("title_11"); // this is on page 2 search results if it gets there...
   if (null != element_OneCheck)
       Console.WriteLine("Page One Still...");
   if (null != element_TwoCheck)
       Console.WriteLine("Page Two found...");
}

The result is: "Page One Still..." I have even tried direct action on the document:

hdoc_Doc.getElementByID("2").click;

Once again this worked but did not advance the document to the next page of search results. I have also parsed this out with the HTMLAgilityPack, but that is for parsing not processing a javascript link, which is why I went this route.

Any help would be much appreciated! I am on .NET 4.0 using VS 2010 (yes, I know it is old, but is Ultimate versus the free versions I have for the newer VS - so I stick with 2010 for full environment.)




jeudi 27 septembre 2018

API'S REST Results: Sabe in Cassandra/MongoSB or cache un Redis?

I need to consume many API's (Twitter, Reddit ...) and show the result on the front of my website.

For example: Get all tweets with #reddit hashtag and show them on the web.

Two ideas in my mind: Save these results in NoSQL and update on every API call or temporarily cache the results of the calls

Possible problems if I use DB: Many accesses to the database

Possible problems if I use Redis: Not enough memory to store all the results of the API calls.

How do you guys/girls see it?




Is there any open-source web service package to view images on remote server like viewing them on local disk?

I have a remote server, which I cannot SSH directly but I can setup any web service on the server. For my work, I need to frequently view images on the remote server. I expect a web page, where I choose a directory on the server, it automatically show the images files under this directory (not just list the file names). If there are a lot of images, it provides function such as "previous n images, next n images" which the value of N can be set.

I know it is not very complicated to implement it in php or something like that, but I am not familiar with web service programming. So I am wondering if there is any open source package like this?




How do I make an image slider with list items generated from an array

I am trying to make an fade-in-out slider show. Here is the sliding show code with static html code:

var slider = document.getElementById("slider");
var slideArray = slider.getElementsByTagName("li");
var slideMax = slideArray.length - 1;
var curSlideNo = 0;
var nextSlideNo =null;
var fadeStart = false;
var curSlideLevel = 1;
var nextSlideLevel = 0;

for (i = 0; i <= slideMax; i++) {
    if (i === curSlideNo) changeOpacity(slideArray[i], 1);
    else changeOpacity(slideArray[i], 0);
}

function startSlide(dir)
{
    if (fadeStart === true) return;
    if( dir === "prev" )
    {
        nextSlideNo = curSlideNo - 1;
        if ( nextSlideNo < 0 ) nextSlideNo = slideMax;
    }
    else if( dir === "next" )
    {
        nextSlideNo = curSlideNo + 1;
        if ( nextSlideNo > slideMax ) nextSlideNo = 0;
    }
    else
    {
        fadeStart = false;
        return;
    }
    fadeStart = true;
    changeOpacity(slideArray[curSlideNo], curSlideLevel);
    changeOpacity(slideArray[nextSlideNo], nextSlideLevel);
    fadeInOutAction(dir);
}

function fadeInOutAction(dir)
{
    curSlideLevel = curSlideLevel - 0.1;
    nextSlideLevel = nextSlideLevel + 0.1;
    if( curSlideLevel <= 0 )
    {
        changeOpacity(slideArray[curSlideNo], 0);
        changeOpacity(slideArray[nextSlideNo], 1);
        if(dir === "prev")
        {
            curSlideNo = curSlideNo - 1;
            if (curSlideNo < 0) curSlideNo = slideMax;
        }
        else
        {
            curSlideNo = curSlideNo + 1;
            if (curSlideNo > slideMax) curSlideNo = 0;
        }
        curSlideLevel = 1;
        nextSlideLevel = 0;
        fadeStart = false;
        return;
    }
    changeOpacity(slideArray[curSlideNo], curSlideLevel);
    changeOpacity(slideArray[nextSlideNo], nextSlideLevel);
    setTimeout(function () {
        fadeInOutAction(dir);
    }, 100);
}

function changeOpacity(obj,level)
{
    obj.style.opacity = level;
    obj.style.MozOpacity = level;
    obj.style.KhtmlOpacity = level;
    obj.style.MsFilter = "'progid:DXImageTransform.Microsoft.Alpha(Opacity=" + (level * 100) + ")'";
    obj.style.filter = "alpha(opacity=" + (level * 100) + ");";
}

var autoslider = setInterval( function(){startSlide('next');}, 1000);
autoslider;

actually, this code worked properly when html code was like that

   <ul id="slider">
        <li><img src="images/cafe.png"/></li>
        <li><img src="images/cafe2.png"/></li>
        <li><img src="images/cafe3.png"/></li>
    </ul>

but images from server can be changed or added.
so, I thought making it dynamic would be better.
this is added code

if(xhr.readyState===XMLHttpRequest.DONE){
        if(xhr.status===200){
            var test=xhr.response.replace(/["]/g,'');
            test= test.substring(1,test.length-1);
            let test2=test.split(",");
            alert(test2);

            let lis=document.createElement("li");

            for(var i=0; i<test2.length; ++i){
                let imgNode=document.createElement("img");
                imgNode.setAttribute("src", url+test2[i]);
                lis.appendChild(imgNode);
            }
            document.getElementById("slider").appendChild(lis);

        }else{
            alert(`:'(`);
        }
    }

but this time, it doesn't work.
no sliding show but the images are listed vertically.
how could I make this sliding show? What should I edit?




Send text message to web from http

Here I have a web app which I can text message in the message box and click on "post" (like web facebook you can write comments). Is there any way that I can post the message by writing some code in java with the help of HTTP? The information I find out that might be helping: 1. In devtool there are some get method through which I can extract content but there is no set method to post or change the content. 2. By inspecting post button I found a corresponding js: onclick="return P.text_editor.save('new_followup')"




Unknown data is added via the proxy

Can i ask here?. i have some problem.

i am Java Web Developer.

i made api that is just only text in the html content.

but client program have more data.

under is example.

My page content send

<html>
  <body>
    conetnt
  </body>
</html>

but Client program is have more text

<html>
  <body>
    conetnt
  </body>
</html>


tml>

0000

Why More added text?

Client Program is C Language.

What is Problem?? Help me...

I think Proxy is bad. I have test No useed Proxy. it is good work.

but used Porxy have more text. T.T It is My problem? or Client problem? anyway i want help me plz....




How to get more than 10000 results through sonarqube web API

I`m doing some research using sonarcloud. I need to get more than 10000 issues result through url https://sonarcloud.io/api/issues/search?languages=java, but the response is ‘msg":"Can return only the first 10000 results. 10500th result asked.’ how can i do to get the results of rest of them?




How to set a property true by clicking on a button on carousel in Vuetify

I have a component for my Carousel:

<template>
   <div class="caro">
    <v-carousel >
     <v-carousel-item
      v-for="(item,i) in items"
      :key="i"
      :src="item.src"
     >
     <div class="title">
      <v-btn color="error" dark large></v-btn>
     </div>
    </v-carousel-item>
   </v-carousel>
   <p> Configure the rack in few easy steps. Click on the part you want. 
     to start from</p>
   </div>
</template>

    <script>
  export default {
    props:['showRackSec', 'showSubrackSec', 'showParts', 'showDatabase'],
    data () {
      return {
        items: [
          {
            id: 'rack', src: 'https://cdn.vuetifyjs.com/images/carousel/squirrel.jpg', title:'Rack Section'
          },
          {
            id: 'subrack', src: 'https://cdn.vuetifyjs.com/images/carousel/sky.jpg' , title: 'Subrack Section'
          },
          {
            id: 'parts', src: 'https://cdn.vuetifyjs.com/images/carousel/bird.jpg' , title: 'Parts Section'
          },
          {
            id: 'admin', src: 'https://cdn.vuetifyjs.com/images/carousel/bird.jpg' , title: 'Admin Section'
          }
        ]
      }
    }

I have another component (parent) that passes the props to Carousel.vue. All these props ('showRackSec', 'showSubrackSec', 'showParts', 'showDatabase') are initially false set by parent component.

I want to set them to true by clicking on the button on the carousel. For example when carousel is showing the "Subrack Section" and I click on the button it should set "showSubrackSec" to true.

What's the best way to do it?




Is there a way I can use bash or apple script to open Safari in Responsive design mode with a screen size set?

I'm looking to send a client to a URL that will be displayed on very particular screen size that isn't a standard horizontal screen. I can use Safari's Responsive design mode to set the exact dimensions (by the way of an ugly slider) and preview what the design will look like.

But clients aren't used to using these tool, so I wondered if I could make a script or action that I can send the client to executes that will put safari into the responsive design mode (with screen size set).

Appreciate any suggestions you might have.




How to zoom picture in asp.net web forms imagebutton

I have an asp.net web forms application which displays a picture of the user's choosing in an ImageButton web control. I am choosing this particular control because I want to record the position of clicks in the display. In my line of work, we use very large images, up to 7200 x 4800 pixels. I have a few questions about displaying such a large image. I want to keep the ImageButton control a decent size (i.e. 900 x 600 pixels), but I want to keep the picture its native size. How do I program an ImageButton to do this? I preferably want to do this in c# or in css.

I already tried this in css:

.main_container {
    blah
    blah
 }
.main_container > .imgbutton_container {
                      float: left;
                  }

I want to show the picture like in the screenshot attached to the question

I did something similar with an Image control In this case I just nested the Image control inside the Panel control without setting Image size in the .aspx file.

Also, how can I zoom the image when the user performs an event with the mouse? (i.e clicking a radiobuttonlist item)




Converting jquery code to pure javascript

I need to convert this piece of jquery code:

$(document).ready(function() {
            $(".menu-icon").on("click", function() {
                  $("nav ul").toggleClass("showing");
            });
      });

to pure javascript, the reason is that i dont want to use jquery library on my page thanks for any help :)




Is there any way to create a website in kotlin?

I want to create a website in kotlin. Is there any way or IDE that I can use to create website in kotlin? If is there any way so please tell me or any IDE name that uses kotlin for web-development.




CustomValidator OnServerValidate Method Determine Validator ID Received

I am thinking my answer may be no, but wanted to verify if I am able to grab the ID from the CustomValidator in the method that the CustomValidator calls. I say this because I have created a CustomValidator method that does the same thing for multiple date fields. However, I would like to make the RequiredValidator Visible=False for each of the controls, on a case by case basis, so that they don't take up space like they do when they are set to visibility:hidden in the span.

Can I do this? I haven't been able to find anything that even addresses this issue.




How do I force Azure Apps to use latest html file?

I have a web application hosted on azure apps that I publish using visual studio. It is a flask app. One of the templates is called searchresult.html. I am making changes to this file that are made when I run locally. When I run it on the server though the changes are absent.

Using the azure console I can see that the changes are present in the file that is stored on the server, but the application continues to deliver the old html.

How can I force azure to see my updated file?

Thanks




How to parse a file containing html using JSOUP?

I have files containing HTML and I am trying to parse that file and then tokenise the text of the body. I achieve this through:

     docs = JSOUP.parse("myFile","UTF-8","");
      System.out.println(docs.boy().text()); 

The above codes work fine but the problem is TEXT that is present outside of html tags without any tag is also printed as part of the body tags. I need to find a way to stop this text outside of HTML tags from being read Help this is a time sensitive question !




set binding context for custom element aurelia

I want to set the binding context for my custom element. something like

<my-custom-element context.bind="someproperty"></my-custom-element>

How can this be achieved? Thanks.




How to display Chinese characters in java web applications?

I use Itext 5 to create pdf file. I refer to https://developers.itextpdf.com/examples/itext-action-second-edition/chapter-1 and get a pdf. When I open it, Chinese characters display normally.

But I develop web applications like https://developers.itextpdf.com/examples/itext-action-second-edition/chapter-9 described. Chinese characters is blank when pdf show in browser.

My font code is

String chFontPath = "c:\fonts\xxx.ttf"; BaseFont chBaseFont = BaseFont.CreateFont(chFontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED); Font font = new Font(chBaseFont, 12);

Does anybody know?




WebApi and Angular 2+ - Authentication - Token expired - Return to login

I have a angular client application protected by a login. When I log in, the web api returns me the access token that expire in x minutes. When the access token is expired I want return to the login but I do not understand how to do it.

Someone can give me some advice? Thanks in advance




How to add html elements to a video online

I need to be able to edit a video with online technologies (Javascript or with some Backend code) and overlay on the original video whatever html elements (maybe even animated elements with css) and download the new video edited.

What is the best way to do it?

I've read about CCapture.js that captures videos from a canvas, but I can't get it to work and I'm not sure it's what I'm looking for. I've read about some FFMPEG plugins to make it work on the server and use it with some backend languages but I don't know if it would get the work done as I need it.

For clarity, you know how Instagram can edit your video after you take it adding text or images? I need to be able to edit a video like that, adding html elements on it.

Thanks in advance for helping.




Asynchronous web scraping

Does anyone here know how to scraping async website? I felt very desperate to search the tutorial or the solution. Maybe u guys can help me with the tutorial link or the solution. I'm using php curl and dom parser for the method. I really open for python too. Thanks before.




Are there reasons to allow registration with only well known email providers?

I noticed that sites restrict registration only to known email providers. What are the reasons to do that? thanks. (I really tried to search this question and found nothing about it)




link Fiori application to a normal web application

it's not a programming question but much more of a concept question. I have a web application which was build using html and javascript on the front-side and using spring MVC on the back-end. and I want to create a dashboard which can give me a lot of KPI data in a panel just like Fiori menu has.

what I'd like to do is to create those dashboard using fiori, and when I click on the fiori panel it would move me into my web application HTML page.

my question is : is it possible to be done?




How do i integrate Clappr in Angular 6 application?

I want to play video in Angular 6 application using Clappr (An extensible media player for the web ) player . How do i integrate it ?




sending html email with jsf - J2EE

I have developed a j2ee application with jsf primefaces and jpa (hibernate). I need a button "Send mail" that allows me to open the mail client by default and create an email with html content. i have found 'mailTo' function but it dosent alow me to creat a html body mail. thanks.




Firebase RecaptchaVerifier: Unknown element

I have been trying to implement Firebase Phone Number Authentication with my VueJS project. I had setup everything as required: firebase project setup, enabling sign-in method, required HTML. Whenever the application tries to verify firebase recaptcha, it is constantly throwing errors What am I missing here? What needs to be done more?

<template>
  <div>
    <h1></h1>
    <template v-if="'verify' === state.value">
      <input type="number" v-model="verificationCode"/>
      <button id="verify-button" :class="{ 'disabled' : !verificationCode }" @click="verifyCode">Verify</button>
    </template>
    <template v-else>
      <vue-tel-input class="phone-input"
                     :disabled="loading"
                     :required="true"
                     v-model="phoneNumber"
                     @onInput="onNumberChange"></vue-tel-input>
      <button id="signInButton" :class="{ 'disabled' : !isPhoneValid, 'allowed': isPhoneValid }"
              @click="signInWithPhoneNumber">
        Receive verification code
      </button>
    </template>
  </div>
</template>

<script>
import 'vue-tel-input/dist/vue-tel-input.css'
import firebase from 'firebase'

export default {
  name: 'login',
  data () {
    return {
      state: {
        value: 'login',
        title: 'Login'
      },
      loading: false,
      phoneNumber: '',
      isPhoneValid: false,
      verificationCode: 0,
      recaptchaWidgetId: null,
      recaptchaVerifier: null,
      confirmationResult: null
    }
  },
  mounted () {
    const self = this
    this.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('signInButton', {
      'size': 'invisible',
      'callback': function (response) {
        console.log('solveRecaptcha', response)
        self.signInWithPhoneNumber()
      }
    })
    this.recaptchaVerifier.render()
      .then(function (widgetId) {
        self.recaptchaWidgetId = widgetId
      })
  },
  methods: {
    /**
     * listen to change in phone number and check if input is valid
     *
     * @param number
     * @param isValid
     * @param country
     */
    onNumberChange ({ number, isValid, country }) {
      this.isPhoneValid = isValid
    },
    /**
     * sign in into the application with phone number
     */
    signInWithPhoneNumber () {
      if (this.isPhoneValid) {
        this.loading = true

        const phoneNumber = this.phoneNumber
        const appVerifier = this.recaptchaVerifier

        firebase.auth().signInWithPhoneNumber(phoneNumber, appVerifier)
          .then(function (confirmationResult) {
            this.confirmationResult = confirmationResult
            this.loading = false
            this.state = { value: 'verify', title: 'Verify your phone' }
          })
          .catch(function (error) {
            console.log(error)
            this.loading = false
          })
      }
    }
  }
}
</script>

<style scoped>
  .phone-input {
    width: 255px;
    height: 45px;
    padding: 5px 0;
    margin: 10px auto;
    border: 1px solid lightgray;
  }

  .phone-input:focus {
    border: 1px solid lightgray;
  }

  button {
    width: 215px;
    height: 45px;
    cursor: pointer;
    text-transform: uppercase;
    background-color: lightgray;
  }

  button.disabled {
    cursor: not-allowed !important;
  }

  button.allowed {
    color: white;
    background-color: steelblue;
  }
</style>

screenshot included




When data is larger than 1mb the response of api giving error

I am getting response on android device where it gives error when response size is larger than 1mb . i am using GoDaddy Cpanel Linux hosting.The Error is 520 : WebServer is returning unknow error.I also check on postman still giving same error.




Why my website opened for any parameter after site url?

https://ift.tt/2xHU5qV or https://ift.tt/2DzQyk2 ......is opening a basic html contact/someother page of my site with no styles or script loaded.

The parameter after index.php/ can also be a group of numbers,alphabets..anything, instead of showing a 404 error it is showing other pages randomly.

Note: 404 page is not redirected to any other pages.




Get html overlay on image in li

I am new to html and i am trying to get a division overlay on a list item hover. However the overlay appears in the full width of the screen when i want it only on the list item as class 'price' which is in gray color. I only want the red overlay division to appear on the gray list item.

Here's my code:

HTML -

<div class="columns">
<ul class="price">
<li class="header"> li One 
</br>
<img src="../images/closeicon.png" height="50%" width="50%"/> 

<div class="overlay">
<span class="closebutton"> 
<img src="../images/closeicon.png" height="10px" width="10px"/> </span>
<div class="text">li One description
</div>
</div>
</li>
</ul>
</div>

<div class="columns">
<ul class="price">
<li class="header"> li One 
</br>
<img src="../images/closeicon.png" height="50%" width="50%"/> 

<div class="overlay">
<span class="closebutton"> 
<img src="../images/closeicon.png" height="10px" width="10px"/> </span>
<div class="text">li two description
</div>
</div>
</li>
</ul>
</div>

<div class="columns">
<ul class="price">
<li class="header"> li three
</br>
<img src="../images/closeicon.png" height="50%" width="50%"/> 

<div class="overlay">
<span class="closebutton"> 
<img src="../images/closeicon.png" height="10px" width="10px"/> </span>
<div class="text">li three description
</div>
</div>
</li>
</ul>
</div>

CSS -

.* {
    box-sizing: border-box;
}

.columns {
    float: left;
    width: 33.3%;
    padding: 8px;
}

.price {
    list-style-type: none;
    border: 1px solid #eee;
    margin: 0;
    padding: 0;
    -webkit-transition: 0.3s;
    transition: 0.3s;
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #F9423A;
  overflow: hidden;
  width: 100%;
  height: 0;
  transition: .5s ease;
}


.price:hover {
    /*box-shadow: 0 8px 12px 0 rgba(0,0,0,0.2)*/
    background-color: #002A3A;
}


.price:hover .overlay {
    height: 20%;
}

.price .header {
    background-color: #ccd4d7;
    color: #002A3A;
    align-content: center; 
    font-size: 25px;
    height: 100%;
}

.price li {
    border-bottom: 1px solid #eee;
    padding: 20px;
    text-align: center;
}

Would anybody know how to do this?

Thanks,




Sticky header in table that scrolls right

Can you please tell me how can i achieve sticky header for table. It lay in div with overflow: auto and scrolls right. And I supporting IE10+.

here is my html

<div class='table-block'>
  <div class='table-header'>
      <div>
         header 1
      </div>
      <div>
         header 1
      </div>
      <div>
         header 1
      </div>      
      <div>
         header 1
      </div>
  </div>
    <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
      <div class='table-body'>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>
      <div>
         body 1
      </div>      
      <div>
         body 1
      </div>
  </div>
</div>

here is my css

    .table-block{
  overflow: auto;
}

.table-header{
  display: table;
  table-layout: fixed;
  width: 100%;
}

.table-header > div{
  display: table-cell;
  border: 1px solid;
  width: 1000px;
}

.table-body{
  display: table;
  table-layout: fixed;
  width: 100%;
}

.table-body > div{
  display: table-cell;
  border: 1px solid;
  width: 1000px;
}

I need exactly the same markup.

Please someone give me an advice.

Here is fiddle with minimal reproduction please check it https://jsfiddle.net/kzmwtuhb/2/




How do I make my user student view all the classrooms he/she belong to?

In my web app, there are 2 types of user: Teacher and Student

A Teacher can create virtual classrooms and view the students who joined his/her rooms.

While Student can join a classroom and should be able to see the classroom he/she joined to.

These codes allow the Teacher to create a classroom:

function classcreation(q)
    {
        var checkcn = document.getElementById('classroomName').value;
        if(checkcn == "" && checkcn == null){
            alert("Empty Class Name!!");
            }
            else {
              var usuid = generateId();
              var myClasses={};
              myClasses.TheClass = 
                        document.getElementById('classroomName').value;
              myClasses.Teacher = user.displayName;
              myClasses.TeacherID = user.uid;
              myClasses.ClassID = usuid;
              fbclass.child(user.uid).push().set(myClasses);
                }
      }

and these to allow the teacher to view the classrooms he/she created as well as the students who joined his/her room/s.

var userRef = firebase.database().ref().child('Classes' + '/' + user.uid);
      userRef.on('child_added', function(data)
      {
            var roomNames = data.val().TheClass;
            var Studentx = data.val().MyStudents;

            var studentRawList = '';
            for (var key in Studentx) {
                studentRawList += ('['+Studentx[key].Studentname + ']');
            }

            var classD = data.val().ClassID;
            var ul = document.createElement('ul');
            document.getElementById('myList').appendChild(ul);
            var li = document.createElement('li');
            ul.appendChild(li);

            Object.keys(roomNames).forEach(function(key){
            li.innerHTML += '<span onclick="clickDone(this)">'
                             +roomNames[key]+'</span>
                             <ul style="display:none">
                             <li>Class Id : '+classD+'</li>
                             <li><span onclick="clickDone(this)">Students : 
                             </span><ul style="display:none">
                             <li>'+studentRawList+'</li></ul></li></ul>';
              });
            });

JSON:

{
  "Accounts" : {
    "FykyhzEZjndylFj3BbCnPqoTGDo1" : {
      "displayName" : "Dodong Advices",
      "email" : "advicenidodong@gmail.com",
      "status" : "Teacher"
    },
    "HOgdSlTed9V8g0kSZjizgODMDOe2" : {
      "displayName" : "Sweet Macaroni",
      "email" : "Sweet@gmail.com",
      "status" : "Student"
    },
    "yJif4ReTxCcGmo682xWSG3L5MKE3" : {
      "displayName" : "Purple Salad",
      "email" : "Purple@gmail.com",
      "status" : "Student"
    }
  },
  "Classes" : {
    "FykyhzEZjndylFj3BbCnPqoTGDo1" : {
      "-LMpvlBl3mEazhxaJwqb" : {
        "ClassID" : "6503-3503-6827",
        "Teacher" : "Dodong Advices",
        "TeacherID" : "FykyhzEZjndylFj3BbCnPqoTGDo1",
        "TheClass" : "StackMates"
      },
      "-LMrfIBg8v-hj1k8X2Qf" : {
        "ClassID" : "7583-2402-2757",
        "MyStudents" : {
          "HOgdSlTed9V8g0kSZjizgODMDOe2" : {
            "Studentname" : "Sweet Macaroni"
          }
        },
        "Teacher" : "Dodong Advices",
        "TeacherID" : "FykyhzEZjndylFj3BbCnPqoTGDo1",
        "TheClass" : "asdasd"
      },
      "-LMrfMV1aw3YNA0PfooR" : {
        "ClassID" : "8083-2712-3347",
        "MyStudents" : {
          "HOgdSlTed9V8g0kSZjizgODMDOe2" : {
            "Studentname" : "Sweet Macaroni"
          },
          "yJif4ReTxCcGmo682xWSG3L5MKE3" : {
            "Studentname" : "Purple Salad"
          }
        },
        "Teacher" : "Dodong Advices",
        "TeacherID" : "FykyhzEZjndylFj3BbCnPqoTGDo1",
        "TheClass" : "Trial"
      }
    }
  }
 }

So based on JSON, we have 2 Student user named: Sweet Macaroni and Purple Salad. Sweet Macaroni joined a class asdasd and Trial while Purple Salad only joined the classroom Trial

The question is, how do I allow the each user student to see/view the rooms they belong to?




mercredi 26 septembre 2018

How does the workflow for developers in the office

I have a question, I'm a future developer, and I have such a question (to be honest, I've long wanted to ask developers), is it permissible for developers to use Google at work to find / solve problems? Or, developers are forbidden to use Google / Internet while working?




custom column filter (with both text and integer) in ag-grid Angular 4 app?

https://www.ag-grid.com/javascript-grid-filter-component/

we are building a customised ag-grid in Angular 5 (Typescript). And we want to have custom column filter (with both text and Integer search).

any suggestions please




javascript: I want to show image from raw data

I'm serious. this is making me going crazy.

I want to display images from raw data from server(nodejs)
node js code is like that

fs.readdir(testFolder, (err, files) => {
  files.forEach(file=>{
    let file_name="./uploads/"+file;
    let data=fs.readFileSync(file_name);
    arr.push(data)
  })
})

and then sends raw data of image array.
such as [ {"type":"Buffer","data":[137,80,78,71,13,10,26,10,0,0,0,13,...]},
{"type":"Buffer","data: ....,}]

I think it's raw data. so I tried encoding it to base64
and then, creating image object.
this is javascript code.

    function alertContents(){
        if(xhr.readyState===XMLHttpRequest.DONE){
            if(xhr.status===200){
                let object=JSON.parse(xhr.response);
                let base=btoa(object[0].data.toString());
                console.log(base)

                let image=new Image();
                image.src=`data:image/png; base64,${base}`
                document.body.appendChild(image);
            }else{
                alert(` :'( `);
            }
        }
    }

and this is html.

<body>
<button id="ajaxButton" type="button" onclick="makeRequest()"> HI </button>

</body>

but It doesn't work properly. no error but no loading image.
could you help me out? :'(
seriously, I'm struggling to solve this for couple of hours.
but it's really difficult for me




Sign up form that only allows a certain list of emails to sign up

A client that I'm working for requires a signup form for their Wordpress site. It needs to be able to check if the entered email is already registered with the client's company (I have a CSV list of registered emails) and then email them a password if they are registered, allowing them to access the site. Does anyone know any Wordpress plugins or solutions that have this functionality?




Form edit for input file

I am making edit data form. Then in edit form, there are 3 input file type (image). So the problem is, when i updated 1 file on one of the input file type, the other input file type updated as well and unlink the previous data so in database, the coloum is empty. So i want to make this edit form, when i update 1 file, the other file do not get change as well.. only the one that being updated and the other keep the previous file. All helps and answer would be much appreciated.. Thankyou Here is the code for edithotel.php

<?php
    include "koneksi.php";

                $id=$_POST['idhotel'];
                $namahotel=$_POST['namahotel'] ;
                $alamat=$_POST['alamat'] ;
                $notelp=$_POST['notelp'] ;
                $gambar1=$_FILES['gambar1']['tmp_name'];
                $gambar2=$_FILES['gambar2']['tmp_name'];
                $gambar3=$_FILES['gambar3']['tmp_name'];
                $nama_file1 = $_FILES['gambar1']['name'];
                $nama_file2 = $_FILES['gambar2']['name'];
                $nama_file3 = $_FILES['gambar3']['name'];
                $tempat_gambar1= 'file/hotel/gambar1/'.$nama_file1;
                $tempat_gambar2= 'file/hotel/gambar2/'.$nama_file2;
                $tempat_gambar3= 'file/hotel/gambar3/'.$nama_file3;
                $latitude=$_POST['latitude'] ;
                $longitude=$_POST['longitude'] ;
                $qr=mysql_query("select * FROM tbhotel WHERE idhotel='$id'");
                $r=mysql_fetch_array($qr);
                $tempat_foto1 = 'file/hotel/gambar1/'.$r['gambar1'];
                $tempat_foto2 = 'file/hotel/gambar2/'.$r['gambar2'];
                $tempat_foto3 = 'file/hotel/gambar3/'.$r['gambar3'];

                //$ccc = mysql_query("SELECT * FROM tbhotel WHERE idhotel='$id' ");
                //$z = mysql_fetch_array($ccc);

                //upload gambar

                if (isset($_POST['simpan'])){
                    if($gambar1 != 'kosong'){
                            $d1 = 'file/hotel/gambar1/'.$r['gambar1'];
                            unlink ("$d1");
                            move_uploaded_file ($_FILES['gambar1']['tmp_name'], "file/hotel/gambar1/".$nama_file1);
                            //echo '<script>alert("DATA BBB DIUBAH");location="hotel.php";</script>';
                            $sql = mysql_query("UPDATE tbhotel SET namahotel ='$namahotel', alamat = '$alamat', notelp = '$notelp' ,  gambar1='$nama_file1', latitude ='$latitude' , longitude ='$longitude'  where idhotel='$id'") or die (mysql_error());
                    }

                     if($gambar2 != 'kosong'){
                            $d2 = 'file/hotel/gambar2/'.$r['gambar2'];
                            unlink ("$d2");
                            move_uploaded_file ($_FILES['gambar2']['tmp_name'], "file/hotel/gambar2/".$nama_file2);

                            $sql2 = mysql_query("UPDATE tbhotel SET namahotel ='$namahotel', alamat = '$alamat', notelp = '$notelp' ,  gambar2='$nama_file2', latitude ='$latitude' , longitude ='$longitude'  where idhotel='$id'") or die (mysql_error());
                    }


                     if($gambar3 != 'kosong'){
                            $d3 = 'file/hotel/gambar3/'.$r['gambar3'];
                            unlink ("$d3");
                            move_uploaded_file ($_FILES['gambar3']['tmp_name'], "file/hotel/gambar3/".$nama_file3);

                            $sql3 = mysql_query("UPDATE tbhotel SET namahotel ='$namahotel', alamat = '$alamat', notelp = '$notelp' ,  gambar3='$nama_file3', latitude ='$latitude' , longitude ='$longitude'  where idhotel='$id'") or die (mysql_error());

                    }


                            if ($sql) {
                                //jika  berhasil tampil ini
                                echo '<script>alert("DATA BERHASIL DIUBAH");location="hotel.php";</script>';
                            } else {
                                // jika gagal tampil ini
                                echo '<script>alert("DATA GAGAL DIUBAH");location="formedithotel.php";</script>';
                            }
                }


?>

and here is the code for editform.html

     <form name="edithotel" enctype="multipart/form-data" action="edithotel.php" method="post" enctype="multipart/form-data" id="demo-form2" data-parsley-validate class="form-horizontal form-label-left">


              <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12" for="last-name">Nama Hotel</label>
                    <div class="col-lg-12">
                      <input type="text" id="namahotel" name="namahotel" value="<?php echo $result['namahotel']; ?>">
                    </div>
                  </div>

              <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12" for="last-name">Alamat</label>
                    <div class="col-lg-12">
                      <textarea class="form-control" rows="5" id="alamat" name="alamat" ><?php echo $result['alamat']; ?></textarea>
                    </div>
                  </div>

              <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12" for="last-name">No Telp</label>
                    <div class="col-lg-12">
                      <input type="text" id="notelp" name="notelp" value="<?php echo $result['notelp']; ?>">
                    </div>
                  </div>

                 <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12">Gambar 1</label><br>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                    <img src="file/hotel/gambar1/<?php echo $result['gambar1']; ?>" width='80' height='60'/>
                    <input type="file" id="gambar1" name="gambar1" value="kosong">
                    </div>
                  </div><br>

                  <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12">Gambar 2</label><br>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                    <img src="file/hotel/gambar2/<?php echo $result['gambar2']; ?>" width='80' height='60'/>
                    <input type="file" id="gambar2" name="gambar2" value="kosong">
                    </div>
                  </div><br>

                  <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12">Gambar 3</label><br>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                    <img src="file/hotel/gambar3/<?php echo $result['gambar3']; ?>" width='80' height='60'/>
                    <input type="file" id="gambar3" name="gambar3" value="kosong">
                    </div>
                  </div><br>


                  <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12" for="last-name">Latitude</label>
                    <div class="col-lg-12">
                      <input type="text" id="latitude" name="latitude" value="<?php echo $result['latitude']; ?>">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-md-12 col-sm-12 col-xs-12" for="last-name">Longitude</label>
                    <div class="col-lg-12">
                      <input type="text" id="longitude" name="longitude" value="<?php echo $result['longitude']; ?>">
                    </div>
                  </div>  


                <div class="ln_solid"></div>
                  <div class="form-group">
                    <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                      <button type="submit" name="simpan" class="btn btn-success">Update</button>
                    </div>
                  </div>