dimanche 31 décembre 2017

Why google has so many urls in just for search bar page?

While making django bookmark app, I realized that google searchbar page has so many urls.

Like, no http://ift.tt/RlElw1,

http://ift.tt/2DGdER9, http://ift.tt/2CxDyqU

It's different at

?gfe_rd=cr&dcr=0&ei=et5JWq2NNoz02QS3vKH4DA

and

?gfe_rd=cr&dcr=0&ei=jd5JWrCTI4z02QS3vKH4DA.

Questions:

  1. Why these are different?

  2. Is there good way to determine that 2 urls are pointing the same pages on django server? or using other python packages?




How can i center content with active sidebar

Please guys help me ... The sidebar will be allways active so i need to center the content on the webpage such as the highlighted text. The problem is that it's centered with width of the whole page counting the sidebar. can i divide the the widths somehow? the sidebar is made in bootstrap it's made with cols so i dont know the exact width.

enter image description here




Web hosting recommendations for mysql db?

I am building a java app that will connect to a mysql db. I am looking for recommendations on where to host this db. Do you have recommendations for web host providers? I am looking for something not too expensive... Thanks! :)




Website Youtube cover video shows loading after loop

I added to our website a cover video. It shows automatically but between the loops it shows black screen and loading for 1-2 seconds. This video size is: 25MB and I compressed it to 20MB.

Is there a best practice for those videos to avoid such a situation?




Jersey Basic Program

I am developing a basic Jersey rest services program, I configured through web.xml,But Its not working , but whenever I configured It through extending By Application and @ApplicationPath annotation , It is working Fine , and My Servlet container is org.glassfish.jersey.servlet.ServletContainer.I tried it thhrough different version of eclipse and jdk but the problem still persist.




Which open source web based IDEs exists

I don't want to start a debate, which I know is not "fit for the Q&A format of StackOverflow". However, I would like to have a complete list of web based IDEs, with their main feature sets. The reasons for my question, is because I have created one myself, and I would want to create a feature comparison, in addition to find inspirations for new features I could incorporate into my own IDE.

They don't necessary have to be Open Source, as long as I can either test them myself, or at the very least see their features somewhere.

Sorry if my question is bad, but I am new to this forum as a poster, even though I've read probably thousands of Q&As here over the years ...




error 500 on xampp using htacces (Password)

Hi I am getting error 500 on Apache webserver using xampp. The error wasnt there until i used a .htaccess, .htpasswd file. I searched and i couldnt find a syntax error. I have only 1 image and the index file I want to protect. Here are the syntaxes: .htaccess

AuthType Basic
AuthName "Prosím přihlašte se.";
AuthUserFile C:\xampp\htdocs\Zprávy 1.E\.htpasswd
require valid-user

.htpasswd

 zak:$apr1$t8hZiqXE$0qdoQ/876dOqysUmww2NM/




samedi 30 décembre 2017

react pass data to two component,but one render failed

I use react to make a submenulist.The parent component get json, pass the json to another two child component.But the only child success to display, another one failes.Two childs shared the grandson component.

class SubMenu extends React.Component {
  render() {
    var submenulink = require("../../../conf/navigation.json")

  return (
    <div>
       <PoliticsSubMenu politics_link={submenulink.politics}/>
       <LawSubMenu law_link={submenulink.law}/>
    </div>
)}}


class PoliticsSubMenu extends React.Component {
  render() {
    return (
      <SubMenuList link={this.props.politics_link} />
)}}

class LawSubMenu extends React.Component {
  render() {
    console.log(this.props.law_link)
    return (
      <SubMenuList link={this.props.law_link}/>
    )
  }
}
class SubMenuList extends React.Component {

  render() {
    const links = this.props.link;
    const listNames = links.map((item) =>
      <li>{item.description}</li>
    )

    return (
      <li className="active">
          <a href="#homeSubmenu" data-toggle="collapse" aria-expanded="false">politics</a>
          <ul className="collapse list-unstyled" id="homeSubmenu">
              <li>{listNames}</li>
          </ul>
      </li>
    )
  }
}




Firebase auth through subdomains

Currently I am having an issue with authentication with firebase. After a user is logged in on the main page they can do various different actions but eventually they will be re directed. After they are re directed the to a page like "project.com/page2" The auth state is lost and needs to be retrieved in a convoluted way that messes a bunch of stuff on the next page. What is the best way to keep auth through pages with firebase?




Mssql script on web server

I am a newbie to asp.net. I recently publish an asps site from visual studio using C#, but I realised that the scripts I wrote for the buttons, links, etc to interact with my database on local machine is missing when I publish the pages.

is it that I have to rewrite the codes for the pages now on the webhost?

your advice is needed.

Thanks




Is there any difference when using interpolation braces and template expression in quotes

For example, there are three ways about style-binding. Suppose color="red" is a property of current component, then we can use:

<p [style.color]="color">Hello</p>

<p style.color=>Hello</p>

<p bind-style.color="color">Hello</p>

My question is is there any difference with these three syntax?




What is a good stack for QuoteOfTheDay.com?

I'm trying build a simple website which will just show a random inspirational quote when users visit it. It will have its own database of quotes on the back-end. Which technology stack would be suitable for implementing this website in a fast and efficient way? XAMPP? MEAN? DJANGO?

Thanks!




cara menyelesaikan maslah ini (help missing 1 required positional argument)

class OrderItem(models.Model):
    order = models.ForeignKey('Order', related_name='items')
    product = models.ForeignKey('Product', related_name='order_items')
    price = models.DecimalField(max_digits=10, decimal_places=2)
    quantity = models.PositiveIntegerField(default=1)

help missing 1 required positional argument = 'on_delete'




Open Android-App with HTML

I want that the visitors of my website can open web-links in my android app.

It looks like this:

<a class="btn btn-primary btn-lg" href="#" role="button">Open the app</a>

I want, that the android app opens, if sb clicks on the button. Could someone add the required informations to this code?

Thank you!




Responsive Navbar. Why isn't it changing itself when on other pages

I'm a beginner here, I've got what I believe is a simple problem which I don't know how to solve. Basically i'm making a responsive website, my problem right now is that I can't make my navbar correctly responsive on the other parts of the websites besides my index.html (which works fine).

I've used the code from w3schools in order to create my navbar.

http://ift.tt/2zQzM98

As I said it works on my index file. But when I'm on my "news page" It doesn't work correctly. It rezises itself but it says Home on the navbar to the left. How do I make it so that it says news on the news page, starts off news and not the home page? (And for Contact, About aswell) Much thanks! Sorry if this was a stupid question. This is my first time trying to make a responsive website!

Here is the code aswell (from the link at w3 schools):

<!DOCTYPE html>
<html>
<head>
<style>
body {margin:0;}

.topnav {
  overflow: hidden;
  background-color: #333;
}

.topnav a {
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

.topnav a:hover {
  background-color: #ddd;
  color: black;
}

.active {
  background-color: #4CAF50;
  color: white;
}

.topnav .icon {
  display: none;
}

@media screen and (max-width: 600px) {
  .topnav a:not(:first-child) {display: none;}
  .topnav a.icon {
    float: right;
    display: block;
  }
}

@media screen and (max-width: 600px) {
  .topnav.responsive {position: relative;}
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }

}
</style>
</head>
<body>

<div class="topnav" id="myTopnav">
  <a href="#home" class="active">Home</a>
  <a href="#news">News</a>
  <a href="#contact">Contact</a>
  <a href="#about">About</a>
  <a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">&#9776;</a>
</div>

<div style="padding-left:16px">
  <h2>Responsive Topnav Example</h2>
  <p>Resize the browser window to see how it works.</p>
</div>

<script>
function myFunction() {
    var x = document.getElementById("myTopnav");
    if (x.className === "topnav") {
        x.className += " responsive";
    } else {
        x.className = "topnav";
    }
}
</script>

</body>
</html>




Python Web Scraping subject

For my academic project I'm looking for an interesting web site to scape using python, Any Suggestions?

thank you all,

Best regards,

Nadia EL HAKIM




Xamarin WCF Service Not Working

wcf web service functions appear in asp.net web projects but I can not add xamarine what is the reason for this?

enter image description here

enter image description here

enter image description here




Not able to change the button size

I am not able to change the button size even though I am using a CSS class to change the width. The form which has the button and the content are placed in a <div>row class. so that they appear side by side.

This is the part of my code:

.row.someDiv{
  margin-left: 0px;
  margin-right: 0px;
  max-width: initial;
}
input[type="text"]{
  border: none;
  border-bottom: 1px solid;
  width: 250px;
  margin-bottom: 10px;
  background: transparent;
}
.button-size{
  width: 100px;
  padding-bottom: 20px;
  
}
<div class="row someDiv">
  <div class="col-xs-8">
   <br/>  
   <label>
     <input type="text" class="text-line" placeholder="Name" required></label><br/>
   <label><input type="text" class="text-line"  placeholder="Email Address" required></label><br/>
   <label><input type="text" class="text-line"  placeholder="phone number"></label><br/>
     <label><input id="message-size"  type="text" placeholder="Message"></label><br/>
    <button type="submit" class="button-size space btn btn-block btn-primary"><i class="fa fa-paper-plane">Submit</i></button>
 </div>
 <div class="col-xs-4">
   <p class="content-style"> Want to get in touch? please fill up the form and I'll revert back soon.
     </div>
  </div>

Button




vendredi 29 décembre 2017

Can someone tell me what website should i make on less than 4 letter .ly domain? Like 3D.LY

How are you? I'm from libya and i can register available .ly domains that are less than 4 letters but unable to sell them to some one who is living outside libya... I have seen there are still some very awesome short .ly domains available to register like 3D.ly Very high in value for any 3D company.. so that's why I'm looking for some one who can help me in making some money out of it... Please tell me which type of website should i make on these type of .ly domains which make some money...

And I'm also looking for someone who can build that website and work with me as a partner.. Waiting for yours comments..




How to show HTML dropdown menu when clicking arbitrary object

I would like to show an HTML form dropdown when clicking on an attribute. After I click the attributed the menu should appear and then once I click an option I want the tag to change to the clicked value.

How would I go about solving this?




Call Webservice myslim

First of all i am sorry if gone be confuse, i don't understand nothing about web-service. So i do a web-service myslim.

structure

inside api

aluno.php:

$app->get('/api/alunos', function(){
require_once('db/dbconnect.php');
foreach ($db->alunos()
             ->order("nome")
         as $row){
    $data[]=$row;
}
echo json_encode($data, JSON_UNESCAPED_UNICODE);
});
 ?>

That work well in my android app, but now i want do web, but i don't know how to call, already see some code but dont work maybe i am searching wrong information




Deobfuscate Javascript [on hold]

I have javascript which is obfuscated using jsf**k. I am trying to decode this message but I can able to decode only half of the message.

  <http://ift.tt/2pYPiAi;




Is it ok to use the anaconda distribution for web development?

I started learning Python working on projects involving data and following tutorials advising to install the anaconda bundle, to take advantage of the other libraries coming with it.

So did I and I got confortable with it, I liked the way it manages environments.

During the last months, I have been teaching myself web development with django, flask, continuing to use the anaconda python. But most of the time I install the dependencies I need with pip install though (inside the conda environment).

I've never seen any tutorials or podcasts mentioning the conda environment as an option for developing web apps so I start to get worried. Is it for a good reason?

Everywhere its the combination of pip and virtualenv that prevail. And virtualenv isn't compatible with anaconda that has its own env management system.

My newbie question is: Will I run into problems later (dependencies management in production or deployment maybe?) using the anaconda distribution to develop my web apps?




How to re-sort search results in-place without having to re-send a request in django?

Here is the scenario:

I have a search page, with some form elements providing multiple filter conditions (something like 'advanced search'), and probably a nested ListView to display the search results in-place. What I would like to achieve:

  1. Whenever the user changes some filter conditions, the result list below responds in-place (taking another request for this could be accepted);
  2. When the user changes the sorting option, the results change their ordering immediately, without sending another request, either synchronous or by ajax. From the server side it would be as simple as changing the order_by attribute of a QuerySet, but I would like it in a front-end way.

So I wonder if it is possible to achieve that. It seems to me that the filtered QuerySet could be somehow kept at the client side.

Is it possible by pure Django using some mechanism like session? Or will it have to take some front-end frameworks such as AngularJS or Vue.js? Or is it not even possible (If so, is there any approach taking the minimal extra network payload?)




How to create a secure webservice with C#?

I want to create a webservice to get access to a mssql-server from a smartphoneapp (Xamarin). But i don't want that everybody can use the webservice. So I have a table with accounts and when sb is calling the webservice i'm checking if the username and password (as hash) are in the table. But i think that a hacker can easily get the call of the service and with this the parameters like username and password too. So he can call the service with this logindata. So my question is how can i avoid this? (I have an ftp windows server with a https certificat - can i use the https connection so the hacker can not get the data?)




Inline event handler practice javascript

I am reading about Events on the Mozilla, here it talks about "Inline events handlers" these should not be used and are considered a bad practice.

e.g.

<button onclick="bgChange()">Press me</button>

However, in frameworks such as Angular we do something like:

<my-component (click)="onClick($event)"></my-component>

Is this not contradicting to what bad practice is considerd by Mozilla in this case.

If this question needs to be asked in another section, please do let me know.




Will Firebase be a good database for a Django server to serve a Website and an Android application?

Not a lot is out there for integrating Firebase with a Django server. Will it be a good database to serve a Website and a mobile application?




How to automatically show the diacrtics on a page?

I have a text that includes ă,ș etc. Is there any way to show the diacritics instead of "?" on a web page, widthout using the HTML character codes for each of them?




Differences between cloud infrastructure and hyperconverged infrastructure

What are the differences between cloud infrastructure and hyperconverged infrastructure in terms of servers, datastores and hardware and use for enterprise application for scalability? Pros and cons of each would also help understand.




jeudi 28 décembre 2017

Adding mouse over in a certain area

I'm looking to create an informational website for a game called Path of Exile. Long story short, I'd like the website to function like this:

User mouses cursor over a blue point on the map and a small box pops up giving information such as monster level and any other info I'd like to add. I'm not sure how this would be possible for a website. Possibly some JavaScript? Thanks.




Where should I store images in my web app?

I'm creating a web app that needs to display a slideshow of images on the homepage - the images will be updated every few weeks. Where should I store these images? On the frontend? On the backend? Or, should I host a DB and store them on there? Not sure what the pros and cons of each option are.




A route named 'DefaultApi' could not be found in the route collection.\r\nParameter name: name

  public CitationFactory(HttpRequestMessage request)
    {
        // Arrange.
        var configuration = new HttpConfiguration();
        request.Properties[System.Web.Http.Hosting.HttpPropertyKeys.HttpConfigurationKey] = configuration;

       _urlHelper=new UrlHelper(request);
    }




section.URL= _urlHelper.Link("DefaultApi", new { id = 1 }); 

I have created URLHelper to create link in asp.net webapi. But it is not working.




Java Web App: NetBeans: "1045: The module has not been deployed." Fails on Glassfish and AWS's Tomcat

I used some more complex code, but to simplify everything, I put in very basic code for simplicity sake for y'all to get a better chance of answering my question.

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Testing</title>
    </head>
    <body>
        <h1>Testing</h1>
        <table border="0">
            <thead>
                <tr>
                    <th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td><input type="radio" name="1" value="Test1" /></td>
                    <td><input type="radio" name="2" value="Test2" /></th</td>
                </tr>
                <tr>
                    <td><input type="checkbox" name="1" value="ON" /></td>
                    <td><input type="checkbox" name="2" value="OFF" /></td>
                </tr>
            </tbody>
        </table>

    </body>
</html>

Only have one index.jsp file. Made a web project with NetBeans will all the default settings. Running on MacOS Sierra. I've searched all over for the past many hours, and nothing has worked. Like I said in the question, I even uploaded the .war file to AWS's Elastic Beanstalk and it still gives a 404 error.

Thanks for the replies!




Styles not applied to HTML pages loaded using window.open in Tomcat web application

I am trying to load a help page in a new popup window as shown in the code below:

<a href="#" onclick="window.open('/abc.htm', null,'width=500px,height=600px,scrollbars=yes,resizable=yes');" > <img src="/images/icons/xyz.gif" valign="middle" border="0"/> </a>

My application is a J2EE web application deployed on Tomcat 8. The web pages for the help files are HTML files present in the root directory in the webapps folder in Tomcat. The stylesheets and JavaScripts are stored in sub folders in the root directory.

My issue is that when the help page is loaded none of the styles are applied to it. However if I am loading the help file by double clicking on it then all the styles are applied. Only when it is loaded through Tomcat I am having this issue.

The chrome console is showing the below warning:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8080/Skins/Default/Stylesheets/Styles.css".

Can somebody please explain what am I doing wrong here?




Is there any "fair" adblocker? [on hold]

I don't know much about adblockers but to my understanding they seem to block requests from third-party sites that would display advertisements on the webpage i am browsing thanks to filters, then the content is not loaded and not displayed.

So my question is the following, considering the website earns money for displaying ads and that the only way to know if you have or not an adblocker is to check if you did load the ads, is it possible to make an adblocker that actually loads the ads and then simply doesn't display them?

Unless i am wrong that would allow the website to earn the money while thinking you see the ad, but you actually don't. As an extra, websites wouldn't display the "please disable adblock" messages or block you as some do.

I would like to support some websites but i hate seeing ads and disabling my adblocker simply isn't a solution (nor donating to improve my karma as some could suggest), i can clearly afford the bit of extra bandwith consumption caused by the loading of ads and the small loss of performance due to their "cleaning" from the page i see.

Extra question, i know some ads are only rewarding when the visitor clicks on it, would it be possible to fake a click on the ad, load it in the background, give the money to the website and still see nothing?

Thanks for answers

PS: Since the adblocker i suggest would make advertisers loose money i wonder if "fair" is the best adjective. (I am not english)

EDIT: Removed the part where i asked for existing software, please reopen my question. If it doesnt belong here (despite i see dozens of adblock-related questions on the right) where can i ask it?




can I test my HTML web template responsive on an online website?

can I test my HTML web template responsive on an online website?

I upload my website and I check its fully responsive or not?

As like: w3 validator is shown my HTML page error.

I needed This type website.

Note: I responsive my HTML site template some media query and bootstrap.

if anyone knows how to check online my site responsive or not please share in here .




how to open a document when loading a web page

I want to open a excel document while loading a web page but i don't know how. I tried this:

<script>
function myFunction() {
    window.open("file:///D://Files/doc.xlsx");
}
</script>
<body onload="myFunction()">
</body>

But it didn't work. I want to mention that it has to be done for IE8 and less.




Firebase Web Authentication - what about server side?

I'd like to authenticate users using Firebase and Firebase UI. I have just started out with it. I was thinking to use it as all tutorials suggest, and that is checking for a valid user in the promise, providing the developers a way to get that user's email, uid and the provider (maybe a picture too).

But then I thought, what about my server side? couldn't someone just copy the previously logged in user's email, and by using devtools just populate the fields as they see fit, and then just start using the web app?

Isn't there a way for my server to query Firebase under the hood so that I can be sure that user is still logged in?

Would that accessToken might be useful for that? Is there a library that helps contacting Firebase servers?

