vendredi 31 mai 2019

HTML website stops working as expected after migrating servers

I'm a web developer for years and I understand a lot about websites and development. But this issue is far from my understanding, I had never encountered it before as it looks mystical for me.

I have HTML website on main server and domain, it's working fine there, all files are loaded and design looks as it should. Now, I have moved the same website, all the same files to a new server and domain, and the website just broke without touching anything. It's working, but design doesn't look like it should, Javascript is throwing errors in console, design structure is lost. All files needed are loaded, I can see in the Network tab of Chrome Developer Tools but website design structure is lost and JS scripts are not working. Now this is the fun part. If I transfer the same website from new server to the main server, the website looks good once again. I'm stretching my head all day and can't find any issue. I've also tried to run the same website locally on WAMP or even just from desktop as it's only HTML, and the website is broke as it's in the new server.

Main website URL: http://vilbar.lt/eng/ New server's website URL: http://www.wellsources.cn/eng/

Any ideas? Anyone had encountered this before?




Сhange of albums in the gallery on the site with buttons JS

I have gallery on website. The task is to make the photos in the gallery change smoothly at the touch of a buttons. When you press the same button again, the pictures should disappear.

I know how to do it in CSS but it's not smooth enough, but JS just started to learn and I have no idea how to do it in JS. I tried to make through changing oppacity, but have no results.


<!DOCTYPE html>

<html>


<head>
<link rel="stylesheet" type="text/css" href="artfiles/effect1.css" />
        <script src="artfiles/modernizr.custom.js"></script>
<!-- /maincss2 -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="./artfiles/main2.css">
  <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- /maincss2 -->
<link rel="stylesheet" href="./css/example.css" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">


    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery//2.2.0/jquery.min.js"></script>



       <meta charset="UTF-8">

    <link rel="stylesheet" href="css/style.css" >
       <link rel="stylesheet" id="six_mainstyle-css" href="./artfiles/main.css" type="text/css" media="all">



    <title>Gallery
    </title>


<body class="demo-1">

                        <!-- /Preloader -->


                        <!-- /Preloader -->





                        <!-- /Content -->




                        <!-- Pushy Menu -->




 <div class="container" data-0="transform:translateX(0%)" data-4000="transform:translateX(-450%)">


    <section style="background-color:#f3f2ed;">

    <div class="storyBx">
      <h1></h1>
      <div class="fadeIn"><h2 style="padding-left: 35.66%;padding-top: 25%; letter-spacing:6pt;">Gallery</h2></div>
    </div>
    <div class="storyBx" style="padding-left: 25.66% ;padding-top: 8.5%; font-size: 130%; list-style-type: none;">
      <h1>
        <div class="fadeIn"> Art Works</li>
        <li> Photos6</a></li>
          <li> Photos5</li>
            <li>Photos4</li>
              <li>Photos3</li>
                <li>Photos2</li></div>
              </ul>
            </h1>
    </div>


  </section>

<section style="background-color:#f3f2ed;">
  <div class="imgBx"><img style="padding-bottom: 12.5%;" src="img/Courses1.png">
    </div></section>

<section style="background-color:#f3f2ed;">
  <div class="imgBx"><img style="padding-bottom: 12.5%;" src="img/Courses2.png">
    </div></section>

    <section style="background-color:#f3f2ed;">
  <div class="imgBx"><img style="padding-bottom: 12.5%;" src="img/Courses3.png">
    </div></section>

    <section style="background-color:#f3f2ed;">
  <div class="imgBx"><img style="padding-bottom: 12.5%;" src="img/Courses4.png">
    </div></section>


  <section style="background-color:#f3f2ed; z-index: 10; position: relative; padding-left:8%;  
   ">

    <div class="storyBx" >

      <h1 style="font-family: Thin; font-size: 400%; margin-bottom: 0;  margin-top:10vh; line-height: 100%;  letter-spacing:0;">Dont be shy,<h2 style="font-family: BrownLight; margin:0; font-size: 400%;font-weight: 100; margin-top: 9%;">Say hi</h2>







</div>
<div class="icons">


    <a href="https://twitter.com/"><div class="circle"><i class="fab fa-twitter"></i></div></a>

    <a href="https://www.facebook.com//"><div class="circle"><i class="fab fa-facebook" aria-hidden="true"></i></div></a>

    <a href="https://www.instagram.com/"><div class="circle"><i class="fab fa-instagram"></i></div></a>

    <a href="https://www.youtube.com/"><div class="circle"><i class="fab fa-youtube"></i></div></a>

    <a href="https://www.pinterest.ru/"><div class="circle"><i class="fab fa-vk"></i></div></a>

    <a href="https://tlgg.ru/"><div class="circle"><i class="fab fa-telegram"></i></div></a>

</div>

    </div>

    </div>


  </section>



</div>







    <!-- </div> -->
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>

    </main>

    </div><!-- /container -->
    </div><!-- /body_class -->
    </div><!-- /#app -->

                        <!-- Pushy Menu -->







                 <!-- Scripts main -->


    <script type="text/javascript" src="./artfiles/main.js">
    </script>

    <script type="text/javascript" src="./artfiles/script.js"></script>

    <script type="text/javascript" src="./artfiles/jquery.js">
    </script>
   <script src="./artfiles/classie.js"></script>
        <script src="./artfiles/pathLoader.js"></script>
        <script src="./artfiles/mainpre.js"></script>

                        <!-- Scripts main -->


                        <!-- Scripts main2 -->
<script type="text/javascript" async="" src="./Barn + Co — A creative digital design and branding agency_files/analytics.js"></script>

<script defer="defer" src="./artfiles/main2.js"></script>

<script async="" src="./artfiles/js"></script> 

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/prism.min.js"></script>


<script type="text/javascript" src="skrollr.js"></script>
<script type="text/javascript">
    skrollr.init();
</script>

</body>

</html>
```html






Webscraping help: can't find root div in soup

Webscraping sites like stockx and goat for shoe information but the html from the soup I create doesn't include the information I need which is apparently found in the root div under the body of the page. When I inspect the page manually the root div is full of information that I am trying to scrape but viewing the page source shows an empty root div.

def scrape(url):
    browser = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0"
    header = {"User-Agent": browser,}
    req = urllib.request.Request(url, headers=header)
    html = urllib.request.urlopen(req).read()
    soup = BeautifulSoup(html, "html.parser")
    print(soup.findAll("div",{"id":"root"}))

yields [<div id="root"></div>] as the result for either stockx or goat search result webpage.

If anyone can let me know how I can extract the information I need I would be greatly appreciative. Thank!




How to create a web page that calculate and update users in same session

I have a programming assignment challenge and would like to get advice on how to start this.

A calculator website which logs calculations as they happen and shares those calculations with everyone connected to the website. For example, user A and user B go to your site at the same time. User A calculates "5 + 5", which equals "10". This is logged below the calculator as "5+5 = 10". User B is updated about this calculation right after user A posts it. Now, user B calculates "3x_4". This calculates to 12 and displays "3x_4=12" right below the prior calculation. User A sees this update immediately after user B posts it. Results should remain between sessions. Only show the last 10 calculations descending from most recent to oldest. Once the calculator is completed, send me the URL for your application.




Intercept another web application requests

I have 2 ear application (Primary and Proxy). The primary application is build using Servlet JSP MVC.

Now, I want to create a Proxy application (ear app) to listen and log all the requests and response going and coming from the Primary application.

I cannot modify the Primary application, have only control on the Proxy application that I am writing.

Can I write a simple Servlet Filter to listen all the requests on my primary application.

Note: Both the applications will run in WAS, may be same ports can be configured.




How to get and post weight from weighing scale

I am trying to get weight off a scale using link or button. I want to be able to get weight using web server (I got Puma using Ruby gem), save that weight in a database SQLite3 (ruby gem), display it using json.

I installed Puma and SQLite3. Already got code that allows user to enter weight manually in a form, but want to get weight off scale automatically. I created a helper class with get and post methods and using it in weights controller and used it in the form where link is being used.

Does anyone have ideas how and what's the best way to code it?

Thanks




Display client ip and put the ip in paragraph using javascript and html

I'm making a website using html/css/php/js I want javascript code to display client ip and put this ip on html paragraph and thanks




Finding Facebook profile of a particular person(google search) using python

I want to write python script to get 'email ID' and other extra information I can get from Facebook profile of a particular person, provided I have 'Name', 'phone number', 'location', 'work-place' of that person. Can someone please tell me how should be my approach to get the solution?

1)I was able to get information related to that person but by hard-coding the link of his/her page. 2)The problem is among many facebook profiles with same name(there can be people with same name ad are famous and appear in first few links blocking required profile get searched) how to get correct one. 3)And how to tackle the blocking agent(by facebook used to prevent web-scraping)

Also if possible give the pseudo code

Suppose I enter "XYZ" as name, "phone_number", "work_place" I should get correct link for the required facebook profile.




How do I get sub directory of an web api

I want to create some statistics for the game auto chess and I know it has a API here: https://autochess.varena.com/api/autochess/match/1558139447625_2831/info?t=1558973553569 . This are stats of the result of one match. I would like to find out other links of this api for example the one that has match ids of newly played games but I dont know how to get those. Is there an way to get all sub directorys of an api?

for example I already tryed https://autochess.varena.com/api/autochess returns only an error.




html link tag color not changing after clicked

Link color not changing after i clicked. I used side navigation bar css style with links. Here is my css styling:

i tried with active but still not working.

.sidenav 
{
height: 100%;
width: 200px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #06799f;
overflow-x: hidden;
padding-top: 20px;
}

.sidenav a 
{
padding: 15px 20px 4px 18px;
text-decoration: none;
font-size: 25px;
color: #f1f1f1;
display: block;
}

.sidenav a:hover 
{
color: #000000;
}

.sidenav a: active
{
color: black;
}

@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}  

expected: is the change of link color when cliked




WSDL file to Jar File

I have WSDL file URL and I want to create JAR file and need use in another project.

I have try to convert with below scenarios

1.Using wsimport command to Java files and using this java files create maven project as packaging JAR

wsimport -keep -wsdllocation /MyService.wsdl

2.Using ANT build (create build.xml file create target for export JAR)

<target name="dist" depends="compile" description="generate the distribution">
        <buildnumber />
        <!-- Create the distribution directory -->
        <mkdir dir="${dist}/lib" />

MyApplication-${version}.${build.number}.jar -->
        <jar destfile="${dist}/lib/MyApplication-${version}.${build.number}.jar" basedir="${build}" />
    </target>

above both scenarios JAR exported but when I deployed in server getting below Exception

java.lang.NoClassDefFoundError

what I am doing wrong ? is there any simple way to convert wsdl to Jar?




How to apply Fabric UI Office theme to body background?

I've got a problem with theming a react website made with fabric ui

I've generated 2 themes (Night/Day mode) using the website that Fabric UI provided for generating themes. I exported them in json format. As i want to use a toggle button to change between these two themes, those two jsons became variables in a file "Themes.json"

Problem is that, once i change the theme, the body's background which is supposed to be dark is in fact plain white

My themes


var lightCyan = {
    "themePrimary": "#009486",
    "themeLighterAlt": "#f1fbfa",
    "themeLighter": "#c8eeea",
    "themeLight": "#9cdfd8",
    "themeTertiary": "#4cbfb4",
    "themeSecondary": "#13a193",
    "themeDarkAlt": "#008578",
    "themeDark": "#007166",
    "themeDarker": "#00534b",
    "neutralLighterAlt": "#f8f8f8",
    "neutralLighter": "#f4f4f4",
    "neutralLight": "#eaeaea",
    "neutralQuaternaryAlt": "#dadada",
    "neutralQuaternary": "#d0d0d0",
    "neutralTertiaryAlt": "#c8c8c8",
    "neutralTertiary": "#595959",
    "neutralSecondary": "#373737",
    "neutralPrimaryAlt": "#2f2f2f",
    "neutralPrimary": "#000000",
    "neutralDark": "#151515",
    "black": "#0b0b0b",
    "white": "#ffffff"
}

var darkCyan = {
    "themePrimary": "#4fedec",
    "themeLighterAlt": "#030909",
    "themeLighter": "#0d2626",
    "themeLight": "#184747",
    "themeTertiary": "#2f8e8e",
    "themeSecondary": "#45d1d0",
    "themeDarkAlt": "#5fefee",
    "themeDark": "#77f2f1",
    "themeDarker": "#99f5f4",
    "neutralLighterAlt": "#151717",
    "neutralLighter": "#1e2020",
    "neutralLight": "#2c302f",
    "neutralQuaternaryAlt": "#353939",
    "neutralQuaternary": "#3d4141",
    "neutralTertiaryAlt": "#5c6161",
    "neutralTertiary": "#c8c8c8",
    "neutralSecondary": "#d0d0d0",
    "neutralPrimaryAlt": "#dadada",
    "neutralPrimary": "#ffffff",
    "neutralDark": "#f4f4f4",
    "black": "#f8f8f8",
    "white": "#0c0d0c",
    "bodyBackground":"#2e2a2a"
}


export {lightCyan, darkCyan};




Why am I getting this error - 'You are calling withTheme(Component) with an undefined component.' -React JS

enter image description here

After installing some "material-ui" packages I'm getting this error. I tried several solutions but still not fixed. Help please?




Web Development Using Git: How to test git branch? How to merge mysql tables?

I am running a git repo for a website. I want to have a production/live website and specific number of development websites for each developer like this:

  • production/live: www.mywebpage.com --> master branch --> database0
  • development01: www.dev01.mywebpage.com --> dev01 branch --> database1
  • development02: www.dev02.mywebpage.com --> dev02 branch --> database2
  • ...

I already configured apache, everything is working fine. The databases1 and 2 are copies of the production database. Every developer will now develop a new tool or feature for the production system which requires database manipulations.

My questions are: - How does a professional web development in this case look like? - Since every developer has to add or change new database tables: How do they merge mysql tables? - How can I view the changes of the developers? How is the domain connected to each branch and database? - What recommendations could you give me?

Thank you very much for your support.




How to fix my layout so my nav bar doesn´t hide some content after linking to the desired section

my navbar is set to fixed, but everytime i press on e.g. home, it doesnt scroll to the most top, the site is just a little under the maximum you can possibly scroll to the top, this makes my H1 beeing covered partly by my navbar.

  • Ive tried different settings for my nav bar like static etc.
  • Ive tried to change the padding of my nav bar which didnt helped either.
  • Ive tried to achieve better results with different min heights for the sections, currently its set to 85%

    <!-- Header -->
    <header>
    
    <div id="logo">
        <img src="img/111.jpg"="Kurzwarenmobil">
    </div>
    
    <nav>
    
        <ul>
            <a href="#home"><li>home</li></a>
            <a href="#about"><li>Über mich</li></a>
            <a href="#DasKurzwarenmobil"><li>Das Kurzwarenmobil</li></a>
            <a href="#Kontakt"><li>Kontakt</li></a>
        </ul>
    </nav>
    
    

    Kurzwarenmobil

    H.S. Schneiderbedarf

    html, body{margin: 0; padding: 0; height: 100%; text-align: center;} section { min-height: 85%} a {text-decoration: none;} li {list-style-type: none;}

    header { width: 100%; height: 65px; position: fixed; top:0; left: 0;
    background: #FEFCFB; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) ; z-index: 1; }

    logo {

    width: 140px; float: left; margin: 10px 0 0 -10px }

    home{

    background: url(../img/landing.jpg); background-position: center center; background-size: cover; background-attachment: fixed; }

    home h1 {

    margin: 62px auto 0 auto; font-size: 110px}

    home h2 {

    margin: 50 auto 0 auto; font-size: 25px;

    }

    home img {

    width: 32px; margin-top: 150px; opacity: 0.7; }

    home img:hover {

    opacity: 1; }

    home {min-height: 100%}

I want my Nav bar to Navigate to the most top part of the site, which means that there is no more space to scroll to the top. right now when i click on "home" on the nav bar, half of my H1 is covered by the navbar because it´s not scrolled up enough




How to set Instagram on website using CMS Made Simple 2.2.10?

Please tell me how can I share Instagram on my website? I am using CMS Made Simple.




How to convert objects/arrays in array list in javascript?

I have this json, but it is array, within array each object contains array/objects both, sometimes it will give object when child is only one, if children are more than 1 then it will come in array, can anyone say how to convert all in array. if only one object then it should also come in array[0] one item in array. simple json is given here.

{
  "text-styles": {
    "text-style": [
      {
        "name": "Menu Heading",
        "id": "855",
        "display-format": "",
        "textblock": {
          "spaceAfter": "0",
          "spaceBefore": "14.1732",
          "rightIndent": "0",
          "leading": "21.6",
          "leftIndent": "0",
          "id": "855",
          "tabStops": "1\\36\\left\\\\\\",
          "text": {
            "color": "cmyk(0,0,0,0)",
            "character-style": "plain ",
            "horizontalScale": "100.000000",
            "baseline-shift": "0.000000",
            "vfield": {
              "visible": "true",
              "editable": "1",
              "display": "true",
              "name": "Menu Heading",
              "index": "2",
              "id": "858:0",
              "editRowHeight": "1",
              "type": "text"
            },
            "font": "HelveticaNeueLTStd-Bd,HelveticaNeueLTStd-75 Bold",
            "pointsize": "18.000000"
          },
          "align": "left",
          "keepTogether": "false",
          "extraParagraphSpacing": "0",
          "firstLineIndent": "0"
        }
      },
      {
        "name": "Menu 1 Price Option",
        "id": "880",
        "display-format": "",
        "textblock": [
          {
            "spaceAfter": "0",
            "spaceBefore": "5.66929",
            "rightIndent": "0",
            "leading": "16.8",
            "leftIndent": "0",
            "id": "880",
            "tabStops": "1\\464.882\\right\\\\\\2\\510.236\\right\\\\\\",
            "text": [
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Menu Item 1 Price Option",
                  "index": "3",
                  "id": "883:0",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Option Text 1",
                  "index": "4",
                  "id": "883:25",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
                "pointsize": "12.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Price 1",
                  "index": "5",
                  "id": "883:37",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              }
            ],
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          },
          {
            "spaceAfter": "0",
            "spaceBefore": "2.83465",
            "rightIndent": "28.3465",
            "leading": "14.4",
            "leftIndent": "0",
            "id": "880",
            "tabStops": "1\\36\\left\\\\\\",
            "text": {
              "color": "cmyk(0,0,0,0)",
              "character-style": "plain ",
              "horizontalScale": "100.000000",
              "baseline-shift": "0.000000",
              "vfield": {
                "visible": "true",
                "editable": "1",
                "display": "true",
                "name": "Menu Description Long",
                "index": "6",
                "id": "883:44",
                "editRowHeight": "2",
                "type": "text"
              },
              "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
              "pointsize": "12.000000"
            },
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          }
        ]
      },
      {
        "name": "Menu 2 Price Option",
        "id": "905",
        "display-format": "",
        "textblock": [
          {
            "spaceAfter": "0",
            "spaceBefore": "5.66929",
            "rightIndent": "0",
            "leading": "16.8",
            "leftIndent": "0",
            "id": "905",
            "tabStops": "1\\340.157\\right\\\\\\2\\388.346\\right\\\\\\3\\464.882\\right\\\\\\4\\510.236\\right\\\\\\",
            "text": [
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Menu Item 2 Price Option",
                  "index": "7",
                  "id": "908:0",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Option Text 2",
                  "index": "8",
                  "id": "908:25",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
                "pointsize": "12.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Price 2",
                  "index": "9",
                  "id": "908:37",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Option Text 3",
                  "index": "10",
                  "id": "908:44",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
                "pointsize": "12.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Price 3",
                  "index": "11",
                  "id": "908:56",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              }
            ],
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          },
          {
            "spaceAfter": "0",
            "spaceBefore": "2.83465",
            "rightIndent": "85.0394",
            "leading": "14.4",
            "leftIndent": "0",
            "id": "905",
            "tabStops": "1\\36\\left\\\\\\",
            "text": {
              "color": "cmyk(0,0,0,0)",
              "character-style": "plain ",
              "horizontalScale": "100.000000",
              "baseline-shift": "0.000000",
              "vfield": {
                "visible": "true",
                "editable": "1",
                "display": "true",
                "name": "Menu Description Short",
                "index": "12",
                "id": "908:63",
                "editRowHeight": "2",
                "type": "text"
              },
              "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
              "pointsize": "12.000000"
            },
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          }
        ]
      },
      {
        "name": "Beverage Heading",
        "id": "1256",
        "display-format": "",
        "textblock": {
          "spaceAfter": "0",
          "spaceBefore": "14.1732",
          "rightIndent": "0",
          "leading": "21.6",
          "leftIndent": "0",
          "id": "1256",
          "tabStops": "1\\36\\left\\\\\\",
          "text": {
            "color": "cmyk(0,0,0,0)",
            "character-style": "plain ",
            "horizontalScale": "100.000000",
            "baseline-shift": "0.000000",
            "vfield": {
              "visible": "true",
              "editable": "1",
              "display": "true",
              "name": "Beverage Heading",
              "index": "2",
              "id": "1259:0",
              "editRowHeight": "1",
              "type": "text"
            },
            "font": "HelveticaNeueLTStd-Bd,HelveticaNeueLTStd-75 Bold",
            "pointsize": "18.000000"
          },
          "align": "left",
          "keepTogether": "false",
          "extraParagraphSpacing": "0",
          "firstLineIndent": "0"
        }
      },
      {
        "name": "Beverage Item 2 Price Option",
        "id": "1331",
        "display-format": "",
        "textblock": [
          {
            "spaceAfter": "0",
            "spaceBefore": "5.66929",
            "rightIndent": "0",
            "leading": "16.8",
            "leftIndent": "0",
            "id": "1331",
            "tabStops": "1\\340.157\\right\\\\\\2\\388.346\\right\\\\\\3\\464.882\\right\\\\\\4\\510.236\\right\\\\\\",
            "text": [
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Beverage Item 2 Price Option",
                  "index": "8",
                  "id": "1334:0",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "UOM 2",
                  "index": "9",
                  "id": "1334:29",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
                "pointsize": "12.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Price 2",
                  "index": "10",
                  "id": "1334:33",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "UOM 3",
                  "index": "11",
                  "id": "1334:40",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
                "pointsize": "12.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Price 3",
                  "index": "12",
                  "id": "1334:44",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              }
            ],
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          },
          {
            "spaceAfter": "0",
            "spaceBefore": "2.83465",
            "rightIndent": "85.0394",
            "leading": "14.4",
            "leftIndent": "0",
            "id": "1331",
            "tabStops": "1\\36\\left\\\\\\",
            "text": {
              "color": "cmyk(0,0,0,0)",
              "character-style": "plain ",
              "horizontalScale": "100.000000",
              "baseline-shift": "0.000000",
              "vfield": {
                "visible": "true",
                "editable": "1",
                "display": "true",
                "name": "Short Tasting Notes",
                "index": "13",
                "id": "1334:51",
                "editRowHeight": "1",
                "type": "text"
              },
              "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
              "pointsize": "12.000000"
            },
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          }
        ]
      },
      {
        "name": "Beverage Item 1 Price Option",
        "id": "1356",
        "display-format": "",
        "textblock": [
          {
            "spaceAfter": "0",
            "spaceBefore": "5.66929",
            "rightIndent": "0",
            "leading": "16.8",
            "leftIndent": "0",
            "id": "1356",
            "tabStops": "1\\464.882\\right\\\\\\2\\510.236\\right\\\\\\",
            "text": [
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Beverage Item 1 Price Option",
                  "index": "3",
                  "id": "1359:0",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "UOM 1",
                  "index": "4",
                  "id": "1359:29",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
                "pointsize": "12.000000"
              },
              {
                "color": "cmyk(0,0,0,0)",
                "character-style": "plain ",
                "horizontalScale": "100.000000",
                "baseline-shift": "0.000000",
                "vfield": {
                  "visible": "true",
                  "editable": "1",
                  "display": "true",
                  "name": "Price 1",
                  "index": "5",
                  "id": "1359:33",
                  "editRowHeight": "1",
                  "type": "text"
                },
                "font": "HelveticaNeueLTStd-BdCn,HelveticaNeueLTStd-77 Bold Condensed",
                "pointsize": "14.000000"
              }
            ],
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          },
          {
            "spaceAfter": "0",
            "spaceBefore": "2.83465",
            "rightIndent": "85.0394",
            "leading": "14.4",
            "leftIndent": "0",
            "id": "1356",
            "tabStops": "1\\36\\left\\\\\\",
            "text": {
              "color": "cmyk(0,0,0,0)",
              "character-style": "plain ",
              "horizontalScale": "100.000000",
              "baseline-shift": "0.000000",
              "vfield": {
                "visible": "true",
                "editable": "1",
                "display": "true",
                "name": "Long Tasting Notes",
                "index": "6",
                "id": "1359:40",
                "editRowHeight": "2",
                "type": "text"
              },
              "font": "HelveticaNeueLTStd-LtCn,HelveticaNeueLTStd-47 Light Condensed",
              "pointsize": "12.000000"
            },
            "align": "left",
            "keepTogether": "false",
            "extraParagraphSpacing": "0",
            "firstLineIndent": "0"
          }
        ]
      },
      {
        "name": "Subheading",
        "id": "1421",
        "display-format": "",
        "textblock": {
          "spaceAfter": "0",
          "spaceBefore": "8.50394",
          "rightIndent": "0",
          "leading": "19.2",
          "leftIndent": "0",
          "id": "1421",
          "tabStops": "1\\36\\left\\\\\\",
          "text": {
            "color": "cmyk(102,0,63,0)",
            "character-style": "plain ",
            "horizontalScale": "100.000000",
            "baseline-shift": "0.000000",
            "vfield": {
              "visible": "true",
              "editable": "1",
              "display": "true",
              "name": "Subheading",
              "index": "19",
              "id": "1424:0",
              "editRowHeight": "1",
              "type": "text"
            },
            "font": "HelveticaNeueLTStd-Bd,HelveticaNeueLTStd-75 Bold",
            "pointsize": "16.000000"
          },
          "align": "left",
          "keepTogether": "false",
          "extraParagraphSpacing": "0",
          "firstLineIndent": "0"
        }
      },
      {
        "name": "Column Break",
        "id": "999999",
        "display-format": "(%s)",
        "textblock": {
          "column-break": {}
        }
      }
    ]
  }
}




jeudi 30 mai 2019

Get contents of a particular row

I want to locate 'td' where text is 'xyz' so that I can find other attributes in the row. I only have 'xyz' with me and want to get other elements in that row.

. . .

<tr>
    <td>
        <a>xyz</a>
    </td>
    <td>address</td>
    <td>phone number</td>
</tr>

. . .

I can get 'xyz' easily by using required = soup.find('a', text = 'xyz') print(required[0].text)

but I'm not able to locate 'td' so that I can use find_next_siblings() to get other columns.

Expected output: xyz address phone number




I want to register for Sogou and Baidu webmaster

Please I need tips on how to register for Sogou and Baidu webmaster tools, I am not a Chinese nor do I understand even letter A in Chinese.




How to integrate unity application in a web application?

I have a Unity application, where user can enter some parameters in a text-boxes, and there is an "export" button. When user clicks on it, based on the entered parameters, some calculations are made and a ".txt" file is generated and it's downloaded in the local computer (with "Save As" box).

I need to integrate this "Unity" project to be web-based. So I need to have a web-application and this same project to be accessible via in my web-application (not to be downloaded, instead to be directly integrated in the web-browser).

Considering that I do not have any experience with Unity, I was wondering, is this possible to be done? And if does, is it straight-forward process, or it's complicated to implement?




to scrape the address location from website using python

i try to scrape the address location from this website("https://www.justdial.com/Jaipur/schools")




I found one link but i don't know what is that

In my website I check security scan and I found one link but I don't know where is that link

I search my whole website pages but don't find anything

/index.php
/                          <-- this link
/artists.php
/byartwork.php
/bytattoo.php
/byartist.php
/contactus.php
/appointment.php
/cdn-cgi/l/email-protection

I want to remove this link. Please tell me where I can find this and what it is.




How to display a user’s Full Name instead of User.Identity.Name and also how to get user's email address?

I want to display full name and email address on the MVC view page.




Unity exceptions on load texture with WWW

I need to download image from server and show in sprite. All example I can find recommended next code

    WWW www = new WWW(requestUrl);
    yield return www;
    onTextureLoaded(www.texture,id);

But I cant find the way how should I handle exceptions in this case. Should I add Try catch Or there any wat to check if request was successful?




Not really a coding question but rather about web servers

When loading a page from a web server, your browser requires how many connections to the server?




Website notifications for Android Webview

I have a website that I create a webview app on it. I have some notification on my website. so, how can I show the website notification on my webview app? please help me. I'm tired with this




What are common problems with web servers and strategies to counter them?

I'm learning internet technologies and my lecturer has been asking this question for a while. I have read everything I can find on web servers - what are they, types of web servers such as Apache, Tomcat, have even created my own but I just can't get an answer to this question.

It's not an exam or a test, I'm just curious. If any of you can shed some light on the matter, I'll be really grateful.




Using Tabulator, is there a way to know which cell was edited on a dataEdited callback?

I want to use an editable table with Tabulator, is there a way to know which cell was edited when a dataEdited callback is triggered?




Bundle several images together for HTTP?

I have a page with several hundreds of small images that need to be loaded when the page is visited. The total amount of data is 11 MB but it still takes upwards of 11 seconds to load the entire page.
Looking at the chrome network profiler, it pretty evident that the majority of time is wasted waiting for connections. A typical image has:
- 0.13 ms - Request sent
- 240.01 ms - Waiting (TTFB)
- 1.13 ms - Content Download
This, with Chrome's policy of only 6 TCP connections in parallal mean that many images wait 10 seconds to be downloaded.

So clearly the problem is in the server that takes a long time to answer each request but unfortunately that's the only piece that I can't control. That server is not going to change and I can't do any caching of technology change.

Is there a way to pack all the images into a single download and then unpack in in JS in the browser? I know about the dataurl method but I was hoping for a way that would avoid the base64 bloat




Test approach for Web Applications

In our team we have currently developing a web app with java/spring boot backend, odata and ui5 frontend. We have many fullstack tests (writen in protractor). This on the one hand, gives us alot of confidence about our deliverables, and they are excellent regression mechanism to avoid introducing new bugs, but on the other hand maintaining this tests, making sure tha the underlying infrastructure is stable enough, or identifiying bugs is a very painful and very timely process.

My question to the round:

  1. Anybody had similiar experience?
  2. If yes, how did you proceed here? What was the solution?
  3. Would be highly appreciatted if you had any suggestions on the tools and methodic that you used to solve this problems..



How to send pramas through post function in jquery?

I got javascript code which use jquery to activate function with $.post. I want to send string parameter to that function, unsuccessfully.

i try this function call i saw on other post, but it didn't work $.post(SavePoint, { data });

myTimer = (function(ctx) {
  $.post(getPoint).done(function(xml) {
    parseXml(xml);

    var lon = (parseFloat($xml.find("lon").text()) + 180) * (screen.height / 360);
    var lat = (parseFloat($xml.find("lat").text()) + 90) * (screen.width / 180);

    draw(ctx, rout, lat, lon);

    if (recordTime <= 0 && recordTime > -0.2) {
      $.post(SaveToFile);
      isSaveNeeded = "false";
    }

    var isSaveNeeded = document.getElementById("isSaveNeeded").value;
    if (isSaveNeeded == "true") {
      var latS = parseFloat($xml.find("lat").text());
      var lonS = parseFloat($xml.find("lon").text());
      var rudderS = parseFloat($xml.find("rudder").text());
      var throttleS = parseFloat($xml.find("throttle").text());

      var data = latS + "," + lonS + "," + rudderS + "," + throttleS + ",";      
      alert(data);

      $.post(SavePoint, {
        data
      }); //This func call doesn't work..

      alert(data);
      recordTime -= 0.25;
    }
  });
});

setInterval(function() {
  myTimer(ctx);
}, 1000 / rate);




How to broadcast on a website, a software that run on windows 10

i have a questions about something that ´ve never really saw on the internet.

I have created my own tool running with java to track pump & dump from all bigger crypto exchange. A very complete tool with charts, metrics, volume, predictions, algo ....

I want to create a website where users will pay to use this software online. Price is calculated by time (ex : 10 min of use for 2$). But i dont want to share it to other, i just want to display it on a website like a virtual machine so all permitted members will have access to it.

So i want for exmple that my tool will run on a server windows, and on my website you can (like a virtual machine) use the software running on windows h24.

Website -> home -> live tool -> mytool running on w10

This tool need to be available h24 so everyone from all over the world can use it




How to splice an image URL field returned by the server and load the img correctly in the vue?

This is an example,This is the data returned by the server:

[
{
        "Id":8,
        "Title":"123123",
        "Creatorid":1,
        "ImgUrl":"\upload\images\item\banner\1.jpeg",
        "bContent":null
    },
    {
        "bId":9,
        "bTitle":"123",
        "bCreatorid":1,
        "bImgUrl":"\upload\images\item\banner\2.jpeg",
        "bContent":null
    },
    {
        "bId":10,
        "bTitle":"",
        "bCreatorid":1,
        "bImgUrl":"\upload\images\item\banner\3.jpeg",
        "bContent":null
    }
]

this html:

<el-table :data="homeTableData" style="width: 100%">
            <el-table-column label=“image” width="300">
              <template slot-scope="scope">
                <span></span>
                <img :src="getImage(scope.row.ImgUrl)" alt=“loding” style="width:50px; height:50px;">
              </template>
            </el-table-column>
</el-table>

this js:

  methods: {

    getImage(src) {
      console.log(src);
      let temp = "test:8080/website/" + src;
      this.$axios
        .get(temp)
        .then(res => {
          console.log("ccc",res)
          return res;
        })
        .catch(error => {});
    }
}

Now the problem is that img doesn't show images

The reason is that axios doesn't return anything. What should I do? Using synchronization?

How do you gracefully load images in a vue?

Can you help me?




js doesn't execute 'else' statement

I have an if-else statement in JavaScript which returns false, but doesn't execute the code inside 'else'.

part of the script inside the cshtml file:

if (@Session["mission"].ToString() != "1") {
    setInterval(function () { myTimer(ctxPoints, ctxLines); }, 1000 / @ViewBag.rate);  
} else {
    alert("hi");
}

In the debug the '@Session["mission"].ToString() != "1"' statement returns false, but nothing jumps to the screen.




Simple Web Project For Beginners? [on hold]

So I did a little bit of laravel course and now I want to make some projects on it. What are some really simple websites that I can make as a beginner? Also if possible, could you guys recommend me a list of beginner to advanced projects that I can do for practice.




Creating a website consisting of 20 levels , where only the correct answer leads to the next level [on hold]

I want to create a website consisting of different levels where only the correct answer given by user will lead him to next page else he will be redirected to same page. What should be the approach




How to Fix initial loading time TTFB in codeigniter?

My company website www.carlo.in is somehow taking more than 15 seconds for TTFB. I have checked everything, GTmatrics showing 82% PageSpeed Score but still Fully Loaded Time is 19.9s. I have checked the server side and its working smoothly because there is one other domain which is in the same server working fine. Actually, www.carlo.in is built on PHP framework Codeigniter and I think that is happening because of the initial loading of main-controller which is slow. And another website in the same server build on Wordpress working fine , i don't know what to do now please someone help, I might lose my job due to this.




mercredi 29 mai 2019

what are the best online platform tu learn designing petern ..pls suggets

what are the best online platform tu learn designing petern ..pls suggets




Wordpress quiz plugin with rest api

I need a WordPress quiz plugin which provides rest API so that I can integrate that with my android application.

These are some quiz plugin but none of them provides rest API

https://www.learndash.com/
https://www.tryinteract.com/#oid=73461_4020




Mettler Toledo BC Line Scale Read/Set Data

I have a Mettler Toledo Scale (BC Line Model) and I'm trying to figure out how to communicate with.

The scale was not provided with any Driver or SDK ... and the Support is not responding to my request.

Scale has RS232 and RJ45 Connector.

I heard that this scale can only be used with a software named Kheops, I asked the support about it and they didn't respond.

My needs:

1- Be able to program the buttons of the scale (It has buttons that can be programmed to some articles: Button1: Chiken, Button2: Potates ... ) with the price/Unit

2- SDK, framework ... anything that will make it possible to communicate with the scale

3- link to download Kheops or anyone who can provide further informations about it

Thanks,




Data Minning (lxml) returned me a list but it's empty

I was trying to make a list of all the top 1000 instagramer's acount from this website:'https://hypeauditor.com/top-instagram/'. The list that returns from lxml is empty for both lxml.html and lxml.etree.

I tried to delete tbody, delete text(), and upper xpath, but it all failed. what worth noticing is that, with upper xpath, it did return me something, but it is all but /n.

I first tried lxml.etree

market_url='https://hypeauditor.com/top-instagram/' r_market=requests.get(market_url) s_market=etree.HTML(r_market) file_market=s_market.xpath('//*[@id="bloggers-top-table"]/tr[1]/td[3]/a/text()')

then I also tried lxml.html.

tree=html.fromstring(r_market.content) result=tree.xpath('//*[@id="bloggers-top-table"]/tr/td/h4/text()')

furthermore, I tried this xpath:s_market.xpath('//*[@id="bloggers-top-table"]/tbody/text()')

It did not give me any error. But after all the attempts, it still gives me wether empty list or a list full of n/.

I am not really experienced in data mining so it is possible that I have just made a stupid error somewhere, but since without the data I can not start my machine learning model, I am really struggling, pls help. Thanks a lot.




Which hosting is the best in India country?

I want best hosting in India for my website, because I don't no which hosting is best I want someone to help me to find out good hosting




How do I Straight away load a website content without having to initial scroll the page and load content?

I have this template which only loads first content when I scroll down, initially page is empty but when I scroll it then loads the content. I want it to just load one div and when user scrolls down it then keep updating the content. To better explain, visit this link. Test Link When you scroll it only then loads content. What changes can I do here to just initially show a div?




How can I display videos from my own computer on my website

so I have this website so far

https://imgur.com/a/o4T81MG

Looks like that. I want the play thumbnails to display video I have on my computer. I want to use my computer as a video host. I am trying to play around making a video sharing site. I plan on going down the google cloud route to host my videos but as of right now I wanted to know if its possible to use my own computer as a server to retrieve videos I have saved.




problems adding web service to a maven project

I created a maven project in spring tool. This project has ldap authentication. Now I need to add a web service client to this project and I tried different solutions without any luck. I created other dynamic web project creating the services with an wsdl file and dont have problems, but when i tried the same steps to add the web services to my maven project it causes trouble in the maven install process to create the .war file.

http://codermem.com/web-services/jax-ws/create-a-soap-web-service-client-from-wsdl-file/ https://crunchify.com/create-and-deploy-simple-web-service-and-web-service-client-in-eclipse/ https://crunchify.com/how-to-create-a-war-file-from-eclipse-using-maven-plugin-apache-maven-war-plugin-usage/




Received an unexpected EOF or 0 bytes from the transport stream. Settings of ServicePointManager doesn't fix

I get that exception when I try download string using WebClient. I tried many cases to setup ServicePointManager: ServicePointManager.Expect100Continue: true and false ServicePointManager.SecurityProtocol: SecurityProtocolType.Ssl3 and SecurityProtocolType.Tls12 and (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12) and all Tls and all protocols. Every combination was used. Not working

CallStack: Failed to get fixtures from URI=https://myurl/2019-05-29. System.Net.WebException: An exception occurred during a WebClient request. ---> System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream. at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.WebClient.DownloadBitsState.RetrieveBytes(Int32& bytesRetrieved) at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream, CompletionDelegate completionDelegate, AsyncOperation asyncOp) at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) --- End of inner exception stack trace --- at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadString(Uri address) at System.Net.WebClient.DownloadString(String address)

Code with one case:

        ServicePointManager.Expect100Continue = true;
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;

        using (var wc = new WebClient())
        {
            try
            {
               var json = wc.DownloadString(uri);
            }
            catch (Exception e)
            {
                return null;
            }
        }




Why does my ASP.NET webpage throw custom 404 error with certain file extensions

So, I have a folder on my server such like this:

enter image description here

You can access this resources by the URL:

https://83.53.92.229:44304/ServidorImagenes/image.png https://83.53.92.229:44304/ServidorImagenes/text.txt

But the kmz, instead of opening the file (maybe like the text in the xml, I'm not expecting to visualize it) it returns a custom 404:

https://83.53.92.229:44304/ServidorImagenes/track.kmz

Is there any way of allowing all files to be accessed without an error? Thank you very much.




Why doesn't a website hosted at home offer the same download speed as just transferring files?

I am hosting a Django website at home on which I can watch specific video's and photos wherever I want. The only problem is that some of the video's take a while to load and keep buffering. Even when I am on the same wired network. When directly watching the video's from a shared network folder it all works fine. Transferring these video files from the network shared folder to my PC works at around 120 MB/S and speed-test online show me my network speed of around 250 MB/S so the internet speed shouldn't be the issue. But why am I not able to stream these video's properly from the Django web-page? When checking my network activity while watching a video from the network web-page it shows me around 1 MB/S which apparently isn't enough. Does anyone know I could fix or improve this?




Cordova ms adal setbrokeruse true not able to access web api

I need to call a web api from ionic app with adal broker usage true with Microsoft intune.. I m able to authenticate using intune. But not able to call those web api hosted in azure active directory




Encrypting connection to a server without a domain name

On the product I'm building I'm using raspberry pi which has a running web server on it used to query the state of the device and issue various actions. I have configured the pi to be a wifi hotspot and I'm connecting to it via a mobile device which is running the client application which I'm also developing using cordova. The app connects to the web server easily by looking at the gateway address which will always be the pi's IP address.

I would like to encrypt the connection such that in the extremely unlikely event that someone would ever try to sniff the useless information going between the devices they wouldn't be able to and hence the problem I'm facing.

If I generate a self-signed certificate then the browser in the webview will complain. I'm pretty sure there is some kind of option in XMLHttpRequest or fetch that I can set so that the certificate will not be checked but doesn't that defeat the purpose of the whole thing?

In short, how can I encrypt a connection between the server and client when the server does not have a domain?




Python code in Feedly at terminal logcat understand

I'm getting started with reptiles and trying to perform a second crawling exercise based on Feedly(Feedly RSS is the first time i think): don't open website to see news(just title、source link and update time)

This is my code, the first tried with python.

And i was think that should i need crawling my subscribe root websites and write a Scrapy and use MangoDB or Excel/CSV to do basic exercise?

In my this case, i was even think that i should developing a macOS App to show crawling result and i was designed the App UI, or use Python QT and learned QT, perhaps i'm anxiety a lot but nobody to talk.

I tried print links and title first, but feedly should tap twice that show Source page,so i choose Feedly‘s entry.

Python code:

def get_url(url):  # 获得每一页新闻的原始链接

    news_url = requests.get('urls',headers)

    soup = BeautifulSoup(news_url.text, 'lxml')

    links = soup.select('#.*?\=_16b.*?\:2.*?\:d02fd57c_entry_title')

    for link in links:
        href = link.get('href')
     print(href)

#if __name__ == '__main__':
#    urls = ['https://feedly.com/i/entry/'.format(number) for number in range(1,16)]
#    for url in urls:
#        get_url(url)
#        time.sleep(2)

logcat:

 File "aa2.py", line 17
    print(href)
              ^
IndentationError: unindent does not match any outer indentation level

I think i don't need use Feedly API,Because i was use chrome to see json info that only have title and sub read, but i was not tried, so i choose web crawling.

I found Feedly "check"(Use Chrome)json only have title and unread, no "update time" and category".

I found Feedly jeson was only have title and unread, no "update time" and category"

Here is my all code:


import requests
import time
from lxml import etree
from bs4 import BeautifulSoup


# import pymongo MongoDB数据库
# import xlwt EXCEL
# import csv CSV

headers = {
           'cookie': '',  # 传入cookies
           'user-agent': 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko)' 
           'Version/11.0 Mobile/15A5341f Safari/604.1'
}

def get_url(url):  # 获得每一页新闻的原始链接

    news_url = requests.get(url, headers)

    soup = BeautifulSoup(news_url.text, 'lxml')

    links = soup.select('#.*?\=_16b.*?\:2.*?\:d02fd57c_entry_title')

    for link in links:
        href = link.get('href')
        get_newsinfo(href)

    get_url(url)

def get_newsinfo(url):

    news_title = requests.get(url, headers)
    soup = BeautifulSoup(news_title.text,'lxml')

    news_titles = soup.select('#.*?\=_16b.*?\:2.*?\:d02fd57c_entry_title')

    news_links = soup.select('#.*?\=_16b.*?\:2.*?\:d02fd57c_entry_title')

    for link in  news_links:
        href = link.get('href')
        return href

    news_updatetimes = soup.select('#>*?\=_16b03.*?\:2.?*\:5de7e37_entryHolder > div.u100Entry > div.entryHeader > div.fx.metadata > span:nth-child(3)')

    for news_title, news_link, news_updatetime in zip(news_titles, news_links, news_updatetimes):
        data = {
            'NewsTitle':news_title.get_text(),
            'Updatetime':news_updatetime.get_text(),
            'NewsLink':news_link.get.text()
        }
        print(data)

    get_newsinfo(url)

if __name__ == '__main__':

    urls = ['https://feedly.com/i/entry/'.format(number) for number in range(1, 14)]

    for url in urls:
       get_url(url)
    time.sleep(2)

#    wbdata = []

#    newsList = ['ifanr', 'huxiu', '36kr']
#
#    if newsList[0] = wbdata:

 #       wbdata = requests.get('http://ifanr.com',headers)

# def news_title(url):

#    news_info = requests.get('https://feedly.com/v3/streams/contents?streamId=user%2F670ed6b0-dfb0-46c7-b688-8b33ba46dd8c%2Fcategory%2F%E7%A7%91%E6%8A%80&count=20&unreadOnly=true&ranked=newest&similar=true&continuation=16b01e292f7:3277d:5de7e37&ck=1559135018763&ct=feedly.desktop&cv=31.0.357', headers)

#    d = news_info.json()

#    artititles = d['title']
#    print(len(artititles))

#    for artititle in artititles:
#        yield artititle['title']


I hope news_title news_updatetime news_links.

Here is my logcat:
```bash
FelixdeMacBook-Pro:Desktop felixxiong$ python3 feedlynewsupdate.py
Traceback (most recent call last):
  File "feedlynewsupdate.py", line 61, in <module>
    get_url(url)
  File "feedlynewsupdate.py", line 23, in get_url
    links = soup.select('#.*?\=_16b.*?\:2.*?\:d02fd57c_entry_title')
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bs4/element.py", line 1376, in select
    return soupsieve.select(selector, self, namespaces, limit, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/soupsieve/__init__.py", line 114, in select
    return compile(select, namespaces, flags, **kwargs).select(tag, limit)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/soupsieve/__init__.py", line 63, in compile
    return cp._cached_css_compile(pattern, namespaces, custom, flags)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/soupsieve/css_parser.py", line 214, in _cached_css_compile
    CSSParser(pattern, custom=custom_selectors, flags=flags).process_selectors(),
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/soupsieve/css_parser.py", line 1113, in process_selectors
    return self.parse_selectors(self.selector_iter(self.pattern), index, flags)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/soupsieve/css_parser.py", line 946, in parse_selectors
    key, m = next(iselector)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/soupsieve/css_parser.py", line 1100, in selector_iter
    raise SelectorSyntaxError(msg, self.pattern, index)
soupsieve.util.SelectorSyntaxError: Malformed id selector at position 0
  line 1:
#.*?\=_16b.*?\:2.*?\:d02fd57c_entry_title
^

Thank you!




vs vs

I got confused about the listed elements.

What I already know is:

  1. They all don't have real meanings.

  2. Fragment is not a real element.

Can you explain what are the key differences between them? When should we choose one over the other?




How to send GIF to users in viber from chatbot

I have Viber bot and I try to send GIF to my users. The documentation said that:

Max size 1 MB. Only JPEG format is supported. Other image formats as well as animated GIFs can be sent as URL messages or file messages

When I use file messages - users with iOS can't see the file but android sees the file and can download it but they can't see GIF at the chat window. When I use URL messages - android users see URL but iOS see GIF...

Maybe someone found a solution




Simple HTML preprocessor for "compile time"

my question is, is there a preprocessor for HTML like php which runs not when a user does a call. It needs to run at some kind of build stage to do some includes an so on to make some modular HTML pages (nav in one file, footer in an other file and some real page files which are including the footer and nav file) so that I only need to change the nav content and the nav is changed on all "real" pages




javascript action works on cshtml but does not work in external javascript file

I'm trying to move my script from the cshtml to exteral javascript file. All the script runs perfecrtly except from one function: $.post('@Url.Action("GetPoint", "Main")').done(function (xml)... the error i get on the browser debuger is: "jquery.min.js:2 POST http://localhost:58153/@Url.Action(%22GetPoint%22,%20%22Main%22) 404 (Not Found)" How can i make this function work??

var script = document.createElement('script');
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js";
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);

