mardi 30 juin 2015

Distorted screen on android native browser

I have tested my website on every browser, everything was well except native android browser, the width of the screen was doubled, and it was divided to two parts, you can visit the website: ar.alphatomega.com

Thank you




Getiing top 1000 instragrammers

Is there some url/website that gives top 1000 instragrammers >What i could find is the site http://insta.me/ .This gives only top 100 instagrammers. Instagram API also does not have any endpoint for this .




Recommendations for colored ordered lists in HTML emails (bullets different than list items)

I am writing an HTML email and I have considered a few options. The ordered list has green bullets but black text. I have considered:

  1. Creating two columns, one smaller column to house the green bullets, and the other the line items. The issue with this is inevitably when tested on all email clients one client distorts where the items appear and thus, they do not line up.

other option

  1. Using images of green dots and placing them next to the line items. I have tried to use list-style-type and list-style-image but they both are not recognized across all email clients. I have also attempted to put them in a separate column.

Does anyone have any recommendations as to the best way to achieve this, but also achieve uniformity across mail clients? It seems accomplishing uniformity across email clients is nearly impossible.

p.s. DOES ANYONE KNOW WHY IN OUTLOOK 2010 it responds to PADDING and in 2013 it responds to margin!? God!!!




Chrome download bar causing view port to shrink and doesn't properly resize to normal when download bar is closed

Hello everyone and thank you in advance for any help you can provide. I have a web page that does a simple file download via a link. In Chrome this causes the download bar to appear on the bottom of the browser. However, when closing the download bar using the X on the right there is just white space left in the place where the download bar was displayed and the web page does not return to it's normal display. Has anyone run into this before, and if so were you able to resolve it? Thanks again everyone.




Which language would you suggest to build web application? What is the fastest language to pick up and master?

As a complete noob, which language would you suggest to build web application? I only know a little of ASP.NET( build a small website connecting to database). What is the fastest language to pick up and master?




How to implement filters for web

Basically I have a list of credit cards and a bunch of category ids. What i want to do is by clicking on certain category button, only matching cards show up. Any thoughts on the implementation? The web uses Haml, CoffeeScript and Ember.js and Ruby & Padrino in the backend. Thank you in advance!




how to start building and designing a web application

i have a little knowledge with designing web application and i'm confused where i should start ! just to explain where i'm lost in. i'm planning to build a website that have tow type of users they can register ,let's name them A and B . A can register and upload his location using GPS and B can use GPS to search for the closest A to them , also B can post photos , comments etc ..

i just give a general idea about the website and i want to make it using ASP.NET and C# . also the database should be in MySql .and i want to make a mobile app version in the future for the same DB. but now i'm confused about should i build everything by myself ? like designing the DB using Mysql SW and design the web interfaces using Visual Studio for ASP.NET and C# . then connect them togather and host my domain in arvixe.com and upload everything there ??

or i can desgin my DB and interfaces in my arvixe.com account ? excuse my english but i want a general guidelines what should i do ? what the easiest and efficient way to build this kind of web application?




Web Browser Turbo C++

So I was browsing the Internet for a project and stumbled upon this piece of code. It runs perfectly until the point you enter a website(include "www" :P) and press Enter and then boom! The program terminates, no error message, nothing.

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <graphics.h>
#include <dos.h>
#include <string.h>

void initialize_graphics_mode();
int get_key();
void draw();

union REGS i, o;

main()
{
  int key, i = 0, xpos, ypos, button;
  char arr[200], temp[5], *ptr;
  char a[] = "C:\\Progra~1\\Mozill~1\\firefox ";

  strcpy(arr,a);

  i = strlen(a);

  initialize_graphics_mode();

  draw();

  while(1)
  {
    if(kbhit())
      key = get_key();

    if((key>=97&&key<=122)||(key>=65&&key<=90)||key==46||key==47||key==63)
    {
      arr[i] = key;
      sprintf(temp,"%c",arr[i]);
      outtext(temp);
      if(getx()>470)
      {
    clearviewport();
    moveto(5,2);
      }
      i++;
    }
    else if ( key == 13 )
    {
      arr[i] = '\0';
      system(arr);
      break;
    }
    else if ( key == 27 )
    {
      closegraph();
      exit(EXIT_SUCCESS);
    }
    if(button==1&&xpos>=150&&xpos<=480&&ypos>=300&&ypos<=330)
    {
      system("C:\\Progra~1\\Mozill~1\\firefox programmingsimplified.com");
      break;
    }
    key = -1;
  }

  closegraph();
  return 0;
}

void initialize_graphics_mode()
{
  int gd = DETECT, gm, errorcode;

  initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
  errorcode = graphresult();

  if( errorcode != grOk )
  {
    printf("Graphics error : %s\n",grapherrormsg(errorcode));

    printf("Press any key to exit...\n");
    getch();
    exit(EXIT_FAILURE);
  }
}

int get_key()
{
  i.h.ah = 0;
  int86(22,&i,&o);

  return( o.h.al );
}

void draw()
{
  settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  outtextxy(275,11,"Web Browser");
  outtextxy(155,451,"<a> href=http://ift.tt/18KHKlF"">http://ift.tt/1g8cqCe;");
  outtextxy(5,105,"Enter URL : ");
  rectangle(120,100,600,130);
  setviewport(121,101,599,129,1);
  moveto(5,1);
}

Could someone help me in understanding why this happens? and possibly a fix for this?

NOTE: + It is supposed to work if you have Mozilla Firefox. If you have any other browser, please edit the code accordingly.

  • I am running this on Turbo C++, what would I have to do in order to convert this code for Dev-C++?

Thanks in advance.

P.S: I'm new to C++ so elaborate as much as possible.




CentOS Web Panel DNS & IP Errors

I installed the CentOS 6.6 and CWP on my second laptop, I think it is erroneous DNS information..

NS1: ns1.centos-webpanel.com | IP:185.4.149.83 [Change]
NS2: ns2.centos-webpanel.com | IP:185.4.149.90 [Change]
Server IP: 192.168.1.158 | 192.168.1.158  
Shared IP: 94.123.179.83 [Change]
Hostname: es-svr-264-cl.local [Change]
Yours IP: 192.168.1.163
CWP version: 0.9.8.6

Server IP: supposed to be public IP How can i resolve this error? Thank you (I do not use a static IP)




Why are web protocols designed to have :// suffix?

This is a really random shower thought

What is the significances if :// in a web protocol? e.g ftp:// or http://

Is there a reason in the design pattern? why isn't it just http: or a http. or something like http~

Any reference to the documentation of this would be appreciated :)




How to make your 3D model have onclick events and display it on your website?

So i am trying to make my human body 3D model to rotate and have onclick events and use that on my website? It should look similar to this: http://ift.tt/1IKKpYf




how to submit checklist in Django with GET

Hi I have on my html file this, tags and tagInfos are both queryset´s of Django, that 2 for´s are only to show wich one belongs to the other:

<form action="/chart/chart/" method="get">
    {% if tags.count > 0 %}                     
        {% for tag in tags %}
            {% for tagInfo in tagInfos %}
                {% if tag.taginfo_idtaginfo1_id == tagInfo.idtaginfo %}
                    <!--
                    <div>
                        <h3><a href = "/tags/get/{{ tag.idtag }}/"> {{ tagInfo.nome}} </a></h3>
                        Datasource: {{ tag.datasource_idestacao_meteo }}            
                    </div>
                    -->         
                    <p>
                        <input type="checkbox" name="checks[]" value="{{ tag.idtag }}" />
                        <a href = "/tags/get/{{ tag.idtag }}/"> {{ tagInfo.nome}} </a>
                        Datasource: {{ tag.datasource_idestacao_meteo }}
                    </p>

                {% endif %}
            {% endfor %}
        {% endfor %}

        <!--To submit the chart creation-->         
            {% csrf_token %}            
            <button type="submit" class="btn btn-primary">Submit creation</button>          
    {% else %}
        <p>None TAG to select.</p>      
    {% endif %}
    </form>

So and on my view i try to do that:

def chart(request):
if 'checks' in request.GET and request.GET['checks']:
    chosen = request.GET.getlist('checks')
    return render_to_response('Chart/chart.html',
            {
            'chosen' : chosen,              
            }
        )
else: 
    return render_to_response('Chart/chart.html',
            {

            }
        )

But don´t show any of the selected checkboxes on the other html, I´m using {{ chosen }} to show.

Any ideas of what I´m doing wrong?




Display an alert visible if the user is using the web or not.

i'm new at programming and im looking for a way to display an alert whenever the user is in the web or not. i've tried with alert() using a timer to test it, but the alert only displays in the tab and not over every application running in the desktop.

If there's a solution in other languages i'm open to try them. thanks.




how to create a decorator proxy page in asp.net 3.5

I am trying to make this feature, and I'm really stuck.

I have two applications that run on the same domain. and I need to have one application load pages from the other one inside it's own (the first) master page.

I have full control of the code of both sides, of course.

I have tries using HTTPRequest, and HTTPResponse, and I have tried using WebBrowser. Both work great as long as I have static(plain HTML) pages. However, those pages are actually dynamic. the user need to press server-side buttons (postback) and generally use the session, viewstate, and/or cookies.

because of that, HTTPRequest and WebBrowser fail me, as they do not cause postback, and therefore those server-side controls are not working. more so, if I try to "fake" a postback by saving the ViewState after each response and than resend it on the next request, after a few (3-4) times the original page will return a "The state information is invalid for this page and might be corrupted" error, even if I use

EnableViewStateMac ="false" EnableSessionState="True" EnableEventValidation ="false" ValidateRequest ="false" ViewStateEncryptionMode ="Never

So... any ideas how can I solve this issue?

Thanks in advance




Concurrent AJAX requests not working. Newest request overwrites previous request

My webpage features a table where each row has a "+" button so that a mini table appears. The mini table houses data from a super slow database so I am having the data come in through ajax requests. My problem is rooted in a certain situation. Suppose you pressed a plus button causing an AJAX request and while waiting you press another plus button. The second ajax request causes the first request to never come back. In other words the newest request overwrites all previous pending requests. Any idea why this might be happening? I feel like this might just be what happens when you don't use jQuery to handle AJAX but I am not sure and I couldn't find anything that said that was the case. I am appending my code below. Any help is appreciated!

function fetchSINamesForVariantAJAX(latestBuild, variantToExpand){
if (latestBuild ==  "") {
    //document.getElementById(subTableId).innerHTML = ""; 
    return;
} 
else { 
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp = new XMLHttpRequest();
    } else {
        // code for IE6, IE5
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            spinner.stop();
            var variantRow = variantToExpand + "Row";
            if (document.getElementById(variantRow).rows.length == 1){
                var json = JSON.parse(xmlhttp.responseText);
                var SINames = json['SIs'];
                var locations = json['locations'];
                var SIBuilds = json['SIBuilds'];
                for (var i = 0; i < SINames.length ; i++){
                    var row = document.getElementById(variantRow).insertRow(-1);
                    var cell = row.insertCell(-1);
                    var SILinkURL = "http://ift.tt/1HsBGNQ" + SINames[i];
                    cell.innerHTML = "<a href=\"" + SILinkURL + "\">" + SINames[i] + "</a>";

                    cell = row.insertCell(-1);
                    var fullLocation = locations[i] + "\\" + SIBuilds[i];
                    cell.innerHTML = "<a href=\"" + fullLocation + "\">" + fullLocation + "</a>";

                    cell = row.insertCell(-1);
                    cell.innerHTML = "";
                }
            }
        }
    }
    //create the GET message to be sent using AJAX window
    var stateToSend = "SITableGeneratorFromVariant.php?";
    stateToSend += "latestBuild=" + latestBuild;    
    xmlhttp.open("GET", stateToSend, true);
    xmlhttp.send();
}

}




Premature end of script headers for unknown reason

Whenever I call the cgi script below by submitting a form to it I get an internal server error and the server log shows the line: Premature end of script headers: LoopFinderRetrieval.cgi, referer: http://ift.tt/1eY3f7g

In short, the cgi file is meant to go to the folder indicated by a run-ID, given at the time of submission, open and read a file called JobStatus.txt, and then perform an action based on the result. This can either be returning a specific error to the user, or giving them their results. As I understand it, the error I'm seeing would be caused if I was, for example omitting the line:

"Content-type:text/html\r\n\r\n"

but the line is present, and another CGI script using the exact same PrintHeader() and PrintFooter() functions on the same server is running without error. Can anybody see any clear errors that might be causing this? If not, what I've read indicates that this might be a permissions issue. In that case I'll have to contact the administrators and have it fixed, but I don't want to do that unless I know it's the problem. Thanks.

#!/usr/bin/python2.6

# Import modules for CGI handling 
import cgi, cgitb
import os 
cgitb.enable()

#Functions to automatically print HTML headers and footers.
def PrintHeader():
    print "Content-type:text/html\r\n\r\n"
    print "<html>"
    print "<head>"
    print "<title>LoopFinder Running</title>"
    print "</head>"
    print "<body>"
def PrintFooter():
    print "</body>"
    print "</html>"

# Create instance of FieldStorage 
form = cgi.FieldStorage() 
ID_Number = form.getvalue('IDNum')

with open('/loopfinder_data/RunData/%s/JobStatus.txt' % ID_Number, 'r') as pre_textfile:
    textfile = pre_textfile.read()
    if textfile[0] == 'Running':
        PrintHeader()
        print '<h2>Your run is not complete. Please check back later.</h2>'
        PrintFooter()
    if textfile[0] == 'Stopped':
        PDBID = textfile[3]
        if textfile[1] == 'PDBError':
            PrintHeader()
            print '<h2>We were unable to download the PBDID you entered, which was %s</h2>' % PDBID
            print '<h2>Please check that this PDBID exists before trying again.</h2>'
            PrintFooter()
        elif textfile[1] == 'ChainCountError':
            PrintHeader()
            print '<h2>We were unable to either download or open the PBDID you entered, which was %s</h2>' % PDBID
            print '<h2>Please check that this PDBID exists before trying again.</h2>'
            PrintFooter()       
        elif textfile[1] == 'SingleChainError':
            PrintHeader()
            print '<h2>It appears that your PDB structure of interest contains only one chain.</h2>'
            print '<h2>LoopFinder requires a multi-chain interface from which to calculate energy values.</h2>'
            PrintFooter()
        elif textfile[1] == 'LoopFinderError':
            PrintHeader()
            print '<h2>LoopFinder experienced an unknown error while analyzing your PDB file.</h2>'
            print '<h2>Leave a comment including your run ID and we will try to solve this issue.</h2>'
            PrintFooter()   
        elif textfile[1] == 'PyRosettaError':
            PrintHeader()
            print '<h2>PyRosetta experienced an unknown error while analyzing your PDB file.</h2>'
            print '<h2>Leave a comment including your run ID and we will try to solve this issue.</h2>'
            PrintFooter()                   
    if textfile[0] == 'Completed':
        PrintHeader()
        print '<a href="http://<url_redacted>/loopfinder_data/RunData/%s/results/%s_Results.zip">\
Click here to download your results.</a>' % (ID_Number,ID_Number)
        PrintFooter()




Social Sharing on Static Website not pointing accurately

I'm working on a site that doesn't seem to share the image url, but points to the main "index" page instead when shared. Any suggestions on how to share the actual image? Link is http://ift.tt/1HsgJmn Click the menu in the upper right and click on photos. There you'll see me problem once you try to share. Appreciate any recommendations. : )




Inserting an image on a website

I'm fairly new in the world of programming. I've been struggling to insert an image to a website. The website is hosted on Axxess, I have already uploaded the image in cPanel. Now, how do I insert it to the website without the HTML code. How do I do that without editing the HTML code?




Okhttp asking to approve connection via dialog box want to make silent

I am using latest okhttp and when using at home it connects just fine. Inside a company it displays dialog box for approval to connect to a server. I do not want the user to see that dialog box just connect silently like it does for me at home. How do I get it to do that? I used httpclient from Apache and it does not do that. I wrote my own code to determine proxy and added that to Apache client code and it does not ask for connection approval.

Thanks for the help, -Tony




Failed to load resource: Request timed out on Safari

We have a web application working correctly for over a year now on most browsers. Recently we discovered it is not working that well on Safari.

A lot of actions end up with the following error : Failed to load resource: Request timed out. Funny thing is the action is actually performed correctly after that (most of the time).

When looking into the error, it seems to happen when there is an ajax request.

First I tried to change the ajax timeout setting by doing the following :

 $.ajax({
      "type"      : methode,
      "dataType"  : "json",
      "url"       : url,
      "async"     : async,
      "data"      : donneesEnvoyees,
      "timeout"   : 60000
 })

That didn't change anything at all, error is actually showing up after about 10 seconds which is less than the timeout defined.

After reading a bit on the internet, I saw some answer about specifying no-cache so that safari doesn't keep the post parameters in cache. I cannot say I fully understand that, but I still tried the following way :

$.ajax({
     "type"      : methode,
     "headers"   : { "cache-control": "no-cache" }, <-- added this line
     "dataType"  : "json",
     "url"       : url,
     "async"     : async,
     "data"      : donneesEnvoyees,
     "timeout"   : 60000
 })

As you can guess, I still get the same error.

Do you have any idea of what is happening? Why is this error happening only on Safari and not other browsers? How to fix it?




What client data should I capture in my webapi from client requests?

Mid-level .net developer here but noob when it comes to public facing (potentially high-traffic) websites.

Doing a little research I noticed a lot of public/high-traffic websites like facebook or even stackoverflow will store ~10 (sometimes more) cookies and I can only imagine these are used for tracking my usage, but I don't know this for sure.

Can anybody tell me or point me to a guide for what data I should be capturing from each client interaction with my api outside of the intended post/put body data? What the significance of said data would be?

And also if anyone knows why so many different cookies? Is there a certain design pattern being followed to only save certain type of data in certain cookies, etc.




How to implement breadcrumbs in PHP?

The graphical control element Breadcrumbs or breadcrumb trail is a navigation aid used in user interfaces.




Treeview contextmenu and modal popup in asp.net web form

I want to open contextmenu on right click of Treeview node(Treeview is getting populated dynamically) and on clicking one of the contextmenu item i want to display modal popup.




create task in icescrum through Java

I am using IceScrum as project tracking tool. I have already installed this on my local instance. Now I would like to configure this to create Tasks (Creation/Deletion/Updateion) through Java using Web Service. Any help Greatly appreciated.

I got the following solution while I am doing R&D to achieve this.

curl -H "Content-Type: application/xml" -u user:password -k --request POST --verbose http://xxxxxxxx/icescrum/ws/p/PKEY/task -d "CLAIM TASK"

But I don't know how to start.

And Please let me know whether Mylyn integration is possible or not.




HTML/CSS float left automatically fill white space

I have created a dash board that connects to sql to get status of a job. each collection of jobs is shown in a Div that is set to float left. if everything is good it looks like below:

enter image description here

when there is an error the div that contains the job automatically expands to show the job and it then looks like:

enter image description here

i was wondering if there is a way for the other divs to adjust and move into the white space? im guessing this wont be possible using just HTML and CSS so i am willing to use jquery if anyone knows of any add ins that can easily do this!

Thanks!




Fixing table header on webpage

I would like to know how to fix a table header even if we scroll down on a website and out of the table view. I would like to use css style to do this. Thank you.

I would also like to know how to fix an element on a webpage so it always appears even when we scroll down. The image can be text. Use div and css




addThis is not working for 2 products

I'm trying to use addThis plugin for facebook likes, tweet and g+ against my products on webpage. Now I have a page where we show 2 products and I want to give fb like button for each. What I am showing but it doesn't work.

How will I tell addThis plugin, 2 different products. It is taking same product for both of tweets.

if($(".share-list").length > 0 ){
                                        var addthis_share = {
                                            url_transforms : {
                                                 shorten: {
                                                      twitter: 'bitly'
                                                    }
                                                 }, 
                                                shorteners : {
                                                    bitly : {} 
                                                 }
                                        };          
                                        var addthis_config = {"data_track_addressbar":false, ui_use_css : false};   
                                        var addthisScript = document.createElement('script');
                                        console.log('src');
                                        addthisScript.setAttribute('src', 'http://ift.tt/1KmMBcP')
                                        document.body.appendChild(addthisScript)
                                    }

It's not even working, when I click on facebook button nothing happens.




What is a tbar(meaning)

I am Stackoverflow's admin's relative. Do feel glad to help me. Please explain to me which language it belongs to and is it a piece of code and how to find it and how to edit it and more. Thanks a lot.




Web Socket Protocal Fully Duplex channel maintainance

I am trying to use web socket protocall in my chat application. In order to do so, I am exploring this protocall and have found that it maintains a fuly duplex channel between the client and the server. Can anyone please explain how this fuly duplex channel is maintained in web socket protocall. Thanks.




Yes or no, do you as a programmer think you will hit it big and become a billionaire? [on hold]

That's something I would like to know.




Hosted Web Fonts

Very quick question, I have a client that insisted in using his own font that he bought somewhere. Everything would be good and cheerful but the font isnt hosted anywhere. Not Typekit, Google Fonts or any other service that I know of.

My question is, do you know a service where you could upload your own font? Something like typekit or Google Fonts but you'd be able to upload the font yourself?

P.s I have all licences etc.

I could embed the font using @font-face but the file size is 1.2mb




Why displaying different page instead of set as startup page in asp.net

I started to work in a new project developed in asp.net. In this application authencation used is forms authentication and session timeout is 10 min. Also IIS used is IIS expression for development purpose.

Issue is that even if I set login.aspx as the startup page for the first time it goes always first to pagenotfound.aspx page. But in 2nd attempte it display this page correctly. Also if I click on any other page even 2 minutes keeping system idle it again display pagenotfound.aspx page but in 2nd attempt display page correctly. pagenotfound is the page which is created to display if user do any invalid request but unable to find the reason while it always goes to that page instead of startup or requested page




Sending SMS via Java web applications

Have you seen how some companies send SMS in order to send access code etc? I am also in need of something like that. I have Java web application developed using JSP and Servlet. Through this application, I need to send SMS messages to some selected people.

I am open for free or paid APIs. But that API should support web based apps and should have the capability to send messages to Sri Lanka.

I went through lot of stuff like SMS Lib etc, but they are not built for web applications.

Any ideas?




Random .asp file generated within the web server?

I have a static html website and few pages that use php like forms. On the front end, the website looks fine, however when I try to login through ftp and noticed there are around 189600 files that end with .asp extension being generated within the server.

The file names are all like these:

   aada-oakley-047495.asp
   Aadcaj-puma-22256.asp
   AAeEc-furniture-s1-94186
   .......

Is this a sign of the website being hacked? Should I deleted all these files or leave it as it is?




lundi 29 juin 2015

Fixing table header on website

I have a table which looks like 2 tables as they are separated by sessions and the 2 sessions have their labels and headers with column names - I would like to let the table header be fixed so that I can continue to see the table header even though I scroll down on the webpage . I would like the 1st header which belongs to the 1st session of the table to be seen until the second header appears and I would like the second header which belongs to the second session of the table to show until the end of the second table is gone or until I reach the end of the site.

My site mostly uses javascript and php. I am just an amateur . Please help me. Thank you all.




How to click the element in span class? Selenium WebDriver

<span class="infor-social-showDetails message-action-menu">
<span class="message-action-menu-text infor-social-showDetailsText" data-inforprops="{"eventName":"GetDetails","UploadIdentifier":"","MsgId":"76","FeedSource":"4","MsgDate":"1433484223883","IONObjectType":"ION_ALERT"}">                     Show Details                 </span>
</span>

I tried the following xpath but it seems not to be working:

.//*[@id='76']/div/div[3]/span[1]/span

Please do help me.

I appreciate for all of those who will comments about this Thanks!




Habits in Web application development [on hold]

I am going to develop php web application. (1) Are there any habits to perform form validation? (2) Are there any habits to do the update of the records list with checkbox checked? e.g. I have the list of items in the table list with checkbox per item, after checked some items and click save button, it will get the checked items for processing. In the web search, suggests to use session assignment variables. How to do?? Is there any sample code??




THREE.PointLightHelper on THREE.js

What's up guys!

Does anyone know answer because this line:

<b> scene.add(new THREE.PointLightHelper(bluePoint, 3)); </b>

It does not work in my code, which is below:

 <b>var bluePoint = new THREE.PointLight(0x0033ff, 100, 500);
                bluePoint.position.set( 500, -500, 25 );
                scene.addLight(bluePoint);
                scene.add(new THREE.PointLightHelper(bluePoint, 3));</b>

I have added the libraries: Projector.js, CanvasRenderer.js, stats.min.js and three.min.js

But it does not work if I remove the line: scene.add(new THREE.PointLightHelper(bluePoint, 3));

My code works. What could it be? There's another way to increase the PointLight size in THREE.js without the THREE.PointLightHelper?




Forum Content Management System exactly like stackoverflow.com

I wish to build a forum to facilitate the discussion in my research field. And I am looking for some easy way out, like forum content management system which allow users to post/answer questions, but most importantly, let users rate the posts and answers, so good answers will ranked up and knowledge can be easier to find in my research field. That is to say I wish to build a stackoverflow.com for my specif research field. Do you know how can I do that quickly without writing too many codes myself? If there are similar content management system available that provide this function, that will be great! I just need some suggestions on this. Thanks very much indeed for your help.




How do use go lang as a web server

I have recently look into go lang and decided that it would be the best option to further improve the speed of the my website and handle more request. As php is not very efficient. In go lang i can write a script which runs multiple go lang webpage (it will host multiple page in a website). However all the page detial and code has to be in the one file.

My current code:

    package main

import (
    "fmt"
    "net/http"
    "strings"
    "log"
    "os"
    "strconv"
    "io"
)

func sayhelloName(w http.ResponseWriter, r *http.Request) {
    r.ParseForm()  // parse arguments, you have to call this by yourself
    fmt.Println(r.Form)  // print form information in server side
    fmt.Println("path", r.URL.Path)
    fmt.Println("scheme", r.URL.Scheme)
    fmt.Println(r.Form["url_long"])
    for k, v := range r.Form {
        fmt.Println("key:", k)
        fmt.Println("val:", strings.Join(v, ""))
    }
    fmt.Fprintf(w, "Hello User!") // send data to client side
}
func main() {
    http.HandleFunc("/hello", sayhelloName) // set router    
err := http.ListenAndServe(":900", nil) // set listen port
    if err != nil {
        log.Fatal("ListenAndServe: ", err)
    }
}

As you can see this script will host the page which is myip:900/hello and it will print hello. If i type myip:/hello/person it will say hello person ect.

However my script from the hello world page, (at the moment) has to also be in the same script as this.

Basically, i would like to have a go lang script which handles the request and send them to another script which will be run and provide a the page - if possible can you demonstrate exemplar code for both pages. Additionally is it possible for go to host some php page passing the url to the php manger fastcgi. So that I can switch over my server to go lang fast server - whilst i convert my php code into go lang code - however this is not vital (just useful).

Also would it be better to program a website in java or go lang. If java can you show an example code please.




How to run this node.js that is imported from github

As a curious noob, I saw this project at the Angelhack hackathon that seems quite interesting and I want to test it out. However, I tried installing node.js and running it(I may have done it incorrectly since I am not quite sure how to do it), but it doesn't work, I tried deploying it on a heroku server, and that didn't work either. Could someone give me some guidance as to how to run it on my computer?

Here is the link to the github repo: http://ift.tt/1QZZ0c9




Sending web requests with IFTT and the Maker Channel

So I am attempting to send a web request via the maker channel on If This then That to a Arduino (and Ethernet shield) to turn on a led. From what I understand, I would send a POST request to the boards url and it would set the led state to high. However I am fairly new to this kind of stuff and I really do not know where to go from there. What sort of text would I put in the Maker Channel body? I do know that its JSON. Also more importantly how would I configure the Arduino and web server to receive the POST request?




Including the results from another server

I've a web server that accepts input from the browser and returns computation results to the browser. I'd like to offload the computation part to another server. What is the best way to include results of computation in the web page?

One option is to use iframe in the generated HTML: <iframe src="http://ift.tt/1NqmvFV"></iframe> But this is clunky as the width of the frame remains fixed irrespective of the width of the browser window. The 'seamless' attribute doesn't do anything in Chrome & Firefox.

Another option is to make an http call to the computation server in the CGI script on the web server and include results in the web page. The downside of this is that the results can be large and there's an extra delay of transferring results from the computation server to the web server and then from the web server to the browser.

Is there another way to accomplish what I'm looking to do? I guess, in essence, what I'm looking for is something like this: At webserver.com, the form calls computationserver.com but that call is hidden from the user and the user sees only webserver.com URL in her browser.

Thanks for your help!




In jQuery, show alerts when user try to change tab or change windows

I want to make an exam page, and not let the user visiting other pages until he submits it.

It seems like onunload and onbeforeunload are for cases where the user explicitly close the page. I was wondering if there is a trigger for the event when the page lose focus.




Interactive Web 3D scatter plot (thousands of points)

I've been using APIs like Highcharts and Canvasxpress to generate 3D scatter plots. The problem is when I increase the amount of points (tens of thousands or more), I "lose" the ability to interact with the plot. By interact I mean zooming and rotating the canvas by dragging.

When I add too many points, the rotating process gets very very slow (in both Highcharts and Canvasxpress), which is annoying, cause most of the times I end up rotating too much. Plotting itself, even 200k or more points is actually fast, but once all points are plotted, I just can't interact properly.

My points are unevenly distributed. And most of them are overlaped depening on how much I zoom. What I want is some workaround, even if it would involve grouping my data. If there's was sollution involving the APIs (allowing me to maintain all points) would be ideal, but if there's a way to reduce the amount of points but keeping the general "shape", I'd be willing to try.




CakePHP 2.6.7 hasMany Data is not saved

I'm using CakePHP 2.6.7.

A user will be able to add to his profile multiple cars and multiple addresses. He will also be able to link multiple addresses to one car, and link one address to multiple cars.

I then have a User model with :

class User extends AppModel {
    public $hasMany = array(
        'Car',
        'Address'
    );
}

A Car model with :

class Car extends AppModel {
    public $belongsTo = array(
        'User'
    );

    public $hasAndBelongsToMany = array(
        'Address' =>
            array(
                'unique' => 'keepExisting'
            )
    );
}

An an Address model :

class Address extends AppModel {
    public $hasAndBelongsToMany = array(
        'Car' =>
            array(
                'unique' => 'keepExisting',
            ),
    );

    public $belongsTo = array(
        'User'
    );
}

I have a form so that the user can edit his cars (only one for the moment) :

[...]

        <legend>Mes voitures</legend>

        <?php
            for($nbrvoiture = 0; $nbrvoiture <= 0; $nbrvoiture++)
            {
                ?><h3>Voiture <?php echo $nbrvoiture+1?></h3><?php
                $myLabelOptions = array('text' => "Marque");
                echo $this->Form->input('Car.'.$nbrvoiture.'.CarMake', array('label' => array_merge($mainLabelOptions, $myLabelOptions)));

                $myLabelOptions = array('text' => "Modèle");
                echo $this->Form->input('Car.'.$nbrvoiture.'.CarModel', array('label' => array_merge($mainLabelOptions, $myLabelOptions)));

                $myLabelOptions = array('text' => "Plaque d'immatriculation");
                echo $this->Form->input('Car.'.$nbrvoiture.'.NumberPlate', array('label' => array_merge($mainLabelOptions, $myLabelOptions)));


                echo $this->Form->submit("Valider", array(
                    'class' => 'btn btn-default col-sm-offset-2'
                ));
            }

The thing is that I can't save the data to my database. Here is part of the User controller code :

function edit() {
    // On récupère l'ID de l'utilisateur
    $user_id = $this->Auth->user('id');

    // Si l'utilisateur n'a pas d'ID => il n'est pas connecté => il ne peut pas éditer son profil
    if(!$user_id){
        $this->redirect('/');
        die();
    }

    debug($this->User->find('all'));

    $this->User->id = $user_id;
    $passError = false;

    if($this->request->is('put') || $this->request->is('post')){
        $d = $this->request->data;

        $d['User']['id'] = $user_id;
        debug($d);


        if($this->request['pass'][0]=='cars')
        {

            if($this->User->saveAssociated($d, array('deep' => true))){
                $this->Session->setFlash(__("Les informations sur la voiture ont bien été modifiées"), 'alert', array (
                    'plugin' => 'BoostCake',
                    'class' => 'alert-success'
                ));
            }else{
                $this->Session->setFlash(__("Impossible de modifier ou d'ajouter les infos"), 'alert', array (
                    'plugin' => 'BoostCake',
                    'class' => 'alert-danger'
                ));
            }
        }

When I save the data, it shows the error.

In my database I have these 4 tables :

Users(id, username, mail, password, created, lastlogin, active, firstname, lastname, gender, birthdate, phonenumber)
Cars(id, CarMake, CarModel, NumberPlate, user_id)
Addresses(id, address, city, state, postcode, country, user_id)
Addresses_cars(address_id, car_id)

This is an example of what I can get from the form (the $d variable) :

array(
    'Car' => array(
        (int) 0 => array(
            'CarMake' => 'Allard',
            'CarModel' => '2005',
            'NumberPlate' => '56QDS1'
        )
    ),
    'User' => array(
        'id' => '1'
    )
)

I don't understand why it doesn't work... Can you help me please ?

Thank you ! :)

EDIT : I also tried with SaveAll but I can't get it to work.. what's wrong?




Web audio API : perfect looping how to

When playing file as a loop, there is still an "audio blank" between end and start. How can I avoid this ? For getting a continuous sound. thanks




How to maximize or fill the whole page with bootstrap carousel. (with navigation bar)

Goodevening coders! I'm currently working with my website. My problem is, I cant maximize the size of my bootstrap carousel. My desired output of my website is the whole page is filled with the bootstrap carousel and there is only a navigation bar above the site for navigation menu. I manipulate all the possible attributes of the <div> and <img> inside my carousel code such as width and height but still the carousel not occupy the whole page. Does the real the size of the image affects? Help.




Authentication with client certificate, ASP .Net web API 2

I'm writing a web service using ASP .Net Web API 2. I'm using client certificates to authenticate the client to the server and I've read pretty much everything I've been able to find about that but I'm still not sure about how it works so I would like someone to confirm my thoughts or tell me I'm wrong.

The client certificate is validated during the TLS handshake and if the client doesn't present a valid certificate with a valid private signature, the certificate isn't sent to the server but the request still is. Is this correct?

I add the client certificate to the request like this:

HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address);
request.ClientCertificates.Add(certificate);

This Add-method, from what I can ell it just adds the certificate to the certificate collection. Will it also actually sign the request itself with the certificate?

Using client certificates like this, will it give any validation of the request itself? The way I understand it it won't but I would like to have that verified.




dimanche 28 juin 2015

Go web server requests spawn its own goroutine?

I want to know how exactly goroutine and go web server works whenever requests come in:

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}

func main() {
    http.HandleFunc("/", handler)
    http.ListenAndServe(":8080", nil)
}

In this code,

  1. Every request to / calls the handler. Does this mean each request spawns its own goroutine? Or does it spawns its own process or thread? Is there any documentation on how those requests get its own goroutine?

  2. How do other languages handle this request? For example, does Python flask launch its own process for each request?

Thanks,




Interacting Via A Mobile Application, to a Web Application. Creating a mobile remote control app for a web app

I'm hoping for guidance, but a specific answer would be fantastic!

I'm developing http://ift.tt/1bUVlcW, which features curated youtube videos, organized into sections, and channels.

The aspect that I'm interested in developing is a remote controller. Currently, I have added a 'remote' with buttons, and links to the next channels.

My dream is to have this integrated with a mobile application, that would act as the remote, and allow the user to change 'channels' on the web application, with their mobile application.

I'm still early in the development, and open to suggestions for development.

My first inclination is to create a module with js, but I'm pretty green, though willing to learn.

Thanks in advance!




java.lang.ExceptionInInitializerError with gephi application

I am trying to make a graphic with gephi, i have used this code before and it worked but now i'm in a web application and it is not. When i run my code i get a java.lang.ExceptionInInitializerError on the line:

ProcessingTarget target =(ProcessingTarget) previewController .getRenderTarget(RenderTarget.PROCESSING_TARGET);

when i broke the line down the error was thrown on the parameter, so i replaced it with "processing" which is the value that constant returned.I still get the same error on that line.




Image rotation with jquery

i cant seem to do this in my website... All i could do was hide the elements!

`http://ift.tt/1ImwBYc`

Whats up with that?




Php exec failed but module working fine on cmdline

I have a xampp setup and im calling a opencv module from php exec function which has been tested to work fine on the system. But when i call it with php, it fails with the result as a random negative number. for eg:--1073741819.

Further investigation lead to the conclusion that the culprit was libtesseract302.dll but it just seems to work fine from the cmdline on the same system and not on xampp.

Any help is deeply appreciated.




Materialize sideNav() and dropdown() not working

I started HTML few weeks ago and I have a problem. I create my website with materialize framework and I have trouble when using initializing sideNav() or dropdown(). What's the problem ? I followed guides on http://ift.tt/1Hki4gt Hope you will help me ! (Sorry if my english is not perfect, i'm french)

The error i getwhere is the error




location direct domain.com to www.domain.com on multi site server

thank you for viewing this. Please advise that my server is running LEMP on Debian Jessie.

I am trying to force "www." to occur. I was able to do this with the following solution found on Stackoverflow.

return       301 http://ift.tt/1mDYAZp;

However, I am running several websites from the server and the issue I am running into is as follows.

When logging into wordpress http://ift.tt/1KiJWke on one website, it routes me to http://ift.tt/1LOLvFH. I believe this issue has to do with a default_server or hostname issue. Do I need to add all hostnames to /etc/hostname ?

Here is my host file

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

        # SSL configuration
        #
        listen 443 ssl default_server;
        listen [::]:443 ssl default_server;

        root /var/www/site0;

        index index.php index.html index.htm;

        server_name site0.com;
        #return 301 http://ift.tt/1KiJWki;
        location / {
                try_files $uri $uri/ =404;
                #try_files $uri $uri/ /index.html;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                #fastcgi_index index.php
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

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

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

        # SSL configuration
        #listen 443 ssl;
        #listen [::]:443 ssl;

        root /var/www/site1;

        index index.php index.html index.htm;

        server_name site1.com;
        #return 301 http://ift.tt/1KiJYZo;
        location / {
                try_files $uri $uri/ =404;
                #try_files $uri $uri/ /index.html;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                #fastcgi_index index.php
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

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

I am thinking part of the issue has to do with: listen 80 default_server; listen [::]:80 default_server;

Please help if you can, it will be very much appreciate.




Why views are same when I run main.go again

When I change the html and run main.go again, why the views are always the same?(I have cleaned the cache of browser)

Then I kill the progress of main.go and run it again, the view is changed.

Is there a better way to stop the main.go rather than kill this progress?




Neither media query nor meta viewport working

i am creating a blogger template and i want to make it responsive...

i have added viewport already.

<meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'/>

what i have done so far is :

@media only screen and (min-width:768px) and (max-width:1023px){ having css code in btwn}
@media only screen and (max-width:767px){}
@media only screen and (max-width:479px){}

i tried this..it worked very well on my desktop application (chrome). but when i tested it on a mobile device ...it didn't worked neither on tablet.

then i made some changes , and used diff. values

@media only screen and (min-width:768px) and (max-width:1023px){}
@media only screen and (min-width:481px) and (max-width:767px){}
@media only screen and (min-width:320px) and (max-width:480px) {}

this did some help but when i tested it on some more devices( iphone 6, 6+, samsung e7, motorola atrix 2 ,ipad3) out of these , it worked only on samsung e7

then i searched some responsive sizes..and found to use pixel ratio rather than width..

//for tabs
@media 
    only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1),
    only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1),
    only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2),
    only screen and (min-device-width: 800px) and (max-device-width: 1280px),
    only screen and (device-width: 601px) and (device-height: 906px) and (-webkit-min-device-pixel-ratio: 1.331) and (-webkit-max-device-pixel-ratio: 1.332),
    only screen and (min-device-width: 800px) and (max-device-width: 1280px) and (-webkit-min-device-pixel-ratio: 1.5),
    only screen and (min-device-width: 1200px) and (max-device-width: 1600px) and (-webkit-min-device-pixel-ratio: 1.5),
{

//For mobiles
@media 
    only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2),
    only screen and (min-device-width: 320px) and (max-device-width: 568px) and (-webkit-min-device-pixel-ratio: 2),
    only screen and (min-device-width: 375px) and (max-device-width: 667px) and (-webkit-min-device-pixel-ratio: 2),
    only screen and (min-device-width: 414px) and (max-device-width: 736px) and (-webkit-min-device-pixel-ratio: 3),
    only screen and (device-width: 320px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 2),
    only screen and (device-width: 320px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 3),
    only screen and (min-device-width: 320px;),
{ }

this too... didn't worked. later i searched on stackoverflow and tried this..(attached jquery in document )

var isMobile = false; //initiate as false
// device detection
if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 
    || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) isMobile = true;

if(isMobile)
{
   console.log('You are using a mobile device!');
   $('head').append('<link rel="stylesheet" href="style2.css" type="text/css" />');
}
else
{
   console.log('You are not using a mobile device!');
}
</script>

now i don't know what to do...or how to make webpage responsive.please help




How can i get the path of .sql file in my php website

I have a website code and i don't know where to place the .sql file in my website folder.




Dynamic Logging window for a webpage

I'm building a website on which users can draw objects.

I want to build a window for logging whatever mistakes that users make

For example, the drawing rule is only circle is allowed inside a triangle. However, one user come and draw a square inside a triangle. The system still allows and perform it as the user wants. But there will be a warning message such as "only circle allowed inside a triangle" appeared in the logging window (located at the bottom of the page). Whenever the user fix the mistake, the warning in the window will be deleted.(Due to this function, I think it should be called dynamic logging window)

I'm using JavaScript with ExpressJS and dojoJS.

Can anyone tell me how to build such a window??? I'm quite new to web developing

Any help would be appreciated.




samedi 27 juin 2015

How can I fetch a dataset from Rosalind?

For purposes of testing my programs, I'd like to automate fetching datasets from Rosalind. For instance, take problem DNA: The sample input can be obtained easily from the HTML of that page, but actual problems are only served on demand, and require a login.

How can I write a function that takes the problem code, my account name, and my password as argument, asks Rosalind for a new dataset, and returns the contents of the received file? Can I do this with WebClient?




How to create web based application?

I new in this topic, i need to create a web based application that received data(databases) over http ,store it and then parse this data and present it visually (image,video,graph, etc). The access to this data must be only for registered users, encrypted and from every web based device(tablet, pc, etc)

Which platforms exists? What is yours recommendations.

Thanks




Event not firing up (onlick)

Try changing almost everything(i.e runat="server", single-double colons) Here is the try:

<head runat="server">

<script type="text/javascript" >

    function Decide() {

        document.getElementById('l').innerText = "after";

    }

</script>
</head>

<body>
    <form id="form1" runat="server">
        <button    onclick="Decide()">Click!</button>
        <asp:Label ID="l" runat="server">before</asp:Label>

    </form>
</body>

What am i doing wrong?




Trying to use Path API but failing to deal with access token

I want to use the Path Api, what is the right URL to get access_token ?http://ift.tt/1eRoGH6




Web Essential for Visual Studio Sass compile wrong

I am using Visual Studio 2013 Update 4 and Web Essentials. I am coding a web site with Sass (scss) and I have problem with compile it. I have read many articles that Web Essentials doesn´t support it, but I found it works even in options.

But there is a problem, for example:

$primaryColor: #eeccff;

body {
  $primaryColor: #ccc;
  background: $primaryColor;
}

p {
  color: $primaryColor;
}

Paragraph (p) have color: #ccc, that is not correct.

Any advice? Is there something better for compiling scss?

Thanks.




Port-forwarding and website hosting: Two domains, same ip, different computer

So I have two domains: http://firstexample.com http://ift.tt/1GHPyjm

on my router I currently have portforwarding so that when someone goes to http://firstexample.com, they see the website that my computer with internal IP 192.168.0.15 is hosting

How can I set it up so that if someone goes to http://ift.tt/1GHPyjm, they would see the website that my other computer, with internal ip 192.168.0.16 is hosting?

Both of my computers have the same public IP.

Is it a setting on my router I would change? Or would godaddy allow me to configure something?




Viewport not working with domain name

I am making a responsive website and as you know, it relies on the meta viewport tag to work properly. I got free hosting and a free domain name that points to the original. When you view the website with the domain name, the viewport doesn't work, but the original works fine.

This one works fine: goldies-goodies.byethost16.com This one points to ^^^ but viewport is broken: goldiesgoodies.tk




Why isn't text-aling working?

Well, i'm trying this code:

.Saludo {
  width:100%;
  display:block;
  text-aling:center;
  font-family: "Times New Roman", Times, serif;
  font-size:75px;
  color:#208CB7;
 }

The idea is that the text should be in the middle of the screen but it doesn't move from the left corner. The css is working because it changes his colour and size, only the position isn't working.

Also, the text is being created from this:

function Saludo(){
  var f = new Date();
  hora = f.getHours();

  if(hora=>22 || hora<7){
    document.write('<span class="Saludo">Buenas Noches</span>');
  }else if(hora=>7 && hora<=14){
    document.write('<span class="Saludo">Buenas Dias</span>');
  }else{
    document.write('<span class="Saludo">Buenos Tardes</span>');
  }
}

The html looks like this. It calls the script shown above and creates the span:

<div id="Saluo">
    <script type="text/javascript" src="js/default.js"></script>
</div>




my job involves many repetitive task, how can I automate them

My work involves repetitive task with different documents, I was wondering how I could automate them for performance and productivity.

Basic overview of tasks involved: open file in excel, updated cells, delete rows and column, save as unicode, open the saved unicode file and make sure left column start with the same thing (easily done in notepad ++ as it highlights green), find and replace rows containing only one quotation mark and not "" which can not be done via replace all.

How could i program this, am i able to this from java? any suggestions or solutions?




How to get real time updated website content in PHP

I have a URL to a third party website that is updated (text) every random number miliseconds. I want to access updates as fast as possible and process them in PHP. Using GET is worth nothing because i need better performance, and i don't want to act as "nasty web scraper" who destroys all bandwidth. Is there any efficient way to do this?




Nameservers vs URL Forwarding

I am using a website called freenom.com and have a domain name. I think I understand that "url forwarding" means whenever someone types in the domain name I own, they are redirected to a different URL. It seems like there is something else called "nameservers" which may or may not do the same thing. Can anyone clarify these two terms?




jQuery - object dissapears as soon as I put it in another page

Couldn't find about this problem, I guess it's not really a problem, just I don't know how to it. On the event of click on a certain div, I want to open it a new tab. I managed to do it in the following code, but what happens is the original div disappears from the original page and is showed only in the new tab, I'm not quite sure why this is happening, but I though about cloning the object - but wasn't successful.

This is the relevant code: open new tab on click:

$(document).on("click", ".button", function(){
    window.toSend = $(this);   
    window.newTab = window.open("test.html", "_blank");  

add the object to the new tab:

var data = parent.window.opener.toSend;
    $(".clickedButton").html(data);

Any solutions? or first, why is this even happening? thanks!




HTML5 images not aligning correctly with same css

I am trying to align two images in two divs. These are the two images, they are the same size, resolution, and the aligning is perfect when doing it in photoshop: enter image description here

But when I reference them in my index.html like so:

<!-- Intro Header -->
<div class="intro">
    <div class="intro-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <h2>ssss</h1>
                </div>
            </div>
        </div>
    </div>
</div>

<!-------acerca---------->

<div id="acerca" class="acerca">
    <div class="acerca-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <h2>Acerca de Cssss</h2>
                </div>
            </div>
        </div>
    </div>
</div>

With the exact same css classes:

.intro {
display: table;
width: 100%;
height: auto;
padding: 100px 0;
text-align: center;
color: #fff;
background: url(http://ift.tt/1eaP4L0) no-repeat bottom center scroll;
background-color: #000;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}

.intro .intro-body {
    display: table-cell;
    vertical-align: middle;
}

.intro .intro-body .brand-heading {
    font-size: 40px;
}

.intro .intro-body .intro-text {
    font-size: 18px;
}


.acerca {
    display: table;
    width: 100%;
    height: auto;
    padding: 100px 0;
    text-align: center;
    color: #fff;
     background: url(http://ift.tt/1HmHMiN) no-repeat bottom center scroll;
    background-color: #000;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    background-size: cover;
    -o-background-size: cover;
}

.acerca .acerca-body {
    display: table-cell;
    vertical-align: middle;
}

.acerca .acerca-body .brand-heading {
    font-size: 40px;
}

.acerca .acerca-body .acerca-text {
    font-size: 18px;
}

And the images do not align as you can see in this picture: enter image description here

I can't post images because of lacking reputation points, this is only my second question.

Do anyone know how to align them? Thanks.

JSfiddle: http://ift.tt/1eaP4La




Html5 images of the same size not aligned in two divs, same classes

I am trying to align two images in two divs. These are the two images, they are the same size, resolution, and the aligning is perfect when doing it in photoshop: http://ift.tt/1IBZxY6 But when I reference them in my index.html like so:

<!-- Intro Header -->
<div class="intro">
    <div class="intro-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <h2>ssss</h1>
                </div>
            </div>
        </div>
    </div>
</div>

<!-------acerca---------->

<div id="acerca" class="acerca">
    <div class="acerca-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <h2>Acerca de Cssss</h2>
                </div>
            </div>
        </div>
    </div>
</div>

With the exact same css classes:

.intro {
display: table;
width: 100%;
height: auto;
padding: 100px 0;
text-align: center;
color: #fff;
background: url(../img/back2.png) no-repeat bottom center scroll;
background-color: #000;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}

.intro .intro-body {
    display: table-cell;
    vertical-align: middle;
}

.intro .intro-body .brand-heading {
    font-size: 40px;
}

.intro .intro-body .intro-text {
    font-size: 18px;
}


.acerca {
    display: table;
    width: 100%;
    height: auto;
    padding: 100px 0;
    text-align: center;
    color: #fff;
     background: url(../img/back4.png) no-repeat bottom center scroll;
    background-color: #000;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    background-size: cover;
    -o-background-size: cover;
}

.acerca .acerca-body {
    display: table-cell;
    vertical-align: middle;
}

.acerca .acerca-body .brand-heading {
    font-size: 40px;
}

.acerca .acerca-body .acerca-text {
    font-size: 18px;
}

And the images do not align as you can see in this picture: http://ift.tt/1IBZyek

I can't post images because of lacking reputation points, this is only my second question.

Do anyone know how to align them? Thanks.




"Develop Single Page Web Applications"

I've seen in various places some frameworks being described as easy to great ways to create single-page websites; such as Bootstrap and Angular. My question is why only single-page? Isn't it just as simple to use them to create multi-page websites?




Extracting data from PDF files

I have a number of PDF files that I'm trying to extract data from. My final goal is building website similar to PCPartPicker.com, but using data from pricelists in my country's local stores - they don't have an online store I can grab data from.

An example of a pricelist would be : http://ift.tt/1CAEnHJ

What I want to do is:

  1. To search for a specific product, and extract the price of product.
  2. Do so for all the pricelists for different shops.
  3. Return lowest price.

I'm currently using the pdf-reader gem (http://ift.tt/VZKyCf) to convert said pricelists into text, and trying to extract the price of product.

An example of a conversion is shown here: enter image description here

Unfortunately, not all PDFs are created equal. The biggest problem with this method is that I can't write an algorithm that can accurately capture all the prices.

My biggest problems:

  1. All stores have differently formatted PDF files.
  2. For items like RAM prices, how do I accurately get the price of a 4GB/8GB? For other products I can simply read the next integer on the following line, but how do I do it for RAMs, flash cards and the like?

It has also occurred to me that perhaps a pdf-to-text conversion wasn't an answer to my goal. My original idea was that after the txt conversion, it would be easier. Is there any other way that I can properly parse PDFs for their product prices?

This is my first ever web development venture in my freshman summer holidays, so I don't really have a prof/tutor to ask. I apologize if I'm not familiar with some of the key concepts when it comes to programming and web development. Thanks in advance:)




What web framework is best for developing windows explorer like user interface to display and manipulate hierarchical data?

Is it better to do it as a browser extension or plugin? Is it better done in a language like C++ to support large datasets and fast loading?




Facing issue after deploying Go app on Heroku

I have deployed the Go App on Heroku but on hitting the url.. its not giving proper response. The Heroku logs looks something like this :

2015-06-27T10:43:06.839094+00:00 heroku[web.1]: Starting process with command `FlickrImage`
2015-06-27T10:43:08.998400+00:00 heroku[web.1]: State changed from starting to crashed
2015-06-27T10:43:08.998400+00:00 heroku[web.1]: State changed from crashed to starting
2015-06-27T10:43:08.985737+00:00 heroku[web.1]: Process exited with status 0
2015-06-27T10:43:10.795684+00:00 heroku[web.1]: Starting process with command `FlickrImage`
2015-06-27T10:43:13.837301+00:00 heroku[web.1]: Process exited with status 0
2015-06-27T10:43:13.850141+00:00 heroku[web.1]: State changed from starting to crashed
2015-06-27T10:44:41.914412+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/Index" host=morning-ridge-1365.herokuapp.com request_id=89d2e794-a725-4ddf-b437-dbcbd988428c fwd="202.12.83.44" dyno= connect= service= status=503 bytes=

FlickrImage is my go file and I have created a Procfile which contains "web: FlickrImage"

Any help would be appreciated




Why does my 1080p screen render websites at 640px?

google says "because css pixel ratio" but I can't figure out what that is, or why it exists.

Why am I adding metadata that tells the browser to render the screen at <2/3rd the screen's resolution? Images (as far as I can tell) don't get resized, so why is everything else? and why this so common?? wts is going on??




vendredi 26 juin 2015

Is there a good way to probe account and billing information from a service provider website like At&t, etc?

I'm a newbie in web-development, and recently I hope to write some codes to automate my at&t billing information recording work. As a plan holder for 10 people, it is pretty troublesome to browse the web, lookup all the billing information, do the math myself to calculate balances for 10 and record them into the sharing google docs every time. It turns out to be a non-creative work since the process in most times programmable.

Wondering if there is any good method available to safely using my own credential to pull all the billing information I need and feed them into some storage area like google docs. Also, is there any common methodology on this?




How to verify an account using SMS or Call

I am working on an eCommerce website but our client told us to add functionalists like they want to verify an user account by sms or by call.

I don't know how to do this and how many of websites and apps do this.

Do they use any third party services or can we implement it by our won?

If we have to use this service please tell me the name and how much it costs and how to setup?

If there is any alternative please tell em that also.

Moreover I want to use this services for testing also.

Any help would be appreciated.




How can I read data off a web page and use it elsewhere?

I'm trying to build a web app that generates a list of classes offered at a university with each class's lecture hours that allows students to add classes to their calendar.

If the class hours are located at a web page like this online course catalogue, what methods can I use to extract the information? I'm thinking I have to code a program that would go into each class category, and save the name and hours of each class somewhere.

If someone can point me in a certain direction, link a code example, tell me what language or tools to use, or even tell me what this practice is called, it would help me out a lot by allowing me to know what I am supposed to be Googling. I have only built websites using HTML and CSS before.




Parameters coming from nowhere

var streams = require('stream');
var util = require('util');
util.inherits(JSONObjectStream, streams.Transform);

function JSONObjectStream(opt){
    streams.Transform.call(this, opt);
}

JSONObjectStream.prototype._transform = function(data, encoding, callback){
    object = data ? JSON.parse(data.toString()) : "";
    this.emit("object", object);
    object.handled = true;
    this.push(JSON.stringify(object));
    callback();
};

JSONObjectStream.prototype._flush = function(cb){
    cb();
};

var tc = new JSONObjectStream();

tc.on("object", function(object){
    console.log("Name: %s", object.name);
    console.log("Color: %s", object.color);
});

tc.on("data", function(data){
    console.log("Data: %s", data.toString());
});

tc.write('{"name": "Carolinus", "color": "Green"}');
tc.write('{"name": "Solarius", "color": "Blue"}');

I have a bunch questions about the code above. I've tested it out, and it does work perfectly.

First question: How does the "opt" parameter get its value in the function JSONObjectStream(opt)? I do not see any value being passed when I create the "tc" object.

Second Question: When I prototype the transform method, from where does the "callback" parameter receive its value? I do not see a value being passed to it when I call the method with tc.write().

Third Question: What is the flush() method's use in this program? I do not see it being called anywhere in the code. And if it is called somewhere, from where its "cb" parameter receive its value?

Fourth Question: How is the variable "object" able to be declared? It doesn't has neither a var nor a this before it.

I got this code from a book, but I can't figure out how it works.

Thanks for taking your time to check it out!




Domain Name Redirection with Path?

I need your Help please! I have a domain name that redirected to an other:

www.xxx.com ===> redirected to ===> www.yyy.com

If i write http://ift.tt/1NkMuxG, i want to be redirected to http://ift.tt/1fKXOJ4.

It's possibl ?




Get page content as if opened by user

I'm trying to get some of IPBoard registry data by using external site since 777 chmoding on whole forum registry would be a terrible idea. Registry returns user data for user if he's logged in on forums. I've created a page which initiates the registry and prints the data. Loading the registry and getting the data to page is quite simple

//userQuery.php
<?php
define("ALLOW_FURLS", false);
require_once 'forum/initdata.php';
require_once IPS_ROOT_PATH . 'sources/base/ipsRegistry.php';
$registry = ipsRegistry::instance();
$registry->init();

$member = $registry->member()->fetchMemberData();
$data = json_encode($member);

print $data;
?>

and if opened by user works perfectly. Problems started when I tried accessing my userQuery.php through external site as intended. Both curl and fopen from external site acts as requested by server not user visiting the site and returns Guest data since server is not logged in.

So doing

<?php
$url = "http://ift.tt/1NkMs95";
$handle = fopen($url, "r");
$result = fread($handle, 8192);

var_dump($result);
?>

Returns server memberdata which is Guest, instead of user memberdata as userQuery would if accessed normally by opening it in a browser.

Is there a way to open that page (userQuery.php) as if user requested its content using php or js as the last resort? I'm not looking forward to rewriting IPBoard registry just to provide external access checks with the forums.




The google favicon is displaying beside my website name?

The title says it all. When I visit my website the google favicon is displaying beside my website title in the tab.

Any ideas why this might be?




How do I get numerical data while web scraping?

I'm completely new to web scraping, so any reference sites would be great. I am slightly confused as to how I'm getting the actual data. When I print(theText), I get a bunch of html code (which should be correct). How do I exactly go about getting values from this? Do I have to use regular expressions to get the actual numerical data?

def getData():
    request = urllib.request.Request("http://ift.tt/1HliMuc")
    response = urllib.request.urlopen(request)
    the_page = response.read()
    theText = the_page.decode()
    print(theText)




Polymer JS passing function from one component to another?

Component A:

<polymer-element name="componentA" extends="core-ajax" attributes="onComplete">
<script>

Polymer('componentA',{
    requestCompleted: function(){
         this.onComplete();
    }
});

Component B:

<polymer-element name="componentB">
<template>
    <componentA method="GET" onComplete="{{myCallbackFunction()}}"></componentA>
</template>
<script>
    Polymer('componentB',{

    name: 'doug',
    myCallbackFunction: function(){
         alert("this works!");
         this.name='mike';
    }
});
</script>

So my problem is that I can pass myCallbackFunction in the attributes of componentA and it'll execute it, alerting "this works!". However, componentB name is still set to 'doug'. So I can successfully pass the function but how do I access component B's variables in that function?




Hosting issues. Domain name, web hosting, mail hosting integration

I got my domain name from godaddy and I am using hostinger for web hosting. Is it possible for me to have my domain specific email from another host like yandex?




What is the right way to identify client app?

What is the right way to identify client application (mobile or js web app) which can't store API keys securely? OAuth's client_id and client_secret seems to be useless for this kind of clients.




Read data from com port since client, web application, C#, .NET, Razor, MVC4

Good day, I created a web application using razor, mvc4 and c #, what happens is that I need to read some data traveling through a COM port on the computer, on the server it runs smoothly, the disadvantage is that I need to read the data through com but from every PC you open the application, not necessarily from Server, is it this possible ?, thank you very much.




How to see what pages are using a specific template

I am using dotCMS and would like to start consolidating some of our many templates into just a few. I need to know what web pages are using these templates, however, before I start deleting them and merging them.

How can I tell what webpages are using a specified template?




Cross Domain Iframe Alternative?

In a nutshell, I run a comic site and want to display this simple page on my site:

http://ift.tt/1GCjUmA

The problem is, when I use Iframes, the links open in the Iframe and it looks dumb. I want it to open in new tabs but as far as I know I can't do that cross domain.

Help please! :)




Stationary Background, Moving Foreground Website

So I have been working on a website using the .NET framework and would like to make the background style look a little something like it does at bons.me. As you can see when you scroll it background stays in the same position, however as you scroll the part of which you see changes.
Anyone know how I would go about doing this? Would it be something in css or ...? I'm rather new to web development, but it would also be just as much of a help if you guys could just point me in a direction or tell me what this is called so I could google it.




Python import statements breaking print value headed to php code

I am making a website with php and a coworker is providing a python script that my php code will execute through shell_exec(). His python script uses a print statement to send the output needed to my php code. We noticed through the creation of a simple test python script, no printed value were returned when the following import statements were included...

import pypyodbc
from collections import OrderedDict
import argparse
import pymysql

but when these imports were excluded, we were able to get output. Any ideas as to why this may be happening? Thanks in advance!




Rails. Why should i use ActiveRecord?

I was trying to make simple SQL-Query tasks. So i used active record and SQLite for my development environment with PostgreSQL for my prod. env.

I thought ActiveRecord is used because it can generate queries depending on DB used but all my queries have some errors for PostgreSQL.

Queries:

@sql[0] = Task.select(:done, :deadline).order(name: :asc).distinct

@sql[1] = Task.joins(:project).group(:project_id).select("projects.name, 
COUNT(*) as TaskCount").order("TaskCount DESC")

@sql[2] = Task.joins(:project).group(:project_id).select("projects.name, 
COUNT(*) as TaskCount").order("projects.name ASC")

@sql[3] = Task.select("projects.name AS pName","tasks.*")
.joins(:project).where("projects.name LIKE ?",'N%')
          .where("projects.name LIKE ?","%_a_%")'

@sql[4] = Project.joins("LEFT OUTER JOIN tasks 
ON 'projects'.'id'='tasks'.'project_id'")
.group(:project_id)
.select("projects.*, COUNT(tasks.project_id) as TaskCount")
          .where("projects.name LIKE ?","%_a_%")

@sql[5] = Task.group(:name).having("COUNT(*)>1").order(name: :asc)

@sql[6] = Task.joins(:project).where("projects.name = 'Garage'")
.group("tasks.name, tasks.done, tasks.deadline")
.having("COUNT(*)>1").select("tasks.*, COUNT(*)").order("COUNT(*) DESC")

@sql[7] = Task.where("tasks.done = ?",true).joins(:project).group(:project_id)
.having("COUNT(*)>=10").select("projects.name, COUNT(*) as TaskCount")
.order("projects.id DESC")

Every of them has some errors.

I dont expect you to solve them.

  • My question how would i avoid them in a first place?
  • Should i use PostgreSQL for development as well?
  • What the purpose of active record then? Can i just write pure queries? Because it seems like a better choice. (Maybe i am wrong?)



Can't seem to change my user password in phpMyadmin

I have a Joomla site that is turned off because the client hasn't paid their hosting fees. Our former web developer can't remember the password to the user for the admin. I'm trying to reset the password within phpMyadmin in the database under users. I change everything I need, password function to MD5 and then type in my password for the Admin user. After saving the changes I try to log in and it says the username and password don't match.

It's like there is something blocking me changing any fields. I tried changing the email address and it reverted back to the original. I tried creating a new user and it then deleted that user after about 5 minutes.

I did find there was rsfirewall installed so I got into the FTP and renamed that folder so it's not active anymore. At least I hope it isn't.

Does anyone have any advice on this topic? Please help, I've been struggling for two days now and can't find any topics on this. Thanks!




VCL.JS - How To Add Left NavBar to Home Page

I am experimenting with Typescript Node.Js VCL.js framework. Using it it Visual Studio 2013 Community with the vcljs plugin. Excellent work by the way. Very easy to use for an old Delphi user like myself. Love how you replicated all the Tcomponents Delphi users are used to. Tclientdataset is very powerful for binding the entry to data.

How do you add a navigation menu bar which is positioned on the left side of the Home Page of an application?

And how do you create submenu items to the top menu navigation bar on the Home Page?

I am looking at the sample Customer Center example that your team has provided for the vcljs framework.

Thanks ahead of time. Bill




URL Rewrite all http to https and all non-www to www both rules at once

Please help me redirect http requests to https as well as non-www. to www. on both my .com and .net sites all at once in IIS using Url Rewrite module.

Thanks.




What is the guidance on concurrent calls involving HttpClient instances and its methods?

What is the difference between following "concurrent" call scenarios? Which is the preferred way and why?

Scenario 1:

Thread 1 => Create new HttpClient (C1) and invoke GetAsync to endpoint A

Thread 2 => Create new HttpClient (C2) and invoke GetAsync to endpoint A

Thread 3 => Create new HttpClient (C3) and invoke GetAsync to endpoint A

Scenario 2:

Create one HttpClient (Instance C)

Thread 1: Use C instance and invoke GetAsync to endpoint A

Thread 2: Use C instance and invoke GetAsync to endpoint A

Thread 3: Use C instance and invoke GetAsync to endpoint A

Both scenarios seem to be opening multiple connections to endpoint, except that Scenario 1 has overhead of creating and initializing multiple HttpClient instances at the beginning.




Authentication from cookie data in mobile app

need to get a user authenticated in a mobile app from credential existing in the cookie sent .

an object which contains all ingredients from MobileApp cookie to authenticate mobile user:

 public class MitCredentials
    {
        /// <summary>
        /// Gets or sets a BreadcrumbId which is stored in a MobileApp credentials cookie. 
        /// </summary>
        [DataMember]
        public string BreadcrumbId { get; set; }

        /// <summary>
        /// Gets or sets a CREDENTIAL_TYPE which is stored in a MobileApp credentials cookie. 
        /// </summary>
        [DataMember]
        public string CredentialType { get; set; }

        /// <summary>
        /// Gets or sets a INTERESTED_PARTY_PUBLIC_ID which is stored in a MobileApp credentials cookie. 
        /// </summary>
        [DataMember]
        public string InterestedPartyPublicId { get; set; }

..... I need to send this via service to authenticate a user in a mobile app

How can I proceed? Do I need to create an interface and another class to implement this interface.

What are the steps please




please fix my javascript [on hold]

my javascript has some bug in it that whenever i "log in" the outside function starts working first then the inside one

what i want to do is to make sure that the user "james" logs in perfectly if not it will close the window (instead i put alert('lol'))

but instead the script does the alert('lol') first rather than the one inside the brackets then it will do the one inside the brackets

please fix it thanks`

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

<script type="text/javascript">


var login = prompt('Enter Username');
        
if(login == 'James'){ 

        var pass = prompt('Enter Password')

                if(pass == 'python'){

                        window.location.replace('http://ift.tt/1QI4Ajl'); 

                }

}



</script>

<script type="text/javascript">
        alert('lol')
</script>

</body>
</html>

`




Correcting skewed SVG rendering

I have created a single jsbin: http://ift.tt/1KfFAud

You can see four triangles rendering within one another. Each triangle is 10% smaller than the previous. The containing SVG is 300x300. I would expect everything to render out square but that doesn't happen. I assume there is some sort of screen stretching happening. The space between the bottom borders of each triangle looks much larger than the space between the top tips.

How do I correct for this?




I'm using Google sign in API for web.Should I verify the access token received?

Is it necessary for me to store the access token?If Yes,in what ways I can use it?




Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\inhertance\base.php on line 10 [duplicate]

This question already has an answer here:

Message Error..

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\inhertance\base.php on line 10

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\inhertance\base.php on line 11

Notice: Undefined variable: data in C:\xampp\htdocs\inhertance\base.php on line 16

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\inhertance\index.php on line 11



my code

//this page class name is base 
class base {

    //get all user..
    function get($link, $tableName) {

        $query = "SELECT * FROM $tableName";
        $result = mysqli_query($link, $query);
        $num_rows = mysqli_num_rows($result);

        for ($i = 0; $i < $num_rows; $i++) {
            $data[] = mysqli_fetch_assoc($result);
        }
        return $data;
    }

}


//this name page class is users  

require_once './base.php';

class users extends base {

    public $link;

    public function __construct() {
        $this->link;
        $this->tableName = "users";
    }

    function all_user() {
        $data = $this->get($this->link, $this->tableName);
        return $data;
    }

}


//this is page name is index 

require_once './users.php';

require_once './config.php';

$usersObject = new users($link);

$data = $usersObject->all_user();
foreach ($data as $value) {
    echo $value['username'] . "<br />";
}




Best Light server (Linux + Web server + Database) for Raspberry Pi

I would like to install a web server with a database on a Raspberry Pi (little computer). The computer has only 1GB RAM.

I want to know what is the best combination : Linux distribution + web server + DBMS to run the local server with multiple users with minimal latency, I will use PHP on the server. And what are the best settings for good performance and to not have bugs.

I thought a light Debian , a lighttpd server and SQLite for the database. Is this is a good solution?

Sorry for my English.




C# Web Forms label size and position controls with mouse Run time

Good day, I making one project and cannot find how to make on run time client mode edit text position size ...

Example link how to need make

This my created test form

Grateful for any information




how to route all web request to my proxy server

I am behind a proxy server (institute proxy) which is not in my control. I am using a application that download file from web. when I run it. it tries to download but did not use proxy ip. The application is not developed to allow to configure the proxy server. So it fails to works. I want to know that is there is an software or service that i install in my pc and this software redirect all my internet access request to my proxy server. so that my internet explorer ,firefox and off course my download application work without defining the proxy server ip in setting.

Regards




Spring MVC realise a custom response for multiple controllers based on a variable

I have a couple of controllers, annotated with @RequestMapping like so:

@RequestMapping(value = "/group/{groupName}", method = RequestMethod.GET)
public ResponseEntity<List<Group>> getGroups(@PathVariable("groupName") String groupName) {...}

As a side note the requests and responses are (de)serialized with jackson.

Now those requests can only be handled if there exists a connection to another server. If that connection breaks I receive a notification and want to retry establishing the connection. While doing that I want to return status code 500.

What is the cleanest way to do so?

-- Thank you in advance.




A Vizulized JavaScript Library for showing Genealogy

I'm about to make a website for a friend's thesis. It's about mythologies of Iran. I need a visualize JavaScript library for showing genealogy. Including some nodes that connect together or to the parent. (Something like family tree.) I'm sure there is a good library but I couldn't find by googling.




jwt authentication: cookie vs header

There are a lot of articles around discussing what is the best place to store JWT on the clientside. In short, they're all about -

  • Http-only secure cookie - no XSS, but vulnarable to XSRF

  • Header (saved in local storage or DOM) - no XSRF, but vulnarable to XSS

I think I come up with an extremely savvy solution to this, but, since I'm complete noob in security I'm not sure if it's really savvy or stupid.

So, what if to split JWT and save part of it in the cookie and another part in the header? Would it be unbreakable?

This should also solve 'logout' problem - deleting header portion would make browser incapable of logging in.

Best regards, Eugene.




What's engine used in website digitaltrends.com to auto update url when scroll page?

In website digitaltrends.com, I see they can update the page url when scroll down page. If we scroll up, website update again with the page url before. It's so interesting to increase the webview and attract the user to website content.

What're technics used? I try to research with keywords: "automatic update url when scroll website" but find nothing about this.

EXAMPLE: http://ift.tt/1GBnNrW




Is there a wordpress plugin that can help me make feeds like this?

What I want is somewhat hard to explain in the title or in plain text, so I'll provide an image:

What I want is kinda hard to explain in a title or in text, so I'm going to provide an image. Sorry if it's crappy, I made it on paint lmao What it should look like

I want a feed system that helps achieve do what the above picture illustrates:

  • Allows the viewer to view posts made by users in order of most liked or most recently made.
  • When a post is clicked on, the viewer is redirected to a page exclusively for the post in question, where he can also view information about the user and the post, or view the full post in case it does not fit.
  • Pressing "View More" Should allow the viewer to view more posts on the same page, sorted in the same fashion.
  • The viewer can like the post then and there.

I have basic knowledge of php and CSS, so if no such plugin exists, could you recommend a plugin that does similar functions, so that I can use it as a base?

There's probably some rule against these types of questions, and I should probably go to the software recommendation forums or the wordpress forums, but they're both rather inactive and I need an answer ASAP. Please help ;~;




Uncaught TypeError: $(...).(thefuntionname) is not a function

Uncaught TypeError: $(...).(thefuntionname) is not a function

this is always the error i had in my website can someone help me. its already under a function({});. what should I do?

and sometimes even if theres an error the code still runs right.

the error : Uncaught TypeError: $(...).opacityrollover is not a function

the code:

Blockquote jQuery(document).ready(function($){ $('div.content').css('display', 'block');

            var onMouseOutOpacity = 0.67;
            $('#thumbs ul.thumbs li, div.navigation a.pageLink').opacityrollover({
                mouseOutOpacity:   onMouseOutOpacity,
                mouseOverOpacity:  1.0,
                fadeSpeed:         'fast',
                exemptionSelector: '.selected'
            });



    });

Blockquote




jeudi 25 juin 2015

Maintaining History in Java desktop application

My desktop application interact with web. Hence how to maintain history record. I have developed in java (NetBeans).




Finding unused image files from web server

recently I have a task. There are many image files (of format .jpg/.gif) uploaded to a web server. However, actually not all image in the web server is shown on the real web site. Now I want to list out the image files that is not on the web site but in the web server, so I want to find a tool that can generate a list of images of a web site, I have found a firefox extention call Link Gopher which may help to generate all links from a web page, but since the web site has many pages, I must do the task page by page if I use Link Gopher.

As a result, I want to know is there any method that can do the task faster, or is there any tool can can generate links of a web site (including all pages of that site)? Really need you guys help, Thanks you so much!!




Performance drop in java8

We recently upgraded to java8 in our project and Started observing the performance drop. 15% performance is dropped after java8 upgrade. This application is related to provisioning system and supports the soap services. We have verified the GC timeline and did not see any suspicious. And als0 started profiling the application through Jconsole and yourkit .

Could anyone guide me what and all to verify ?




How to test in a collaborative environment?

My question is how to develop and test a Web application in a small team (2-3 people)? Imagine such a scenario:

A small team of 2-3 people are working together on a Web application. The Web server is on one computer, maybe at someone's home or a hosting environment, i.e. Google App Engine or Redhat openshift, and the source code is hosted in github or bitbucket. Developers check in and out code from github/bigbucket. Since the Web application is actually hosted in Google App Engine or Openshift, then a few questions arise:

1) How to move code between github/bigbucket and Google App Engine/Openshift? How often is the code synced between the two?
2) How to test the code, to make sure it will be running fine in the whole application? Because we can't test it on developer's local computer or on github/bitbucekt?
3) What't the best practice of setting up a collaborative development environment?

Thanks for your comments, and insights!




How should you comment css?

While developing, most of the CSS I interact with does not have comments, besides the occasional header. As a result, I have gotten in the habit of not commenting my CSS.

However, I often find it would be useful to have comments in css that I am working with. Should you comment css besides a header indicating an author? If so, how?




how to keet get parameters upong form submition

The current url is: http://localhost:8000/?sort=age and I have a filter in the page.

<form method="GET">
Filter By Name:<input name="filter" id="filter" type="text"/>
<input type="submit" value="Filter">
</form>

when the filter is applied, I expect the url to become: http://localhost:8000/?sort=age&filter=maria but it changes the url to: http://localhost:8000/?filter=maria

Is there a way to keep the current parameters?