{"displayName”:”someone”
"email”:”some@one.com",
"emailVerified":false,
"phoneNumber":null,
"photoURL":"http://ift.tt/2DoKRAg?,
"uid":"6yC3n39SsnOeFNZ6pJ0Yaw1vF2e3",
"accessToken”:”hjeher38738743j4k34.....", // <-- IMMEDIATE SUSPECT
"providerData":[
{
"uid":"987239872349872",
"displayName":"Some User",
"photoURL":"https://scontent.xx.fbcdn.net/v/t1.0-1/p100x100/83487843_3453453453453$%_32487234.jpg",
"email":"some@mail.com",
"phoneNumber":null,
"providerId":"facebook.com"
}
]




Which is the **best Python IDE** for a beginner in **Windows or Linux or both**?

I just started learning Python programming language and curious about using tools that are specifically meant for Python beginners. I also would like to get some suggestion on what are the best tools available out there for learning Python,as I am confused with large options available.

PS: I know C,C++,Java core,Android, HTML & CSS for basic skeleton website, SQL basics

So I need tools than can teach me python overall and specifically for Web Development and Machine Learning.

Thank you in advance !




How can I Speedup Regex to find Image Urls

I would like to be able to browse web pages for pictures. The regex that I have done works, but it is very slow and needs some steps. The data types should be able to be extended later. Maximum 10 pieces at once. Do you have an idea? Happy new year and thanks for the help!

This is my currently Regex:

([\-\_\/\.\:\d\w\\]{1,})\.(jpeg|jpg|png|gif|tiff|psd|bmp|cr2)

Desired result output:

http://ift.tt/2C2BLgz
http://ift.tt/2zGElmr
./xxxxxx/xxxx.jpeg
/xxxxxx/xxxx.gif
xxxxxxx.jpeg




In MVC 5 how to form authentication works

this is code in web.config MVC5 application

<authentication mode="Forms">
   <forms loginUrl="~/Account/Login" timeout="2880"></forms>
</authentication>

I am not getting which method it will call either GET Method or POST Method? I am also not getting control over debugger.




How to use C# Winforms in Web Browser

Firstly, sorry for my english,

I want use C# Win Forms the in Web Browser. I'll write C# purchasing project for a my customer. But this customer wanting use this project on web browser. (Like remote desktop). Project will run on my customer server and i want use on web browser too.

I had search little bit on internet. It have can be done with delphi. In my opinion it can be with C# too.

But how?




missing appcfg.py for app-engine deployment

I have inherited an app-engine project.

I try to deploy from my dev machine:

appcfg.py --oauth2 update PATH

I have installed app-engine SDK but I cannot find appcfg.py

I have googled and seems like appcfg.py is no longer in use?

how should i deploy otherwise?




How to detect whether a website use Angular or React

What is the easiest and most convenient way to detect whether a website uses Angular or React?




How do I draw a polygon border? in css

Dear developer i want make like this

this is before enter image description here

i want after like this enter image description here

Lable is li tag like

<ul>
    <li>one</li>
    <li>two</li>
    <li>three</li>           
</ul>

The box below is the div tag

like this

<div class="main-container">

</div>

I tired like this

li{
border-top: 1px solid red;
border-left: 1px solid red;
border-right: 1px solid red;
}

div{
border: 1px solid red;
}

However, the two borders overlap and are disgusting.

**

I would like to avoid the table-cell method. Because it was impossible to design a reactive type by wrongly calculating the area.

**




How to set Auto Replay for my Soundcloud embed link on my webpage?

I am making a website sharing some of my audios using Soundcloud services. How could I, on my webpage, set the Auto replay for my audios? Users only need to hit the play button once.




Related to Get service call

I just created a HTTP get request to get the content(All the Badges) from stack overflow for my console application as shown below :

  public void getStackBadges()
        {
            var client = new HttpClient();
            client.BaseAddress = new Uri("http://ift.tt/2C4HEJW");
            var res = client.GetAsync(client.BaseAddress).Result;
            Console.WriteLine(res);
        }

Can anybody please tell if i want to get all the badges from stack overflow using this API what i need to do. I don't realy understand the format of result that i am getting on my Cmd prmt !




Response.End in Razor?

I am using Razor V3. in any.cshtml:

@{
    <p>asdfasdf</p>
    Response.End();
}

then access this page, you'll get a blank page, no content. what is the correct way to end response? except return; because maybe I want end response in @helper. Thanks.




mercredi 27 décembre 2017

Why c# Web Browser control's InvokeMember("click") is not being fired?

I need to login to a web site using c# web browser control in an web application. The site has javascript redirects. When InvokeMember("click") is called, it does not fire. My code is as follows:

    public Form2()
    {
        SetBrowserFeatureControl();
        InitializeComponent();
    }

    int pages = 0;

    private void btnLoginEc_Click(object sender, EventArgs e)
    {
        pages = 1;
        webBrowser1.DocumentCompleted +=
             new WebBrowserDocumentCompletedEventHandler(DocumentCompleted);

        webBrowser1.Navigate("http://ift.tt/1o6ieYS");
        //webBrowser1.Refresh(WebBrowserRefreshOption.Completely);

    }       

    void DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        //WebBrowser webBrowser1 = sender as WebBrowser;
        if (webBrowser1.ReadyState != WebBrowserReadyState.Complete) return;

        if(pages == 1)
        {
            pages = 2;
            //login();
            HtmlElement userNameEle = webBrowser1.Document.GetElementById("pt1:username::content");
            HtmlElement passwordEle = webBrowser1.Document.GetElementById("pt1:password::content");
            HtmlElement logonButtonEle = webBrowser1.Document.GetElementById("pt1:logon");
            HtmlElement formEle = webBrowser1.Document.GetElementById("f1");

            if (userNameEle != null && passwordEle != null && logonButtonEle != null)
            {
                userNameEle.SetAttribute("Value", "username");
                passwordEle.SetAttribute("Value", "password");

                logonButtonEle.InvokeMember("click");


            }
        }
        else if(pages == 2)
        {
            pages = 3;
            //gotoData();

            HtmlElement someEle1 = webBrowser1.Document.GetElementById("pt1:it1::content");
            HtmlElement someEle2 = webBrowser1.Document.GetElementById("pt1:id1::content");
            HtmlElement verifyButtonEle = webBrowser1.Document.GetElementById("pt1:verify");

            if(someEle1 != null && someEle2 != null && verifyButtonEle != null)
            {
                someEle1.SetAttribute("Value", "somevalue");
                someEle2.SetAttribute("Value", "somevalue");
                verifyButtonEle.InvokeMember("click");

            }


        }

    }  

  1. I need to login to site first (Login button is not clicked).
  2. Then I put some value in the controls
  3. Then Verify button needs to be clicked



How to use ember.js for client side with struts as server side?

I have created an application of Student Details using Struts Framework Now I am given the task to use ember.js Framework in the same Application for client side. So Can someone explain how can i use both together?




How to download links in the html of a url?

For example, when I open http://ift.tt/1jBnDYz in browser, the browser will download not only the main page, but also images, js, css.

But when I do curl http://ift.tt/1jBnDYz, only the main page html is downloaded. Is there any options of curl or wget that can download images/js/css also?

Or any other tools can do this?




Creating a simple P2P network

I am attempting to create my own version of a cryptocurrency by using a BlockChain in a P2P network. I would like users to access my website then download an executable that allows them join the network and mine for currency. I also would like my website(c#) to display the updated ledger of the blockchain. I have done a lot of research, with little success, attempting to understand how to construct the P2P network.

What would be the recommended language to construct this executable? Are there any tutorials or examples that are suggested? In addition, how would my website access the universal ledger? Is it feasible to have my website's server also join the P2P network, or should the P2P network continuously send the ledger to my server?




pics not loading in codeignitor

I am new to codeignitor and trying to make a controller and a view.controller is made successfully made and calling the view. view is also being called successfully but images are not shwoing. I have tried puting pics is same folder as the views and in other folder but none worked

View

            <!doctype html>
        <html>
<head>
<!-- Latest compiled and minified CSS -->
<meta charset="utf-8">
<title>Untitled Document</title>
<!--<link href="/assists/css/font-awsome.css" rel="stylesheet" type="text/css">-->
<!--<link type="text/css" rel="stylesheet" href="/assists/css/stylecinemax.css">-->
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="style2.css">
<!-- Start CSS Slideshow HEAD section -->
<link rel="stylesheet" type="text/css" href="engine1/style.css" />
<script type="text/javascript" src="engine1/jquery.js"></script>
<!-- End CSS Slider HEAD section -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://ift.tt/2apRjw3">

<!-- jQuery library -->
<script src="http://ift.tt/2nYZfvi"></script>

<!-- Latest compiled JavaScript -->
<script src="http://ift.tt/2aHTozy"></script>
</head>




<body>

        <div class="header">
            <a class="cinestar" href="#"></a>
            <a id="membersarealink" style="margin-left: 5%" href="#" class="toplink">Home</a>
            <a id="corporatelink" href="#" class="toplink">Corporate</a>
            <div class="imaxbox">
                    <div class="sponsor"><img src="pics/sponsorlogo.png" height="32"></div>
                </div>
                <a id="gallerycinestar" href="#" class="toplink">Gallery</a>
                <a id="aboutus" href="#" class="toplink">About</a>
                <a id="contactuscinestar" href="#" class="toplink">Contact</a>
                <div class="contactinfo">
                    <h1>(042) 111 cinema</h1>
                    <a href="#" class="socialicon"><img src="googleplus-header.png" width="24"></a>
                    <a href="#" class="socialicon" target="_blank"><img src="../pics/2.png" width="24"></a>
                    <a href="#" class="socialicon" target="_blank"><img src="../pics/imax-logo.png" width="24"></a>
                </div>
                <div class="topticker" style="background-color:gainsboro">
                    <span>
                        <a class="online-booking-dialogue" href="login.php">Login</a>
                        <a class="members-area-dialogue" href="registration.php" target="_blank">MEMBER REGISTRATION</a>
                    </span>
                    <p style="padding-left: 2%">
                        To get SMS Alerts of our daily schedule and promotions, please dial 111 CINEMA from your cellphone 
                    </p>
                </div>  <!--toptickter-->


        </div> <!--header-->
    </body>
    </html>

COntroller

<?php

class front_page extends CI_Controller{

public function one()
{

 $this->load->view('header');
}


}

this is the output output




Angular2 Router Navigation

I'm trying to test out router navigation in my application, however each time I attempt to navigate to my url I get thrown back to the homepage.

The router should navigate to the next page when the user selects a row to complete a form, like this:

  onUserRowSelect(event): void {
    this.router.navigate(['myforms']);}

However, myforms is not being navigated to, heres how I defined the routes:

    const routes: Routes = [
  {
    path: '',
    component: UserAdminComponent,
    children: [
      {
        path: 'createuser',
        component: CreateUserComponent
      },
      {
        path: 'updateuser',
        component: UpdateUserComponent,
        children: [
          {
            path: 'myform',
            component: UpdateFormComponent,
          }
        ]
      },
    ]
  },

];

So the navigate to myURL/useradmin/updateuser/updateform does not work at all (if the child routes are working even).

I can elaborate more if needed. Thank you




how does the hacker change or add the content to source code of web page

I don't even had a little bit of knowledge in hacking, but i just want to know that where the hacker will (change or add) the source code of web page to change the content of web page. Do they use any editors or in which environment will they hack or what is the tool used to hack.




Java webapp produces StackOverflow exception on Linux

I have a Java-web application running on Tomcat 9. It works fine on a Windowns machine. But after deploying this app on a Debian Linux server I've encountered java.lang.StackOverflow exceptions on some particular pages. Here is the beginning of the stacktrace log:

27-Dec-2017 08:54:43.746 SEVERE [https-jsse-nio-9443-exec-3] 
org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for 
servlet [jsp] threw exception
java.lang.StackOverflowError
at java.io.UnixFileSystem.canonicalize0(Native Method)
at java.io.UnixFileSystem.canonicalize(UnixFileSystem.java:172)
at java.io.File.getCanonicalPath(File.java:618)
at org.apache.catalina.webresources.AbstractFileResourceSet.file(AbstractFileResourceSet.java:90)

Please, see full stacktrace here: http://ift.tt/2Ce1saR

As far as I understand, the exception occurs while compiling the JSP page source by Jasper and it's somehow related to the resolving of Linux paths / directories. Could anybody please help me to figure out what the exact problem is? I didn't create any symbolic links, if the problem can be related to this.




Can't maxomize window on BrowserStack

I have an issue, I'm not able to maximize window on browserstack for Chrome, Edge, Ie I've tried different ways like

driver.manage.window.resize_to(1804,1096)
driver.manage.window.maximize

Works fine for firefox - Windows




Any way to embedd facebook 360/180 view like in an external website?

I wanna make a 180 panoramic look/feel with the same control and UX as facebook embedded into my website (Based on WordPress).

Example of my picture: http://ift.tt/2zALeWt

Is there any recommended plugin or another way to make/transfer it to my website?

  • I tried few WordPress Plugins or Javascript scripts without much success, the UX is very different and hasn't given me the result I wanted.

Thanks in advance, Dan.




Integrate document scanner with web application

I have a portable document scanner, which is Eloam's product. It has its own driver software which could do many things such as -Scan the image, -Convert it into PDF, create multiple PSD and also it has a capability to OCR.

So by the way, in short now my requirement is to scan, convert and save the image in web application. Is there any API? or another way to do it?




mardi 26 décembre 2017

How to check if FontFace prototype exists in Edge

I am using FontFace to preload fonts, it's working ok on chrome, but it stops page in Edge because FontFace is not defined in Edge.

How can I check if FontFace class prototype exists ( in JavaScript) so I don't construct it in Edge?

(I know FontFace prototype doesn't exist in Edge, but just wanted to prevent page from crashing by skipping using FontFace in Edge)

I tried this, but doesn't work in edge, it crashes.

if (typeof FontFace != undefined)
{
....
}




Undefined error for variable never used Node.JS

I am writing a chat app but the Node.JS console is saying a is undefined. I have never used a variable "A" so I am not sure why it is saying this.

console.log('Starting Server...');const express=require('express');const app=express();const server=require('http').createServer(app);const POST=process.env.PORT||80;const io=require('socket.io').listen(server);app.get('/',(req,res)=>{res.sendFile(__dirname+'/client/index.html');});app.use('/client',express.static(__dirname + '/client'));server.listen(PORT);console.log('Server Started...');let messages='';io.sockets.on('connection',socket=>{socket.emit('beforeMsgs',messages);socket.on('msgSend',e=>{console.log(${e.name}: ${e.msg} ${e.time});io.sockets.emit('msgReceived', {name: e.name,msg: e.msg,time: e.time});messages = <div class="message"><span class="bold"><td><b>${e.name}: </b></td></span><span><td>${e.msg} <sub class="date">${e.time}</sub></td></span></div> + messages;});});function returnRandInt(){let one=3;let two=19;let three;three+=92;if(!(!boolean(true))){console.log('86\'`()->{&setFirst(\)=>self::depricateQuery(new (()=>{return this})()}')}}let HTML=''+''+'.browserupgrade{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.copy,h3{color:#4c4c4c},body{border:0;outline:0;padding:0;margin:0}{vertical-align:baseline;background:0 0;-webkit-touch-callout:none;-webkit-user-select:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent}:focus{outline:0}::-moz-focus-inner{border:0}img{display:block;transform:translateZ(0)}li,ol,ul{list-style:none}body{-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden;overflow-x:hidden;background-color:#fff}*,::after,::before{box-sizing:border-box}@font-face{font-family:Montserrat-Bold;src:url(../fonts/Montserrat-Bold.eot?#iefix) format("embedded-opentype"),url(../fonts/Montserrat-Bold.otf) format("opentype"),url(../fonts/Montserrat-Bold.woff) format("woff"),url(../fonts/Montserrat-Bold.ttf) format("truetype"),url(../fonts/Montserrat-Bold.svg#Montserrat-Bold) format("svg");font-weight:400;font-style:normal}@font-face{font-family:Montserrat-Light;src:url(../fonts/Montserrat-Light.eot?#iefix) format("embedded-opentype"),url(../fonts/Montserrat-Light.otf) format("opentype"),url(../fonts/Montserrat-Light.woff) format("woff"),url(../fonts/Montserrat-Light.ttf) format("truetype"),url(../fonts/Montserrat-Light.svg#Montserrat-Light) format("svg");font-weight:400;font-style:normal}@font-face{font-family:Montserrat-Regular;src:url(../fonts/Montserrat-Regular.eot?#iefix) format("embedded-opentype"),url(../fonts/Montserrat-Regular.otf) format("opentype"),url(../fonts/Montserrat-Regular.woff) format("woff"),url(../fonts/Montserrat-Regular.ttf) format("truetype"),url(../fonts/Montserrat-Regular.svg#Montserrat-Regular) format("svg");font-weight:400;font-style:normal}@font-face{font-family:OpenSans;src:url(../fonts/OpenSans.eot?#iefix) format("embedded-opentype"),url(../fonts/OpenSans.woff) format("woff"),url(../fonts/OpenSans.ttf) format("truetype"),url(../fonts/OpenSans.svg#OpenSans) format("svg");font-weight:400;font-style:normal}@font-face{font-family:OpenSans-Bold;src:url(../fonts/OpenSans-Bold.eot?#iefix) format("embedded-opentype"),url(../fonts/OpenSans-Bold.woff) format("woff"),url(../fonts/OpenSans-Bold.ttf) format("truetype"),url(../fonts/OpenSans-Bold.svg#OpenSans-Bold) format("svg");font-weight:400;font-style:normal}main>div{position:relative}.cover,.header-logo{width:100%}.header-logo-wrapper{z-index:2;max-width:100%}.cover-wrapper{z-index:1;max-width:100%}.logo{width:28.6%;max-width:542px;margin:1.2vw auto}.dots,h3{color:#777}Page 1';

Why is it saying "A" is undefined and how can I fix it?




How do I display 'hello world' on a public website, using my aws server with eclipse or html?

I currently have been able to locally post 'Hello World' in HTTP using eclipse, but what I want to do is publicly display 'Hello World' on a website that anyone can access. I also have AWS toolkit installed in eclipse and have an AWS EC2 instance Ubuntu 16.04 server running that I have successfully SSH to.

What should I do?




Why are annotations used with java on Dependecy Injection

so I am reading about the Dependency Injection for the first time. I think I have figured it out and I have understood an example written for PHP. Though, I was reading this JAVA tutorial and it insists on adding annotations. If I am going to offer the the class its dependency externally using the constructor for example, then what why are the annotations required? Also, I am reading on the Spring framework, which also states you need annotations. How do the annotations fit in? Any information is appreciated.




display dynamic view in asp

i try to make an examining system so the admin up lode the question and the choices and the answers i wont to display in user side the question and the chooses in Multi View each view have a question and 3 Radio Button one for each choice in Radio Button List but i get only the first question in the first view when display the other view i get error (ActiveViewIndex is being set to '1'. It must be smaller than the current number of View controls '1'. For dynamically added views, make sure they are added before or in Page_PreInit event. Parameter name: value)

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            m1.ActiveViewIndex = 0;
        }
        if (m1.ActiveViewIndex==0)
        {
            Button2.Visible = false;
        }

    }


protected void Button1_Click(object sender, EventArgs e)
{

    con.Open();
    SqlCommand cmd = con.CreateCommand();
    cmd.CommandType = CommandType.Text;
    cmd.CommandText = "SELECT * FROM exam WHERE exam_name='" + Request.QueryString["examid"] + "'";
    cmd.ExecuteNonQuery();
    DataTable dt = new DataTable();
    SqlDataAdapter da = new SqlDataAdapter(cmd);
    da.Fill(dt);

    foreach (DataRow dr in dt.Rows)
    {
        View view = new View();
        Label label = new Label();
        RadioButtonList list = new RadioButtonList();
        label.Text = dr["qustion"].ToString();
        list.Items.Add(new ListItem(dr["cha"].ToString(), "a"));
        list.Items.Add(new ListItem(dr["chb"].ToString(), "b"));
        list.Items.Add(new ListItem(dr["chc"].ToString(), "c"));
        view.Controls.Add(label);
        view.Controls.Add(list);
        m1.Views.Add(view);
    }
    m1.ActiveViewIndex = 1;
    Button2.Visible = true;
    Button1.Visible = false;

}

protected void Button2_Click(object sender, EventArgs e)
{
    if (m1.ActiveViewIndex < m1.Views.Count)
    {
        m1.ActiveViewIndex += 1;
    }

}




Laravel 5.5 Send MAil

I a trying to send an email from localhost to my email but i alwasy get this error