var createPoint = function(ctx, lat, lon) {
  ctx.beginPath();
  ctx.arc(lat, lon, 8, 0, Math.PI * 2);
  ctx.fillStyle = "red";
  ctx.strokeStyle = "black";
  ctx.lineWidth = 3;
  ctx.fill();
  ctx.stroke();
  ctx.closePath();
}

var ctx = document.getElementById("myCanvas").getContext('2d');
ctx.canvas.width = window.innerWidth;
ctx.canvas.height = window.innerHeight;

if ("true" === isFirstMission) {
  // ...
} else {
  myTimer = (function(ctx) {

    $.post('@Url.Action("GetPoint", "Main")').done(function(xml) { // This function does not work..
      alert(xml);
      var xmlDoc = $.parseXML(xml);
      $xml = $(xmlDoc);
      var lat = (parseFloat($xml.find("lat").text()) + 90)(screen.height / 180);
      var lon = (parseFloat($xml.find("lon").text()) + 180) * (screen.height / 360);
      alert(lat);
      alert(lon);

      createPoint(ctx, lat, lon);
    });
  });

  setInterval(function() {
    myTimer(ctx);
  }, 1000);
}




Two FontAwesome Twitter icons with different styles on the same Boostrap 3 page

I need to place two Twitter icons with different style (standard and custom) on the same Bootstrap 3 page.

To do this I decided to copy every relevant FontAwesome style from the font-awesome.css file. The result is almost perfect a part from vertical alignment:

enter image description here

If I edit original fa styles the vertical alignment is fine. Do you know why?

<style>
    .fa_copy {
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;        
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;

        font-size: 30px;
        height: 50px;
        margin: 5px 2px;
        padding: 16px;
        text-align: center;
        text-decoration: none;
        width: 50px;
    }

    .fa_copy:hover {
        opacity: 0.7;
        text-decoration: none
    }

    .fa_copy-twitter:before {
        content: "\f099";
    }

    .fa_copy-twitter {
        background: #55ACEE;
        color: white;
    }
<style>

<!-- custom -->
<a href="#" class="fa_copy fa_copy-twitter" onclick="..."></a>
<!-- standard -->
<a href="#"><i class="fa fa-twitter"></i></a>




WWW Unity: not showing text

I am trying to assign a text taken from a page linked to a Database through the WWW class to a text (in the code "linguaitaliana") that I inserted inside Unity. Through the script I propose below, I take the name in the Update function and insert it into the IEnumerator function. As you can see from the console (IMAGE 1), DataIta is correct, since the link is the working one. But when I do DataIta.text, I don't get the text I want (it's empty!) (IMAGE 2) If I try to put the link directly (without concatenation) inside the script, the result is right (IMAGE 3) In image 4 I show the result of the connection to the link of Image 3. Image 5, on the other hand, is the screen referred to "Italian language" on Unity. The problem is, therefore, of printing. Solutions?

Image 1

Image 2

Image 3

Image 4

Image 5




Web hosting for JSP pages and servlet pages

what is the best web hosting site for JSP page and Servlet? Please give me yours best suggestion




Is there way to get the cookie from browser (console) and use this in python request (user validation)?

I want to crawl a site which uses authentication. After login there are some content that i want to get. I cannot seem to make it work to login with python because it uses authentication token, so i thought there might be a way to log in in browser and observ the request and response to get the cookie which can authenticate the python script to access contens that are hidden behind validation.

I have tried to login with python script but could not get it work.

with requests.Session() as s:
    r = s.get(url, headers=header)

    #r = s.post(url, data=login_data, headers=header)
    print(r.content)
    #s.get(url, data=login_data, headers=header)

login_data = {
    'authenticity_token': '',
    'user[id]': '',
    'user[name]': '',
    'user[pass]': '',
    'commit': 'login'
}




How to verify an ES256 JWT token using Web Crypto when public key is distributed in PEM?

I need to verify ES256 JWT tokens in a Cloudflare Worker. To my understanding they do not run Node.js there and I will have to make everything work with the Web Crypto API (available in browsers, too, as window.crypto.subtle). However, I am expecting to receive the public keys as PEM files and I think I am having problems importing them.

I have been trying to modify an existing open source JWT implementation that only supports HS256 to support ES256.

In addition to trying to use the actual tokens and keys, and keys generated in browsers and OpenSSL, I have tried to use a working example from the JWT.io website (after converting it to JWK format using node-jose), since it should validate correctly. But I am not getting any errors, my code running in browser just tells me the token is not valid.

Here is my Node REPL session I used for converting the key from JWT.io to JWK:

> const jose = require('node-jose')
> const publicKey = `-----BEGIN PUBLIC KEY-----
... MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEVs/o5+uQbTjL3chynL4wXgUg2R9
... q9UU8I5mEovUf86QZ7kOBIjJwqnzD1omageEHWwHdBO6B+dFabmdT9POxg==
... -----END PUBLIC KEY-----`
> const keyStore = jose.JWK.createKeyStore()
> keyStore.add(publicKey, 'pem')
> keyStore.toJSON()
{
  keys: [
    {
      kty: 'EC',
      kid: '19J8y7Zprt2-QKLjF2I5pVk0OELX6cY2AfaAv1LC_w8',
      crv: 'P-256',
      x: 'EVs_o5-uQbTjL3chynL4wXgUg2R9q9UU8I5mEovUf84',
      y: 'kGe5DgSIycKp8w9aJmoHhB1sB3QTugfnRWm5nU_TzsY'
    }
  ]
}
>

Here is the failing validation, based on code from webcrypto-jwt package:

function utf8ToUint8Array(str) {
    // Adapted from https://chromium.googlesource.com/chromium/blink/+/master/LayoutTests/crypto/subtle/hmac/sign-verify.html
    var Base64URL = {
        stringify: function (a) {
        var base64string = btoa(String.fromCharCode.apply(0, a));
        return base64string.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
        },
        parse: function (s) {
        s = s.replace(/-/g, '+').replace(/_/g, '/').replace(/\s/g, '');
        return new Uint8Array(Array.prototype.map.call(atob(s), function (c) { return c.charCodeAt(0); }));
        }
    };
    str = btoa(unescape(encodeURIComponent(str)));
    return Base64URL.parse(str);
}

var cryptoSubtle = (crypto && crypto.subtle) ||
(crypto && crypto.webkitSubtle) ||
(window.msCrypto && window.msCrypto.Subtle);

// Token from JWT.io
var tokenParts = [
    'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9', 
    'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0',
    'tyh-VfuzIxCyGYDlkBA7DfyjrqmSHu6pQ2hoZuFqUSLPNY2N0mpHb3nk5K17HWP_3cYHBw7AhHale5wky6-sVA'
];

// Public key from JWT.io converted in Node using node-jose
var publicKey = {
    kty: 'EC',
    kid: '19J8y7Zprt2-QKLjF2I5pVk0OELX6cY2AfaAv1LC_w8',
    crv: 'P-256',
    x: 'EVs_o5-uQbTjL3chynL4wXgUg2R9q9UU8I5mEovUf84',
    y: 'kGe5DgSIycKp8w9aJmoHhB1sB3QTugfnRWm5nU_TzsY'
};

var importAlgorithm = {
    name: 'ECDSA',
    namedCurve: 'P-256',
    hash: 'SHA-256',
};

cryptoSubtle.importKey(
    "jwk",
    publicKey,
    importAlgorithm,
    false,
    ["verify"]
).then(function (key) {
    var partialToken = tokenParts.slice(0,2).join('.');
    var signaturePart = tokenParts[2];

    cryptoSubtle.verify(
        importAlgorithm,
        key,
        utf8ToUint8Array(signaturePart),
        utf8ToUint8Array(partialToken)
    ).then(function (ok) {
        if (ok) {
            console.log("I think it's valid");
        } else {
            console.log("I think it isn't valid");
        }
    }).catch(function (err) {
        console.log("error verifying", err);
    });
}).catch(function(err) {
    console.log("error importing", err);
});

Since I copied a valid key and a valid token from JWT.io, I am expecting the code to log "I think it's valid" without errors. It does not show any errors, indeed, but it ends up in "I think it isn't valid" branch.




Parceljs configuration

I have a problem with import html-files in index.html.

My package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "test",
  "author": "test",
  "license": "ISC",
  "dependencies": {
    "del": "^3.0.0",
    "i": "^0.3.6"
  },
  "devDependencies": {
    "parcel-bundler": "^1.12.3"
  },
  "scripts": {
    "start": "parcel src/pages/index.html"
  }
}

My project structure

I tried include header.html in index.html like this, but it's didn't work. <include src="src/pages/templates/header.html"></include>

How can i include html files on index.html page?




what is the best way to create a user manual on using a crm

I develop a crm, and I want to train users on the use of the latter, and create a user guide for future users. how can i do that and what are the tools used by the developer to write the documentation of their software




Making a video background fit screen (Currently zoomed in)

I have a video that I am trying to use as a background and want it to be able to resize according to the browser size as well. Currently, the video is zoomed far in and therefore, only a portion of the video is shown.

I would like there to be no whitespace between any of the divs. All the other methods I have tried have led to this...

<!DOCTYPE html>
            <html>
            <head>
            <title></title>

            <style>
            body {
            margin: 0;
            }

            .container-fluid .header {
            position: relative;
            }

            .video-container {
            z-index: -100;
            overflow: hidden;
            position: relative;
            top: 0;
            left: 0;

            max-width: 100vw;
            width: 100%;
            max-height: 100vh;
            height: 100%;
            }

            #video-bg {
            margin: 0 auto;
            height:auto;
            width:auto;
            display: block;
            }

            .block {
            width: 100%;
            height: 100vh;
            }

            #block1 {
            background: black;
            }

            #block2 {
            background: yellow;
            }

            #block3 {
            background: red;
            }


            /*.carousel-caption {
            left: 5%;
            text-align: left;
            max-width: 500px;
            right: auto;
            padding:5px;
            }
            .carousel-inner {
            width: auto;
            }
            .carousel-inner > .carousel-item > img {
            height:100vh;
            }*/

            </style>
            </head>
            <body>

             <div class="container-fluid header"> 
            <div class="header">

            <div class="video-container">
              <video autoplay muted id="video-bg">

                <source src="https://static.videezy.com/system/resources/previews/000/003/951/original/downtownla.mp4" type="video/mp4"/>

              </video>
            </div> 
            </div>
            </div>

            <div id="block1" class="block">

            </div>
            <div id="block2" class="block">

            </div>
            <div id="block3" class="block">

            </div>



            </html>




mardi 28 mai 2019

Forcing www and https redirect on NGINX as backend of Google cloud Load Balancer using $http_x_forwarded_proto

I have a NGINX backend instance for the google cloud platform load balancer. I have and have successfully set up the https redirect. I want to force from non-www to www. For the most part all but one instance redirects to a www url. to Summarize:

https://ampkart.com not successful and stays as https://ampkart.com

I have tried multiple edits to the redirect in the default.conf file to force it but to no avail. I know it probably has something to 'http' in the bracket and it is only affecting the http urls to redirect to www but the https urls are not affected. Can someone please help me modify this code for the redirect to work? Here is my default.conf file for my NGINX server.

 server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /storage;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        server_name ampkart.com;


        location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ =404;
                error_page  405     =200 $uri;
        }

        # pass PHP scripts to FastCGI server
        #
        location ~ \.php$ {

            if ($http_x_forwarded_proto = 'http'){
            rewrite  ^/(.*)$  https://www.ampkart.com/$1 permanent;
        }               
                    include snippets/fastcgi-php.conf;
        #   # With php-fpm (or other unix sockets):
            fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        #   # With php-cgi (or other tcp sockets):
        #   fastcgi_pass 127.0.0.1:9000;
        if ($request_method ~* "(GET|POST|OPTIONS)") {
                    add_header "Access-Control-Allow-Methods" "GET, POST, 
        OPTIONS";
                    add_header "Access-Control-Allow-Credentials" "true";
                    add_header "Access-Control-Allow-Origin" 
         "https://www.ampkart.com";
                    add_header "Access-Control-Expose-Headers" "AMP- 
         Access-Control-Allow-Source-Origin,Content-Length,Content-Range";
                    add_header 'Access-Control-Allow-Headers' 'DNT,User- 
         Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content- 
         Type,Range';
                    add_header 'AMP-Access-Control-Allow-Source-Origin' 
         "https://www.ampkart.com";
                    add_header "AMP-Same-Origin" "true";
                    add_header "AMP-Redirect-to" 
         "https://www.ampkart.com$request_uri";
              }   
            }

          # deny access to .htaccess files, if Apache's document root
          # concurs with nginx's one
          #
          location ~ /\.ht {
            deny all;
          }
          }

I would like to be able to redirect https://ampkartcom to https://www.ampkart.com




Python: How to scrape an updating website and store data for future analysis

I have a developed to scrape website below https://www.insidefutures.com/markets/data.php?page=quote&sym=NG&x=19&y=5

The data updates every 10 minutes and I would like to find a relationship between prices and volumes traded. However, I would need to download the data every 10 minutes and store it for future analysis.

On website update I would like my code to run and also download to database every 10 minutes for future analysis. How can I achieve this?

  from urllib.request import urlopen
  from bs4 import BeautifulSoup
  import pandas as pd
  import requests
  import numpy as np

  res = requests.get('https://shared.websol.barchart.com/quotes/quote.php?page=quote&sym=ng&x=13&y=8&domain=if&display_ice=1&enabled_ice_exchanges=&tz=0&ed=0')

  soup = BeautifulSoup(res.text, 'lxml')
  soup.prettify()
  Header = soup.findAll('tr', limit=2)[1].findAll('th')

  column_headers = [th.getText() for th in soup.findAll('tr', limit=2) 
  [1].findAll('th')]


 data_rows = soup.findAll('tr')[2:]
 i = range(len(data_rows))
 # for cell in data_rows
 Contracts =[]
 Lasts =[]
 Changes =[]
 Opens = []
 Highs =[]
 Lows =[]
 Volumes=[]
 Previous_Settles=[]

 for td in data_rows:

Contract = td.findAll('td')[0].text
Contracts.append(Contract)

Last = td.findAll('td')[1].text
Lasts.append(Last)

Change = td.findAll('td')[2].text
Changes.append(Change)

Open = td.findAll('td')[3].text
Opens.append(Open)

High = td.findAll('td')[4].text
Highs.append(High)

Low = td.findAll('td')[5].text
Lows.append(Low)

Volume = td.findAll('td')[6].text
Volumes.append(Volume)

Previous_Settled = td.findAll('td')[7].text
Previous_Settles.append(Previous_Settled)

Date_Time = td.findAll('td')[8].text
df = pd.DataFrame({'Contracts' : Contracts, 'Last': Last, 'Change': Changes, 'Open':Opens, 'High': Highs, 'low': Lows,'Previous_Settled': Previous_Settles})
print(df)




Mobile - Browser addreds bar doesn't hide when scrolling with Ionic

When an Ionic App is deployed in the web and you access it from a phone, the bar address never dissapears. I know this is because of ion-content or something similar but I haven't found any work around or info about this, only an issue in github from Ionic 2.

Isn't there any work around to hide the browser address bar yet? This is a really downcoming to Ionic...




how to run a python file on a django website

I (a django beginner) am making a website (http://tijmenmeijer.pythonanywhere.com/articles/) with django. I created a python file and I'd like to run that file on my website.. how to do that?

import requests
import pygame,sys
pygame.init()

run = True
while run:


headers = {'Referer' : 'https://www.windguru.cz/station/219'}    
r = requests.get(' https://www.windguru.cz/int/iapi.php?q=station_data_current&id_station=219&date_format=Y-m-d%20H%3Ai%3As%20T&_mha=f4d18b6c', headers = headers).json()


maxwind = r['wind_max']
minwind = r['wind_min']
avgwind = r['wind_avg']
temp = r['temperature']
direction = r['wind_direction']
date = r['datetime']


for event in pygame.event.get():
    if event.type == pygame.QUIT:
        quit()

screen = pygame.display.set_mode((300,100))
screen.fill((100,255,255))

sys_font = pygame.font.SysFont("None",23)
render = sys_font.render(str(avgwind) + str(' knopen -- ') + str(maxwind) + str(' max -- ') + str(minwind) + str(' min'), 0,(0,0,0))
screen.blit(render, (35,10))


pygame.display.update()




How to design an efficient architecture for a simple news feed in php/mysql?

To make it short : I have come to 2 solutions while thinking about the best way to make a simple news feed for a big audience website. I'll expose the 2 solutions but most of all, I'm posting them here to have the most opinions about them and mostly to know if you would have a better way to set this up. So I'm very open to all feedbacks/advices.

The details :

In the database, there is 3 tables : User, Author and Books. The users can suscribe to authors and authors are writing the books. So this is what it looks like.

db_architecture_1

What is needed is a simple news feed : users would be displayed a list of the last books published by the authors they suscribed to. Like this: *

  • Author45 wrote a new book : Book756Title
  • Author12 wrote a new book : Book45Title
  • Author 76 wrote a new book : Book28Title
  • ...

*

The solutions :

  • The first solution i that came in my mind : When loading the news, just make a simple SELECT that joins all the concerned tables and order by the publishing date.

    The problem is that, though it's the simplest and quickest solution, i couldn't stop thinking that it is a pretty heavy query which would affect a lot the application performance when executed by a large audience.

  • Then comes the second solution, which needs a little more explanations :

For the website system, there are 2 servers : the public server which hosts the public website with the main database, and a second server which has a backup/update database. The second server is not accessible publicly but both server are synchronized everyday.

So all new author and books insertions are made on this one whereas user suscribtions and all user activities are done on the public server.

Sooo the second solution i found, and the best one in terms of performance is to add a new table Notification, and set up a mysql trigger on the Publication table. The trigger, after every new publishing is inserted, would select all users who suscribed to the author and insert form them new entries on the notification table.

This way, the only remaining task on the public server would be to select the new notifications of the user and display them.

I have made a test for that trigger for 10 000 users suscribtion and i think mysql reacted extremely fast.


So now, even though the second solution is the winner, I came to expose both to you, in order to have the maximum of opinions about this optimization question.

Thank you all for reading and waiting for your answers.




CSS error: Image CSS set permanently to 'display:none ! important;

Well, basically i created a image inside a div using the img tag in a HTML file that i've been writing and the image just wont show up on the browser. Inspect says the image cannot be loaded and it's CSS is set to 'display: none!important'.I wasn't able to untick it even in inspect. Can you help me?

  1. No class was declared on the img tag and the div holding it.
  2. I haven't written the 'display:none!important' css anywhere on the page. 3.There are other images in the same page which is displaying perfectly fine. I placed another image on the div which is holding my problem-image and even it is showing up. Renaming the image works too [Although i would like to know why].

Any other image will work fine,The image is now kept renamed by finding it in finder, the error is gone now. But i still would like to know why it is so. If i rename it back. The error will appear once again.




Problems with $.post

I am doing some checks on my website to assure that the web browser can run it. If the browser pass the requirements, I want to reload the webpage and send a post argument with jQuery like this.

I have tried the $.post function on jQuery like this:

$.post("index.php", { 
  correcto_obligatorio: true 
});

window.location.reload("index.php")

However, when the browser reloads the web, there is no correcto_obligatorio parameter on $_POST. I used the var_dump php function to print it and all I get is NULL




Bypass the Origin header check and CSRF attack

I'm trying to do some csrf attack test on a site.
I found that the site protect itself from csrf by checking the http Origin header.

But I guess maybe under some conditions I can bypass the protection. When I delete the Origin header, the csrf attack success.
It means that the server only check the Origin heaer for csrf protection and accept an "none" value.

Any way to do the following exploit please?




lundi 27 mai 2019

Single code base of website, mobile site and native app

We are offering customer service in all the 3 mediums - Web Site, Mobile Site (PWA) and Native App (Android and iOS). We are maintaing 3 different code base and some parity exists in terms of some features available only in Native App.

Now my business team wants to move in a faster phase and I am thinking of moving to a single code base with which I can cater all the 3 mediums. In this sense which one is best to take :

ReactJS VueJS

I am new to both and completely have no idea about these. Is there any other options please let me know

Thanks in advance!

regards

Mano




How to call webservice [Postman] in PHP

I'm using postman web service [https://www.getpostman.com/] to collect the datas. Can anyone please guide me on how to call these postman webservice using PHP.




Selecting a subform from form in Mechanize/Python

I want to fill username and password at https://myapps.lilly.com with usage of Mechanize lib. I have discovered that there is only one form 'e1' at this page. Inside of it is the 'username' I want to fill in.

I checked it on using multiple browser settings - no effect at all. I inspected the page. Then I realized that I have to access table's cell name=username, however I cannot find info about filling/clicking particullar tables in lib's documentation. Below you may find a snip that I used to check list of forms at page.

import mechanize

br = mechanize.Browser()
br.addheaders = [('User-agent', 'Mozilla/5.0')] 
br.open('https://myapps.lilly.com')

for form in br.forms():
    print(form.name)

I want to be able to log in to this page using python.




Extract data from web without identifier?

How can I extract a table from a website https://www.lyngsat.com/tvchannels/in/Aaj-Tak.html to an excel which does not any identifier?

Previously, I tried using getElementsByTagName but there are too many tags for a different table on the page.




Code is executing twice but it should run once only?

My code is executing twice the componentWillMount() method is executing twice.

tried using different life cycles methods as well.

import React from "React"; import ProductDetails from "./ProductDetails";

class Product extends React.Component { constructor(props) { super(props); this.state={ data : null }
} componentWillMount() { console.log("before"); let xhr = new XMLHttpRequest(); xhr.onreadystatechange = ()=>{

    if(xhr.readyState === 4 && xhr.status === 200)
    {
      let dataRecived = JSON.parse(xhr.responseText);
      this.setState({data: dataRecived})
    }

  }
  xhr.open("GET", "./db.json", true);
  xhr.send();
  console.log("before",this.state.data);
}

render(){
  console.log("after",this.state.data)
  return(
  <div>
    {/* <ProductDetails  data={this.state.data}/> */}
  </div>
  );
}

}

export default Product;

It should executes once only