Daily Archives

Articles indexed Thursday July 5 2012

Page 7/17 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Security & Authentication: SSL vs SASL

    - by 4herpsand7derpsago
    My understanding is that SSL combines an encryption algorithm (like AES, DES, etc.) with akey exchange method (like Diffier-Hellman) to provide secure encryption and identification services between two endpoints on an un-secure network (like the Internet). My understanding is that SASL is an MD5/Kerberos protocol that pretty much does the same thing. So my question: what are the pros/cons to choosing both and what scenarios make both more preferable? Basically, I'm looking for a guidelines to follow when choosing SSL or to go with SASL instead. Thanks in advance!

    Read the article

  • Hotmail SMTP not working with javamail

    - by yashdosi
    I am trying to write a simple Java program to send emails from my hotmail account using JavaMail API. Here is my code : import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class HotMailSend { public static void main(String args[]) { final String username = HOTMAIL.username; final String password = HOTMAIL.password; Properties props = new Properties(); props.setProperty("mail.smtp.auth", "true"); props.setProperty("mail.smtp.starttls.enable", "true"); props.setProperty("mail.smtp.host", "smtp.live.com"); props.setProperty("mail.smtp.port", "587"); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } }); try { Message message = new MimeMessage(session); message.setFrom(new InternetAddress(HOTMAIL.username)); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(GMAIL.username)); message.setSubject("Testing Subject"); message.setText("Hey Buddy..!!!," + "\n\n No spam to my email, please!"); Transport.send(message); System.out.println("Done"); } catch (MessagingException e) { throw new RuntimeException(e); } } } And here is the error I am getting : Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Can't send command to SMTP host; nested exception is: java.net.SocketException: Connection closed by remote host at HotMailSend.main(HotMailSend.java:45) Caused by: javax.mail.MessagingException: Can't send command to SMTP host; nested exception is: java.net.SocketException: Connection closed by remote host at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2163) at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2150) at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:1220) at javax.mail.Transport.send0(Transport.java:197) at javax.mail.Transport.send(Transport.java:124) at HotMailSend.main(HotMailSend.java:40) Caused by: java.net.SocketException: Connection closed by remote host at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1307) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:43) at com.sun.mail.util.TraceOutputStream.write(TraceOutputStream.java:114) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2161) ... 5 more

    Read the article

  • Error when trying to use PDO object

    - by Nate
    EDIT: I'm going to put my code in here due to comments below. So sit tight for a few minutes ;-) Thanks! I'm an inexperienced php programmer and only found out about PDO a few days ago. I'm now trying to port my website code over to using PDO, but I am getting an error when I try to use the PDO object that I create. I'm using a CMS on my website, and it makes building page output kind of complicated, but I've tried to draw the structure of what is being called below: index.php -class myClass defined --method myFunction defined (it gets called on pageload & returns the page output) ---include file1.php ----require_once('mysql_connect.php') (creates pdo object) ----*I can use the pdo object here successfully* ----require_once('file2.php') -----require_once('mysql_connect.php') -----function myFunction2 defined ------*trying to use the pdo object here results in the error* The error I'm getting is: Fatal error: Call to a member function prepare() on a non-object in /home/rgcpanel/public_html/account/account_functions.php on line 147 Any idea what's going on?

    Read the article

  • Nesting arbitrary objects in Java

    - by user1502381
    I am having trouble solving a particular problem in Java (which I did not find by search). I do not know how to create a nested lists of objects - with a different type of object/primitive type at the end. For example: *Note: only an example. I am actually doing this below with something other than Employee, but it serves as simple example. I have an array of an object Employee. It contains information on the Employee. public class Employee { int age int salary int yearsWorking public Employee () { // constructor... } // Accessors } What I need to do is organize the Employees by quantiles/percentiles. I have done so by the following: import org.apache.commons.math.stat.descriptive.rank.Percentile; public class EmployeeSort { public void main(String args[]) { Percentile p = new Percentile(); Employee[] employeeArray = new Employee(100); // filled employeeArray double[] ageArray new double[100]; // filled ageArray with ages from employeeArray int q = 25; // Percentile cutoff for (int i = 1; i*q < 100; i++) { // assign percentile cutoff to some array to contain the values } } } Now, the problem I have is that I need to organize the Employees first by the percentiles of age, then percentiles of yearsWorking, and finally by percentiles of salary. My Java knowledge is inadequate right now to solve this problem, but the project I was handed was in Java. I am primarily a python guy, so this problem would have been a lot easier in that language. No such luck.

    Read the article

  • JSF h:outputStylesheet doesn't work everywhere

    - by s3rius
    I'm currently learning Icefaces, now I'm trying to integrate a css file via h:OutputStylesheet into my code. I have a main page and a second page. Using outputStylesheet in my main page works well (and then I can also access the css in the second page, which I guess is intended). But when I try to integrate it in my second page it doesn't work at all. The code for both pages is basically identical. main page: <h:head></h:head> <h:body> <!-- this line works --> <h:outputStylesheet library="css" name="style.css" /> <!-- this line is only shown in red if the outputStylesheet from above is there --> <div class="red">This is red color in main page</div> </h:body> second page: <h:head></h:head> <h:body> <!-- this line doesn't work --> <h:outputStylesheet library="css" name="style.css" /> <!-- this line is only shown in red if the outputStylesheet in main page is there --> <div class="red">This is red color in second page</div> </h:body> I've made sure that I have h:body and h:head tags in both files. There's nothing more in the html pages except the standard doctype and xml version declarations. I've tried packing everything into h:forms, but that doesn't change anything. Can anyone explain to me what's going on?

    Read the article

  • C: Recursive function for inverting an int

    - by Jorge
    I had this problem on an exam yesterday. I couldn't resolve it so you can imagine the result... Make a recursive function: int invertint( int num) that will receive an integer and return it but inverted, example: 321 would return as 123 I wrote this: int invertint( int num ) { int rest = num % 10; int div = num / 10; if( div == 0 ) { return( rest ); } return( rest * 10 + invert( div ) ) } Worked for 2 digits numbers but not for 3 digits or more. Since 321 would return 1 * 10 + 23 in the last stage. Thanks a lot! PS: Is there a way to understand these kind of recursion problems in a faster manner or it's up to imagination of one self?

    Read the article

  • html escape characters

    - by user1468537
    I have the following: <form name="input" method="get" action="http://site:8083/Default.aspx?DC=" target="foo" onSubmit="window.open('', 'foo', 'width=1100 height=500,status=no,resizable=yes,scrollbars=yes')"> <select name="DC"> <option value="1&Type=type1">1</option> <option value="2&Type=type2">2</option> <option value="3&Type=type3">3</option> <option value="4&Type=type4">4</option> <option value="5&Type=type5">5</option> <option value="6&Type=type6">6</option> <option value="7&Type=type7">7</option> </select> <input type="submit" value=">>"/>&nbsp;&nbsp; </form> Basically my querystring should be something like DC=1&Type=type1 the problem I have is that when I click the button above the html screws up the stirng by changing & to %26 and = to %3D How can I make the value stay as I have it in the code above?

    Read the article

  • Common vulnerabilities for WinForms applications

    - by David Stratton
    I'm not sure if this is on-topic or not here, but it's so specific to .NET WinForms that I believe it makes more sense here than at the Security stackexchange site. (Also, it's related strictly to secure coding, and I think it's as on-topic as any question asking about common website vulnerabiitles that I see all over the site.) For years, our team has been doing threat modeling on Website projects. Part of our template includes the OWASP Top 10 plus other well-known vulnerabilities, so that when we're doing threat modeling, we always make sure that we have a documented process to addressing each of those common vulnerabilities. Example: SQL Injection (Owasp A-1) Standard Practice Use Stored Parameterized Procedures where feasible for access to data where possible Use Parameterized Queries if Stored Procedures are not feasible. (Using a 3rd party DB that we can't modify) Escape single quotes only when the above options are not feasible Database permissions must be designed with least-privilege principle By default, users/groups have no access While developing, document the access needed to each object (Table/View/Stored Procedure) and the business need for access. [snip] At any rate, we used the OWASP Top 10 as the starting point for commonly known vulnerabilities specific to websites. (Finally to the question) On rare occasions, we develop WinForms or Windows Service applications when a web app doesn't meet the needs. I'm wondering if there is an equivalent list of commonly known security vulnerabilities for WinForms apps. Off the top of my head, I can think of a few.... SQL Injection is still a concern Buffer Overflow is normally prevented by the CLR, but is more possible if using non-managed code mixed in with managed code .NET code can be decompiled, so storing sensitive info in code, as opposed to encrypted in the app.config... Is there such a list, or even several versions of such a list, from which we can borrow to create our own? If so, where can I find it? I haven't been able to find it, but if there is one, it would be a great help to us, and also other WinForms developers.

    Read the article

  • Django - Override admin site's login form

    - by TrojanCentaur
    I'm currently trying to override the default form used in Django 1.4 when logging in to the admin site (my site uses an additional 'token' field required for users who opt in to Two Factor Authentication, and is mandatory for site staff). Django's default form does not support what I need. Currently, I've got a file in my templates/ directory called templates/admin/login.html, which seems to be correctly overriding the template used with the one I use throughout the rest of my site. The contents of the file are simply as below: # admin/login.html: {% extends "login.html" %} The actual login form is as below: # login.html: {% load url from future %}<!DOCTYPE html> <html> <head> <title>Please log in</title> </head> <body> <div id="loginform"> <form method="post" action="{% url 'id.views.auth' %}"> {% csrf_token %} <input type="hidden" name="next" value="{{ next }}" /> {{ form.username.label_tag }}<br/> {{ form.username }}<br/> {{ form.password.label_tag }}<br/> {{ form.password }}<br/> {{ form.token.label_tag }}<br/> {{ form.token }}<br/> <input type="submit" value="Log In" /> </form> </div> </body> </html> My issue is that the form provided works perfectly fine when accessed using my normal login URLs because I supply my own AuthenticationForm as the form to display, but through the Django Admin login route, Django likes to supply it's own form to this template and thus only the username and password fields render. Is there any way I can make this work, or is this something I am just better off 'hard coding' the HTML fields into the form for?

    Read the article

  • Redirect in codeigniter after login

    - by edelweiss
    Trying to do a redirect after a successful login. The login info is sent using ajax to the controller. My controller code as below public function login_controller_function() { $this->load->model('login_model'); if ($this->input->is_ajax_request()) { $user_name=$this->input->post('username'); $user_password = $this->input->post('password'); $this->load->helper('url'); $result = $this->login_model->verify_user($user_name,$user_password); // echo 'user_logged_in'; if(strcmp($result,'user_logged_in')==0) { redirect('welcome'); } } } But it is not working at all. Anyone knows whats wrong? Hi my html as requested. i am using twitter bootstrap as well <li class="divider-vertical"></li> <li><a href="#" id="login_btn">Login</a></li> <li><a href="<?php echo base_url('register'); ?>">Register</a></li> for the buttons so when i click the login button, a modal window will appear and ask for login info. so when i click on the login button, my js code will send an ajax request my js code as below /*Attempt register user jquery ajax*/ $('#login').click(function(){ var user_name = $('#loginHere').find('#user_name').val(); var user_password = $('#loginHere').find('#login_pwd').val(); if(user_name==""||user_password=="") return; var login_data = { username:user_name, password:user_password}; $.ajax({ type: "POST", dataType: "json", async: false, url:"login_register/login_controller_function", data: login_data, success: function(data) { if(data.login) { alert(data.redirect); window.location.replace(data.redirect); } else if(!data.login) { alert('data login not true'); } }, error:function(data){ alert('ajax error'); } }); }); });

    Read the article

  • How to find index of an object by key and value in an javascript array

    - by return1.at
    Given: var peoples = [ { "attr1": "bob", "attr2": "pizza" }, { "attr1": "john", "attr2": "sushi" }, { "attr1": "larry", "attr2": "hummus" } ]; Wanted: Index of object where attr === value for example attr1 === "john" or attr2 === "hummus" Update: Please, read my question carefully, i do not want to find the object via $.inArray nor i want to get the value of a specific object attribute. Please consider this for your answers. Thanks!

    Read the article

  • Windows Phone 7.1.1 Ping

    - by Matt
    I am writing an app to connect to a third party application using REST web services. I have a configuration page that asks for an IP, Port, User Name & Password, currently it just blindly assumes you enter the correct details and attempts a connection. I want to create a test routine that goes through and checks off the following steps when setting up the config information Is the IP/Hostname correct (using ping or something) Is the Port correct Is the Username & Password correct then displays the results on screen as it's going so that if it can't connect to the service it's easier to identify where the issue is. To achieve step 1 I would like to use Ping or some equivalent that does not rely on a particular port being open. So I can eliminate dodgy DNS or a typo in the IP/Hostname. I understand from previous questions asked that ping wasn't possible in 7.0 but with Mango the sockets classes have been added in, is it possible now, if so how? If it still isn't possible is there a different way I can achieve step 1?

    Read the article

  • Review - Professional Android Programming with Mono for Android and .NET/C#

    - by Wallym
    Mike Riley of Dev Pro Connections Magazine has a review of our Mono for Android book.  You can read the full review on their siteMono for Android has been available for more than a year. The documentation for the product is adequate and has been improving over time, but until recently, finding a good book about the technology was difficult. Such a constraint has been lifted thanks to Wiley's Professional Android Programming with Mono for Android and .NET/C#. Written under the Wrox imprint by several contributors (Wallace B. McClure, Nathan Blevins, John J. Croft, Jonathan Dick, and Chris Hardy), the book is one of the most comprehensive and helpful Mono for Android titles currently on the market. Please buy 8-10 copies of our book for the ones you love, they make great romantic gifts.

    Read the article

  • Calling a web service through a reverse proxy

    - by Ken
    I had a w/s that when I first read the WSDL in test, was http, but needed to be accessed from behind a reverse proxy with https.  Here are the steps: Change the app.config, <httpTransport> to <httpsTransport> Change the app.config and the url address in the <endpoint>to the reverse proxy address Add System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };  to disable certificate validation.  This will validate all certificates (including invalid, expired or self-signed ones).

    Read the article

  • Chrome OS is missing or damaged

    - by Ken
    My Google Chrome CR-48 started flaking out/rebooting and finally this message.  This post solved the problem quite easily. http://cr-48.wikispaces.com/Reseat+SSD+Cable Two hints: 1) you need to pull off the rubber feet to get at some screws. 2) the real problem is the little white clip under the cable.  Don’t worry about reseating anything, Just push the cable back on and the little white clip back up to snap in place and hold the cable.

    Read the article

  • Shuttle FB51 mobo does not boot with external USB drive attached [closed]

    - by user127236
    I am repurposing an old Alienware desktop as a home media server. The PC is based on the Shuttle FB51 motherboard. The BIOS is a Phoenix Version 6.00 PG, release date 12/16/2002. I have loaded Ubuntu 12.04 LTS on the internal hard drive. I am using a Western Digital WD Elements 1.5 TB USB 2.0 Desktop External Hard Drive for media storage. When the external drive is plugged in and the PC is powered on, it freezes very early in the BIOS self-test, even before it begins the memory test. If I unplug the drive, the self-test proceeds without further problems. I can plug the USB drive back in when the self-test is complete, and Ubuntu will boot and find the external drive normally. I've tried several changes to the BIOS setup without finding a cure for the boot issue. Any assistance gratefully accepted. JGB

    Read the article

  • Installing Ubuntu guest crashes Hyper-V host

    - by Grant
    I have a weird problem that I don't even know where to begin diagnosing. Trying to install Ubuntu to a VM locks up the host system! My setup is: Dell R715 server, dual 16 core AMD opteron processors, 96GB RAM Dell MD3600f SAN Server 2008 R2 Datacenter System Center VMM 2012 There are 5 windows virtual machines running that have had no problems. This is the first linux VM I've tried to create. I setup a VM through virtual machine manager, set the CD drive to a Ubuntu 12.04 server x64 iso, and started it up. It boots up the normal ubuntu install menu, but the second I hit enter on "Install Ubuntu Server", I get disconnected. The HOST machine stops responding to pings. So do all virtual machines on it. It locks up entirely - keyboard on the host won't work, mouse won't move, numlock light won't change. There's no blue screen - the host is sitting at the login screen completely unresponsive. I can't find any relevant logs in event viewer after rebooting. What could cause the host machine to freeze like that? It's not a one time occurrence - it happens every time at the exact same point. Thank god this server isn't in production yet!

    Read the article

  • compare the contents of two folders that are replicating by dfs

    - by Funky Si
    I have a large folder that I am replicating by dfs and I want to check that all files have been replicated correctly. Currently I am running the following script at both ends. cd e:\data\shared\ dir /a:-h /b /s > e:\data\shared\result.txt and then using a text editor to tidy the file before using a diff tool to compare them. Does anyone know a better way of doing this? Failing that does anyone know how to adapt my script to ignore all the files in the DfsrPrivate folders

    Read the article

  • When to raise domain functional level?

    - by Joel Coel
    We very recently completed a project to retire two old domain controllers running Server 2003 R2. They are now replaced with shiny new 2008 R2 boxes. However, the functional level of the domain has not yet been updated for the 2008 R2 servers, just in the long-shot case of the need for a rollback to the old controllers. I expect to have the all clear to update the domain by next weekend. I also want to note that our desktop clients are still 95% Windows XP. However, we're about to start a project to update our 200 or so clients to Windows 7 before the end of the calendar year. Is there any advantage to holding the domain at the 2003 functional level while we are still supporting more Windows XP than Windows 7, especially given that some of the management stations are still XP? Update: I forgot to mention earlier that we still have a pair of windows 2000 servers (not domain controllers) that support some legacy software. I'm working to replace those, but in the meantime I need to be sure that Windows 2000 can still participate in a 2008 R2 domain.

    Read the article

  • Add static route through DHCP

    - by MathieuK
    I'm trying to get an OSX Lion Server to provide a static route to its clients (all OSX Lion) over DHCP. I can't get the client to actually apply the static route. So far, I've managed to get the DHCP server (BOOTPD) to actually serve the DHCP OPTION 33 (static_route) on the DHCP offers by editing /etc/bootpd.plist and adding something like: <key>dhcp_option_33</key> <data>[some base64 goes here]</data> .. and restarting the DHCP service. On the client I've managed to get the client to actually request the dhcp option by modifying and adding option 33 to the DHCPRequestedParameterList key: <key>DHCPRequestedParameterList</key> <array> ... keys snipped for brevity ... <integer>33</integer> </array> .. and rebooting the client. This makes the client request the static_route option from the DHCP server ( i can see the proper output in ipconfig getpacket en0 ) but it doesn't actually apply the rule. Has anyone ever succeeded in applying static_route options on OSX clients through DHCP?

    Read the article

  • How to maintain one file across many production servers (Windows and Linux)

    - by Brien
    My organization wants to centrally manage an Oracle TNSnames file for all of their production servers. When that file changes, they want to be able to push out the changes to all servers that use it with a minimal effort. Approaches that have been considered: Centralized file server (drawback: if the file server or the network connection to the file server goes down, the servers have no access to the critical file) Subversion client on each server (drawback: using a source control tool in production, added complexity) Store an individual copy of the file on each server (drawback: changing the file contents involves making changes on many different servers) Update Can I use DFS to do this?

    Read the article

  • Hyper-V shutdown/start up host causing issues in VMs

    - by Colin Desmond
    I have a single physical host, running 2008 R2 with Hyper-V, all fully updated. On that host I am running 3 clients, a DC, a web server and a SQL Server 2008 R2 SP1. All are running on Windows Server 2008 R2, again all fully patched. Generally all is fine, but sometimes and not repeatably, when I shutdown the host properly, which suspends the Clients, when it all comes up again, SQL Server is no longer running and the IIS App Pool I am running the website in needs to be told which account to run in again! Any ideas!?

    Read the article

  • is it dangerous for the processor core to be *always* loaded at 100%?

    - by javapowered
    In my HFT software I plan to use one core for stock index calculation. That would be simply while(true) loop without any delays which will calculate (sum and multiply) components as often as possible (so millions times per second) and I plan to do that 8 hours per day every day. I was never before loading my computer to 100% full time every day regullary. May it be dangerous? Do processor has kind of "resource" (very big of course) after which it can stopped working?

    Read the article

  • .htaccess rewrite all queries to static page

    - by user127219
    I have an account where hundreds of inbound links to their calender are showing up as 404 (they moved their site to a new platform). I would like to make a wildcard redirection of all URLs with a query to their old event calender to land on a new static page, and do the same for their webstore queries. I've tried several variations, but can't seem to get it to work. CASE 1: I need to redirect URLs like these (note the difference between "showDay" and "showWeek"): apps/calendar/showWeek?calID=5107976&year=2011&month=7&day=10 apps/calendar/showDay?calID=5107976&year=2011&month=9&day=10 To: http://domain.com/events/ CASE 2: And also URLs like these: apps/webstore/products/show/1927074 TO: http://subdomain.domain.com/ I can't seem to get the syntax right to take all of the URLS and redirect them. I'm looking for the equivalent of a wildcard like "apps/calendar/*" would give you at a command line. Any help is appreciated!

    Read the article

  • BizTalk configuration broken following WCF hotfix installation

    - by Sir Crispalot
    I usually post over on StackOverflow, but thought this was probably better suited to ServerFault. Please migrate if I'm wrong! I am developing a WCF service and a BizTalk application on my workstation at the moment. As part of the WCF service, I had to install hotfix 971493 from Microsoft which updates some core WCF assemblies. Following installation of that hotfix, I am now experiencing severe issues in my existing BizTalk application. When I attempt to configure the properties of an existing WCF-Custom receive location, I get this error: Error loading properties (System.IO.FileLoadException) The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) If I click OK (the same error repeats four times) I eventually see the WCF-Custom properties dialog. However if I click on the various tabs, I continue to receive errors: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (Microsoft.BizTalk.Adapter.Wcf.Admin) The WCF-Custom receive location was working yesterday, and I installed the hotfix this morning. I'm guessing these two are related, and that BizTalk somehow has a reference to the old WCF assemblies. Does anyone know how I can fix this?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >