Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 79/96 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Using SimpleDB (with SimpleSavant) with POCO / existing entities, not attributes on my classes

    - by alex
    I'm trying to use Simple Savant within my application, to use SimpleDB I currently have (for example) public class Person { public Guid Id { get; set; } public string Name { get; set; } public string Description { get; set; } public DateTime DateOfBirth { get; set; } } To use this with Simple Savant, i'd have to put attributes above the class declaration, and property - [DomainName("Person")] above the class, and [ItemName] above the Id property. I have all my entities in a seperate assembly. I also have my Data access classes an a seperate assembly, and a class factory selects, based on config, the IRepository (in this case, IRepository I want to be able to use my existing simple class - without having attributes on the properties etc.. In case I switch out of simple db, to something else - then I only need to create a different implementation of IRepository. Should I create a "DTO" type class to map the two together? Is there a better way?

    Read the article

  • Can somebody tell me why this Jquery tooltip is not showing up?

    - by alex
    <link rel="stylesheet" type="text/css" href="jquery-tooltip/jquery.tooltip.css"/> <script type="text/javascript" src="jquery-tooltip/jquery.tooltip.js"></script> <div id="baby" title="My tootip">The text</div> <script type="text/javascript"> $(function(){ $('#baby').tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", extraClass: "pretty", fixPNG: true, opacity: 0.95, left: -120 }); }); </script> The files are found, and they are not 404.

    Read the article

  • Ant Junit tests are running much slower via ant than via IDE - what to look at?

    - by Alex B
    I am running my junit tests via ant and they are running substantially slower than via the IDE. My ant call is: <junit fork="yes" forkmode="once" printsummary="off"> <classpath refid="test.classpath"/> <formatter type="brief" usefile="false"/> <batchtest todir="${test.results.dir}/xml"> <formatter type="xml"/> <fileset dir="src" includes="**/*Test.java" /> </batchtest> </junit> The same test that runs in near instantaneously in my IDE (0.067s) takes 4.632s when run through Ant. In the past, I've been able to speed up test problems like this by using the junit fork parameter but this doesn't seem to be helping in this case. What properties or parameters can I look at to speed up these tests? More info: I am using the reported time from the IDE vs. the time that the junit task outputs. This is not the sum total time reported at the end of the ant run. So, bizarrely, this problem has resolved itself. What could have caused this problem? The system runs on a local disk so that is not the problem.

    Read the article

  • stm monad problem

    - by Alex
    This is just a hypothetical scenario to illustrate my question. Suppose that there are two threads and one TVar shared between them. In one thread there is an atomically block that reads the TVar and takes 10s to complete. In another thread is an atomically block that modifies the TVar every second. Will the first atomically block ever complete? Surely it will just keep going back to the beginning, because the log is in an inconsistent state?

    Read the article

  • How to use the Zend_Log instance that was created using the Zend_Application_Resource_Log in a model

    - by Alex
    Our Zend_Log is initialized by only adding the following lines to application.ini resources.log.stream.writerName = "Stream" resources.log.stream.writerParams.mode = "a" So Zend_Application_Resource_Log will create the instance for us. We are already able to access this instance in controllers via the following: public function getLog() { $bootstrap = $this->getInvokeArg('bootstrap'); //if (is_null($bootstrap)) return false; if (!$bootstrap->hasPluginResource('Log')) { return false; } $log = $bootstrap->getResource('Log'); return $log; } So far, so good. Now we want to use the same log instance in model classes, where we can not access the bootstrap. Our first idea was to register the very same Log instance in Zend_Registry to be able to use Zend_Registry::get('Zend_Log') everywhere we want: in our Bootstrap class: protected function _initLog() { if (!$this->hasPluginResource('Log')) { throw new Zend_Exception('Log not enabled'); } $log = $this->getResource('Log'); assert( $log != null); Zend_Registry::set('Zend_Log', $log); } Unfortunately this assertion fails == $log IS NULL --- but why?? It is clear that we could just initialize the Zend_Log manually during bootstrapping without using the automatism of Zend_Application_Resource_Log, so this kind of answers will not be accepted.

    Read the article

  • jQuery $.getJSON: "Failed to load resource: cancelled"

    - by Alex
    I'm having problem loading a json resource from a local rails app with jQuery 1.4.4 The json is valid (based on jsonlint.com) and I can download it properly if I'm requesting it from other sources. In webkit (Safari), I got this error: Failed to load resource: cancelled Response Header on Firebug: Content-Type application/json; charset=utf-8 Set-Cookie geoloc=toulouse; path=/; Connection close Server thin 1.2.7 codename No Hup jQuery code to load json: $.getJSON("http://127.0.0.1/search_agenda", {'edition': edition, 'categories': categories}, function(data){ console.log(data); } });

    Read the article

  • A non-ugly way to persist dialog contents across orientation changes?

    - by alex
    So I have a managed AlertDialog with a number of EditTexts & separate portrait + landscape layouts. The user opens the dialog in portrait mode, enters some text and then all of a sudden decides to pop out the keyboard. Now, I need to remove the dialog and recreate it for the changed layout persisting the text entered. What I can think of is getting references to the EdiTexts in onPrepareDialog(..), then getting the actual text in onConfigurationChanged(..), then removing the dialog, then showing it again, then populating it. Rather ugly, huh? Are there any better options?

    Read the article

  • Compare string and array

    - by alex
    Hello all! I have an array and variable. If the variable does not exist in the array to be added, if there is - remove from the array. Why not work? $ar = ["a","b","c"]; $vr = "b"; foreach ($ar as $i => $value) { if ($value == $vr) { unset ($ar[$i]); } else { $ar[] = $vr; $ar = array_unique($ar); } } Thanks.

    Read the article

  • how to populate the tables within xmlDataDocument.DataSet

    - by alex
    Hi all: I am working on a C# application that involves using XML schema file as databases for message definitions and XML file as databases for message data. I was following the example I found:http://msdn.microsoft.com/en-us/library/system.xml.xmldatadocument.dataset%28v=VS.100%29.aspx I wrote my own xsd and XML file. I used the same approach in the example, read the xsd file and then load the xml file. But I don't have any "Rows" created for my DataTable. I used debugger to step through my codes. When I am get my DataTable use xmlDataDocument.DataSet.Tables["name of the table"], the Rows property of that tables is 0. Does anybody know what might cause the DataSet tables not get populated after I loaded the xmlDataDocument with XML file? Here is a fragment of XSD file: <?xml version="1.0" encoding="utf-8"?> <xs:schema id="test" targetNamespace="http://tempuri.org/test.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/test.xsd" xmlns:mstns="http://tempuri.org/test.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:element name="reboot_msg"> <xs:complexType> <xs:complexContent> <xs:extension base="header_s"> <xs:sequence> <xs:element name="que_name"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="4"/> <xs:maxLength value="8"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="priority" type="xs:unsignedShort"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> and here is a fragment of the XML file: <?xml version="1.0" standalone="yes"?> <test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <reboot_msg> <message_length>16</message_length> <message_type>7</message_type> <message_sequence>0</message_sequence> <que_name>NONE</que_name> <priority>5</priority> </reboot_msg> It could be the XML and XSD file I created missed something. Please help. Thanks

    Read the article

  • Append some HTML into the HEAD tag?

    - by Alex
    Hi! I want to add some style to head tag in html page using javascript. var h = document.getElementsByTagName('head').item(0); h.innerHTML += '<style>a{font-size:100px;}</style>'; But when I run this code in IE8 I see this error message: Could not set the innerHTML property. Invalid target element for this operation. Any ideas?

    Read the article

  • networkstream always empty!

    - by ALEX
    hey I'm writing on an Server-Client program but when my client sends something, it never reaches my server! I'm sending like this: public void Send(string s) { char[] chars = s.ToCharArray(); byte[] bytes = chars.CharToByte(); nstream.Write(bytes, 0, bytes.Length); nstream.Flush(); } and Receiving in a background thread like this void CheckIncoming(object dd) { RecievedDelegate d = (RecievedDelegate)dd; try { while (true) { List<byte> bytelist = new List<byte>(); System.Threading.Thread.Sleep(1000); int ssss; ssss = nstream.ReadByte(); if (ssss > 1) { System.Diagnostics.Debugger.Break(); } if (bytelist.Count != 0) { d.Invoke(bytelist.ToArray()); } } } catch (Exception exp) { MSGBOX("ERROR:\n" + exp.Message); } } the ssss int is never 1 whats happening here???

    Read the article

  • Having Issues with a utility app...

    - by Alex
    How do I accept data on the backside of a utility app, and then how do I let users modify that data? I've tried all sorts of tutorials, but to no avail. If you need further information let me know. Thanks in advanced.

    Read the article

  • How do I overwrite the functionality of the home button?

    - by Alex
    Essentially, I just want to change the home button from just hiding my app to killing the activity that is on the screen. I thought about writing a broadcast receiver that kills the activity, but I'm not sure how to kill the activity from the receiver. How do I change the functionality of the home button to "finish" the specific activity? Thanks

    Read the article

  • Rails: Duplicate functionality across controllers? A humble plea.

    - by Alex
    So I'm working with authlogic, and I'm trying to duplicate the login functionality to the welcome page, so that you can log in by restful url or by just going to the main page. No, I don't know if we'll keep that feature, but I want to test it out anyway. Here's the error message: RuntimeError in Welcome#index Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id The code is below. Basically, what's happening is the index view (the first code snippet) is sending the information from the form to the create method of user_sessions controller. At this point, in theory, it create should just pick up, but it doesn't. PLEASE help. Please. I've been doing this for about 8 hours. I checked Google. I checked IRC. I checked every book I could find. You don't even have to answer, I can to the grunt work if you just point me in the right direction. <% form_for @user_session, :url => user_sessions_path do |f| %> <%= f.text_field :email %><br /> <%= f.password_field :password %> <%= submit_tag 'Login' %> <% end %> class ApplicationController < ActionController::Base helper :all # include all helpers, all the time protect_from_forgery # See ActionController::RequestForgeryProtection for details # Scrub sensitive parameters from your log # filter_parameter_logging :password helper_method :current_user_session, :current_user before_filter :new_session_object protected def new_session_object unless current_user @user_session = UserSession.new(params[:user_session]) end end private def current_user_session return @current_user_session if defined?(@current_user_session) @current_user_session = UserSession.find end def current_user return @current_user if defined?(@current_user) @current_user = current_user_session && current_user_session.record end end

    Read the article

  • Own params to PeriodicTask run() method in Celery

    - by Alex Isayko
    Hello to all! I am writing a small Django application and I should be able to create for each model object its periodical task which will be executed with a certain interval. I'm use for this a Celery application, but i can't understand one thing: class ProcessQueryTask(PeriodicTask): run_every = timedelta(minutes=1) def run(self, query_task_pk, **kwargs): logging.info('Process celery task for QueryTask %d' % query_task_pk) task = QueryTask.objects.get(pk=query_task_pk) task.exec_task() return True Then i'm do following: >>> from tasks.tasks import ProcessQueryTask >>> result1 = ProcessQueryTask.delay(query_task_pk=1) >>> result2 = ProcessQueryTask.delay(query_task_pk=2) First call is success, but other periodical calls returning the error - TypeError: run() takes exactly 2 non-keyword arguments (1 given) in celeryd server. So, can i pass own params to PeriodicTask run() ? Thanks!

    Read the article

  • pass parameter from controller to models condition

    - by Alex
    I'm trying to bind a param to a join via a named scope., but I'm getting an error. What is the correct way to do that? has_one :has_voted, :class_name => 'Vote', :conditions => ['ip = :userIp'] # named scopes scope :with_vote, lambda {|ip| { :include => [:has_voted], # like this ?? :conditions => [:has_voted => {:conditions => {:userIp => ip}} ] }} Idea.with_vote(request.ip).all I believe I need the condition definition in the model for it to appear in the ON clause of a JOIN, rather then in the WHERE one. Edit I'm trying to get the following query select Ideas.*, Votes.* from Ideas left outer join Votes on Votes.Idea_id = Idea.id AND Votes.ip = {request.ip}

    Read the article

  • Can I include a view in Kohana 3 that is not within `application/views`?

    - by alex
    I am building a staff area for a website, which is completely different to the main brochure style site. I have 2 Kohana systems setup. I realise they can both share the same system and modules folder. Now, with the second one, I want to make the main template view a view in a different folder. I tried this in my base controller $this->template = DOCROOT . '../~new2/application/views/template.php'; But Kohana is looking for it in its own views folder as evident by the error I received. I even put a var_dump(file_exists($this->template)); // true to be sure it was finding the correct file. Is there a way to add a template file that is not within the views folder, without hacking the core Kohana code (and if I'm lucky not extending and overloading the view class).

    Read the article

  • How to round a number to n decimal places in Java

    - by Alex Spurling
    What I'd like is a method to convert a double to a string which rounds using the half-up method. I.e. if the decimal to be rounded is a 5, it always rounds up the previous number. This is the standard method of rounding most people expect in most situations. I also would like only significant digits to be displayed. That is there should not be any trailing zeroes. I know one method of doing this is to use the String.format method: String.format("%.5g%n", 0.912385); returns: 0.91239 which is great, however it always displays numbers with 5 decimal places even if they are not significant: String.format("%.5g%n", 0.912300); returns: 0.91230 Another method is to use the DecimalFormatter: DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385); returns: 0.91238 However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this: 0.912385 -> 0.91239 0.912300 -> 0.9123 What is the best way to achieve this in Java?

    Read the article

  • Is it possible to import specific class from project propreties

    - by Alex
    I have 2 projects. First project need to include second. When I copy sources from second project to first I need to modify manually import path to R.java file. The problem is that I need to use SVN external link connection between this 2 projects, that is mean, one project (the bigger one) will take sources from another through svn and should be able to use it without any modifications. If I would be able to specify R.java file path anywhere in project properties it will resolve my problem by changing manually that path. Need to specify that package name of these 2 projects are different. Another solution to resolve this problem also would be accepted. Thank you.

    Read the article

  • Self-modify the classpath within a Scala script?

    - by Alex R
    I'm trying to replace a bunch of Linux shell scripts with Scala scripts. One of the remaining challenges is how to scan an entire directory of JARs and place them into the classpath. Currently this is done in the shell script prior to invoking the scala JVM. I'd like to eliminate the shell script completely. Is there an elegant scala idiom for this? I have found this other question but in Java it seems hardly worthwhile to mess with it: http://stackoverflow.com/questions/252893/how-do-you-change-the-classpath-within-java

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >