Search Results

Search found 1419 results on 57 pages for 'joe erickson'.

Page 11/57 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • No Commons Logging in Android?

    - by Joe Boese
    Hello all, I have a pretty big library I developed specifically for use in my Android Application. However business logic itself has no dependency on Android. To preserve that, I used Commons Logging throughout this library and it's respective JUnit tests (which I run in Eclipse). However now that I am starting to integrate it into an Activity which I launch on Android, I am unable to get my logging to work. In Eclipse/JUnit, I had simply pulled in log4j's jar file as well as a log4j.properties file. This doesn't seem to work when deploying to a device. After struggling with attempting to get that to work for several hours, I gave up and tried replacing all my commons logging stuff with android.util.Log. Now I can log on the device.. but all JUnit tests are broken. When any JUnit tries to log using android.util.Log, it throws a RuntimeException 'Stub!'. I would prefer to revert to my commons logging approach.. if anyone can help with that.. otherwise.. what can I do to get my JUnit test cases running using 'android.util.Log'? Many thanks in advance.. I've spent more than a few hours on this and I'd like to move on to writing real code again! Joe

    Read the article

  • How to get NHProf reports in TeamCity running MSBUILD

    - by Jon Erickson
    I'm trying to get NHProf reports on my integration tests as a report in TeamCity I'm not sure how to get this set up correctly and my first attempts are unsuccessful. Let me know if there is any more information that would be helpful... I'm getting the following error, when trying to generate html reports with MSBUILD (which is being run by TeamCity) error MSB3073: The command "C:\CI\Tools\NHProf\NHProf.exe /CmdLineMode /File:"E:\CI\BuildServer\RMS-Winform\Group\dev\NHProfOutput.html" /ReportFormat:Html" exited with code -532459699 I tell TeamCity to run MSBUILD w/ CIBuildWithNHProf target The command line parameters that I pass from TeamCity are... /property:NHProfExecutable=%system.NHProfExecutable%;NHProfFile=%system.teamcity.build.checkoutDir%\NHProfOutput.html;NHProfReportFormat=Html The portion of my MSBUILD script that runs my tests is as follows... <UsingTask TaskName="NUnitTeamCity" AssemblyFile="$(teamcity_dotnet_nunitlauncher_msbuild_task)"/> <!-- Set Properties --> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> <NHProfExecutable></NHProfExecutable> <NHProfFile></NHProfFile> <NHProfReportFormat></NHProfReportFormat> </PropertyGroup> <!-- Test Database --> <Target Name="DeployDatabase"> <!-- ... --> </Target> <!-- Database Used For Integration Tests --> <Target Name="DeployTestDatabase"> <!-- ... --> </Target> <!-- Build All Projects --> <Target Name="BuildProjects"> <MSBuild Projects="..\MySolutionFile.sln" Targets="Build"/> </Target> <!-- Stop NHProf --> <Target Name="NHProfStop"> <Exec Command="$(NHProfExecutable) /Shutdown" /> </Target> <!-- Run Unit/Integration Tests --> <Target Name="RunTests"> <CreateItem Include="..\**\bin\debug\*Tests.dll"> <Output TaskParameter="Include" ItemName="TestAssemblies" /> </CreateItem> <NUnitTeamCity Assemblies="@(TestAssemblies)" NUnitVersion="NUnit-2.5.3"/> </Target> <!-- Start NHProf --> <Target Name="NHProfStart"> <Exec Command="$(NHProfExecutable) /CmdLineMode /File:&quot;$(NHProfFile)&quot; /ReportFormat:$(NHProfReportFormat)" /> </Target> <Target Name="CIBuildWithNHProf" DependsOnTargets="BuildProjects;DeployTestDatabase;NHProfStart;RunTests;NHProfStop;DeployDatabase"> </Target>

    Read the article

  • c - strncpy issue

    - by Joe
    Hi there, I am getting segmentation fault when using strncpy and (pointer-to-struct)-(member) notation: I have simplified my code. I initialise a struct and set all of it's tokens to an empty string. Then a declare a pointer to a struct and assign the address of the struct to it. I pass the pointer to a function. I can print out the contents of the struct at the beginning of the function, but if I try to use the tp - mnemonic in a strncpy function, I get seg fault. Can anyone tell me what I am doing wrong? typedef struct tok { char* label; char* mnem; char* operand; }Tokens; Tokens* tokenise(Tokens* tp, char* line) { // This prints fine printf("Print this - %s\n", tp -> mnem); // This function gives me segmentation fault strncpy(tp -> mnem, line, 4); return tp; } int main() { char* line = "This is a line"; Tokens tokens; tokens.label = ""; tokens.mnem = "load"; tokens.operand = ""; Tokens* tp = &tokens; tp = tokenise(tp, line); return 0; } I have used printf statements to confirm that the code definitely stops executing at the strncpy function. Can anyone tell me where I am going wrong? Many thanks Joe

    Read the article

  • Maximum Uri Length in Silverlight

    - by Kris Erickson
    Does anyone know what the Maximum URL length is in Silverlight (version 4 if it matters)? I know it is 2048 and basically infinite for Firefox (the two environments I have tested in), but Image requests fail for long Uri's. Anyone know the magic number (is it 256 the max filepath length?) It is considerably shorter than the 2048 for IE...

    Read the article

  • Non-Mainstream Languages, Bad for your resume?

    - by Joe
    Hi folks, I got my BS in Computer Science about seven years ago. I spent two years in neuroscience research and the next three providing what amounts to tech support. But I love computer programming - and I have since written, as a freelancer, non-trivial commercial code in Haskell, Smalltalk, and Objective-C. I used these languages because I find them rewarding, they make me a better programmer and thus, I thought, more attractive to companies. However the polar opposite has occured and I am now unhireable. The freelance market has bottomed out and I am looking for regular employment. But I am being repeatedly turned down, even for entry-level positions, because I don't specifically fit the requirements - eg. Java programmer with 2+ years with JUnit, JavaMail, Servlets etc. And none of the hiring managers, let alone the recruiters, have heard of either Haskell or Smalltalk and more disturbing is their thinly veiled contempt for my background. My question is , how should I market myself to these positions? Is anyone here in a similar position? What should I be doing different professionally? More broadly is this contempt for non-mainstream experience occurring everywhere or just my town? And if there are any hiring managers reading this, I'd love to hear your side. Please be brutally honest. thanks, joe

    Read the article

  • Python Django Global Variables

    - by Joe J
    Hi all, I'm looking for simple but recommended way in Django to store a variable in memory only. When Apache restarts or the Django development server restarts, the variable is reset back to 0. More specifically, I want to count how many times a particular action takes place on each model instance (database record), but for performance reasons, I don't want to store these counts in the database. I don't care if the counts disappear after a server restart. But as long as the server is up, I want these counts to be consistent between the Django shell and the web interface, and I want to be able to return how many times the action has taken place on each model instance. I don't want the variables to be associated with a user or session because I might want to return these counts without being logged in (and I want the counts to be consistent no matter what user is logged in). Am I describing a global variable? If so, how do I use one in Django? I've noticed the files like the urls.py, settings.py and models.py seems to be parsed only once per server startup (by contrast to the views.py which seems to be parsed eache time a request is made). Does this mean I should declare my variables in one of those files? Or should I store it in a model attribute somehow (as long as it sticks around for as long as the server is running)? This is probably an easy question, but I'm just not sure how it's done in Django. Any comments or advice is much appreciated. Thanks, Joe

    Read the article

  • Standard way to hash an RSA key?

    - by Adam J.R. Erickson
    What's the algorithm for creating hash (sha-1 or MD5) of an RSA public key? Is there a standard way to do this? Hash just the modulus, string addition of both and then take a hash? Is SHA-1 or MD5 usually used? I want to use it to ensure that I got the right key (have the sender send a hash, and I calculate it myself), and log said hash so I always know which exact key I used when I encrypt the payload.

    Read the article

  • How to start recognizing design patterns as you are programming?

    - by Jon Erickson
    I have general academic knowledge of the various design patterns that are discussed in GoF and Head First Design Patterns, but I have a difficult time applying them to the code that I am writing. A goal for me this year is to be able to recognize design patterns that are emerging from the code that I write. Obviously this comes with experience (I have about 2 years in the field), but my question is how can I jumpstart my ability to recognize design patterns as I am coding, maybe a suggestion as to what patterns are easiest to start applying in client-server applications (in my case mainly c# webforms with ms sql db's, but this could definitely be language agnostic).

    Read the article

  • How do I choose files from the local filesystem in Windows Phone 7

    - by Kris Erickson
    I'm trying to choose some files to upload in Windows Phone 7 (in the emulator), and any attempt to ShowDialog of the OpenFileDialog leads to a Security Exception. The open file dialog is being called from an event on a button click but I get a SecurityException [FileDialog_ActiveScripting] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.40806.0&File=System.Windows.dll&Key=FileDialog_ActiveScripting Looking up the SecurityException in the Silverlight version of OpenFileDialog.ShowDialog states that the error is: Active Scripting in Internet Explorer is disabled. -or- The call to the ShowDialog method was not made from user-initiated code. Anyone had any luck with the OpenFileDialog and ShowDialog in Windows Phone 7?

    Read the article

  • Is there any way to programitically change a Data/ItemTemplate in Silverlight?

    - by Kris Erickson
    So I have a Listbox, which is using an ItemTemplate to display an image. I want to be able to change the size of the displayed image in the ItemTemplate. Through databinding I can change the Width, but the only way I can see how to do this is to add a Property (Say, ImageSize) to the class I am binding to and then change every item in the colleciton to have a new ImageSize. Is there no way to access the property of an item in that Datatemplate? E.g. <navigation:Page.Resources> <DataTemplate x:Key="ListBoxItemTemplate"> <Viewbox Height="100" Width="100"> <Image Source="{Binding Image}"/> </Viewbox> </DataTemplate> </navigation:Page.Resources> <Grid> <ListBox ItemTemplate="{StaticResource ListBoxItemTemplate}" ItemSource="{Binding Collection}"/> </Grid> Is there anyway to set the Width and Height of the viewbox without binding a property to every element in the collection?

    Read the article

  • Writing an app with Perl and Ruby?

    - by Jeff Erickson
    I am working on a project that is mostly Ruby on Rails. However, I need to generate and parse Excel files in this project (I know, I know...), so I've been using Perl's Spreadsheet::WriteExcel and Spreadsheet::ParseExcel which work well. However, what is the best way to combine this use of Perl with the larger Ruby on Rails app? Is calling the Perl script with backticks the kosher way to go about this? It feels a little hacky to me, but if that is the only (or best) way, then that's what I'll do. I wanted to reach out and see if anyone else has some suggestions or advise. Thank you!

    Read the article

  • VBA Macro to save an excel file to a different backup location

    - by Joe Taylor
    I am trying to create a Macro that either runs on close or on save to backup the file to a different location. At the moment the Macro I have used is: Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) 'Saves the current file to a backup folder and the default folder 'Note that any backup is overwritten Application.DisplayAlerts = False ActiveWorkbook.SaveCopyAs Filename:="T:\TEC_SERV\Backup file folder - DO NOT DELETE\" & _ ActiveWorkbook.Name ActiveWorkbook.Save Application.DisplayAlerts = True End Sub This creates a backup of the file ok the first time, however if this is tried again I get: Run-Time Error '1004'; Microsoft Office Excel cannot access the file 'T:\TEC_SERV\Backup file folder - DO NOT DELETE\Test Macro Sheet.xlsm. There are several possible reasons: The file name or path does not exist The file is being used by another program The workbook you are trying to save has the same name as a... I know the path is correct, I also know that the file is not open anywhere else. The workbook has the same name as the one I'm trying to save over but it should just overwrite. Any help would be much appreciated. Joe

    Read the article

  • Is it too early to start designing for Task Parallel Library?

    - by Joe Erickson
    I have been following the development of the .NET Task Parallel Library (TPL) with great interest since Microsoft first announced it. There is no doubt in my mind that we will eventually take advantage of TPL. What I am questioning is whether it makes sense to start taking advantage of TPL when Visual Studio 2010 and .NET 4.0 are released, or whether it makes sense to wait a while longer. Why Start Now? The .NET 4.0 Task Parallel Library appears to be well designed and some relatively simple tests demonstrate that it works well on today's multi-core CPUs. I have been very interested in the potential advantages of using multiple lightweight threads to speed up our software since buying my first quad processor Dell Poweredge 6400 about seven years ago. Experiments at that time indicated that it was not worth the effort, which I attributed largely to the overhead of moving data between each CPU's cache (there was no shared cache back then) and RAM. Competitive advantage - some of our customers can never get enough performance and there is no doubt that we can build a faster product using TPL today. It sounds fun. Yes, I realize that some developers would rather poke themselves in the eye with a sharp stick, but we really enjoy maximizing performance. Why Wait? Are today's Intel Nehalem CPUs representative of where we are going as multi-core support matures? You can purchase a Nehalem CPU with 4 cores which share a single level 3 cache today, and most likely a 6 core CPU sharing a single level 3 cache by the time Visual Studio 2010 / .NET 4.0 are released. Obviously, the number of cores will go up over time, but what about the architecture? As the number of cores goes up, will they still share a cache? One issue with Nehalem is the fact that, even though there is a very fast interconnect between the cores, they have non-uniform memory access (NUMA) which can lead to lower performance and less predictable results. Will future multi-core architectures be able to do away with NUMA? Similarly, will the .NET Task Parallel Library change as it matures, requiring modifications to code to fully take advantage of it? Limitations Our core engine is 100% C# and has to run without full trust, so we are limited to using .NET APIs.

    Read the article

  • firefox and javascript redirection

    - by Joe
    Hello there, I currently have a issue with firefox, where all other browser behave in the right way - even IE6! What I want to do is redirection to a subpage but leaving a history entry. There are 2 methods of rewriting the url as far as I know: window.location = "some.url"; - redirect to some.url with history entry window.location.replace("some.url"); - redirect without history entry So I have to use the first one and tested in the firebug console everthing works fine. Now there is the kind of strange part of this question: the same statement, that worked fine in the console doesn't in some jQuery callback handler: jQuery("#selector").bind("submit", function() { $.getJSON("some_cool_json", function(response) { var redirect_path = response.path; window.location = redirect_path; }); return false; }); where response_path is set correctly, I checked it! Even the redirection is working correctly, but there is no history entry created. Any ideas on that one? Would be great! ;) Cheers Joe

    Read the article

  • When doing a Schema Export with hbm2ddl, is there a way to specify that you DO NOT want Nullable For

    - by Jon Erickson
    The DDL that is being created is putting all of my many to many associations into 1 table, but I actually want each many to many association in its' own table (for other reasons) Right now hbm2ddl is creating this table (only Table1Key OR Table2Key OR Table3Key should be filled out for any given record, causing this table to have nullable foreign keys): +-----------+ | xRef | +-----------+ | Table1Key | | Table2Key | | Table3Key | | RiskKey | +-----------+ I want hbm2ddl to create the following 3 tables so that there are no nullable foreign keys. +-----------+ +-----------+ +-----------+ | xRef1 | | xRef2 | | xRef3 | +-----------+ +-----------+ +-----------+ | Table1Key | | Table2Key | | Table3Key | | RiskKey | | RiskKey | | RiskKey | +-----------+ +-----------+ +-----------+

    Read the article

  • How I do I make controls/elements move with inertia?

    - by Kris Erickson
    Modern UI's are starting to give their UI elments nice inertia when moving. Tabs slide in, page transitions, even some listboxes and scroll elments have nice inertia to them (the iphone for example). What is the best algorythm for this? It is more than just gravity as they speed up, and then slow down as they fall into place. I have tried various formulae's for speeding up to a maximum (terminal) velocity and then slowing down but nothing I have tried "feels" right. It always feels a little bit off. Is there a standard for this, or is it just a matter of playing with various numbers until it looks/feels right?

    Read the article

  • What techniques are being used to pass MVC ModelState validation errors back to the client when usin

    - by Jon Erickson
    I'm sort of thinking out loud here, so let me know if I need to clarify... on ajax heavy sites, when using JsonResult to pass information back to the client, what techniques, patterns, best practices are being used to pass ModelState validation errors back to the client? I am using xVal and castle validation on my view models, is there some sort of standard to get jquery validate to display errors coming from ajax responses?

    Read the article

  • Fluent NHibernate Map to private/protected Field that has no exposing Property

    - by Jon Erickson
    I have the following Person and Gender classes (I don't really, but the example is simplified to get my point across), using NHibernate (Fluent NHibernate) I want to map the Database Column "GenderId" [INT] value to the protected int _genderId field in my Person class. How do I do this? FYI, the mappings and the domain objects are in separate assemblies. public class Person : Entity { protected int _genderId; public virtual int Id { get; private set; } public virtual string Name { get; private set; } public virtual Gender Gender { get { return Gender.FromId(_genderId); } } } public class Gender : EnumerationBase<Gender> { public static Gender Male = new Gender(1, "Male"); public static Gender Female = new Gender(2, "Female"); private static readonly Gender[] _genders = new[] { Male, Female }; private Gender(int id, string name) { Id = id; Name = name; } public int Id { get; private set; } public string Name { get; private set; } public static Gender FromId(int id) { return _genders.Where(x => x.Id == id).SingleOrDefault(); } }

    Read the article

  • Question about passing data using intents

    - by Joe K 1973
    Hi everyone, I'm trying to modify the Notepad tutorial (the Notepadv3 solution) to take in a value into the NoteEdit class, given to by the Notepadv3 class. I've successfully used .putExtra in the OnListItemClick method to place the value into the NoteEdit class, but I'm struggling to do this for the createNote method; I'm getting a force close when I try to create a new note. I bet there's a simple solution, but I'm pretty new to Java & Android and would very much appreciate your help. Here's the code in question in the Notepadv3 class: private void createNote() { Intent i = new Intent(this, NoteEdit.class); i.putExtra("key", 1); startActivityForResult(i, ACTIVITY_CREATE); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); Intent i = new Intent(this, NoteEdit.class); i.putExtra(NotesDbAdapter.KEY_ROWID, id); i.putExtra("key", 1); startActivityForResult(i, ACTIVITY_EDIT); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); fillData(); } And here's the receiving code in the NoteEdit class: mRowId = savedInstanceState != null ? savedInstanceState.getLong(NotesDbAdapter.KEY_ROWID) : null; if (mRowId == null) { Bundle extras = getIntent().getExtras(); mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID) : null; value = extras.getInt("key"); } I'm fairly sure that (mRowId == null) is not true when I'm using the createNote method so therefore getExtras won't be called. One of my questions would be how can I make my NoteEdit class get this value when I use the createNote method? I'm new to this so sorry if this is a simple question for you all. Thanks, Joe

    Read the article

  • How do I recover from an unchecked exception?

    - by erickson
    Unchecked exceptions are alright if you want to handle every failure the same way, for example by logging it and skipping to the next request, displaying a message to the user and handling the next event, etc. If this is my use case, all I have to do is catch some general exception type at a high level in my system, and handle everything the same way. But I want to recover from specific problems, and I'm not sure the best way to approach it with unchecked exceptions. Here is a concrete example. Suppose I have a web application, built using Struts2 and Hibernate. If an exception bubbles up to my "action", I log it, and display a pretty apology to the user. But one of the functions of my web application is creating new user accounts, that require a unique user name. If a user picks a name that already exists, Hibernate throws an org.hibernate.exception.ConstraintViolationException (an unchecked exception) down in the guts of my system. I'd really like to recover from this particular problem by asking the user to choose another user name, rather than giving them the same "we logged your problem but for now you're hosed" message. Here are a few points to consider: There a lot of people creating accounts simultaneously. I don't want to lock the whole user table between a "SELECT" to see if the name exists and an "INSERT" if it doesn't. In the case of relational databases, there might be some tricks to work around this, but what I'm really interested in is the general case where pre-checking for an exception won't work because of a fundamental race condition. Same thing could apply to looking for a file on the file system, etc. Given my CTO's propensity for drive-by management induced by reading technology columns in "Inc.", I need a layer of indirection around the persistence mechanism so that I can throw out Hibernate and use Kodo, or whatever, without changing anything except the lowest layer of persistence code. As a matter of fact, there are several such layers of abstraction in my system. How can I prevent them from leaking in spite of unchecked exceptions? One of the declaimed weaknesses of checked exceptions is having to "handle" them in every call on the stack—either by declaring that a calling method throws them, or by catching them and handling them. Handling them often means wrapping them in another checked exception of a type appropriate to the level of abstraction. So, for example, in checked-exception land, a file-system–based implementation of my UserRegistry might catch IOException, while a database implementation would catch SQLException, but both would throw a UserNotFoundException that hides the underlying implementation. How do I take advantage of unchecked exceptions, sparing myself of the burden of this wrapping at each layer, without leaking implementation details?

    Read the article

  • Which SQL query is faster? Filter on Join criteria or Where clause?

    - by Jon Erickson
    Compare these 2 queries. Is it faster to put the filter on the join criteria or in the were clause. I have always felt that it is faster on the join criteria because it reduces the result set at the soonest possible moment, but I don't know for sure. I'm going to build some tests to see, but I also wanted to get opinions on which would is clearer to read as well. Query 1 SELECT * FROM TableA a INNER JOIN TableXRef x ON a.ID = x.TableAID INNER JOIN TableB b ON x.TableBID = b.ID WHERE a.ID = 1 /* <-- Filter here? */ Query 2 SELECT * FROM TableA a INNER JOIN TableXRef x ON a.ID = x.TableAID AND a.ID = 1 /* <-- Or filter here? */ INNER JOIN TableB b ON x.TableBID = b.ID

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >