Daily Archives

Articles indexed Tuesday April 10 2012

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

  • Is there a slick way to deploy my silverlight app and change settings programmatically?

    - by MIke S.
    I am fairly new to web development. I am at the point of deployment (for testing). I have a few places (maybe 4 places) where I had to add a URI that was non-relative into the appliation. So now, at deployment, those need to be changed. Is there a slick way of handling this? By slick I mean not manually going through the app and changing the URIs or a blanket find and replace (too risky). I only have 4 places to change now, but this could easily change and cause deployment issues. I am using a Microsoft technology stack. Silverlight, ASP.NET, RIA, etc. Development is done in Visual Studio 2010. I noticed that the web projects have a nifty transformation for the web.config...which is nice. Is there an equivalent mechanism for silverlight resources? Any other ways? Any thoughts?

    Read the article

  • Gathering entropy in web apps to create (more) secure random numbers

    - by H M
    after several days of research and discussion i came up with this method to gather entropy from visitors (u can see the history of my research here) when a user visits i run this code: $entropy=sha1(microtime().$pepper.$_SERVER['REMOTE_ADDR'].$_SERVER['REMOTE_PORT']. $_SERVER['HTTP_USER_AGENT'].serialize($_POST).serialize($_GET).serialize($_COOKIE)); note: pepper is a per site/setup random string set by hand. then i execute the following (My)SQL query: $query="update `crypto` set `value`=sha1(concat(`value`, '$entropy')) where name='entropy'"; that means we combine the entropy of the visitor's request with the others' gathered already. that's all. then when we want to generate random numbers we combine the gathered entropy with the output: $query="select `value` from `crypto` where `name`='entropy'"; //... extract(unpack('Nrandom', pack('H*', sha1(mt_rand(0, 0x7FFFFFFF).$entropy.microtime())))); note: the last line is a part of a modified version of the crypt_rand function of the phpseclib. please tell me your opinion about the scheme and other ideas/info regarding entropy gathering/random number generation. ps: i know about randomness sources like /dev/urandom. this system is just an auxiliary system or (when we don't have (access to) these sources) a fallback scheme.

    Read the article

  • monitoring unix resources from inside a process

    - by kamziro
    I've had a bunch of EAGAIN's from trying to fork() or spawning threads, which lead me to believe that I'm leaking resources somewhere. Is it possible, in POSIX, to get the following from inside the process itself: number of active pthreads number of active child processes number of active pipes number of active sockets (or maybe this and pipes would be counted as file descriptors?) Or do these have to be counted manually? There's already counters for them, but I think one of them are leaking.

    Read the article

  • X++ Coming Out Of QueryRun In Fetch Method

    - by will
    I can't seem to find the resolution for this. I have modified the Fetch method in a report, so that if the queryRun is changed, and the new ID is fetched, then the while loop starts over and a new page appears and 2 elements are executed. This part works fine, the next part does not, in each ID there are several Records which I am using Element.Execute(); and element.Send(); to process. What happens is, the first ID is selected, the element (body) of the reports is executed and the element is sent as expected, however the while loop does not go onto the next ID? Here is the code; public boolean fetch() { APMPriorityId oldVanId, newVanId; LogisticsControlTable lLogisticsControlTable; int64 cnt, counter; ; queryRun = new QueryRun(this); if (!queryRun.prompt() || !element.prompt()) { return false; } while (queryRun.next()) { if (queryRun.changed(tableNum(LogisticsControlTable))) { lLogisticsControlTable = queryRun.get(tableNum(LogisticsControlTable)); if (lLogisticsControlTable) { info(lLogisticsControlTable.APMPriorityId); cnt = 0; oldVanId = newVanId; newVanId = lLogisticsControlTable.APMPriorityId; if(newVanId) { element.newPage(); element.execute(1); element.execute(2); } } if (lLogisticsControlTable.APMPriorityId) select count(recId) from lLogisticsControlTable where lLogisticsControlTable.APMPriorityId == newVanId; counter = lLogisticsControlTable.RecId; while select lLogisticsControlTable where lLogisticsControlTable.APMPriorityId == newVanId { cnt++; if(lLogisticsControlTable.APMPriorityId == newVanId && cnt <= counter) { element.execute(3); element.send(lLogisticsControlTable); } } } } return true; }

    Read the article

  • On android how would I go about creating a prompt for an app that requires a user to enter a username before fully launching the app?

    - by racl101
    I'll preface this with I'm really new to working on Android. So I have to work on an existing app and create a screen that prompts the user for a username if one isn't entered then it won't launch the currently existing main activity (i.e. it won't fully launch the app. Instead it will just sit on that screen until a username is entered.) I suppose that it's tantamount to a web app login page in that it will not let a user past that page if the user is not authenticated and authorized. However, there's no authentication nor authorization in this app. Instead, on first run a user must simply register with a username and that username gets saved to the database and for any subsequent runs the app's main activity will just start because a user has registered to that phone. In fact, the app will not prompt the user for their name again unless the app gets deleted with all its data and reinstalled again. This implicitly means that I have to save the user's name in the database or some other kind of storage. So I was wondering what would be the best way of doing this in an app with an existing main activity? Should I try to accomplish this on that existing main activity or create a new activity to display this prompt screen and, in effect, block the main activity from running until the user enters their name? Any tutorials or links would be helpful and thank you in advance for any help.

    Read the article

  • PHP code displayed in browser

    - by Drake
    so, I'm working on a databases project, and i'm trying to code incrementally. the problem is, when i go to test the php in browser, it displays the php code after my use of "-". the html printing is displayed properly, which is AFTER the point where the - is. here is the php: <?php function getGraphicNovel(){ include_once("./connect.php"); $db_connection = new mysqli($SERVER, $USERNAME, $PASSWORD, $DATABASE); if (mysqli_connect_errno()) { echo("Can't connect to MySQL Server. Error code: " . mysqli_connect_error()); return null; } $stmt = $db_connection->stmt_init(); $returnValue = "invalid"; if($stmt.prepare("select series from graphic_novel_main natural join graphic_novel_misc")) { $stmt->execute(); $stmt->bind_result($series); while ($stmt->fetch()) { echo "<tr><td>" . $series . "</td></tr>"; } $stmt->close(); } $db_connection->close(); } getGraphicNovel(); ?> here is a link to the page. hopefully it works for people outside the school's network. http://plato.cs.virginia.edu/~paw5k/cainedb/viewall.html if anyone knows why this is happening, your input would be great!

    Read the article

  • How to delete duplicate/aggregate rows faster in a file using Java (no DB)

    - by S. Singh
    I have a 2GB big text file, it has 5 columns delimited by tab. A row will be called duplicate only if 4 out of 5 columns matches. Right now, I am doing dduping by first loading each coloumn in separate List , then iterating through lists, deleting the duplicate rows as it encountered and aggregating. The problem: it is taking more than 20 hours to process one file. I have 25 such files to process. Can anyone please share their experience, how they would go about doing such dduping? This dduping will be a throw away code. So, I was looking for some quick/dirty solution, to get job done as soon as possible. Here is my pseudo code (roughly) Iterate over the rows i=current_row_no. Iterate over the row no. i+1 to last_row if(col1 matches //find duplicate && col2 matches && col3 matches && col4 matches) { col5List.set(i,get col5); //aggregate } Duplicate example A and B will be duplicate A=(1,1,1,1,1), B=(1,1,1,1,2), C=(2,1,1,1,1) and output would be A=(1,1,1,1,1+2) C=(2,1,1,1,1) [notice that B has been kicked out]

    Read the article

  • How to redirect a user to a new webpage after a Javascript Alert/confrim box

    - by David Maldonado
    I have a client who wishes to have an alert/confirm box pop up when a user leaves the site, then based on what they choose, they will either stay on the page or go to a new page (would love if it would work in all browsers). I have been twiddling all day and have got this piece of code, but doesn't work too well. <script> window.onbeforeonload = function exitLeave(){var answer = confirm("You have not filled out your questionnaire yet") if (answer){ window.location = "http://www.google.com/"; } else{ alert("Cancel it !") } } </script> Any help would be greatly appreciated.

    Read the article

  • Precise explanation of JavaScript <-> DOM circular reference issue

    - by Joey Adams
    One of the touted advantages of jQuery.data versus raw expando properties (arbitrary attributes you can assign to DOM nodes) is that jQuery.data is "safe from circular references and therefore free from memory leaks". An article from Google titled "Optimizing JavaScript code" goes into more detail: The most common memory leaks for web applications involve circular references between the JavaScript script engine and the browsers' C++ objects' implementing the DOM (e.g. between the JavaScript script engine and Internet Explorer's COM infrastructure, or between the JavaScript engine and Firefox XPCOM infrastructure). It lists two examples of circular reference patterns: DOM element → event handler → closure scope → DOM DOM element → via expando → intermediary object → DOM element However, if a reference cycle between a DOM node and a JavaScript object produces a memory leak, doesn't this mean that any non-trivial event handler (e.g. onclick) will produce such a leak? I don't see how it's even possible for an event handler to avoid a reference cycle, because the way I see it: The DOM element references the event handler. The event handler references the DOM (either directly or indirectly). In any case, it's almost impossible to avoid referencing window in any interesting event handler, short of writing a setInterval loop that reads actions from a global queue. Can someone provide a precise explanation of the JavaScript ↔ DOM circular reference problem? Things I'd like clarified: What browsers are effected? A comment in the jQuery source specifically mentions IE6-7, but the Google article suggests Firefox is also affected. Are expando properties and event handlers somehow different concerning memory leaks? Or are both of these code snippets susceptible to the same kind of memory leak? // Create an expando that references to its own element. var elem = document.getElementById('foo'); elem.myself = elem; // Create an event handler that references its own element. var elem = document.getElementById('foo'); elem.onclick = function() { elem.style.display = 'none'; }; If a page leaks memory due to a circular reference, does the leak persist until the entire browser application is closed, or is the memory freed when the window/tab is closed?

    Read the article

  • HTML Checkbox Alignment

    - by iGuygar
    Test Page URL: http://www.guygar.com/inception/ultra/indexCopy.html I am new to this and searching SO I found the following solution for alignment between text and Checkbox: <div style="border-bottom:1px solid black; padding:4px; background-color:#003b5a;"> <span style="font-weight:bold;">Back to the Roots</span> <form> <input type="checkbox" value="header" style="float:right; vertical-align: middle; margin-top: -15px;" /> <label></label> </form> </div> While this works in IE9, it does not work in Chrome or Firefox. Could you please help me with this? Thank you.

    Read the article

  • How can I put a string and an integer into the same array?

    - by Stelios M
    I have to following code. I want this to return an array e.g. arg[] that contains at arg[0] the number of the rows of my cursor and at arg[1] String(0) of my cursor. Since one is integer and the other is string I have a problem. Any ideas how to fix this? public String[] getSubcategoriesRow(String id){ this.openDataBase(); String[] asColumnsToReturn = new String[] {SECOND_COLUMN_ID,SECOND_COLUMN_SUBCATEGORIES,}; Cursor cursor = this.dbSqlite.query(SECOND_TABLE_NAME, asColumnsToReturn, SECOND_COLUMN_SUBCATEGORIES + "= \"" + id + "\"", null, null, null, null); String string = cursor.getString(0); int count = cursor.getCount(); String arg[] = new String[]{count, string}; cursor.close(); return arg; } The cursor and the results and correct i just need to compine them to an array in order to return that.

    Read the article

  • Django: TypeError: 'str' object is not callable, referer: http://xxx

    - by user705415
    I've been wondering why when I set the settings.py of my django project 'arvindemo' debug = Flase and deploy it on Apache with mod_wsgi, I got the 500 Internal Server Error. Env: Django 1.4.0 Python 2.7.2 mod_wsgi 2.8 OS centOS Here is the recap: Visit the homepage, go to sub page A/B/C/D, and fill some forms, then submit it to the Apache server. Once click 'submit' button, I will get the '500 Internal Server Error', and the error_log listed below(Traceback): [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] Traceback (most recent call last): [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__ [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] response = self.get_response(request) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] response = self.handle_uncaught_exception(request, resolver, sys.exc_info()) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] if resolver.urlconf_module is None: [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/core/urlresolvers.py", line 323, in urlconf_module [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] self._urlconf_module = import_module(self.urlconf_name) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/python2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] __import__(name) [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] File "/opt/web/django/arvindemo/arvindemo/../arvindemo/urls.py", line 23, in <module> [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] url(r'^submitPage$', name=submitPage), [Tue Apr 10 10:07:20 2012] [error] [client 122.198.133.250] TypeError: url() takes at least 2 arguments (2 given) When using django runserver, I set arvindemo.settings debug = True, everything is OK. But things changed once I set debug = Flase. Here is my views.py from django.http import HttpResponseRedirect from django.http import HttpResponse, HttpResponseServerError from django.shortcuts import render_to_response import datetime, string from user_info.models import * from django.template import Context, loader, RequestContext import settings def hello(request): return HttpResponse("hello girl") def helpPage(request): return render_to_response('kktHelp.html') def server_error(request, template_name='500.html'): return render_to_response(template_name, context_instance = RequestContext(request) ) def page404(request): return render_to_response('404.html') def submitPage(request): post = request.POST Mall = 'goodsName' Contest = 'ojs' Presentation = 'addr' WeatherReport = 'city' Habit = 'task' if Mall in post: return submitMall(request) elif Contest in post: return submitContest(request) elif Presentation in post: return submitPresentation(request) elif Habit in post: return submitHabit(request) elif WeatherReport in post: return submitWeather(request) else: return HttpResponse(request.POST) return HttpResponseRedirect('404') def submitXXX(): ..... def xxxx(): .... Here comes the urls.py from django.conf.urls import patterns, include, url from views import * from django.conf import settings handler500 = 'server_error' urlpatterns = patterns('', url(r'^hello/$', hello), # hello world url(r'^$', homePage), url(r'^time/$', getTime), url(r'^time/plus/(\d{1,2})/$', hoursAhead), url(r'^Ttime/$', templateGetTime), url(r'^Mall$', templateMall), url(r'^Contest$', templateContest), url(r'^Presentation$', templatePresentation), url(r'^Habit$', templateHabit), url(r'^Weather$', templateWeather), url(r'^Help$', helpPage), url(r'^404$', page404), url(r'^500$', server_error), url(r'^submitPage$', submitPage), url(r'^submitMall$', submitMall), url(r'^submitContest$', submitContest), url(r'^submitPresentation$', submitPresentation), url(r'^submitHabit$', submitHabit), url(r'^submitWeather$', submitWeather), url(r'^terms$', terms), url(r'^privacy$', privacy), url(r'^thanks$', thanks), url(r'^about$', about), url(r'^static/(?P<path>.*)$','django.views.static.serve',{'document_root':settings.STATICFILES_DIRS}), ) I'm sure there is no syntax error in my django project,cause when I use django runserver, everything is fine. Anyone can help ? Best regards

    Read the article

  • Do I really need cmake for build automation?

    - by PMiller
    I'm currently investigating cmake to allow automatic building on the Win32 platform. For all runtimes and libraries I'd like to build, Visual Studio (2008/2010) projects do allready exist. I've come across cmake, but I'm unsure if I really need it. As the documentation says, cmake generates VS projects and they then can be built e.g. using MSBuild. As the projects itself allready do exist (and build nicely via the IDE or MSBuild on the cmd line), what do I need and use cmake for? Just for directory/project folder traversal? Build failure reporting? Regards, Paul

    Read the article

  • Diff between $.ajaxSetup and $.ajax in jquery

    - by Deeptechtons
    title is a bit misleading but i would like to know internally (what happens during ajax request) when i execute Code 1 and Code 2 in turns Code 1 $.ajax({url:"1.aspx/HelloWorld",type:"GET",dataType:"json",contentType:"application/json"}); Code 2 $.ajaxSetup({ contentType: "application/json", dataType: "json" }); $.get("1.aspx/HelloWorld","",$.noop,"json"); i ask this because the method HelloWorld in page 1.aspx is executed correctly when run Code 1. But the seconds one refuses to invoke the pageMethod. I have set the ContentType and data as expected but the second request in Code 2 refuses to invoke the method does anyone have a reason for this ?

    Read the article

  • Android: Scrollable (bitmap) screen

    - by somin
    I am currently implementing a view in Android that involves using a larger than the screen size bitmap as a background and then having drawables drawn ontop of this. This is so as to simulate a "map" that can be scrolled horizontally aswell as vertically. Which is done by using a canvas and then drawing to this the full "map" bitmap, then putting the other images on top as an overlay and then drawing only the viewable bit of this to screen. Overriding the touch events to redraw the screen on a scroll/fling. I'm sure this probably has a huge ammount of overhead (by creating a canvas of the full image whilst using(drawing) only a fifth of it) and could be done in a different way as to the explained, but I was just wondering what people would do in this situation, and perhaps examples? If you need more info just let me know, Thanks, Simon

    Read the article

  • Group properties in custom control

    - by Gunners98
    I want to do a class that have properties like font, which will have other properties, such as name, size, unit,bold.I had tried a solution but it isn't working for me.(http://stackoverflow.com/questions/755391/group-properties-in-a-custom-control) Anyone can help? Any help will be appreciated. <TypeConverter(GetType(ExpandableObjectConverter))> _ Class TestingClass 'Some property here End Class

    Read the article

  • Is there a way to intersect/diff a std::map and a std::set?

    - by Jack
    I'm wondering if there a way to intersect or make the differences between two structures defined as std::set<MyData*> and std::map<MyData*, MyValue> with standard algorithms (like std::set_intersect) The problem is that I need to compute the difference between the set and the keyset of the map but I would like to avoid reallocating it (since it's something that is done many times per second with large data structures). Is there a way to obtain a "key view" of the std::map? After all what I'm looking is to consider just the keys when doing the set operation so from an implementation point it should be possible but I haven't been able to find anything.

    Read the article

  • Run a .java file using ProcessBuilder

    - by David K
    I'm a novice programmer working in Eclipse, and I need to get multiple processes running (this is going to be a simulation of a multi-computer system). My initial hackup used multiple threads to multiple classes, but now I'm trying to replace the threads with processes. From my reading, I've gleaned that ProcessBuilder is the way to go. I have tried many many versions of the input you see below, but cannot for the life of me figure out how to properly use it. I am trying to run the .java files I previously created as classes (which I have modified). I eventually just made a dummy test.java to make sure my process is working properly - its only function is to print that it ran. My code for the two files are below. Am I using ProcessBuilder correctly? Is this the correct way to read the output of my subprocess? Any help would be much appreciated. David primary process package Control; import java.io.*; import java.lang.*; public class runSPARmatch { /** * @param args */ public static void main(String args[]) { try { ProcessBuilder broker = new ProcessBuilder("javac.exe","test.java","src\\Broker\\"); Process runBroker = broker.start(); Reader reader = new InputStreamReader(runBroker.getInputStream()); int ch; while((ch = reader.read())!= -1) System.out.println((char)ch); reader.close(); runBroker.waitFor(); System.out.println("Program complete"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } subprocess package Broker; public class test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("This works"); } }

    Read the article

  • add animation to layer's path in cocos2d

    - by greg rock
    so i'm on cocos2d but before I was on a normal ios app and I had this code : -(void)viewDidLoad{ rootLayer = [[CALayer alloc] init]; [imageView.layer addSublayer:rootLayer]; roundPath = CGPathCreateMutable(); CGPathMoveToPoint(roundPath, nil, center.x , center.y - 35); CGPathAddArcToPoint(roundPath, nil, center.x + 35, center.y - 35, center.x + 35, center.y + 35, 35); CGPathAddArcToPoint(roundPath, nil, center.x + 35, center.y + 35, center.x - 35, center.y + 35, 35); CGPathAddArcToPoint(roundPath, nil, center.x - 35, center.y + 35, center.x - 35, center.y, 35); CGPathAddArcToPoint(roundPath, nil, center.x - 35, center.y - 35, center.x, center.y - 35, 35); CGPathCloseSubpath(roundPath); //Box Path boxPath = CGPathCreateMutable(); CGPathMoveToPoint(boxPath, nil, center.x , center.y - 35); CGPathAddArcToPoint(boxPath, nil, center.x + 35, center.y - 35, center.x + 35, center.y + 35, 4.7); CGPathAddArcToPoint(boxPath, nil, center.x + 35, center.y + 35, center.x - 35, center.y + 35, 4.7); CGPathAddArcToPoint(boxPath, nil, center.x - 35, center.y + 35, center.x - 35, center.y, 4.7); CGPathAddArcToPoint(boxPath, nil, center.x - 35, center.y - 35, center.x, center.y - 35, 4.7); CGPathCloseSubpath(boxPath); shapeLayer = [CAShapeLayer layer]; shapeLayer.path = boxPath; [rootLayer addSublayer:shapeLayer]; } -(void)startAnimation { CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"]; animation.duration = 2.0; animation.repeatCount = HUGE_VALF; animation.autoreverses = YES; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; animation.fromValue = (id)boxPath; animation.toValue = (id)roundPath; [shapeLayer addAnimation:animation forKey:@"animatePath"]; } But I didn't found a way to do the animation fromboxpath toroundpath on cocos2d, I don't know what CCAction use . Can anybody help me ? sorry for my english I'm french :/

    Read the article

  • uploading images with the help of arrays and fetch errors

    - by bonny
    i use a script to upload a couple of images to a directory. the code works great in case of just one picture will be uploaded. if i like to upload two images or more and have an extension that is not accepted, the script will upload the one with the extension that is allowed to upload and shows the errormessage for the one who is not accepted. but the upload takes place. that's my first problem. second problem will be: in case of an errormessage i would like to display a message in which it is said, which of the images will be not allowed. i do not know how to fetch this one that has an unaccepted ending into a variable that i can echo to the errormessage. here is the code i use: if(!empty($_FILES['image']['tmp_name'])){ $allowed_extension = array('jpg', 'jpeg', 'png', 'bmp', 'tiff', 'gif'); foreach($_FILES['image']['name'] as $key => $array_value){ $file_name = $_FILES['image']['name'][$key]; $file_size = $_FILES['image']['size'][$key]; $file_tmp = $_FILES['image']['tmp_name'][$key]; $file_extension = strtolower(end(explode('.', $file_name))); if (in_array($file_extension, $allowed_extension) === false){ $errors[] = 'its an unaccepted format in picture $variable_that_count'; continue; } if ($file_size > 2097152){ $errors[] = 'reached maxsize of 2MB per file in picture $variable_that_count'; } if (count($errors) == 0){ $path = "a/b/c/"; $uploadfile = $path."/".basename($_FILES['image']['name'][$key]); if (move_uploaded_file($_FILES['image']['tmp_name'][$key], $uploadfile)){ echo "success."; } } } } hope it will be clear what i like to approach. if there is someone who could help out i really would appreciate. thanks a lot.

    Read the article

  • Unable to Sign in to the Microsoft Online Services Signin application from Windows 7 client located behind ISA firewall

    - by Ravindra Pamidi
    A while ago i helped a customer troubleshoot authentication problem with Microsoft Online Services Signin application.  This customer was evaluating Microsoft BPOS (Business Productivity Online Services) and was having trouble using the single sign on application behind ISA 2004 firewall.The network structure is fairly simple with single Windows 2003 Active Directory domain and Windows 7 clients. On a successful logon to the Microsoft Online Services Signin application, this application provides single signon functionality to all of Microsoft online services in the BPOS package. Symptoms:When trying to signin it fails with error "The service is currently unavailable. Please try again later. If problems continue, contact your service administrator". If ISA 2004 firewall is removed from the picture the authentication succeeds.Troubleshooting: Enabled ISA Server firewall logging along with Microsoft Network Monitor tool on the Windows 7 Client while reproducing the issue. Analysis of the ISA Server Firewall logs and Microsoft Network capture revealed that the Microsoft Online Services Sign In application when sending request to ISA Server does not send the domain credentials and as a result ISA Server responds with an error code of HTTP 407 Proxy authentication required listing out the supported authentication mechanisms.  The application in question is expected to send the credentials of the domain user in response to this request. However in this case, it fails to send the logged on user's domain credentials. Bit of researching on the Internet revealed that The "Microsoft Online Services Sign In" application by default does not support Outbound Internet Proxy authentication. In order for it to send the logged on user's domain credentials we had to make  changes to its configuration file "SignIn.exe.config" located under "Program Files\Microsoft Online Services\Sign In" folder. Step by Step details to configure the configuration file are documented on Microsoft TechNet website given below.  Configure your outbound authenticating proxy serverhttp://www.microsoft.com/online/help/en-us/helphowto/cc54100d-d149-45a9-8e96-f248ecb1b596.htm After the above problem was addressed we were still not able to use the "Microsoft Online Services Sign In" application and it failed with the same error.  Analysis of another network capture revealed that the application in question is now sending the required credentials and the connection seems to terminate at a later stage. Enabled verbose logging for the "Microsoft Online Services Sign In" application and then reproduced the problem. Analysis of the logs revealed a time difference between the local client and Microsoft Online services server of around seven minutes which is above the acceptable time skew of five minutes. Excerpt from Microsoft Online Services Sign In application verbose log:  1/26/2012 1:57:51 PM Verbose SingleSignOn.GetSSOGenericInterface SSO Interface URL: https://signinservice.apac.microsoftonline.com/ssoservice/UID1/26/2012 1:57:52 PM Exception SSOSignIn.SignIn The security timestamp is invalid because its creation time ('2012-01-26T08:34:52.767Z') is in the future. Current time is '2012-01-26T08:27:52.987Z' and allowed clock skew is '00:05:00'.1/26/2012 1:57:52 PM Exception SSOSignIn.SignIn  Although the Windows 7 Clients successfully synchronized time to the domain controller for the domain, the domain controller was not configured to synchronize time with external NTP servers. This caused a gradual drift in time on the network thus resulting in the above issue. Reconfigured the domain controller holding the PDC FSMO role to synchronize time with external time source ( time.nist.gov ) and edited the system policy on the ISA server firewall to allow NTP traffic to time.nist.gov Configure the time source for the forest:Windows Time Servicehttp://technet.microsoft.com/en-us/library/cc794937(WS.10).aspx Forced synchronization of Windows time using the command w32tm /resync on the domain controller and later on the clients each of which had corrected the seven minutes difference. This resolved the problem with logon to Microsoft Online Services Sign In.

    Read the article

  • Controlling soft errors and false alarms in SSIS

    - by Jim Giercyk
    If you are like me, you dread the 3AM wake-up call.  I would say that the majority of the pages I get are false alarms.  The alerts that require action often require me to open an SSIS package, see where the trouble is and try to identify the offending data.  That can be very time-consuming and can take quite a chunk out of my beauty sleep.  For those reasons, I have developed a simple error handling scenario for SSIS which allows me to rest a little easier.  Let me first say, this is a high level discussion; getting into the nuts and bolts of creating each shape is outside the scope of this document, but if you have an average understanding of SSIS, you should have no problem following along. In the Data Flow above you can see that there is a caution triangle.  For the purpose of this discussion I am creating a truncation error to demonstrate the process, so this is to be expected.  The first thing we need to do is to redirect the error output.  Double-clicking on the Query shape presents us with the properties window for the input.  Simply set the columns that you want to redirect to Redirect Row in the dropdown box and hit Apply. Without going into a dissertation on error handling, I will just note that you can decide which errors you want to redirect on Error and on Truncation.  Therefore, to override this process for a column or condition, simply do not redirect that column or condition. The next thing we want to do is to add some information about the error; specifically, the name of the package which encountered the error and which step in the package wrote the record to the error table.  REMEMBER: If you redirect the error output, your package will not fail, so you will not know where the error record was created without some additional information.    I added 3 columns to my error record; Severity, Package Name and Step Name.  Severity is just a free-form column that you can use to note whether an error is fatal, whether the package is part of a test job and should be ignored, etc.  Package Name and Step Name are system variables. In my package I have created a truncation situation, where the firstname column is 50 characters in the input, but only 4 characters in the output.  Some records will pass without truncation, others will be sent to the error output.  However, the package will not fail. We can see that of the 14 input rows, 8 were redirected to the error table. This information can be used by another step or another scheduled process or triggered to determine whether an error should be sent.  It can also be used as a historical record of the errors that are encountered over time.  There are other system variables that might make more sense in your infrastructure, so try different things.  Date and time seem like something you would want in your output for example.  In summary, we have redirected the error output from an input, added derived columns with information about the errors, and inserted the information and the offending data into an error table.  The error table information can be used by another step or process to determine, based on the error information, what level alert must be sent.  This will eliminate false alarms, and give you a head start when a genuine error occurs.

    Read the article

  • memory tuning with rails/unicorn running on ubuntu

    - by user970193
    I am running unicorn on Ubuntu 11, Rails 3.0, and Ruby 1.8.7. It is an 8 core ec2 box, and I am running 15 workers. CPU never seems to get pinned, and I seem to be handling requests pretty nicely. My question concerns memory usage, and what concerns I should have with what I am seeing. (if any) Here is the scenario: Under constant load (about 15 reqs/sec coming in from nginx), over the course of an hour, each server in the 3 server cluster loses about 100MB / hour. This is a linear slope for about 6 hours, then it appears to level out, but still maybe appear to lose about 10MB/hour. If I drop my page caches using the linux command echo 1 /proc/sys/vm/drop_caches, the available free memory shoots back up to what it was when I started the unicorns, and the memory loss pattern begins again over the hours. Before: total used free shared buffers cached Mem: 7130244 5005376 2124868 0 113628 422856 -/+ buffers/cache: 4468892 2661352 Swap: 33554428 0 33554428 After: total used free shared buffers cached Mem: 7130244 4467144 2663100 0 228 11172 -/+ buffers/cache: 4455744 2674500 Swap: 33554428 0 33554428 My Ruby code does use memoizations and I'm assuming Ruby/Rails/Unicorn is keeping its own caches... what I'm wondering is should I be worried about this behaviour? FWIW, my Unicorn config: worker_processes 15 listen "#{CAPISTRANO_ROOT}/shared/pids/unicorn_socket", :backlog = 1024 listen 8080, :tcp_nopush = true timeout 180 pid "#{CAPISTRANO_ROOT}/shared/pids/unicorn.pid" GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true before_fork do |server, worker| STDERR.puts "XXXXXXXXXXXXXXXXXXX BEFORE FORK" print_gemfile_location defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! defined?(Resque) and Resque.redis.client.disconnect old_pid = "#{CAPISTRANO_ROOT}/shared/pids/unicorn.pid.oldbin" if File.exists?(old_pid) && server.pid != old_pid begin Process.kill("QUIT", File.read(old_pid).to_i) rescue Errno::ENOENT, Errno::ESRCH # already killed end end File.open("#{CAPISTRANO_ROOT}/shared/pids/unicorn.pid.ok", "w"){|f| f.print($$.to_s)} end after_fork do |server, worker| defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection defined?(Resque) and Resque.redis.client.connect end Is there a need to experiment enforcing more stringent garbage collection using OobGC (http://unicorn.bogomips.org/Unicorn/OobGC.html)? Or is this just normal behaviour, and when/as the system needs more memory, it will empty the caches by itself, without me manually running that cache command? Basically, is this normal, expected behaviour? tia

    Read the article

  • Opinion choosing Switch

    - by mastercode
    ) i have to reestruct a LAN network, with (currently) +/- 60hosts connected ... i have File Servers hosted, VoIP Phones,wireless AP's,printers, scanners, plotters,biometric dispositive,and 2 QNAP TS412 as FileServer and BackupServer, a Mac Mini as main Server of almost all services that need server ... and, a HP V1910-24 (L2+) and another two switches,but, only L2. which switch in your opinion, could fit better this reestruct, to ensure a VLAN division- and have to support Inter VLAN routing also - provide better performance, and also, allow a Future expansion. the budget, is low xD hehe!!

    Read the article

  • Puppet templates and undefined/nil variables

    - by larsks
    I often want to include default values in Puppet templates. I was hoping that given a class like this: class myclass ($a_variable=undef) { file { '/tmp/myfile': content => template('myclass/myfile.erb'), } } I could make a template like this: a_variable = <%= a_variable || "a default value" %> Unfortunately, undef in Puppet doesn't translate to a Ruby nil value in the context of the template, so this doesn't actually work. What is the canonical way of handling default values in Puppet templates? I can set the default value to an empty string and then use the empty? test... a variable = <%= a_variable.empty? ? "a default value" : a_variable %> ...but that seems a little clunky.

    Read the article

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