Search Results

Search found 1494 results on 60 pages for 'tim kersten'.

Page 45/60 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Options for header in raw byte file.

    - by Tim
    I have a large raw data file (up to 1GB) which contains raw samples from a USB data logger. I need to store extra information relating to the file (sample rate, description, trigger point, last seek position etc) and was looking into adding this as a some sort of header. The header file should ideally be human readable and flexible so I've so far ruled out some sort of binary serialization into a header. I also want to avoid two separate files as they could end up separated when copied or backed up. I remembered somebody telling me that newer *.*x Microsoft Office documents are actually a number of files in a zip. Is there a simple way to achieve this? Could I still keep the quick seek times to the raw file?

    Read the article

  • DRY way of calling a method in every rails model

    - by Tim
    Along the same lines as this question, I want to call acts_as_reportable inside every model so I can do one-off manual reports in the console in my dev environment (with a dump of the production data). What's the best way to do this? Putting acts_as_reportable if ENV['RAILS_ENV'] == "development" in every model is getting tedious and isn't very DRY at all. Everyone says monkey patching is the devil, but a mixin seems overkill. Thanks!

    Read the article

  • getting started with Google Closure if you don't compare about minifying/compiling?

    - by Tim
    If you don't care about minifying your code, is there a way to get started using the Google Closure library without having to set up a subversion client and use the compiler? The Notepad sample program on Google's website refers to <script src="closure-library/base.js" > </script > Can you simply download closure-library/base.js somewhere and start playing with the UI examples? The Closure Lite quick-start version doesn't appear to include goog.ui

    Read the article

  • User authentication in Django. Problems with is_authenticated

    - by tim
    I have one problem with users menu. So, I want, that authenticated user can see his/her profile page and logout (links) in menu. It works (when I logging in) on index page: index, page1, profile, logout ,but, if I go to the, for example, page1 I can see in menu: index, page1, login, not profile and logout. How to fix it? in urls: url(r'^accounts/login/$', 'django.contrib.auth.views.login' ), url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login' ), url(r'^accounts/profile/$', 'my_app.views.profile' ), in views: def profile(request): if not request.user.is_authenticated(): return HttpResponseRedirect("/accounts/login/") else: user = request.user.is_authenticated() return render_to_response('profile.html',locals()) Part of index.html: {% if user.is_authenticated or request.user.is_authenticated %} <li><a href="/accounts/profile/">Profile</a></li> <li><a href="/accounts/logout/">logout</a></li> {% else %} <li><a href="/accounts/login/">login</a></li> {% endif %} login.html: {% extends "index.html" %} {% load url from future %} {% block application %} {% if form.errors %} <p>Try one more time</p> {% endif %} <form method="post" action="{% url 'django.contrib.auth.views.login' %}"> {% csrf_token %} <table> <tr> <td>{{ form.username.label_tag }}</td> <td>{{ form.username }}</td> </tr> <tr> <td>{{ form.password.label_tag }}</td> <td>{{ form.password }}</td> </tr> </table> <input type="submit" value="Login" /> <input type="hidden" name="next" value="{{ next }}" /> </form> {% endblock %} profile.html: {% extends "index.html" %} {% block application %} {% if request.user.is_authenticated %} <p>Welcome, {{ request.user.username }}. Thanks for logging in.</p> {% else %} <p>Welcome, new user. Please log in.</p> {% endif %} {% endblock %}

    Read the article

  • Default controller name is removed on browser refresh (CodeigniterPHP/Nginx issue?)

    - by tim peterson
    For all pages in my codeigniter app except my default controller, when I refresh the browser the url isn't affected as one would expect. However for my default controller, main.php, when when I refresh the browser at "http://localhost/main" or "http://mysite.com/main", the main part is stripped off the url. So the browser bar shows just "http://localhost" or "http://mysite.com". Totally lost on where to start with this but was just wondering if anyone has come across this before...? Here's what I think could be the relevant part of my nginx.conf (if Nginx is the problem). if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$) { rewrite ^(.*)$ / permanent; }

    Read the article

  • using .NET how to convert iso8859-1 encoded text files that contain Latin-1 accented characters to u

    - by Tim
    I am being sent text files saved in iso88591-1 format that contain accented characters from the Latin-1 range (as well as normal ASCII a-z etc). How to convert these files to utf-8 using C# so that the single-byte accented characters in iso8859-1 become valid utf-8 characters? I have tried to use a StreamReader with ASCIIEncoding, and then converting the ascii string to UTF-8 by instantiating an ascii encoding and a utf8 encoding and then using Encoding.Convert(ascii, utf8, ascii.GetBytes( asciiString) ) — but the accented characters are being rendered as question marks. What step am I missing?

    Read the article

  • Querying a perimeter around a Geocode-Location (Lat/Lon)

    - by Tim
    Hi, how can I search for geo-objects in a certain perimeter ? E.g. I have several objects with Lat/Lon coordinates stored in my DB. Now I want to retrieve all the objects which lie in a specific perimeter (10 miles or 20 miles) around a given point. I guess what I would have to do is to form some query like: SELECT * FROM objects o where o.lat < (myPositionLat+x) AND o.lon < (myPositionLon+y) Is this right? How do I determine/set the values for x and y?

    Read the article

  • List and Remove directories in an archive

    - by Tim
    I wonder how to list the content and remove some directories in an archive file? For example, I have an archive file data.tar. I would like to list its content without extracting it. I also would like to remove some directories inside it matching "*/count1000" Thanks and regards!

    Read the article

  • text watermark on website? how to do it?

    - by Tim
    I am a C++/C# developer and never spent time working on web pages. I would like to put text (randomly and diagonally perhaps) in large letters across the background of some pages. I want to be able to read the foreground text and also be able to read the "watermark". I understand that is probably more of a function of color selection. I have been unsuccessful in my attempts to do what I want. I would imagine this to be very simple for someone with the web design tools or html knowledge. Any links or sample code? Thanks

    Read the article

  • Bulk Compare, Report, Update

    - by Tim Donaldon
    I need to import either csv or excel file into a dbase. The column headers will match but I will want to compare the file against the dbase using an ItemID field, list the rows to be affected and the differences, then allow an update to all the rows with the matching ID.

    Read the article

  • Match Anything Except a Sub-pattern

    - by Tim Lytle
    I'd like to accomplish what this (invalid I believe) regular expression tries to do: <p><a>([^(<\/a>)]+?)<\/a></p>uniquestring Essentially match anything except a closing anchor tag. Simple non-greedy doesn't help here because `uniquestring' may very well be after another distant closing anchor tag: <p><a>text I don't <tag>want</tag> to match</a></p>random data<p><a>text I do <tag>want to</tag> match</a></p>uniquestring more matches <p><a>of <tag>text I do</tag> want to match</a></p>uniquestring So I have more tag in between the anchor tags. And I'm using the presence of uniquestring to determine if I want to match the data. So a simple non-greedy ends up matching everything from the start of the data I don't want to the end of the data I do want. I know I'm edging close to the problems regular expressions (or at least my knowledge of them) aren't good at solving. I could just through the data at an HTML/XML parser, but it is just one simple(ish) search. Is there some easy way to do this that I'm just missing?

    Read the article

  • Number of elements in Python Set

    - by Tim
    I have a list of phone numbers that have been dialed (nums_dialed). I also have a set of phone numbers which are the number in a client's office (client_nums) How do I efficiently figure out how many times I've called a particular client (total) For example: >>>nums_dialed=[1,2,2,3,3] >>>client_nums=set([2,3]) >>>??? total=4 Problem is that I have a large-ish dataset: len(client_nums) ~ 10^5; and len(nums_dialed) ~10^3.

    Read the article

  • ??? Error using ==> dlmread at 55 Filename must be a string.

    - by Tim
    [file_input, pathname] = uigetfile( ... {'*.txt', 'Text (*.txt)'; ... '*.xls', 'Excel (*.xls)'; ... '*.*', 'All Files (*.*)'}, ... 'Select files'); D = uiimport(file_input); M = dlmread(D); X = freed(M); Getting errors with dlmread......"??? Error using == dlmread at 55 Filename must be a string."..need to get the data from dlmread to "freed"

    Read the article

  • PHP5: restrict access to function to certain classes

    - by Tim
    Is there a way in PHP5 to only allow a certain class or set of classes to call a particular function? For example, let's say I have three classes ("Foo", "Bar", and "Baz"), all with similarly-named methods, and I want Bar to be able to call Foo::foo() but deny Baz the ability to make that call: class Foo { static function foo() { print "foo"; } } class Bar { static function bar() { Foo::foo(); print "bar"; } // Should work } class Baz { static function baz() { Foo::foo; print "baz"; } // Should fail } Foo::foo(); // Should also fail There's not necessarily inheritance between Foo, Bar, and Baz, so the use of protected or similar modifiers won't help; however, the methods aren't necessarily static (I made them so here for the simplicity of the example).

    Read the article

  • Same dll-version different on different computers?

    - by Tim
    Hello, i have a strange problem with a VB.Net Windows Application. On my computer(the development PC) it executes the newest version of the exe and dll's but on the computer of my fellow(he is not a developer and cant debug it) an older version is executed. He has overwritten all files with the new version: I dont know where to start looking for the reason.

    Read the article

  • Should a protected property in a C# child class hide access to a public property on the parent?

    - by Tim
    I have the following code: public class Parent { public string MyField { get; set; } } public class Child : Parent { protected new int MyField { get; set; } } I try and access this with: static void Main(string[] args) { Child child = new Child(); child.MyField = "something"; } Visual studio 2008 compiles this without comment, but under Mono (2.4.2, Ubuntu) I get the error message 'HideTest.Child.MyField' is inaccessible due to its protection level (CS0122) Is one implementation or the other more compliant with the standard here?

    Read the article

  • VB.NET logical expression evaluator

    - by Tim
    I need to test a logical expression held in a string to see if it evaluate to TRUE or FALSE.(the strig is built dynamically) For example the resulting string may contain "'dog'<'cat' OR (14 AND 4<6)". There are no variables in the string, it will logically evaluate. It will only contain simple operators = < < = <= and AND , OR and Open and Close Brackets, string constants and numbers. (converted to correct syntax && || etc.) I currently acheive this by creating a jscipt function and compiling it into a .dll. I then reference the .dll in my VB.NET project. class ExpressionEvaluator { function Evaluate(Expression : String) { return eval(Expression); } } Is there a simpler method using built in .NET functions or Lamdba expressions.

    Read the article

  • Are comonads a good fit for modeling the Wumpus world?

    - by Tim Stewart
    I'm trying to find some practical applications of a comonad and I thought I'd try to see if I could represent the classical Wumpus world as a comonad. I'd like to use this code to allow the Wumpus to move left and right through the world and clean up dirty tiles and avoid pits. It seems that the only comonad function that's useful is extract (to get the current tile) and that moving around and cleaning tiles would not use be able to make use of extend or duplicate. I'm not sure comonads are a good fit but I've seen a talk (Dominic Orchard: A Notation for Comonads) where comonads were used to model a cursor in a two-dimensional matrix. If a comonad is a good way of representing the Wumpus world, could you please show where my code is wrong? If it's wrong, could you please suggest a simple application of comonads? module Wumpus where -- Incomplete model of a world inhabited by a Wumpus who likes a nice -- tidy world but does not like falling in pits. import Control.Comonad -- The Wumpus world is made up of tiles that can be in one of three -- states. data Tile = Clean | Dirty | Pit deriving (Show, Eq) -- The Wumpus world is a one dimensional array partitioned into three -- values: the tiles to the left of the Wumpus, the tile occupied by -- the Wumpus, and the tiles to the right of the Wumpus. data World a = World [a] a [a] deriving (Show, Eq) -- Applies a function to every tile in the world instance Functor World where fmap f (World as b cs) = World (fmap f as) (f b) (fmap f cs) -- The Wumpus world is a Comonad instance Comonad World where -- get the part of the world the Wumpus currently occupies extract (World _ b _) = b -- not sure what this means in the Wumpus world. This type checks -- but does not make sense to me. extend f w@(World as b cs) = World (map world as) (f w) (map world cs) where world v = f (World [] v []) -- returns a world in which the Wumpus has either 1) moved one tile to -- the left or 2) stayed in the same place if the Wumpus could not move -- to the left. moveLeft :: World a -> World a moveLeft w@(World [] _ _) = w moveLeft (World as b cs) = World (init as) (last as) (b:cs) -- returns a world in which the Wumpus has either 1) moved one tile to -- the right or 2) stayed in the same place if the Wumpus could not move -- to the right. moveRight :: World a -> World a moveRight w@(World _ _ []) = w moveRight (World as b cs) = World (as ++ [b]) (head cs) (tail cs) initWorld = World [Dirty, Clean, Dirty] Dirty [Clean, Dirty, Pit] -- cleans the current tile cleanTile :: Tile -> Tile cleanTile Dirty = Clean cleanTile t = t Thanks!

    Read the article

  • How to focus a control in an MDIParent when all child windows have closed?

    - by Tim Gradwell
    I have a control in my parent mdi form which I wish to be given the focus if all mdi children have closed. I've tried hooking into the child form's FormClosed event and setting the focus from there but when I test it, my control is not left with focus when I close the mdi child. Can anyone tell me what I'm missing? In the sample below, "first focus" gets hit and does its job correctly (if I comment out the first focus line, my tree does not get focus on startup, so it must be doing its job, right?) Unfortunately, even though "second focus" gets hit, my tree does not end up with the focus when I close the child window. Sample using System; using System.Windows.Forms; namespace mdiFocus { class ParentForm : Form { public ParentForm() { IsMdiContainer = true; tree = new TreeView(); tree.Nodes.Add("SomeNode"); tree.Dock = DockStyle.Left; Controls.Add(tree); } protected override void OnShown(EventArgs e) { Form child = new Form(); child.MdiParent = this; child.Show(); child.FormClosed += new FormClosedEventHandler(child_FormClosed); tree.Focus(); // first focus works ok } void child_FormClosed(object sender, FormClosedEventArgs e) { tree.Focus(); // second focus doesn't seem to work, even though it is hit :( } TreeView tree; } static class Program { [STAThread] static void Main() { Application.Run(new ParentForm()); } } }

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >