Daily Archives

Articles indexed Friday April 16 2010

Page 2/120 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Reverse Proxy Methods for Hosting a Low-Bandwidth Dynamic Website

    - by Casey
    I am building a webcam w/ HTTP server that will be running from a low-bandwith connection. The content on the site will be changing every 5 to 10 minutes. Instead of serving files directly from this connection, are there hosting companies that can act as a reverse proxy for my site? Therefore, if nobody is using the site, the local internet connection remains idle. And if I receive 1000 hits all at the same time, only one HTTP GET is required, and the hosting company (on a fat pipe) continues serving the other 999 requests? This doesn't sound like a very common usage model, but I feel like this would be the optimal solution to my situation.

    Read the article

  • Is it possible to compile a query in linq-to-objects

    - by Luke101
    I have a linq to objects query in a recursive loop and afraid when the objects approach more then 1000 and a have more then 100 users on the site -- my website will break. so is it possible to compile a linq to objects query. The linq query does nothing more then find the direct children of a node.

    Read the article

  • How do I convert this Crystal Report IF statement for use in a WHERE clause in Reporting Services?

    - by Spacehamster
    I'm trying to translate this Crystal Reports IF Statement for use in a WHERE clause - {@receipt_datetime_daylight} in {?DateRange} and (if {?Call Sign} = "All Call Signs" Then {cacs_incident_task.resource_or_class_id} = {cacs_incident_task.resource_or_class_id} Else If {?Call Sign} = "All Sierra Call Signs" Then {cacs_incident_task.resource_or_class_id} in ["S10", "S11", "S12"] Else If {?Call Sign} = "All Whiskey Call Signs" Then {cacs_incident_task.resource_or_class_id} in ["W01", "W02", "W03"] Else {cacs_incident_task.resource_or_class_id} = {?Call Sign}) and (if {?OffenceType} = "All Offences" Then {cacs_inc_type.description} = {cacs_inc_type.description} else {cacs_inc_type.description} = {?OffenceType}) CASE statements don't work in Reporting Services, so I need to find a why of translating this into a WHERE clause. Does anyone know a way?

    Read the article

  • CGContextDrawPDFPage doesn't seem to persist in CGContext

    - by erichf
    I am trying to access the pixels of a CGContext written to with a PDF, but the bitmap buffer doesn't seem to update. Any help would be appreciated: //Get the reference to our current page pageRef = CGPDFDocumentGetPage(docRef, iCurrentPage); //Start with a media crop, but see if we can shrink to smaller crop CGRect pdfRect1 = CGRectIntegral(CGPDFPageGetBoxRect(pageRef, kCGPDFMediaBox)); CGRect r1 = CGRectIntegral(CGPDFPageGetBoxRect(pageRef, kCGPDFCropBox)); if (!CGRectIsEmpty(r1)) pdfRect1 = r1; int wide = pdfRect1.size.width + pdfRect1.origin.x; int high = pdfRect1.size.height + pdfRect1.origin.y; CGContextRef ctxBuffer = NULL; CGColorSpaceRef colorSpace; UInt8* bitmapData; int bitmapByteCount; int bitmapBytesPerRow; bitmapBytesPerRow = (wide * 4); bitmapByteCount = (bitmapBytesPerRow * high); colorSpace = CGColorSpaceCreateDeviceRGB(); bitmapData = malloc( bitmapByteCount ); if (bitmapData == NULL) { DebugLog (@"Memory not allocated!"); return; } ctxBuffer = CGBitmapContextCreate (bitmapData, wide, high, 8, // bits per component bitmapBytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); // if (ctxBuffer== NULL) { free (bitmapData); DebugLog (@"Context not created!"); return; } CGColorSpaceRelease( colorSpace ); //White out the current context CGContextSetRGBFillColor(ctxBuffer, 1.0, 1.0, 1.0, 1.0); CGContextFillRect(ctxBuffer, CGContextGetClipBoundingBox(ctxBuffer)); CGContextDrawPDFPage(ctxBuffer, pageRef); //!!!This displays just fine to the context passed in from - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx. That is, I can see the PDf page rendered, so we know ctxBuffer was created correctly //However, if I view bitmapData in memory, it only shows as 0xFF (or whatever fill color I use) CGImageRef img = CGBitmapContextCreateImage(ctxBuffer); CGContextDrawImage(ctx, tiledLayer.frame, img); void *data = CGBitmapContextGetData (ctx); for (int i = 0; i < wide; i++) { for (int j = 0; j < high; j++) { //All of the bytes show as 0xFF (or whatever fill color I test with)?! int byteIndex = (j * 4) + i * 4; UInt8 red = bitmapData[byteIndex]; UInt8 green = bitmapData[byteIndex + 1]; UInt8 blue = bitmapData[byteIndex + 2]; UInt8 alpha = m_PixelBuf[byteIndex + 3]; } } I have also tried using CGDataProviderCopyData(CGImageGetDataProvider(img)) & CFDataGetBytePtr, but the results are the same?

    Read the article

  • Getting a 404 when setting up MVC in IIS 6 and using .NET 4 beta 2

    - by joshcomley
    Hi all, I've completed this set up on a fair few IIS 6 boxes, but one is giving me a tough time. The problem occurs when I add the application extension mapping to: c:\windows\microsoft.net\framework\v4.0.21006\aspnet_isapi.dll When this is in place, I get a 404 error on every request. Even if I remove all files from the application directory apart from a basic test.htm and navigate to that, I still get a 404. I've unchecked the "Verify that file exists" I've set up a .NET 4 application pool and pointed my application to that I've changed the ASP.NET version to 4.0.21006 I've checked the IIS log file, and there's nothing useful in there (it only shows the first bunch of requests after each reboot and then stops logging) I've checked the application event log and nothing gets reported I've installed MVC 2 I've copied the set up onto another box, just to be sure, following all the same steps - and it all works! What else can I look out for?? N.B: If I set .NET to v2 in IIS, then I can successfully navigate to \test.htm

    Read the article

  • Anyway that I can get the values of a PHP array through ajax?

    - by Jerry
    Hi All, I am trying to build a shopping cart site. When a user click add to cart image on the product page, The product title will show a "The product is in your cart" text without reloading the page. I am using session and ajax but no luck so far. I appreciate any helps. My html cold <table id="<?php echo $productId; ?>" width="594" border="0" cellpadding="5" cellspacing="0"> <tr> <td><img src="<?php echo "$brandImage"; ?></td> <td <?php echo $productName; ?> //The "The product is in your cart" will be showed here</td> </tr> <tr> <td><a class="addToCart" href="javascript:void(0);" onclick="addToCart(<?php echo $productId?>)"> </td> My Javascript file (addToCart.js) function addToCart(productId){ var url="addToCart.php"; url=url+"?productId="+productId; url=url+"&sid="+Math.random(); $.post( url, function(responseText){ alert(responseText); //I wish I can get productData value from addToCart.php }, "html" ) My php file (addToCart.php) <?php SESSION_START(); $productId=$_GET['productId']; $cart=$_SESSION['cart']; if(isset($cart)){ $cart.=",".$productId; $product=explode(',',$cart); $totalItem=count($product); }else{ $cart=$productId; $totalItem=1; }; $productData=array(); foreach($product as $id){ $productData[$id]=(isset($productData[$id])) ? $productData[$id]+1 :1; }; $_SESSION['cart']=$cart; //print_r($productData); echo $productData; //Not sure what to do to send $productData back to my addToCart.js variable ?> I tried to make the code look simple. Any suggestion will be a great help. Thanks

    Read the article

  • Where is the probem in this code (javascript)?

    - by user318068
    Hi I have a problem in my code. can anybody help me ... <html> <body> <script type="text/javascript"> <?php $conn = mysql_connect("localhost","root"); mysql_select_db("tr", $conn); $q = mysql_query("SELECT message FROM messages WHERE to_viewed = '0' "); if (mysql_num_rows($q)) { require('pm.php'); ?> var answer = confirm("you have new message "); <?php } ?> if (answer) { window.location = "http:>>>/"; } else { } //--> </script> </body> </html> Thanks .... The error that appears in my code is that the confirm is not working if I open my page (no output)

    Read the article

  • How To: Group Column Headings In WPF.

    - by VoidDweller
    -------------------------------------------------------------------------- |[ Common Category ]|[ Dynamic Category 0 ]|[ Dynamic Category N ]| -------------------------------------------------------------------------- |[Header 1]|[Header 2]|[ Type 0 ]|[ Type N ]|[ Type 0 ]|[ Type N ]| -------------------------------------------------------------------------- |[Data 2 Group] | -------------------------------------------------------------------------- | Data A | Data 2 || Null | Data 1 || Data 0 | Data 1 || | Data B | Data 2 || Data 0 | Null || Data 0 | Data 1 || -------------------------------------------------------------------------- |[Data 1 Group] | -------------------------------------------------------------------------- | Data C | Data 1 || Null | Data 1 || Data 0 | Data 1 || | Data D | Data 1 || Null | Null || Data 0 | Null || -------------------------------------------------------------------------- Dynamic Category: Columns can be 0 or more. Must contain 1 or more Type Columns. Will only be displayed if any row contains Type Column data associated with it. Data Rows: Will be added Asynchronously. Will be grouped by a Common Category column. Will add a Dynamic Category if it does not yet exist. Will add a Type Column if it does not yet exist within its appropriate Dynamic Category. Platform Info: WPF .Net 3.5 sp1 C# I have a few partially functional prototypes, but each has it's own major set of problems. Can any of you give me some guidance on this? A working prototype would be even better! Envision this nicely styled. :-)

    Read the article

  • How can you connect OpenGrok to a SVN repository?

    - by Malcolm Frexner
    I was able to install and use opengrok on WinXP using this blog entry http://theflashesofinsight.wordpress.com/2009/05/11/install-opengrok-on-windows/ I now want to index a subversion repository. I checked out a repository to the source folder and can search the files. However the links for history and annotate are not active. I have svn installed and indexing the directory give no warnings or errors. (There was an error when I didnt have the SVN client installed) Is there some configuration needed? I saw this link http://blogs.sun.com/trond/entry/using_subversion_with_opengrok but it did not give me any clue. I used java -Xmx1024m -jar opengrok.jar -W "C:\\OpenGrok\\data\\configuration.xml" -r on -P -S -v -s "C:\\OpenGrok\\source" -d "C:\\OpenGrok\\data" and after it java -Xmx1024m -jar opengrok.jar -R "C:\\OpenGrok\\data\\configuration.xml" -H This is the resulting config: <?xml version="1.0" encoding="UTF-8"?> <java version="1.6.0_20" class="java.beans.XMLDecoder"> <object class="org.opensolaris.opengrok.configuration.Configuration"> <void property="dataRoot"> <string>C:\OpenGrok\data</string> </void> <void property="projects"> <void method="add"> <object class="org.opensolaris.opengrok.configuration.Project"> <void property="description"> <string>Configuration</string> </void> <void property="path"> <string>/Configuration</string> </void> </object> </void> <void method="add"> <object class="org.opensolaris.opengrok.configuration.Project"> <void property="description"> <string>test</string> </void> <void property="path"> <string>/test</string> </void> </object> </void> </void> <void property="remoteScmSupported"> <boolean>true</boolean> </void> <void property="repositories"> <void method="add"> <object class="org.opensolaris.opengrok.history.RepositoryInfo"> <void property="datePattern"> <string>yyyy-MM-dd&apos;T&apos;HH:mm:ss.SSS&apos;Z&apos;</string> </void> <void property="directoryName"> <string>C:\OpenGrok\source\Configuration</string> </void> <void property="remote"> <boolean>true</boolean> </void> <void property="type"> <string>Subversion</string> </void> <void property="working"> <boolean>true</boolean> </void> </object> </void> </void> <void property="sourceRoot"> <string>C:\OpenGrok\source</string> </void> <void property="verbose"> <boolean>true</boolean> </void> </object> </java>

    Read the article

  • How can I do a fastAgi to use with Asterisk in Perl

    - by Edwin Jaws
    Hi! I am trying to do an IVR using FAstAGI to say information from my database to my clients. I done AGI doing this but I need now run this from another server, windows server, but I dont know how can I do this. I checked the Asterisk::fastagi module but it is so confused and I dont understand anything. I did a few AGI perl scripts without problem but now I get. If somebody can give me an example to simple script to put me on rigth direction to do that will be so appreciated. Just I need one exmaple and to know if all AGI normal commands from AGI like stream_file are available in fastagi Thks In Advance Edwin Jaws

    Read the article

  • Things IT needs to do for compliance in a private company?

    - by SQL Baba
    My company is a private, family owned business. The company is head quartered in USA and also runs businesses in several countries including Mexico, UK, Canada, Carribean islands and few other countries in S.America. Me and my boss had a discussion over lunch regarding IT compliance and we wondered what kind of mail archiving solution we need to pursue and what are the other IT related compliance we need to pursue. Our processes include online and phone based sales, phone based customer support, w-9 (SSN and EIN) verification, etc.

    Read the article

  • How to start using twill?

    - by brilliant
    How do I start using twill? I have just downloaded it, unpacked it and clicked on the setup .py file in the folder. The black window (terminal) appeared for a moment and vanished. (I do have Python 2.5 installed on my computer - along with SDK from Google App Engine) In the twill documentation section it says: Downloading twill The latest release of twill is twill 0.9, released Thursday, December 27th, 2007; it is available for download at http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz. You can also use Python's easy_install to install or upgrade twill. twill works with Python 2.3 or later. To start using twill, install it and then type twill-sh. At the prompt type: go http://www.slashdot.org/ show showforms showhistory I am not clear from this passage what I am supposed to type (only "twill-sh" or "twill-sh" and all the words under that line) and where (I tried typing it in the command prompt window of my computer - to no avail) Can, anyone, please, help me out here? Thank You in advance.

    Read the article

  • Can a native-looking GUI be made with Python

    - by Matt
    I haven't gotten far enough into Python to make GUIs yet, so I thought I'd ask here. Can a python app be made with the windows default style GUI, or will it have its own style? The only screenshots I've seen of a python app running with a GUI had this ugly win95 look to it.

    Read the article

  • Self documenting REST interface

    - by KandadaBoggu
    I have a Rails based server running several REST services and a Rails based web UI that interacts with the server using ActiveResource. Same server is being used by other clients( e.g: mobile). I have to generate documentation for the REST interface. I need to provide service URL, input/output and error document structure for each service. Ideally, I would like to use an interceptor at the server side that will document the service based on the existing traffic. I am wondering if there is a gem to do this.

    Read the article

  • Javascript Error with DataTable jQuery plugin

    - by stevoyoung
    I am getting a JS error and what to know what it means and how to solve it. (JS noob here) Error: "tId is not defined" Line of JS with error: "if (s[i].sInstance = tId) { " More Information I am using the Data Table (http://datatables.net) jQuery plugin. I have a two tables with a class of "dataTable" loaded on a page (inside of jQuery UI tabs). The tables render as expected but I get the error above in Firebug. Attached is my Data Table config file... $(document).ready(function() { //Take from: http://datatables.net/forums/comments.php?DiscussionID=1507 // before creating a table, make sure it is not already created. // And if it is, then remove old version before new one is created var currTable = $(".dataTable"); if (currTable) { // contains the dataTables master records var s = $(document).dataTableSettings; if (s != 'undefined') { var len = s.length; for (var i=0; i < len; i++) { // if already exists, remove from the array if (s[i].sInstance = tId) { s.splice(i,1); } } } } oTable = $('.dataTable').dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "bFilter": false }); }); What does the error mean and how do I resolve it?

    Read the article

  • Code Organization Connundrum: Web Project With Multiple Supporting DLLs?

    - by Code Sherpa
    Hi. I am trying to get a handle on the best practice for code organization within my project. I have looked around on the internet for good examples and, so far, I have seen examples of a web project with one or multiple supporting class libraries that it references or a web project with sub-folders that follow its namespace conventions. Assuming there is no right answer, this is what I currently have for code organization: MyProjectWeb This is my web site. I am referencing my class libraries here. MyProject.DLL As the base namespace, I am using this DLL for files that need to be generally consumable. For example, my class "Enums" that has all the enumerations in my project lives there. As does class MyProjectException for all exception handling. MyProject.IO.DLL This is a grouping of maybe 20 files that handle file upload and download (so far). MyProject.Utilities.DLL ALl my common classes and methods bunched up together in one generally consumable DLL. Each class follows a "XHelper" convention such as "SqlHelper, AuthHelper, SerializationHelper, and so on... MyProject.Web.DLL I am using this DLL as the main client interface. Right now, the majority of class files here are: 1) properties (such as School, Location, Account, Posts) 2) authorization stuff ( such as custom membership, custom role, & custom profile providers) My question is simply - does this seem logical? Also, how do I avoid having to cross reference DLLs from one project library to the next? For example, MyProject.Web.DLL uses code from MyProject.Utilities.DLL and MyProject.Utilities.DLL uses code from MyProject.DLL. Is this solved by clicking on properties and selecting "Dependencies"? I tried that but still don't seem to be accessing the namespaces of the assembly I have selected. Do I have to reference every assembly I need for each class library? Responses appreciated and thanks for your patience.

    Read the article

  • How to sanely configure security policy in Tomcat 6

    - by Chas Emerick
    I'm using Tomcat 6.0.24, as packaged for Ubuntu Karmic. The default security policy of Ubuntu's Tomcat package is pretty stringent, but appears straightforward. In /var/lib/tomcat6/conf/policy.d, there are a variety of files that establish default policy. Worth noting at the start: I've not changed the stock tomcat install at all -- no new jars into its common lib directory(ies), no server.xml changes, etc. Putting the .war file in the webapps directory is the only deployment action. the web application I'm deploying fails with thousands of access denials under this default policy (as reported to the log thanks to the -Djava.security.debug="access,stack,failure" system property). turning off the security manager entirely results in no errors whatsoever, and proper app functionality What I'd like to do is add an application-specific security policy file to the policy.d directory, which seems to be the recommended practice. I added this to policy.d/100myapp.policy (as a starting point -- I would like to eventually trim back the granted permissions to only what the app actually needs): grant codeBase "file:${catalina.base}/webapps/ROOT.war" { permission java.security.AllPermission; }; grant codeBase "file:${catalina.base}/webapps/ROOT/-" { permission java.security.AllPermission; }; grant codeBase "file:${catalina.base}/webapps/ROOT/WEB-INF/-" { permission java.security.AllPermission; }; grant codeBase "file:${catalina.base}/webapps/ROOT/WEB-INF/lib/-" { permission java.security.AllPermission; }; grant codeBase "file:${catalina.base}/webapps/ROOT/WEB-INF/classes/-" { permission java.security.AllPermission; }; Note the thrashing around attempting to find the right codeBase declaration. I think that's likely my fundamental problem. Anyway, the above (really only the first two grants appear to have any effect) almost works: the thousands of access denials are gone, and I'm left with just one. Relevant stack trace: java.security.AccessControlException: access denied (java.io.FilePermission /var/lib/tomcat6/webapps/ROOT/WEB-INF/classes/com/foo/some-file-here.txt read) java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) java.security.AccessController.checkPermission(AccessController.java:546) java.lang.SecurityManager.checkPermission(SecurityManager.java:532) java.lang.SecurityManager.checkRead(SecurityManager.java:871) java.io.File.exists(File.java:731) org.apache.naming.resources.FileDirContext.file(FileDirContext.java:785) org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:206) org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:299) org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1937) org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:973) org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1108) java.lang.ClassLoader.getResource(ClassLoader.java:973) I'm pretty convinced that the actual file that's triggering the denial is irrelevant -- it's just some properties file that we check for optional configuration parameters. What's interesting is that: it doesn't exist in this context the fact that the file doesn't exist ends up throwing a security exception, rather than java.io.File.exists() simply returning false (although I suppose that's just a matter of the semantics of the read permission). Another workaround (besides just disabling the security manager in tomcat) is to add an open-ended permission to my policy file: grant { permission java.security.AllPermission; }; I presume this is functionally equivalent to turning off the security manager. I suppose I must be getting the codeBase declaration in my grants subtly wrong, but I'm not seeing it at the moment.

    Read the article

  • Doctrine: Unknown table alias. Is this DQL correct?

    - by ropstah
    I'm trying to execute a query but I get an error: Unknown table alias The tables are setup as follows: Template_Spot hasOne Template Template hasMany Template_Spot Template hasMany Location Location hasOne Template I'm trying to execute the following DQL: $locationid = 1; $spots = Doctrine_Query::create() ->select('cts.*, ct.*, uc.*') ->from('Template_Spot cts') ->innerJoin('Template ct') ->innerJoin('Location uc') ->where('uc.locationid = ?', $locationid)->execute(); Does anyone spot a problem?

    Read the article

  • UINavigationController creating a blank view out of thin air?

    - by Alex Gosselin
    Ok, this one is really weird... I can't show code for it exactly cause it follows a pretty snake-like pattern through subclasses etc, there would be a pile of it. The important parts are that I push a view controller, which during viewWillAppear pushes another view controller onto the nav controller. My nav controller is an item in a tab bar. When I press back twice, I wind up at a blank view with the same title as my root view controller, (I have no other views having this title). I even tested and put a NSLog() in viewWillAppear to make sure it was the same view appearing, but for some reason the mystery blank view is showing up instead of my view. I am able to get the original view back by pressing the button on the tab bar again. (The one that corresponds to the nav controller). This confuses me greatly, so any help would be appreciated. I will post code if somebody could narrow down what code to put. Thanks.

    Read the article

  • how to run javascript from c# code ?

    - by dotnetcoder
    I have a webrequest that returns a html response which has form inside with hidden fields with some javascript that submits the form automatically on pageload ( if this was run in a browser). If I save this file as *.html and run this file in browser , the java script code automatically posts the form and the output is excel file. I want to be able to generate this file from a c# code which is not running in broswer. I tried mocking thr form post but its complicated and has various scenarios based on the original webrequest querystring. any pointers.... i know its not possible to probably run JS code that posts the form - from within c# code but still thought of chekcing if someone has done that.

    Read the article

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