Connection could not be established with host smtp.gmail.com [Une tentative de connexion a �chou� car le parti connect� n�a pas r�pondu convenablement au-del� d�une certaine dur�e ou une connexion �tablie a �chou� car l�h�te de connexion n�a pas r�pondu. #10060] and i didn't found any solution

this is the controller code

public function contact_sent(Request $request)
{
    $emails = "mohamedfarjallah8@gmail.com";
    $messages = "This body message......";
    $subject = "This is subject from email";
    $fromEmail = "mohamedfarjallah8@gmail.com";

    $data = array('emails'=>$emails,'messages'=>$messages,'fromEmail'=>$fromEmail,'subject'=>$subject);
    Mail::send([],$data, function ($message) use ($data) {
                     $message->from($data['fromEmail'],'SubText that show in header part of email');
                     $message->to($data['emails'])->setBody($data['messages']);
                     $message->subject($data['subject']);
                     $message->replyTo($data['fromEmail'],'Some text you can test this');

            });

            echo "Ok you can check your email";exit;
}

and this is the .env configuration

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=2525
MAIL_USERNAME=mohamedfarjallah8@gmail.com  
MAIL_PASSWORD=**************
MAIL_ENCRYPTION=tls




гзGet the text from webpage what not exists in source code and links?

I am using Java Jsoup Api of just getting the raw text from some url and want to get specific text in there.
But my question is language and API-independent:
i just want to know, where this text comes from.
As an example, you can see: stepsone
If you see the source code of the page there is no place where this text (from job application) is and there is no links to another ressources where it would be, so how it appears on browser? From javascript? How to get it then with Jsoup?




is it good to work with 50 tables for a project

my Project is based on website and mysql, i am working on management project

i am woking with php and mysql some project needs more tables for fast and effective work but this is my employee management system is requried more then 50+ tables for execution. we also normlized all tables as required.

is it good way to work with 50+ tables?




Text to Speech in browser - Get voice like Siri/Google

I am developing a web app which will need to convert given text(1000+ chars) into speech. I was going to use Google translate but that has the limit of 100 chars.

I have tried HTML5 SpeechSynthesis but it has a weird male voice (I guess it's using OS' voice). So basically I need a voice like Siri or Google (OK Google type). Is there any way to do this?




Deploy web application .exe

I made a web application which is built into an .exe file so I can run it and see it on a browser on localhost:3000.

How can I make the app open to the world by IP of my computer so it can be accessed by anyone (that is, anyone can visit my website by pointing the browser to my IP)?

I tried NGENIX. I read a lot of articles on how to deploy a web application and I can't get it working.

If it is possible what is the simplest way on Ubuntu?




Why the size tab in chrome devtools network panel has 2 cells?

I want to ask that why the size tab has 2 cells? It seems that the over is Encoded Data and the under is Decoded Body, but the developer doc doesn't have explanation about this, and if so, and why some Encoded Data is bigger than Decoded Body(no HTTP2)




pixi container hitarea with mask

I create a container then add some points to it , and create a mask on the container, make the container moveable , outside the container , there are some displayObject which are clickable ;

but when I move the container, the displayObject is masked by the container , it is not clickable;

what is worse, the point is invisible but clickable outside the mask , seems mask only make it opacity:0 , It's not correct !

here see more visible

http://ift.tt/2DfKckQ




PHP JS HTML C++ Website

Can someone make a website with the following:

  • Forum using object oriented PHP, MySQL and PDO
  • Chat Using AJAX, object oriented PHP, MySQL and PDO
  • Video chat with AJAX, JS, object oriented PHP, MySQL, and PDO,
  • HTML Canvas that people can draw on and others can see using TypeScript, object oriented PHP, MySQL, and PDO

I have been having trouble with Apache so I may also need someone to make a substitute for it using C++. I do not own a domain so I may need someone to set up the DNS for one of theirs. (It must be a .com). Oviously it needs to be completely responsive and must look good. You should use the SCSS pre-compiler to help you. I also need help getting it on the front page of Google for any searches that resemble what you decide to name the project. Just send the code for each file in your response and tell me what they should be called and what folder they should go in. Make sure to use single tags the HTML5 way e.g (<> instead of < />) because it looks much nicer in my opinion. I want the indentation for everything to be 4 spaces. I would recommend you use notepad++ because it is highly effective (this isn't a requirement). It may also need images to go along with it. Just upload the images to a free hosting site and send the link in your answer.




VS 2017 basic web project template

I am currently struggling to find a basic project template for a simple angular app that I am building in VS 2017. This app will consist of only html/js/typescript files, npm's package.json file and a gulpfile. All templates I'm finding are for class libraries or include other aspects of server side based projects that I don't want or need in my project.

Is there a way to make a basic web project in VS 2017? I'd like to stick with Visual Studio since it is the IDE we use for our other projects.

All help is appreciated.




Is c++ good enough for a WEB based ERP

Our company recently order a new ERP ( including Accounting , HR and BI complete solution ) Program . Now some engineers accept the work and submit their solution will be build via C++ and FIBER database , they also grantee to developing both IOS/Android apps , complete web site and any thing else we need . therefore they said Application and it's database must be in single server.

I hear some bad news about developing Web-Apps in C++ , Is it True or not ? Is it true C++ will use more resource than other Modern-Languages in web purpose ?

thanks in advance to who will enter her/his opinion to this topic .




Why is wrong redirecting?

Have model with tasks they are done and todo. In view have link and when click the link it must change task from todo to done. It's my routes

get 'tasks/:id', to: 'tasks#change_to_done', as: 'change_to_done'

my view

<% unless task.done %>
        <td><%= check_box_tag "cb_tasks[]", task.id %></td>
        <td><%= link_to task.title, task %></td>
        <td><%= link_to 'Edit', edit_task_path(task.id) %></td>
        <td><%= link_to 'Done', change_to_done_path(task.id) %></td>
        <td><%= link_to 'Destroy', task, method: :delete, data: {confirm: 'Are you sure?'} %></td>
      <% end %>

and my controller

  def change_to_done
    @task = Task.find(params[:id])
    @task.done = true
    @task.save
  end

when clicking the ling have redirecting to the show path

Started GET "/tasks/32" for 127.0.0.1 at 2017-12-26 11:59:06 +0200
Processing by TasksController#show as HTML
  Parameters: {"id"=>"32"}
  Task Load (0.1ms)  SELECT  "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT ?  [["id", 32], ["LIMIT", 1]]
  Rendering tasks/show.html.erb within layouts/application
  Rendered tasks/show.html.erb within layouts/application (0.7ms)
Completed 200 OK in 57ms (Views: 55.0ms | ActiveRecord: 0.1ms)

What's wrong? I need only to change field state from false to true.




Grey out only layouts while its content are loading

I do not know the exact term for the this (attached) type of page rendering while its contents are being loaded and starts to appear in the UI. Is this a specific kind of concept? I do see this design in few areas, like LinkedIn, Skype etc.,

Is this a part of material design? Any examples or fiddles if you know?

Thanks.enter image description here enter image description here




lundi 25 décembre 2017

Chrome remote debug display issue

I am trying to debug remote Chrome, the device could be connected, and inspect the tab starts fine.

But in the window of remote debug, everything is a mess. the GUI is terrible, which makes the functionality totally unusable, see picture below:

enter image description here

  1. resize this window or change the resolution is not working.
  2. some times tabs like elements, source, networks could presents, but under the source tab, there is search bar keep presents and covers all area of the codes area.
  3. this is totally not working.

OS: Win7. PC Chrome version: 63.0.3239.108 (Official Build) (64-bit) I don't think this should related to Mobile Chrome or android version.

Is there any possible reason for this? I think Chrome is a widely using browser this can't be a formal released bug for Chrome, right?




why it opened web and not app in my web when i use facebook login?

I use php in my app , but when the facebook login in my use ,it can opened web only ,can't open the app to authorization,why ?why ?why ?

$helper = $fb->getRedirectLoginHelper();
   $helper = $fb->getJavaScriptHelper();
   $helper = $fb->getCanvasHelper();
   $helper = $fb->getPageTabHelper();




How do I make a animated logo like tumblr.com currently has?

Just by interest, how is tumblr´s logo done? When you visit https://www.tumblr.com/ and you hover above the "t", a animation within the "t" comes up. Anyone knows the technique behind this magic?




Web calculator - which programming language and technology (how to start)

I want to make physics calculator to help other people with their homework; It should also create dynamic charts, but here is a problem:

-I don't know what programming language, framework, libraries, stuff... use for it. I want to make it simple first and then adding some visuals. I thought about javascript or python, but rly I don't know how to start...




Http failure response for (unknown url) Angular 4

I am having two servers ON on system. One port serving Angular project and another one Laravel. I am using backend made in Laravel to give response in json format. I have made Angular project in which I have implemented an service to consume data from the port and display the list. As I can see in the network tab of developer tools in browser, Angular is retrieving the text from the backend server but however the list is not being displayed. It just shows that error. Here is the code

blog-list.component.html

<div>
<mat-list role="list">
<mat-list-item role="listitem" *ngFor="let blog of blogs"></mat-list-item>
</mat-list>
</div>

blog-list.component.ts

import { Component, OnInit } from '@angular/core';
import {NetworkOperationsService} from '../network-operations.service';
import {Blog} from '../blog';
import {Category} from '../category';

@Component({
selector: 'app-blog-list',
templateUrl: './blog-list.component.html',
styleUrls: ['./blog-list.component.css']
})
export class BlogListComponent implements OnInit
{
blogs : Blog[];
constructor(private networkOperationsService : NetworkOperationsService)
{}
ngOnInit()
{
this.getBlogs();
}
getBlogs() : void
  {
  this.networkOperationsService.getBlogs()
  .subscribe(blogs=>this.blogs = blogs);
  }
}

network-operations.service.ts

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import {Blog} from './blog';
import {Category} from './category';
import {ApiConfigurations} from './api-configurations';


@Injectable()
export class NetworkOperationsService
{
 constructor(private http: HttpClient) { }

 getBlogs() : Observable<Blog[]>
  {
  return this.http.get<Blog[]>('http://localhost:8000/api/blogs');
  }
}

JSON Response

[{"id":1,"title":"My Second Blog","body":"Here is the body of my first blogger app","categories":"[1]","created_at":"2017-12-22 11:28:02","updated_at":"2017-12-22 11:32:15"},{"id":2,"title":"Is Android a right choice for career","body":"A lot of people are trying to make android as their primary motive of their lives so please people stop there and watch for more choices and make your choices more sophesticatedly.","categories":"[1]","created_at":"2017-12-22 17:12:26","updated_at":"2017-12-22 17:12:26"},{"id":3,"title":"Is Android a right choice for career","body":"A lot of people are trying to make android as their primary motive of their lives so please people stop there and watch for more choices and make your choices more sophesticatedly.","categories":"[]","created_at":"2017-12-22 17:12:40","updated_at":"2017-12-22 17:12:40"},{"id":4,"title":"Is Android a right choice for career","body":"A lot of people are trying to make android as their primary motive of their lives so please people stop there and watch for more choices and make your choices more sophesticatedly.","categories":"[5]","created_at":"2017-12-22 17:12:45","updated_at":"2017-12-22 17:12:45"},{"id":5,"title":"Is Android a right choice for career","body":"A lot of people are trying to make android as their primary motive of their lives so please people stop there and watch for more choices and make your choices more sophesticatedly.","categories":"[6]","created_at":"2017-12-22 17:12:51","updated_at":"2017-12-22 17:12:51"},{"id":6,"title":"Is Android a right choice for career","body":"A lot of people are trying to make android as their primary motive of their lives so please people stop there and watch for more choices and make your choices more sophesticatedly.","categories":"[8]","created_at":"2017-12-22 17:12:55","updated_at":"2017-12-22 17:12:55"},{"id":7,"title":"Dushyant SUthar","body":"Dushyant SUthar","categories":"Dushyant SUthar","created_at":"2017-12-25 11:20:06","updated_at":"2017-12-25 11:20:06"}]




Grails 3 - f:table - how to display property of related class

There is 2 simple classes:

class Entity{
Integer id
Status status
String type
}

class Status{
Integer id
String name
}

I just need to replace representation of "status" field in Entity list and edit - instead of my.appStage : 1 -> "normal" How to do it?




i want to know which ip is shown to the website i visit

I used to use Hide My Ass VPN Client on Virtual Machine and all works good, until i needed to run VPN only for specific websites/IPs only, so i downloaded OpenVPN 2.4 and made Batch Scripts to connect and disconnect from VPN Server automatically,

Now the problem is that i want to make sure that the target website i visit is really affected with the VPN, i tested this with ip website and shows the VPN IP but in the another website i cant know what the website sees.

TIA




Ext JS Format DATA to "DD-MM-YYYY"

Using ExtJS 4.2.3, I have FORM with textfield. I need to get value from store to the field. Having problems with my attempt to format data in the desired format. Asking for help with syntax to format data to DD-MM-YYYY

Data in source: /Date(1417986000000)/

After trying to get data by:

Form_window.query('textfield[name="DateField"]')[0].setValue(NewDATA_store.getAt(1).get('DateData'))

Result: Mon Dec 08 2014 00:00:00 GMT+0300 (RTZ 2 (winter))

Result what I need: 08.12.2014




Use Firebase in Web App via Phone Number Log in to Restrict Access to Site?

Firebase now provides an authentication method using the users phone. A user opens a web page, and the page initiates a SMS verification process. Firebase stores the users phone number (Identifier) and a randomly generated User UID. This is great if you want to validate phone numbers of your users, but not so great for restricting access to a whitelist of known phone numbers. Using Firebase phone auth and the very handy firebaseui-web library you receive an authorization when a phone number (ANY phone number) is validated via SMS message.

I guess I could perform a test in the browser client to see if the phone number (after SMS validation) is on the authorized whitelist via an API call to another server; If valid team member, redirect to the team directory site and to a "thanks anyway" site if not. I will say, performing that query in the client browser JavaScript seems like the wrong thing to do. It would be too easy to cheat it. Definitely not a good thing to do,

I'm hoping to use Firebase and phone SMS authorization to restrict a web page's access to a white list of authorized phone numbers. My use case is a group of people who need access to a simple web page showing the phone numbers of others in the group. We don't want that visible to the world, but it would be nice to have in a handy form (i.e. Look up web page, press the <a href="tel:1-408-555-5555">1-408-555-5555</a> phone number for quick, easy access on a mobile phone. We intend to make the page persistent via Progressive Web Application methods.

Any hints on how to proceed on using Firebase to restrict a webpage to a whitelist of users' phone numbers?

Note: I've seen this response that hints that it may be possible to use Cloud Function to restrict access to content but its not clear to me how that would work.




after use generate_password_hash(password), password sequencethe is not in database

i am studying flask web, and have some question

@auth.route('/register', methods=['GET', 'POST'])
def register():
    form = RegistrationForm()
    if form.validate_on_submit():
        user=User(email=form.email.data,username=form.username.data, 
                  password_hash=form.password.data)
        db.session.add(user)
        db.session.commit()
        flash('you can now login')
        return redirect(url_for('auth.login'))
    return render_template('auth/register.html', form=form)


class User(UserMixin, db.Model): 
    __tablename__ = 'users'
    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.Integer, unique=True, index=True)
    username = db.Column(db.String(64), unique=True, index=True)
    role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))
    password_hash = db.Column(db.String(128))
    @property
    def password(self):
        raise AttributeError('password is not a readable attribute')

    @password.setter
    def password(self, password):
        self.password_hash = generate_password_hash(password)

    def verify_password(self, password):
        return check_password_hash(self.password_hash, password) 

    def __repr__(self):
        return '<user %r>' % self.username

register image

database image

When I enter the account password registration, the password is 16. but The password of the database is also 16, not the sequence of the password.

i can't understand




urllib.error.URLError: HTTP Error 403: Forbidden from urllib.request.urlopen

I'm trying to get ulr status via urllib.request.urlopen and in some cases it return urllib.error.URLError: HTTP Error 403: Forbidden howewer I can open this url from browser successfully. Is it possible to overcome this problem with urllib or better to use some other lib?

def urllib_status(url):
    REQUEST_TIMEOUT = 10

    if 'http' not in url:
        url = 'http://' + url

    try:
        response = urllib.request.urlopen(url, timeout=REQUEST_TIMEOUT)
        return response.status
    except urllib.error.URLError as e:
        print('url:'+url)
        print('urllib.error.URLError:', e)
        return -1
    except ssl.SSLError as e:
        print('url:'+url)
        print('ssl.SSLError:', e)
        return -1
    except socket.error as e:
        print('url:'+url)
        print("socket.error: ", e)
        return -1




Extjs Record.get from Store

Using ExtJS 4.2.3. I have FORM with combobox field and some values inside on choose, and some textfields. I need to get value from store and put it in textfields when user pick 1 of the value in combobox. Using documentForm_window.query('textfield[name="Textfield1"]')[0].setValue(record.get("cfo_name")) in listener of combobox field. But it doesn't work.

Example of code on ExtJS:

documentForm_window = Ext.create("Ext.window.Window", {
        title: (document_GUID == null) ? "[Create]" : "[Edit]",
        width: 500,
        modal: true,
        layout: "fit",
        items: [{
            xtype: "form",
            frame: true,
            waitMsgTarget: true,
            listeners: {
                afterrender: function (form) {
                    if (document_GUID != null) {
                        form.getForm().load({
                            url: Ext.state.Manager.get("MVC_url") + "/Document/Get",
                            method: "GET",
                            params: { document_GUID: document_GUID },
                            waitMsg: "[loading]",
                            timeout: 300,
                            failure: function (form, action) {
                                if (action.result) Ext.Msg.alert("[Error1]!", action.result.errorMessage);
                                else Ext.Msg.alert("[Error2]!", "[Error3]!");
                            }
                        });
                    }
                }
            },
            defaults: {
                anchor: "100%",
                msgTarget: "side",
                labelWidth: 145,
                allowBlank: false
            },
            items: [{
                xtype: "combo",
                name: "document_type",
                fieldLabel: "<b>[Type]<font color='Red'>*</font></b>",
                displayField: "document_type_name",
                valueField: "document_type",
                queryMode: "local",
                triggerAction: "all",
                editable: false,
                store: document_store,
                    listeners: {
                        select: function(combo, records) {
                            console.log(combo);
                            console.log(records);
                            if(!Ext.isArray(records)) records = [records];
                            Ext.each(records, function (record) {
                                if (record.get(combo.valueField) == 3) {
                                            documentForm_window.query('textfield[name="Textfield1"]')[0].setValue(record.get("cfo_name"));
                                            documentForm_window.query('textfield[name="Textfield2"]')[0].setValue(record.getData().cfo_manager);

                                  }
                          });
                     }
             },
            formBind: true,
            buttons: [{
                text: (document_GUID == null) ? "[Create]" : "[Edit]",
                handler: function () {
                    var action = (document_GUID == null) ? "Create" : "Edit";

                    var form = this.up("form").getForm();
                    if (form.isValid()) {
                        form.submit({
                            url: Ext.state.Manager.get("MVC_url") + "/Document/" + action,
                            params: { document_GUID: document_GUID, treasury_GUID: tree_value },
                            waitMsg: "[Loading...]",
                            success: function (form, action) {
                                documentForm_window.destroy();
                                OrderLines_store.load({
                                    scope: this,
                                    callback: function (records, operation, success) {
                                        documents_List.query('*[itemId="DATA1_grid"]')[0].selModel.select(curr_position);
                                    }
                                });
                            },
                            failure: function (form, action) {
                                if (action.result) Ext.Msg.alert("[Error1]!", action.result.msg);
                                else Ext.Msg.alert("[Error2]!", "[Error3]!");
                            }
                        });
                    }
                }
            }]
        }]
    }).show();
}

Example of storage. And it's code below the image. enter image description here

  //stores //   
     document_store = new Ext.data.ArrayStore({
        fields: ["document_type", "document_type_name"],
        data: [[0, "data1"], [1, "data2"], [2, "data3"]]   
    });



  OrderLines_store = new Ext.data.Store({
            model: "OrderLine_model",
            proxy: {
                url: Ext.state.Manager.get("MVC_url") + "/OrderLine/ListForDocuments",
                type: "ajax",
                reader: { root: "data" }
            },
            sorters: [{
                property: "orderLine_id",
                direction: "ASC"
            }],
            remoteFilter: true,
            filters: [{
                property: "order_GUID",
                value: [" = ''" + treasury_GUID + "''"]
            }],
            autoLoad: true
        });




Web server from home without paralyzing internet at home

I'm looking for a way to run a simple web server that will be accessible from "outside web" from my home. I somewhat understand what I have to do, but my problem is that I can't give up my entire port 80 by port-forwarding, because I still need to use internet normally on the same network. Is there any solution that could help me?

Sorry if I'm not clear, I really don't know how to explain it.
Thanks in advance.




c# FiddlerCore AutoResponder Tunnel Connection Failed

So im trying to get basically the same functionality as the "AutoResponder" inside the Fiddler app.

also i need this to work offline.

the website im trying to autorespond for it HTTP(S) i put in code to ask the user to Trust the Root Certificate which i have included below incase its somehow relevant.

            if (Fiddler.CertMaker.rootCertExists())
        {
            if (!Fiddler.CertMaker.rootCertIsTrusted())
            {
                MessageBox.Show(this, "You need to approve the Fiddler Root CA.", "First Time?");
                Fiddler.CertMaker.trustRootCert();
            }

        }
        else
        {
            Fiddler.CertMaker.createRootCert();
            if (!Fiddler.CertMaker.rootCertIsTrusted())
            {
                MessageBox.Show(this, "You need to approve the Fiddler Root CA.", "First Time?");
                Fiddler.CertMaker.trustRootCert();

            }
        }

        if (!Fiddler.CertMaker.rootCertIsTrusted())
        {
            MessageBox.Show(this, "Fiddler Root CA not Trusted.", "Error");
            this.Close();
        }

As for the autoresponder (and what im pretty sure is causing the problem)

 FiddlerApplication.Startup(8080, true, true, true);



        FiddlerApplication.BeforeRequest += delegate (Session session)
        {
            if (session.HTTPMethodIs("CONNECT")) { session.oFlags["X-ReplyWithTunnel"] = "Fake for HTTPS Tunnel"; return; }
            if (session.uriContains("https://google.com"))
            {
                session.bBufferResponse = true;
            }
        };

        FiddlerApplication.BeforeResponse += delegate (Session session)
        {
            session.utilDecodeResponse();
            session.LoadResponseFromFile("Google.txt");
        };

However after running this code i cannot access any HTTPS websites and receive the error "ERR_TUNNEL_CONNECTION_FAILED" even on the website im trying to AutoRespond to.




How to check the StatusCode in json object to get a string of httpResponse rest API

I can't check StatusCode when REST API and parse JObject

code

string jsonResponse = HttpRequest(HostAPI, "POST", paramModel);
JObject jsonObject = JObject.Parse(jsonResponse);
if (jsonObject["data"] != null && jsonObject["StatusCode"]==200)  ????

jsonResponse

{"data":[{"OBJID":1012540462,"SUPID":1041252952,"STATUSPTC":1.0,"DATEACTIVESUP":0.0}],"StatusCode":200}

Please help me if you know ???




dimanche 24 décembre 2017

How to find Email in Jsoup scraping

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods. I am not able to find out Email

  try {
    pageDocument = Jsoup.connect(url).get();
    } catch (IOException e) {
    e.printStackTrace();
   }




Laravel Chat System RESTful API

I spend last days searching on how to develop a chat system API to be use later in Mobiles , I searched a lot and there no clear tutorial that give me the required answer , since I am new on laravel and I can't figure out all the aspects in the laravel and web development , can someone please help me and give me the instruction how to start and what notification system do i need to use Pusher or Firebase Clouding Messaging....




Can not remove base category slug from url on WordPress site

I would be very grateful if you tell me when is my mistake. This is my .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteRule ^category/shopcategory1/(.*)$ http://ift.tt/2BJLOXD [L,R=301]
RewriteRule ^shopcategory1/$ /category/shopcategory1/ [L]
</IfModule>
# END WordPress

But all the same there is no redirection.




Extracting a table from html file uploaded via FileReader using jquery

I am receiving a file uploaded using FileReader() (e.target.result) from which I need to extract the table. From a normal html file this is easily done with $("table tbody") . Is it possible to apply this on e.target.result without appending it to my document?

I am also open to other methods other than FileReader, but if possible I'd like to use this.




Messenger in the website

I have a website and a messenger block, imported in each page.

The problem is, when several tabs of website are opened in the browser, notifications are received only once in some page, others doesn't show an information about new message.

In Facebook the messenger seems to work independently. How to get the same functionality?




Click on every instance of a certain word in a page using Javascript

Im trying to program something using JQuery that will search a webpage for every instance of a certain word and then click on it. How would I do this?

I currently have something like this:

$(document).ready(function(){
    function follow(texttofind, setinterval){
        var buttons = $( "*:contains('"texttofind"')" );
        var i = 0;
        interval = setInterval(function(){
            for(i <= buttons.length; i++){
                $(buttons[i]).scrollIntoView();
                buttons[i].click();
            }
        },setinterval);
    }
});




Webpage with grid vidoes

I'm trying to create a webpage for demonstration in an event, it should have a grid that has a video in each square, I should upload local videos to this page, the user can click a video and it will play in the same page. I tried looking through materialize framework grid but I don't think it's enough. What do you recommend?




Click on every instance of a word on a page with Javascript

Im trying to program something using JQuery that will search a webpage for every instance of a certain word and then click on it. Is there any way to do this?




Multiple users posting to one database endpoint?

I'm new to web development and was curious about something. When posting to an endpoint to then receive a value from a server-side function, is it problematic if multiple users are writing to the same endpoint? Can this corrupt the value returned?

For instance, I'm using Stripe in a project and you're supposed to post to an endpoint to generate a user-specific ephemeral key. There's a 1-2 second delay in the response at times, so would there be a problem if two users posted to the same endpoint within a few milliseconds?




What is the difference between Web Designer and Front End Developer? [on hold]

I need to know what is the difference between web designer and front end developer .. What is unique in each ??? Which makes the web designer better than front end developer Or vice versa ?




How to get user location and sent back to server on webpages?

I want to get users location via the Google location api and send back to my server (so that I can know where the user is).

But I don't know how to make the users browser sent a POST request to Google and send the answer to my server, on AJAX/JavaScript

(The reason I must request Google Location API : I want to get the exact location of the user by only ip , but most of ip2location database just accurate to the city. And the Google Location API can accurate to 3km range)

If possible, please give me an example code with explanation Thanks for you helping!




Trouble with setting webpack

How to tune webpack so that pug file dont compile into HTML and parse src img? if i use:

{
    loader: 'html-loader'
},
{
    loader: 'pug-html-loader',
    options: {
        pretty: true,
        exports: false
    }
} 

this work but output HTML




Click all buttons containing certain text on page with JQuery

I'm making a chrome extension, and basically id like to be able to pass it a certain word - like "Dog" and then it will click on every instance of "Dog" on the page. It should have a small time limit between each click. How would I do this? Whenever I've attempted this before I haven't been able to get it to work.




Embed simple interactive data visualisation in website (Bokeh? Other platforms?)

I've built quite a few data visualisation tools using Python before, relying on the desktop-based GUI tools for user interaction (e.g. Qt), but am now trying to make something more widely accessible in the form of a website.

I'm afraid I have limited web development experience however, and wonder if anyone could recommend platforms / techniques to consider for this project please?

My target is a simple website with a drop-down menu. When the user makes a selection from the drop-down, the relevant data is loaded from a .txt file on the web server and plotted within the website. Having access to tools to zoom and a cursor to indicate the data at mouse position are valuable.

In the future I'd like to extend this to add more complicated features (e.g. user input box, with plotting code executed depending on the input), but for now, achieving the simple case above would be great.

I've found positive comments about Bokeh online, which looks good and seems to support Python code. However, while the examples show me how to plot a single case, I can't work out how to make a drop-down menu in a website that dynamically updates the plotted data.

I aim for the code to be fast, and potentially accesses by numerous web users. If other better options than Bokeh are available, I'm very open to any suggestions or thoughts.

Many thanks




Keep getting the same error code (bad request) when trying to retrieve a page using sockets

I was trying to get a web page using Socket and get request but I keep getting the same error - bad request, for any website or webpage i try to use it.

    Socket s = new Socket("horstmann.com", 80);

    InputStream in = s.getInputStream();
    OutputStream out = s.getOutputStream();

    Scanner reader = new Scanner(in);
    PrintWriter writer = new PrintWriter(out, false);

    String command = "GET / HTTP/1.0\n\n";
    //System.out.print(command);
    writer.print(command);
    writer.flush();

    while (reader.hasNextLine()) {
        System.out.println(reader.nextLine());
    }
    s.close();




samedi 23 décembre 2017

Spotify node web api - trouble with multiple users

I am working on an app that uses Spotify Node web API and having trouble when multiple users login into my application. I am successfully able to go through authentication flow and get the tokens and user ID after a user logs in. I am using the Authorization Code to authorize user (since I would like to get refresh tokens after expiration). However, the current problem is that getUserPlaylists function described here (FYI, if the first argument is undefined, it will return the playlists of the authenticated user) returns playlists of the most recently authenticated user instead of the user currently using the app.

Example 1: if user A logins in to the application, it will get its playlists fine. If user B logins in to the application, it also sees its own playlists. BUT, if user A refreshes the page, user A sees the playlists of the user B (instead of its own, user A playlists).

Example 2: user A logs in, user B can see user A's playlists just by going to the app/myplaylists route.

My guess is, the problem is with this section of the code

    spotifyApi.setAccessToken(access_token);
    spotifyApi.setRefreshToken(refresh_token);

The latest user tokens override whatever user was before it and hence the previous user is losing grants to do actions such as viewing its own playlists.

  • Expected behavior: user A sees own playlists after user B logs in after refreshing the page.
  • Actual behavior: user A sees user B's playlists after user B logged in and user A refreshes the page.

I am aware that I could use the tokens without using the Spotify Node API and just use the tokens to make request and it should probably be fine, however, it would be great to still be able to use the node API and still be able to handle multiple users.

Here is the portion of code that most likely has problems:

export const createAuthorizeURL = (
     scopes = SCOPE_LIST,
    state = 'spotify-auth'
) => {
    const authUrl = spotifyApi.createAuthorizeURL(scopes, state);

    return {
        authUrl,
        ...arguments
    };
};

export async function authorizationCodeGrant(code) {
    let params = {
    clientAppURL: `${APP_CLIENT_URL || DEV_HOST}/app`
};

    try {
        const payload = await spotifyApi.authorizationCodeGrant(code);
        const { body: { expires_in, access_token, refresh_token } } = payload;

        spotifyApi.setAccessToken(access_token);
        spotifyApi.setRefreshToken(refresh_token);

        params['accessToken'] = access_token;
        params['refreshToken'] = refresh_token;

        return params;
    } catch (error) {
        return error;
    }

    return params;
}

export async function getMyPlaylists(options = {}) {
    try {
        // if undefined, should return currently authenticated user
        return await spotifyApi.getUserPlaylists(undefined, options);
    } catch (error) {
         return error;
    }
}

Would appreciate any help on this. I am really excited about what I am making so it would mean a LOT if someone could help me find the issue...




Javascript add class to classList don't add. Used in Django web development framework

We have a form in which we want all input areas with faulty submitted data to gain red borders. This is done by setting the class of the input tag to "form-control-danger" in addition to the original class "form-control". The HTML/JS/Django code looks like this, and it is mostly correct. I have controlled that the scripts tags are only generated and run when faulty data is submitted.

<!-- Output all fields -->
 

As we feed the form faulty data this gives us this source code.

<div class="input-group form-group-no-border">
    <span class="input-group-addon">
        <i class="now-ui-icons



             ui-1_lock-circle-open
        "></i>
    </span>
    <input type="password" name="password2" value="iuhqeifuhweifuhweifuwefw" id="id_password2" required placeholder="Password again..." class="form-control" />

    <!-- Give input box red border if data is not valid -->

        <script>
            alert("Before");
            var element = document.getElementById("id_password2");
            element.classList.add("form-control-danger");
            alert("Done");
        </script>

</div>

Observe that the class of the input tag with id of "id_password2" is unchanged, despite the javascript seeming correct, my javascript skills could however be considered questionable. All help is appreciated.

Merry Christmas




How to fix webbrowser control MessageBox pop up

I was making a simple winform to log in to a website but when I do that a MessageBox appears. IDK what is the problem is there any way to fix that or just click on the ok button before it popups or something like that. Thank you. This is the error.




How do I incorperate a line break in a web app? (HTML,CSS)

So I have been researching this for the past 10 or so minutes and am now bringing it to this community. I don't know how to make a break like this: A line break with "or" in the center.

I know there used to be an "hr" tag like so,


but its depreciated and I'd prefer to use something else. Its a common thing for login pages where its Email login "or" login with a social account. If you have any tips or find anything, please link it down below!

Thanks in advance!!




Firebase Authentication - The password is invalid or the user does not have a password

I'm having trouble with this error while trying to log in. The password is invalid or the user does not have a password
STORY: I created a new account in my own android application, with the email and password: test1@gmail.com 123456. After creating my own website, I tried logging in with the same email and password and then gives me the error(on the image above).

So what I did, I deleted the account in Firebase, and created a new account in my website with auth.createUserWithEmailAndPassword('test1@gmail.com','123456'). I logged in successfully in my website but I failed logging in in my android application.

The next thing I did is that I sent reset password email, I reset it. I logged in successfully in my android app but I failed logging in in my website (with the error again in the picture).

Why is that? (sorry, english is not my main language)




How to center three images with captions and descriptions? HTML

I am new to HTML and am trying to create a web page with three centered images (displayed side by side). Here is the code I have:

<center>
<figure style="display:inline-block;text-align:center;top:350px">
    <div style="width:275px; font-size:80%;margin:20px;text-align:center;display:inline-block">
    <img src="images/website-main1.jpg" style="margin-bottom:10px" width="275px" height="175px" />
    <figcaption style="text-align:center">This is an example of a super long caption that will make the images offset</figcaption>
    <div style="text-align:left">
    <p>description example</p>
    </div>
    </div>
    <div style="width:275px; font-size:80%;margin:20px;text-align:center;display:inline-block">
    <img src="images/website-main6_1.jpg" style="margin-bottom:10px" width="275px" height="175px" />
    <figcaption style="text-align:center">First image</figcaption>
    <div style="text-align:left">
    <p>description</p>
    </div>
    </div>
    <div style="width:275px; font-size:80%;margin:20px;text-align:center;display:inline-block;">
    <img src="images/a1_orig.jpg" style="margin-bottom:10px" width="275px" height="175px" />
    <figcaption style="text-align:center">First image</figcaption>
    <p>description</p>
    </div>
</figure>
</center>

This code creates the images and centers them, but if the captions or descriptions are not exactly the same, the images will offset (EX: If the caption on the leftmost image is very wordy, then that image will appear higher than the other two). Is there anyway to fix this?




proptypes error when using material-ui

i just started a reactJS project and when i decided to use material-ui it statrted throwing a lot of errors:

bundle.js:12441 Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the prop-types package. Use PropTypes.checkPropTypes() to call them. Read more at http://ift.tt/2pPxRx8 Check the render method of CardHeader.

my App component looks like this:

import React from 'react';
import PropTypes from 'prop-types';
import NavBar from './common/NavBar';
import Logo from './common/Logo';
import MuiThemeProvider from 'material-ui/styles/MuithemeProvider';

class App extends React.Component {
  render() {
    return (
      <MuiThemeProvider>
        <div className="container-fluid">
          <Logo />
          <NavBar />
          {this.props.children}
        </div>
      </MuiThemeProvider>
    );
  }
}

App.PropTypes = {
  children: PropTypes.object.isRequired
};

export default App;

material-ui version: 0.20.0 react version: 15.0.2




how do I get rid of space between nav bar and background image?

Background pic

How do I get rid of the gap between the nav bar and the background image. On top is the link to the screen shot of the gap.

Here is my css code

#header{
background-image: url("sizepic.jpg")
width: 100%;
height: 100%;
  background-repeat: no-repeat;
background-size: cover;
}

