Search Results

Search found 25127 results on 1006 pages for 'anemic domain model'.

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

  • Scala and the Java Memory Model

    - by Ben Lings
    The Java Memory Model (since 1.5) treats final fields differently to non-final fields. In particular, provided the this reference doesn't escape during construction, writes to final fields in the constructor are guaranteed to be visible on other threads even if the object is made available to the other thread via a data race. (Writes to non-final fields aren't guaranteed to be visible, so if you improperly publish them, another thread could see them in a partially constructed state.) Is there any documentation on how/if the Scala compiler creates final (rather than non-final) backing fields for classes? I've looked through the language specification and searched the web but can't find any definitive answers. (In comparison the @scala.volatile annotation is documented to mark a field as volatile)

    Read the article

  • Get domain name (not subdomain) in php

    - by Cyclone
    I have a URL which can be any of the following formats: http://example.com https://example.com http://example.com/foo http://example.com/foo/bar www.example.com example.com foo.example.com www.foo.example.com foo.bar.example.com http://foo.bar.example.com/foo/bar example.net/foo/bar Essentially, I need to be able to match any normal URL. How can I extract example.com (or .net, whatever the tld happens to be. I need this to work with any TLD.) from all of these via a single regex? This is in PHP. Thanks for the help!

    Read the article

  • deserialization on client sied in Domain Service

    - by ankit
    i have 2 classes. Person and Contact. Person class has property named "ContactNumber" which returns the Contact type, and this property is marked as "Datamember" for serialization. i have marked Contact type as "DAtaContract". on client side i am able to get the values, but when i try to insert a value and then do submit, i get the below exception. Failed to deserialize change-set. Failed to convert value of type 'Dictionary`2' to type 'Contact' Stack Trace is: at System.Web.Ria.DataServiceSubmitRequest.GetChangeSet(DomainService domainService) at System.Web.Ria.DataServiceSubmitRequest.Invoke(DomainService domainService) at System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context) can anyone give me the solution ?

    Read the article

  • Deserialization on client side in Domain Service

    - by ankit
    I have 2 classes: Person and Contact. Person class has a property named ContactNumber which returns the Contact type, and this property is marked as a DataMember for serialization. I have marked Contact type as a DataContract. On the client side I am able to get the values, but when I try to insert a value and then do submit, I get the following exception: Failed to deserialize change-set. Failed to convert value of type 'Dictionary`2' to type 'Contact' Stack Trace is: at System.Web.Ria.DataServiceSubmitRequest.GetChangeSet(DomainService domainService) at System.Web.Ria.DataServiceSubmitRequest.Invoke(DomainService domainService) at System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context) Can anyone give me the solution ?

    Read the article

  • Recreating Cookies on another Domain

    - by Bill
    Hi, I have a site on A.com and an iframe on B.com which reads info from A.com. I realize that there is some problems with third party cookies, iframes and P3P - particularly in Safari [my problem] Is it possible to instead, use AJAX or a hidden iFrame to pass the cookie information from A.com to B.com which will then "recreate" another cookie with the same information on the iframe in B.com. I am trying to do this for authenication - i.e. a user is logged in on A.com and then goes to b.com and the iframe is also logged in ? I was hoping to perhaps pass the data in a hidden iframe and "recreate" the cookie in the iframe on B.com using JavaScript?

    Read the article

  • Domain migration - 301 Redirect of all contentes of directory)

    - by Trufa
    Hi, I would like to know if it is possible to do the following considering that I would like to migrate domains. I have lets say: one.com/files/one.html one.com/files/two.php one.com/other/three.html one.com/other/four.doc one.com/other/subdirectory/five.doc I am migrating to two.com So I would like to make RESPECTIVE 301 redirects to the following: two.com/old/files/one.html two.com/old/files/two.php two.com/old/other/three.html two.com/old/other/four.doc two.com/old/other/subdirectory/five.doc I've tried with cPanel and although I come "close" with the redirects option I can't seem to make it happen. The folders are not much (10 -12) the file are a lot, and obviously impossible to make it manually. How would you proceed? Can this/ should this be done with regex from the .htaccess?? Can you direct all the elements of a subdirectory in the manner expressed above? I hope the question is clear enough, if not please ask for any clarification needed!! Thanks in advance!!

    Read the article

  • Sinatra, JavaScript Cross-Domain Requests JSON

    - by pex
    I run a REST-API build on top of Sinatra. Now I want to write a jQuery Script that fetches data from the API. Sinatra is told to response with JSON before do content_type :json end A simple Route looks like get '/posts' do Post.find.to_json end My jQuery script is a simple ajax-call $.ajax({ type: 'get', url: 'http://api.com/posts', dataType: 'json', success: function(data) { // do something } }) Actually everything works fine as long as both runs on the same IP, API and requesting JS. I already tried to play around with JSONP for Rack without any positive results, though. Probably I just need a hint how to proceed.

    Read the article

  • MVC Model Binding to a collection where collection does not begin with a 0 index

    - by FloatLeft
    I'm trying to perform remote validation on a property of an item within a collection. The validation works OK on the first item of the collection. The http request to the validation method looks like: /Validation/IsImeiAvailable?ImeiGadgets[0].ImeiNumber=123456789012345 However on the 2nd item where the url looks like below, the validation doesn't work /Validation/IsImeiAvailable?ImeiGadgets[1].ImeiNumber=123456789012345 Now I'm pretty sure the reason for this, is that binding wont work on a collection that doesn't begin with a zero index. My validation method has a signature as below: public JsonResult IsImeiAvailable([Bind(Prefix = "ImeiGadgets")] Models.ViewModels.ImeiGadget[] imeiGadget) Because I'm passing an item within a collection I have to bind like this yet what I'm really passing is just a single value. Is there anyway I can deal with this other than just binding it as a plain old query string. Thanks Edit: This is the quick fix to get the Imei variable but I'd rather use the model binding: string imeiNumber = Request.Url.AbsoluteUri.Substring(Request.Url.AbsoluteUri.IndexOf("=")+1);

    Read the article

  • cross domain DOM access and manipulation in Java ?

    - by gaqer
    In my Java app, how can I incorporate the browser (which loads and renders URLs) in Swing and access it's DOM and manipulate HTML ? How can you embed such browser in a Rich Internet Application and access it's DOM ? More specifically, Vaadin ? Is there a HTTP proxy class that can load an external URL, and render it to the user ? This was what I was doing on LAMP stack....but I want to switch to Vaadin or some Java web framework where I can just use Java to do everything from server-side to client-side logic design, so I can focus more on application logic. (aka looking for developer friendly frameworks like Vaadin). Thank you and have a great weekend !

    Read the article

  • What's your favorite cross domain cookie sharing approach?

    - by Haoest
    I see iframe/p3p trick is the most popular one around, but I personally don't like it because javascript + hidden fields + frame really make it look like a hack job. I've also come across a master-slave approach using web service to communicate (http://www.15seconds.com/issue/971108.htm) and it seems better because it's transparent to the user and it's robust against different browsers. Is there any better approaches, and what are the pros and cons of each?

    Read the article

  • Domain validates but won't save

    - by marko
    I have the following setup. Class, say, Car that has a CarPart (belongsTo=[car:Car]). When I'm creating a Car I also want to create som default CarParts, so I do def car = new Car(bla bla bla) def part = new CarPart(car:car) Now, when I do car.validate() or part.validate() it seems fine. But when I do if(car.save && part.save() I get this exception: 2012-03-24 14:02:21,943 [http-8080-4] ERROR util.JDBCExceptionReporter - Batch entry 0 insert into car_part (version, car_id, id) values ('0', '297', '298') was aborted. Call getNextException to see the cause. 2012-03-24 14:02:21,943 [http-8080-4] ERROR util.JDBCExceptionReporter - ERROR: value too long for type character varying(6) 2012-03-24 14:02:21,943 [http-8080-4] ERROR events.PatchedDefaultFlushEventListener - Could not synchronize database state with session org.hibernate.exception.DataException: Could not execute JDBC batch update Stacktrace follows: java.sql.BatchUpdateException: Batch entry 0 insert into car_part (version, deal_id, id) values ('0', '297', '298') was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2621) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1837) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2754) at $Proxy20.flush(Unknown Source) at ristretto.DealController$_closure5.doCall(DealController.groovy:109) at ristretto.DealController$_closure5.doCall(DealController.groovy) at java.lang.Thread.run(Thread.java:722) Any ideas?

    Read the article

  • Free PHP framework/library for single-sign on / cross domain login

    - by Dennis Cheung
    I am looking for free (non GPL is better) SSO framework/library implementation or code samples. There are many kind of SSO implementation. Sharing cookie, sharing session, one time token, associative accounts, etc, etc. (BTW, any good article compare them?) Is there any keyword I should google and reuse before before I start to implement our own wheel. I know OpenID, but which is too much and it is not our need. We rather keep it KISS. We just want share the credentials of user that could save users from another login form.

    Read the article

  • Load a model in a Codeigniter library

    - by ci
    Hello, people! I have this piece of code: class MY_Language extends CI_Language { function MY_Language() { parent::CI_Language(); $CI =& get_instance(); $CI->load->model('language_model'); $languages = $this->language_model->get_languages(); print_r($languages); } } But I keep getting "Fatal error: Call to undefined function get_instance() in C:\xampp\htdocs\application\libraries\MY_Language.php on line 44". Any ideas? Thanks in advance!

    Read the article

  • Codeigniter Model appending word_limiter to result object

    - by yahyaE
    I have a get_all function in my model class in Codeigniter 2.0+. For a given database field name, i need to use word_limiter() in text helper. In view page, i loop result set as object $row->field_name_to_be_limited. With below code, i am trying to do it. But i should include the change $q->$field_name = word_limiter($q->$field_name, 4); into the $q->result. Thanks for help. function get_all($table_name,$orderByField,$ascDesc,$field_name = '') { $this->load->helper('text'); $qOrder = $this->db->order_by($orderByField,$ascDesc); $q = $this->db->get($table_name,$qOrder); if( ! $field_name ==='') $q->$field_name = word_limiter($q->$field_name, 4); return $q->result(); }

    Read the article

  • Cross-Domain + iFrame Question

    - by Tom
    Hi Guys, We are creating a "widget" for our site and wanted to ensure we have got this right. I realize this all relates to X-Browser permissions but little worried about how this works with like Cookies and permissions ?

    Read the article

  • Retrieve a cross domain RSS(xml) through Javascript

    - by Ajay
    I have seen server side proxy workarounds for retrieving rss (xmls) from cross-domains. In fact this very question addressess my same problem but gives out a different solution. I have a constraint of do not use a proxy to retrieve rss feeds. And hence the Google AJAX Feed API solution also goes out of picture. Is there a client-only workaround for this problem. JSONP is the solution for requests that respond with JSON output. But here, I have RSS feeds which can respond with pure xml . How do I solve the problem.

    Read the article

  • Check if User (live) on the Domain Controller

    - by Data-Base
    Hello, when we connect a machine to AD, user will be able to log into the machine with their AD user-name and password, at home they can do that ( when they are not on the work network) which fine and good we need to have a program Auto-start when the user login BUT only when they are at work and in our network! how can I achieve that? (I can build a checking program in c#) but not sure where to start! cheers

    Read the article

  • New Validation Attributes in ASP.NET MVC 3 Future

    - by imran_ku07
         Introduction:             Validating user inputs is an very important step in collecting information from users because it helps you to prevent errors during processing data. Incomplete or improperly formatted user inputs will create lot of problems for your application. Fortunately, ASP.NET MVC 3 makes it very easy to validate most common input validations. ASP.NET MVC 3 includes Required, StringLength, Range, RegularExpression, Compare and Remote validation attributes for common input validation scenarios. These validation attributes validates most of your user inputs but still validation for Email, File Extension, Credit Card, URL, etc are missing. Fortunately, some of these validation attributes are available in ASP.NET MVC 3 Future. In this article, I will show you how to leverage Email, Url, CreditCard and FileExtensions validation attributes(which are available in ASP.NET MVC 3 Future) in ASP.NET MVC 3 application.       Description:             First of all you need to download ASP.NET MVC 3 RTM Source Code from here. Then extract all files in a folder. Then open MvcFutures project from mvc3-rtm-sources\mvc3\src\MvcFutures folder. Build the project. In case, if you get compile time error(s) then simply remove the reference of System.Web.WebPages and System.Web.Mvc assemblies and add the reference of System.Web.WebPages and System.Web.Mvc 3 assemblies again but from the .NET tab and then build the project again, it will create a Microsoft.Web.Mvc assembly inside mvc3-rtm-sources\mvc3\src\MvcFutures\obj\Debug folder. Now we can use Microsoft.Web.Mvc assembly inside our application.             Create a new ASP.NET MVC 3 application. For demonstration purpose, I will create a dummy model UserInformation. So create a new class file UserInformation.cs inside Model folder and add the following code,   public class UserInformation { [Required] public string Name { get; set; } [Required] [EmailAddress] public string Email { get; set; } [Required] [Url] public string Website { get; set; } [Required] [CreditCard] public string CreditCard { get; set; } [Required] [FileExtensions(Extensions = "jpg,jpeg")] public string Image { get; set; } }             Inside UserInformation class, I am using Email, Url, CreditCard and FileExtensions validation attributes which are defined in Microsoft.Web.Mvc assembly. By default FileExtensionsAttribute allows png, jpg, jpeg and gif extensions. You can override this by using Extensions property of FileExtensionsAttribute class.             Then just open(or create) HomeController.cs file and add the following code,   public class HomeController : Controller { public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(UserInformation u) { return View(); } }             Next just open(or create) Index view for Home controller and add the following code,  @model NewValidationAttributesinASPNETMVC3Future.Model.UserInformation @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2>Index</h2> <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset> <legend>UserInformation</legend> <div class="editor-label"> @Html.LabelFor(model => model.Name) </div> <div class="editor-field"> @Html.EditorFor(model => model.Name) @Html.ValidationMessageFor(model => model.Name) </div> <div class="editor-label"> @Html.LabelFor(model => model.Email) </div> <div class="editor-field"> @Html.EditorFor(model => model.Email) @Html.ValidationMessageFor(model => model.Email) </div> <div class="editor-label"> @Html.LabelFor(model => model.Website) </div> <div class="editor-field"> @Html.EditorFor(model => model.Website) @Html.ValidationMessageFor(model => model.Website) </div> <div class="editor-label"> @Html.LabelFor(model => model.CreditCard) </div> <div class="editor-field"> @Html.EditorFor(model => model.CreditCard) @Html.ValidationMessageFor(model => model.CreditCard) </div> <div class="editor-label"> @Html.LabelFor(model => model.Image) </div> <div class="editor-field"> @Html.EditorFor(model => model.Image) @Html.ValidationMessageFor(model => model.Image) </div> <p> <input type="submit" value="Save" /> </p> </fieldset> } <div> @Html.ActionLink("Back to List", "Index") </div>             Now just run your application. You will find that both client side and server side validation for the above validation attributes works smoothly.                      Summary:             Email, URL, Credit Card and File Extension input validations are very common. In this article, I showed you how you can validate these input validations into your application. I explained this with an example. I am also attaching a sample application which also includes Microsoft.Web.Mvc.dll. So you can add a reference of Microsoft.Web.Mvc assembly directly instead of doing any manual work. Hope you will enjoy this article too.   SyntaxHighlighter.all()

    Read the article

  • Custom Model Validator for MVC

    - by scottrakes
    I am trying to add a custom model validation at the property level but need to pass in two values. Below is my class definition and validation implementation. When it runs, the "value" in the IsValid method is always null. I can get this working at the class level but the property level is causing me issues. What am I missing? Event Class: public class Event { public int? EventID {get;set;} [ValidPURL("EventID", "PURLValue")] public string PURLValue { get; set; } ... } Validation Class [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] public sealed class ValidPURL : ValidationAttribute { private const string _defaultErrorMessage = "Web address already exist."; private readonly object _typeId = new object(); public ValidPURL(int eventID, string purlValue) : base(_defaultErrorMessage) { EventID = eventID; PURLValue = purlValue; } public int EventID { get; private set; } public string PURLValue { get; private set; } public override object TypeId { get { return _typeId; } } public override string FormatErrorMessage(string name) { return String.Format(CultureInfo.CurrentUICulture, ErrorMessageString, EventID, PURLValue); } public override bool IsValid(object value) { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value); object eventIDValue = properties.Find(EventID, true /* ignoreCase */).GetValue(value); object purlValue = properties.Find(PURLValue, true /* ignoreCase */).GetValue(value); [Some Validation Logic against the database] return true; } } Thank for the help!

    Read the article

  • Strange results about C++11 memory model (Relaxed ordering)

    - by Dancing_bunny
    I was testing the example in the memory model of the Anthony Williams's book "C++ Concurrency" #include<atomic> #include<thread> #include<cassert> std::atomic_bool x,y; std::atomic_int z; void write_x_then_y() { x.store(true, std::memory_order_relaxed); y.store(true, std::memory_order_relaxed); } void read_y_then_x() { while(!y.load(std::memory_order_relaxed)); if(x.load(std::memory_order_relaxed)) { ++z; } } int main() { x = false; y = false; z = 0; std::thread a(write_x_then_y); std::thread b(read_y_then_x); a.join(); b.join(); assert(z.load()!=0); } According to the explanation, relaxed operations on difference variables (here x and y) can be freely reordered. However, I repeated running the problem for more than several days. I never hit the situation that the assertion (assert(z.load()!=0);) fires. I just use the default optimization and compile the code using g++ -std=c++11 -lpthread dataRaceAtomic.cpp Does anyone actually try it and hit the assertion? Could anyone give me an explanation about my test results? BTW, I also tried the version without using the atomic type, I got the same result. Currently, both programs are running healthily. Thanks.

    Read the article

  • cakephp - form for belongsTo Model

    - by user1511579
    I createt the following model to link 2 relational tables: class Ficha extends AppModel { //public $useTable = 'ficha_seg'; var $primaryKey = 'id_ficha'; var $name = 'Ficha'; var $belongsTo = array( 'Perigo' => array( 'className' => 'Perigo', 'foreignKey' => false, 'conditions' => 'Perigo.id_fichas = Ficha.id_ficha' ) ); } Now, i have a form that requires data from the class Ficha, and then is redirected to another ctp page where i will input the data for the table "Perigos". However, since i'm still a newbie in cakephp i'm having difficult building that second form to insert the data on the table "Perigos". Here goes the code i built at the moment related to the second form: FichasController.php (the method where is it supposed to save the data on the table "Perigos": public function preencher_ficha(){ if ($this->request->is('ficha')) { $this->Ficha->create(); if ($this->Ficha->Perigo->save($this->request->data)) { $last_id=$this->Ficha->getLastInsertID(); $this->Session->setFlash('Your post has been updated '.$last_id.'.'); //$this->redirect(array('action' => 'preencher_ficha')); } else { $this->Session->setFlash('Unable to qualquer coisa your post.'); } } } The preencher_ficha.ctp file with the form: echo $this->Form->create('Ficha->Perigo', array('action' => 'index')); echo $this->Form->input('class_subst', array('label' => 'Classificação:')); echo $this->Form->input('simbolos_perigo', array('label' => 'Símbolos:')); echo $this->Form->input('frases_r', array('label' => 'Frases:')); echo $this->Form->end('Finalizar Ficha'); Here i guess the create part is wrong, but i think i have errors too in the controller part.

    Read the article

  • 301 redirect and page ranking

    - by justin
    Say I have a site 123example.com, with roughly 100 backlinks, which has increased from a google page 27 to page 12 for my keywords over the last month and continues toward the top 10... I have another domain 123.com, which has roughly 30 backlinks, that just points to the 1st domain. I would like to use 123.com as the primary domain and use a 301 redirect on 123example.com. Would I have to start my link building back over again for 123.com or will the backlinks and PR with the 301 redirect of 123example.com transfer over to the new domain?

    Read the article

  • DDD and filtering

    - by tikhop
    I am developing an app in ddd maner. So I have a complex domain model. Suppose I have a Fare object and Airline. Each Airline should contain several or much more Fares. My UI should represent Model (only small part of complex model) as a list of Airline, when the user select the Airline, I must show the list of Fares. User can filtering the Fares (by travel time, cost, etc.). What is the appropriate place for filtering Fares and Airlines? I am assuming that I should do it in ViewModel. Like: My domain model has wrapped with Service Layer - UI works with ViewModel - ViewModel obtain data from Service Layer filtering it and create DTO objects for UI. Or I'm wrong?

    Read the article

  • Can I buy a .CA if I have no affiliation with Canada?

    - by neezer
    Well, the title says it all. It seems by CIRA (http://www.cira.ca/home-en/?lang=en) that I cannot, but the website doesn't make it explicitly clear how they check or anything like that... I have a domain name that I'd love to register for a business that will likely start in the US (where I'm based), but hopefully will grow globally (probably including Canada), but I want to build a brand around the domain name, and I do not want to get slammed by Canada yanking the domain name back if they discover I have no connection there. I only have experience with .com and .us domain names, so this is new territory for me. Any advice?

    Read the article

  • What is the proper way to setup Google Apps email accounts for a subdomain?

    - by binaryorganic
    Let's say I've registered domain.com at enom and set it up to use Google Apps for email by rerouting DNS to enom's servers and editing the MX records there. That works flawlessly. Now let's say I want to have email at a subdomain for that same site. I already have a working subdomain at the host, but I want to catch email traffic at enom before it gets that far. I've set up Google Apps as a new account for the subdomain, successfully verified domain ownership, and now they want me to update MX records. What's the right format? For domain.com, I just put @ for the hostname, and then provided the Address and Pref values that Google gave me. I tried putting subdomain.domain.com as new values under hostname for the subdomain, but that doesn't seem to work. What am I doing wrong?

    Read the article

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