dimanche 30 avril 2017

Typescript import error of mdc module

I'm new to TypeScript. And I can't import mdc-checkbox as it's described in the docs.

What do I have to do to fix this error?

Error: Cannot find module <code>@material/checkbox</code>




Can you access a local server from a mobile device or another computer? [on hold]

I'm curious to know if there is a way to access a local server such as WAMP or MAMP from another computer or mobile device securely? Say I wanted to test a website or maybe an app designed on my PC running WAMP or MAMP on another device or computer without having to post it live somewhere is there a program for that or is there a more efficient way of testing without having to go live?




How to display values of excel file in a web page

I have excel files (tab-delimited) and the contents of which I want to display in a web page.

Sample dataset:

Group A Group B Group C Group D Group E Group F
lynx    cat zeus    zebra   smug    zebra
zebra   lump    flun    flun    kilm    lump
    zebra   cat         

I want to display links to datasets in the first page:

link:<Dataset 1>
link:<Dataset 2>
link:<Dataset 3>

So, for example when the link to "Dataset 1" is clicked, I want to display a drop-down list:

Group A 
Group B
Group C
Group D
Group E
Group F

Then, if Group A is selected, the content of that column, lynx and zebra, should be displayed.

What is the best and quickest way to get these datasets on a web page? Can I also get away with not using a database and a web server for this purpose and just get data displayed in a web browser?

Thanks




Wordpress and lodging house software

Good day to everyone.

I have to create a web page for a hostel, however it has to have a room reservation process, the problem is in the exact availability (connected to a software that they already bought) to ensure that there is no more than there is .

My question is if it is feasible to apply this using wordpress and how?




Programming Languages to create a Web-App

this is my project: I have a lot of records in a MYSQL Database and I have to create dinamically queries to show the results in the form of graphs.

I don't know perfectly how to realize that but I really want to study. So have you realized something like this? How? Can you give me some suggests? Thanks a lot!




Node.js send multiple files to client

I can send one file at request with plain node.js very easily. What is the best way to send multiple files together to client? for example if i need to load a basic homepage, i need multiple file like index.html, style.css, script.js and so on...




ColdFusion 2016 Installation

I can't run ColdFusion 2016 after installed. I open terminal window and type in this command: /Applications/Coldfusion2016/cfusion/bin/coldfusion start After that, it required to type the command: sudo ./coldfusion start I did all the steps however it failed to run.enter image description here Please help me with this problem. I greatly appreciate your answer.




ColdFusion 2016 Installation

I can't run ColdFusion 2016 after installed. I open terminal window and type in this command: /Applications/Coldfusion2016/cfusion/bin/coldfusion start After that, it required to type the command: sudo ./coldfusion start I did all the steps however it failed to run.enter image description here Please help me with this problem. I greatly appreciate your answer.




ReactJS component vendors

Are there big vendors like Telerik, Infragistics, Devexpress offering widgets (Grid, Chart, Combo-box, etc..) written in ReactJS (not wrapping their existing jQuery widgets) ?

Best Regards




How to vertically AND horizontally align img inside div?

I know this has been asked many times but I've tried pretty much anything I've read so far.

I want to align both horizontally and vertically an img inside a div.

The container div is inside a modal showing the picture, once clicked its preview. Then it will contain pictures with any size.

I can align horizontally OR vertically but not both.

HTML code: http://ift.tt/2oYtEH9

<div id="mypicmodal" class="col-lg-12 col-md-12 col-sm-12 content">
<div class="row content">
    <div class="col-lg-1 col-md-1"></div>
    <div class="col-lg-10 col-md-10 col-sm-12 content">
        <div class="row content">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
            <div class="col-lg-12 col-md-12 col-sm-12 modal-content">
                <div class="row content">
                    <div id="modalpiccontainer" class="col-lg-8 col-md-8 col-sm-12 content" style="background-color:black">
                        <div class="row content">   



                                    <!-- pic here -->
                                    <img id="pic" src="">



                        </div>
                    </div>
                    <div id="modalpicdata" class="col-lg-4 col-md-4 col-sm-12 content">
                        <div class="row content">   
                            <div id="modaluserdata" class="col-lg-12">
                                <div class="row content">
                                    <div id="modaluserpic" class="col-lg-3 col-md-3 col-sm-3 content" style="background-color:yellow">

                                    </div>
                                    <div id="modaluserpicinfo" class="col-lg-9 col-md-3 col-sm-3 content" style="backround-color:green">

                                    </div>
                                </div>
                            </div>
                            <div id="modalsocial" class="col-lg-12">
                                <div class="row content">

                                </div>
                            </div>
                            <div id="modalcomments" class="col-lg-12">
                                <div class="row content">

                                </div>
                            </div>
                            <div id="modaltypecomment" class="col-lg-12">
                                <div class="row content">

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

Modal example (with img not aligned vertically): https://ibb.co/j4nJ1Q

(.content only contains "height: inherit" and the modal is 550px)

Thank you!




Dropbox Python API: Uploading a file

Note: There have been questions like this in different programming languages, but they do not address the dropbox library for Python specifically (or at least I can't find any that do), which is why I created this question.

I would like to know how to use the dropbox library in Python 2.7 to upload a file to my Dropbox.

I have successfully connected to my Dropbox and the Dropbox object is called db.

If anybody knows how to do this, please write an answer containing the method call and parameters, or if this is a duplicate question, please comment with the link.

Thank you in advance!

[EDIT]

I also need a way to read a file from Dropbox.




How to make principle.getName() retrieve modified username in database?

While logged in, I changed the username in my web setting page. However, principal.getName() still returned the old username. principal.getName() will only return correct updated username after I log out and log in back to my website. Is there a way around it so principal.getName() will immediately return the new username after I changed it without needing to log out and log in back?

@RequestMapping("/")
public String showHome(Principal principal, Model model)
{
    String username = principal.getName();

    model.addAttribute("username", username);

    return "home";
}




Examine my Website and Help me

Hey Guys I just want you to examine the website that,I made and tell me what I have to improve,What all should I add and thanks in advance and I will add Portifo and no need to remind me that!!

The website http://ift.tt/2qsAl4L




Django admin static files

I want to deploy a server using nginx, django & gunicorn. I created a django project in /home/myproj/ with STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static'), did all the migrations, and then python3 manage.py collectstatic

then I changed the nginx configuration:

server {
    listen 80;
    server_name www.myserver.com;
    access_log  /home/nginx.log;

    location /static/ {
        alias /home/myproj/static/;
        autoindex on;
        expires 30d;
    }

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

when I start the server gunicorn myproj.wsgi:application the start page is displayed correctly, but the admin panel does not load the css styles. What am I doing wrong?

P.S. I'm still not good in linux, so please write the full commands.




'webread' Matlab function not found

I am using Matlab R2010a but could not find 'webread' function but with the message : "Undefined function or variable 'webread'." is shown. The only available web function is 'web'. How to download that function or solve the problem anyway?




samedi 29 avril 2017

GitHub download and upload speed is less

my GitHub speed is very less. I get decent speed on other sites but, I get only 3-4 kb of speed on GitHub for both download as well as upload. Any solution for this. Thanks in advance.




Unable to view the post request parameters

I want to view the post request url and its paramter.

For that I tried using firebug but could not able to view the request parameter.

URL :- http://ift.tt/2qkjvFR




Leave input with value 0 ( PHP, MySql)

I want to show the students' grades. This is what I have in prueba.php Image of web browser

And I have this on my table qualifications in my database:

Image of Database

How can I leave students who do not qualifications with an input value of 0?

This is my code of prueba.php

    <table>
    <tbody>
<?php
$connect = mysql_connect("localhost","root", "");
if (!$connect) {
die(mysql_error());
}
mysql_select_db("liceo");
$results = mysql_query("SELECT rut, nombre, apellido FROM alumnos") or die(mysql_error);
while($row = mysql_fetch_object($results)) {
$rut = $row->rut;

$results2 = mysql_query("SELECT nota FROM notas WHERE rut_alumno = '$rut' LIMIT 1");
?>
<tr>
<td><?=$row->rut?></td>
<td><?=$row->nombre?></td>
<td><?=$row->apellido?></td>
<td>

<?php
while($nota = mysql_fetch_object($results2)):
?>
<input type="text" name="pin" maxlength="2" size="2" value="<?=$nota->nota?>">
<?php
endwhile;
?>
</td>
</tr>

<?php
}
?>
</tbody>
</table>




Computer crash, when i use recursion to check all html links and sublinks of web

i'm tasked to iterate over all links+sublinks of the given web portal. In most cases , when the web pages are not too complex and big i dont have any problems. The problem starts when i check links of a really complex site such as tutorialspoint and my computer just crash. I can't find any performance issue in code i attached, so can someone experienced tell me where in my code is a possible threat, where my computer crashes?

uniqueLinks collection is a HashSet for best perfomance for using contains.

private void recursiveLinkSearch(String webPage) {
        /** ignore pdf**/
        try {
            logger.info(webPage);
            uniqueLinks.add(webPage);
            Document doc = Jsoup.connect(webPage).get();
            doc.select("a").forEach(record->{
                String url=record.absUrl("href");
                if(!uniqueLinks.contains(url)) {
                    /** this would not allow me to to recursively acces to link from other domain **/
                    if(url.contains(getWebPortalDomain())) {
                        recursiveLinkSearch(url);
                    }
                }
            });
        } catch (IOException e) {
            e.printStackTrace();
        }

    }




C# get innerText from with an child

I am working with a webBrowser in C# and I need to get the text from the link. The link is just a href without a class.

its like this

<div class="class1" title="myfirstClass">
<a href="link.php">text I want read in C#
<span class="order-level"></span>

Shouldn't it be something like this?

HtmlDocument doc = webBrowser1.Document;
HtmlElementCollection col = doc.GetElementsByTagName("div");
HtmlElement element = doc.GetElementById("visual-label visual-label-main");
HtmlElementCollection childDivs = element.Children.GetElementsByName("a");
foreach (HtmlElement childElement in childDivs)
{
    MessageBox.Show(childElement.InnerText);
}




Location of a device with IP, which is sending information

I want to get IP addres, but not from the visitor in the website. I want to get device's IP, which is sending information to the site, then to turn it to location. I'm going to send the content of the site with HTTP requests and the device is Arduino project. I guess that it should be in PHP, but how? Thank you in advance.




Web Dev : Data storage in cloud

I'm developing a website (for the first time). The users should be able to upload and retrieve files (with restricted access).

Example, One user uploads a file and has access to it. Another user needs access to it. And then only the two have access to the file. I need it all automated, so that when a user asks for access, they get some URL to view the file.

I believe I will require subscription to Amazon S3 or google cloud services (if there is a free alternative where I can test, that would be great). Do these services allow different anonymous users to upload data? Can they do it fairly easily, or would they need basic knowledge of how buckets and objects work?

Can you please tell me how should I proceed?




Change to CSS FILE. It work's. but too late

when my css file of CMS has been changed, sometimes it takes a while to do the change in php file. what is the solution of this problem?




How can I convert a method to asynchronous of my web service?

I currently have a web soap service method that works fine, but I would like to know how I can convert it to return a confirmation that the message has been received and that the client does not wait until I finish the process.

@Service
@WebService(serviceName = 
  "getStudents",wsdlLocation="/wsdl/Students.wsdl")
  public class StudentsImpl implements Students {


   public StudentResponse getStudents(StudentRequest 
   request) {

       **********************
   }
 }


public class StudentResponse
  {
    private String status;
    private Date timeStamp;
    ....................
  }

I would like to know how I can respond with an "OK" status and also the time.

    @WebService
    public abstract interface Students
    {

       @WebResult(name="response")
       @XmlElement(required=true, name="request")
       public abstract StudentResponse 
       getStudents(@WebParam(name="request") StudentRequest 
       request);

    }




firebase simple - data structure questions

I have been reading a little about how to structure your firebase database and i understand that you need to split your data into pieces so you don't forced the client to download all of the 'users' data.

So in this example you will get all the users data when you write

  ref.('users').once('value', function(snap)...

    /users/uid
    /users/uid/email
    /users/uid/messages
    /users/uid/widgets 

but what if you specifically write the path to the location instead like

ref.('users/uid/email').once('value', function(snap)...

Will you still get all the users data or only the data in email ?




Adding text Javascript progressbar

I would like to add a description text to my progress bar. This description text shoud appear at the left top of the bar. The best way to do it is by modifying my Javascript. It should be very easy to do but i don't have a lot of knowledge in js and I don't know how to do it.

Here is the code :

HTML :

<div id="cont"></div>

CSS :

#cont {
  margin: 10px;
  width: 100%;
  height: 5px;
  position: relative;
}

JS :

var bar = new ProgressBar.Line(cont, {
    strokeWidth: 4,
    easing: 'easeInOut',
    duration: 1400,
    color: '#ed1100',
    trailColor: '#eee',
    trailWidth: 1,
    svgStyle: {width: '100%', height: '100%'},
    text: {
      style: {
        // Text color.
        // Default: same as stroke color (options.color)
        color: '#999',
        position: 'absolute',
        right: '0',
        top: '30px',
        padding: 0,
        margin: 0,
        transform: null
      },
      autoStyleContainer: false
    },
    from: {color: '#ed1100'},
    to: {color: '#ED6A5A'},
    step: (state, bar) => {
      bar.setText(Math.round(bar.value() * 100) + ' %');
    }
  });

  bar.animate(1.0);  // Number from 0.0 to 1.0

It also uses another JS you can find here : http://ift.tt/2pgruFt

Code in use : http://ift.tt/2qiHRjw

Can someone help me to add this description text ?




Regex to match only certain characters or strings and only one instance of each?

I feel like I know just enough about Regexes to get stuck. That said, I have an input field which will allow users to enter their currency symbol. I'm only wanting to allow said currency symbol and disallow anything else from being entered into that field. Some countries don't actually have a single symbol, but are just two or three characters, e.g., "Kr" for Krona. So the field has a max length of 3. Given it needs a max length of three to accommodate some currencies, I also don't want to allow three dollar signs to be entered, e.g., "$$$". I would only want to allow one single dollar, pound, euro, etc. sign.

Here's my basic code for allowing only these symbos in the input:

$('#id_currency_symbol').on('input',function (){
    var value = $(this).val().toString();
    newvalue = value.replace(/[^$£€¥₣₩₩¥₽₺₹Rkr]+/g,'');
    $(this).val(newvalue);
});

This works for only allowing these symbols/letters, but like I said above, I don't want to allow users to enter more than a single instance of some symbols, i.e. dollar sign ($). In addition, I want to match exact strings for cases where the "symbol" is actually just two or three characters. In the case of Krona, the "symbol" is Kr. Given the above, users could in theory enter "rK" and it would be perfectly valid according to the regex, but I would ONLY want to allow the exact match of "Kr." Is that possible?

Thanks




How to understand this js code?

I am new at learning web programming, can anyone help explain the following code to me?

{url:n+"/game_servers_info",data:{game:"g37"},type:"get",dataType:"jsonp"})

If I want to use add-ons like POSTMAN to GET this website, what should I do?




C# - How to extract search results from various websites

Slightly beginner question but I'm wanting to extract a various number of results from websites and compile the results into a string array. Is that possible? If so, what is the best way to go about doing so?




How to start learning web development "beginner"?

I want to learn web development, I'm a total beginner & I don't know anything about it. yet I took an intro to computer science course, & I want to work back-end so which of these courses is better for me?

http://ift.tt/1NYRnhT http://ift.tt/2oS8Xvy




which Technology Stack is currently used in leading Software companies for web app and WHY?

what is the trend in Software companies now? Which Technology does most Software companies use currently? Does it depend on the need and backward-compatibility to support existing apps? My team is currently planning to shift from java to C# for a various reasons. Is there a better alternative and WHY? They are also considering ReactJS for front end. How good is that? Is there any better alternative for it? Ease of development, Ease of maintenance, Extensibility, Dynamic web development, Scalability, Security are some of the factors i'd like to consider.




on scroll i want to jump one section to another section

HI there i just want to move from one section to another section on scroll

    <section id="about>
<h1>Heading</h1>
</section>
<section id="vision>
<h1>vision</h1>
</section>
<section id="mission>
<h1>mission</h1>
</section>




How do i save text to the clipboard using javascript? [on hold]

It has to be on the click of a button.

I don't have any code since i'm still a noob.




vendredi 28 avril 2017

Engines in Browser - How do they interact?

Okay, so I've been trying to learn more under the hood when it comes to Web Development, specifically Javascript, and how the different engines interact with the Javascript engine. For example, I know that the Rendering Engine is interacting, HTTP Requests, etc. But I guess I'm slightly confused on at what point can another engine start processing asynchronously with the Javascript engine? Let me elaborate a little: You want to render some content in Javascript. How does the data get sent to the render engine? And by the time it gets there, has Javascript completed the current execution context? If so, does the render engine have to syntax parse? Does the render engine compute synchronously as well? I know these are a lot of questions, I feel like I have a good understanding this far so I think it should make sense to those who know this stuff. I know there are some pretty intelligent and generous people on here, I'm reaching out to you, I would appreciate it a lot!




Retrieve google links using Search API from Github

I am working on a python project that uses needs to retrieve search links. I am using the Google Search API from Github: http://ift.tt/2pHCVaA

Here is my basic code:

from google import google
search_results = google.search("dog")
print(search_results)

It returns the results in the following format:

 description=The domestic dog is a member of genus Canis (cani.., GoogleResult(name=Complete Guide to Caring for Dogs | Dog Breed Informati..

However, I only want the link of the websites on the results to be returned. How can retrieve only the link, and nothing else?




My website project's images get uploaded with capitalized filename. Why is this happening?

so strange problem.

I finished my website and pushed the project to github.com. The picture section of my page won't work because the pictures are added into the html with .jpg but github has it as .JPG (capitalized).

So if you go to my site: http://ift.tt/2oUg6N1 you won't see the pictures. However if you click on one of the missing file icon you will get the link to the full picture (but it say that the page does not exist because filename is written in lowercase letter (as it should be) but github has the images capitalized (.JPG)

If you edit the link like so: /Frodo/images/pic4.JPG (sry have to shorten that I can't post more then one link) it infect works.

So what is this problem? On my local machine it's fine. I uploaded it on windows with the github shell like normal.

So I go to my local images folder and I see the filename like so: pic4.JPG --> If I right click it properties it says pic4.jpg

So I renamed it to pic4.jpg and after hitting enter I got .JPG again. I deleted the whole file ending enter. Rename it again and write .jpg and enter --> Now it's actually pic4.jpg.

But how can I push it to github, because it does not recognize it as changed file?

Also how can I solve this for feature pictures and uploads?

Bonus: Cute dog pics on my page :P

Thank you!




disadvatages of local web server on rooted android tablet?

I have two web applications, one use java/tomcat/postgresql, another php/mysql. I need to run them in offline mode on tablet. Thus I have to make decision rewrite them into ordinal android applications, or use as is.

So, do you see any big disadvantages in compare with ordinal Android app, in installation oracle jvm, php, mysql, postgresql prebuilded for arm cpu into rooted android? Note, that web application will have only one user/client in such case.

For example power consummation or cpu usage?

As I understand, because of usage of loopback device, no power loss for 3G/LTE/Wifi. Because of php/tomcat work only during http request, not big power or cpu usage?

And as understand open sockets on loopback device to not prevent go into low-power mode.

The only difference in compare to ordinal android application as I understand will be more big memory usage?




Highlight Active Page

I'm working on a website that has a side navigation on about 20 pages. Instead of copying and pasting the side navigation on each individual page, I created all of the links in a JS file and just added it to the HTML pages for easier ability to change if and when needed.

My question is: is there a way to have the active page highlight on the side navigation? This is my JS code (W3CSS is being used on the pages):

document.write('<h4>Services:</h4>\
<div class="w3-bar-block w3-light-grey">\
    <a href="/page/7/alternative-dispute-resolution" class="w3-bar-item w3-button">Alternative Dispute Resolution</a>\
    <a href="/page/8/appellate-practice" class="w3-bar-item w3-button">Appellate Practice</a>\
    <a href="/page/9/aviation-law" class="w3-bar-item w3-button">Aviation Law</a>\
    <a href="/page/10/business-and-commercial-law" class="w3-bar-item w3-button">Business and Commercial Law and Litigation</a>\
    <a href="/page/11/contract-law" class="w3-bar-item w3-button">Contract Law</a>\
    <a href="/page/12/construction-law" class="w3-bar-item w3-button">Construction Law</a>\
    <a href="/page/13/design-professsional-representation" class="w3-bar-item w3-button">Design Professional Representation</a>\
    <a href="/page/14/dram-shop-and-liquor-license" class="w3-bar-item w3-button">Dram Shop and Liquor Liability</a>\
    <a href="/page/15/employment-law" class="w3-bar-item w3-button">Employment Law</a>\
    <a href="/page/17/enviromental-law" class="w3-bar-item w3-button">Environmental Law, Abestos, and Toxic Torts</a>\
    <a href="/page/18/general-civil-litigation" class="w3-bar-item w3-button">General Civil Litigation</a>\
    <a href="/page/19/mass-transit-liability" class="w3-bar-item w3-button">Government and Mass Transit Liability</a>\
    <a href="/page/20/insurance-and-indemnity-law" class="w3-bar-item w3-button">Insurance Coverage and Indemnity Law</a>\
    <a href="/page/21/ip-and-trademark-litigation" class="w3-bar-item w3-button">Intellectual Property and Trademark Litigation</a>\
    <a href="/page/22/motor-vehical-law" class="w3-bar-item w3-button">Motor Vehical Law</a>\
    <a href="/page/23/premises-liability" class="w3-bar-item w3-button">Premises Liability</a>\
    <a href="/page/24/product-liability" class="w3-bar-item w3-button">Product Liability</a>\
    <a href="/page/25/professional-liability" class="w3-bar-item w3-button">Professional Liability</a>\
    <a href="/page/26/transportation-liability" class="w3-bar-item w3-button">Transportation, Trucking, and Highway Liability</a>\
    <a href="/page/27/workmens-compensation" class="w3-bar-item w3-button">Workmens Compensation</a>\
</div>')




Is there a difference between rendering engine and layout engine

Per http://ift.tt/2pu2KKs
"Web browsers consist of a user interface, layout engine, rendering engine, JavaScript interpreter, UI backend, networking component and data persistence component. These components achieve different functionalities of a web browser and together provide all capabilities of a web browser."

However, I cannot find a reference to a difference between a layout engine and a rendering engine. Are these synonyms?




Avoid from loading scripts on Fire Fox version 3

I modified few web pages . All works fine on all browsers except Fire Fox version 3.6.24 on Linux Open SUSE.Problem with scripts file where I used jQuery. Can I avoid on HTML file loading specific scripts when system will detect that browser is Fire Fox version 3.6.24 ? Something like on IE ...




side navbar when position is "Fixed"

I have a side nav bar and I have set the float to be right and then when I put the position: fixed; it floated to left why did this happen? can anyone help me?

this is my html:

<div id="navbar">
 <ul>
 <li><a href="default.asp">&nbsp; &nbsp;<i class="fa fa-pagelines fa-2x"></i></a></li>
 <li><a href="news.asp">&nbsp; &nbsp;<i class="fa fa-smile-o fa-2x"></i></a></li>
 <li><a href="contact.asp">&nbsp; &nbsp;<i class="fa fa-envelope-o fa-2x"></i></a></li>
<li><a href="about.asp">&nbsp; &nbsp;<i class="fa fa-home fa-2x"></i></a></li>
 <li><a href="default.asp">&nbsp; &nbsp;<i class="fa fa-plus-square fa-2x"></i></a></li>
 <li><a href="news.asp">&nbsp; &nbsp;<i class="fa fa-bell-o fa-2x"></i></a></li>
 <li><a href="contact.asp">&nbsp; &nbsp;<i class="fa fa-cog fa-2x"></i></a></li>
 <li><a href="about.asp">&nbsp; &nbsp;<i class="fa fa-clock-o fa-2x"></i></a></li>
 <li><a href="about.asp">&nbsp; &nbsp;<i class="fa fa-power-off fa-2x"></i></a></li>
</ul>
</div>

And this is my css:

#navbar{
position:fixed;


}
    ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    height:auto;
    width: 70px;
  background: rgba(255, 255, 255, 0.1);
    float:right;
}


li a {
    display: block;
    color: #ffffff;
    padding: 22.2px 10px;
    text-decoration: none;
     -webkit-transition: all 0.5s ease;
  transition: all 0.5s ease;
  -webkit-appearance: none;
}

li a:hover,li a:focus {
    background-color:#28a828;
    color: green;

}

Thank you :)




I can not implement "extended custom element" with a BUTTON tag

I have been learning about web components and I have the following code:

<input is="totally-not-checkbox"> 
<script>
    var protoInput = Object.create(HTMLInputElement.prototype);

    protoInput.createdCallback = function() {
        this.style.color = "orange";
    };

    var nCB = document.registerElement("totally-not-checkbox", {
        prototype: protoInput,
        extends: 'input'
    });
</script>

It is a simple implementation of "extended custom element", now I try to do the same but instead of using an INPUT I use a BUTTON:

<button is='MY-button'>hola</button>

<script>
    var Proto = Object.create(HTMLButtonElement.prototype);

    Proto.createdCallBack = function() {

        this.style.color = "orange";
    }

    var tmp = document.registerElement('MY-button', {
        prototype: Proto,
        extends: 'button'
    });

</script>

But with the BUTTON the extension is not done correctly; Consequently the BUTTON does not take the indicated properties.

what am I doing wrong?




Angular2 Firebase App

the app I am developing is an employee management app for companies using angular 2 cli, firebase and angularfire2. I have three clients that vary in size. I want to be able to accurately monitor each companies usage to charge them appropriately.

My question is in regards to the firebase database architecture, I have searched around for about a week but haven't found a straight answer. For each client should I create a new firebase application or use one firebase application for all clients and create child nodes within the firebase JSON db to determine who sees what?

Below states "Firebase rarely (if ever) recommends someone create multiple Firebases for their application."

Create a new firebase app from API

But if I use only one firebase application for each client how would I monitor usage and program certain aspects of each application to tailor to the client needs?

If this is the rare case I should use multiple firebase apps, what would be the best way to automatically initialize and setup a user who has paid for the service through our website?




Web api: Limits on the number of queries?

I have a web api which I want to open to public. But I want to limit it. Say we limit 100 queries per IP, per day. Is there a way to limit the number of request to my webapp based on their IPs? Is that possible? Is there a commonly known way of handling this issue?

Btw, I am using Java Spark as my web frame work. But I think this issue might be completely irrelevant to Spark, as they don't support this out of the box.




Why do I see websites using (really long) base 64 pictures in their HTML?

What are the perks of doing it?

background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAKCAYAAAB10jRKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBJREFUeNpEyqERADAIBMGbbwSH+qhA/6URXMyqBUhFBLIP6ip0ezk2zExqC58nwACVZwX67tO41gAAAABJRU5ErkJggg=="), url("data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAABVAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzUgTWFjaW50b3NoIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjM5RDRDOEYzQ0QzNjExRTFBRTIwRkUzMzM4MTZCOEQzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjM5RDRDOEY0Q0QzNjExRTFBRTIwRkUzMzM4MTZCOEQzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MzlENEM4RjFDRDM2MTFFMUFFMjBGRTMzMzgxNkI4RDMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MzlENEM4RjJDRDM2MTFFMUFFMjBGRTMzMzgxNkI4RDMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAACAQEBAQECAQECAwIBAgMDAgICAgMDAwMDAwMDBQMEBAQEAwUFBQYGBgUFBwcICAcHCgoKCgoMDAwMDAwMDAwMAQICAgQDBAcFBQcKCAcICgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAkACADAREAAhEBAxEB/8QAYwABAQEBAAAAAAAAAAAAAAAAAAECCQEBAAAAAAAAAAAAAAAAAAAAABABAAEDAgUDAwUAAAAAAAAAAREhAhIAMfBBYSIyUaETsfFiccFCggMRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AO7clpAhbVm52g330EItG1cY2PRd3f25aCN6DyBneh1WePoFvcWRxibt5x3Jo1H04AXXBbyMav49YmpoDfbatygWmRWIGksJOgJbOUtpbNyz4+q1roF1y0tO47pOSi5RPN5cAR/0ttEUyt7m6dq71emgo3TksJ3JK4k7+VR9NBcriniFd9q7oPtoM8isNvd3MxMzc1J/TQLh/wAysW2i3TPi1J326aCyQj2x7MzO+gWsXYzEBcfjNDnz46AVtFaB4k+LUlh9uADnT49pccs4y+2gM/w8o7fKc6z+0fbQZPlxcfCH45zjOXj6aDT8s2/HM/2jLrFNB//Z"); background-repeat: repeat-x, repeat, repeat; background-position: 0px 30px, 0% 0%, 0% 0%;




How can clearing your browser's history solve an issue with a website?

What is a situation where nothing more than clearing your browser history will solve an issue with a web application?

"Clearing your history" does not include cookies or any sort of cache. Just the history. Is there any legitimate situation where asking someone to clear their browser history will solve a problem?




How to get phone no over response in digits twitter fabric using javascript?

I

Digits.logIn().done(this.onLoginsuccess).fail(this.onLoginFailure);
  onLoginsuccess(res){
      console.log(res);
    }
    onLoginFailure(res)
    {
      console.log(res);
    }
    
 var oAuthHeaders = loginResponse.oauth_echo_headers;
  var verifyData = {
authHeader: oAuthHeaders['X-Verify-Credentials-Authorization'],
apiUrl: oAuthHeaders['X-Auth-Service-Provider']
  };

  $.post('/verify', verifyData)
.done(function(){ window.reload(); });

In onLoginsuccess method , i'm only getting two values, there is no phone no over the response. After '/verify' gives an error for me. I'm struck here, How do i solve this?




Converting Textbox Txt to int?

I'm trying to convert text from a textbox to an int, which is then used as a parameter when calling a method from a webservice. I'm getting this error:

An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code

Any help?

Heres my code

            int amount= int.Parse(txtAmount.Text);

            Service1Client connectionToService = new Service1Client();

            lblResult.Text = connectionToService.getCurrencyName(amount, "Rupee", "Euro");




JavaScript not functioning in IE [duplicate]

I am using this JavaScript in order to show a navigation bar below the header. This is the JavaScript:

function insertBefore(el, referenceNode) {
referenceNode.parentNode.insertBefore(el, referenceNode);
}

// example
var navBar = document.createElement('div');
navBar.innerHTML = `
<div class="navbar">Test Nav</div>`;

var ref = document.querySelector('.x-header-landmark');

insertBefore(navBar, ref);

This script works perfectly in Chrome and Firefoxx but does not work in IE. Are there any solutions for this?




Firebase On The Web Learning Materials

I am creating a web application that uses firebase's realtime database. I have come across a few tutorials on data insertion,retrieving and authentication but none of them have been informative enough. Does anyone has/knows where I can get more learning content?




how to avoid calling OS commands asp.net?

I am developing VULNERABLE web application project and I want to block to shell commands in asp.net

you can see VULNERABLE web app on link.

my source code

http://ift.tt/2ptgPYC

small my code

Process p = new Process();
        p.StartInfo.CreateNoWindow = true;
        p.StartInfo.FileName = "cmd.exe";
        p.StartInfo.Arguments = "/c " + txtCmdIn.Text;
        p.StartInfo.UseShellExecute = false;
        p.StartInfo.RedirectStandardOutput = true;
        p.StartInfo.RedirectStandardError = true;
        p.StartInfo.WorkingDirectory = dir;
        p.Start();

        lblCmdOut.Text = p.StandardOutput.ReadToEnd() + p.StandardError.ReadToEnd();
        txtCmdIn.Text = "";

I don't want my webpage send to command to cmd ? How to avoid that? it's possible?

enter image description here

how to avoid calling OS commands asp.net? How can I control that ?




how to avoid calling OS commands asp.net?

I am developing VULNERABLE web application project and I want to block to shell commands in asp.net

you can see VULNERABLE web app on link.

source code

http://ift.tt/2ptgPYC

My page: you can delete all files on directory I don't want that my files can be delete on server? How to avoid that?

how to avoid calling OS commands asp.net?




Trying to dump a file - Python

I'm trying to dump a web to a file to get the data I need for a project. The web looks like this. Image1

And the resulting file is this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://ift.tt/mOIMeg">
<html>
    <head>        
        <!--Meta tags-->  
        <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
        <meta name="viewport" content="width=1280"/>
        <meta name="viewport" content="initial-scale=0.8"/>

        <!--Stylesheets--> 
        <link href="../../../css/layout.css"  rel="stylesheet" type="text/css" />
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

        <!--Janitza Library-->
        <script type="text/javascript" src="../../../lib/jquery.js" ></script>
        <script type="text/javascript" src="../../../lib/jquery-ui.js" ></script>
        <script type="text/javascript" src="../../../lib/lib_full_min.js" ></script>

        <script type="text/javascript" src="../../../lib/app.js" ></script>
        
        <!--Other Javascripts-->
        <script type="text/javascript" src="../../../javascripts/menu.js" ></script>
        
        <!--Javascripts - Language-->   
        <script>
            var vars = null;
            var data = null;
            $.ajax({
                dataType: "json",
                url: "../../../../json.do?_LANGUAGE",
                async: false,
                data: data,
                success: function(data){
                    vars = data;
                }
              });
            var language = vars["_LANGUAGE"][0];
            var systime = new Date().getTime();
            document.write('<script type="text/javascript" src="../../../egg.js?' + systime + '"></sc' + 'ript>');
            document.write('<script type="text/javascript" src="../../../lang/info.js?' + systime + '"></sc' + 'ript>');
            document.write('<script type="text/javascript" src="../../../lang/' + language + '.js?' + systime + '" encoding="utf-8" ></sc' + 'ript>');
            document.write('<script type="text/javascript" src="../../../lang/en.js?' + systime + '" encoding="utf-8" ></sc' + 'ript>');
            
            CurrentLanguage = language.toLowerCase();
            CurrentChallenge = "";         
            
            $( document ).ready(function() {
                InsertsEggs();
              });     
        </script>
        
        <!--Title-->  
        <title></title>
    </head>

    <body>
        <div id="main">
            <div id="top-bar">
                <div class="wrapper">
                    <div class="logo"></div>
                    <div class="devicetype"></div>
                    <div id="languagebox">
                        <ul id="languageselector">
                            <!-- Ausgabe der Flaggen fuer die Sprachauswahl -->
                            <LangSelect></LangSelect>
                            <!-- ENDE Sprachauswahl -->
                        </ul>
                    </div>
                </div>
                <!--End .wrapper--> 
            </div>
            <!--End top-bar--> 
            <div id="menu-bar">
                <div class="wrapper">
                    <div id="navigationbar">
                        <ul id="navigation">

                        </ul>        
                    </div>

                </div>
                <!--End .wrapper--> 
            </div>
            <!--End menu-bar--> 

            <div id="content">
                <div class="wrapper">


    
    <script type="text/javascript" src="javascripts/functions.js" ></script>
    
    <div class="full-width-frame" >

        <div class="top">

            <span class="trans">menu.soverview</span>

        </div>

        <div class="center">

            <div class="whitebar">
                <div class="white-one">
                    <div class="white-img"><img src="../layout/devicename.png"></div>
                    <div class="white-text"><span class="trans">soverview.device</span></div>
                    <div class="white-value"></div>
                </div>
                <div class="white-two">
                    <div class="white-img"><img src="../layout/time.png"></div>
                    <div class="white-text"><span class="trans">soverview.time</span></div>
                    <div class="white-value" id="time">
                        <script>
                            hideL4();
                            time();
                            setInterval(function(){
                                hideL4();
                                time();
                            }, 3000);
                            
                        </script>
                    </div>
                </div>
                <div class="white-three">
                    <div class="white-img"><img src="../layout/freq.png"></div>
                    <div class="white-text"><span class="trans">soverview.freq</span></div>
                    <div class="white-value"><script>document.write(sysvar("_FREQ", AUTOUPDATE, 2));</script></div>
                </div>
            </div>


            <table style="width: 1100px; margin: 0 auto">
                <tr>
                    <td VALIGN="top">
                        <table class="showtable" >
                            <tr>
                                <th><span class="trans">soverview.phase</span></th>
                                <th><span class="trans">soverview.uvll</span></th>
                                <th><span class="trans">soverview.uvln</span></th>
                            </tr>
                            <tr>
                                <td>L1/L2</br>L1/N</td>
                                <td><script>document.write(sysvar("_ULL[0]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_ULN[0]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td>L2/L3</br>L2/N</td>
                                <td><script>document.write(sysvar("_ULL[1]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_ULN[1]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td>L3/L1</br>L3/N</td>
                                <td><script>document.write(sysvar("_ULL[2]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_ULN[2]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td>L4/N</td>
                                <td></td>
                                <td><script>document.write(sysvar("_ULN[3]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                        </table>
                    </td>
                    <td VALIGN="top" align="center">
                        <table class="showtable" >
                            <tr>
                                <th><span class="trans">soverview.phase</span></th>
                                <th><span class="trans">kW</span></th>
                                <th><span class="trans">kWh</span></th>
                                <th><span class="trans">kvar</span></th>
                                <th><span class="trans">kvarh</span></th>
                            </tr>
                            <tr>
                                <td><span class="trans">L1</span></td>
                                <td><script>document.write(sysvar("_PLN[0]", AUTOUPDATE, 2, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_WH[0]", AUTOUPDATE, 0, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QLN[0]", AUTOUPDATE, 2, ["k"],  HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QH[0]", AUTOUPDATE, 0, ["k"],  HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L2</span></td>
                                <td><script>document.write(sysvar("_PLN[1]", AUTOUPDATE, ["k"], 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_WH[1]", AUTOUPDATE, 0, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QLN[1]", AUTOUPDATE, 2, ["k"],  HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QH[1]", AUTOUPDATE, 0, ["k"],  HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L3</span></td>
                                <td><script>document.write(sysvar("_PLN[2]", AUTOUPDATE, 2, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_WH[2]", AUTOUPDATE, 0, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QLN[2]", AUTOUPDATE, 2, ["k"],  HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QH[2]", AUTOUPDATE, 0, ["k"],  HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L4</span></td>
                                <td><script>document.write(sysvar("_PLN[3]", AUTOUPDATE, 2, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_WH[3]", AUTOUPDATE, 0, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QLN[3]", AUTOUPDATE, 2, ["k"],  HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QH[3]", AUTOUPDATE, 0, ["k"],  HIDEUNIT));</script></td>
                            </tr>
                            <tr></tr>
                            <tr>
                                <td><span class="trans">L1..L3</span></td>
                                <td><script>document.write(sysvar("_P_SUM3", AUTOUPDATE, 2, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_WH[4]", AUTOUPDATE, 0, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_Q_SUM3", AUTOUPDATE, 2, ["k"],  HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QH[4]", AUTOUPDATE, 0, ["k"],  HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L1..L4</span></td>
                                <td><script>document.write(sysvar("_P_SUM", AUTOUPDATE, 2, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_WH[5]", AUTOUPDATE, 0, ["k"], HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_Q_SUM", AUTOUPDATE, 2, ["k"],  HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_QH[5]", AUTOUPDATE, 0, ["k"],  HIDEUNIT));</script></td>
                            </tr>
                        </table>

                    </td>
                    <td VALIGN="top" align="right">
                        <table class="showtable" >
                            <tr>
                                <th><span class="trans">soverview.phase</span></th>
                                <th><span class="trans">IinA</span></th>
                                <th><span class="trans">cos-phi</span></th>
                                <th><span class="trans">THD-U</span></th>
                                <th><span class="trans">THD-I</span></th>
                            </tr>
                            <tr>
                                <td><span class="trans">L1</span></td>
                                <td><script>document.write(sysvar("_ILN[0]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_COS_PHI[0]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_ULN[0]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_IL[0]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L2</span></td>
                                <td><script>document.write(sysvar("_ILN[1]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_COS_PHI[1]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_ULN[1]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_IL[1]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L3</span></td>
                                <td><script>document.write(sysvar("_ILN[2]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_COS_PHI[2]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_ULN[2]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_IL[2]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L4</span></td>
                                <td><script>document.write(sysvar("_ILN[3]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_COS_PHI[3]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_ULN[3]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_THD_IL[3]", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                            </tr>
                            <tr></tr>
                            <tr>
                                <td><span class="trans">L1..L3</span></td>
                                <td><script>document.write(sysvar("_I_SUM3", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_COS_SUM3", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><span class="trans">L1..L4</span></td>
                                <td><script>document.write(sysvar("_I_SUM", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td><script>document.write(sysvar("_COS_SUM", AUTOUPDATE, 2, HIDEUNIT));</script></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </table>

                    </td>
                </tr>
            </table>

        </div>

        <div class="bottom"></div>

    </div>

    <!--End full-width-frame--> 

    
                </div>
            </div>
            <!--End content--> 

            <div id="footer-bar">
                <div class="wrapper">
                    <div class="footdevice"></div>
                </div>
                <!--End .wrapper--> 
            </div>
            <!--End footer-bar--> 
        </div>
        <!--End main--> 
        
        
    </body>
</html>

That is, a strange script comes out where there should be the digits that appear in the image.

And the code I use to import the web is:

curl http://ift.tt/2pFK3Es -o "arrival.txt"

I need to get the digits out so I can take them out and insert them somewhere else.

Thank you.




jQuery in Safari is not working properly

I have the following code to open and close my side nav with a overlay.. it works perfectly on chrome but in safari it just breaks so I am guessing their is some compatibility issue with the version of code.

$(document).ready(function () {
        $(function () {
            $('.sidenav-button').click(function () {
                if ($(this).hasClass('show')) {
                    $(".sidenavbody-overlay").fadeIn(500);
                    $(".sidenav-button, .sidenav-panel").animate({
                        left: "-=25%"
                    }, 700, function () {
                        // Animation complete.
                    });
                    $(this).html('').removeClass('show').addClass('hide');

                }
                else {
                    $(".sidenavbody-overlay").fadeOut(400);
                    $(".sidenav-button, .sidenav-panel").animate({
                        left: "+=25%"
                    }, 700, function () {
                        // Animation complete.
                    });
                    $(this).html('').removeClass('hide').addClass('show');

                }


            });


        });

$('.sidenavbody-overlay').click(function(){    

    $('.sidenav-button').trigger('click');
});

});




Analyze Html Content - in Java

I was tasked to analyze content of Html page using Java, and export these web page data into well formated pdf. I have already set up my technology stack using Jsoup for parsing Html and Apache PDFBox for exporting this web page into pdf.

But where im stucked is, what data should i export,how do i find in prased Html which data are interesting which not , how to well format them etc. Are there any Studies, where i can read more about how to analyze html content , by priorities. Which data are important which are not. The only one i know is to analyze priorities by html tags is more prioritized then and so on.

Sorry for my bad english and thanks for help




Can't open index.php file from Mobile browser

I have a web application. It's back-end is in PHP. There are some directories inside the application. Some of the directory has index.php file. The Problem is when I am trying to route users to other .html pages in the same directory it's working fine. Now one of the directory has index.php file and in the link I have given the relative path to the folder (So by default it is loading index.php file in that directory from Desktop,Labtop etc) but it is not loading that page when I try to run the same from any mobile browser. After Inspection I realized that I can see somefolder/index.php in the address bar while in mobile it is just till the somefolder i.e it is not trying to load index.php file due to which I get "Not Found" 404 error




People's bank of china exchange rate downloads

Does anybody know how to download exchange rates of currencies published by People's Bank of China? Is there any web service avaiable publishing such a data? Regards.




How to update functionalities of a live Laravel web application?

I have a Laravel application. It's live and have daily users. I need to update some features. Not only front end work. Have to change back end too. With database. The problem is our old developer created this site. Now he's not here, and also no any documentation or blue print available. I downloaded the project. I can change front end even it's live. Changes affected. Is there any way to change some back end and database when it's live ? Is that a risk ? Please guys don't give minus points to this question.




what should server do when user open a sub page

I'm developing a web server but I'm a newbie so I have a basic question.

Imagine that on the index page, there are many countries. If user clicks on some country, a new page should be opened. Obviously the content of new pages depends on the clicked country.

For example, the url of index page is: www.mysite.com
When I click on France, the url of new page is: http://ift.tt/1AD5jcC

I just want to know that what should the server do in this case.
I mean when user clicks France, the server receives the string France, then what should it do? Need it generate a whole new page? Or it just need to send the message to the page France.html so that user can visit the new page? If so I'm considering that I need to create many new pages because I have more than 150 countries...

Is it possible to generate only one page, which can take messages coming from the server and show them?




Online hierarchically-nested data structures generated by folder structure on local machine

I am a computer music student with more of a background in music than programming so please pardon my ignorance. I am trying to create a website whose online file structure resembles the local file structure of a directory on my disk. Most ideally, this directory would reference a directory on google drive.

I am interested in programming in javascript because I want the data on the file system to be dynamically aligned with the web. At one point I had a wiki, specifically a PMWiki distribution. I am fascinated with nested data structures and love the json format for that reason. One of the things I disliked with Pmwiki is how I could not create nested directories on my local machine which immediately reflected onto the frontend of my website. Seeking guidance on different approaches I might pursue. I am guessing I need some more knowledge in FTP or GIT for starters.




I want to redirect globital.media.com to globital.media

Is there any possible solution for doing this type of practice. Actually, we miss printed our business cards with the wrong web address.




Modernizr returning false for positionfixed safari ios 10.3.1

I have some calculation based on Modernizr.positionfixed condition but it is returning false in safari (ios 10.3.1). As fas as I know safari ios supports position fixed from 5.0+. Please let me know if it is bug in Modernizr or I am missing something.




PHP form sends multiple emails after submission

So I have created a PHP form for my wordpress site as Contact form 7 is too heavy and slows it down drastically.

But I have the same contact form on multiple 'items' on one page, so the contact form is used more than once on one page. So when the sender clicks submit depending on how many items are on the page the form will send the same amount of emails...

Now contact form 7 doesn't do this when you submit it only sends me one email. So there is a way to do it, I just don't know as I am new to PHP.

Any help would be great. Here is my sending form code but let me know if you need anything else. cheers guys:

// Sending form to admin
    if ($error == false) {
        // Hook to support plugin Contact Form DB
        //do_action( 'name_before_send_mail', $form_data );
        $to = $name_atts['email_to'];

        if ($name_atts['hide_subject'] != "true") {
            $subject = "(".get_bloginfo('name').") " . $form_data['form_subject'];
        } else {
            $subject = get_bloginfo('name');
        }
        $message = $form_data['form_name'] . "\r\n\r\n" . $form_data['form_email'] . "\r\n\r\n" . $form_data['form_message'] . "\r\n\r\n" . sprintf( esc_attr__( 'IP: %s' ), name_get_the_ip() ); 
        $headers = "Content-Type: text/plain; charset=UTF-8" . "\r\n";
        $headers .= "Content-Transfer-Encoding: 8bit" . "\r\n";
        $headers .= "From: ".$form_data['form_name']." <".$form_data['form_email'].">" . "\r\n";
        $headers .= "Reply-To: <".$form_data['form_email'].">" . "\r\n";

        if(wp_mail($to, $subject, $message, $headers) == true) { 
            $result = $name_atts['message_success'];
            $sent = true;
        } else {
            $result = $name_atts['message_error'];
            $fail = true;
        }       
    }




jeudi 27 avril 2017

Brackets Community Discord Server

Hello there!

I want to invite you to join the official and first brackets server on discord. In this server you can share your code, find other partners to work on some cool project and talk in the same language with others programmers just like you. So join today and share your code!

As the time goes, the server will updated and have more features and cool stuff so stay tuned. Hope to see you there!

discord.gg/ETQmZ5g

Owner - Sizzle




azure ml web service request not working in java

i'm working on a mobile app project and we created a machine learning experiment and deployed it as a web service then we get URL and api key then we failed to use them, we need a code in java as we work on android app any help ?




What is the easiest way to turn a Linux CLI program into a basic Web app?

I have a Linux command line program that takes data from 2 ascii files and writes data into a third ascii file - all defined as parameters. I want to create a most basic Web app that would upload two files and return/display the result. No logic whatsoever, just to pass the input and display the output, whatever it is, nothing if no file is created.

How can I do that in a jiffy, without learning too much?




Embedding another web portal inside our applicatioj

I need some pointers for embedding an external web portal inside our web application. our web application is built on struts, spring framework. We need to integrate an external tool with our application. We need to pass certain parameters to that external tool and handle the response as well. There requirement is to show external web portal screen inside our application. How can we achieve this?

Could anyone please provide pointers on this?




Matrix in Java and MySQL using Spring + Hibernate

I am developing a web application using Java + Spring + Hibernate + MySQL.

I need to make a matrix that has as non-consecutive numbers rows like 1, 2, 3, 5, 10, 20, 30, 50, 100, etc. And something similar for columns (100, 150, 200, 300, 500, 1000, 1500, ...).

I was following this example but I do not know if I can do the following search: I have i_data = 27 and j_data = 278. I have to get the nearest integers. In this case, i = 30, j = 300, and with these numbers obtain the data of the matrix.

Any suggestions? I was told to try key embedabble but I do not know how.




Paypal REST API - Error: JSON Parse error: Unexpected EOF

I am using following API code to make advanced paypal integration:

<?php

// # Create Payment using PayPal as payment method
// This sample code demonstrates how you can process a
// PayPal Account based Payment.
// API used: /v1/payments/payment

require __DIR__ . '/bootstrap.php';
use PayPal\Api\Amount;
use PayPal\Api\Details;
use PayPal\Api\Item;
use PayPal\Api\ItemList;
use PayPal\Api\Payer;
use PayPal\Api\Payment;
use PayPal\Api\RedirectUrls;
use PayPal\Api\Transaction;

// ### Payer
// A resource representing a Payer that funds a payment
// For paypal account payments, set payment method
// to 'paypal'.
$payer = new Payer();
$payer->setPaymentMethod("paypal");

// ### Itemized information
// (Optional) Lets you specify item wise
// information
$item1 = new Item();
$item1->setName('Ground Coffee 40 oz')
    ->setCurrency('USD')
    ->setQuantity(1)
    ->setSku("123123") // Similar to `item_number` in Classic API
    ->setPrice(7.5);
$item2 = new Item();
$item2->setName('Granola bars')
    ->setCurrency('USD')
    ->setQuantity(5)
    ->setSku("321321") // Similar to `item_number` in Classic API
    ->setPrice(2);

$itemList = new ItemList();
$itemList->setItems(array($item1, $item2));

// ### Additional payment details
// Use this optional field to set additional
// payment information such as tax, shipping
// charges etc.
$details = new Details();
$details->setShipping(1.2)
    ->setTax(1.3)
    ->setSubtotal(17.50);

// ### Amount
// Lets you specify a payment amount.
// You can also specify additional details
// such as shipping, tax.
$amount = new Amount();
$amount->setCurrency("USD")
    ->setTotal(20)
    ->setDetails($details);

// ### Transaction
// A transaction defines the contract of a
// payment - what is the payment for and who
// is fulfilling it.
$transaction = new Transaction();
$transaction->setAmount($amount)
    ->setItemList($itemList)
    ->setDescription("Payment description")
    ->setInvoiceNumber(uniqid());

// ### Redirect urls
// Set the urls that the buyer must be redirected to after
// payment approval/ cancellation.
$baseUrl = getBaseUrl();
$redirectUrls = new RedirectUrls();
$redirectUrls->setReturnUrl("$baseUrl/ExecutePayment.php?success=true")
    ->setCancelUrl("$baseUrl/ExecutePayment.php?success=false");

// ### Payment
// A Payment Resource; create one using
// the above types and intent set to 'sale'
$payment = new Payment();
$payment->setIntent("sale")
    ->setPayer($payer)
    ->setRedirectUrls($redirectUrls)
    ->setTransactions(array($transaction));


// For Sample Purposes Only.
$request = clone $payment;

// ### Create Payment
// Create a payment by calling the 'create' method
// passing it a valid apiContext.
// (See bootstrap.php for more on `ApiContext`)
// The return object contains the state and the
// url to which the buyer must be redirected to
// for payment approval
try {
    $payment->create($apiContext);
} catch (Exception $ex) {
    exit(1);
}

// ### Get redirect url
// The API response provides the url that you must redirect
// the buyer to. Retrieve the url from the $payment->getApprovalLink()
// method
$approvalUrl = $payment->getApprovalLink();

return $payment;

My html file with checkouts.js:

<html>
<head>
  <script src="http://ift.tt/2aJUIDS"></script>
 <script> 
    paypal.Button.render({

        env: 'sandbox',

        payment: function(resolve, reject) {

            var CREATE_PAYMENT_URL = '/paypal/CreatePaymentUsingPayPal.php';

            return paypal.request.post(CREATE_PAYMENT_URL)
                .then(function(data) { resolve(data.paymentID); })
                .catch(function(err) { reject(err); });
        },

        onAuthorize: function(data) {

            var EXECUTE_PAYMENT_URL = '/paypal/ExecutePayment.php';

            return paypal.request.post(EXECUTE_PAYMENT_URL,
                    { paymentID: data.paymentID, payerID: data.payerID })

                .then(function(data) { /* Go to a success page */ })
                .catch(function(err) { /* Go to an error page  */ });
        }

    }, '#paypal-button-server');
</script>
</head>
<body>
  <p>Paypal:</p>
  <div id="paypal-button-server"></div>
</body>
</html>

and when I try to make express checkout by clicking on paypal button I get:

Error: JSON Parse error: Unexpected EOF

what can be wrong with json if I use Paypal API? (My scripts based on Paypal API samples.)

$apiContext and getBaseUrl() method are defined in bootsrap.php.

Logs:

04-2017 03:26:31] PayPal\Core\PayPalHttpConnection : INFO: Response  Status     : 201
[27-04-2017 03:26:31] PayPal\Core\PayPalHttpConnection : DEBUG: Response Headers    : HTTP/1.1 201 Created, Date: Thu, 27 Apr 2017 15:26:31 GMT, Server: Apache, paypal-debug-id: a201c7bc10e43, Content-Language: *, Paypal-Debug-Id: a201c7bc10e43, Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D1880%26app%3Dplatformapiserv%26TIME%3D2802647641%26HTTP_X_PP_AZ_LOCATOR%3D; Expires=Thu, 27 Apr 2017 15:56:31 GMT; domain=.paypal.com; path=/; Secure; HttpOnly, Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT, Vary: Authorization, Content-Length: 967, Connection: close, Content-Type: application/json, , 
[27-04-2017 03:26:31] PayPal\Core\PayPalHttpConnection : DEBUG: Response Data   : {"id":"PAY-1KU75701VG630150ALEBA3JY","intent":"sale","state":"created","payer":{"payment_method":"paypal"},"transactions":[{"amount":{"total":"20.00","currency":"USD","details":{"subtotal":"17.50","tax":"1.30","shipping":"1.20"}},"description":"Payment description","invoice_number":"59020da6c110b","item_list":{"items":[{"name":"Ground Coffee 40 oz","sku":"123123","price":"7.50","currency":"USD","quantity":1},{"name":"Granola bars","sku":"321321","price":"2.00","currency":"USD","quantity":5}]},"related_resources":[]}],"create_time":"2017-04-27T15:26:31Z","links":[{"href":"http://ift.tt/2pqHk0S","rel":"self","method":"GET"},{"href":"http://ift.tt/2qjGzUo","rel":"approval_url","method":"REDIRECT"},{"href":"http://ift.tt/2pqAYyB","rel":"execute","method":"POST"}]}




How to prevent seeing image from browser but allow on desktop app

I'm developing a desktop app connected to a website. I store the user profile images in the file system of a web server so I can reach them from the URL, the problem is that I don't want that someone can access the images from any web browser like chrome.

Is there a way in which I can access the images through the URL and display them in my desktop app (built with qt) but also prevent accessing these images from a regular web browser.

The desktop app user is incapable of seeing the URL from the image tough.




Is there any open-source safe INPUT plugin for web?

I have a web application, I want to embed my web app to any other native app (Android/iOS WebView). There are some sensitive account info need to be input, and obviously I can't trust any other native app. So I'm here asking if there are any free/open-source safe input plugins that prevent my web app from being bugged/monitored?




Professional file hosted server

Good morning everyone.

I am looking some professional file hosted server for web application based on .NET. Could somebody recommend me some one?

Thanks. Regards.




Auto-login disabled in parallel pages

If you have an account with Lloyds Bank, and you log on through their website at http://ift.tt/2qahlsd, when opening a separate window on the same website in the same browser, such parallel page does not get logged in as well, and you are required to log in again.

The questions are:

1) At high level, how is it possible to implement such feature in a web product? If they would use cookies to cache the authentication, then it should not matter: the second page should be logged in as straight in, because the browser is sending the same cookies.

2) What are the security flaws behind allowing parallel pages to be opened and logged on in websites?




Job hunting questions [on hold]

Good day! I'm just wondering, is it possible that I can get an online web developer job even if I only self studied web programming and has zero working experience? Thanks




Running a website/web application that analyzes big data

Hello i have this website where the server has in its database 2-3 GB of data and i want the user to run a query to get the data and analyze it (for example the user can put age>15) and then press the button that says cluster to do clustering in that data , then the user sees that with libraries like d3.js.

how to do it ? Can i link Hadoop or something like that with php /nodejs ? Any suggestion




WordPress Theme Import Slider Error

I`m trying to import a slider for a theme that I chose in WordPress.

But, when I select the .zip file, I received the following error:

This page isn’t working. localhost is currently unable to handle this request. HTTP ERROR 500

Thanks




Must str not float python tkinter

  st1= str()    

  c1= str()
  c2= str()
  EndCash = float()

  page = requests.get('http://ift.tt/1Hd4BYE?
       Amount=' + str(st1) + '&From='+(c1) +'&To=' + 
       (c2))
    tree = html.fromstring(page.content)
    rate = tree.xpath('//span[@class="uccResultAmount"]/text()')
    symbol = tree.xpath('//span[@class="uccToCurrencyCode"]/text()')

    EndCash = rate + symbol

Hello I am using the requests module and lxml too harvest Currency rates of the internet.I am encountering problems when doing this. I am getting a Must be Str not float error.Im using this line of code for a lebel in tkinter so the output of this which is EndCash should appear in the label. This code works independly but in tkinter it does not work

      >>>TypeError: must be str, not float




need help to resolve an exception i am get

Exception in thread "main" org.springframework.ws.soap.SoapMessageCreationException: Could not create message from InputStream: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?




select different cell values reside inside the single row of dynamic html table

Hi I am new to programming and this is my first question in stackoverflow. Please forgive If I have made any mistake while posting this question.

I want to achieve functionality that shown in below HTML tableenter image description here.

If I select more than one cells corresponding to any row I can only select other remaining cells in that row, at the same time I cant select any other cell residing in other row.

Also If I select single cell from a row I can select any other cell from different row. now in this case previous selection will be disabled.

basically I want to restrict multiple row cell selection if I select more than two cells in a row by using shift key randomly.

below is my code to create HTML table.

function buildIPTGrid(iptView) { ////console.log(iptView);

    var firstValue = '';
    var secondValue = '';

    $("#IPTResults").empty();
    $("#IPTVolumes").empty();

    var pIPTGrid = "";

    var pIPTVolumesGrid = "<ul id='iptRateGrid'>";

    pIPTVolumesGrid = pIPTVolumesGrid + "<li><strong>Rates</strong><br/></li></ul>";
    //var pIPTGrid = "<ul id='iptGrid'></ul>";

   // pIPTGrid = pIPTGrid + "<li><strong>Rates</strong><br/></li>";

    pIPTGrid = "</br>" + pIPTGrid + "<table id='priceTable'><tr><th class='dpTdHeaderData'><span> Type </span></th><th class='dpTdHeaderData'><span> Delivery Type</span></th>";

    $(iptView[0].NymexRates).each(function (index, obj) {
        pIPTGrid = pIPTGrid + "<th class='dpTdHeaderData'><span style='text-align:center;'> " +
            concatMonthYear(iptView[0].NymexRates[index].rateMonth, iptView[0].NymexRates[index].rateYear)
        + "</th></span>";
    });

    pIPTGrid = pIPTGrid + "</tr>";
    pIPTGrid = pIPTGrid + "<tr><th class='dpTdHeaderData'><span></span></td><td><span></span></th>";
    for (var i = 1; i < iptView[0].NymexRates.length + 1; i++) {
        pIPTGrid = pIPTGrid + "<th class='dpTdHeaderData'><span style='text-align:center;'>" +
            i + "</span></th>";
    }

    pIPTGrid = pIPTGrid + "</tr>";
    //index NYMEX
    pIPTGrid = pIPTGrid + "<tr><th class='dpTdHeaderData'><span> NYMEX </span></th><th><span> </span></th>";

    $(iptView[0].NymexRates).each(function (index, obj) {
        pIPTGrid = pIPTGrid + "<td class='dpTdNormal'><span style='text-align:center;'> " +
            iptView[0].NymexRates[index].rateFixed + "</td></span>";
    });
    pIPTGrid = pIPTGrid + "</tr>";

    //END index NYMEX

    //Avg index NYMEX
    pIPTGrid = pIPTGrid + "<tr><th class='dpTdHeaderData'><span>Avg Wt NYMEX </span></th><th><span> </span></th>";

    $(iptView[0].AverageNymexRates).each(function (index, obj) {
        pIPTGrid = pIPTGrid + "<td class='dpTdNormal'><span style='text-align:center;'> " +
            iptView[0].NymexRates[index].rateFixed + "</td></span>";
    });
    pIPTGrid = pIPTGrid + "</tr>";
    //End Avg index NYMEX

    //Firm Type 
    for (var i = 0; i < iptView[0].Rates.length; i++) {

        switch (iptView[0].Rates[i].firmType) {
            case 1:
                firstValue = "1F";
                secondValue = "GC Fixed";
                pIPTGrid = pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateFixed);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";

                firstValue = " ";
                secondValue = "GC Basis";
                pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid =  BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateBasis);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";

                break;
            case 2:

                firstValue = "4F";
                secondValue = "BT Fixed";
                pIPTGrid = pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateFixed);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";

                firstValue = " ";
                secondValue = "BT Basis";
                pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateBasis);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";
                break;
            case 6:

                firstValue = "2F";
                secondValue = "GC Fixed";
                pIPTGrid = pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateFixed);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";

                firstValue = " ";
                secondValue = "GC Basis";
                pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateBasis);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";
                break;
            case 7:

                firstValue = "5F";
                secondValue = "BT Fixed";
                pIPTGrid = pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateFixed);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";

                firstValue = " ";
                secondValue = "BT Basis";
                pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateBasis);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";
                break;
            case 8:

                firstValue = "3F";
                secondValue = "GC Fixed";
                pIPTGrid = pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateFixed);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";

                firstValue = " ";
                secondValue = "GC Basis";
                pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateBasis);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";
                break;
            case 9:

                firstValue = "6F";
                secondValue = "BT Fixed";
                pIPTGrid = pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateFixed);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";

                firstValue = " ";
                secondValue = "BT Basis";
                pIPTGrid + "<tr>";
                pIPTGrid = BuildHeaderData(pIPTGrid, firstValue, secondValue);

                $(iptView[0].Rates).each(function (index, obj) {
                    if (iptView[0].Rates[index].firmType == 1) {
                        pIPTGrid = BuildIPTPriceData(pIPTGrid, iptView[0].Rates[index].rateBasis);
                    }
                });

                pIPTGrid = pIPTGrid + "</tr>";
                break;

            case 0:
                //Interruptible 
                pIPTGrid = pIPTGrid + "<tr><th class='dpTdHeaderData'><span> Interruptible (CG) </span></th><th><span> </span></th>";

                $(iptView[0].Rates).each(function (index, obj) {
                    pIPTGrid = pIPTGrid + "<td class='`'><span style='text-align:center;'> " +
                        iptView[0].Rates[index].rateFixed + "</td></span>";
                });
                pIPTGrid = pIPTGrid + "</tr>";

                pIPTGrid = pIPTGrid + "<tr><th class='dpTdHeaderData'><span> Basis (CG) </span></th><th><span> </span></th>";

                $(iptView[0].Rates).each(function (index, obj) {
                    pIPTGrid = pIPTGrid + "<td class='dpTdNormal'><span style='text-align:center;'> " +
                        iptView[0].Rates[index].rateBasis + "</td></span>";
                });
                pIPTGrid = pIPTGrid + "</tr>";
                break;
            default:
                break;
        }
        i = i + iptView[0].NymexRates.length;
    }
    //End Firm Type

    //pIPTGrid = pIPTGrid + "</label></li>";

    pIPTGrid = pIPTGrid + "</table></br>";

    $("#IPTVolumes").append(pIPTVolumesGrid);
    $("#IPTResults").append(pIPTGrid);
    $("#IPTVolumes").css("visibility", "visible");
    $("#IPTResults").css("visibility", "visible");
    $("#CreatePGPB").css("visibility", "visible");


}

also I need to find the selected cell value is in which month(as shown in table header) and whether it is fixed or basis.

Quick response will be appreciable.

Thanks in advance.




ng-route doesn't owrk with other modules

I have de following code

var balaitus = angular.module("balaitus", ["ngRoute"]);

// configure our routes
balaitus.config(function($routeProvider) {
    $routeProvider
    // route for the home page
        .when('/', {
            templateUrl : 'home_usuario2.html',
            controller  : 'usuarioCtrl'
        })

        .when('/home_usuario', {
            templateUrl : 'home_usuario2.html',
            controller  : 'usuarioCtrl'
        })

        // route for the about page
        .when('/estadisticas', {
            templateUrl : 'estadisticas.html',
            controller  : 'estadisticasCtrl'
        })

        // route for the contact page
        .when('/hashtags', {
            templateUrl : 'hashtags.html',
            controller  : 'hashtagsCtrl'
        })
        .otherwise({
            templateUrl : 'home_usuario2.html',
            controller  : 'usuarioCtrl'
    });
});

// create the controller and inject Angular's $scope
balaitus.controller('usuarioCtrl', function($scope) {
    // create a message to display in our view
    $scope.message = 'Hi! This is the home page.';
});

balaitus.controller('estadisticasCtrl', function($scope) {
    $scope.message = 'Hi! This is the estadisticas page.';
});

balaitus.controller('hashtagsCtrl', function($scope) {
    $scope.message = 'Would you like to contact us?';
});

The code simply routes different pages, and set the corresponding controller. It works fine, but when I add another angular module between [ ], for example ngFileUpload or ui.bootstrap.demo, ng-route doesn't work, ¿but why?




Issues in Implementing Facebook Share API on my web application

I'm currently trying to figure how I can implement the Facebook Share API on my application. I have been getting errors even though I have implemented it correctly. Here is so far what I've done. I have copied the following code below from the Facebook Application that I have just created and placed it on the Web Application that I'm currently building.

  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'APP ID',
      xfbml      : true,
      version    : 'v2.9'
    });
    FB.AppEvents.logPageView();
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));


  $('#facebook').on('click', function() {

      // FB.ui({
      //   method: 'feed',
      //   link: 'http://localhost/es/',
      //   caption: 'An example caption',
      // }, function(response){});

      FB.ui({
        method: 'share',
        display: 'popup',
        quote: 'test',
        href: 'http://nytimes.com/'
      }, function(response){});
  })

I tried testing it and right now I got this error.

enter image description here

This is the web application that I'm currently developing and is running on Python/Angular.

I made a separate page on my localhost using XAMPP and also using the same Facebook Code. And to my surprise it works.

enter image description here

If you look at the settings on my Facebook Application. I did not have to add the url in App Domains and also Site URL. I tried placing the IP address of my Web App but it won't allow it. I even disabled the pop-up blocker that is installed on my browser

enter image description here




Exception while sending CardImage from Bot

I have written code for sending the message based on the intent matching using LUIS in bot framework. Here is my code.

[LuisIntent("Skype for Business")]
    public async Task Skype4Business(IDialogContext context, LuisResult result)
    {
        var connector = new ConnectorClient(new Uri(context.Activity.ServiceUrl));
        try
        {
            // return our reply to the user
            List<CardImage> cardImageList = new List<CardImage>();
            List<CardAction> buttons = new List<CardAction>();

            CardImage cardImage = new CardImage { Alt = "SpeechPic", Url = @"C:\Users\Rock\Documents\Visual Studio 2015\Projects\Text Analytics\Text Analytics\Resources\Skype-for-business-2.jpg" };
            cardImages = new List<CardImage>();

            cardImages.Add(cardImage);

            CardAction skypeButton = new CardAction()
            {
                Value = "example.com/",
                Type = "openUrl",
                Title = "Skype for Business"
            };
            buttons.Add(skypeButton);

            HeroCard heroCard = new HeroCard()
            {

                Title = "Skype For Business",

                Images = cardImages,
                Buttons = buttons

            };

            var message = context.MakeMessage();
            message.Attachments = new List<Attachment>();
            message.AttachmentLayout = AttachmentLayoutTypes.List;
            message.Attachments.Add(heroCard.ToAttachment());


            await context.PostAsync(message);

            context.Wait(MessageReceived);
        }

So whenever I am sending the reply from the bot if the intent is matched e.g: Skype for business. So I am replying by making card and adding cardimage and button in it. It send without any error but after sending successfully it shows me the exception too. Snapshot of exception

I'm stuck here even i have added the try/catch clause too to handle the exception but still i am getting the exception. How to resolve this? Any help or guidance would be appreciated.




UI design for a web application

I'm trying to create a web app , the application needs a good , simple design as the procedures it might seem complex to the user .the application about determining the suitable job for the user depending on some certain questions. for example if the user is engineering a different list will show up , and so on. or if the user is a job seeker or still a student a different options will show up, and after selecting some options , the recommended jobs will show up. is there and template or example for such an slimier idea? note that I don't want to use radio buttons or check box thanks in advance