Thank you in advance for your help.




Create Selectable li items as buttons

I have a user interface with buttons made of list items. I want to be able to have them be individually selectable, where they will control the color of another div. Right now I have them laid out and they have a css transition where they grow in scale when hovered over but I want then to stay fully scaled when selected. How would I do this?

I tried using the focus pseudo-class but that only works on input elements. I also tried active pseudo class but I think I am missing something with using those.

Lastly, what would I do if I want them to change the background color of another div to the color of the button?

I haven't built the elements that will be effected yet, I was just going to use some divs shaped like squares with a background color to test, but I am stuck at this point with giving the list items active states. There is probably some JS aspect to this that I am missing.

Here is my code: HTML:

<div id="colorSelection">
  <div class="base_color selector">
    <p class="sectionHeader">Base Color</p>
    <ul class="swatchSelector">
      <hr class="crossbar" width="90%">
      <li class="swatch one"></li>
      <li class="swatch two"></li>
      <li class="swatch three"></li>
      <li class="swatch four"></li>
      <li class="swatch five"></li>
      <li class="swatch six"></li>
      <li class="swatch seven"></li>
      <li class="swatch eight"></li>
    </ul>
  </div>
</div>

CSS:

/*reset*/
html, body, ul, li, p, a, img, hr{
  margin: 0px;
  padding: 0px;
  border: 0px;
  list-style-type: none;
  text-decoration: none;
}
#colorSelection {
    width: 320px;
    height: 720px;
    background-color:#d4d4d4;
    display: inline-block;
}
.selector{
    margin-bottom: 20px;
    padding: 10px;
    margin-left: 4px;
}
.sectionHeader {
    font-family: helvetica,arial,sans-serif;
    font-size: 20px;
    color:black;
    margin-bottom: 7px;
}
.swatch {
    width: 17px;
    height: 17px;
    border: 2px solid;
    border-radius: 50%;
    display: inline-block;
    margin-left: 12px;
    text-align: center;
    position: relative;
    transition: transform:2s ease-in-out;
    box-shadow: 0px 1px 5px rgba(0,0,0,0.5);
    cursor: pointer;
}
.swatch:hover{
    transform: scale(1.3);
}

.crossbar{
    border:1px white solid; 
    position: relative;
    right: 0px;
    top: 12px;
    box-shadow: 0px 1px 5px rgba(0,0,0,0.25);  
}

.one{
    margin-left: 0px;
    background-color:#ffdc01;
    border-color:white;
    transition: border .01s;
}
.one:hover, .one:active {
    border-color:#ffdc01;
}
.two{
    background-color:#f27245;
    border-color:white;
    transition: border .01s;
}
.two:hover, .two:active {
    border-color:#f27245;
}
.three {
    background-color:#db3844;
    border-color:white;
    transition: border .01s;
}
.three:hover, .three:active {
    border-color:#db3844;
}
.four {
    background-color:#754c90;
    border-color:white;
    transition: border .01s;
}
.four:hover, .four:active {
    border-color:#754c90;
}
.five{
    background-color:#005c9f;
    border-color:white;
    transition: border .01s;
}
.five:hover, .five:active {
    border-color:#005c9f;
}
.six{
    background-color:#343333;
    border-color:white;
    transition: border .01s;
}
.six:hover, .six:active {
    border-color:#343333;
}
.seven {
    background-color:#6a6c70;
    border-color:white;
    transition: border .01s;
}
.seven:hover, .seven:active {
    border-color:#6a6c70;
}
.eight {
    background-color:#e9eae8;
    border-color:white;
    transition: border .01s;
}

.eight:hover, .eight:active {
    border-color:#e9eae8;
}

http://ift.tt/2BHTV7e