Search Results

Search found 38 results on 2 pages for 'lachlan roche'.

Page 1/2 | 1 2  | Next Page >

  • Rails solution for mobile-specific content filter?

    - by Damien Roche
    To note, I'm not interested in simply 'hiding' content for mobile devices, I want to filter out that content completely. I'm also not trying to address the issue by building a mobile specific interface (mob.example.com). There was another question regarding something similar: How do I prevent useless content load on the page in responsive design? The solution, in that post, was to set a session during the initial request, and then use the session to filter content on subsequent requests. I primarily develop in Rails, and I'm wondering if there are any gems or ruby-specific solutions to this problem?

    Read the article

  • powershell errors on remove-item command

    - by Lachlan
    Hi, I've written a powershell script which removes folders more than 7 days old. It seems to be removing the folders, but for some reason its giving me errors. I was wondering if anyone might be able to tell me why? The script is... $rootBackupFolder = "\server\share" get-childitem $rootBackupFolder | where {$.PSIsContainer -AND $.Name -match ("^CVSRepository_(19|20)[0-9]0-9(0[1-9]|[12][0-9]|3[01])$") -AND $_.LastWriteTime -le (Get-Date).AddDays(-7)} | remove-item -recurse -force Their are 2 errors I get, this first is this one... (Get-Date).AddDays(-7)} | remove-item <<<< -recurse -force Remove-Item : Cannot remove item \server\share\CVSRepository_20100305\somesubfolder\sumotherfolder: Could not find a part of the path '\server\share\CVSRepository_20100305\somesubfolder\sumotherfolder'. The other error is this... (Get-Date).AddDays(-7)} | remove-item <<<< -recurse -force Remove-Item : Cannot remove item \server\share\CVSRepository_2010031 2\somesubfolder\: Access to the path 'Rdl' is denied.At C:\CVSRepository_BackupScript\Backup.ps1:43 char:38+ (Get-Date).AddDays(-7)} | remove-item <<<< -recurse -force Any ideas? The script is running under a domain account which has privs to delete the remote folders. And in fact it is indeed deleting the folders! But giving me errors... Thanks, Lachlan

    Read the article

  • Openfire on EC2 with Jingle

    - by Bjorn Roche
    I would like to run Openfire (or another XMPP server) on EC2. At the moment this is just for testing, so easy setup and configuration are important, as is low cost. At some point, however, if things go well, it will be important to scale this. Ideally, it would be nice to not have to switch software when the scaling happens, but if a switch needs to happen later it certainly can. My requirements are: basic XMPP services, including muc and pubsub. Logins controlled from an external API. Preferably, when a user attempts to connect, the XMPP server checks with the api to see if their username and password are correct, but I can also have the API keep the XMPP server up to date on new users, deleted users, pasword changes and so on. I see Openfire has a "user service" API. Not ideal, but it looks workable. Jingle, including relay and STUN. It's not at all clear to me if the Jingle Nodes plugin takes care of this. I'm a bit confused about what's required to set this up, and I'd rather know in advance than be confused along the way :). eg It seems like STUN servers require more than one IP address. Can Openfire do all this for me, including stun and media relay on a single machine? Is this hard to configure on EC2 with Openfire? What are the basic steps? Would this be easier with something else like, say Tigase? What about database? Should I use amazon's database service, or run a db on the same machine? Would the server be compatible with a service like http://www.siteuptime.com/ Thanks!

    Read the article

  • What is the meaning of the two different recording icons used in Windows 7 Media Center?

    - by Lachlan Wetherall
    I am using Windows 7 Media Center with a digital TV tuner. If I am watching live TV and then use the mouse to bring up the control buttons at the bottom of the screen and press the record button once, then a single red circle 'recording' icon appears at the left side of the time slider. If I press the record button a second time, the 'recording' icon changes to a red circle with several shadowed circles fading off to the right. Pressing the record button a third time halts the recording. What is the meaning of the two different 'recording' icons?

    Read the article

  • Software for measuring internet traffic?

    - by Lachlan McDonald
    I'm interested in finding a free piece of software for Windows XP & 7 that allows us to measure both incoming and outgoing internet traffic, but not traffic between users of the local network. I live in a shared household with three others, and we're interested to see which of us is using the largest amount of our monthly internet quota. We're all happy to install the necessary software. Any suggestions?

    Read the article

  • Repairing Damage to VMWare Virtual Disk

    - by Lachlan McDonald
    Evening all, I've got a considerable problem I'm hoping to get some resolution on. I had two VMWare 6.5 virtual machines, one running Ubuntu 9.10 and the other Ubuntu 10.04. I used 9.10 as a testing server, so I could install a LAMP environment to prepare some code. Over the months I took a number of snapshots of this VM just in case something went wrong, and did a full copy of the entire VM a month ago. I created the 10.04 VM when Lucid Lynx launched so I could continue development on a fresh install. To get the files over, I simply added the 9.10 virtual disk into the 10.04 VM, grabbed some of the files I needed, and dismounted it. Unknown to me at the time, the changes to the 9.04 virtual disk meant that I could no longer boot it with the 9.10 VM. I'd always get the "The parent virtual disk has been modified since the child was created." error. I decided this was a good time to backup all the critical files, but now whenever I open the 9.04 disk to get the data it isn't in the same state as it was earlier. My question is; is it possible when I'm mounting the virtual disk that I'm not seeing the most recent snapshot, or in my blundering, have I lost the virtual disk. Cheers

    Read the article

  • Handling inconcistent resource availability in Project 2007

    - by Lachlan McDonald
    Afternoon all, I have four resources; a project manager, and three developers. The project manager can work anywhere from 9 to 5pm each day, but only for a total of 10 hours per week. It doesn't matter when he works, as long as he isn't over-allocated 10 hours per week. The developers on the other hand can only work up to 2 hours per day, for a total of 10 hours per week. If they work more than 2 hours in a day, they are over-allocated. How do I best configure Project to handle this kind of scheduling requirement?

    Read the article

  • Missing Data on VMWare Virtual Disk

    - by Lachlan McDonald
    Evening all, I've got a considerable problem I'm hoping to get some resolution on. I had two VMWare 6.5 virtual machines, one running Ubuntu 9.10 and the other Ubuntu 10.04. I used 9.10 as a testing server, so I could install a LAMP environment to prepare some code. Over the months I took a number of snapshots of this VM just in case something went wrong, and did a full copy of the entire VM a month ago. I created the 10.04 VM when Lucid Lynx launched so I could continue development on a fresh install. To get the files over, I simply added the 9.10 virtual disk into the 10.04 VM, grabbed some of the files I needed, and dismounted it. Unknown to me at the time, the changes to the 9.04 virtual disk meant that I could no longer boot it with the 9.10 VM. I'd always get the "The parent virtual disk has been modified since the child was created." error. I decided this was a good time to backup all the critical files, but now whenever I open the 9.04 disk to get the data it isn't in the same state as it was earlier. My question is; is it possible when I'm mounting the virtual disk that I'm not seeing the most recent snapshot, or in my blundering, have I lost the virtual disk. Cheers

    Read the article

  • How to embed PDF in a web page using Acrobat Reader instead of Acrobat.

    - by Lachlan Roche
    I have a pdf form that uses Acrobat 8 features. The form contains Javascript that interacts with the hosting web page. Some of my Windows users have both Adobe Acrobat and Acrobat Reader installed, and need Adobe Acrobat to be the default handler for pdf files. The users with Adobe Acrobat 7 are unable to use the form, even though they might have Acrobat Reader 8 or 9 installed. Currently, the PDF is embedded like this: <object id="host" data="/path/to/document.pdf" type="application/pdf" width="900" height="550" ></object>

    Read the article

  • FreeType2 Bitmap to System::Drawing::Bitmap.

    - by Dennis Roche
    Hi, I'm trying to convert a FreeType2 bitmap to a System::Drawing::Bitmap in C++/CLI. FT_Bitmap has a unsigned char* buffer that contains the data to write. I have got somewhat working save it disk as a *.tga, but when saving as *.bmp it renders incorrectly. I believe that the size of byte[] is incorrect and that my data is truncated. Any hints/tips/ideas on what is going on here would be greatly appreciated. Links to articles explaining byte layout and pixel formats etc. would be helpful. Thanks!! C++/CLI code. FT_Bitmap *bitmap = &face->glyph->bitmap; int width = (face->bitmap->metrics.width / 64); int height = (face->bitmap->metrics.height / 64); // must be aligned on a 32 bit boundary or 4 bytes int depth = 8; int stride = ((width * depth + 31) & ~31) >> 3; int bytes = (int)(stride * height); // as *.tga void *buffer = bytes ? malloc(bytes) : NULL; if (buffer) { memset(buffer, 0, bytes); for (int i = 0; i < glyph->rows; ++i) memcpy((char *)buffer + (i * width), glyph->buffer + (i * glyph->pitch), glyph->pitch); WriteTGA("Test.tga", buffer, width, height); } array<Byte>^ values = gcnew array<Byte>(bytes); Marshal::Copy((IntPtr)glyph->buffer, values, 0, bytes); // as *.bmp Bitmap^ systemBitmap = gcnew Bitmap(width, height, PixelFormat::Format24bppRgb); // create bitmap data, lock pixels to be written. BitmapData^ bitmapData = systemBitmap->LockBits(Rectangle(0, 0, width, height), ImageLockMode::WriteOnly, bitmap->PixelFormat); Marshal::Copy(values, 0, bitmapData->Scan0, bytes); systemBitmap->UnlockBits(bitmapData); systemBitmap->Save("Test.bmp"); Reference, FT_Bitmap typedef struct FT_Bitmap_ { int rows; int width; int pitch; unsigned char* buffer; short num_grays; char pixel_mode; char palette_mode; void* palette; } FT_Bitmap; Reference, WriteTGA bool WriteTGA(const char *filename, void *pxl, uint16 width, uint16 height) { FILE *fp = NULL; fopen_s(&fp, filename, "wb"); if (fp) { TGAHeader header; memset(&header, 0, sizeof(TGAHeader)); header.imageType = 3; header.width = width; header.height = height; header.depth = 8; header.descriptor = 0x20; fwrite(&header, sizeof(header), 1, fp); fwrite(pxl, sizeof(uint8) * width * height, 1, fp); fclose(fp); return true; } return false; }

    Read the article

  • unsigned char* buffer (FreeType2 Bitmap) to System::Drawing::Bitmap.

    - by Dennis Roche
    Hi, I'm trying to convert a FreeType2 bitmap to a System::Drawing::Bitmap in C++/CLI. FT_Bitmap has a unsigned char* buffer that contains the data to write. I have got somewhat working save it disk as a *.tga, but when saving as *.bmp it renders incorrectly. I believe that the size of byte[] is incorrect and that my data is truncated. Any hints/tips/ideas on what is going on here would be greatly appreciated. Links to articles explaining byte layout and pixel formats etc. would be helpful. Thanks!! C++/CLI code. FT_Bitmap *bitmap = &face->glyph->bitmap; int width = (face->bitmap->metrics.width / 64); int height = (face->bitmap->metrics.height / 64); // must be aligned on a 32 bit boundary or 4 bytes int depth = 8; int stride = ((width * depth + 31) & ~31) >> 3; int bytes = (int)(stride * height); // as *.tga void *buffer = bytes ? malloc(bytes) : NULL; if (buffer) { memset(buffer, 0, bytes); for (int i = 0; i < glyph->rows; ++i) memcpy((char *)buffer + (i * width), glyph->buffer + (i * glyph->pitch), glyph->pitch); WriteTGA("Test.tga", buffer, width, height); } // as *.bmp array<Byte>^ values = gcnew array<Byte>(bytes); Marshal::Copy((IntPtr)glyph->buffer, values, 0, bytes); Bitmap^ systemBitmap = gcnew Bitmap(width, height, PixelFormat::Format24bppRgb); // create bitmap data, lock pixels to be written. BitmapData^ bitmapData = systemBitmap->LockBits(Rectangle(0, 0, width, height), ImageLockMode::WriteOnly, bitmap->PixelFormat); Marshal::Copy(values, 0, bitmapData->Scan0, bytes); systemBitmap->UnlockBits(bitmapData); systemBitmap->Save("Test.bmp"); Reference, FT_Bitmap typedef struct FT_Bitmap_ { int rows; int width; int pitch; unsigned char* buffer; short num_grays; char pixel_mode; char palette_mode; void* palette; } FT_Bitmap; Reference, WriteTGA bool WriteTGA(const char *filename, void *pxl, uint16 width, uint16 height) { FILE *fp = NULL; fopen_s(&fp, filename, "wb"); if (fp) { TGAHeader header; memset(&header, 0, sizeof(TGAHeader)); header.imageType = 3; header.width = width; header.height = height; header.depth = 8; header.descriptor = 0x20; fwrite(&header, sizeof(header), 1, fp); fwrite(pxl, sizeof(uint8) * width * height, 1, fp); fclose(fp); return true; } return false; } Update FT_Bitmap *bitmap = &face->glyph->bitmap; // stride must be aligned on a 32 bit boundary or 4 bytes int depth = 8; int stride = ((width * depth + 31) & ~31) >> 3; int bytes = (int)(stride * height); target = gcnew Bitmap(width, height, PixelFormat::Format8bppIndexed); // create bitmap data, lock pixels to be written. BitmapData^ bitmapData = target->LockBits(Rectangle(0, 0, width, height), ImageLockMode::WriteOnly, target->PixelFormat); array<Byte>^ values = gcnew array<Byte>(bytes); Marshal::Copy((IntPtr)bitmap->buffer, values, 0, bytes); Marshal::Copy(values, 0, bitmapData->Scan0, bytes); target->UnlockBits(bitmapData);

    Read the article

  • My jquery cookies are not resetting, even though am using the correct code.

    - by Adam Libonatti-Roche
    My problem is that I am trying to reset some form cookies so when someone has completed their form, they are reset so it is possible for someone else to complete the form. Simple and obvious. But However many different lines of code I put in, the cookies just do not seem to be disappearing. I am using the remember function from the site below: Komodo Media So the details stay when they move away from the page: the code i have for the page starting is as follows: <script type="text/javascript"> function remember( selector ){ $(selector).each( function(){ //if this item has been cookied, restore it var name = $(this).attr('name'); if( $.cookie( name ) ){ if( $(this).is(':checkbox') ){ $(this).attr('checked',$.cookie( name )); }else{ $(this).val( $.cookie(name) ); } } //assign a change function to the item to cookie it $(this).change( function(){ if( $(this).is(':checkbox') ){ $.cookie(name, $(this).attr('checked'), { path: '/', expires: 1 }); }else{ $.cookie(''+name+'', $(this).val(), { path: '/', expires: 1 }); } }); }); } // JQUERY FOR THIS PAGE $(document).ready( function(){ remember("[name=username]"); remember("[name=firstname]"); remember("[name=lastname]"); remember("[name=email]"); remember("[name=password]"); remember("[name=address1]"); remember("[name=address2]"); remember("[name=postcode]"); remember("[name=country]"); } ); </script> And the code for resetting them is simple enough, as it takes the cookie name and sets it to null. However, this does not work as on returning to the form, all fields from before are still there. Any help with this would be brilliant.

    Read the article

  • Updating MS Access Database from Datagridview

    - by Peter Roche
    I am trying to update an ms access database from a datagridview. The datagridview is populated on a button click and the database is updated when any cell is modified. The code example I have been using populates on form load and uses the cellendedit event. private OleDbConnection connection = null; private OleDbDataAdapter dataadapter = null; private DataSet ds = null; private void Form2_Load(object sender, EventArgs e) { string connetionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\\Users\\Peter\\Documents\\Visual Studio 2010\\Projects\\StockIT\\StockIT\\bin\\Debug\\StockManagement.accdb';Persist Security Info=True;Jet OLEDB:Database Password="; string sql = "SELECT * FROM StockCount"; connection = new OleDbConnection(connetionString); dataadapter = new OleDbDataAdapter(sql, connection); ds = new DataSet(); connection.Open(); dataadapter.Fill(ds, "Stock"); connection.Close(); dataGridView1.DataSource = ds; dataGridView1.DataMember = "Stock"; } private void addUpadateButton_Click(object sender, EventArgs e) { } private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { try { dataadapter.Update(ds,"Stock"); } catch (Exception exceptionObj) { MessageBox.Show(exceptionObj.Message.ToString()); } } The error I receive is Update requires a valid UpdateCommand when passed DataRow collection with modified rows. I'm not sure where this command needs to go and how to reference the cell to update the value in the database.

    Read the article

  • How can I define a clojure type that implements the servlet interface?

    - by Rob Lachlan
    I'm attempting to use deftype (from the bleeding-edge clojure 1.2 branch) to create a java class that implements the java Servlet interface. I would expect the code below to compile (even though it's not very useful). (ns foo [:import [javax.servlet Servlet ServletRequest ServletResponse]]) (deftype servlet [] javax.servlet.Servlet (service [this #^javax.servlet.ServletRequest request #^javax.servlet.ServletResponse response] nil)) But it doesn't compile. The compiler produces the message: Mismatched return type: service, expected: void, had: java.lang.Object [Thrown class java.lang.IllegalArgumentException] Which doesn't make sense to me, because I'm returning nil. So the fact that the return type of the method is void shouldn't be a problem. For instance, for the java.util.Set interface: (deftype bar [#^Number n] java.util.Set (clear [this] nil)) compiles without issue. So what am I doing wrong with the Servlet interface? To be clear: I know that the typical case is to subclass one of the servlet abstract classes rather than implement this interface directly, but it should still be possible to do this. Stack Trace: The stack trace for the (deftype servlet... is: Mismatched return type: service, expected: void, had: java.lang.Object [Thrown class java.lang.IllegalArgumentException] Restarts: 0: [ABORT] Return to SLIME's top level. Backtrace: 0: clojure.lang.Compiler$NewInstanceMethod.parse(Compiler.java:6461) 1: clojure.lang.Compiler$NewInstanceExpr.build(Compiler.java:6119) 2: clojure.lang.Compiler$NewInstanceExpr$DeftypeParser.parse(Compiler.java:6003) 3: clojure.lang.Compiler.analyzeSeq(Compiler.java:5289) 4: clojure.lang.Compiler.analyze(Compiler.java:5110) 5: clojure.lang.Compiler.analyze(Compiler.java:5071) 6: clojure.lang.Compiler.eval(Compiler.java:5347) 7: clojure.lang.Compiler.eval(Compiler.java:5334) 8: clojure.lang.Compiler.eval(Compiler.java:5311) 9: clojure.core$eval__4350.invoke(core.clj:2364) 10: swank.commands.basic$eval_region__673.invoke(basic.clj:40) 11: swank.commands.basic$eval_region__673.invoke(basic.clj:31) 12: swank.commands.basic$eval__686$listener_eval__687.invoke(basic.clj:54) 13: clojure.lang.Var.invoke(Var.java:365) 14: foo$eval__2285.invoke(NO_SOURCE_FILE) 15: clojure.lang.Compiler.eval(Compiler.java:5343) 16: clojure.lang.Compiler.eval(Compiler.java:5311) 17: clojure.core$eval__4350.invoke(core.clj:2364) 18: swank.core$eval_in_emacs_package__320.invoke(core.clj:59) 19: swank.core$eval_for_emacs__383.invoke(core.clj:128) 20: clojure.lang.Var.invoke(Var.java:373) 21: clojure.lang.AFn.applyToHelper(AFn.java:169) 22: clojure.lang.Var.applyTo(Var.java:482) 23: clojure.core$apply__3776.invoke(core.clj:535) 24: swank.core$eval_from_control__322.invoke(core.clj:66) 25: swank.core$eval_loop__324.invoke(core.clj:71) 26: swank.core$spawn_repl_thread__434$fn__464$fn__465.invoke(core.clj:183) 27: clojure.lang.AFn.applyToHelper(AFn.java:159) 28: clojure.lang.AFn.applyTo(AFn.java:151) 29: clojure.core$apply__3776.invoke(core.clj:535) 30: swank.core$spawn_repl_thread__434$fn__464.doInvoke(core.clj:180) 31: clojure.lang.RestFn.invoke(RestFn.java:398) 32: clojure.lang.AFn.run(AFn.java:24) 33: java.lang.Thread.run(Thread.java:637)

    Read the article

  • Binding multiple events in jQuery

    - by Lachlan McDonald
    I have a custom jQuery plugin which binds a change event to a form element, in this case some input elements. The change event is used to indicate to some other components that a change has taken place. This works as it should. However, I've come across the need to bind an additional change event to the same input elements -- so that additional components can act on the event. I don't wish to replace the plugin's change, simply run an additional function afterwards. Is there any way to bind multiple events in jQuery, or, what is the best method for accomplishing this?

    Read the article

  • How should one import large amounts of data for FIT/Fitnesse tests?

    - by Lachlan
    We have a scheduling engine with large amounts of test data to test all the scenarios, so test automation is critical. We're currently hoping to use FIT/Fitnesse. However a single test has quite a large table of test data, so it doesn't fit very well into the mould of "two or three inputs, one or more outputs" that Fitnesse uses in its examples. Hopefully the other functionality of Fitnesse makes it worth using it. I hear that there is a way to initialize an application for a FIT test with an Excel spreadsheet - not the Spreadsheet to Fitness function, mind you - but I haven't been able to find it so far. Once the whole spreadsheet is loaded into the application, and the application does its thing, we plan to compare either a number of output rows, or perhaps just the last row, to see if the test passes. The application is currently pulling test data from a database for manual tests, but writing to a database, then initializing from it, is not preferred because of the performance impact. The application is written in C#.

    Read the article

  • Java LockSupport Memory Consistency

    - by Lachlan
    Java 6 API question. Does calling LockSupport.unpark(thread) have a happens-before relationship to the return from LockSupport.park in the just-unparked thread? I strongly suspect the answer is yes, but the Javadoc doesn't seem to mention it explicitly.

    Read the article

  • Displaying single-instance business object data on SSRS

    - by Lachlan
    I have a SQL Server Reporting Services local (i.e. RDLC) report displayed in a ReportViewer, with two subreports. I am using business objects to populate the datasets. What is the best way to populate single-instance data on my report, e.g. a dynamic title, or a text box that lists a calculated value, not based on the report data? I am currently displaying data using the following style: public class MyRecordList { string Name { get; set; } List<MyRecord> Records { get; set;} } public MyRecord { string Description { get; set;} string Value { get; set;} } I set the datasource to the Records in an instance of MyRecordsList, and they print out find in a table. But adding a textbox and and referring to Name displays nothing. I also tried turning Name into a List, and referring to the first in the list, using: =First(Fields!Name.Value, "Report1_MyRecordList") but still nothing is printed on the report.

    Read the article

  • Avoiding symbol capture when using macros to generate functions (or other macros)

    - by Rob Lachlan
    I'm a bit confused as to exactly when symbol capture will occur with clojure macros. Suppose that I have a macro which defines a function from keywords. In this trivial example, (defmacro foo [keywd1 keywd2] `(defn ~(symbol (name keywd1)) [~(symbol (name keywd2))] (* 2 ~(symbol (name keywd2))))) I call (foo :bar :baz), and this gets expanded into (defn bar [baz] (* 2 baz)). So now the question -- can this lead to symbol capture? If so, under what circumstances? I know that it's preferred to use gensym (e.g. bar#) to prevent symbol capture, but in some cases (not many, but still) I'd like to have a pretty macro-expansion, without the auto-generated symbols. Bonus question: does the answer change if we are considering a macro that creates macros?

    Read the article

  • Creating GUI desktop applications that call into either OCaml or Haskell -- Is it a fool's errand?

    - by Rob Lachlan
    In both Haskell and OCaml, it's possible to call into the language from C programs. How feasible would it be to create Native applications for either Windows, Mac, or Linux which made extensive use of this technique? (I know that there are GUI libraries like wxHaskell, but suppose one wanted to just have a portion of your application logic in the foreign language.) Or is this a terrible idea?

    Read the article

1 2  | Next Page >