mardi 31 mai 2016

how to design the col in boostrap 3.3.6?

how can i design this image below using the bootstrap 3.3.6, those are div CSS? I am just new programmer hope you can help me. thank you sir and ma'am,

click to see image




Accessing an open MDB file via PHP for many users

I have a system that accesses an MDB file that contains time in/out information. This software is usually set running 24/7. How do I obtain the contents of an already open MDB file through the PHP, especially to many users? Do note that the system I'll be developing will not write to the MDB file, only read the table contents. Does MDB prevent concurrent connections?




Where to put testNG xml file in ANT java web project

I am using testNG in a java web project. When I run the test with gui eclipse on Linux machine it creates a .xml file in my /tmp/ folder. My concern is If I create a custom xml file then where to put that file in project and how we can run that test with eclipse gui.




How can I make a online leaderboard for a javascript game? [on hold]

I wrote a processing.js video game in which the user receives a score at the end of playing each time. I now have this game embedded in my personal website and I wanted to know if there was anyway to provide a live leaderboard? These variables for the leaderboard would come straight from the javascript variables. For the database I'd ideally use SQL.




Why do browsers allow CSRF?

I am pretty new to web security, and as I read more about the different attack vectors, my mind boggles that they are allowed in the first place. It's like the web was designed with a broken security model and to be vulnerable.

I am also amazed at the amount of vague and imprecise information. For example, at first the Single Origin Policy sounds pretty good, then I read that it only applies to XHR, and oh and by the way, doesn't actually prevent XHR cross-origin POST, which is the classic CSRF attack. Glad I kept reading.

There is also an Origin header that the server can use to make sure the request is coming from the right place -- but oops, it is set inconsistently across browsers, and if it is NOT set, you can't be quite sure if it was because of a same-origin request, or a request type that just didn't get it for certain browsers (maybe an IMG tag?). Keep reading.

So the right way seems to be set a CSRF token in the session cookie, and also add that token to forms/links, and then compare them server side on a submission. In theory (and lets exclude all XSS attacks for the purpose of this question), a CSRF attempt from another tab may make a POST request to a form that includes the cookie, but without a form input element set to the matching token (because it can't read the token from the cookie), so the server will reject the request. Works but kludgy, and make sure you never ever forget to check!

Holding that thought in mind for a second, here is my question -- why does the browser send the session cookie in a request that originates from a page that is not the origin of the cookie?

I mean, browsers will refuse to send cookies to different domains for good reason, but are quite happy to send them from different origins? Would stuff break if they didn't? Would it be a robust defence against CSRF, only requiring servers to do what they are doing anyway -- checking for a valid session cookie?




What is the best website to learn? [on hold]

I'm still learning to make securiy system with java HQL for website, but I not find any website for tutorial how to make a security question, please help me to find a good website to learn about security system or how to make a security system ? (Sorry my english is bad)




changing /var/www to /srv gets 403

I'm used to working with /srv as the webroot for apache. After creating a new CentOS machine, the default DocumentRoot is set to /var/www/html. I've changed this /srv, but I'm getting a 403 when I visit my domain.

From the default httpd.conf file that was created, I changed the following:

DocumentRoot "/srv/www/html"

<Directory "/srv/www">
    AllowOverride None
    Require all granted
</Directory>
<Directory "/srv/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

This is a ls -lhA in /srv:

rwxrwxrwx. 3 root root 34 Jan 29 06:51 www

I 777d the directory just to get it to work. I'll be changing this after I figure out what's wrong. chmod -R a=rwx /srv is what I did.




When I upload new webpage to server can i just change folder's name?

i am making new webpage in these days.

i am using editplus with sftp and filezilla.

and the server is centOS.

there is a one folder named "foo" assigned to www.example.com

and there is a folder that i been working on named "foo_dev".

both folder have same permission properties.

so I thought that it will be fine to change "foo" to "foo_original"

and "foo_dev" to "foo". but my senior said this is not correct way.

and i learned that git or any version control system can be applied

in the web development too, but he doesn't want it.

what is the simple and best way to upload changes?




How to make a opensource software like question2answer [on hold]

I want to create a software like opencart or q2a which can install on server. I find this very interesting




How to Disable Auto_Complete Keyword Specific in Sublime Text

Whenever entering the word 'do' for example in Sublime Text, I get the little auto complete tab hanging over the end of my keyword. If I press enter, it auto completes for me and then I spend time deleting unnecessary code.

enter image description here

I then added this in my Settings - User tab.

"auto_complete": false

However, this turns off auto_complete completely. I was wondering if there was a way to disable this feature my keyword only. Any thoughts?




Why does .json() return a promise if in an object literal?

I've been messing around with the fetch() api recently, and noticed something which was a bit quirky.

let url = "http://ift.tt/281iWkN";

let iterator = fetch(url);

iterator
  .then(response => {
      return {
          data: response.json(),
          status: response.status
      }
  })
  .then(post => document.write(post.data));
;

post.data returns a promise object. http://ift.tt/1P1X4Ky

However if it is written as:

let url = "http://ift.tt/281iWkN";

let iterator = fetch(url);

iterator
  .then(response => response.json())
  .then(post => document.write(post.title));
;

post here is a standard object which you can access the title attribute. http://ift.tt/281j043

So my questions is: why does response.json return a promise in an object literal, but return the value if just returned?




JavaScript runtime error: InvalidStateError

I'm getting an "Unhandled Exception" error at this specific point of the code:

function loadAccount(accountId) { // here-> $("#accountDetails").load('/RxCard/GetAccount', { accountid: accountId }, function (response, status, xhr) { if (status == "error") { var msg = "Sorry but there was an error: "; alert(msg + xhr.status + " " + xhr.statusText); } I have no idea what is causing this. I'm trying to run an application that will save the changes a user submits. The error appears as soon as I click on the "save" button. Any help is appreciated. Thanks.




What happens in the network when I access port on localhost using telnet?

My ubuntu machine's wireless interface is connecting to the wireless router. I wrote a simple web server listening on port 8888. I would like to understand how the packets are sent and receive using localhost. So I did the following experiment:

I started wireshark on the same machine listening wlan0 and on the terminal I type:

$telnet localhost 8888

Then I observe TCP SYN, SYN/ACK, ACK. In these messages, the MAC src and dest addresses are all 00:00:00:00:00:00. The src and dst IP addresses are all 127.0.0.1.

Does this mean these packet never go out from my wlan0 interface to the wireless router and directly loop back within my machine? Does it even reach my wireless card or just looping back within the ubuntu linux OS?




Foundation dropdowns trouble in ipds or android tablets

I'm developing an intranet and use com grid css of foundation, everything goes well except that the dropdowns menus in the ipad does not work well, really not the menu, are the links on the menu that does not work, it is common links ( ) or buttons (), more than anything when the iPad is in landscape mode, though I click lso links do not work, in other areas also use buttons but nothing works, it is in the tablets in if so landscape

Any idea might be going?

Capture dropdown menu: http://ift.tt/22vUV1e




Understanding web server response

I am learning how to write a simple webserver. I got two questions:

1.I created a file called HelloWorld.html and place it in the same dir as my webserver.

<html>
<header><title>This is title</title></header>
<body>
Hello world
</body>
</html>

Then i type the following url in chrome:

http://localhost:8888/HelloWorld.html

My webserver listening 8888 will open HelloWorld.html and send the content to the connection chrome uses directly. This means that I did not sent any http header information to chrome. But I can still see chrome renders the "Hello world" in the page properly. Why?

2.I want to improve my webserver and send a proper http response header. But I dont know how to get a sample response. What tool should I use to get a sample response from an internet page?




How can I efficiently save profile pictures of users

How are the professionals doing it ? My thought would be just compress the image and use a ftp service which uploads and downloads pictures with the User ID as filename. But that looks like very expensive in the Webhosting sites which I looked up and would have a very slow performance.

Lets assume I have to upload 500K Images. How can I handle this ? (Im using PHP & mySQL to save normal data)




How does the homepage of shipfinder.com start a request and parse the result?

shipfinder.com provides a function to search information of a ship by its MMSI (or its name, etc.), and the returning messages include ship size, ship location, current speed, and so on. For example, for the ship with MMSI 416003098, some information of ship is presented as follow:

enter image description here

I want to write a crawler program to automatically fetch such information of a specific ship from shipfinder.com.

To this end. Firstly I check the source code of its homepage, and find the search button evokes the function autosearch.queryShip() from AutoSearchShip.js to query the information of a ship. However I can not find which part of javascript actually query the data from the server. Second. with the help of chrome developer tools, I check all requests to the server in the search time of a ship, only seemingly meaningless strings are returned. Take ship (MMSI:416003098) for example, five requests are:

  1. http://ift.tt/25x1BOH
  2. http://ift.tt/1O1V621
  3. http://ift.tt/25x127j
  4. http://ift.tt/1O1V3Do
  5. http://ift.tt/25x1yCv

and their corresponding responses are:

  1. AAABAwkANDE2MDAzMDk4
  2. AAABAAAAAQAAAAEAAAABAAAAAwkANDE2MDAzMDk4GrTLGAAAAAA=
  3. AADgw2lkaRCHsMtuU+Rtx7Bk41x+mcHe2Zn5YI58YM5HRxUxJnnISUbQlNgSSNeaB+tMNAis3M7B3V+RWjutsqfP+GvJ+uXazKQNLZPTJVGTL/SOHF0+mAc+zWEIKd3pyr19dtx0x2xNrg==
  4. AAA5Ho7EMxnUFMtuU+Rtx7Bk41x+mcHe2Zkq2wWscsr4aHNpfYFAKtYTX9+8w0ZS0qxMNAis3M7B3V+RWjutsqfP+GvJ+uXazKQNLZPTJVGTL/SOHF0+mAc+zWEIKd3pyr19dtx0x2xNrg==
  5. AADWgTLOaGbr9dqiyydcW1kQ41x+mcHe2Zk=

I can not make a connection of these strings to the ship information in figure above. I guess some javascript codes may parse some of these string to the specific values.

Please help me find where does the code parse the strings, or provides some relative materials to learn, so I can finish my crawler task.




Override Prestashop 1.6.1.4

I am doing a module in Prestashop and I need override the method update in the class CartCore. I have created a class inside the folder override (I have tried in modules/name_of_module/override also) Cart extends CartCore (the file is Cart.php), and I have the next code.

public function update($null_values = false, $hook = true)
{
    if (isset(self::$_nbProducts[$this->id])) {
        unset(self::$_nbProducts[$this->id]);
    }

    if (isset(self::$_totalWeight[$this->id])) {
        unset(self::$_totalWeight[$this->id]);
    }

    $this->_products = null;
    $return = parent::update($null_values);
    if($hook) Hook::exec('actionCartSave');

    return $return;
}

I have deleted the file cache/class_index.php and I have activated the overrides in the back-office Performance but it does not work. Only works if I change the original Cart class, but I don´t want do this.

Thanks!




Android app and web service with cloud

I am researching on my final year project. There is a android MOBILE APPLICATION and WEB MODULE in it.I want to connect both of them with a database which should be on CLOUD. Which cloud platform support both of them except Microsoft Azure?




Xslt Dropdown by using xml (using nested for each)

Hi I am new for xslt and I have trouble make dropdown menu navigation , please any can help me I create a static drop down in xslt but I want make drop down as per my XML , In XML there have MenuItem/Menu/Link which I want to make drop down .

Following is my XML code :

  "<?xml version='1.0' encoding='ISO-8859-1'?>\r\n \
<?xml-stylesheet type='text/xsl' href='menu.xsl'?>\r\n \
<MenuData>\r\n \
    <MenuTab>\r\n \
        <Tab URL='?do=userMgmt&amp;Page=userMgmt&amp;action=list' Rel='1' TabName='User Management'/>\r\n \
        <Tab URL='?do=clientMgmt&amp;Page=clientMgmt&amp;action=list'  Rel='2' TabName='Client Management'/>\r\n \
        <Tab URL='?do=clientserverMgmt&amp;Page=clientserverMgmt&amp;action=list' Rel='3' TabName='Client ServerManagement'/>\r\n \
        <Tab URL='?do=licMgmt&amp;Page=licMgmt&amp;action=list' Rel='4' TabName='License Management'/>\r\n \
        <Tab URL='?do=serviceMgmt&amp;Page=serviceMgmt&amp;action=list'  Rel='5' TabName='Service Management'/>\r\n \
        <Tab URL='?do=reports&amp;Page=Reports&amp;action=list' Rel='6' TabName='Report'/>\r\n \
    </MenuTab>\r\n \
    <MenuItem>\r\n \
        <Menu Rel='1'>\r\n \
            <Link URL='?do=userMgmt&amp;Page=users&amp;action=list' LinkName='Users' Permission='VW,AD,ED,DL'/>\r\n \
            <SubLink URL='?do=userMgmt&amp;Page=users&amp;action=add'  />\r\n \
            <SubLink URL='?do=userMgmt&amp;Page=users&amp;action=edit'  />\r\n \
            <SubLink URL='?do=userMgmt&amp;Page=users&amp;action=delete'  />\r\n   \
            <Link URL='?do=userMgmt&amp;Page=roles&amp;action=list' LinkName='Roles' Permission='VW,AD,ED,DL'/>\r\n \
            <SubLink URL='?do=userMgmt&amp;Page=roles&amp;action=add'  />\r\n \
            <SubLink URL='?do=userMgmt&amp;Page=roles&amp;action=edit'  />\r\n \
            <SubLink URL='?do=userMgmt&amp;Page=roles&amp;action=delete'  />\r\n   \
        </Menu>\r\n \
        <Menu Rel='2'>\r\n \
            <Link URL='?do=clientMgmt&amp;Page=clients&amp;action=list' LinkName='Clients' Permission='VW,AD,ED,DL'/>\r\n \
            <SubLink URL='?do=clientMgmt&amp;Page=clients&amp;action=add'  />\r\n \
            <SubLink URL='?do=clientMgmt&amp;Page=clients&amp;action=edit'  />\r\n \
            <SubLink URL='?do=clientMgmt&amp;Page=clients&amp;action=delete'  />\r\n   \
        </Menu>\r\n \
        <Menu Rel='3'>\r\n \
            <Link URL='?do=clientserverMgmt&amp;Page=clientServer&amp;action=list' LinkName='Servers' Permission='VW,AD,ED,DL'/>\r\n \
            <SubLink URL='?do=clientserverMgmt&amp;Page=clientServer&amp;action=add'  />\r\n \
            <SubLink URL='?do=clientserverMgmt&amp;Page=clientServer&amp;action=edit'  />\r\n \
            <SubLink URL='?do=clientserverMgmt&amp;Page=clientServer&amp;action=delete'  /> \r\n \
        </Menu>\r\n \
        <Menu Rel='4'>\r\n \
            <Link URL='?do=licMgmt&amp;Page=licDetail&amp;action=list' LinkName='License Details' Permission='VW,AD,ED,DL'/>\r\n \
            <SubLink URL='?do=licMgmt&amp;Page=licDetail&amp;action=add'  />\r\n \
            <SubLink URL='?do=licMgmt&amp;Page=licDetail&amp;action=edit'  />\r\n \
            <SubLink URL='?do=licMgmt&amp;Page=licDetail&amp;action=delete'  />\r\n  \
            <Link URL='?do=licMgmt&amp;Page=licReq&amp;action=list' LinkName='License Request' Permission='VW,AD,ED,DL'/>\r\n \
            <SubLink URL='?do=licMgmt&amp;Page=licReq&amp;action=add'  />\r\n \
            <SubLink URL='?do=licMgmt&amp;Page=licReq&amp;action=edit'  />\r\n \
            <SubLink URL='?do=licMgmt&amp;Page=licReq&amp;action=delete'  />\r\n  \
        </Menu>\r\n \
        <Menu Rel='5'>\r\n \
            <Link URL='?do=serviceMgmt&amp;Page=service&amp;action=list' LinkName='Services' Permission='VW,AD,DL'/>\r\n \
            <SubLink URL='?do=serviceMgmt&amp;Page=service&amp;action=add'  />\r\n \
            <SubLink URL='?do=serviceMgmt&amp;Page=service&amp;action=delete'  />\r\n   \
        </Menu>\r\n \
        <Menu Rel='6'>\r\n \
            <Link URL='?do=reports&amp;Page=Reports&amp;action=list' LinkName='Reports' Permission='VW'/>\r\n \
            <SubLink URL='?do=reports&amp;Page=Reports&amp;action=add'  />\r\n \
            <SubLink URL='?do=reports&amp;Page=Reports&amp;action=edit'  />\r\n \
            <SubLink URL='?do=reports&amp;Page=Reports&amp;action=delete'  />\r\n   \
        </Menu>\r\n \
    </MenuItem>\r\n \
</MenuData>\r\n "

Following is my xslt with static drop down but I want dynamic as per as XML :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://ift.tt/tCZ8VR">
<xsl:output method="html" />
     <xsl:template match="MenuData">
         <ul>
         <xsl:for-each select="MenuTab/Tab">
             <li onclick='toggleNavSelected(this);'><a href="{@URL}" rel="{@Rel}"><span><xsl:value-of select="@TabName"/></span></a>

                <div class="dropdown-content">
                        <a href="#123">Tab1</a>

            </div>


            </li>
         </xsl:for-each>
         </ul>
     </xsl:template>

 </xsl:stylesheet>




How to separate html pages and Python code in Web2py

I am working on a new Web project (with Web2py) and I need to define organisation where page design and code will be separate and made by different peoples. Web designers will use tools like Pinegrow then give files to coders. I need to define rules where Web designers may update there work without coders' intervention (and vice versa). My question : is it possible with Web2py and what are the restrictions and 'best rules' ?




Causes of Uncaught RangeError: Maximum call stack size exceeded

I have this error Uncaught RangeError: Maximum call stack size exceeded in my JS code and I want to know which are the causes for this error.




Considering Using Firebase - Converting to static only files - Web Application

I'm considering using Google Firebase to make a web application.

After watching the Google IO, it looks great! I always seem to be distracted by maintaining the server, database or backend code etc.

If Firebase can truly take the responsibility away it would be great for the end product.

It maybe because I come from a server side background but doing simple tasks, for example creating layouts seems impossible without server side language.

I would normally use blade to create my layouts, using includes and blades @section thing.

How can this be done using HTML CSS and JS? Can anyone else share their experience with firebase?

I also just can't envision how its possible to create apps without business logic.

If everything they preach is correct, I don't see why anyone would maintain their own backend unless they have a specific use case.

What brought me to Firebase is the three way data syncing their real time database offers, after implementing my own solution for this, I've come to the conclusion that for a start up managing your own isn't feasible especially when a service offers this.

Thanks in advance for feedback, its all appreciated!




HTML flexible canvas scale

I am making a website which will load some blueprint images on a canvas.

but the images are vary in height and width.i Would like to make the canvas scaling equal to the uploaded image scale. How do i code to make the canvas width and height changeble respective to uploaded image. This done in html5




Google play store support Web App?

Is Google Play Store support Web Apps? Is We can upload our Web Apps on Google Play Store?

I know Google Play store Support Android Apps but I dont get a answer that Google Play Store Web Apps or not.




lundi 30 mai 2016

Ignore media url on PHP

Is there any way to ignore all url that contains media? I'm using this line:

preg_match_all("/((?:http|https):\/\/(?:www\.)*(?:[a-zA-Z0-9_\-]{1,15}\.+[a-zA-Z0-9_]{1,}){1,}(?:[a-zA-Z0-9_\/\.\-\?\&\:\%\,\!\;]*))/", $content, $matches);

So, I need to ignore this links (and all media type):

http://ift.tt/1RHJGes 

http://ift.tt/1XL1Wun

http://ift.tt/1RHJyf0

...

Thanks in advance




How to deploy website?

I have all of the code (HTML/CSS, etc.) for my website in a folder. I also have an Ubuntu server on Digital Ocean and a domain.

How do I deploy my website?




Could someone give me a real example of using web messaging?

Sorry for my lack of knowledge regarding Web, I understand Web Messaging allows communication between different window or iframes; however, I cannot think of a practical example of using this technology in real life project. Moreover, what is the advantage of window.postMessage() method in HTML5 suite?




this.callback is not a function

new ajax.xhr.Request('commentadd.jsp', params, searchmember('<%=groupPlanDto.getG_id()%>'), 'POST');


function searchmember(g_id) {
        var params = "g_id=" + g_id;
        sendRequest("/railro/admin", params, receiveList, "GET");
    }

in this code "this.callback is not a function" is occurered

Is this impossible? -> searchmember('<%=groupPlanDto.getG_id()%>')

But I have to need "g_id" when I move to searchmember How can I solve this problem...?




Understanding Singleton objects in a web application

We have a Spring web application, where user's login in and place orders. There is a factory bean and its a singleton object. This factory bean holds user information. Also there will be multiple users logged into the web application at any point of time. When I read about singleton, it says that there will be only one object created per JVM. So I want to understand how the user information will be stored in this singleton object?




How to apply a filter after a mask in SVG?

I have the following SVG:

<svg xmlns="http://ift.tt/nvqhV5" viewBox="0 0 100 100">
        <mask id="mask">
                <rect x="0" y="0" width="100" height="100" fill="white"/>
                <circle cx="50" cy="50" r="33" fill="black"/>
        </mask>
        
        <filter id="dropShadow">
                <feGaussianBlur in="SourceAlpha" stdDeviation="3"/>
                <feOffset dx="4" dy="4"/>
                <feMerge>
                        <feMergeNode/>
                        <feMergeNode in="SourceGraphic"/>
                </feMerge>
        </filter>
        
        <circle cx="50" cy="50" r="50" fill="green" filter="url(#dropShadow)" mask="url(#mask)"/>
</svg>

It's basically a ring with a shadow.
The problem is that the shadow is not visible on the inside of the ring, because the filter is applied to the circle before it is masked.

But what I'm looking for is to apply the filter to the already masked object.
How can I do that?

PS: In this trivial example it doesn't make much sense to use a mask. It's just to explain the problem.




How to apply a filter after a mask in SVG?

I have the following SVG:

<svg xmlns="http://ift.tt/nvqhV5" viewBox="0 0 100 100">
<mask id="mask">
        <rect x="0" y="0" width="100" height="100" fill="white"/>
        <circle cx="50" cy="50" r="33" fill="black"/>
</mask>

<filter id="dropShadow">
        <feGaussianBlur in="SourceAlpha" stdDeviation="3"/>
        <feOffset dx="4" dy="4"/>
        <feMerge>
                <feMergeNode/>
                <feMergeNode in="SourceGraphic"/>
        </feMerge>
</filter>

<circle cx="50" cy="50" r="50" fill="green" filter="url(#dropShadow)" mask="url(#mask)"/>
</svg>

It's basically a ring with a shadow.
The problem is that the shadow is not visible on the inside of the ring, because the filter is applied to the circle before it is masked.

But what I'm looking for is to apply the filter to the already masked object.
How can I do that?

PS: In this trivial example it doesn't make much sense to use a mask. It's just to explain the problem.




What is the best data structure for web classification, where each website can have multiple class labels?

I want to store a large number of websites, where each website can have multiple class labels. Ideally, I'd like to have a set of primary labels (entertainment, news, sports, etc.) for each website, and each of those primary labels can have a number of sub-classes (sports -> news and media -> ...). I want to be able to quickly query by class, as well by website. What is the best data-structure to accomplish this?




message system in android app and web using php, javascsript

can anyone give me an idea on what to do. I'm doing a student portal system using android app and web. I have message feature wherein the teacher can send message to student. what am i going to use for storing messages. I'm afraid that if i use database it might slow the system. the android app and web must link together. the teacher can use the app to send message and the student can view it on web. thanks




Jboss java-ee implementation classes in another vendor's AS

In my opinion an application server does not only comprises of bunch of .class files implementanting java-ee specification,
But it is the combination of those files plus the server itself
because for example the behaviour of EJB or servlets or whatever objects cannot be hardwired in in a .class, I mean the server has to manage those classes in a way that is adherent to the specification.

Am I right ?

From this consideration arieses my question: is it possible to use Jboss implementation of java-ee api in a AS by another vendor, say Weblogic for instance ?




Automatically update data in sql for a webpage

So Im a softwarwe Development student and for my web class I created a proyect that uses among other things Php and Sql; In this page proyect users can create posts and other users can comment on them.

The thing is I want posts to only be available for a certain period of time.

Then I have a sql table named 'Posts' and they have a column named 'Status' (you know, if the status its 0 they're not available and else they are.)

When user creates a post I make Sql: INSERT INTO posts *All the post data*, I set the Status to 1 and make a TIMESTAMP to register the date of creation of the post. I want that a week after the date registered in the Timestamp change the status column to 0 but I don't want it to be with a page request (because I want the user to be notified via email or something)

Can it be made with some python cgi that checks the date, updates the Status and sends the email or is there a better/easier way to do it?

Thanks a lot for your help :)




Extracting entire text part from a website with python [on hold]

Extracting the textual part of all the links in all the pages of a website.




WIX to Wordpress

We have site that is based on wix. Now we have another site that has different host and different domain. Is there any ability to create a redirect from wix page to wordpress page? The problem is that wix doesn't allow to edit html code, so I can't have standard 301 redirect. I've read this 301 Redirect from Wix to WordPress but didn't understand. Is there any ability? Tried to place in head but wix blocks it. I can only add




move an image to a top of a cell (urgent)

I put an image on a cell and all margins were separated from the image, the thing is that I united the borders again with display: block; but the top margin is , and I want to move the photo up to touch with the title and this with the top margin but as a limit and not allowed to rise me more , I need urgent help the project must be delivered in a few days in class . There is the photo image




sending message using android app and web on php, javascript

can anyone give me an idea on what to do. we are doing student portal system. we will do an app for phone and a website. our system has messaging wherein the teacher can send message to students. could you give me an idea on what to use in the messaging feature. im thinking of database but im afraid that it might slow our system. what should we do. the message must link to the web and anroid app. thanks




Change the Default Download Location of file

In my application, I have a link from which a PDF file can be downloaded on click. And on clicking on the link my file is by default downloaded to the Downloads folder. My doubt is Can I change the location, where my file is being downloaded..?




Understanding the architecture of IoT(Internet of Things) system in technical perspective

I have recently started in the domain of IoT. Though, during R&D, I have seen lots of small examples over internet where people are lightning up LEDs connected to a Raspberry board, using internet and mobile app. But, that's just OK for small learning projects. I want to understand what software tools and hardware it takes to build a working IoT system on a large scale. Lets take 2 example projects :

  1. Smart Home - Controlling Home Devices over-the-internet through mobile app.
  2. Smart Garbage - Dustbins across the city that send data to a central server, whether they are filled or empty.

I want to get an idea, how will I get the things operational for above two sample projects, to a production level? What are the possible designs I can adopt?

If I had to work on Smart Home Project, the best I can think of is I put a Raspberry board in the house connected to internet, install a TCP/IP server like apache, code the backend in PHP to handle requests (in JSON) from mobile apps acting as clients , and execute the scripts (written in bash) locally on the board to control different peripherals connected to it, depending on the type of request. e.g. controlFan.sh, controlLight.sh, controlGarageDoor.sh, etc.

And, if I had to work on the second project, I now put the Raspberry board on each dustbin connected to a central server. This time, I don't need a server on the dustbins. There will be a central TCP/IP server, at the city's Garbage Collection Department, which will expose APIs in the form of URLs like :

http://ift.tt/1sncKTX;

Simply hitting the url via a cron job will suffice the job.

I understand that my architecture is naive and might not suit the production level of quality. So I request if any of you have worked on such project, what architecture and softwares did you use? How were your clients and servers programmed to communicate?




web admin noob - broke local webserver while trying to install jenkins

I just broke my local development web server while trying to install jenkins. Jenkins works. But other sites that I have built and used to access on my web server do not work. I was following this article: http://ift.tt/12RGpBT

After following the main section to download and install jenkins, i ran the steps in the section "Setting up an Apache Proxy for port 80 -> 8080". That's when I managed to break apache.

Here's the history of what I ran:

me@mydevbox:~$ sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-image-4.2.0-34-generic linux-image-extra-4.2.0-34-generic
  python-support
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  daemon
The following NEW packages will be installed:
  daemon jenkins
0 upgraded, 2 newly installed, 0 to remove and 8 not upgraded.
Need to get 64.0 MB of archives.
After this operation, 65.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ift.tt/x7aQTN wily/universe daemon amd64 0.6.4-1 [98.2 kB]
Get:2 http://ift.tt/1Q2ZIly binary/ jenkins 1.651.2 [63.9 MB]
Fetched 64.0 MB in 6s (9,372 kB/s)                                             
Selecting previously unselected package daemon.
(Reading database ... 433471 files and directories currently installed.)
Preparing to unpack .../daemon_0.6.4-1_amd64.deb ...
Unpacking daemon (0.6.4-1) ...
Selecting previously unselected package jenkins.
Preparing to unpack .../jenkins_1.651.2_all.deb ...
Unpacking jenkins (1.651.2) ...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for systemd (225-1ubuntu9) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up daemon (0.6.4-1) ...
Setting up jenkins (1.651.2) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
[ ok ] Starting jenkins (via systemctl): jenkins.service.
ln: failed to create symbolic link ‘/run/openrc/started/jenkins’: No such file or directory
Processing triggers for systemd (225-1ubuntu9) ...
Processing triggers for ureadahead (0.100.0-19) ...

me@mydevbox:~$ sudo /etc/init.d/jenkins start
[ ok ] Starting jenkins (via systemctl): jenkins.service.
me@mydevbox:~$ sudo vim /etc/default/jenkins 
me@mydevbox:~$ /etc/init.d/jenkins restart
[ ok ] Restarting jenkins (via systemctl): jenkins.service.
me@mydevbox:~$ 

This is what I've specified for the HTTP port in the jenkins config file:

# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080

After that, I ran this:

me@mydevbox:~$ sudo a2enmod proxy
Enabling module proxy.
To activate the new configuration, you need to run:
  service apache2 restart
me@mydevbox:~$ sudo a2enmod proxy_http
Considering dependency proxy for proxy_http:
Module proxy already enabled
Enabling module proxy_http.
To activate the new configuration, you need to run:
  service apache2 restart
me@mydevbox:~$ service apache2 restart
me@mydevbox:~$ sudo a2dissite default
ERROR: Site default does not exist!
me@mydevbox:~$ sudo a2dissite 000-default
Site 000-default disabled.
To activate the new configuration, you need to run:
  service apache2 reload
 me@mydevbox:~$ service apache2 reload

And then I created a jenkins.conf file in /etc/apache2/sites-available/ That file looks like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName ci.company.com
    ServerAlias ci
    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPreserveHost on
    ProxyPass / http://localhost:8080/ nocanon
    AllowEncodedSlashes NoDecode
</VirtualHost>

At this point, when I try to run:

http://localhost:8080/

That launches jenkins.

But I no longer can run my other sites which i launched like this:

localhost/mytestapp

The error I get is:

HTTP ERROR 404

Problem accessing /mytestapp/. Reason:

Not Found

Prior to attempting Jenkins install, I just installed apache2 and left all defaults. I would just create folders under /var/www/html and they would "just magically" appear in my browser.

Sorry for the trouble. But any help would be appreciated.

EDIT 1

I think my problem is related to this:

 me@mydevbox:~$ sudo a2dissite 000-default
 Site 000-default disabled.

I never noticed that in the output before. When I checked that file, it looks like that was the original conf I had.

Here's what I have in the sites-available folder:

me@mydev:/etc/apache2/sites-available$ ls -lah
total 24K
drwxr-xr-x 2 root root 4.0K May 30 11:06 .
drwxr-xr-x 8 root root 4.0K Apr 19 15:18 ..
-rw-r--r-- 1 root root 1.5K Apr 19 15:30 000-default.conf
-rw-r--r-- 1 root root 6.3K Jan  7  2014 default-ssl.conf
-rw-r--r-- 1 root root  282 May 30 11:06 jenkins.conf
me@mydev:/etc/apache2/sites-available$ 

So I guess I need a way to re-enable 000-default.conf and just add an entry for jenkins to use port 8080 or something like that. Googling for examples but in the mean time, if you have any suggestions, I'd appreciate them.

Thanks.




Javascript store video

I am currently working on a Unity Webgl project and I am new to javascript and web .

In my project the user have to be able to add pictures and videos to the the webgl player, picture works fine (thanks to gman's code on this thread). I use it as a base for my scrip. Of course I have changed the input accept to be able to get video (mp4 only). But I am getting some trouble.

I have read this tutorial and all the doc I have found about javascript File, blob, etc. But I didn't make it work. I believe there is something I don't understand with FileReader since the console.log on the "load" listener is never called, same for the "onerror" listener except when I click on cancel (from the code here).

      function getPic(evt) {
    var file    = document.querySelector('input[type=file]').files[0];
    var reader  = new FileReader();

    reader.addEventListener("onload", function () {
        reader.readAsDataURL(file);
        console.log(reader.result);
    }, false);
    reader.addEventListener("onerror", function (error) {
        console.log("error" + error);
    }, false);
  }

I have tried onloadend too but it don't work, since the onload/onloadend listener is never called my script print "null". Is that a good beginning or is there a simpler way to get video/image from user computer ?




Undefined scope after ldap search PHP

I want to receive through LDAP the user's givenname.

I am using the following code:

$ldap = ldap_connect("ldap://domain.com");
        ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
        ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
        if ($bind = ldap_bind($ldap, $myusername, $mypassword)) 
        {
            $_SESSION['login_user'] = $myusername;
            $filter = "(sAMAccountName={$myusername})";
            $ldap_dn = "dc=domain, dc=com";
            $attr = array("givenname");
            $result = ldap_search($ldap, $ldap_dn, $filter, $attr) or exit("Unable to search LDAP server");
            $entries = ldap_get_entries($ldap, $result);
            $givenname = $entries[0]['givenname'][0];
            ldap_unbind($ldap);

            setcookie("name", $givenname, time() + (86400 * 30), "/");  

            setcookie("sessao", $local, time() + (86400 * 30), "/"); // 86400 = 1 dia
            //header("location: welcome.php");

        } 

Whenever I login, in the welcome page, the cookie "name" is empty, so I removed the redirect to see what is happening.

Now I am receiving the following error:

Notice: Undefined offset: 0 in C:\wamp\www\OperPHP\authentication.php on line 21

Observation: Line 21 is:

$givenname = $entries[0]['givenname'][0];

I guess is something in my LDAP query, but I don't know where it could be.

Anyone could help?




firebase.initializeApp callback/promise?

This is my web page

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Calcolo Diliuzioni</title>

    </head>
    <body>

        <h1>My app</h1>

        <!-- Libreria per gestire l'autenticazione con google -->
        <script src="http://ift.tt/1bMh26W" async defer></script>

        <!-- Firebae config -->
        <script src="http://ift.tt/24gI965"></script>
        <script>
        // Initialize Firebase
        var config = {
        apiKey: "",
        authDomain: "",
        databaseURL: "",
        storageBucket: "",
        };
        firebase.initializeApp(config);
        </script>

        <script type="text/javascript">
            var user = firebase.auth().currentUser;
            if (user) {
                console.log(user);
            } else {
                console.log(user);
            }
        </script>
    </body>
</html>

Let's assume I have an already logged user. When I load the page in the console I got null. While I'm expecting to have the current user's object.

If I run the same code in the browser console

var user = firebase.auth().currentUser;
if (user) {
    console.log(user);
} else {
    console.log(user);
}

I'm able to get the current user's object.

I think that the firebase.initializeApp(config); has some async behavior. What's the right way to work around it? Should I use a promise or something on the firebase.initializeApp(config); function? A sort of callback..




Customized Google Maps link get reseted

I try to customize a GoogleMaps link.

based on this answer: How to calculate zoom URL parameter at the Google Maps Preview (new version GM)?

I ve created the following link:

http://ift.tt/1smELeo

//represents Berlin

But when i press it LAT and LONG gets reseted and it doesnt show me the location i want, but the USA.

What is wrong with the link?




i writing a code for webcrawling here i m able to fetch data but the prepared statement is not allowning to insert data in mysql Db

the code displays all products and prices just need to insert in db error showing at stmt.setstring(1, title) can any one explain this error The method setString(int, String) in the type PreparedStatement is not applicable for the arguments (int, Elements)

import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Set;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

@SuppressWarnings("unused")
public class Main {

    public static DB db = new DB();

    public static void main(String[] args) throws SQLException, IOException {
        db.runSql2("TRUNCATE Record;");
        processPage("http://ift.tt/1UdNndi");
    }

    public static void processPage(String URL) throws SQLException, IOException {

        String url = "http://ift.tt/1UdNndi";
        Document doc = Jsoup.connect(url).timeout(1000 * 100).get();

        Document doc1 = Jsoup.connect("http://ift.tt/1XZr4hu")
                .followRedirects(true).timeout(1000 * 100).get();
        Elements title = doc.getElementsByClass("rttl");
        System.out.println("title is: " + title);

        Elements price = doc1.getElementsByClass("gl-cpr2");
        System.out.println("Price is: " + price);


        String sql = "INSERT INTO  data " + "(Product Name) VALUES " + "(?);";
        ResultSet rs = db.runSql(sql);

        PreparedStatement stmt = db.conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
        stmt.setString(1, title);
        stmt.execute();

        String sql1 = "INSERT INTO  data " + "(Product Name) VALUES " + "(?);";
        ResultSet rs1 = db.runSql(sql);

        PreparedStatement stmt1 = db.conn.prepareStatement(sql1, Statement.RETURN_GENERATED_KEYS);
        stmt.setString(1, price);
        stmt.execute();



    }
}




how to handle the remember password ( cookies ) for more than one login page in same application

how to handle the remember password ( cookies ) for more than one login page in same application and how to store their username and password in different cookies ? Description : I have two login page with different name but have the same controls on page . One page is used for Admin and another is used for User . If i remember the username and password for admin and then login next time, it remember the username and password for admin login page and user login page (vice-versa). i want to remember the username and password differently for both admin and user.




website to load only in mobile browser

Is there is any possibility to make an website to load only in mobile browsers. I knew media query does the trick, But not really sure is there is any specific meta tag for it. If there is any possibilities what will be the best practice to do so. Any advice will be greatly appreciated.




Antivirus detection on client devices

how to detect if any Antivirus solution is present on web or mobile client devices? and know what product or version is currently active ? this is drive banking application users to use antivirus, endpoint protection systems.




Dynamic routing with array of values AngularJS

I would like to provide a dynamic route with AngularJS and get an array of value, like we would do with GET request parameters : (/?id[]=1&id[]=2..) I do not know if angular js provides a "clean" way like :

/array/of/value/[1,2,3,4] 

And get the array with ngRoute and $routeProvider :

.when("/list/:arrayOfValue", {templateUrl: "./partials/list.html", controller: "ListController"})




a specific Website does'nt load on my internet but loads on other networks

Our website Social Dunya News does not loads on my office internet, but loads on other networks. I am facing this problem from a week. Please provide me a better solution. What should i do ?




How to check Firebase's connect timeout event

I'm using Firebase in China. But I find the Firebase can not connect to the firebase's server sometimes. Are there any API to check this event? Or check this event? Thank you.




how to consume the restfull webservices input is .TSV file from JSON in java

In my program i am getting the response of the request in xml with .TSV file i want to consume that in to my java web app using jersey and build restfull webservice and send it to other user(site/local)will you please help me thanks in advance




track hits & visibilities

I have a dynamic database driven web site. For a search result list, each item is counted as being visible once, if the individual item is clicked, it is counted as a hit. My question: what is the best way ( or reasonably good way) to track the count of visibility & the count of hits. Thanks a lot.




How I can fix element

How I can fix my count text on div block? There is a problem when you change the screen size. Example: Normal On screen resize

HTML:

<div class="col-sm-4">
                    <div class="top-block">
                        <div class="huge"><i class="fa fa-book"></i></div>
                    </div>
                    <div class="well">
                        <span class="badge right-corner">${count}</span>
                        <h4>Архів</h4>
                        <a class="watcher" href="/edocs/main/archive/${offnoteType}"></a>
                    </div>
                </div>

css:

span.right-corner{
position: relative;  
float: left; 
left: 250px;  


   bottom: 25px;  
    width: auto;  
}

div.top-block{
    position: relative; 
    float: left; 
    left: 240px;
    bottom: 40px; 
    width: auto; 
}




dimanche 29 mai 2016

how to involve in already started project (Java web application) as developer?

I am very confused about carrying on a project that's already started by someone else. I am a java developer. Please help me with suggestions to carry on project in a managed way.




Ideal time of service response

We are consuming a third party vendor web service and updating our live database with some of the key information. We have scheduled a simple console application that runs every 15 mins and gets around 100 (on an average) records and updates the database. There is also a button provided in the UI that updates the database only for the selected record in real time (calling the same service). This is how we are using the vendor service.

The only problem is the service is taking around 2 to 3 minutes to return the result. I'm having very bad instinct on this 3 minutes of time, won't it effect my system performance as well as i'm keeping my server busy for 3 minutes on every 15 minutes?

Will there be any best practices/guidelines doc that I can share to my vendor and reject/ask for optimize the service ?

Thank you




I need help making a ribbon effect on a box in css

I am very new to this site so bare with me.

I'm having a lot of problems bringing in the sides on this image. http://ift.tt/1UdCB6X

I have tried to make indents on the two sides come in about 10 degrees and keep the stitching going with the indents for majority of the day.




Reactjs props not showing up. How can I improve my code?

// initial state and other properties

    var ReviewControl = React.createClass({
        getInitialState: function() {
            return {
                name:'',
                feedback:'',
                movie:'',
                reviews:[] 
            };
        },
    onChangeName:function(el){
        this.setState({name:el.target.value})
    },

    onChangeFeedback:function(el) {
        this.setState({feedback:el.target.value})
    },

    onChangeMovie:function(el){
        this.setState({agent:el.target.value})
    },

    submitReview:function(el) {

//preventing default for the form

        el.preventDefault();

//storing data into the reviews array created earlier

        this.state.reviews.push(
            {name:this.state.name, feedback:this.state.feedback, movie:this.state.movie});
        this.setState({name:'', feedback:''});
    },

    render: function() {
        var options = this.props.list.map(function(agent){

            return (<option key={agent.id} value={agent.agentName}>{agent.agentName}</option>);
        });

//rendering the form for feedback

        return (

            <div>

//creating form

                <form onSubmit = {this.submitReview}>
                    <lable> Agent Name : </lable>
                    <input type="text" placeholder='Enter The Agent Name' value={this.state.name} onChange={this.onChangeName} />
                    <br/><br/>


                    <lable> Feedback : </lable>
                    <input type="text" placeholder='Enter Your Feedback' value={this.state.feedback} onChange={this.onChangeFeedback} />
                    <br/><br/>

                    <select onChange={this.onChangeMovie}>
                        {options}
                    </select>

                    <br/><br/>

                    <input type="submit" value="Submit"/>

                </form>

//collecting the reviews

                <ReviewCollection reviews = {this.state.reviews} /> 

            </div>
            )
    }


});

// collecting all the reviews from the user and storing it

var ReviewCollection = React.createClass ({

    render:function () {

        var reviews = this.props.reviews.map(function(review) {
            return <Review key={review.id} movie = {review.movie} name = {review.name} feedback = {review.feedback} />
        });

        return (<div> {reviews} </div>)
    }

    });

//showing the stored values from the array review

var Review = React.createClass({
        render:function(){
            return <div>

                <span> Agent Name </span>
                {this.props.name}
                <br/>

                <span> Movie Name </span>
                {this.props.movie}
                <br/>

                <span> Feedback </span>
                {this.props.feedback}
                <br/>
            </div>
        }

});

// rendering the form

var finalReview = <ReviewControl list={agentList} />;
ReactDOM.render(finalReview, document.getElementById('myid'));




Pie graph not showing

I'm new to JS. I'm trying to display a pie graph, with a line graph underneath it. I have the pie graph working and the line graph working.

When my HTML looks like this, it shows the pie chart.

<body>
    <div id="canvas-holder" style="width:50%">
        <canvas id="chart-area" width="300" height="300" />
    </div>

    <!--<div style="width:75%;">
        <canvas id="linegraphcanvas"></canvas>
    </div>-->

    <script src="piestuff.js"></script>
    <!--<script src="linestuff.js"></script>-->
</body>

When I uncomment the parts above, only the line graph will show.

Why could this be? I have a feeling it's something small to do with how html/js works and not my code (as it's running fine with the other commented out)

Thanks




What are example instances do we need to parse XML as input?

Hi I just want to be familiar on XML as inputs. Found out that this could be a hole in your application as XML External Entity vulnerability.

Answers would be so much appreciated.

Thanks!




how to fixed this MySQL error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES (null,'admin','admin')' at line 1




How do I adjust the location of these navbar elements when screen size changes?

I am making a site with bootstrap. It is responsive, but not in the way I want it to be. When I change the screen size, the navbar tabs get cluttered together.

Here's my code: http://ift.tt/1sliBsQ

Thanks so much!




If I am making a static website, do I need web server software?

Do I need software such as Apache on my ubuntu server, or is placing the html and other files in /var/www/ sufficient?




Factory is not a function in my controller

I am trying to write a factory and use it in one of my controllers, but it gives me an error:

TypeError: wordsToTrain is not a function

I made my controller and factory very simple but still don`t get why is this happening:

angular.module('bananaApp')
  .controller('TrainingCtrl', [ '$scope', 'wordsToTrain', function ($scope, wordsToTrain) {
    wordsToTrain();
  }]);

angular.module('bananaApp')
  .factory('wordsToTrain', function () {
    return  3;
  });




How to align text in a padded-out input-field/ box?

err..Hi guys :)

I'm making an application for the company I'm interning with. I've completed a part of the front end and there was one small problem I needed help with. The code is at

http://ift.tt/1TOMryZ

Or else you may shoot up the landing page straight up by clicking

http://ift.tt/1XGSNmD

As you might see, the input fields have their placeholder brought left because of the extra (necessary) padding I gave. Can anybody here suggest me something as to how align the placeholder (and hence the text) with the left border of the input field?




Web Application not able to connect to db

Stack Trace:

[Win32Exception (0x80004005): The system cannot find the file specified]

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]

I have deployed my database to the server using ssms 2016, and added the connection string to my web application that is deployed.However I received the following error message posted above.I suspected that the application cannot reach the database.

I tried changing the connection string several times to no avail




Scripting on Website - JQuery, Selenium IDE, and javascript clicks don't work

My friend and I like to practice scripting for fun in the javascript console. This one stumped us. Would love your advice.

We were trying to script clicking the "follow" button on THIS URL. You'll need to sign up to try it.

The first thing we tried was:

$( '.btn-white' ).click ();

Which is the most obvious thing. Select for the class. It didn't work. It DID select all the correct buttons. But didn't click.

We then tried using .trigger() still nothing. Also tried mousedown events

We looked into it a bit deeper, saw they were using Handlebars and thought that it might cause issues with the JQuery so wrote the script with javascript instead. The function would run and again select the right buttons, but wouldn't click the button.

Finally, just because we were curious, we downloaded the Selenium Firefox IDE just to see what it would do. It also is unable to click the button. It also runs smoothly, thinking that it clicked everything, but is unable to execute the actual click.

Any idea what the solution to our puzzle is? Or even WHY this is happening? Very curious since we've never seen this before in our exercises.




Can't download flv from website - stream

I want to download this website movies But i cant. no video link in page source. no download link. they using stream . now how can i download this movie? FLV Link




samedi 28 mai 2016

how to pass a variable from javascript function to php file without reloading the current html page in which javascript function is written?

function change( el)
{
    if ( el.value == "ON" )
    { 
        el.value = "OFF"; 
        el.style.backgroundColor = "#ff3333"; /* Red */
    }
    else
    { 
        el.value = "ON"; 
        el.style.backgroundColor = "#4CAF50"; /* Green*/
    } // works till here like expected.



    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() 
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
        {
            }

    }
    xmlhttp.open("GET", "postform.php?switch=" + el.value, true)
    xmlhttp.send();
}




Find text in element that is NOT wrapped in html tags and wrap it with

<div class="menu-content">
  <h3>Lorem Ipsum</h3>
  TEXT THAT NEEDS TO BE WRAPPED
  <ul>
    <li>List Item 1</li>
  </ul>
</div>

I got the code above (it gets generated automatically so I can't manually wrap the text), I need to filter through the content of ".menu-content" and find the text that is not wrapped in a html tags and then wrap that text in a p tag.

I tried the following jQuery code:

$('.menu-content').find(':not(h3, ul)').wrap('<p></p>');




What's wrong the HTTP response my webserver is generating [on hold]

This is the output from my webserver:

b'HTTP/1.1 200 OK\r\nDate: Sun, 29 May 2016 15:49:41 AUS Eastern Standard Time\r\nServer: theJamesServer \r\nContent-Length: 81\r\n Content-Type: text/html\r\nConnection: Closed\r\n\r\n<DOCTYPE! html><html><head></head><body><p>Hey</p></body></html>'

Please I don't understand why the web browser doesn't understand it?




c# web api token authenticacion and no authenticacion at the same api

I have a c# web api without token authentication, i need to add token authentication, but i need that one of the routes of the web api don't ask for token, being public access.

I alredy search on youtube but don't show how to do or if it can be done.
thak's for any help.




Any recomendations or good guides on deploying a website from Windows Server 2008 to GoDaddy?

As the question states, I am interested in deploying a website using Win Server 2008 using a domain on GoDaddy.

Can anyone please provide maybe some links, guides, good books and recommendations are also very, very welcome.

I am thinking about starting off with a static page, but maybe in the future I can start working with web apps and databases.

Also, I already have a server with a static IP, I just need help on setting everyhing else.

Thanks!




How can I extract a pattern on a web page in unix

I wanna extract all sentences included a pattern from a web page in unix shell scripting. How can I do it? are sphinx or swish++ useful for this?




web project in java

I am creating a java project for the WEB which has multiple jsp(view) pages, which either insert or queries a database. I created the main page and links to each jsp. At this point I am unsure whether I should put each component of the project( MVC pattern with jsp, servlet, a java file) into its own web application ( I use Eclipse ide ) and its own war file for uploading to the web server. Is this a proper way to build my web project? The problem I have with this approach is each component/application would have their own jdbc driver which seems redundant. I have thought about grouping the "inserts" together in one application and the "queries" in another. Would that be a good way to proceed? Your advise would be greatly appreciated.




Trying to copy an image file and move it to a new folder that is dynamically created. java web [duplicate]

This question already has an answer here:

Trying to copy an image file and place it in a new folder that is generated dynamically. Not sure why the file is not being created? The folder gets created under the username of the currently logged in user but the image does not copy across. Any ideas why this is happening? Thanks for your attention.

public String directoryAbsolute = "C:/Users/jonathanlal/workspace/jonaProjects/testproject/WebContent/UserFiles";

public File defaultcover = new File("C:/Users/jonathanlal/workspace/jonaProjects/testproject/WebContent/img/cover.png");

String username=request.getParameter("username");


String fileName = username+"_"+"cover.png"; 
File folderdestination = new File("C:/Users/jonathanlal/workspace/jonaProjects/testproject/WebContent/UserFiles" +  username  + File.separator + fileName);

String directory = directoryAbsolute + File.separator + username;;
                        File fileSaveDir = new File(directory);
                        if (!fileSaveDir.exists()) {
                            fileSaveDir.mkdir();
                            Path test = Files.copy(defaultcover.toPath(), folderdestination.toPath());
                            Files.createFile(test);


                        }




Flash web apps, can I get source data

I want to create a .net application that will load a webpage containing a flash player for streaming music.

The app should be able to get the title of the current song being played. And maybe be able to put on diffetent songs.

I know with, for example, HTML, you can just get the content out of an element, but is this possible with a flash web app of any kind of company?

Thanks




Web apps using django and integration of other frameworks

I am building a web application(a dynamic site) using Django framework. I will require to add some real-time features such as chatting , video conferencing , online whiteboard collaboration etc. I know Django is not that great when it comes to real-time apps. So I would like to ask is there a way where I can integrate other services into Django to build real-time app say chat app . for example can I use Node.js with Django or any other technology.

Also I would need to visualise data in my site so what is the best way to do that?




Loading an image of a website that contains redirects

I am currently doing a small app for fun while playing around with the UIs and several other things in android studio. I tried to load a image based on an url with this code:

URL urlConnection = new URL(url);

HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setAllowUserInteraction(false);
connection.setRequestMethod("GET");
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);

However this will throw a FileNotFoundException for certain urls. I am guessing that is due to the webpage checking the client for certain conditions. One example is this image: http://ift.tt/22s5CC8 It works fine when loading it via the webbrowser though. I do not own this page, so I do not know what is causing this issues. Is there any way to debug/solve this?




Let grow if grows

Because I didn't find a post with this topic I'm gonna create my own (first ;-) ) post. So, I've got a question. How can I move all the elements below a paragraph, that is contenteditable, when I type something. Here is my code:

                      body, html {
                                margin: 0;
                                padding: 0;
                                background-color: white; 
                        }       
                        
                        .input {
                                border: 1px dotted black;
                                width: 30%;
                                float: right;
                                left: 45%;
                                height: 40px;
                                position: absolute;
                                background-color: #8CE1FF;
                                color: #6E6E6E;
                                font-size: 16px;
                                font-family: 'Arimo';
                        }                       
                        
                        .input:hover {
                                border: 1px solid black;                        
                        }
                        
                        
                        #content {
                                border: 1px dotted black;
                                width: 50%;
                                float: right;
                                position: absolute;
                                background-color: #8CE1FF;
                                color: #6E6E6E;
                                font-size: 19px;
                                font-family: 'Arimo';
                                height: 40%;
                        }
                        
                        #content:hover {
                                border: 1px solid black;
                        }
                        
                        .details {
                                margin-bottom: 30px;
                                z-index: 900;
                                font-family: 'Arimo';
                                font-size: 17px;
                        }
                        
                        section {
                                background-color: #53CFFC;
                                margin: 20%;
                                z-index: 901;
                                border: 1px solid black;
                        }
                        
                        #button {
                                color: #C0C0C0;
                                margin-top: 5%;
                                background: #168CB7;
                                border: 1px solid #0C8FBF;
                                height: 40px;
                                width: 100%;
                                font-family: 'Arimo';
                                font-size: 20px;
                                position: relative;
                        }                       
                        
                        #title {
                                height: 40px;
                                text-align: center;
                                font-family: 'Arimo';
                                font-size: 20px;
                                background: #168CB7;
                                color: #C0C0C0;
                        }
                        
                        #form {
                                padding: 4%;
                        }
<!DOCTYPE html>
<html>
<head>

                <title> Test </title>
                <script src="http://ift.tt/1pD5F0p"></script>

                </head>
        
                        

                

        <body>

        <section>
                <div id="title"> title </div>
                
                <div id="form">
                
                <div class="details">     Name <strong>*</strong>:                                                                                                            <input type="text" class="input" id="name">       <br> </div>
                <div class="details">     Mail <strong>*</strong> : <input type="text" class="input" id="mail">                 <br> </div>
                <div class="details">     Website:                                                                                                                                                                                                <input type="text" class="input" id="name">       <br> </div>
        
                <br>
                <div class="details"> Text: 
                <p id="content" contenteditable="true"> Click to write your post. </p>
                        <br>              
                </div>
                
                </div>
                
                
                <button id="button" onclick="">Submit</button>
        </section>

        </body>
</html>

I hope you understand my problem and help me. :-) fiddle: http://ift.tt/1NUHvcy

LG adagi

// Sorry for my bad english, I'm from Switzerland and I'm learning english since 4 years only. :c Correct every mistake c:




how to create site like zbigz ,seedr, converting torrentfile to webfile

Blockquote

how to convert torrent file to web file .and stream torrent file live on site >without software. like other site do zbigz.com , seedr.com is anyone have code for it. or any suggestion.




SignalR broadcast using Entity Framework and Unit of Work

I will be working in the remaking of an old legacy project. The new implementation will use EntityFramework and Unit of Work.

In the old project there are a lot of popups that show up when some value changes in the database. This is implemented with constant polling and logic checking if the value is different from the last one cached. As you can see this is slowing the project a lot.

For the new one I'll like to explore the best options to send SignalR notification when some particular models change in the database in the context of Unit of Work. I have some ideas but they don't seem good enough to me.

Can you give me sample implementation of some good practice in such scenario?




CSS prevent from resizing at a point?

Hi all I am making a website and I am trying to make the width of the object to not overscale, i.e I have a body tag and I set the page width to 60% and that is fine and now I am trying to set min width of xx% so the elements will not go over each other and I am trying to stop the browser from going over that xx% and show all content on the page.

I hope someone understands what i am trying to do and will help me with this.

Thanks




Apache redicection to cgi-sys/defaultwebpage.cgi. .htaccess empty

My problem is that I am trying to access my domain name, (up to a few months ago was showing a coming soon splash page) and I'm being redirected to cgi-sys/defaultwebpage.cgi.

I've tried placing an index.html file in www directory to no unveil.

I've made some research which points to the .htaccess file, which is empty. Does a site still work if .htaccess is empty ? If not what do I do ?

I'd appreciate help on this.

Thanks in advance.




Client of social and web services - what it could be?

I want to prepare school project in topic given by teacher "Client of social and web services" and I want to ask for your point of view.

I don't feel that topic very well.. for me it is something like make reservation to doctor via mobile app (social) (app for local community) or maybe something like facebook?

Thanks for all opinions




sequence of javascript events

I want to serialize 2 events in my web application. I have change event tied to an input field and click event tied to a button. User sometimes enters value is input field and presses button immediately.

I want that change event should be called before click event.




Open cart buy now button clearing all my cart data when I use buy now button?

I have integrate buy now extension in my open cart web app. When I click buy now it works perfectly but it clear all my cart data. Open cart version is 2.2 and I have integrate huntbee extension. Here is the url for the buy now extension. http://ift.tt/1XDWQ34

How can I solve it. Anyone please help me. Thanks in advance.




vendredi 27 mai 2016

Best/s web framework/s for high performance applications

I know that this is a vague question because an application performance depends on a lot of things, not just the web framework, depends more like on the whole implementation of the system.

And i know also that this is quite a subjective thing, that allows many probably good answers.

But... if you are a software enginner responsible for write a web application that is going to be used by millions and millions of users per day which framework/s would you choose and why?

Thanks for taking the time of reading this.




How to load a file.rpt [report file with data] on a CrystalReportViewer object?

I a newbie on ASP.NET. I got the following trouble... I would like to load a file with data, this file is a Report file .rtp, on a CrystalReportViewer object. I have seen several codes online about this, but those I've seen use Connection to a database. So it's not what I am needing. Further details or so, I am here to share!

Regards From Costa Rica.




spring @value returns null [duplicate]

This question already has an answer here:

I'm using spring 3.2.2 and what to inject some string in my .properties file into a class. But always get null.

In my applicationContext.xml:

....
<context:component-scan base-package="com.mypackage">
     <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/
</context:component-scan>
<context:property-placeholder location="classpath:/config/core/abc.properties"/>
....

in abc.properties:

path=testpath

in java code:

package com.mypackage
@Component
public class myclass implements Imyclass {
@Value("${path}")
private String path; //this always is null
...
}

what I'm missing here?




WarLauncher in SpringBoot does not read external resources

I have a SpringBoot application that should be able to read some external files from a S.O. folder.

Creating a JAR build, I can use the VM parameter "-Dloader.path" and set the folder where the external files will be, and after that the application reads them via classpath loader.

Sadly my SpringBoot application is WEB, because there are pictures, jsp that should be in WAR format and read them via ServletContext.

Using the JAR format the build is created using PropertiesLauncher to load the application, and WAR format uses WarLauncher. PropertiesLauncher is able to read external folders, but WarLauncher is not.

Is there any way to inform the WAR about those external folders? Some kind of VM parameter, or even a property for it.

It would be nice to have some kind of launcher that mixes WAR with JAR features for class loading resources.

By the way, the JAR format uses ZIP layout on MAVEN to work, but WAR does not accept this layout giving error about the directory.

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <layout>ZIP</layout>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>               
</plugin>




need help in sql query [on hold]

Table 1

id |UserCNIC | Subject | UserMessage                    |DateTime           
4  |9698     | Hello   | Hi sir                         | May 27 2016  9:19PM
5  |9698     | Fine    |I am Fine , whare You from sir? | May 27 2016  9:23PM


Table 2

id |UserCNIC |AdminName   | Subject |AdminMessage         | DateTime
5  |9698     |Admin       |Hello    |Hi User How Are YOu? | May 27 2016  9:20PM
6  |9698     |Admin Place | Replay  |I Am From UK..       | May 27 2016  9:24PM


Required Result ...

9698  | Hello        |  Hi sir                        |  May 27 2016  9:19PM 
Admin | Hello        |Hi User How Are YOu?            | May 27 2016  9:20PM
9698  | Fine         |I am Fine , whare You from sir? |May 27 2016  9:23PM
Admin | Place Replay | I Am From UK..                 |May 27 2016  9:24PM

========================================================= Kindly tell me the query for this which select the data from two tables and give us the result in this form order by data and time in both tables....




web application deployment in weblogic failure : Proxy authentication failure

I'm trying to deploy a web application in weblogic 11g server. When I deploy this application, weblogic is throwing following error(Stack trace is below).

Once I hit the URL of this application, it has to create a SOAP message and hit a cloud application using HTTPS protocol. We have a proxy server in between. When I hit the URL of web application it takes some time and browser respond with blank page(500). I checked weblogic server log and found this exception. Also I have set the system properties for proxy with required proxy IP and port in the web application while creating the URL to hit the cloud application. I am not able the find the exact issue. Went through many online forum and post and tried many solution. Could not find an exact solution. I'm new to weblogic server. Do not have much idea about this. Was all ready with the web application to deploy in tomcat server. At the last moment client came up with webloigc server and a proxy server in between. Any suggestions and comments will be highly appreciated.

Thanks in advance

java.net.ProtocolException: Proxy or Server Authentication Required
at weblogic.socket.utils.ProxyUtils.getAuthInfo(ProxyUtils.java:279)
at weblogic.socket.utils.ProxyUtils.getProxySocket(ProxyUtils.java:199)
at weblogic.socket.utils.ProxyUtils.getSSLClientProxy(ProxyUtils.java:239)
at weblogic.socket.SocketMuxer.newSSLClientSocket(SocketMuxer.java:397)
at weblogic.socket.JSSESocketFactory.getConnectedSocket(JSSESocketFactory.java:92)
at weblogic.socket.JSSESocketFactory.createSocket(JSSESocketFactory.java:65)
at weblogic.security.SSL.SSLSocketFactory.createSocket(SSLSocketFactory.java:140)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:289)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:363)
at weblogic.net.http.HttpsClient.New(HttpsClient.java:518)
at weblogic.net.http.HttpsURLConnection.getHttpClient(HttpsURLConnection.java:330)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:450)
<our custom methods are here to create SOAP XML to hit a cloud application>
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)




Get value of Capacitor of capacitive touch in the form of farads in Android and IPhone (kernel level )

i want to access the value of capacitors of capacitive touch in android and iphone using background process application and than need to pass them to server is that possible




Does Google display AMP search results to tablet devices?

In implementing AMP, I need to know whether to prioritize for tablets as well as smaller mobile devices. Or, put another way, what is the max browser width that will see an AMP page? (The various breakpoints etc.)

I can't seem to find any Google docs on this.




Can websites share data stored on the client-side?

Is there any way for a website to communicate with another storing data on the browser?

I think cookies are strictly available to the same domain (and subdomains), but I notice suspicious cases in which websites seem to be able to track my presence on another site.

I also have NoScript to block per-site JavaScripts.




Can you make navbar-brand active?

Is it possible to make this "active"?

    <a class="navbar-brand glyphicon glyphicon-home active"  href="http://localhost:8080/LuckySevenWeb/" ></a>




Making incision on a unity3d model

Well the question says it all. Please help me on this. I am unable to find a lead on this question. I want to make an incision on a 3d unity model of a human being. How is it possible? Any type of feedback will be appreciated..




How to pass completed async job result to a client requested that job

I have a web site which publishes by a client request a job to a queue (RabbitMQ) Then worker gets notified of it, performs the job and calls the web site API endpoint to save the result to DB.

The question is how in general a client finds out the job status has being changed? Does it poll the web site?




Using the Spotify Web API, can you get audio features for a NON-spotify hosted track?

I want to host a track and use the Spotify Web API to analyse the audio features of the track. Is it possible to replace the Spotify ID with an external URL?




Firefox redirect section bug

I'm trying to redirect to my price section of my webiste by the following link: http://ift.tt/1U0yMSI

<a href="http://ift.tt/1U0yMSI"></a>

Google chrome works correctly, already in firefox does not work.

but this only occurs via link, if you put the url "http://ift.tt/1U0yMSI" and press enter in the browser works, but not via link!

why is that?




How to play Encrypted video using web API 2

According my requirement to stream video online i found following link to help me out

HTTP 206 Partial Content In ASP.NET Web API - Video File Streaming

Now over this i m using another Encryption library to encrypt my video file.For some reason small size video work fine but large size video not working or not responding. below is my Decryption code so anyone can suggest me any possible solution.

 private static byte[] AES_Decrypt(byte[] bytesToBeDecrypted)
    {
        string password = "abcd1234";
        byte[] passwordBytes = Encoding.UTF8.GetBytes(password);
        passwordBytes = SHA256.Create().ComputeHash(passwordBytes);

        byte[] decryptedBytes = null;

        // Set your salt here, change it to meet your flavor:
        // The salt bytes must be at least 8 bytes.
        byte[] saltBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };

        using (MemoryStream ms = new MemoryStream())
        {
            using (RijndaelManaged AES = new RijndaelManaged())
            {
                AES.Padding = PaddingMode.Zeros;
                AES.KeySize = 256;
                AES.BlockSize = 128;

                var key = new Rfc2898DeriveBytes(passwordBytes, saltBytes, 1000);
                AES.Key = key.GetBytes(AES.KeySize / 8);
                AES.IV = key.GetBytes(AES.BlockSize / 8);

                AES.Mode = CipherMode.CBC;

                using (var cs = new CryptoStream(ms, AES.CreateDecryptor(), CryptoStreamMode.Write))
                {
                    cs.Write(bytesToBeDecrypted, 0, bytesToBeDecrypted.Length);
                    cs.Close();
                }
                decryptedBytes = ms.ToArray();
            }
        }
        return decryptedBytes;
    }




Is it possible to make the PC as a web storage?

I am looking for a space storage for my website because my hosting server has a limited space storage and my question is... Is it possible to make the PC as a web storage? Thank u for the answers...




How to use Value of an Variable of JSP page in JAVA CLASS

I know its easy to use values of form ,from jsp to java,But how to use a variable value of JSP code into java class. For e.g., I want to use value of vlaue in a java class any help will be appreciated,thanx

  <%
     String value=null;
    value= (String) session.getAttribute("name");

    %>




I am trying to write a web browser in c# any tips on getting started e.g getting libraries or something like that

Can any of you help me by telling me some good libraries for c# and stuff like that ?




Unable to open my website on mobile

I am unable to open my website on mobile using mobile network but if I am connected to wifi it opens without any delay. I am also able to open it on desktop.




Removing space between two html elements: textbox and glyphicon

I want to dynmaically add rows in an html form. However, I have small issue: My form is:

<html lang="en">
<head>
    <!-- CSS -->
    <link rel="stylesheet" href="http://ift.tt/1jAc5cP"/>
    <!-- Javascript -->
    <script type="text/javascript" src="http://ift.tt/1mWWrGH"></script> 
    <script type="text/javascript" src="http://ift.tt/25pxzjl"></script>
    <script src="scripts.js"></script> 
</head>

<body>
    <div id = "mydiv" class="controls  multi-field-wrapper row">
        <div class="multi-fields">
            <div class="multi-field col-md-11 col-lg-11">
                <input type="text" name="how_many[]" placeholder="How many?" class="col-md-6 col-lg-6" >
                <input type="text" name="where_when[]" placeholder="When and Where?" class="col-md-5 col-lg-5 " >
            </div>
        <a href="#" class="col-md-1 col-lg-1" style='margin: 0; padding: 0; border: 0; float: left;'>
            <span class="add-field glyphicon glyphicon-plus-sign"></span>
        </a>
    </div> 
</body>
</html>

and my jquery script is

jQuery(document).ready(function() {
    $('.multi-field-wrapper').each(function() {
    var $wrapper = $('.multi-fields', this);
    var remove = '<a href="#" style="padding-left:20px" class ="remove-field "><span class=" glyphicon glyphicon-minus-sign"></span></a>';

    $(".add-field", $(this)).on('click', function(e)  {
        e.preventDefault();
        $('.multi-field:first-child', $wrapper).clone(true).append(remove).appendTo($wrapper).find('input').val('').focus();
    });
    $('.multi-field ', $wrapper).on('click', '.remove-field' ,function(e) {
       e.preventDefault();
        if ($('.multi-field', $wrapper).length > 1)
            $(this).parent('.multi-field').remove();
    });
});
});

However the problem is that the plus glyphicon is far from textbox while minus glyphicon is nearer which is what is required, as in the image. How can I also move the plus glyphicon in similar distance to the minus glyphicon from the textbox.

enter image description here

This should be extremely but I am a newbee in the area, could you identify the problem and suggest the solution. Thanks!




Library that allow python and javascript (web development) share the same global constant variable

I am currently using Flask to make a web application. Therefore, I am wondering whether there is a library to allow the front-end and back-end scripts using the same set of constants. Thanks




Does loading Google Analytics script with RequireJS affect tracking metrics?

I would like to know if loading the Google Analytics script with RequireJS affects tracking metrics such as page load times, etc.

Here are some resources on the topic that I have found:

http://ift.tt/1RvVhx5

http://ift.tt/1WQfeq8

http://ift.tt/1RvVlNc

http://ift.tt/1WQfaXy

The resources above do not address the topic of tracking metrics directly.

Thanks in advance.




Accessing a link in an external html file on clicking a button in the current file

I am trying to use magnific popup in my html file. I created a separate html file for the magnific popup anchor tags, I need to access these links from my "index.html" file. I need to get the popup after clicking a button in "index.html"




jeudi 26 mai 2016

Php parse html dom and target elements

I have a gaming server and i want to build a simple php to get my server players because there is no API to use

So after a little search i have found this Simple php DOM Parser And this is perfectly suitable for what i want to do :)

Lets say my server link contains this structure

<div id="server-page-info">

<div class="row-tight">
    <div class="box span1">
        <header>
            <h1>Players</h1>
        </header>
    </div>
    <div class="box span1">
        <header>
            <h1>Ping</h1>
        </header>
    </div>
</div>
<div class="row-tight">
    <div class="box span1">
        <section class="box-content">
            <h5>
                0 / 64
            </h5>
        </section>
    </div>
    <div class="box span1">
        <section class="box-content">
            <h5>
                -ms
            </h5>
        </section>
    </div>
</div>

</div>

Lucky me, there are a bunch of row-tight and box and box-content class names :)

So i want to get the value of one of this box-content sections which is shows 0 / 64 above

My php code

Sorry im a newbie on PHP. you can also see how i have targeted the element but it does not work and i do not get anything :)

require 'simple_html_dom.php';
$url = '';
$html = file_get_html($url);

$player = $html->find('div[id=server-page-info] .row-tight:nth-child(2) .box:first-child');

foreach( $player as $players ){

    echo $players->plaintext;

    }

I will also add one more question :) Now when i get the server players value as plaintext i want to wrap it in a div :)

Thanks




Am I missing something?

I am trying to get a submit form working but I think I might be missing something - either that or it might not be working because the website isn't live.

This is the form part of the webpage.

<div class="contact">
                            <div id="contact_form">
                                <form name="form1" id="ff" method="post" action="contact.php">
                                    <label>
                                    <span>Enter your name:</span>
                                    <input type="text"  name="name" id="name" required>
                                    </label>
                                    <label>
                                    <span>Enter your phone number:</span>
                                    <input type="text"  name="phone" id="phone" required>
                                    </label>
                                    <label>
                                    <span>Enter your email:</span>
                                    <input type="email"  name="email" id="email" required>
                                    </label>
                                    <label>
                                    <span>Your message here:</span>
                                    <textarea name="message" id="message"></textarea>
                                    </label>
                                    <center><input class="sendButton" type="submit" name="Submit" value="Submit"></center>
                                </form>
                            </div>
                        </div>

And here is the php I am using.

<?php

$text = "<span style='color:red;'>Error! Please try again.</span>";

if(isset($_POST['name']))
{
$name=$_POST['name'];
$phone=$_POST['phone']
$email=$_POST['email'];
$message=$_POST['message'];

$to = "enquiries@website.com";
$subject = "Web Enquiry Submission";
$message = " Name: " . $name ."\r\n Phone: " . $phone ."\r\n Email: " . $email . "\r\n Message:\r\n" . $message;

$from = "**Not_Sure_What_Goes_Here**";
$headers = "From:" . $from . "\r\n";
$headers .= "Content-type: text/plain; charset=UTF-8" . "\r\n"; 

if(@mail($to,$subject,$message,$headers))
{
  $text = "<span style='color:blue;'>Your Message was sent successfully !</span>";
}
}
?>

Any help would be appreciated.

Cheers.




Working with a poorly documented module for Python called invenio-accounts

I am working with a library called invenio-accounts, and the documentation for it is not extensive at all. I know it uses Flask, and it is used for authentication. I am fairly new at this, but if not for this specifically, what are some ways to be able to understand exactly how a library is supposed to be implemented and used?




Go Reader.read(); how to get the contents without duplication?

I've started studying Go recently as a side project and have been trying to get a better handle around the Reader interface. Specifically, I'm trying to get contents from a website, and then reading it to a bytes slice.

I am aware that the ioutils.ReadAll function is the canonical way to get the data, but I'm curious why the original function I wrote has repeated content at the end of the output.

Code: package main

import(
    "net/http"
    "fmt"
)

func main() {
    // retrieve url from hacker news.
    resp, err := http.Get("http://ift.tt/eY2lHV")
    if err != nil {
        // handle error
    }
    defer resp.Body.Close()
    text := make([]byte, 500)
    buf := make([]byte, 200)
    i, _ := resp.Body.Read(buf)
    for i != 0 {
        text = append(text,buf...)
        i, _ = resp.Body.Read(buf)
    }
    fmt.Println(resp.ContentLength)
    fmt.Println(resp.Status)
    fmt.Printf("%q\n", text)

}

Content:

         (...)Search:\n  <input type=\"text\" name=\"q\" value=\"\" size=\"17\" autocorrect=\"off\" spellcheck=\"false\" autocapitalize=\"off\" autocomplete=\"false\"></form>\n            </center></td></tr>      
         </table></center></body></html>\nput type=\"text\" name=\"q\" value=\"\" "

As you can see, for a reason I don't quite understand, one part of the text is repeated at the end after the closed tags; 'nput type=\"text\" name=\"q\" value=\"\" "'.

Maybe this is something related to the buffer not being cleared maybe? Could anyone offer some insight as to what I am getting wrong?




adminLTE and VBA scripts?

My goal is to use adminLTE (adminLTE) interface in a corporate setting which allows for VBA scripts to run to automate task which my non-tech savy team can accomplish much quicker than by doing them by hand. (pre-filling emails, providing inventory information, creating and printing forms automatically, integrating with stamps.com, reference and display a lot of excel data). From my understanding, the execution of VBA scripts in a web browser is not allowed. What are my options for accomplishing my goal? Do this in an HTA file? Am I wrong about browser execution of VBA scripts? Do I need to build an application in Visual Studio? Any and all thoughts are welcome.

I have a team of three which need to access this and share data, so it's not like an entire enterprise spread across the nation or anything like that. Thanks.