Search Results

Search found 6580 results on 264 pages for 'require'.

Page 14/264 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • PHP: get contents of a remote webpage that require authentication?

    - by powerboy
    I receive many emails whose contents are of the same pattern, e.g. Name: XXX Phone: XXX Bio: XXX ...... I want to write a PHP script to parse these emails and save the data into a database. I tried to use file_get_contents() to get the contents of these emails. The problem is that, it requires authentication to access to my emails. Even though I have signed into my email account on the server (localhost actually), file_get_contents() still return the webpage that prompts me to sign in. So how to access the contents of my emails with a PHP script? EDIT: it is a gmail account.

    Read the article

  • When and why does an EventHandler require objects to be final?

    - by Michiel Borkent
    I have the following code from a GWT Project that is part of the onModuleLoad() method (similar to Java's main method, if you don't know GWT): final TextBox t1 = new TextBox(); final Label lt1 = new Label(); t1.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { // TODO Auto-generated method stub if (!(t1.getText().matches("\\w{2}-\\w{2}-\\w{2}"))) lt1.setText("Invalid."); else lt1.setText("OK."); } }); Why do the two local variables have to be final here?

    Read the article

  • Does C++ require a destructor call for each placement new?

    - by Josh Haberman
    I understand that placement new calls are usually matched with explicit calls to the destructor. My question is: if I have no need for a destructor (no code to put there, and no member variables that have destructors) can I safely skip the explicit destructor call? Here is my use case: I want to write C++ bindings for a C API. In the C API many objects are accessible only by pointer. Instead of creating a wrapper object that contains a single pointer (which is wasteful and semantically confusing). I want to use placement new to construct an object at the address of the C object. The C++ object will do nothing in its constructor or destructor, and its methods will do nothing but delegate to the C methods. The C++ object will contain no virtual methods. I have two parts to this question. Is there any reason why this idea will not work in practice on any production compiler? Does this technically violate the C++ language spec?

    Read the article

  • Dynamic SQL Rows & Columns...cells require subsequent query. Best approach?

    - by Pyrrhonist
    I have the following tables below City --------- CityID StateID Name Description Reports --------- ReportID HeaderID FooterID Description I’m trying to generate a grid for use in a .Net control (Gridview, Listview…separate issue about which will be the ‘best’ one to use for my purposes) which will assign the reports as the columns and the cities as the rows. Which cities get displayed is based on the state selected, and is easy enough SELECT * FROM CITIES WHERE STATEID=@StateID However, the user is able to select which reports are being generated for each City (Demographics, Sales, Land Area, etc.). Further, the resultant cells (City * Report) is a sub-query on different tables based on the city selected and the report. Ie. Column Sales selected yields SELECT * FROM SALES WHERE CITYID=@CityID I’ve programmed a VERY inelegant solution using multiple queries and brute-forcing the grid to be created (line by line, row by row creation of data elements), but I’m positive there’s got to be a better way of accomplishing this…? Any / all suggestions appreciated here as the brute force approach I’ve gotten is slow and cumbersome…and this will have to be used often by the client, so I’m not sure it’ll be acceptable in it’s current implementation.

    Read the article

  • Will Emacs --batch run in cron will hang when require user input?

    - by J Spen
    I have a job in crontab that requires emacs --batch but if the file is currently open it requests (s, p, q) to (steal, quit, etc...) which is fine if this file is being edited to not run the script but I want to make sure it kills the cron running script so it's not sitting in the background taking up memory. I have the output set to go to a log file so I can see this happening but no way to tell whether the script was terminated even though asked for user input. Does cron terminate these scripts and how to check the PID to make sure?

    Read the article

  • What is the standard way of using a sitemap with pages that require specific information passed to t

    - by Mike
    Hi, I have a website for which many pages rely on information passed to them (usually in the form of a querystring) or on a session variable. When making a web application, how do you normally handle these particular pages in regards to the sitemap? If you're using the standard ASP.NET menu control, it will render the node on the menu and if you click it, you could get an exception stating that a session variable doesn't exist (if it hasn't been created yet). For example, if you're making a user management area: All of these nodes get rendered, but I don't want the user to click on edit user or delete user without specifying someone to edit or delete. Any tips or suggestions would be greatly appreciated.

    Read the article

  • Why do C# and Java require everything to be in a class?

    - by Javier Badia
    It seemed like this question should have been asked before, but searching found nothing. I've always wondered what's the point of making us put every bit of code inside a class or interface. I seem to remember that there were some advantages to requiring a main() function like C, but nothing for classes. Languages like Python are, in a way, even more object oriented than Java since they don't have primitives, but you can put code wherever you want. Is this some sort of "misinterpretation" of OOP? After all, you can write procedural code like you would in C and put it inside a class, but it won't be object oriented.

    Read the article

  • Does binding temporary to a reference require a copy constructor in C++?

    - by vitaut
    Consider the following code: class A { A(const A&); public: A() {} }; int main() { const A &a = A(); } This code compiles fine with GCC, but fails to compile with Visual C++ with the following error: test.cc(8) : error C2248: 'A::A' : cannot access private member declared in class 'A' test.cc(2) : see declaration of 'A::A' test.cc(1) : see declaration of 'A' So is it necessary to have a copy constructor accessible when binding a temporary to a reference?

    Read the article

  • Does Silverlight require the .NET framework to be installed?

    - by Mohit Deshpande
    I have been exploring the possibilities of Microsoft Silverlight and how it runs in web browsers. I just wonder if Silverlight requires the .NET framework? Meaning that Mac or Linux users cannot run Silverlight. I will be making the application using the .NET framework 3.5. Will this application run in any web browser, or just major ones like Internet Explorer, Firefox, or Safari?

    Read the article

  • Does jquery require timestamp on GET Calls in IE7?

    - by Mithun P
    Please see the jQuery code below, it used to paginate some search results paginate: function() { $("#wishlistPage .results").html("<div id='snakeSpinner'><img src='"+BASE_URL+"images/snake.gif' title='Loading' alt='...'/></div>"); var url = BASE_URL+"wishlist/wishlist_paginated/"; $.ajax({ type: "GET", url: url, data: { sort_by:$('#componentSortOrder input:hidden').val(), offset:My.WishList.offset, per_page: 10, timestamp: new Date().getTime() }, success: function(transport){ $("#wishlistPage .results").html(transport); } }); }, My issue is not with the pagination, issue is when i need to call this same function when something happed to other part of the page which remove some search results, it brings the old results in IE7, other browsers works fine. So added the timestamp: new Date().getTime() part. That fixed the IE issue. I want o know why this happens in jQuery? Do I need to include a timestamp parameter to URL to avoid caching in all jQuery Ajax calls?

    Read the article

  • How to require a checkbox to be checked at client side before form gets submitted to server in MVC 3?

    - by Projapati
    I have a Terms and Condition checkbox on my signup page. I want to make it required like my few other fields on the form before posting to server. This validation must be done at client side. Anyone knows how to do it properly? I am using MVC 3, jquery.validate.min.js and jquery.validate.unobtrusive.min.js Model: [Required(ErrorMessage = "terms and condition")] [Display(Name = "terms")] public bool Terms { get; set; } View: @Html.CheckBoxFor(m => m.Terms, new { @class = "cb" }) Terms & Condition <button type="submit" id="btnSubmit" class="btn">Signup</button> Also, Is it possible to call/trap some JS function when the submit button is clicked? That way I can easily use jquery to do validation and then submit? Thanks for reading

    Read the article

  • Why Does try ... catch Blocks Require Braces?

    - by Bidou
    Hello. While in other statements like if ... else you can avoid braces if there is only one instruction in a block, you cannot do that with try ... catch blocks: the compiler doesn't buy it. For instance: try do_something_risky(); catch (...) std::cerr << "Blast!" << std::endl; With the code above, g++ simply says it expects a '{' before do_something_risky(). Why this difference of behavior between try ... catch and, say, if ... else ? Thanks!

    Read the article

  • require user to login in at login screen before giving access to iPhone app that accesses secure web

    - by MikeN
    On iPhone, how do I show a login screen to get username and password before giving access to iPhone app? Also, does the iPhone store a cookie to the secure website like a web browser? I was thinking of giving users to my website a long API key to store in the settings of their iPhone instead of asking them to login with a username/password (seems to be the Slicehost iPhone app approach.) Which is the best way to get a user to login securely? I have full control over the design of the iPhone app and website so have a lot of flexibility.

    Read the article

  • How do I require a login for a user in Django?

    - by Di Zou
    In my urls.py I have this: (r'^myapp/$', 'myapp.views.views.index'), (r'^myapp/login/$', 'myapp.views.views.login_user'), In my settings.py I have this: LOGIN_URL = '/myapp/login' In my views.py I have this: @login_required((login_url='/myapp/login/') def index(request): return render_to_response('index.html') def login_user(request): #login stuff return render(request, 'registration/login.html', {'state':state, 'username': username}) I can go to mysite.com/myapp/login and the login page works. However, when I go to mysite.com/myapp/index I do not get redirected to the login page even though I am logged out. Why is that and how do I fix it?

    Read the article

  • Why Do try ... catch Blocks Require Braces?

    - by Bidou
    Hello. While in other statements like if ... else you can avoid braces if there is only one instruction in a block, you cannot do that with try ... catch blocks: the compiler doesn't buy it. For instance: try do_something_risky(); catch (...) std::cerr << "Blast!" << std::endl; With the code above, g++ simply says it expects a '{' before do_something_risky(). Why this difference of behavior between try ... catch and, say, if ... else ? Thanks!

    Read the article

  • Requisite of file.append

    - by Jeff Strunk
    Is it possible to make salt require that a particular file was appended to as opposed to the file merely existing? It seems like I can only require a file state. The source looks like it strips out any method names from a require attribute. In the example below, I only want the foo service to run if my lines have been appended to /etc/security/limits.conf. file.append: - name: /etc/security/limits.conf - text: - root hard nofile 65535 - root soft nofile 65535 foo: service.running: - enable: True - require: - file.append: /etc/security/limits.conf

    Read the article

  • Where am I going wrong? "undefined method 'application' for Sinatra:Module" Sinatra/Passenger/Apache

    - by safetycopy
    Hi, I'm trying to get my first Sinatra app off the ground, but am getting an error page from Passenger: undefined method `application' for Sinatra:Module Here's my Rackup file: require 'rubygems' require 'sinatra' set :env, :production disable :run require 'app' run Sinatra.application And the app itself: #!/usr/bin/env ruby require 'rubygems' require 'sinatra' require 'haml' get '/' do haml :index end get '/hello/:name' do |name| @name = name haml :hello end get '/goodbye/:name' do |name| haml :goodbye, :locals => {:name => name} end __END__ @@layout %html %head %title hello.dev %body =yield @@index #header %h1 hello.dev #content %p This is a test... @@hello %h1= "Hello #{@name}!" @@goodbye %h1= "Goodbye #{name}!" Where am I going wrong?

    Read the article

  • How to navigate to another html page?

    - by newbie
    In my application there's a usual login page sending username and password to the server script, where it needs to be authenticated, and in case of an authentic user, the server should redirect to a page student.html. This is my code var ports = 3000; var portt = 3001; var express = require('express'); var student = require('express')(); var teacher = require('express')(); var server_s = require('http').createServer(student); var server_t = require('http').createServer(teacher); var ios = require('socket.io').listen(server_s); var iot = require('socket.io').listen(server_t); var path = require('path'); server_s.listen(ports); server_t.listen(portt); student.use(express.static(path.join(__dirname, 'public'))); student.get('/', function(req,res){ res.sendfile(__dirname + '/login.html'); }); teacher.use(express.static(path.join(__dirname, 'public'))); teacher.get('/', function(req,res){ res.sendfile(__dirname + '/mytry.html'); }); ios.sockets.on('connection', function(socket){ var username, password; socket.on('check',function(data){ username = data[0]; password = data[1]; //************* Database connection and query ************* var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', user : 'user', password: '*******', database: 'my_db' }); connection.connect(); var qstring = 'SELECT s_id FROM login_student WHERE username='+username+'AND password='+password; connection.query(qstring, function(err, rows, fields) { if (err) { console.log('ERROR: ' + err); socket.emit('login_failure','DB error'); return; } console.log('The solution is: ', rows[0].solution); if (rows>0) //***** Here i want redirection to another page ****** else socket.emit('login_failure','Invalid Username or password'); }); connection.end(); }); }); iot.sockets.on('connection', function(socket){ ; }); }); Can anyone suggest what should I do?

    Read the article

  • Javascript 'class' and singleton problems

    - by Kucebe
    I have a singleton object that use another object (not singleton), to require some info to server: var singleton = (function(){ /*_private properties*/ var myRequestManager = new RequestManager(params, //callbacks function(){ previewRender(response); }, function(){ previewError(); } ); /*_public methods*/ return{ /*make a request*/ previewRequest: function(request){ myRequestManager.require(request); //err:myRequestManager.require is not a func }, previewRender: function(response){ //do something }, previewError: function(){ //manage error } }; }()); This is the 'class' that make the request to the server function RequestManager(params, success, error){ //create an ajax manager this.param = params; this._success = success; //callbacks this._error = error; } RequestManager.prototype = { require: function(text){ //make an ajax request }, otherFunc: function(){ //do other things } } The problem is that i can't call myRequestManager.require from inside singleton object. Firebug consolle says: "myRequestManager.require is not a function", but i don't understand where the problem is. Is there a better solution for implement this situation?

    Read the article

  • I'd like to rebuild my web server without web management software; what knowledge, skills, and tools will I require? [closed]

    - by Joe Zeng
    I've been using Webmin for my web server that runs my personal website and a host of other websites for a while now, and I feel like I should be able to manage my web server more directly, because I haven't even touched the Webmin for the past year or so and I feel like maybe it has too much functionality that I have to click through the next time I want to access it or create a new subdomain or database on my site. I want to try something lighter and more wholly manageable, now that I'm more comfortable with using ssh and command-line tools. I've decided that I'm going to try using Django as a framework, but obviously that's only part of the picture. What sort of knowledge will I require?

    Read the article

  • Windows can see Ubuntu Server printer, but can't print to it

    - by Mike
    I have an old desktop that I'm trying to set up as a home backup/print server. Backup was trivial, but am having issues getting the printing to work. The printer is connected to the server running Ubuntu Server 9.10 (no gui). If I access the printer via http://hostname:631/printers/, I am able to print a test page, so I know the printer is working; however, I am having no luck from Windows. Windows can see the printer when browsed via \hostname\, but I am unable to connect. Windows says "Windows cannot connect to the printer" without indicating why. Any suggestions? From /etc/samba/smb.conf: [global] workgroup = WORKGROUP dns proxy = no security = user username map = /etc/samba/smbusers encrypt passwords = true passdb backend = tdbsam obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes map to guest = bad user load printers = yes printing = cups printcap name = cups [printers] comment = All Printers browseable = no path = /var/spool/samba writable = no printable = yes guest ok = yes read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers browseable = yes read only = yes guest ok = yes From /etc/cups/cupsd.conf: LogLevel warn SystemGroup lpadmin Port 631 Listen /var/run/cups/cups.sock Browsing On BrowseOrder allow,deny BrowseAllow all BrowseRemoteProtocols CUPS BrowseAddress @LOCAL BrowseLocalProtocols CUPS dnssd DefaultAuthType Basic <Location /> Order allow,deny Allow all </Location> <Location /admin> Order allow,deny Allow all </Location> <Location /admin/conf> AuthType Default Require user @SYSTEM Order allow,deny Allow all </Location> <Policy default> <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document> Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit CUPS-Authenticate-Job> Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit All> Order deny,allow </Limit> </Policy> <Policy authenticated> <Limit Create-Job Print-Job Print-URI> AuthType Default Order deny,allow </Limit> <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document> AuthType Default Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs> AuthType Default Require user @SYSTEM Order deny,allow </Limit> <Limit Cancel-Job CUPS-Authenticate-Job> AuthType Default Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit All> Order deny,allow </Limit> </Policy>

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >