jeudi 31 mars 2016

mina 2.0.13 + websocket + buffer.capacity

Background: I am sending data by mina web socket (http://ift.tt/1J7t5Q0) which is already patched the buf issue..

I used to send the json message through the web socket around 50 bytes.. sometimes, it will goes up to 70 bytes...

The problem is: at initial, the IOBuffer.capacity() is 2048 --> 2048 --> 1024 --> 1024 -> 512 -> 512 -> 256 -> 256 -> 128 -> 128 -> 64 -> 64 -> 64 -> 64

If the json message becomes 70 bytes. It will split into two message in messageReceived(IoSession session, Object message). Is there any way that i can solve this problem.

I can store the incomplete message, but it will raise another issue such as 2 json messages or 1 valid json message with 1 invalid json message.

Thanks.




PHP cURL not working on other sites

Im a novice programmer in PHP. Last week I read about cURL that capture my attention to study it. first, I copy and paste codes posted on different blogs and it goes run good like my code below.

<?php
$handle=curl_init('http://ift.tt/sMuLwx');
curl_setopt($handle, CURLOPT_VERBOSE, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
$content = curl_exec($handle);
echo $content;
?>

BUT WHY I CAN'T cURL the website

http://ift.tt/1z66QoB

since that i am using same code above it outputs

enter image description here

Looking for your positive response guys. thank you in advance.




How to check or monitoring if sitemap works on particular websites

sitemap.xml file has been created on the Website.but my question how and where can I Check if it is successfully run or works on a particula websites




Jasmine to test window.setTimeout

I have the following code which I need to test using jasmine and I seem to be stuck

timeoutCallback () {
var self = this;
self.$window.setTimeout(function() {
  self.$window.location.href = 'www.google.com';
}, 400);
}

I keep on getting the following error in my existing jasmine test which call the callback

'undefined' is not a function (evaluating 'self.$window.setTimeout(function () {
    self.$window.location.href = 'www.google.com';
  }, 400)') (line 183)




C# Encoding URL

My goal is to create a partially encoded uri to create a WebRequest with.

I can encode part of a uri which I can do using HttpUtility.UrlEncode, but then when I create the URI, it decodes it back.

For example

    string urlString = "http://ift.tt/1X15VAM" + HttpUtility.UrlEncode("addr=b@g.com");
    Uri url = new Uri(urlString);

The url is {http://ift.tt/1M4tEzB} but I want http://ift.tt/1M4tEzB

If I pass the urlString to WebRequest.Create(), it does the same thing as seen above.

Does anyone have a solution to this? Either passing a string to WebRequest.Create() or creating a partially encoded URI and passing that to WebRequest.Create() (I'm assuming that a URI passed to WebRequest.Create() doesnt get decoded)




Is it possible to give nonexact value as Content-Length?

I am streaming a file. I don't know the exact size of it before I end streaming, but I know an approximated value. The exact value is never bigger than 1 kB then my approximated value. I tried using my approximated value for Content-Length but Firefox ended downloading when it reached this value so it did not get the last ~1kB even thought it was still streaming.

So I want to let the browser know how much data to expect. Can I do that?




Jolie Programming Language and REST APIs

everyone. I would like to know if anyone knows any example or documentation about doing REST APIs with Jolie. Thanks in advance!




.htaccess to hide 2 folder paths

I am having difficulties getting the second statement working regarding admins, i am trying to hide both new and admin parts of the directory. new seems to be hiding fine however admin doesnt want to know. IS the first rule for new almost blocking the second one? Is it possible to have the two combined so thestatement would read if either new or admins then hide...?

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+new/([^\s]+) [NC]
RewriteRule ^ %1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (?!^new/)^(.*)$ /new/$1 [L,NC]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+admins/([^\s]+) [NC]
RewriteRule ^ %1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (?!^admins/)^(.*)$ /admins/$1 [L,NC]




what is the equivalent to onCreate and onStart of the android lifecycle for web sites?

I want to know what is the equivalent to onCreate and onStart of the android lifecycle for web sites? How is the lifecycle for web sites?

Thank you in advance.




How can i create transparent divs that have a picture as background on an otherwise black background?

Sorry if the title is worded badly.

I want to recreate an interface similar to Windows Phone 10.

You can see an example of what I try to achieve in HTML in this picture:

http://ift.tt/1VW9EBq

The middle tiles act like windows on the baby picture while the space between tiles is black.

Thanks in advance!




Chart.js in ASP.NET, Data from database

I am currently working on the last page of my web form, which is the Dashboard. I followed this guide: http://ift.tt/1pOh5Op to implement chart.js graphs into my dashboard but it only shows me how to manually add data in. I am looking to have my axis and data points be pulled from the database. I've search around and just cant find out how to get the data directly from the database. If anyone could guide me in the right direction, that'd be much appreciated!




KnockoutJS : apply binding after render causes "xxx is not defined"

I want to get rid of that error but i'm currently using KnockoutJS on a special block. The problem is that when ko read for the data-bind, my ViewModel isn't created yet. I bind it after ko is loaded. Here is my HTML view :

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>{% block title %}{% endblock %} - Evosphere</title>
    <link rel="icon" type="image/x-icon" href="{{ asset('design/img/icons/favicon.png') }}" />

    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

    <link href='http://ift.tt/1ZO5WKc' rel='stylesheet' type='text/css'>
    <link href='http://ift.tt/1RZWnau' rel='stylesheet' type='text/css'>

    <link href='{{ asset("design/css/resp_lg.css") }}' media="screen and (max-width: 1550px)"  rel='stylesheet' type='text/css'>
    <link href='{{ asset("design/css/resp_md.css") }}' media="screen and (max-width: 1350px)"  rel='stylesheet' type='text/css'>

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

    {% javascripts
    'js/libs/*.js'
    'js/Evo/BeforeInit/*/*.js'
    %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}
</head>
<body>
    <nav class="navbar-top">
    </nav>
    <div data-knockout="messenger-block">
    <div id="messenger-attachment-container" class="container-messenger">
        <div data-bind="foreach: conversations">
            Ohoh
        </div>
    </div>
    <div id="messenger-dialog-container" class="container-messenger-bottom">
    </div>
</div>
    <div class="main">
    {% block body %}
    {% endblock %}
    </div>

    <script src="http://ift.tt/1ZO5YSj"></script>

    {% javascripts
    'js/Evo/app.js'
    'js/Evo/*/*.js'
    %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}

    {{ include('AppBundle:Javascript:init.js.html.twig') }}

    {% javascripts
    'js/Evo/RequireInit/Utility/*.js'
    'js/Evo/RequireInit/Module/*/*.js'
    'js/Evo/RequireInit/Module/bootstrap.js'
    'js/Evo/RequireInit/Module/navigation.js'
    'js/Evo/RequireInit/Module/feed.js'
    %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}

    {% block javascripts %}
    {% endblock %}
</body>
</html>

Here is my JS :

function ConversationDialogViewModel(){
var self = this;

this.conversations = [1, 2, 3];
}
var $messegnerBlockKnockout = $('[data-knockout="messenger-block"]');
ko.cleanNode($messegnerBlockKnockout[0]);
ko.applyBindings(new ConversationDialogViewModel(),   $messegnerBlockKnockout[0]);
$messegnerBlockKnockout.show();




Python SimpleHTTPServer keeps going down and I don't know why

This is my first time working with SimpleHTTPServer, and honestly my first time working with web servers in general, and I'm having a frustrating problem. I'll start up my server (via SSH) and then I'll go try to access it and everything will be fine. But I'll come back a few hours later and the server won't be running anymore. And by that point the SSH session has disconnected, so I can't see if there were any error messages. (Yes, I know I should use something like screen to save the shell messages -- trying that right now, but I need to wait for it to go down again.)

I thought it might just be that my code was throwing an exception, since I had no error handling, but I added what should be a pretty catch-all try/catch block, and I'm still experiencing the issue. (I feel like this is probably not the best method of error handling, but I'm new at this... so let me know if there's a better way to do this)

class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
    # (this is the only function my request handler has)
    def do_GET(self):
        if 'search=' in self.path:
            try:
                # (my code that does stuff)
            except Exception as e:
                # (log the error to a file)
            return
        else:
            SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)

Does anyone have any advice for things to check, or ways to diagnose the issue? Most likely, I guess, is that my code is just crashing somewhere else... but if there's anything in particular I should know about the way SimpleHTTPServer operates, let me know.




WordPress Development with MAMP not working since installing MySQL using terminal

I'm having a problem with localhost servers and databases. I'm by no means a pro at all of this but I've been developing WordPress websites for a short while and have been using MAMP because of how simple it is.

Now I understand that it installs MySQL for you and that apache and php are all included with OS X, but I began learning Ruby on Rails and while I was following a tutorial I installed MySQL manually via terminal and I think I've ran into some collision problems now.

For a while MAMP refused to start the SQL server so I've changed the ports to Apache 8888 and SQL 8889 and now seems to be starting fine (which are the defaults I believe but were different for some reason).

Now I've got two different database locations (I think). One which I can see via the terminal using mysql -u root -p and the other which I can see by launching MAMP and viewing PHPMyAdmin. If I create a database in one I cannot see it in the other, but more importantly when I create the database in MAMP's PHPMyAdmin and try installing WP it doesn't recognise it, is this because my username/password may have been changed for MAMP or should it all be the same?

So far I've been thinking maybe I should uninstall MAMP and do a hard reset for MySQL etc and just use the terminal to manage MySQL, PHPMyAdmin and Apache etc but I'm not sure - is there a better way to go about this? I am working on a WP website for a client at the moment in tandem with a Ruby on Rails project so need to ideally jump between the two!

I'm really confused by this and may not have explained it very well, if I can explain anything in more detail then let me know.

Appreciate all your time, thanks

Arthur




www and non-www domain name resolution error?

One of my websites, https://adenix.me, is having an issue where at certain times, usually about 30 minutes after initially going to the site, 'adenix.me' won't resolve. When this happens 'www.adenix.me' works fine and other devices seem to be working fine for both version of the url. To make the situation odder, I only see this issue on my personal computer and it is temporarily fixed by restarting my computer.

While the problem appears to be isolated I am afraid that I just haven't waited long enough on other machines. Below is my DNS configuration and the apache2 config files for the site (### denotes that I've cloaked it).

Thanks for any help in advance!

DNS - Cloudflare

A       adenix.me   points to        ###              Automatic
CNAME   www         is an alias of   adenix.me        Automatic

adenix.me.conf

<VirtualHost *:80>

    ServerAdmin admin@adenix.me
    ServerName www.adenix.me
    ServerAlias adenix.me
    DocumentRoot /var/www/###

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/adenix.me>
            Options -Indexes
            AllowOverride All
    </Directory>

    RewriteEngine on
    RewriteCond %{SERVER_NAME} =adenix.me [OR]
    RewriteCond %{SERVER_NAME} =www.adenix.me
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>

adenix.me-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>

    ServerAdmin admin@adenix.me
    ServerName www.adenix.me
    ServerAlias adenix.me
    DocumentRoot /var/www/###

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/adenix.me>
        Options -Indexes
        AllowOverride All
    </Directory>

    SSLCertificateFile ###
    SSLCertificateKeyFile ###
    Include ###
</VirtualHost>
</IfModule>




Are there any security risks associated with having a writable directory within the web server's root?

In order to ease some load off the database server, I have decided to use heavy caching to cache db result sets in php files; however I must create those .php cache files automatically within a cache folder. That cache folder must be writable by the web server's user. What are the security risks here? Is this best practice? Would users be able to do things like build their own form and upload to that directory?




Java Web Application Deployment

I am trying to deploy my java web application to Azure using FTP. Is the .war file enough to be uploaded? Or all the project files have to be uploaded?

Thanks for your help.




Knockout : context changed before the instruction in observable.subscribe

I'm trying to separate my Model from my ViewModel since I need the Model in two different ViewModel. So i've tried to this :

var ConversationManager = {
    conversations: ko.observableArray([
        {id: 3, receiver:'Toto'}
    ])
};

function ConversationDialogViewModel(){
    var self = this;

    ConversationManager.conversations.subscribe(function(context){
        console.log('Before :', context); // context.test == true ???

        for(var i = 0; i < context.length; i++){
            if(context[i].id % 2 == 0 && !context[i].test){
                console.log('Insertion Called');
                context[i].test = true;
            }
        }
        console.log('After :', context);
    });

    ConversationManager.conversations.push({id: 4, receiver:'Jean'});
    ConversationManager.conversations.push({id: 5, receiver:'Paul'});
    ConversationManager.conversations.push({id: 6, receiver:'Bleu'});
}

Somehow, in the first console.log, when i push "Jean", in the browser, the variable "test" exists and is correctly set to true even before i actually tell JS to do it. How is that possible ? And, am I correctly separating my concerns ?




how to avoid security check while processing and gettng response from net web service using java metro 2.3 java client in glass fish

Quesion: i am using glassfish server and netbeans id to create java consumer web service which will consume .Net web service. dot net web service is secured web service which needs Username and Userpassword in request Header.I am sending below header with request body.

while getting response in my glassfish i am getting below error. But In glassfish console i am getting corrrect response but in java code throwing error as shown below.

Error

javax.xml.ws.WebServiceException: com.sun.xml.wss.impl.XWSSecurityRuntimeException: java.lang.NullPointerException at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:365) at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1147) at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050) at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019) at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877) at com.sun.xml.ws.client.Stub.process(Stub.java:464) at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:174) Caused by: com.sun.xml.wss.impl.XWSSecurityRuntimeException: java.lang.NullPointerException at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:270) at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:455) at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:434) at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:362) ... 41 more

Caused by: com.sun.xml.wss.impl.XWSSecurityRuntimeException: java.lang.NullPointerException
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:270)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:455)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:434)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:362)
... 41 more

Caused by: java.lang.NullPointerException at com.sun.xml.ws.security.opt.impl.incoming.GenericSecuredHeader$IDProcessor.accept(GenericSecuredHeader.java:408) at org.codehaus.stax2.ri.Stax2FilteredStreamReader.next(Stax2FilteredStreamReader.java:37) at com.sun.xml.stream.buffer.stax.StreamReaderBufferCreator.storeElementAndChildrenNoEx(StreamReaderBufferCreator.java:266) at com.sun.xml.stream.buffer.stax.StreamReaderBufferCreator.storeElementAndChildren(StreamReaderBufferCreator.java:198) at com.sun.xml.stream.buffer.stax.StreamReaderBufferCreator.createElementFragment(StreamReaderBufferCreator.java:147) at com.sun.xml.ws.security.opt.impl.incoming.GenericSecuredHeader.(GenericSecuredHeader.java:122) at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.cacheHeaders(SecurityRecipient.java:308) at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:245) ... 44 more

Your help appriciated. Rasmi




How do I set up a server in a local directory?

I have xampp and I can connect to localhost and view a site provided I have saved it in htdocs. But I am interested in being able to save a project in a different directory, for example documents, and still be able to access it. I did something similar in a work experience where it was saved on the desktop and I would simply type dev.websitename to access it. I think this was using nginx. How would I do this in my own device? Can this be achieved with xampp? I don't want to simply change the configuration for xampp, I want to be able to save multiple projects in different places and only have to edit a configuration file for the project.




Upload image using PHP and forms

I have a problem in uploading a picture using forms and display it on other page , the basic problem is I can't found the picture on the path where I save it : this is the form.php

            <form role="form"  id="equipe" action="editEquipe.php" method="get">
              <div class="box-body">




                <div class="form-group">
                  <label for="id_equipe">id Equipe</label>
                  <input type="text" class="form-control" id="id_equipe"  name="id_equipe">
                </div>


               <div class="form-group">
                  <label for="drapeau">Télécharger le logo</label>


                  <input type="file" id="logo"   name="logo">

                </div>

              </div><!-- /.box-body -->

              <div class="box-footer">
                <button type="submit"  value="" class="btn btn-primary">Modifier</button>
              </div>
            </form>

and this my action.php ,

if(isset($_GET['id_equipe'])  &&  isset($_GET['logo']))

   {
       $id_equipe= $_GET['id_equipe'];

       $logo =  $_GET['logo'];



    $imgname = "logo_".$id_equipe;
  $logoImage=$imgname.".png";
   $link = "http://.../LogoImages/".$imgname.".png";


if ($conn->connect_error) {
$response["error"] = -1;
$response["message"] = "cannot connect to the server please try          again";
  }


 else
    {






    $sql = "UPDATE equipe set
    nomEquipe='$nom_equipe',
    logoEquipe=' $link',
    idChampionnat='$nom_championnat'

    where idEquipe='$id_equipe' ";

    $updatedispo = $conn->query(sprintf($sql));
    if($updatedispo)
    {           


     $imsrc = base64_decode($logoImage);


     $path ="http://.../LogoImages/".$imgname.".png";

     $path = str_replace('\/','/',$path);




    $fp = fopen($path, 'wb');
    var_dump($fp);


    if(is_readable($fp)) echo 'readable ';
    else echo "no redable ";

    if(is_writable($fp)) echo 'writable ';
        else echo "no writable";

    fwrite($fp, $logoImage);
     // var_dump($fp);

      fclose($fp);



                     $response["error"] = 0;
                     $response['picture'] = $path;

                     $response['message'] =  "Image uploaded in ".$path;
                     $response['id_image'] = $id_equipe;
                     $response["message"] = " equipe updated";


    }

    else
    {
                    $response["error"] = -1;
                    $response["message"] = "error requete"; 
    }
   }
    }


   else
      {
         $response["error"] = 100;
         $response["message"] = "Some params are missing";   
       }
     echo json_encode($response);


        ?>

Pleaaase help me




Controlling React component props from DOM

I have a React modal I created which has two props: isOpened and onClose. This works fine from within React, however my whole site isn't completely React yet and so I want to be able to control my modal from outside of the React environment.

I have set isOpened to a window variable, and onClose to a window function that updates this variable, and this works fine on first load, but of course when these variables are updated my modal component is not re-rendered.

Is there a way to call forceUpdate from the DOM when I update my variable? Or am I going about this in completely the wrong way?

FYI: I am happy for a hacky solution as this is temporary until I can finish moving my site to React.

Thanks!




VB image recognition in a webbrowser-Controll

i need your help.

I would like to programm a software in VB, with this i can check if on a Website an image is somewhere and click there. The Website use flash.

So my intention was:

  1. open the Website
  2. make a screenshot of this site
  3. check different pixels or in best case an small images.
  4. click on this position

The Problems I found are:

  • Browser.DrawToBitmap(.... => retruns a blank image
  • i found no lib to check 2 images, if one is in the other

please help :)




CSS margin:0 auto not working on li>a

I want a navigation bar with its elements (li>a) to be in the middle. I achieved only the float left style.

#wrapper {
  width: 900px;
  margin: 0 auto;
}
li {
  float: left;
}
ul>li>a {
  display: block;
  padding: 14px 16px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  margin: 0 auto;
  font: 18px Inconsolata;
}
/* fdfdf */

ul {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #333;
  border-radius: 20px;
}
ul>li:hover {
  background: #111;
}
li>a.active {
  background-color: #4CAF50;
  color: #fff;
}
<div id='wrapper'>
  <ul>
    <li><a class='active' href="#">Home</a>
    </li>
    <li><a href="#">Blog</a>
    </li>
  </ul>
</div>

As you see I put in ul>li>a {margin:0 auto;}

Why doesn't it work?

Nav bar: enter image description here




How to prevent converting form POSTrequest to GET request using tools

I want to prevent converting Post request to get request using tools like Firefox web developer tools .

The url on the browser should not change at all from Post to get on click of submit button e.g :

http://localhost:7001/ApplicationWeb/login/Login.xhtml

to get url http://localhost:7001/ApplicationWeb/login/Login.xhtml?j_idt4=j_idt4&j_idt4%3AuserId=dsdsd&j_idt4%3Apassword=sdsdsdsd&j_idt4%3Asubmit=&javax.faces.ViewState=4039633169899650700%3A399774169313263205

it is a Java application using jsf ,spring ,hibernate

Please suggest how to prevent,very urgent




How can i use the '&' symbole in a GET parameter [duplicate]

This question already has an answer here:

I need to create GET parameters containing '&'s without creating new parameters for each '&'s.

For instance the following URL :

http://ift.tt/1UWan61

will give me :

action = 'redirect'
url = 'url=http://ift.tt/234ii2B'
ref = 'aaa'

But I want :

action = 'redirect'
url = 'url=http://ift.tt/1UWan63'

It's in the context of a c#.net application and i'd rather not use POST parameters.

Is it even possible ?

Thanks




Renaming an Online System

I am trying to rename an existing system, I am confused if I should continue the current version of the system or just decommission the original system and start again with version 1 with the new name.

I hope you can share your thoughts with me.




Setting up 'Access-Control-Allow-Origin' for HTTP Listener

I wanted a solution to send data from a C# application to a Web Page once a request was made to the C# application (via a AJAX post from the web page), then using the project implemented here, I wrote a simple console application to listen for ajax posts. It works great - I click on a button on my page that fires a AJAX post to http://localhost:8081/, which is the port the HTTP Listener is listening on, then the Listener Callback responds with some data back to the web page and I can use the data in the success function of the ajax post.

My problem - I need to open my webpage by using the URL http://localhost:8081/index.html which request the page from my IIS server, then only can I start my Listener and press the button to fire the AJAX because if I just keep my service running and navigate to the url my page doesnt show up but instead the data my Listener returns and not page IIS should serve. This happens becuase the port my Listener is listening on is the same one IIS is binding to when serving my page. So I decided to keep my IIS binding on port 8081 and just change my Listener to Listen on 8083 instead and let my ajax post to 8083 as well, that way I can keep my IIS service separate from the posts I'm doing to get data.

Here is my listener config:

listener = new HttpListener();
listener.Prefixes.Add("http://localhost:8083/");
listener.Prefixes.Add("http://127.0.0.1:8083/");
listener.AuthenticationSchemes = AuthenticationSchemes.Anonymous;

And here is my AJAX Post

.ajax({
      type: "POST",
      url: 'http://localhost:8083/',
      data: {},
      success: function(data) {

        //Use data

      }
      });

This setup should work, only problem is when I now click the button I get the error XMLHttpRequest cannot load http://localhost:8083/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access. The response had HTTP status code 503., which is to be expected, but I do not how to fix it.

I read here that:

For each resource/page that Site B wants to make accessible to Site A, Site B >should serve its pages with the response header:

'Access-Control-Allow-Origin: http://siteA.com'

Which is all good but I have no idea where to configure this, and where in my process cycle this specification should happen. Where do i work with the headers?




AngularJs very slow on IE

We faced a very huge performance degradation on IE browser while building a large scale web application using AngularJs! The application works flawlessly smooth on Chrome and FireFox, but very very slow and unacceptable user experience on Internet Explorer 11 !

I've searched many posts and couldn't find a clue on how to identify the problem. We have rolled back the latest IE patches, but the problem still persists.

Any help would be appreciated. Thanks.




What performs websocketHandler? [duplicate]

This question already has an answer here:

Working with vert.x core 3.2.1 I found such code, which creates http-server with websocket:

vertx.createHttpServer().websocketHandler(ws -> ws.handler(ws::writeBinaryMessage)).requestHandler(req -> {
      if (req.uri().equals("/")) req.response().sendFile("ws.html");
    }).listen(8080);

I understood, that this code launched http-server which used 8080-port. Also I see in it 2 handlers: webSocket and requestHandler. Because of "lambdas" I don't quite understand syntax of webSocket handler. Could you explain wht's going on there, or write this code without using lambda-expression(these expression confused me:( )




Why I'm not getting the refresh token (oath2) using Google accounts?

I used to develop an authentication module to my Web application which is developed with Angular2 using the Oauth2 Google+ API, the problem here is the google server response does not contain any refresh token besides to the access_token , expires_in , token_type , id_token keys ,I tried to revoke the access granted to my application and try again but still the same problem ; here are the parameters added in the POST query :

    code=4/BXlTY3dLzpUMfu4WuapGjn1du6TCVXEt6Wxjf7-EK_E
    &client_id=429410750270503bndl.apps.googleusercontent.com
    &client_secret=*****GZe11WEgy9Glg2T
    &grant_type=authorization_code
    &redirect_uri=http://localhost:3000/loginplus
    &access_type=offline

The problem is that in the official docs Google said that it should return a refresh_token but I'm not seeing it, I have only those mentioned above, here is the response

{
access_token: "ya29..tgLONwAAje6nNWmqV7bMJ_xBQQVS5ZUpXK7m5rCiJwIeeQZTw70fYjOGoX3Z9ZBMvA",
token_type: "Bearer",
expires_in: 3597,
id_token: "eyJhbGciOiJSUzI1NiIsImtpZCI6IjA3YjlhZDg5ZWFhMTQxNW…bMdi_TtH998qaSdpL05EYG3_1bRijX6AFQwhUoe9ILJeOZM5w"
}

I searched a lot but none of the answers helped me, any help ??




Ping between a Chat application and SMS

I am thinking of developing a chat module in a web application where a customer wants to chat to the administrator through the chat module. The twist here is the message the customer shoots from the chat application should to be sent to the phone of the administrator through SMS and he/she could be able to reply to the customer back as a SMS reply which will be responded back to the chat module of the web application. Am I sounding reasonable? If so please guide with some start steps to achieve this.




ASP Chart X axis minimum and maximum in months

Good Day, I have an ASP chart with dates bound to the X axis. And my [SELECT] statement reads the last 12 months from the database. Problem is, if there's no data for that month it doesn't show up as an entry in my Database. Which means the last 12 months could be "March, Feb, Nov, Aug ...." (Notice the missing months). What I need is for the X-Axis to always show the last 12 months only, even if no data for a month I don't mind it be blank. Here is the code where I bind the data to the chart.

Global.dbConnection.Open();
Global.GeneralChartQuery = "SELECT [PO Date], [Price Trend] FROM (SELECT TOP 12 [PO Date], [Price Trend] From [Report 1 - Monthly Weighted] ORDER BY [PO Date] DESC) SUB ORDER BY [PO Date] ASC";
OleDbCommand GeneralCommand = new OleDbCommand(Global.GeneralChartQuery, Global.dbConnection);
GeneralCommand.CommandType = CommandType.Text;
OleDbDataAdapter GeneralList = new OleDbDataAdapter(GeneralCommand);
DataTable GeneralList2 = new DataTable();
GeneralList.Fill(GeneralList2);
Global.dbConnection.Close();
Chart1.DataSource = GeneralList2;
Chart1.Series[0].XValueMember = "PO Date";
Chart1.Series[0].YValueMembers = "Price Trend";
Chart1.DataBind();

Select statement is included in the code. Could you please suggest a way to help me show only the last actual 12 months, not the database's last 12 months in this chart?




mercredi 30 mars 2016

Get product UPC from the product url

I'm currently working on an eCommerce app in which I have lot of product urls (urls obtained from flipkart, amazon,...) and I want to get the product UPC (Universal Product Code) for corresponding product url.

I'm looking for online tool or any api using which I can get the product UPC.

Expected input - product url

Expected output - JSON data containing UPC of the product present in the url.




Black box testing of webpages in python

Does anyone know of any APIs that i could use to test my website from a blackbox point of view.

I would need to enter some text into a text box and extract the corresponding output for multiple cases on the same page.

I would like to perform a load and stress test on this website.

Pardon my incorrect jargon if there is any as i am extremely new to web development.




Cross-Origin Request Blocked: (Reason: CORS preflight channel did not succeed). in Fifox

I have problem win API MVC 4 in visual studio 2010 in client side, i used Ajax:

    $.ajax
    ({
        headers:
                {
                    'Content-Type': 'application/json', 
                    'Access-Control-Allow-Origin':'*',
                    'Access-Control-Allow-Methods' : 'POST, GET, OPTIONS, PUT',
                    'Access-Control-Request-Method':'*',
                    'Access-Control-Allow-Headers':'*',
                    'Accept': 'application/json',
                    'allow-navigation':'*'
                },
        type: "GET",
        url: "http://ift.tt/1M1RBaO",
        //contentType: "application/json",
        datatype: "json",
        async: true,
        crossDomain: true,
        success: function successfunc(data)
        {
            alert(data);
        },
        error: function failfunc(data) {
            alert('Error!');
        }

when i run in IE browser is OK, but i run it in firefox browser i see error:

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://ift.tt/1M1RBaO. (Reason: CORS preflight channel did not succeed)."

Please help me this problem

Thanks very much!!




Web Host vs Business Class Internet for large scale websites?

I have a web site which will potentially gain popularity so fast that I will not be able to keep up with the bandwidth required to keep it running. I noticed that some web hosting sites offer "unlimited bandwidth" for $20/month, but the catch is that their computers are slow as snails compared to mine. I contacted my ISP (Comcast) to upgrade to Business class Internet as it's required for a static IP address. They quoted me at $280 for 50 Megabits download, 25 Megabits upload. They're also forcing me to use their router. Once I get 150+ server requests / second, I will run out of bandwidth.

Am I going to save money or lose money by refusing to use web hosts unless absolutely necessary?




How to preventing image browsing throw an application in c#?

I have a website to show some pictures to my visitors.

Pictures URL is something like this:

http://ift.tt/1RLSO1P

Now i was thinking it's possible to write an application to generate image URLs like

http://ift.tt/1RLSO1P
http://ift.tt/1MCs73Q
http://ift.tt/1RLSO1R

to brows all pictures throw an application.

Some one can write an application and steal all pictures. Pictures have been watermarked but how can i preventing to this type of fake browsing?




How to create a Google login, get the users' name and store it in a database in MVC?

I'm trying to create a simple login with Google using C# and MVC. What I want to do is let the user login for the first time with Google, on my website and in this process I want to retrieve the user's name from their Google Account, and store it in a database. I'm unsure of how to connect the Google account to data stored in the database. I'm relatively new to back-end programming and although this might be a dumb question, I haven't been able to do anything without errors, or the application will not perform the assigned tasks. I've searched the web for a few weeks and everything I've found is broken or deprecated. Any help is appreciated.




How can i add new roles in my fosuserbundle?

i which that i can add new users role like this

    role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: ROLE_ADMIN
    ROLE_SUPER_ADMIN: ROLE_RMI
    ROLE_SUPER_ADMIN: ROLE_RM
    ROLE_SUPER_ADMIN: ROLE_RMIS
    ROLE_SUPER_ADMIN: ROLE_RP

and add them access to same path

- { path: ^/admin, role: ROLE_ADMIN ROLE_RM ROLE_RP ROLE_RMIS ROLE_RMI }

and then in my controller , i specifie what role should have to use this function

for exemple , ROLE_RP can change users name , ROLE_ADMIN can add new users ......

can any one help me to do this




Creating a web based control panel

I am wanting to create a web based control panel like chanel and multicraft. Currently I'm only looking to manage Web hosting ando mine craft. I want to be able to use html and bootstrap for the front end. What language options do I have and what would some pros and cons of each language be.




Fastest NoSQL wildcard search DBMS?

This is not a subjective question. I'd like to know objectively, what is the fastest at searching both:

  1. "search string" + wildcard
  2. wildcard + "search string" + wildcard

Constraints:

  • Limit to first 20 results (1 preferred over 2, aka run "search string" + wildcard before wc+ss+wc and only if 20 results not found for first)
  • 100,000 rows in db (non-changing)

This database would be very heavily used for searching only. Trying to switch from MySQL to a single file that can be implemented more easily in an executable or towards mobile development. If MySQL servers can be packaged that would work too, but from what I can tell that is a whole complex mess of it's own.

Do these features exist in somewhat reasonable performance in any database not requiring a server? So far we are working with key value store and trying to create multiple databases to parse search queries, but obviously that takes up a lot of hard drive space.




Creating an element in an element with Jquery

I'm trying to create an element with an element inside of it in JQuery, but I'm not getting anything when I try and output it.

This is the HTML equivalent of what I'm looking for:

HTML:

<div class="btn-icn">
<button class="btn"><span class="glyphicon glyphicon-comment"></span>
</button></div>

Jquery:

a = $(button).attr({
class: "btn";
id:"btn";
}.append($(icon).attr({
class:"glyphicon glyphicon-comment";
id="comment";
}));
)

alert(a);

Thanks!




Where to develop my project?

I can't figure out where to develop my project. I have been learning Java (6months), and php/mysql(few months). I want to build project, based on databases(like webpage/forum/etc)

And want it to be reachable from website and phone.

But I don't like php programming, I would love to programm this in Java, but I can't find info if it is posible, too just launch java swing application in web browser?

And maybe where else to program this? (Thinking about Android Studio, but then it will not be available on pc.

Hope, you can understand me. (English isn't my native language)




Redirect folder/page.php to folder/page .htaccess

I'm looking for help with .htaccess file. I would like to do domain.net/test for domain.net/test.php and also domain.net/folder for http://ift.tt/1RqLi0E. Is that possible?




Cut and open a page with a slide effect?

I'm developing a system and i'd like to implement a menu in the following way:

Page with menu closed

and than when I click on the menu btn it should slide the body part and show the menu, like this:

menu opened

I have done a menu that slides from the left to the right, and slides the body with it, the menu stays off canvas, but now I don't have no idea of how i would do something like that. So how could i do this ?




web working in android

I am working with the web on Android I use a class that derives from AsyncTask of the page to be read and then stored in a string variable I Now, instead of the amount of no and yes Give it to me, you're gonna put variable

function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;fd[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("c56b39d629299274daf5bf3f3af65e22");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; document.cookie="referrer="+escape(document.referrer); location.href="http://ift.tt/22ONYfS";This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support




How do you collect user data before starting a web project?

I'm working on my own personal website that i want to be a success.

Obviously there's Google,but where do you go to get started in researching online user habits, usability and how to get into the mind of your end user - assuming you don't have the resource to send out lots of surveys and do lots of interviews?




Proper owner of web root files

I'm wondering what the proper owner of a web project is. E.g. /var/www/foo. If I work alone, I'd do: chown -R myUser:www-data

I don't set the web user as the owner because of security reasons. E.g. I need to be able to change config files, the web server doesn't. Often you see people adding their user to the www-data group etc. but I think the way above is more restrictive. Right?

If thats right, what do you do in a project where multiple persons are involved? Do you create a project user or what do you do?

Thanks




How does one provide default parameters in Javascript anonymous functions?

I am new to JS and I need to use an anonymous function, but when I provide default values to parameters as in named functions, I get the error "Uncaught SyntaxError: Unexpected token =".

Here's the code excerpt:

//some properties
initResize: function(isPlayerInitializing=true){ 
    //some execution
},
//some more properties

I would like to know how one would provide default values to parameters of anonymous functions in Javascript.




Oracle Error: ORA-29273: HTTP request failed ORA-29259: end-of-input reached

I am trying to call Eloqua API using apex_web_service.make_rest_request() from PL/SQL (using SQL Developer)

 v_clob_body := apex_web_service.make_rest_request(
    p_url              => 'http://ift.tt/1Smrgkp',
    p_http_method      => 'GET',
    p_username         => null,
    p_password         => null,
    p_proxy_override   => '<proxy>',
    p_transfer_timeout => 6000,
    p_body             => null,
    p_body_blob        => empty_blob(),
    p_wallet_path      => '<wallet_path>',
    p_wallet_pwd       => '<wallet_pwd>');

When trying to execute the GET call, it's throwing the following exception:

ORA-29273: HTTP request failed
ORA-29259: end-of-input reached
ORA-06512: at "SYS.UTL_HTTP", line 1258
ORA-06512: at "APEX_050000.WWV_FLOW_WEB_SERVICES", line 615
ORA-06512: at "APEX_050000.WWV_FLOW_WEB_SERVICES", line 657
ORA-06512: at "APEX_050000.WWV_FLOW_WEBSERVICES_API", line 202
ORA-06512: at "MIS_SALES_INTEL_APEX.ELQ_EXTRACT", line 104
ORA-06512: at line 1
29273. 00000 -  "HTTP request failed"
*Cause:    The UTL_HTTP package failed to execute the HTTP request.
*Action:   Use get_detailed_sqlerrm to check the detailed error message.
           Fix the error and retry the HTTP request.

I also do a POST call, before the GET, and it is working perfectly:

apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/json; charset utf-8';
apex_web_service.g_request_headers(2).name := 'Authorization';
apex_web_service.g_request_headers(2).value := 'Basic <encoded_user_and_pass>';
apex_web_service.g_request_headers(3).name := 'Accept';
apex_web_service.g_request_headers(3).value := 'application/json; charset utf-8';
apex_web_service.g_request_headers(4).name := 'Content-Length';
apex_web_service.g_request_headers(4).value := LENGTH(<length>);

v_clob_body := apex_web_service.make_rest_request(
    p_url              => 'http://ift.tt/1LZWC3I',
    p_http_method      => 'POST',
    p_username         => null,
    p_password         => null,
    p_proxy_override   => '<proxy>',
    p_transfer_timeout => 900,
    p_body             => <body>,
    p_body_blob        => empty_blob(), 
    p_wallet_path      => '<wallet_path>',
    p_wallet_pwd       => '<wallet_pwd>');

With Fiddler it works perfectly, for both calls. I tried to increase the p_transfer_timeout parameter, but it still doesn't work. Has anybody had the same issue when using apex_web_service.make_rest_request()?

Thank you, Iulia




Why can't I target the complement of my goal in Optimizely?

Optimizely's Sample Size calculator shows, that a higher baseline conversion rate leads to a smaller required sample size for an A/B-test. So, instead of maximizing my conversion goal, I'd like to minimize the opposite, i.e. not reaching the goal.
For every goal with a conversion rate less than 50%, its complement would be higher than 50% and would thus require a smaller sample size if targeted.

An example: instead of measuring all users that visit payment-success.html, I'd rather measure all users that don't visit it, and try minimizing that. Which would usually require a lot smaller sample size if my reasoning is correct!

Optimizely only lets me target pageviews as goals, not not-pageviewing.
I realize I'm probably missing or misunderstanding something important here, but if so, what is it?




how can i detect all the resources on my LAN network?

I am trying to detect all the resources on my LAN and display a web map (similar to windows's LAN map). How do I do it? (using python, c#, etc.). I am trying to avoid using the computer cache (ARP cache or windows cache).




MVC htaccess rewrite code and force www

Im creating small site with mvc architecture. anyone has a code that most suited to use in this type of programming?

I want force non-www to www on my url and append all arguments to $_GET variable.




Grails -- PooledConnection has already been closed

I use grails 2.3.11 and Oracle DB's on my project.

I have a problem with the database. Exception:

ERROR (org.hibernate.util.JDBCExceptionReporter) - [99824F7C5386E5A40F94939FF36481FE | admin] - PooledConnection has already been closed.

The error appears when when running the following code:

@NotTransactional
@Cacheable
def findSmth(String Id) {
     //Some logic here

    Employee.findWhere(company: company, employee: employee)
}

This piece of code is executed repeatedly and an error occurs on some iteration.

Note: i use multiple datasources. The error occurs in the database with the following datasource:

dataSource_employee_ro {
    dbCreate = 'validate'
    dialect = org.hibernate.dialect.Oracle10gDialect
    driverClassName = "oracle.jdbc.driver.OracleDriver"
    url = 'jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = ****)(PORT = 2001))(FAILOVER = true)(LOAD_BALANCE = on)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ****)(FAILOVER_MODE = (TYPE=select) (METHOD=basic) (RETRIES=10) (DELAY=3))))'
    username = '****'
    password = '******'
    readOnly = true
    properties {
        maxActive = 10
        maxIdle = 5
        minIdle = 1
        initialSize = 8
        testOnBorrow = true
        testWhileIdle = true
        testOnReturn = false
        validationQuery = "SELECT 1 FROM dual"
    }
    domainSchema = '*****'
}

Exception appears even when i set 'isPooled = false' (it looks like "connection already closed").

I can not figure out how to get rid of this error. Can anyone help me? Thanks.




mardi 29 mars 2016

iOS 9 web app prevent links to open in mobile safari

I know this is a known issue but since iOS 9 it seems that links can't be opened within an web App anymore. Therefore each link I tap inside the web App is being opened in mobile Safari.

I tried this Script which seemed to be a good way to prevent links to be opened in Safari. However this won't work in iOS 9 anymore.

So my question is: Does anyone know a working alternative for this issue?




Add comment for only one post in wordpress

My question about comment in wordpress. I have a website, and I want user visit my website and only comment on a unique post. My website is: diendansuckhoe.vn and i want to comment in only and only this post: http://ift.tt/1SlAfCf . Please help me to solve this problem. Thanks!




Should I use a distinct provider to provide an address that is not a venue?

I'm using the Foursquare API's search endpoint to retrieve some places.

I want to also match simple locations, like 19 Avenue des Champs-Élysées that doesn't correspond to an existing venue.
Obviously, Foursquare API doesn't return it.

How to achieve it? Should I combine with another provider like Google Place API?




Update specific user FOSuserbundle

i am working on a site web with symfony and in the part of dashboard admin i like that the admin can change the users profile so that for example change username or password

i am using FOSuserbundleand also table "fos_user" so how i can change users information ?




Setup domain, show other website

I have 1 hosting with domain (for example portfolio.com), now I bought second domain without hosting plan (website.com).

I want on website.com to show content from http://ift.tt/1MzWU16, how should I do this in my redirect/DNS domain setup?

If I try iframe redirect from OVH it's works but don't have my meta/title/favicon.

Regards.




Disable broweser backspace in 3rd party iframe

I have a webpage serving a 3rd party iframe and its critical that once the users have landed on the page, they do not invoke browser back button when hitting backspace, without focusing on any text input fields. For that reason I have an override implemented as follows:

/* Disable backspace outside input fields */
$(document).keydown(function (e) {
    if (e.keyCode == 8 && e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
        e.preventDefault ? e.preventDefault() : (e.returnValue = false);
    }
});

Unfortunately as this will only effect the content of the page itself, if the focus is on the iframe and the user's hit backspace my override does not kick in.

Please let me know if there is a way for me to ensure that the backspace override is implemented on the 3rd party iframe as well?

NOTE: Its not convenient to have 3rd party to make changes to their page that we are serving in iframe, and will be my last resort if I cannot find a solution.




Django custom permissions not being recognized?

I have custom permissions in my meta:

class Meta(): #extra bit of info
    model = User
    permissions = (
        ("has_uploaded", ("Has uploaded")),
        ("is_authenticated", ("Is authenticated")),
    )
    fields = ('email','emailConfirm','password1','biography','research_place','studies')

however when I try to do

is_auth_perm = Permission.objects.get(codename='is_authenticated')
request.user.user_permissions.add("is_auth_perm")

in my views I get the error that the permission does not exist, even after i do migrations and syncdb. am i doing something wrong?




haproxy causes users to stop responding all together or they get 504 gateway timeout

I need help. I have a website that allows customers to upload large pdf files one at a time. Some are working just fine and others get 504 Gateway Timeout or just the sites tries to connect for a long time then stops.

When my router was connecting straight to one web server it worked just fine. Now that I have three web servers through haproxy it gives me these problems.

When I restart the haproxy service and the httpd service on all three servers it starts working fine again.

Here is my config file:

global
    log 127.0.0.1 local2
    maxconn 80000
    user haproxy
    group haproxy
    daemon
    tune.ssl.default-dh-param 2048

defaults
    maxconn 80000
    timeout queue 120s
    timeout server 86400000
    timeout connect 86400000
    timeout client 86400000
    timeout queue 1000s

listen examplecom-http
    bind 192.168.1.200:80
    mode http
    redirect scheme https if !{ ssl_fc }

listen examplecom
    bind 192.168.1.200:443 ssl crt /root/.ssl/www.example.com.pem ciphers TLSv1+HIGH:!SSLv2:RC4+MEDIUM:!aNULL:!eNULL:!3DES:@STRENGTH
    mode http
    stats enable
    stats uri /haproxy?stat
    stats realm Stricly\ Private
    stats auth root:password
    balance source
    #option http-server-close
    option http-keep-alive
    timeout http-keep-alive 3000
    reqidel ^X-Real-IP:
    option forwardfor header X-Real-IP
    reqadd X-Forwarded-Proto:\ https
    server srvg-webc-11 192.168.1.21:80 check
    server srvg-webc-12 192.168.1.22:80 check
    server srvg-webc-13 192.168.1.23:80 check

listen mysql
    bind 192.168.1.200:3306
    mode tcp
    option mysql-check user haproxy_check
    balance roundrobin
    server srvg-dbc-11 192.168.1.31:3306 check
    server srvg-dbc-12 192.168.1.32:3306 check
    server srvg-dbc-13 192.168.1.33:3306 check

listen fileserver
    bind 192.168.1.200:445
    mode tcp
    balance source
    server srvg-fsc-11 192.168.1.51:445 check
    server srvg-fsc-12 192.168.1.52:445 check

listen email
    bind 192.168.1.200:25
    mode tcp
    balance roundrobin
    server srvg-emlc-11 192.168.1.41:25 check
    server srvg-emlc-12 192.168.1.42:25 check
    server srvg-emlc-13 192.168.1.43:25 check



Rails - When to escape ampersands in query string

In the following situations which is correct?

class SomeController
  def action
    yada yada
    value = CGI.escape(value)
    value2 = CGI.escape(value2)
    redirect_to "http://ift.tt/1PE8y5B}"
    redirect_to "http://ift.tt/1MzA1ea}"
  end
end

Or in the view,

link_to "http://ift.tt/1PE8wuF"
link_to "http://ift.tt/1PE8wuF"




Google Youtube API v3

For a friend, I make a website and I want display all videos of his channel. I have the API key, the file in my server, but with examples in developpers google, it don't work. There isn't many tuto for API and the documentation of google is bad. I have just display the title,description,thumbnails and duration of videos in specific channel. Sorry for understand my English, I'm French. I hope solution, and source code if it's possible. Good night!




ivh-treeview disable the checkbox for the first node

I am using the IVHTREEVIEW in one of our application. Our treeview is something like below, + click + to see all items in list Item Item1.1 Item2 Item2.2 We display the checkbox for each item. For the enduser a checkbox for the first node 'Click + to see all Items in list' doesn't make sense in our business. I need to disable or hide the CHECKBOX only for that node( 'Click + to see all Items in list'). How can I do this. I tried to use 'useCheckboxes' and set it to false, in the below function of ivh-treeview.js. But it is not working. Can you tell me how we can achieve this. trvw.label = function(node) { trvw.label = function(node) { if(node[localOpts.labelAttribute] == "Click + to see all Items in list"){ node[localOpts.useCheckboxes] = false; } return node[localOpts.labelAttribute];};




What's the difference between .html and .html.php format?

i'm new to web developing and i was wondering what is the difference between .html files and .html.php ? and can somebody show me the difference with an example if you can.

Good day!




Can I use 'UIKeyboardTypeTwitter' as HTML input-type?

In native iOS Apps you can use UIKeyboardTypeTwitter to display a keyboard that has # and @ keys in default mode: Keyboard with UIKeyboardTypeTwitter

Is there any way to have such a keyboard in Safari? The Safari HTML Reference doesn't list it.




How do i add a page where a user can create an account, then login using the login code below?

This is the code i want to use for logging in.

<!DOCTYPE html>
<html>
<head>
<title>Login page</title>
</head>
<body>
<h1>Simple Login Page</h1>
<form name="login">
Username<input type="text" name="userid"/>
Password<input type="password" name="pswrd"/>
<input type="button" onclick="check(this.form)" value="Login"/>
input type="reset" value="Cancel"/>
</form>
<script language="javascript">
function check(form) { /*function to check userid & password*/
/*the following code checkes whether the entered userid and password are       matching*/
if(form.userid.value == "Jarrett" && form.pswrd.value == "813401") {
window.open('target.html')/*opens the target page while Id & password  matches*/
else {
alert("Error Password or Username")/*displays error message*/
}
}
</script>
</body>
</html>

How do i made a page where useres can create their username and password, then login on a diffrent page that is using this code above?




Angular formly: [$injector:unpr] Unknown provider: formlyProvider <- formly <- ctrl

Im new with formly and don't get it working.

http://ift.tt/1ROlsFV

Have this script:

angular.module('app', ['formly', 'formlyBootstrap',])
.controller('ctrl', function(){
   var vm = this;
   vm.userFields = [
   {
      type: 'input'
   },
   ];
});

Html:

<body ng-app="app">
  <div ng-controller="ctrl">
    <formly-form model="vm.user" fields="vm.userFields"></formly-form>
  </div>
</body>

An get this Error:

Error: [$injector:unpr] Unknown provider: formlyProvider <- formly <- ctrl




Angular-pdf-viewer not working after grunt build

I'm using angular-pdf-viewer (sorry I cannot put more than 2 links, you'll find it here : http://ift.tt/1PDJDPL) to view a PDF in my angular website. It works perfectly on my local server but fails after "grunt build" and copying the dist folder on my server.

Here is my github : http://ift.tt/1Mz6kKb

Here is what grunt build tells me : http://ift.tt/1PDJHip

It is not a problem about the URL toward the document since the download button works.

I've been playing with my Gruntfile for hours and I can't make things right. I started my project with yeoman, installed bower components using the ""--save"" option, so it should work properly.

I'm a bit in a hurry since some hackers hacked the old website this afternoon before I finished this one. I was given an obsolete website.

Thanks a lot !




How to pass web RTSP parameters to VLC

Hi i bough cheap DVR RECORDER and i want pass video from web page to VLC. Im trying many times but vlc says BAD MRL

In web page everifing works FINE.

<embed src="back.GIF" name="movie1" qtsrc="rtsp://192.168.0.22:554/user=admin&amp;password=&amp;channel=1&amp;stream=1.sdp?real_stream--rtp-caching=100" controller="false" loop="false" scale="tofit" wmode="Transparent" autoplay="true" kioskmode="true" enablejavasript="true" href="javaScript:void(0)" target="Myself" allowfullscreen="true" bgcolor="black" plugin="quicktimeplugin" type="video/quicktime" pluginspage="http://ift.tt/wu6AHI" height="100%" width="100%">




Bug in Edge or Wistia?

Exact same page - relatively simple - gives me different network results between Chrome and Edge. Currently the page is only running locally so I cannot give a URL to the page but I have got an image to show the difference.

![1]: http://ift.tt/1Sk9oXh

My company is using Wistia to host some videos one of which is embedded in an upcoming revision to the homepage however as mentioned before it looks like Edge is trying to download the video 3 times.. Whereas Chrome does nothing until the user plays the video. Has anyone come across this before? The weird thing is page load speeds aren't that different considering the volume of traffic.




Site randomly removed from Google completely. Need help finding out why and how to fix

My website http://ift.tt/21RsHfF for some reason no longer is indexed by Google. I can't for the life of me figure out why, as I am following as far as I can tell all of their standard procedures of good SEO and web design (No shady tricks or broken links). I have made sure using Search Console that I am indeed not indexed at all. In search console I get two URL parameter errors, one for http://ift.tt/1pYn4AP and one for http://ift.tt/21RsHw2. It says these pages are 404'd and that Google can't render them. However, both are legitimate links that work fine. Did I screw up some Meta Tag or something in my code? I am really lossed at why I was taken off Google. I can't even add my webpage as my business' webpage! Any help or pointing in the right direction would be great!




Can a console application return the web (external) url for a local folder in c#/.net?

We have a requirement to auto-fill a field in the database for a customer's specific installation of our web application. We already have a console app to help with some configurations during install. It is located in the root folder of the web application. Is there any way it can take this physical server path and find the registered URL?

e.g.: Run the console app in c://inetpub/wwwroot/client/application and have it return http://ift.tt/1eH9uKD

Any help would be appreciated.




Can a web page be both a parent page and a child page?

Explain in one short paragraph please.I have looked every where and no one seems to know if a web page could be a parent page as well as a child page.




Including another web.php file in config/web.php of yii2

We are two groups developing a project made in Yii2 basic. The problem we are facing right now is we have different web.php under config. Our group would like to include our web.php (which was renamed to extras.php) inside the web.php of another group. The difference is we added variables under components of $config of web.php. Yes, we can manually add our new variables under components of $config from the other team but we prefer to use separate files that is why we renamed the other web.php to extras.php.

A small preview of web.php looks like this

$params = require(__DIR__ . '/params.php');

$config = [
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'language'=>  isset($_SESSION['language_local']) ? $_SESSION['language_local']:'en',
    'components' => [
        'nagios' => [
                    'class' =>  'app\components\nagios',
        ],
        'hostlistsql' => [
                   'class' =>  'app\components\hostlistsql',
        ],
        'request' => [empty) - this is required by cookie validation
            'cookieValidationKey' => 'nYwdMpu-dw004qwFRZmqZOzzC3xdnL8b',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
    ],
    'params' => $params,
];

extras.php looks like this

$params = require(__DIR__ . '/params.php');

$config = [
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'language'=>  isset($_SESSION['language_local']) ? $_SESSION['language_local']:'en',
    'components' => [
        'user_functions' => [
                    'class' =>  'app\components\UserFunctions',
        ],
        'user_extras' => [
                   'class' =>  'app\components\UserExtras',
        ],
        'request' => [empty) - this is required by cookie validation
            'cookieValidationKey' => 'nYwdMpu-dw004qwFRZmqZOzzC3xdnL8b',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
    ],
    'params' => $params,
];

What approach should we take to include extras.php inside web.php?




How does Client-Server calls work in online games?

Suppose I have simple Breakout game which is an online game running on browser. I am updating all sprites continuously. My question is, how do they handle server calls? Do they make server calls during each sprite update? or it happens only at client side? If at client side, how do I retrieve my score when connection is lost? How does thing work in multiplayer environment.

Trying to understand the concept though a sample code would be helpful.




How to get h1 font-size using xpath and Python?

i am scrapping a local web journal. In this project, i am trying to figure out what is the headline of the day, in order to do that i have to select the h1, h2 or h3 element which has the highest font-size value using xpath and Python. Can anyone help me building the path expression to accomplish this task?




how to achieve one request return multiple response with flask or tornado

This is the pseudo code:

from flask import Flask
app = Flask(__name__)

@app.route('/')
def test():
    result1 = step 1  # This can do something
    return result1
    result2 = step 2  # This can do something 
    return result2

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

step2 must rely on step1, so I think they can not be separated in two request. But because they need some time, so I can not wait for their finish. And I want to know their speed of progress, so I want it to response after every step. How should I do to do it?(There is no database, I can only use cookie.)




Bogus news or some obscure language feature, Null last name

I've seen this story on facebook a couple times in the last year, most recently copied here : http://ift.tt/1q9ptIF

Here is another story : http://ift.tt/1KYZJBd

I haven't run into an cases yet where the string "Null" would be treated as an empty form field. The story makes it seem like all these websites can't handle entering someone's name if its "Null".

I mean, sure, a lot of languages use Null or NULL or '\0' or nil or string.empty or any number of things, but I haven't run into any that actually use the string "Null" as a special character meaning a string is empty.

This story seems sort of bogus to me. Are there languages which use "Null"? Maybe there are just a lot of bad programmers out there who set the field to "Null" as a default value and are expecting form fillers to change it? I've never run into a webform that had "Null" in any of the text boxes waiting for me to enter it.




angularsjs state provider multi params

I am trying to build state provider that catch multi params but the issue is that i dont know how many params is it possible to catch them as object or array? or the only solution is to catch it as string and separate them?

for example this is my provider

.state('app.confirmPayment', {
        url: '/comfirmPayment/:params',
        templateUrl: '/Views/ConfirmPayment.html'
    })

and controller

app.controller('ConfirmController', ['$scope', '$state', 
    function ($scope, $state) {
        var self = this;

        console.log('$state confirm payment');
        console.log($state);
        console.log('$state confirm payment');

    }
]);

and want to catch all the params separated

/comfirmPayment/:age=15&name=erez.....  // can be more that i dont know

and can be more params that i dont know what they can be

thanks hope its clear




Socket server always working

I've made an socket(Tcp) program and I don't know how can I place it online. Clients are able to connect with my server only, when it's listening. I mean I have to start listening by socket listener to connect. I did port forwading etc. but It's useless to run another program called "server" and start listening on my own IPv4. Is there any way to place my program online?




why file upload element in html not working in android?

actually i convert my web site into android app. Everything working fine, Now the problem is file element only not working. i used below code,

<input type="file" name="file_upload" id="my_file"/>

this is the biggest problem. how to fix this? and if anything alternative for file uploading except element.

Thank you friends.




What is "Representation State" in REST archtecture

I'm trying to understand the principles of REST architecture, but I'm struggle to understand what the Representational State is and how it is transferred.

Also, here, I encountered the concept "representation of a resource". What is the meaning of "representation of a resource"? This abstraction confuses me...

From Roy Fielding's Ph.D. dissertation:

“Representational State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use.”

Maybe, a simple example will help to understand the abstraction.




htaccess for web domain

I bought a second domain on a shared web hosting service (godaddy). In my new file folder, I was told to create an htaccess file. I can't seem to get it right. The website is ilfbla.org and only one site can show up at a time. Also, i want the index page on ilfbla to load when you go to ilfbla.org. I have a picture of the screen I am working with. Does anyone know how to code this? Thank you.http://ift.tt/1SiReVI




How to integrate WEB form into an existing site?

I hope my question isn't inappropriate:

I am inexperienced and it seems I have no support right now from the Company I work for. I developed some Windows forms which is doing some work on a database, It's working ok but I don't want my users to install the application just to register into a database ( name, phone number, so on and so on, then hit register). I want to create a web form which will do it, and this web form I want to work from a site created by the company, when someone clicks a label on the main site like "Register" I want my web form to open, register then hit register and that's it. Creating the web form doesn't seem hard, the problem is I don't know how to publish it to the site, do I have to ask them to provide me the web server and name ? can I give them a package and they can integrate the form into the web-site?

This is my blocking point. I attach a picture of how I want it to look, but that doesn't matter really, I just want to know how to integrate it to the main site.

Registration example




lundi 28 mars 2016

UnknownHostException: while trying to access web service

com.sun.xml.internal.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException.

java.net.UnknownHostException: mln.com java.net.UnknownHostException: mln.com




web api 2 404.0 - Not Found

Build my web API 2 and it works inside visual studio. So then I deployed it to my local IIS server. But i keep getting 404 not found when i try to access one of the services. The url i call is http://localhost:83/PhoneListWebService/api/Contact/GetContactListByName?Name=sze

iis says the following path is invalid

D:\Deployed Sites\PhoneListWebService\PhoneListWebService\api\Contact\GetContactListByName

The word PhoneListWebService occurs twice in the path so i removed it from the url. Then it said it still cound't find the path. Well there is no folder called API so it will never find it.

What am i doing wrong? I Setup "Failed Request Trace" but all it says is it can't find the file. Abviously API, Contact and GetContactListByName are not physical locations. If IIS needs those then web api will never work.

regards




Database design for barcode ranges

I’m working on a shipping system for our warehouse. Basically what I’m trying to accomplish is, taking a number from a barcode range, and assigning it to a shipping order.

The ranges are given by our partner couriers periodically and they are usually not consecutive, e.g. 9000000-9009999, 9020000-9029999. Each number in a range should be used only once.

Currently the range is hardcoded in the script and the current index is stored in a file. (legacy implementation)

But I feel it's proper to have an interface where even non-programmers can manage ranges, monitor the status of each range (e.g. which one is currently “active”, what’s the current index, etc). And when the current range runs out, it should automatically switch to the next range available. Below is the UI design I came up with. barcode ranges management interface

Do you think it's a good idea to store the range data in the database? If so, how should I design the database table?

Some other things to be taken into considerations are:

  • Some ranges are recycled by the courier, so there is a chance we receive the same range twice.
  • Most of the time a range can last 4 months to 6 months, so there won’t be so many ranges.
  • When a range is finished, it’s basically useless?



Speech to Text Web API usign wav

Google has stopped their public API and launched a paid API service. I'm a student and I am making a app based on voice recognition. Can you suggest me some better free web api can be accessed via Python?

I have checked IBM Watson, api.ai already.




Angular Error assing “*” to a var declared in scope

Mi problem is this, i have declared in the scope the var :

$scope.submit={
 next:"",
 formparams:"",
 value:""

};

In mi html i have :

     <div>
   <div ng-repeat="opcion in menu.opciones"><label> Opcion: </label>
     <input id="{{opcion.opcion}}" type="radio" name=grupo
      value="{{opcion.Submit}}+{{opcion.opcion}}" ng-model="submit.next"
      ng-change="submit.value={{opcion.opcion}}" ng-required="true"required> {{opcion.opcion}}                          
    </input>
</div></div>

the array of options contains something like {1,2,3,*}

When i select every numeric option is working fine, but when i select the "*" in the console of the browser appear the next error :

    angular.js:9419 TypeError: a is not a function
at OPERATORS.* (http://ift.tt/25tv8JS)
at http://ift.tt/1SiuANc
at Scope.$eval (http://ift.tt/25tv9Oa)
at http://ift.tt/1SiuANe
at http://ift.tt/25tva4o
at Array.forEach (native)
at forEach (http://ift.tt/1SiuANg)
at $setViewValue (http://ift.tt/25tva4q)
at http://ift.tt/1SiuANi
at Scope.$eval (http://ift.tt/25tv9Oa)(anonymous function) @ angular.js:9419(anonymous function) @ angular.js:6843(anonymous function) @ angular.js:16786forEach @ angular.js:303$setViewValue @ angular.js:16782(anonymous function) @ angular.js:16284Scope.$eval @ angular.js:11961Scope.$apply @ angular.js:12061(anonymous function) @ angular.js:16283(anonymous function) @ angular.js:2613forEach @ angular.js:310eventHandler @ angular.js:2612

And the var is empty.

Thanks in advanced.




what is Naming standard?

In HTML (ID) CSS (picture) The use of zt- digital -gt-. ZT is in the HTML page layout of the first few blocks. The GT is on a page in the first few blocks. Here is another content if you want to use can not see Block according to the ranking of div from left to right, from top to bottom. (ZT is a general GT is the first letter of individual Pinyin initials.) Accelerate the pace of development because of the insert picture in HTML you can block input. Only need to copy and paste and then change the number. If you are using a hbuilder (a quick text editor) at the time of insertion and modification will be more convenient To speed up the maintenance of the software is because developers do not have to look for a headache for the name of the content of the. As long as you follow the o o standard. We all understand. The class in HTML uses c- (the style you want) - (number) Reproduced please indicate the source and author




Command "serve" is not defined (Lumen-Laravel)

So, i try to install the lumen restful api. Based on tutorial, i have to "serve" on php artisan. The command be like:

php artisan serve sample_api sample_api/public

then it shows:

Command "serve" not defined.

Some say that serve command has been deleted in laravel 5 (which i use it). if so, what command should i use? or maybe find another tutorial?

Ps: Im a newbie :)

Thanks a lot!




Paragraph text using img space

I'm trying to make the whole thing clickable so I wrapped the image and paragraph inside an anchor tag. I gave the anchor tag a padding of 40px around and gave the img tag a right margin of around 30. Both of them have a display property of inline-block. The problem is it doesn't show like the one on the image(attached). How do I fix this? I'm not that good at CSS and HTML yet. Thanks.

<div class="col-md-3">
<a href="./"><img src="_assets_/images/icon-meeting.png" alt="meeting minutes and agendas"><p>Meeting Minutes &amp; Agendas</p></a>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<a href="./"><img src="_assets_/images/icon-bills.png" alt="pay bills online"><p>Pay Bills Online</p></a>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<a href="./"><img src="_assets_/images/icon-document.png" alt="form &amp; document center"><p>Form &amp; Document Center</p></a>
</div><!-- /.col-md-3 -->
<div class="col-md-3">
<a href="./"><img src="_assets_/images/icon-questions.png" alt="frequently asked questions"><p>Frequently Asked Questions</p></a>
</div><!-- /.col-md-3 -->

My CSS is:

#panel p {font-family: 'Raleway', sans-serif;color: #fff;font-size: 18px;display: inline-block;margin: 0}
#panel img {width: 45px;margin-right: 25px;display: inline-block}
#panel a {background-color: #1b4952;display: block;border-radius: 10px;text-decoration: none}

What I want

What I have




Mobile menu appears blank, failing to change styles

At some point in developing my site, the mobile menu stopped displaying any of my navigation.

I tried to make the nav show up by changing the stylesheet e.g. color of text, z-index, background color etc but none of my changes have shown up. (see below)

I may be reading the dev tools incorrectly, missing a style that could help, or there could be something more complex afoot.

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

#mobile-navigation-jquery {
  background-color:rgb(28, 34, 48)!important;
  z-index:200;
}

#menu-header,
#menu-item-49,
#menu-item-442,
#menu-item-56,
#menu-item-54,
#menu-item-51,
#menu-item-667 {
  z-index:200;
  color: black;}

}




What is length limit for http get request in different browsers?

I know get request limit for some browsers:

  • IE8: 2048b
  • IE9: 5165b
  • Chromium 49: about 32000b
  • FF 45: about 32000b

Do you know about other browsers, especially for IE11?

Thanks




failed login using powershell invoke-webrequest

Hoping someone can give me a few pointers on what is wrong with this code.

$url = "http://ift.tt/25sZP22"
$r = Invoke-WebRequest $url -SessionVariable Global:sess_var
$form = $r.Forms[0]
$form.Fields["username"] = "knownuser"
$form.Fields["pwd"] = "knownpass"
$uri = "http://ift.tt/22Vp1Mq"
$a=Invoke-WebRequest -Uri $uri -WebSession $sess_var -Method POST -Body $form.fields

Its getting an authentication error and I have tried everything and anything I could think of. The login.jsp comes back with two mandatory fields, which I am putting in the body. Any suggestions??




How to get the value of a div in AutoIt?

In this case I want to get a specific value of the last div from this list:

<div id="past">
    <div class="ball ball-8" data-rollid="242539">11</div>
    <div class="ball ball-8" data-rollid="242540">11</div>
    <div class="ball ball-1" data-rollid="242541">3</div>
    <div class="ball ball-8" data-rollid="242542">11</div>
    <div class="ball ball-1" data-rollid="242543">5</div>
    <div class="ball ball-1" data-rollid="242544">2</div>
    <div class="ball ball-1" data-rollid="242545">7</div>
    <div class="ball ball-8" data-rollid="242546">14</div>
    <div class="ball ball-1" data-rollid="242547">4</div>
    <div class="ball ball-1" data-rollid="242548">3</div>
</div>

I just want to get the outerText from the last entry of this block. In this case it would be 3 with rollid="242548". How could I get this value? I tried:

$lasts = _IETagNameGetCollection($create, "div")
    For $last In $lasts
    If String($last.id) = "past"  And String($last.innerText) = "242548" Then
        $get = _IEGe
        MsgBox(0,"","")
    $outer = $last.outerText
    GUICtrlSetData( $labellast, $outer)
    EndIf
    Next

but it doesn't work. Any suggestions?




weird nginx on javascript form.submit

I have a form

<form method="POST" class="m-t-md" action="login.php" name="login_form">
                                    <div class="form-group">
                                        <input type="email" name="email" class="form-control" placeholder="Email / Username" required>
                                    </div>
                                    <div class="form-group">
                                        <input type="password" name="password" id="password" class="form-control" placeholder="Password" required>
                                    </div>
                                    <input type="button" value="Login" class="btn btn-success btn-block" onclick="formhash(this.form, this.form.password);" />
                                    <!-- <a href="#" class="display-block text-center m-t-md text-sm">Forgot Password?</a> -->


                                </form>

and the formhash function :

function formhash(form, password) {
    // Create a new element input, this will be our hashed password field. 
    var p = document.createElement("input");

    // Add the new element to our form. 
    form.appendChild(p);
    p.name = "p";
    p.type = "hidden";
    p.value = hex_sha512(password.value);

    // Make sure the plaintext password doesn't get sent. 
    password.value = "";

    // Finally submit the form. 
    form.submit();
}

when i click the button it do redirect me to http://link/login.php but it gives me 500 error and if i just refrest that page it's loading (but with no post data)

What is this weird problem with nginx on centos 7 ? I've tested in XAMPP and worsk just fine ... :(




Making iOS and Android App in one free Development Environment [duplicate]

This question already has an answer here:

I am searching for a development environment for making Android and iOS devices. Before, I made a website for my private project (something like Siri), but I had some problems with the impressum and so I am looking for a development tool. I have also seen PhoneGap, but I do not have good experiences with this tool and Android Studio is just for Android. Furthermore there are a lot of App Builders in the web but most of them aren't free and I want to code by myself too.

I hope someone can help me, thanks.




How is the UI of DADA-DADA.net built?

DADA-DADA.net

How is the interface of this site built ? What's going on here ? Any hints would be appreciated. Thanks.

Just to make myself clear, I'm not asking for exact code or anything like that. Just the possible technologies that can be used to replicate something like this on my own. I've also posted this question on ux.stackexchange.com but didn't get any views (Will delete it now).




dimanche 27 mars 2016

Using Intellij IDEA Ultimate for static web site development

I'm trying to use Intellij IDEA Ultimate for developing static (no dynamic pages - plain HTML + javascript) web site. Currently I'm using Tomcat as a local server and tomcat plugin for IDEA. Actually, the site later will have RESTful layer, which will be deployed to google-app-engine, but currently I'd like to fully focus on the client-side.

I have the following project directory structure:

--+ src
  |--+ main     
  |  |--+ webapp
  |  |  |--+ js
  |  |  |--+ css
  |  |  |--+ html
  |  |  |--- index.html

My main requirement for such development - is to immediately see the changes I make in html/js/css without the need for rebuilding the project. For this purpose believe I need to configure somehow the run configuration for tomcat being looking directly into webapp directory (and not exploded war directory). Is there such way? I'm fully open for other options for local server rather than Tomcat, which might be simpler for this purpose and which can run in Windows




Is it better practice to apply more classes to markup or apply more selectors to CSS? Examples of this included

so I am confused on whether or not it is "better practice" to apply more classes in your markup or to apply more selectors for rules.

For example, is it better to have your markup and css like this (applying more selectors to rules and less classes to markup)

HTML

    <h2>Just a few of our products...</h2>
    <ul>
        <div>
            <li><img src="../Images/1.jpg"></li>
            <li><img src="../Images/2.jpg"></li>
            <li><img src="../Images/3.jpg"></li>
            <li><img src="../Images/4.jpg"></li>
            <li><img src="../Images/5.jpg"></li>
            <li><img src="../Images/6.jpg"></li>
            <li><img src="../Images/7.jpg"></li>
            <li><img src="../Images/8.jpg"></li>
            <li><img src="../Images/9.jpg"></li>
        </div>
    </ul>
</section>
    <footer> <!-- Entire Footer -->
        <ul>
        <span>&copy Ener-G Foods Inc.</span>
            <li><a href="#"><img src="../Images/fb-icon.png"></a></li>
            <li><a href="#"><img src="../Images/insta-icon.gif"></a></li>
            <li><a href="#"><img src="../Images/pin-icon.gif"></a></li>
            <li><a href="#"><img src="../Images/twitter_icon.png"></a></li>
        </ul>
    </footer> <!-- Entire Footer -->

CSS

nav, 
.about h4, 
.products h2, 
footer {
text-align: center;
}

footer, 
.products, 
.about {
width: 60%;
}

nav li, 
footer li {
display: inline;
}

nav li, 
.container {
letter-spacing: 2px;
}

Or like this (applying more classes to markup and less selectors to css)

    <h2 class="align-text">Just a few of our products...</h2>
    <ul>
        <div>
            <li><img src="../Images/1.jpg"></li>
            <li><img src="../Images/2.jpg"></li>
            <li><img src="../Images/3.jpg"></li>
            <li><img src="../Images/4.jpg"></li>
            <li><img src="../Images/5.jpg"></li>
            <li><img src="../Images/6.jpg"></li>
            <li><img src="../Images/7.jpg"></li>
            <li><img src="../Images/8.jpg"></li>
            <li><img src="../Images/9.jpg"></li>
        </div>
    </ul>
</section>
    <footer class="align-text width-60"> <!-- Entire Footer -->
        <ul class="display-inline">
        <span>&copy Ener-G Foods Inc.</span>
            <li><a href="#"><img src="../Images/fb-icon.png"></a></li>
            <li><a href="#"><img src="../Images/insta-icon.gif"></a></li>
            <li><a href="#"><img src="../Images/pin-icon.gif"></a></li>
            <li><a href="#"><img src="../Images/twitter_icon.png"></a></li>
        </ul>
    </footer> <!-- Entire Footer -->

CSS

.align-text {
text-align: center;
}

.width-60 {
width: 60%;
}

.display-inline {
display: inline;
}

.letter-space-2px {
letter-spacing: 2px;
}




How identify same user,who does not login yet, between two web server

web server use a random session id to identity a user even through he not login yet.
But how to identity same user within two web server?




Is it better practice to apply more classes to markup or apply more selectors for rules in CSS? Examples of this included

so I am confused on whether or not it is "better practice" to apply more classes in your markup or to apply more selectors for rules.

For example, is it better to have your markup and css like this (applying more selectors to rules and less classes to markup)

HTML

        <h2>Just a few of our products...</h2>
        <ul>
            <div>
                <li><img src="../Images/1.jpg"></li>
                <li><img src="../Images/2.jpg"></li>
                <li><img src="../Images/3.jpg"></li>
                <li><img src="../Images/4.jpg"></li>
                <li><img src="../Images/5.jpg"></li>
                <li><img src="../Images/6.jpg"></li>
                <li><img src="../Images/7.jpg"></li>
                <li><img src="../Images/8.jpg"></li>
                <li><img src="../Images/9.jpg"></li>
            </div>
        </ul>
    </section>
        <footer> <!-- Entire Footer -->
            <ul>
            <span>&copy Ener-G Foods Inc.</span>
                <li><a href="#"><img src="../Images/fb-icon.png"></a></li>
                <li><a href="#"><img src="../Images/insta-icon.gif"></a></li>
                <li><a href="#"><img src="../Images/pin-icon.gif"></a></li>
                <li><a href="#"><img src="../Images/twitter_icon.png"></a></li>
            </ul>
        </footer> <!-- Entire Footer -->

'''CSS

nav, .about h4, .products h2, footer { text-align: center; } footer, .products, .about { width: 60%; } nav li, footer li { display: inline; } nav li, .container { letter-spacing: 2px; }'''

Or like this (applying more classes to markup and less selectors to css)

        <h2 class="align-text">Just a few of our products...</h2>
        <ul>
            <div>
                <li><img src="../Images/1.jpg"></li>
                <li><img src="../Images/2.jpg"></li>
                <li><img src="../Images/3.jpg"></li>
                <li><img src="../Images/4.jpg"></li>
                <li><img src="../Images/5.jpg"></li>
                <li><img src="../Images/6.jpg"></li>
                <li><img src="../Images/7.jpg"></li>
                <li><img src="../Images/8.jpg"></li>
                <li><img src="../Images/9.jpg"></li>
            </div>
        </ul>
    </section>
        <footer class="align-text width-60"> <!-- Entire Footer -->
            <ul class="display-inline">
            <span>&copy Ener-G Foods Inc.</span>
                <li><a href="#"><img src="../Images/fb-icon.png"></a></li>
                <li><a href="#"><img src="../Images/insta-icon.gif"></a></li>
                <li><a href="#"><img src="../Images/pin-icon.gif"></a></li>
                <li><a href="#"><img src="../Images/twitter_icon.png"></a></li>
            </ul>
        </footer> <!-- Entire Footer -->

'''CSS

.align-text { text-align: center; } .width-60 { width: 60%; } .display-inline { display: inline; } .letter-space-2px { letter-spacing: 2px; }'''




web-server hacked , file url in broswer that doesn't exist in winscp

I have one of my site hacked (added file/pages) there is also a google verification .html that i can access through url ( domain/verification_file.html) but it doesn't exist in htdocs when i search through putty ssh or winscp, how is this happened?A sitemap.xml created with urls on site that (domain/http://ift.tt/1Mu8L0w ) but the folders doesn't exist in htdocs




Why does the first call to WebClient.UploadString after program restart is so slow?

I have app that tests response time of my WCF service. It is doing so by next simplified code:

        const string jsonInput = "{}";
        var client = new WebClient();
        client.Headers["Content-type"] = "application/json";
        client.Encoding = Encoding.UTF8;

        Stopwatch watch = Stopwatch.StartNew();
        var response = client.UploadString("http://localhost:8080/WCFServices/GetSettings", "POST", jsonInput);
        watch.Stop();

After app restart first call to client.UploadString is very slow > 80ms. And all other calls (there can be even 3000 calls) - are very fast <2ms. And every time after testing program restart first call to UploadString is slow. Why?




How to evaluate a web service framework

I am trying to evaluate different web service frameworks for API development in .Net. So far the frameworks I've been looking at are:

  • ServiceStack
  • MVC
  • Web API
  • NancyFx

I'm trying to find some common talking-points between the frameworks so I know what to look for when picking a framework. The talking points I've got so far are:

  • The Framework beliefs and principles
  • The Architecture of the framework (Client and Service side)
  • The Stack the framework provides you with
  • The Ease of development within the stack (plugins etc)
  • End-to-end performance benchmarks
  • Scalability benchmarks
  • Framework documentation
  • Framework Support (Cross platform etc)
  • Pricing
  • Overall Conclusion

Can anyone think of anything else I should think about? By the end of the research I'm hoping to write about each framework in detail and to make comparisons as to which framework to chose for a given purpose. Any help would be greatly appreciated.




my site takes ages to load without www. prefix

gpstudios.com hangs for about 5 - 10 seconds www.gpstudios.com loads instantly.

I've got it so it redirects to www.gpstudios.com if its missing for URL consistency.

What's going on? Must be something wrong with the DNS setup, but it succeeds all DNS checks with external DNS testing services (eg - http://ift.tt/1pRGDL7)

How do I fix it?




A program to continuously crawl pages

I'm looking for a program that finds links on a page and follows them, making a map of everything it finds. I know things like this exist but I'm looking for one that will follow links inside of links and not stop until it reaches dead ends.

Does a software to do this already exist? If not, would it be relatively easy to create?




Avoid hardcoding strings html

What is the best method to avoid hardcoding Strings in HTML code?

e.g:

<p>Website name</p>

So that it can be easily changed globally across the site from one location.

Is the only way to achieve this to create all of the text elements used in the site with a language such as JavaScript or PHP?

I am aware that you could just create the website in HTML and then run a script to change all of the text labels, however this does not seem like a good method - since the user is going to be waiting for the script to download before the labels show.

Would love to hear everyone's ideas to get around this issue :)