vendredi 31 juillet 2015

How can I use BOOTSTRAP without internet?

I mean, you can use it via html link tag pointing to where bootstrap classes are. is possible to download those so you can call bootstrap even without internet?




No Validation icon for html5

I have Validated my webpage but in W3C there is no validation icon for html5 W3C Validation Icon

but it has been released on 28 October 2014 and validator is validating pages. why there is no validation icon for html5 in W3C.




How to get hardware information of (in-build) microphone?

Is it possible to read the hardware information (at least the name) of the (in-build) microphone while a user is recording an audio file on my website?

Is that possible with JavaScript or is there another way to solve this problem? I searched the web but could only find scripts for recording with JavaScript.




Twitter event triggers without event

I am facing a tricky problem with my code and hope to get some help on this. Below is a snippet of my code:

<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.myurl.com/" data-text="My text" data-via="Via">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

<script>
    twttr.events.bind( 
          'tweet', 
              function (ev) {

        <?php
        $file = 'file.txt';
        $id = trim($_GET["id"]);
        $data = array("ID:$id", "CURRENT POSITION:$position", 'Twitter');
        file_put_contents($file, implode(" ",$data).PHP_EOL,FILE_APPEND);
        ?>
                            }
                    );
</script>

I can't understand why my function (ev) triggers every time the page loads. It should be only triggered once a tweet has been posted. Anyone knows where the problem lies?




I want to Access enTranslations provided in one JS File as shown Below, But I am not Able to access it

As You can see in my HTML I want to take my Data according to my current locale, and i have custom translation file enTranslation, which is given.

PROBLEM : I am not able to see the values on browser page, when i am using {{ translations[key] }} OR {{ translation.key }}

      Please HELP me understand what is needed to be done to make this work.

I have 3 files in js Directory, Given Code Below:

   1. enTranslations.js
   2. prax_controller.js
   3. angular_1.4.2.min.js

And My HTML file

<!DOCTYPE html>
<html>
<head>
<script src="js/angular_1.4.2.min.js"></script>
<script src="js/prax_controller.js"></script>
<script src="js/enTranslations.js"></script>
<meta charset="UTF-8">
<title>Prax Local</title>
</head>

<body ng-app="prxApp" ng-controller="prxController">
    <div>
    List
        <ul class="d1" ng-repeat="(key, value) in eventHistories">
            <li class="d1k">
                <!--  {{ translations.key }}: {{ value }}% -->
                {{ translations[key] }}  :  {{ value }}%
            </li>
        </ul>
    </div>
    </body>
</html>

1. enTranslations.js

var translations = {
    "Device Status":'Device Status',
    "Device Temperature":'Device Temperature',
    "Device Network":'Device Network',
    "Wifi hotspot":'Wifi hotspot',
    "Memory Usage":'Memory Usage',
    "Data Usage":'Data Usage',
    "Application":'Application',
    "Security":'Security',
    "Activity":'Activity',
    "SIM Info":'SIM Info',
    "Motion Info":'Motion Info'
};

2. prax_controller.js

var prxApp = angular.module('prxApp', []);
prxApp.controller('prxController', ['$scope', function($scope) {
$scope.init = function() 
{
    $scope.eventHistories = {
            "Device Status":0,
            "Device Temperature":0,
            "Device Network":0,
            "Wifi hotspot":0,
            "Memory Usage":0,
            "Data Usage":0,
            "Application":0,
            "Security":0,
            "Activity":0,
            "SIM Info":0,
            "Motion Info":0
        };
};

$scope.init();
}]);

3. Angular.min.js

http://ift.tt/1VOR2Tc




Building a searchable database with drupal -- where to start

:) I'm trying to build a site that mainly offers a big database of a lot of different tools... those tools all have attributes like user ratings, descriptions, links to further informtaion and so on... the entries should also be linked; that means that the database stores which tools work great together. All the data will be collected manually. The main feature of that site should be a good search function and many options to filter results.

Well, this however differs a lot from an ecommerce system, because a lot of e-commerce stuff isn't used. I don't need any shopping cart or paying options and so on. I did some research and thought drupal would fit my needs; already installed it and tried it out a little bit. I'm new to drupal but not to coding and web design, worked with WP for 4 years and coded quite a bit; i'm also studying IT at university. Well, my question is basically where to start; do you have any tips for tutorials and so on? Maybe something that isn't too general but already leads me in the right direction? Thanks for any help, equi




JavaScript : Prevent showing alert when the url being opened is invalid

I have a requirement where I have to open a URL from html page. But, before I open the URL I cannot determine if the URL is a valid or not, so when I try to open a invalid url, the webpage throws an alert saying "Safari cannot open the page because the address is invalid.".

I understand it is designed for a reason, but is there anyway to prevent showing this alert, when the url is not a valid one.




WebGL: Failing at drawing points: glDrawArrays: "attempt to access out of range vertices in attribute 1"

I am trying to display points (a pointcloud actually) using WebGL. The past 2 days I spent going through this tutorial and still have a lot of my code based on it.

I am attempting to load a .ply file and then show each coordinate as a coloured point, but get stuck at this error when trying to draw it:

[.WebGLRenderingContext-0x111ff17bc300]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 1

I have of course done some research, but the general answer was that the length of the buffered arrays would be different, which I have made sure is not the case. It's mostly likely a similar noobish mistake though:

function getShader(gl, id) {
        var shaderScript = document.getElementById(id);
        if (!shaderScript) {
            return null;
        }
        var str = "";
        var k = shaderScript.firstChild;
        while (k) {
            if (k.nodeType == 3) {
                str += k.textContent;
            }
            k = k.nextSibling;
        }
        var shader;
        if (shaderScript.type == "x-shader/x-fragment") {
            shader = gl.createShader(gl.FRAGMENT_SHADER);
        } else if (shaderScript.type == "x-shader/x-vertex") {
            shader = gl.createShader(gl.VERTEX_SHADER);
        } else {
            return null;
        }
        gl.shaderSource(shader, str);
        gl.compileShader(shader);
        if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
            alert(gl.getShaderInfoLog(shader));
            return null;
        }
        return shader;
    }
    var shaderProgram;
    function initShaders() {
        var fragmentShader = getShader(gl, "shader-fs");
        var vertexShader = getShader(gl, "shader-vs");

        shaderProgram = gl.createProgram();
        gl.attachShader(shaderProgram, vertexShader);
        gl.attachShader(shaderProgram, fragmentShader);
        gl.linkProgram(shaderProgram);

        if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
            alert("Could not initialise shaders");
        }

        gl.useProgram(shaderProgram);

        shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");
        gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);

        shaderProgram.vertexColorAttribute = gl.getAttribLocation(shaderProgram, "aVertexColor");
        gl.enableVertexAttribArray(shaderProgram.vertexColorAttribute);

        shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, "uPMatrix");
        shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
    }

    var mvMatrix = mat4.create();
    var mvMatrixStack = [];
    var pMatrix = mat4.create();

    function mvPushMatrix() {
        var copy = mat4.create();
        mat4.set(mvMatrix, copy);
        mvMatrixStack.push(copy);
    }

    function mvPopMatrix() {
        if (mvMatrixStack.length == 0) {
            throw "Invalid popMatrix!";
        }
        mvMatrix = mvMatrixStack.pop();
    }

    function setMatrixUniforms() {
        gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);
        gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);
    }

    function degToRad(degrees) {
        return degrees * Math.PI / 180;
    }


    var pointcloudVertexPositionBuffer;
    var pointcloudColourBuffer;
    var pointcloudIndexBuffer;
    function handlePoints(pointCoords, pointColours, indices) {
        pointcloudVertexPositionBuffer = gl.createBuffer();
        gl.bindBuffer(gl.ARRAY_BUFFER, pointcloudVertexPositionBuffer);
        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(pointCoords), gl.STATIC_DRAW);
        pointcloudVertexPositionBuffer.itemSize = 3;
        pointcloudVertexPositionBuffer.numItems = pointCoords.length / 3;

        pointcloudColourBuffer = gl.createBuffer();
        gl.bindBuffer(gl.ARRAY_BUFFER, pointcloudColourBuffer);
        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(pointColours), gl.STATIC_DRAW);
        pointcloudColourBuffer.itemSize = 3;
        pointcloudColourBuffer.numItems = pointColours.length / 3;

        pointcloudIndexBuffer = gl.createBuffer();
        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, pointcloudIndexBuffer);
        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);
        pointcloudIndexBuffer.itemSize = 1;
        pointcloudIndexBuffer.numItems = indices.length;
    }

    var coordList = [];
    var colList = [];
    var indexList = [];
    function loadPLY(){
        jQuery.get('some_ascii.ply', function(data) {
            var lines = data.split('\n');
            var coords = false;

            for(var line = 0; line < lines.length; line++){
                if (coords) {
                    var splitString = lines[line].split(" ");
                    coordList.push(parseFloat(splitString[0]), parseFloat(splitString[1]), parseFloat(splitString[2]));
                    colList.push(parseFloat(splitString[3]), parseFloat(splitString[4]), parseFloat(splitString[5]));
                    indexList.push(parseFloat(line));
                }
                else{
                    if (lines[line] == "end_header"){
                        console.log("end header");
                        coords = true;
                    }
                }
            }
            handlePoints(coordList, colList, indexList);
        });
    }

    function drawScene(){
        gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);
        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

        mat4.perspective(45, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0, pMatrix);

        mat4.identity(mvMatrix);

        //mat4.translate(mvMatrix, [0, 0, -6]);

        //gl.uniform1i(shaderProgram.samplerUniform, 0);

        gl.bindBuffer(gl.ARRAY_BUFFER, pointcloudColourBuffer);
        gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, pointcloudColourBuffer.itemSize, gl.FLOAT, false, 0, 0);

        gl.bindBuffer(gl.ARRAY_BUFFER, pointcloudVertexPositionBuffer);
        gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, pointcloudVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);

        setMatrixUniforms();
        //gl.drawElements(gl.TRIANGLES, pointcloudIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);
        //console.log("1", pointcloudIndexBuffer.numItems);
        //console.log("2", pointcloudColourBuffer.numItems);
        //console.log("3", pointcloudVertexPositionBuffer.numItems);
        gl.drawArrays(gl.POINTS, 0, pointcloudIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);
    }


    function tick() {
        requestAnimFrame(tick);
        drawScene();
    }

    function webGLStart(){
        var canvas = document.getElementById("canvas");
        initGL(canvas);
        initShaders();
        loadPLY();

        gl.clearColor(0.0, 0.0, 0.0, 1.0);
        gl.enable(gl.DEPTH_TEST);

        tick();
    }




Problems while adopting a generated JavaScript page to Angular.JS

I am working in a project, where we adopt among others already in-use pages to an app. The app will have all the code in a JS & an HTML file.

The used code creates HTML pages that work fine. One of the subpages does have a list of elements that have a (+) or (>) button on their right, where the first is opening the item, enlisting subitems. The code does this as you can see with functions like $scope.switchOnOff. The item opens when clicking on the (+) button, which becomes a (-) button.

This is not the case with the Angular.JS code that I try to create from the generated & working code by hand. Here, I do not get any error messages (when opening the Google chrome window with F12), but nothing happens; the (+) button remans the same, and the list of subitems does not open.

I have another part on other subpages of my created Angular.JS code where actually list items open and show their subitems. In these cases, however, there is no object.innerHTML += '…' in the code.

I made the following example that will make the understanding of the problem I have easier. There are two items without a list, which should open when the (+) button is pressed. This is the case for the first item. I need help concerning the second item that does not open when pressing it's (+) button.

My question: What is the problem with the second item?

Thank you for your help & ideas!

Code example: controller.js, Test.html & main.css follow:

var app = angular.module("MyApp", ['ngSanitize']);

/**
 * Controls the messages.
 * 
 * @param $scope
 * @param $http
 */
app.controller("PostsCtrl", function($scope, $http) {
        $http.defaults.useXDomain = true;
        delete $http.defaults.headers.common['X-Requested-With'];

        $scope.processHTML = function(html) {
                // Combine HTML
                return $scope.myHTML;
        }
        
        /**
         * Vacation
         */ 
        $scope.instruction = function(object) {
                if (document.getElementById("instruction").style.display == "block") {
                        document.getElementById("instruction").style.display = "none";
                        document.getElementById('instructionGroup').className = 'contact_group parent';
                } else {
                        document.getElementById("instruction").style.display = "block";
                        document.getElementById('instructionGroup').className = 'contact_group parent active';
                }
        }

        /**
         * Info point
         */
        $scope.alt = '';

        $scope.switchOnOff = function(object) {
                if (object.className == 'item parent') {
                        $scope.alt = object.innerHTML;
                        object.className = 'item parent active';
                        object.innerHTML += '<ul class="site_submenu"><li class="item white-7"><div class="item_inner"><div class="item_txt"><a class="item_link" href="http://ift.tt/1fP3KQW">Jahresblatt</a></div><span class="item_icon"></span></div></li><li class="item white-7"><div class="item_inner"><div class="item_txt"><a class="item_link" href="http://ift.tt/1IOApmM">Zeiterfassung</a></div><span class="item_icon"></span></div></li></ul>';
                } else {
                        object.className = 'item parent';
                        object.innerHTML  = $scope.alt;
                }
        }
});
/*
###  smartphones Grid 
.col-ph
###  Tablets grid
.col-tb
###  Desktop grid
.col-dt
###  large screen grid
-col-ls
*/
body {
    background:white;
    margin: 0;
    padding:0;
    font-family:'Open Sans','droid Sans',arial, helvetica, sans-serif;
}
    body.height100 {
        overflow:hidden;
    }

/*farben - hintergrund*/
/*ivmblue*/

.ivmblue0 {
background: #7f96c1!important;
}
.ivmblue20 {
background: #5479ad!important;
}
.ivmblue40 {
background: #295898!important;
}
[…]
<!DOCTYPE html>
<html>
        <head>
                <title>Test page</title>
                <link rel="stylesheet" href="http://ift.tt/1wORPGp">
                <script src="http://ift.tt/13jmVM7"></script>
                <script src="http://ift.tt/1toXtPU"></script>

                <script src="lib/angular/angular.js"></script>
                <script src="lib/angular/angular-sanitize.min.js"></script> <!-- to parse HTML code safely! -->

                <script src="js/controllers.js"></script>
                <link href="css/main.css" rel="stylesheet" type="text/css">
                <link href="http://ift.tt/YlWz97" rel="stylesheet" type="text/css">
        </head>
        <body ng-app="MyApp">
                <div ng-controller="PostsCtrl">
                        <!-- START PAGE -->
                        <!-- Start page header -->
                        <header class="start">
                                <div class="header_top Group">
                                        <div class="header_background ivmblue40">
                                                <element><b>Head</b></element>
                                        </div>
                                </div>
                        </header>
        
                        <!-- Start page body -->

                        <div data-role="page" id="infoPoint">
                                <section class="contact_blog">
                                        <div class="contact_group parent" id="instructionGroup">
                                                <div class="org">
                                                        <div class="contact_group_txt" ng-click="instruction(this)">
                                                                <a href="#" class="link">Instruction</a>
                                                        </div>
                                                        <span class="contact_group_icon"></span>
                                                </div>
                                        </div>
                                        <div id="instruction" style="display:none">
                                                <ol>
                                                        <div>Fill out the form.</div>
                                                        <div>Send data using the email button.</div>
                                                </ol>
                                        </div>
                                        <div class="contact_group parent" id="infoPointGroup">
                                                <div class="org">
                                                        <div class="contact_group_txt" ng-click="switchOnOff(this);">
                                                                <a href="#" class="link">Tutorials</a>
                                                        </div>
                                                        <span class="contact_group_icon"></span>
                                                </div>
                                        </div>
                                </section>
                        </div>
                </div>

        </body>
</html>



how to get ID for several elements jquery

I have a situation where I want to print labels on a form, and I'm using Label For to do this. I'd like to append the child tag's ID using jquery, but I'm not sure how.

so basically what I want to do is get the ID of several elements and append those IDs to my page. I want to keep my DOM and my jquery code as clean as possible. What would be the easiest way to do this?




Helpdesk workflow application in c#

I want to create a simple helpdesk web application using workflow. I don't have a knowledge about the this project. any one help me to do this. If you have any idea please share with me,.




Python web application with C++ back-end

What does this statement mean exactly?

The best approach is often to write only the performance-critical parts of the application in C++ or Java, and use Python for all higher-level control and customization.

In the context of web applications and Saas, I understand that Python can be used for the UI and light weight data processing on the server. But when would I need to use C++ for performace-critical parts? I'm trying to understand how Python can be used with C++ to provide Saas or another web application.




Accessing a website in python

I am trying to get all the urls on a website using python. At the moment I am just copying the websites html into the python program and then using code to extract all the urls. Is there a way I could do this straight from the web without having to copy the entire html?




jeudi 30 juillet 2015

Center navigation bar and slider

I am teaching myself web design, and I'm building a random site for fun in Dreamweaver.I am trying to center the container, where the images scroll, to auto adjust depending on the screen size to the center (so the left and right side can be even). I am not sure how to go about that. Also, there is some little lag between images and can see the yellow background of the container is this normal?? Is there a way for my (UL) to take up the top portion of the website so the top will be white and then the bottom black and how can I center align my navigation bar??

This is what i have to far...

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ift.tt/kkyg93">
<html xmlns="http://ift.tt/lH0Osb">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>


</head>

<body>

<div class="Head">



<div class="Nav">
        <ul>
            <li><a href="#">HOME</a></li>
            <li><a href="#">ABOUT</a></li>
            <li><a href="#">CONTACT US</a></li>
            <li><a href="#">GALLERY</a></li>
        </ul>
</div>

<style>

body{
background:black;

}


.Nav{

background-color:white;
height:40px;


  }
.Nav ul{

color:white;
font-family:"American Typewriter";
padding:0px;

}
.Nav ul li{
  list-style:none;
  margin-left:350px;

}
.Nav ul li a{
  text-decoration:none;
  float:left;
  padding: 10px 40px;
  color:black;

}

.Nav ul li a:hover{
color:orange;
}
</style>

<script src="../Downloads/jquery-1.11.3.min.js"></script>
<script src="../Downloads/jquery.cycle.all.js"></script>
<script type="text/javascript">
$('#slider').cycle({ 
fx:     'scrollHorz', 
speed:  'slow',  
next:   '#next', 
prev:   '#prev ' 
});

</script>



<!--This is where the slider is happening-->
<style type="text/css">
 #wrapper{
display:block;
height:500px;
width:500px;

}

#container{
background-color:#FFC;
display:block;
float:left;
height:500px;
width:1200px;
overflow:auto;
margin-left:25%;
margin-top:50px;
}

#prev{
background-image:url(../Downloads/1438243795_circle_back_arrow.png);
background-repeat:no-repeat;
background-position:center center;
display:block;
float:left;
height:500px;
width:200px;
position:relative;
z-index:99;


}


#next{
background-    image:url(../Downloads/1438243790_circle_next_arrow_disclosure.png);
background-repeat:no-repeat;
background-position:center center;
display:block;
float:right;
height:500px;
width:200px;
position:relative;
z-index:99;


}

#slider{
display:block;
float:left;
height:500px;
width:1200px;
overflow:hidden;
position:absolute;



}
</style>
<div id= "wrapper">
<div id = "container">
    <div class="controller" id="prev" ></div>
    <div id="slider">
    <img src="../Pictures/1910493.jpg" width="1920" height="1080" />
    <img src="../Pictures/1822211.jpg" width="2560" height="1600" /> 
    <img src="../Pictures/old_book_4-wallpaper-1920x1440.jpg" width="1920"       height="1440" /> </div>

  <div class="controller" id="next" ></div> 
  </div>
</div>

<div id = "background">
</div>  





</body>
</html>




mobile web page control

For client side, I'm using HTML/CSS/Javascript and using PHP for server side. For input boxes in mobile web, is there any method that I can manipulate mobile keypad?

For example, for the input boxes which takes user phone numbers, I want to open number keypads first on phone screen. Currently, user has to encounter English keypad first (which is default) and then move on to the numbers.

input = "number" is the method, but in my case, iphone works with this, but android does not support this.




Directory indexes are not allowed here

I am new to Django, but have tried innumerable things. We're using Django 1.7.3. I need to be able to see the contents of to load into a JS program. I can access static files, but can not get the index of folders.

I have defined in settings:

STATIC_URL = '/static/'

Currently my URL code looks like:

urlpatterns += patterns('',
#...
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/static/', 'show_indexes' : True}),
)

Thanks in advance.




How to write multiple nested objects in a C# model to a sql database

I have the following model object in c# that I'm receiving in a WEB API from a POST - Does anyone know how I would write this object to a database? The tables can be whatever, I'm just not sure how to cycle through this model to get the 'Sequence', 'Quote' & 'Items' to flat files from objects.

[Serializable] public class PickupDetail { public string driver_name; public class PickupDate
{ public DateTime pickup_date; public class Sequence { public int sequence_id; public int location_id; public string company; public string address; public string city; public string state; public string zip;

            public class Quote
            {   public int quote_id;
                public bool complete;
                public string customer;
                public string destination_customer;
                public string purchase_order;

                public class Item
                {   public int quote_pickup_id;  
                    public int return_id;        

                    // Quote Detail
                    public int quote_detail_id;
                    public string description;
                    public bool selected;
                    public bool show_note;
                    public int pickup_qty;
                    public int qty_received;      
                    public int labels_printed;    
                    public string comments;       
                    public int return_qty;
                    public int qty_returned;      
                    public string return_comments;
                    public DateTime date_time;
                    public string driver_name;
                    public class OriginalItem
                    {
                        public int qty_received;
                        public int labels_printed;
                        public string comments;
                        public int qty_returned;
                        public string return_comments;
                    }
                    public OriginalItem original;
                }
                public List<Item> items;
            }
            public List<Quote> quotes;
        }
        public List<Sequence> sequence;
    }
    public List<PickupDate> dates;
}




Configure Membership into Web Service

I am developing an windows application (app) with Visual Studio Express 2013. For to log in, the app asks username and password using a form and then consume a method of web service that use a Membership installed into remote DB defined for use in a web site. My trouble is that app is common for any client and web service too, but Membership depend what DB app is pointing at that time. In fact the connection string I pass by parameter and all methods that make sql sentence against DB they know that they have to go. But with Membership is different, because the connection is defined in the web.config of each web site. Are there any way for to make dinamic the assign connection for Membership into the web service ? Thanks in advance




How to create a website like this I would like to design a website like this http://ift.tt/1h9a8Dr

I would like to design a website like this http://ift.tt/1h9a8Dr

Please help me, what it the name of this kind of websites, technology, language program, book, app or course that I can take to do it.




How domain name service starts?

Can anybody tell me how the domain name service (searching for the IP of a website) starts?

Or in other words, what happens after I type a web address (say www.google.com) in a browser, press enter and before the DNS server start searching. Is there any communications between my browser and some port of my computer; between the ports of my computer to that of my ISP DNS server?

Many thanks in advance!




How do JavaScript closures work at a low level?

I understand that a closure is defined as:

[A] stack-frame which is not deallocated when the function returns. (as if a 'stack-frame' were malloc'ed instead of being on the stack!)

But I do not understand how this answer fits in the context of JavaScript's storage mehcanism. How does the interpreter keep track of these values? Is the brower's storage mechanism segmented in a way similar to the Heap and Stack?

An answer on this question: How do JavaScript closures work? Explains that:

[A] function reference also has a secret reference to the closure

What is the underlying mechanism behind this mysterious "secret reference?"




PHP vs Ruby on Rails vs Python [on hold]

What's the best language to use on the web with PHP, Ruby On Rails, and Python? I need to know which programming language is the best since I am about to chose a back-end programming language (I am already a HTML / CSS / JavaScript expert).

Thanks!




Best tool to build mobile application based on a desktop application

I have an existing JSF application for which I want to build a mobile web app. I don't want to change anything in the existing JSF application. All the requests from my mobile app should go through JSF site. My mobile site should be light so I'll use selective operations.




Running python scripts on local host

I am a newbie to python . I am not bad with python programming , but never started using it with web. So I figured it out that python same as php can work on localhost via xampp .But as said It is displaying the python script contents. How can I exactly interpret code in apache(using xampp) an show it in browser. If there isn't any way please give me an alternative to use python on localhost.

Please do correct me if I am wrong anywhere because as I said I am new to python programming and cs world.




Extract cookies from open Safari session in Python

Trying to follow the example in this one:

Python urllib2 login to minecraft.net

I'm trying to get files from this website and it's a tedious process of clicking to get to each file. I could easily use urllib2 to webscrape but, of course, you have to be logged in to this website to get the data. I tried doing one of the login type approaches in Python but I can't get it to work.

My other option is to export the cookies from Safari session so I can run my webscraping scripts to get the data I need.

Does anyone know how to export cookies from Safari session to Python for access to website data?




multiple SUM from multiple tables to one query

SELECT amount, SUM(amount) AS intotal FROM incomes

intotal = 500

SELECT amount, SUM(amount) AS outtotal FROM outgo

outtotal=300

and after that but totals together total=intotal-outtotal= 200




Is there an icon list like “font awesome icons” with smartphones/pc brands?

I am looking for an icon list like font awesome icons but with smartphones and pc brands logo like (Samsung, HP, Apple…)




Python - Looping through HTML Tags and using IF

I am using python to extract data from a webpage. The webpage has a reoccurring html div tag with class = "result" which contains other data in it (such as location, organisation etc...). I am able to successfully loop through the html using beautiful soup but when I add a condition such as if a certain word ('NHS' for e.g.) exists in the segment it doesn't return anything - though I know certain segments contain it. This is the code:

soup = BeautifulSoup(content)
details = soup.findAll('div', {'class': 'result'})

for detail in details:
    if 'NHS' in detail:
        print detail

Hope my question makes sense...




Insert two values with same name to MySQL

I Have form where I want insert let's say:

  1. Who paid ? (user_id) in user database
    1. when (date) incomes database
    2. how much (sum) incomes database
    3. Who entering the data (user_id) in user database

and inserting script:

if(empty($_POST['user_id'])){
    $data_missing[] = 'User';

} else{
   $summa = trim($_POST['user_id']);   }
.......

$sql = "INSERT INTO incomes (user_id, date, sum, user_id)
VALUES ('$user_id','$date','$sum','$user_id')";

......

How I can solve to insert two times "user_id", and they may be different or same!




Is worth using a client-side framework to make a simple website look like an app?

I'm building a simple website. With simple I mean just a regular site, DB powered, with views of 2 or 3 models, an admin section.

My idea was using React.js to make the entire frontend. It's not necessary, but the purpose was to make it responsive (in time, not display size) and make it feel quick like an app.

Is worth it? Or I just simply use server-side templates?

Could we list some advantages and disadvantages?




What is a good php code

I'm have a problem with using this code:

<?php
    for($i=0;$i<=10;$i++){
?>
        <p><?php echo $i ?></p>
<?php
    }
?>

and this code:

<?php
    for($i=0;$i<=10;$i++){
        echo'<p>'.$i.'</p>';
    }
?>

which is better php code when you need to use html tag inside your php code?




My LAMP server is always running- isn't this a waste of resources?

On my Windows and Mac boxes, the WAMP and MAMP servers (respectively) are started and stopped manually, but on my Linux box the LAMP stack is always available without the need for starting and stopping.

Isn't this a waste of resources?




change the web template deppeding on web browser

How can I use many web templates on my website where each one opens on a different web browser?

My website crashes on any ios devices even on mac using safari web browser. The website either crashes or does not open properly so I want users using this browser (safari) to view another template that does not crash the app.




Good way to prevent registration several accounts for one user on site

I would like to prevent described problem. So I can check the IP of user and store it into DB, also I can store some info in cookies and check it while registration. But I am worry - is it enough?

What you could recommend me to do else?




What are the recommended algorithm and data structure books?

I am junior, WEB Engineer.I want to go to work,I have no experience with algorithms and data structures.So,I want to read some books about this.




How could i get the request of my web service call.

My aspx file uses an external web service and when i call that service method, i want to see what request is created and send the otherside. Is it possible to get it?




JavaScript snytax error

<button id="KullaniciSec" type="button" runat="server" onserverclick="KullaniciSec_OnServerClick"  onclick='<%# string.Format("return SecDegerler(\"{0}\");",Eval("id")) %>' class="btn  btn-default btn-xs">
<i class="fa fa-folder-open-o fa-2x"></i>Seç  </button>

Hi , i will call javascript code this code but i have error messaj and i will open console

 <button onclick="return SecDegerler("23"); __doPostBack('ctl00$ContentPlaceHolder1$griduser$cell0_9$TC$KullaniciSec','')" id="ContentPlaceHolder1_griduser_cell0_9_KullaniciSec_0" type="button" class="btn  btn-default btn-xs">
                                            <i class="fa fa-folder-open-o fa-2x"></i>Seç

                                        </button>

how to will be fix? And How to remove "__doPostBack" ?




editing a text file on my host using php

i have created a website ..... suppose i have a webpage index.php and a txt file updateContent.txt How can I manipulate the txt file via the php code on my host???

i have tried this code but it doesnt work !!! and it say Unable to open file! is There another way?? or What?

//database connection
$quryForGetLastUpdate="SELECT englishword FROM allowedwords";
         $myfile = fopen("./updateContent.txt", "w") or die("Unable to open file!");
                foreach ($dbh->query($quryForGetLastUpdate) as $row){
                    //out the mean in txt file
                    $txt = $row['englishword'];
                    fwrite($myfile, $txt);
                }
fclose($myfile);

And its My Host Content... enter image description here




How to create activation link after sign up?

I am using Spring mvc It does not matter..

I have a sign up section. Now My requirement is, After fullfill signup, I want to create an activation link and send it to the user by mail..

For send mail I am follwing this code Now please can any one tell me how to create activation link.




URL without index.php cause timeout but with index.php works fine

I have a php script that runs for long time continuosly.

It is installed on a domain for example: http://ift.tt/ME9KXX

My issue is that whenever I try to open script through this url:

http://ift.tt/ME9KXX then my page shows timeout error after few minutes.

But in other case if I run the same url with index.php at the end e.g. http://ift.tt/1Jxz3LX then that works like charm for hours without any interruption.

Why is it showing such strange behaviour. Both urls access the same index.php then why one url works perfect and why other causes timeout?




Simple email sender with NodeJS and Express

I'm totally new to web development and working with web related concepts and frameworks (IPs, networks, routers, I cringe everytime :D ).

But, thanks to some internship work I have "forced myself" to work with this and thanks to lots of digging on the internet I have managed to develop a super simple app that can send emails if I am under my localhost. But, I have some (many) questions, but first, the files that comprise all of my code:

Package.json file

{
"name": "email-node",
"version": "1.0.0",
"dependencies": {
"nodemailer": "~0.7.1",
"express": "~4.5.1"
}
}

Index.html

<html>
<head>
<title>Node.JS Email application</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><script>// <![CDATA[
$(document).ready(function(){
    var from,to,subject,text;
    $("#send_email").click(function(){     
        to=$("#to").val();
        subject=$("#subject").val();
        text=$("#content").val();
        $("#message").text("Sending E-mail...Please wait");
        $.get("http://localhost:3000/send",{to:to,subject:subject,text:text},function(data){
        if(data=="sent")
        {
            $("#message").empty().html("Email is been sent at "+to+" . Please check inbox !");
        }

});
    });
});
</script>
</head>
<body>
<div id="container">
<h1>Mailer In Node.JS</h1>
<input id="to" type="text" placeholder="Enter E-mail ID where you want to send" />
<input id="subject" type="text" placeholder="Write Subject" />
<textarea id="content" cols="40" rows="5" placeholder="Write what you want to send"></textarea>
<button id="send_email">Send Email</button>
<span id="message"></span>
</div>
</div>

app.js File

var express=require('express');
var nodemailer = require("nodemailer");
var app=express();
/*
Here we are configuring our SMTP Server details.
STMP is mail server which is responsible for sending and recieving email.
*/
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "MYGMAIL@gmail.com",
pass: "MYGMAILPASS"
}
});
/*------------------SMTP Over-----------------------------*/

/*------------------Routing Started ------------------------*/

app.get('/',function(req,res){
res.sendfile('index.html');
});
app.get('/send',function(req,res){
var mailOptions={
to : req.query.to,
subject : req.query.subject,
text : req.query.text
}
console.log(mailOptions);
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
res.end("error");
}else{
console.log("Message sent: " + response.message);
res.end("sent");
}
});
});

/*--------------------Routing Over----------------------------*/

app.listen(3000,function(){
console.log("Express Started on Port 3000");
});

From what I have read here is what I concluded:

Node.js + Express applications always "listen" to incoming connections on port 3000 (regardless of the IP? Or is this a stupid thing to ask?) so that is the value I use.

Ideally, to send stuff from a website instead of my localhost I believe that the problem lies on the index.html file.

Specifically, this line:

$.get("http://localhost:3000/send",{to:to,subject:subject,text:text},function(data){

where instead of using http://localhost:3000/send I would use something like:

http://ift.tt/1SOtM3o

I have read countless forums and posts, tried everything from:

$.get("/send",{to:to,subject:subject,text:text},function(data){

to searching for github servers IP adress range ( http://ift.tt/1MzpjCK ) to try and use them directly there and nothing seems to work...

(The application is supposedly host here:

http://ift.tt/1SOtM3q

)

Can someone help me?

Best,

Bruno




Facebook OAuth redirect URIs for both canvas and website Unity game versions

I have developed a Unity game that enables users to login with their Facebook account.

The game has two versions

  1. Facebook canvas version to play inside Facebook http://ift.tt/1IN3dfy. We configured our facebook app to use the unity integration so we supply a direct path to the unity3d file.
  2. public website version http://www.MyGame.com

Recently the website version facebook login stopped working.

We traced the problem to the Settings|Advanced|Client OAuth Settings. When the Web OAuth Login setting is disabled, the web version can't login to facebook.

If we enable this setting, then Facebook requires us to whitelist redirect uris.

We whitelisted the web version uri and it works, we are able again to login to Facebook from the website. But the facebook version stopped working.

It seems that we also need to whitelist the facebook canvas version redirect uri. But we don't know what it is. We do not supply it to the sdk. We tried different values, e.g. the location where our .untiy3d file is deployed but nothing worked.

It is strange to me that we suddenly require the WebOAuth Login switch. Can someone confirm this?

Is there a redirect URI I can whitelist for the facebook canvas version to work?

I am using FacebookUnitySDK6.0 with Unity4.6.6 and I must have the 'Unity integration' setting enabled.




Modifying href using jQuery generating inconsistent results

When leveraging jQuery to modify the href for a given link - using 'prop' or 'attr' - the call succeeds. I can see the link change in developer tools, if I right click on the link and select "Open link in new tab" it works flawlessly.

BUT

If I attempt to simply click on the link, in the same tab, it, for whatever reason, keeps sending me to the old (non-modified) link as if it's cached on the browser or something. This occurs in Firefox and Chrome.

Anyone seen this before?




How can I build a front end webgui control panel to control SoftEther VPN?

I have setup the SoftEther (http://ift.tt/1kj6DH4) VPN platform on a linux box, and would like to control (add,create,delete etc) users from a webgui. How could I accomplish this, or where should I look for resources on how to do it? I have been unable to locate any useful information thus far.

Thanks




Compilation error on file lib/phoenix_ecto/html.ex

While compiling project which use elixir with phoenix web framework, below compilation error which shown in below image is occurred.

enter image description here




What is the web hosting service with the lowest account cancellation percentage?

The Google search algorithm software was unable to answer the following question: What is the web hosting service with the lowest account cancellation percentage? Is there anyone who can help me out on this? Thanks!




C# Web Bot Not Working/Questions

I am trying to make a web bot that will click a button then fill out two textboxs with the contents of two text boxes (on gui of the program) and then click another button and have this repeat in the background of the program, but unfortunately it would not work so i unhid the web browser and made it big so i could see what the problem was like if any of the buttons were being clicked or the text boxs were filling out and none of the buttons were being clicked or anything

Help Please

`using MetroFramework.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Instagram_Bot
{
    public partial class Form1 : MetroForm
    {
        public Form1()
        {
            InitializeComponent();
            webBrowser1.Navigate("http://iglikers.ml/");
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void startButton_Click(object sender, EventArgs e)
        {
            SendData();
        }

        private void SendData()
        {
            var buttons = webBrowser1.Document.GetElementsByTagName("button");

            foreach (HtmlElement button in buttons)
            {
                if (button.InnerText == " Get Free Followers")
                {
                    button.InvokeMember("click");
                }
            }
        }
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (webBrowser1.Url == e.Url)
            {
                if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
                {

                    webBrowser1.Document.GetElementById("lfFieldInputUsername").SetAttribute("value", userNameTextBox.Text);
                    webBrowser1.Document.GetElementById("lfFieldInputPassword").SetAttribute("value", passWordTextBox.Text);

                    var buttons = webBrowser1.Document.GetElementsByTagName("button");

                    foreach (HtmlElement button in buttons)
                    {
                        if (button.InnerText == " Log in")
                        {
                            button.InvokeMember("click");
                        }
                    }

                    SendData();
                }

            }
        }
    }
}
`




Online Libraries Relocation

It just came to my mind now that since when developing web based application we use online libraries, we reference to them, is there a chance (if it makes sense) that those libraries be relocated to another sites? Say perhaps you always used to find your resources(libraries) on a particular site and now that site doesn't exist anymore or rather it does not output what you have requested.




mercredi 29 juillet 2015

Display a webpage with styles for printing

Is there a way how display a webpage with CSS for printing instead of standard CSS?
I want to see how the webpage will look like before printing. I don't want print preview in print dialog, but the webpage with CSS for printing.
I use @media print to specify printing styles.




Usage and Implementation of Head, Option, Trace http methods with Servlet

I want to implement following methods to understand their working by using Servlet.

doHead()  
doTrace()  
doHead()  
doOption()

The syntax and theoretical meaning is given in every tutorial and documentation but I didn't find their actual use and implementation.

Can u plz help me out with scenarios in which we use these methods and actual implementation code.

I tried to call these function from html form and implemented respective method but it is not working.

<form action="trace" method="trace">
<input type="submit">
</form>
<form action="trace" method="option">
<input type="submit">
</form>




The class 'WebAPI.MyMiddlewareComponent' does not have a constructor taking 2 arguments

I am trying to implement step-by-step selfhosting OWIN application following this article. I've done all examples before 'Use Configuration Objects for Configuring Middleware' section, but during coding the example from that section i've got error. Here my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

// Add the Owin Usings:
using Owin;
using Microsoft.Owin.Hosting;
using Microsoft.Owin;



namespace WebAPI
{
    // use an alias for the OWIN AppFunc:
    using AppFunc = Func<IDictionary<string, object>, Task>;

    class Program
    {
        static void Main(string[] args)
        {
            WebApp.Start<Startup>("http://localhost:8080");
            Console.WriteLine("Server Started; Press enter to Quit");
            Console.ReadLine();
        }
    }

    public class MyMiddlewareConfigOptions
    {
        string _greetingTextFormat = "{0} from {1}{2}";
        public MyMiddlewareConfigOptions(string greeting, string greeter)
        {
            GreetingText = greeting;
            Greeter = greeter;
            Date = DateTime.Now;
        }

        public string GreetingText { get; set; }
        public string Greeter { get; set; }
        public DateTime Date { get; set; }

        public bool IncludeDate { get; set; }

        public string GetGreeting()
        {
            string DateText = "";
            if (IncludeDate)
            {
                DateText = string.Format(" on {0}", Date.ToShortDateString());
            }
            return string.Format(_greetingTextFormat, GreetingText, Greeter, DateText);
        }
    }

    public static class AppBuilderExtensions
    {
        public static void UseMyMiddleware(this IAppBuilder app, MyMiddlewareConfigOptions configOptions)
        {
            app.Use<MyMiddlewareComponent>(configOptions);
        }

        public static void UseMyOtherMiddleware(this IAppBuilder app)
        {
            app.Use<MyOtherMiddlewareComponent>();
        }
    }

    public class MyMiddlewareComponent
    {
        AppFunc _next;

        // Add a member to hold the greeting:
        string _greeting;

        public MyMiddlewareComponent(AppFunc next, string greeting)
        {
            _next = next;
            _greeting = greeting;
        }

        public async Task Invoke(IDictionary<string, object> environment)
        {
            IOwinContext context = new OwinContext(environment);

            // Insert the _greeting into the display text:
            await context.Response.WriteAsync(string.Format("<h1>{0}</h1>", _greeting));
            await _next.Invoke(environment);
        }
    }

    public class MyOtherMiddlewareComponent
    {
        AppFunc _next;
        public MyOtherMiddlewareComponent(AppFunc next)
        {
            _next = next;
        }
        public async Task Invoke(IDictionary<string, object> environment)
        {
            IOwinContext context = new OwinContext(environment);
            await context.Response.WriteAsync("<h1>Hello from My Second Middleware</h1>");
            await _next.Invoke(environment);
        }
    }



    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            // Set up the configuration options:
            var options = new MyMiddlewareConfigOptions("Greetings!", "John");
            options.IncludeDate = true;

            // Pass options along in call to extension method:
            //app.UseMyMiddleware(options);
            app.Use<MyMiddlewareComponent>(options);           
            app.UseMyOtherMiddleware();
        }
    }
}

The class 'WebAPI.MyMiddlewareComponent' does not have a constructor taking 2 arguments.

when app.Use<MyMiddlewareComponent>(options); is calling. If i use some string instead of MyMiddlewareConfigOptions:

app.Use<MyMiddlewareComponent>("somestring");  

it works. Version of Owin package is 3.0.1.0, .NET Framework - 4.5.

Why it is happening?




what are the apache2 performance tuning?

Am having ubuntu server which has 3gb ram. And apache2 is installed on that server. Lot of sites are running under apache2. Due that apache2 went slow. What are the performance configurations for apache2?




Questions from a new ASP.NET Developer

This is a developer start doing Web using ASP.NET. I got a few questions for learning Web development. Can you help me? Thanks!

  1. Can I understand HTML, CSS and JavaScript in this way (the front-end)? They are all run on the browser level, HTML provides the basic structure for a web page and JavaScript is the code executed on the browser level. CSS is used for the style - such as font, color, and theming. Am I right about them?

  2. So, in the back-end, there can be C# codes with SQL Server for the data source.

  3. From above discussion, I couldn't find a place to fit in ASP.NET? Is it like a bridge between the front and the back? Or something different? How does ASP.NET fit in?

  4. When I create a new ASP.NET project from Visual Studio templates, how can I find where the HTML exists? Does it contain in the ASPX files?




Save file with relative path from javabean or servlet

I need to save file from javabean or servlet, and I'm having trouble finding relative path, I tried:

(from servlet)

ServletContext servCont = this.getServletContext();
String contextPath = servCont.getRealPath(File.separator);
System.out.println("REAL PATH: "+ contextPath);

this gives me:

REAL PATH: E:\Web\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Saloni\

and project folder is:

E:\Web\Saloni

and from bean (bean is called Salon)

String path = Salon.class.getResource("Salon.class").getPath();

and got basically the same thing

/E:/Web/.metadata/.plugins/http://ift.tt/1MuDYyk

If I just put file name into FileOutputStream file gets saved in eclipse workspace.

I read somewhere that I'm supposed to get to WEB-INF somehow but can't do that ..




How to embed leaflet map to html page?

I'm new with web developing, and I want to embed a map to my html page.

How I can do this?

I'm using leaflet map generated from QuantumGIS with qgis2leaflet plugins. In the future, I want to show a heat graph in the map that represent population distribution.

this is my html code:

<div class="widget span8">
        <div class="widget-header">
          <i class="icon-map-marker"></i>
          <h5>Map Visualization</h5>
          <div class="widget-buttons">
          </div>
        </div>
        <div class="widget-body clearfix">
          <div style="height:274px;" id="graph" class="widget-analytics-large"></div>
        </div>
      </div>
    </div>




Generate preview images with custom text?

I´m working on a webshop where you can personalize Glasses, Pens etc. with gravures...

We also want a "Preview" function like in this shop (click on "Vorschau"): http://ift.tt/1H41JWW

They are generating the preview images through this link: http://ift.tt/1gnSFHj

What is a .dtm file and how can I implement this feature on my website?

Thanks in advance!




Web design projects [on hold]

I'm a newbie programmer who just started learning html5, css3, JavaScript, MySQL and Python from a book and I'm looking for projects to practice with. Does anyone know where I could find project to practice with?




How to set windows URI scheme

I want to start an application via web browser. Therefore, I need a new URI entry in my registry. Some time ago i have seen a script which will create a new entry but i have lost the site. I already have tried to set it via regedit but without result.




Infrastructure to host multiple sites on (multiple) IIS server(s)

We have an application, which consists of web app running in IIS, windows service and data storage in file system and a database (PostgreSQL).

We have two types of clients, that host the system on their server (site, win service and postgre can be on a single machine), also we offer 'hosting' services - when we run multiple instances of the system on our servers for clients.

So with the requirement of local installs, we don't use any cloud-based services or tools, just run multiple instances in parallel on our VMs. So all the clients are completely segregated, there are as many sites (app pools) as clients, multiple win services, and separate databases in postgre.

So how our current operation work is that we start a web-server with IIS and db server, start adding new instances, and once a server is 'full', we open another one... This is done manually, as there may be many cases when someone is just interested in the system and asks for a new instance for testing. That new website/database can be mostly empty, don't take much resources so on a single 'standard' VM we can host many of those. But at some moment, one or several sites will start growing and then we can decide to a) not add any more to that server; and b) move larger instances to another machine...

This manual process is error prone of course and results in long down-times if something goes wrong.

We started moving to new hardware infrastructure and in this process are trying to revisit system organization as well.

I started looking at IIS web farms to at least reduce some of the issues with multiple servers - like having one gateway (arr in IIS case) that receives requests and directs to the right webserver. Plus we can benefit from adding load balancing and ssl offloading later. While for single sites this works fine, I couldn't find a way to have a logic that says 'for list of host names go to web1 server, for another list go to web2' etc.

So wanted to ask, am I on the right track and need to come up with correct setup in IIS ARR or the whole organization needs to be reworked, with different routing, internal dns etc?

Thanks, Zura




undefined method when accessing attributes of a model (STI)

I have 4 models: Patient, Admin, Doctor, User. Patient, Admin and Doctor extends User.

// patient.rb
class Patient < User
end

// doctor.rb
class Doctor < User
end

// admin.rb
class Admin < User
end

However, I cannot get child-class-specific attributes. When I call, for example patient.fathername, it gives me the error

NoMethodError: undefined method `fathername' for #Patient:0x007fa4c172a188

while I have fathername column in my Patient model.

//schema.rb
create_table "patients", force: :cascade do |t|
t.string   "fathername"
end

Made some research about the problem, and realized that other people who use STI also encountered with this problem. However, I could not understand any of the solutions and source of the problem. What is wrong with STI and getting attributes?




Why would a Web Service return a variable in a format that needs conversion?

More specifically, I cam calling a web service via a console application. It requires a login function to be sent via the service and receives a login sessionId that is active for x minutes. The sessionId needs to be a long variable for any of the service defined functions to be utilized but it the service returns a string? Is this a common thing that web services only return strings? Any explanation would be helpful.




Is it insecure to send a request to reset token to previous state?

I am using Meteor and its account system. My enrollment process involves a few steps on resetting the password.

Template['enrollment'].events({
  'submit #reset-password-form': function (e, template) {
    e.preventDefault();
    let token = Session.get('_resetPasswordToken');
    let user = Meteor.users.findOne({ "services.password.reset.token": token });
    let password = $(e.target).find('input#password').val();

    if (AutoForm.validateForm('reset-password-form')) {
      resetPasswordAsync(token, password)
        .then(() => {
          return Meteor.promise('Orders.initialize', template.data);
        })
        // a few more `.then()s`
        .catch((error) => {
          Notify.warn(error.message);
          Meteor.call('User._resetToken', user, token);
        })
    }
  }
});

The reason for this is because if anything fails in the promise chain, then they will remain on the same page but have an "uninitialized" state.

I use a meteor method, because a user should not be able to change his/her services to change their token back.

Meteor.methods({
  'User._resetToken': function (user, token) {
    check(user, Meteor.users.simpleSchema());
    check(token, String);
    Meteor.users.update(user._id, {
      "services.password.reset.token": token
    });
  }
});

I vaguely feel like this is insecure, but can't quite tell why. Is there any exploits where resetting the user token on a callback can be exploited?




My input text has changed color

Every place I type in any web page, the text is now RED instead of black. Even this text box is typing in RED. I don't know what changed. How do I get it back to black?




Grid changing in responsive web design

I'm a designer, and I jump from mobile app design to web design, so the concept of responsive web design is new to me, i know the web should be on a grid. When responsive and grid come together makes me a little bit confused.

The question is: I have a 16-column grid at desktop size, when resizing to tablet or mobile:

  1. the grid keeps its amount of columns, but the columns and gutters shrink (because of percentage-based size), the specific element changes the amount of columns it spans

-Or-

  1. The grid shrinks until it's at the tablet or mobile breakpoint, it reset the columns and gutters' size to its initial state but reduces its amount of columns, for example: tablet is 8 columns, mobile is 4 columns

-Or-

  1. Create a new grid at every breakpoint.

Which solution is correct ?




How to execute this javascript function from command line?

I'm building a web macro and and I'm stuck at this point. This select shows a certain number of records per page (10, 20, 30, etc,100)

It fires this ajax code on change of the select element to bring back the number of records from that the select indicates.

I want to return 1500 results even though "1500" is not a select value.

My queestion is: How can I execute javascript to bring 1500 reords?

I will execute it on the address bar "Javascript:...."

Thanks

<select class="x2-minimal-select" onchange="$.ajax ({
                    data: {
                        results: $(this).val ()
                    },
                    url: &quot;/x2crm/http://ift.tt/1Kzz4xE;,
                    complete: function (response) {
                        $.fn.yiiGridView.update(&quot;contacts-grid&quot;, {data: {Contacts_page: 1},complete: function () {}});
                    }
                });" name="resultsPerPage" id="resultsPerPage">
<option value="10">10 rows</option>
<option value="20">20 rows</option>
 <option value="30">30 rows</option>
<option value="40">40 rows</option>
<option value="50">50 rows</option>
<option value="75">75 rows</option>
<option value="100" selected="selected">100 rows</option>
</select>




Using Redis with Node.js front end+back end

I'm making a web tool using node js that needs to take in a large amount of data constantly and serves this to a user. So that each new user does not have instantiate an enormous number of listeners and process all of the data locally, I am making a node.js back-end which takes in all data and pushes processed data to a Redis database.

I then want a separate front-end, where users are fed data from this same Redis db.

I have seen many tutorials explaining how to create a Redis server with Node.js, which is what I need for the back-end, but I need my front-end to connect to an existing Redis db created by my back-end. Is there an easy way to do this?

Also the server this is all running on is already running 2 redis db's. Is that going to be a problem? I don't see a way to establish a db number on Node.js ass I would when created a Redis db python for example.

Thanks

David




Server Properties For New Website

I want to Know which server I can choose for my new website.I probably will have about 80,000-140,000 pageviews per day and worry about sever properties (Processor,RAM).




how to share data between two html pages on a local network?

i want to send a few variables from a html page on one device to another hmtl page on a different device but on the same local network to be displayed immediately. Im not well versed with servers and i want to know how i can do this




Is it possible to know which api call is being made from browser?

There are some webapps which dont expose their api's openly.

Is there a way to know which api call is being made from chrome tools or something.

Like for example take flipkart(I know it does expose its apis but just suppose it does not)

And take this item

http://ift.tt/1OBDe94

I want to know which api is being and how it is being called so that i can use it in my app.I could have scraped the data but i would prefer the api because i would directly get the response as an json object.

Can i get this using chrome devoloper tools or something else?

PS: This is purely for a hobby/learning/educative project and not for commercial purpose.




How do I make a drop down menu?

<ul id="MenuBar2" class="MenuBarHorizontal">
    <li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
         <ul>
              <li><a href="#">Mr</a></li>
              <li><a href="#">Mrs</a></li>
              <li><a href="#">Miss</a></li>
              <li><a href="#">Ms</a></li>
              <li><a href="#">Master</a></li>
              <li><a href="#">Prof.</a></li>
              <li><a href="#">Dr</a></li>
         </ul>
    </li>
</ul>

This is the code that I have used on Dreamweaver Cs6. The drop down works however, when I click on one of the titles, it doesn't select it. Could someone explain how to fix this problem please.

Thanks :)




VB.net Sicherheitsfehler Crystal Report

I have currently the problem that in the execution of my program the following error appears:

System.Security.Policy.PolicyException:Did not get Required.

Does anyone have any idea what it could be? The application is a Web application and running on a server.




One Page Scroll 1.3.1 Not working

I included the CSS , JS files into the Head and called the start function as they said. Created main , sections. When I scroll nothing is happening. And the page stays at the home and the normal scrolling is also not working. I am beginner.




How to create redirect link in html or php with hidden constant credential?

Please help me to make redirect link or link which will perform the following activities. The given code is

<html>
  <body>
     <div class="loginDiv">
        <div id="divack"></div>
        </br>
        <form id="login" onsubmit="return submitForm();" name ="login" >
            <table>
               <tr>
               <td>Username </td><td><input type="hidden" id="txtUsername" name = "username" value="guest" />
               </tr>
               <tr>
               <td>Password </td><td><input type="hidden" id="txtPassword" name= "password"   value="guest1234"/>
               </tr>
               <tr><td><input type = "submit" id="btnSubmit" name="Login" value ="Login"/></td></tr>
             </table>
        </form>
     </div>
   </body>
</html>

In the code on button click event it will redirect to some other page after checking credential from the database.

But I want to open direct on login page with particular fix credential which display some data in a grid.

So let consider the given code of login.html

when page is loaded on button click event it will redirect to some other page like home.html after checking credential from the database. According to the user access it will display some information.

Suppose, geust is one user and his password is guest1234

So instead on two manual redirection, I want all on one link.

So please help me to solve this problem.




Getting a Table using Excel VBA behiind a username and login

I have basic excel vba knowledge and is trying to get a table in a website. The problem is that I need to login first in-order to access this information.

My code is below. I have hit a road block and most of the guides I found out there do not work with this site. Appreciate your help.

Private Sub Worksheet_Change(ByVal Target As Range) Dim KeyCells As Range

' The variable KeyCells contains the cells that will cause an alert when they are changed.
Set KeyCells = Range("H1")

If Not Application.Intersect(KeyCells, Range(Target.Address)) _
       Is Nothing Then
        ' Clear contents of Sheet 1
        '
        Worksheets("Sheet1").Cells.Clear
        Range("A1").Select
        '
        'Login to the website
        '
        Dim IE As Object

        Set IE = CreateObject("InternetExplorer.application")

        With IE
            .Visible = True
            .navigate ("http://ift.tt/1Dat2n7")

            While .Busy Or .readyState <> 4: DoEvents: Wend

            .document.all("Template_GLE_Login_LoginView1_login_UserName").Focus
            .document.all("Template_GLE_Login_LoginView1_login_UserName").Value = "Username"
            .document.all("Template_GLE_Login_LoginView1_login_Password").Focus
            .document.all("Template_GLE_Login_LoginView1_login_Password").Value = "Password"
            .document.all("Template_GLE_Login_LoginView1_login_LoginButton").Click

            While .Busy Or .readyState <> 4: DoEvents: Wend
            Debug.Print .LocationURL
        End With
        '
        ' take the Ticker in sheet Blank cell H1
        Dim Ticker As String
        Ticker = Sheets("Blank").Range("H1")
        URL = "URL;http://ift.tt/1ASDSrQ" & Ticker
    '
    ' get the data from the website
        Range("A1").Select
        With Sheets("Sheet1").QueryTables.Add(Connection:=URL, Destination:=Sheets("Sheet1").Range("$A$1"))
    '        .CommandType = 0
            .Name = Ticker
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
    '        .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
    '        .RefreshPeriod = 0
    '        .WebSelectionType = xlSpecifiedTables
    '        .WebFormatting = xlWebFormattingNone
    '        .WebTables = """Rf"""
    '        .WebPreFormattedTextToColumns = True
    '        .WebConsecutiveDelimitersAsOne = True
    '        .WebSingleBlockTextImport = False
    '        .WebDisableDateRecognition = False
    '        .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
        End With

End If

End Sub




How to get index of the max value in array of objects?

I've got an array with following format:

var dataset = [{date:'1',value:'55'},{date:'2',value:'52'},{date:'3',value:'47'}];

And I'm getting the maximum value in it by:

var maxValue = Math.max.apply(Math,dataset.map(function(o){return o.value;}));

It works very well, there's nothing to worry about. But how I can obtain an index of the maxValue?

I've tried indexOf() (which returns me -1 all the time), jQuery inArray() as well as reduce() but none of them work properly.

I guess there's a more cleaner way by iterating all elements to get the index.

Thanks in advance.




mardi 28 juillet 2015

By minimizing the chromium loses its video Can I know why?

I would like to play the video properly.

I use HLS for video playing

My questions are:

1.By minimizing the chrome loses its video Can I know why?

2.You will know the solution?




Publishing a website [on hold]

I'm doing a website for my church. They have a hosting service already with an out-dated website. The old website was made using dreamweaver (yuck). I hand coded the entire new website using html & css. I just don't know how the server side works. Where does stuff go? The hosting service makes you pay for documentation and technical support. I'm trying not to go that route. I think that the html & css files go into a folder called public_html, but how is a home page picked? Any light shed on this is greatly appreciated.




In JS, how to make a POST given a URL and a application/x-www-form-urlencoded string?

I have an application/x-www-form-urlencoded string and a destination URL. How do I make the browser open that URL and use the string as the POST body?




Mac unable to browse to any websites hosted at a single IP

I am unable to browse to any websites that are hosted on a single IP address - a reseller web hosting account that I manage, with a number of websites on it. This occurs in all browsers. Other websites are fine. The issue is just with websites hosted at this reseller account.

Errors:

Safari:

Safari can’t open the page XXXXXXXX because the server unexpectedly dropped the connection.
This sometimes occurs when the server is busy. Wait for a few minutes, and then try again.

Chrome:

No data received
ERR_EMPTY_RESPONSE
Unable to load the webpage because the server sent no data.

Firefox:

The connection was reset
The connection to the server was reset while the page was loading.

I am able to SSH, ping, traceroute, etc to the IP address. I can even log into the reseller hosting control panel (WHM) which runs on a different port - it is purely a web browsing issue on port 80.

Other machines at the same connection as me have no problems - just my machine.

I have tried many different things to resolve this:

  • Using different DNS (Google, OpenDNS, etc.)
  • Flushing DNS cache
  • Clearing of cache in all browsers
  • Used both WiFi and LAN connections

If I connect my machine to a personal hotspot on my phone, I am able to browse to these sites no problems. Switching back to my office network, and the issue is back. This may suggest it is the office connection being blocked, however:

  • There are other machines on this network that can access the same sites perfectly fine
  • There are no blocks at the web host for this IP

I have checked with the Hosting Provider, and they can see no issues at their end.

My machine:

Mac Yosemite 10.10.4 Broswers: Safari (8.0.7 (10600.7.12)), Chrome (44.0.2403.107 (64-bit)), Firefox (39.0)

So, I am putting this weird issue out there in the hope that somebody has some ideas on what may be the cause of the problem.

Looking forward to some ideas.

Thanks,

Nathan




CSS: h2::first-letter with a border needs a margin for the rest of the h2

I hope this could be answered. More details: I want to create extra spacing after the ::first-letter but when I add margin to it expands the border. I tried to find a solution and found ::after but that didn't work for me..

CSS used:

h2::first-letter {
font-size: 200%;
font-family: Times;
padding-left: 5px;
padding-right: 3px;
border:2px solid black;                                                 
}

h2{
    font-family:"Helvetica Neue",HelveticaNeue,Arial,sans-serif;
    font-weight:normal;
}

Any tips or improvements would be really great! I'm pretty new to it, but I learning it at a decent speed.




HTML/CSS Drop-down Menu Location

I'm having issues with creating a drop-down menu with HTML&CSS. I got the HTML part down (I think).

<div id="Nav">
    <ul>
        <li class="Navigation"><a href="" class="Nav_Text">Item 1</a></li>
        <li class="Navigation"><a href="" class="Nav_Text">Item 2</a></li>
        <li class="Navigation"><a href="" class="Nav_Text">Item 3</a></li>
        <li class="Navigation">
            <a class="Nav_Text">Item 4</a>
            <ul class="sub-menu">
                <li class="Sub_Navigation"><a href"" class="Sub_Nav_Text">Sub Item1</a></li>
                <li class="Sub_Navigation"><a href"" class="Sub_Nav_Text">Sub Item2</a></li>
            </ul>
        </li>
    </ul>
</div>

Here is what I have for the CSS

.submenu
{
    display: none;
}

#Nav ul li:hover > ul
{
    display: block;
    position: absolute;
    /*The rest of the code is just for looks and doesn't effect the position*/
}

The issue that I'm having is that the drop-down menu is not showing up underneath Item 4, but instead at the far left of the screen. Can anyone help me with positioning the drop-down menu underneath Item 4? And not by setting a margin. I tried that, and when the screen resized, the drop-down menu was off alignment.

Thank you ahead of time.




hosting rails app best choice between VPS or AWS

What's the best choice between VPS (1 vps for mysql DB and 1 vps for rails app) and AWS.

  • Price
  • Performance
  • Availability
  • Backup and restore

knowing that I am a beginner with AWS. thank your for your advice.




How do you select an item when I have created a drop down menu on Dreamweaver?

I've created a web page and I am currently creating a contact form. I've added a drop down menu however, when I click on one of the buttons in the drop down menu, it doesn't select it.

If anyone could help me it would be great.

Thanks :)




Is ALLOWED_HOSTS needed on Heroku?

From what I understand, ALLOWED_HOSTS does a check when DEBUG=False to prevent an attacker from pointing their own domain to your site.

It looks like Heroku's Custom Domains do the same thing.

So instead of adding a required ALLOWED_HOSTS variable in your app.json for the Heroku Button (since it feels redundant and is error-prone when you're in a hurry), can you set ALLOWED_HOSTS = ['*'] and allow Heroku to verify the requests are coming where they should instead?




What should I learn if I want to develop single page application that reloads without refresh new data from database?

There are a lot choices out there, and I'm thinking about learning angular.js because it seems to have a lot of tutorials and learning material.

For someone like me who is not a coder and just started dabbling in this stuff, can you please tell me how to proceed? Any tips/wisdom would be appreciated.

Thanks

please don't downvote. I am honestly trying to learn




HTML/JavaScript: User is able to add option to dropdown list by typing it in a text box

Is there any HTML/JavaScript code that can allow the viewer of a webpage to add a option to a dropdown select list by typing it in a text box???




How i can access an image with a random name from the name of the folder?

I have a folder with one file and i need access to it using only the Folder name. This is basically the struct:

  • Folder
    • File.ext (Random name)

For example: When i go to "http://ift.tt/1fEnqH8" i need to redirect me to "http://ift.tt/1fEnt5H".

I tried with ".htaccess" but not achieved what I need:

 RewriteEngine On
 RewriteBase /
 RewriteRule ^/Folder/$ /Folder/*.ext

Exists some regular expression to solve this problem with htaccess? or some other solution to this problem?

Aclaration: the folder only contains one file, and this file have a random name.




Hit Counter in Codeigniter

I have the code below this:

(Step by step) 1. Put counter.txt in APPPATH . 'logs/counter.txt' 2. Make counter_helper.php set in APPPATH . 'helpers/counter_helper.php'; 3. Autoload newly created helper in APPPATH . 'config/autoload.php' file; 4. Make MY_Controller.php in APPPATH . 'core/MY_Controller.php' 5. Any controller should extend MY_Controller instead of CI_Controller; 6. Echo it on page with: count_visitor;?>

The Helper :

<?php defined('BASEPATH') OR exit('No direct script access allowed.');

if ( ! function_exists('count_visitor')) {
    function count_visitor()
    {
        $filecounter=(APPPATH . 'logs/counter.txt');
        $kunjungan=file($filecounter);
        $kunjungan[0]++;
        $file=fopen($filecounter, 'w');
        fputs($file, $kunjungan[0]);
        fclose($file);
        return $kunjungan[0];
    }
}

The Core :

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller
{
    public $count_visitor;

    public function __construct()
    {
        parent::__construct();
        $this->count_visitor = count_visitor();
    }   
}

/* End of file MY_Controller.php */
/* Location: ./application/core/MY_Controller.php */

The Controller :

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends MY_Controller {
 public function index() {
 $data=array('isi'      =>'home/index_home');
 $this->load->view('layout/wrapper',$data); 
 }
}

The View :

<?php echo $this->count_visitor;?>

But there is something error in thats code. The error is like : enter image description here




Basic Authentication or alternative?

I'd like to make a website where each authenticated user has readonly access to one folder stored on the webserver. Is there a way to do this without BasicAuth on a Apache Webserver because Basic Auth looks bad (no styling with css, no html :[).

Do I get something wrong? Thanks for any hints or links :)




Website Vs Webapp

We have static and dynamic websites. Then again, we have web apps. It is said that dynamic web sites are simply informational, thought the contents are changing, they are just informational and do not provide much of user interactivity. However, web apps provide user interaction more, they say. So, does a simple search functionality or login functionality make a website get consideration as a webapp?

Also, suppose we use already available widgets in our site. Does it make our site a web app?

Also, what are the following: websites or web apps? and why?

  1. An otherwise static restaurant site that has a Google Maps widget on it, allowing users to input their own address to get directions to the store.

  2. A self-made website, built without any programming knowledge on the part of the creator, but that uses third party widgets to interact with users (a website created in WordPress, for example).

  3. A completely static web page with zero user interaction, which is built dynamically from runtime compiled back end code, NOT simply static HTML.

  4. Google: https://www.google.com/. One of the simplest, yet most powerful, web pages in the world.

  5. A news magazine web page with no particular user interactivity, but that hides most of their content behind a pay wall requiring subscribers to log in to read it.




What kind of frameworks do sites like amazon, facebook, etc. use to show "dynamic" content?

I am learning about bootstrap. I'm wondering about sites like amazon, facebook, etc. What kind of frameworks do they use to build their sites?

Sorry if this is a very stupid question..




how to make the background image fit to the screen html

I'm trying to make by background image fit to the scree, but i'm not sure what to add to my code. This is the code that I have for my background:

If anyone could suggest what to put and where that would be great! thanks!!! :-)




PHP vs Ruby vs Perl vs Python [on hold]

I am about to create a website with a backend service and I am wondering about which language or framework to chose. I need a language that I can learn (by books or videos) and that I can use in later on in my projects. Here are the 4 candidates: Thanks!

  • Python

  • Ruby

  • PHP

  • Perl

- More Candidates

  • JavaScript Only

  • Scala

  • Java

  • Go

  • Hack

  • Dart




Chaning Wordpress Website into a LAMP managed site

We are currently running a site for an organization using Wordpress. All I have seen of it is a management GUI and then the result which is clunky and not well maintained.

We want the website to be revamped to mostly focus on events and be mobile friendly. My thought was to just have a list of upcoming events and clicking/tapping each one goes to a page with all of the details.

I figured this would be easily achieved by using a database table with the events and then query it based on the current date and show the next say 10 events or so in a list of buttons.

My question is what needs to be done to get off of wordpress and then use this URL for a LAMP stack set up on location.




PHP + ADODB do nonthink

Hi everyone i try write page with PHP and ADODB db-engine is mysql. I want to add to mysql new record and show table. Someone knows what is wrong with that code?

index.php

    <?php 
    require('./engine.php');
    $lz = new zakupy;
    $lz->pokaz();
    ?>

engine.php

 <?php 
include('adodb/adodb.inc.php');

class zakupy {

    function __construct($dbuser,$dbpass,$dbname,$dbhost)
        { 
            $db = ADONewConnection('mysql');
            $db->debug = true;
            $this-> $db->Connect($dbhost,$dbuser,$dbpass,$dbname);
        }

    function dodaj($name)
        {
            $rs = $db->Execute('insert into zakupy values(null,\''.$name.'\',\'N\');');
        }

    function pokaz(): void
    {
        $rs = $db->Execute('select * from zakupy');
        print "<pre>";
        print_r($rs->GetRows());
        print "</pre>";
    }
    }

?>




Centering the Of A Navigation Bar

This is how the navigation bar of a website I'm currently working on appears i.e to the left:

enter image description here

I would however like to shift the navigation bar to the right of the screen such that 'Editorial' is against the right border of the screen. What changes would I have to make to the following CSS/HTML code of the same?

CSS Code Of Navigation Bar

.navbar-inverse {
  background-color: transparent;
}
.navbar-inverse .navbar-nav>.active>a:hover,
.navbar-inverse .navbar-nav>li>a:hover,
.navbar-inverse .navbar-nav>li>a:focus {
  background-color: #FF0346;
}
.navbar-inverse .navbar-nav>.active>a,
.navbar-inverse .navbar-nav>.open>a,
.navbar-inverse .navbar-nav>.open>a,
.navbar-inverse .navbar-nav>.open>a:hover,
.navbar-inverse .navbar-nav>.open>a,
.navbar-inverse .navbar-nav>.open>a:hover,
.navbar-inverse .navbar-nav>.open>a:focus {
  background-color: #FF0346;
}
.dropdown-menu {
  background-color: #FFFFFF
}
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
  background-color: #FF0346
}
.navbar-inverse {
  background-image: none;
}
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
  background-image: none;
}
.navbar-inverse {
  border-color: transparent;
}
.navbar-inverse .navbar-brand {
  color: #A6A6A6
}
.navbar-inverse .navbar-brand:hover {
  color: #0D0D0D
}
.navbar-inverse .navbar-nav>li>a {
  color: #000000;
}
.navbar-inverse .navbar-nav>li>a:hover,
.navbar-inverse .navbar-nav>li>a:focus {
  color: #FFFFFF;
}
.navbar-inverse .navbar-nav>.active>a,
.navbar-inverse .navbar-nav>.open>a,
.navbar-inverse .navbar-nav>.open>a:hover,
.navbar-inverse .navbar-nav>.open>a:focus {
  color: #FFFFFF;
}
.navbar-inverse .navbar-nav>.active>a:hover,
.navbar-inverse .navbar-nav>.active>a:focus {
  color: #FFFFFF
}
.dropdown-menu>li>a {
  color: #333333
}
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
  color: #FFFFFF
}
.navbar-inverse .navbar-nav>.dropdown>a .caret {
  border-top-color: #999999
}
.navbar-inverse .navbar-nav>.dropdown>a:hover .caret {
  border-top-color: #FFFFFF
}
.navbar-inverse .navbar-nav>.dropdown>a .caret {
  border-bottom-color: #999999
}
.navbar-inverse .navbar-nav>.dropdown>a:hover .caret {
  border-bottom-color: #FFFFFF
}

<!-- begin snippet: js hide: false -->
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
  <div class="container">
    <div class="navbar-header" float>
      <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="index.php" class="navbar-brand"><img src='dummylogo.png' width="100" height="100" alt="HEG Logo"></a>
    </div>
    <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
      <ul class="nav navbar-nav">
        <li>
          <a href="index.php">Home</a>
        </li>
                                
        <li>
          <a href="gameprojects.php">Game Projects</a>
        </li>
        <li  >
          <a href="hardware.php">Hardware</a>
        </li>
        <li>
          <a href="wvm.php">Written & Visual</a>
        </li>
<li class="active">
          <a href="twitchcorner.php">Twitch Corner</a>
        </li>
<li>
          <a href="Community.php">Community</a>
        </li>
<li>
        <a href="editorial.php">Editorial</a>
        </li>
      </ul>
    </nav>
  </div>
</header>



How to make your own cloud ? (Not with OwnCloud) [on hold]

I'm very new to web development, yet I have a lot of html/css/php experience. So basically I want to create my own cloud, where a user should be able to authenticate, upload and download files. This is very basic, but I would like to do it myself in order to learn something :) I don't want to use OwnCloud or something similar.

Things I have:

  • A local apache webserver running on a windows 8 64-bit system with php and mysql

  • A mysql database to store the blowfish-hashed credentials

  • another database to store hashed user sessionIDs, used as access tokens (not sure if this is safe)
  • A php login/logout system that authenticates the user with his sessionID

Things i want:

  • When logged in the user should have access to a certain folder on my webserver (so basically if he enters the url of a pdf.file in this folder, only he can view it, everybody else should be redirected to another "Access denied" html page)
  • he also should be able to see a overview of the files in this folder
  • uploading should be possible via ftp or the webbrowser directly (this would be epic :)
  • downloading is not so important, since there are only pdf files, that can be opened or downloaded easily
  • security is very important for me (I just don't know anything here except the basics)
  • I also don't want to use Basic Authentication because here I'm not able to style and customize anything

If there is already a article out and I'm sure there is please just post the link because I was to stupid to find it until now... Im glad there is StackOverflow, Thanks in advance ;




What are tools required for design the website.?

I am new to web design, i need some information about web design when i create the web design what are tools is required is there any server to install the for web design. Already i have knowledge on HTML,CSS and java script. Can you please any one give me suggestion i would like to design the website. Thanks in advance




Extract request information without using Servlets

I have an assignment that requires me to simulate a system that runs a web proxy and creates logs of requests containing information such as host, path, query etc. I believe I can accomplish the task using Java Servlets, but I was wondering if this can be achieved without Servlets. I appreciate any kind of advice regarding this matter. To clarify, I am not looking for a written code - I am seeking someone who can point me in the right direction.

Thanks.




Login form in same url as web application

On my server I have two folders. One is for login system (login, registration, forget password etc.) and second is for web application that i am developing. Both folders have index.php. I want that when the user visit my site (mydomain.com), he must logged in to be allowed to use the application. I need to stay on url mydomain.com. Not mydomian.com/app.

I was thinking about moving the applications files in the www/ folder and load the login form with iframe, but in my opinion it is not the right solution.

For example, Instagram.com has exactly what I want. You must login to see photos, but you stays on the instagram.com




Deactivating or Deleting accounts on a web service

I am building a web service where the user registers and then can have access to this service.

During his/her time using the service, the user collects some points according to his/her actions (similar to what Stackoverflow does).

Question 1: Do we need to offer both DEACTIVATION and DELETE account?

Question 2: In case of DEACTIVATION should i offer an option to re-activate their previous account [with all points gathered so far]? Meaning all their previous data are kept in the database, just change some flags? Is there a best practice for this?

Question 3: In case of DELETE account, how do i proceed? Do i delete all database data regading that user? What if a user wants to delete his/her account because he/she gathered a lot of negative points and wants to re-register with the same email just with no negative points?

Question 4: Do other services (like Facebook or Google+) delete any data from their databases even if the user wants to delete his/her account? Are there any legal issues?

Thanks!




lundi 27 juillet 2015

Open source livestock management and central register software

I am looking for open source solution for central web based livestock management system please suggest some similar solutions that I can modify further for myself. It can be software used for similar purposes and be written in any language. Please any suggestions? Thanks a lot




Front-end design: Dynamically add items to list

So, I've tried several times to thrust myself into the world of website development. Each time, I have abandoned a project for one simple reason: lists.

I would like to know, from front to back, the dataflow for a system which follows the following sequence of events:

  1. The user is shown a list in a website
  2. The user fills out a new list item in some sort of modal dialog
  3. The user hits "Submit" and that item is now added to the list.
    • That new list item is sent to the server to be stored

Would there be a whole new page load? When would the data be posted to the server? What are the various options for this (seemingly simple) application? I am targeting relatively small web tools. Not necessarily single page, but I'm not against it.

I understand how to add the new <li> to a list with JQuery, and I know how to build the modal with HTML. I can pull the data from the modal, but I'm not sure how to take that data from JQuery, turn it into the appropriate block of HTML (which could be rather complex), and store the new record in the database. I can't seem to find a tutorial on this sort of data handling.

Thank you!