Search Results

Search found 11197 results on 448 pages for 'related'.

Page 14/448 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Whats wrong with this function? .each related

    - by Ritz
    When I uncomment the alert the data is there... like: { 'Huishoudelijke hulp': 'Huishoudelijke hulp', 'Verpleging thuis': 'Verpleging thuis', 'Verzorging thuis': 'Verzorging thuis', '24 uurs zorg': '24 uurs zorg', 'Ondersteunende begeleiding': 'Ondersteunende begeleiding', } But instead of populating the key and the value it takes the whole var and start to create a key and value pair for each character. You can see this in action here: http://www.zorgzuster-zeeland.nl/site/static/calendar_test.php create a task in the calendar and then try to edit the task by clicking on it. It should populate the dropdown field properly. When i create a static var with the same values the dropdown works. static variable var zvmlist = { 'Huishoudelijke hulp': 'Huishoudelijke hulp', 'Verpleging thuis': 'Verpleging thuis', 'Verzorging thuis': 'Verzorging thuis', '24 uurs zorg': '24 uurs zorg', 'Ondersteunende begeleiding': 'Ondersteunende begeleiding', }; This is my function, anybody has a clue? $.get('get_zorgvormen.php', function(zvmlist) { //alert("Data Loaded: " + zvmlist); $.each(zvmlist, function(key, value) { var selected=''; if(key==eventdata.title){var selected='selected' } $('<option value="'+key+'" '+selected+'>'+value+'</option>').appendTo($('#calendar_edit_entry_form_title')); }); });

    Read the article

  • unistd.h related problem when compiling bison & flex program under vc++

    - by Eric
    I'm using bison & flex (downloaded via cygwin) with vc++. When I compile the program I got an error: ...: fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory The corresponding code in the flex-generated file is: #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ /* %if-c-only */ #include <unistd.h> /* %endif */ /* %if-c++-only */ /* %endif */ #endif If I define YY_NO_UNISTD_H in the flex file(.l) this error will disappear, but I get several other errors: ...: error C2447: '{' : missing function header (old-style formal list?) ...: warning C4018: '<' : signed/unsigned mismatch ...: error C3861: 'isatty': identifier not found How can I fix this problem? All these errors occur in the flex-generated scanner. I know it's because unistd.h doesn't exist in windows. Do I have to write my own unistd.h? If so how to write it in order to eliminate those errors?

    Read the article

  • Interesting questions related to lighttpd on Amazon EC2

    - by terence410
    This problem appeared today and I have no idea what is going on. Please share you ideas. I have 1 EC2 DB server (MYSQL + NFS File Sharing + Memcached). And I have 3 EC2 Web servers (lighttpd) where it will mounted the NFS folders on the DB server. Everything going smoothly for months but suddenly there is an interesting phenomenon. In every 8 minutes to 10 minutes, PHP file will be unreachable. This will last about 1 minute and then back to normal. Normal files like .html file are unaffected. All servers have the same problem exactly at the same time. I have spent one whole day to analysis the reason. Finally, I find out when the problem appear, the file descriptor of lighttpd suddenly increased a lot. I used ls /proc/1234/fd | wc -l to check the number of fd. The # of fd is around 250 in normal time. However, when the problem appeared, it will be raised to 1500 and then back to normal. It sounds funny, right? Do you have any idea what's going on? ======================== The CPU graph of one of the web server.

    Read the article

  • Automatic testing of GUI related private methods

    - by Stein G. Strindhaug
    When it comes to GUI programming (at least for web) I feel that often the only thing that would be useful to unit test is some of the private methods*. While unit testing makes perfect sense for back-end code, I feel it doesn't quite fit the GUI classes. What is the best way to add automatic testing of these? * Why I think the only methods useful to test is private: Often when I write GUI classes they don't even have any public methods except for the constructor. The public methods if any is trivial, and the constructor does most of the job calling private methods. They receive some data from server does a lot of trivial output and feeds data to the constructor of other classes contained inside it, adding listeners that calls a (more or less directly) calls the server... Most of it pretty trivial (the hardest part is the layout: css, IE, etc.) but sometimes I create some private method that does some advanced tricks, which I definitely do not want to be publicly visible (because it's closely coupled to the implementation of the layout, and likely to change), but is sufficiently complicated to break. These are often only called by the constructor or repeatedly by events in the code, not by any public methods at all. I'd like to have a way to test this type of methods, without making it public or resorting to reflection trickery. (BTW: I'm currently using GWT, but I feel this applies to most languages/frameworks I've used when coding for GUI)

    Read the article

  • Select those objects whose related objects IDs are *all* in given string

    - by Jannis
    Hi Django people, I want to build a frontend to a recipe database which enables the user to search for a list of recipes which are cookable with the ingredients the user supplies. I have the following models class Ingredient(models.Model): name = models.CharField(max_length=100, unique=True) slug = models.SlugField(max_length=100, unique=True) importancy = models.PositiveSmallIntegerField(default=4) […] class Amount(models.Model): recipe = models.ForeignKey('Recipe') ingredient = models.ForeignKey(Ingredient) […] class Rezept(models.Model): name = models.CharField(max_length=100) slug = models.SlugField() instructions = models.TextField() ingredients = models.ManyToManyField(Ingredient, through=Amount) […] and a rawquery which does exactly what I want: It gets all the recipes whose required ingredients are all contained in the list of strings that the user supplies. If he supplies more than necessary, it's fine too. query = "SELECT *, COUNT(amount.zutat_id) AS selected_count_ingredients, (SELECT COUNT(*) FROM amount WHERE amount.recipe_id = amount.id) AS count_ingredients FROM amount LEFT OUTER JOIN amount ON (recipe.id = recipe.recipe_id) WHERE amount.ingredient_id IN (%s) GROUP BY amount.id HAVING count_ingredient=selected_count_ingredient" % ",".join([str(ingredient.id) for ingredient in ingredients]) rezepte = Rezept.objects.raw(query) Now, what I'm looking for is a way that does not rely on .raw() as I would like to do it purely with Django's queryset methods. Additionally, it would be awesome if you guys knew a way of including the ingredient's importancy in the lookup so that a recipe is still shown as a result even though one of its ingredients (that has an importancy of 0) is not supplied by the user.

    Read the article

  • Rails CSV import, adding to a related table

    - by Jack
    Hi, I have a csv importing system on my app (used locally only) which parses the csv file line by line and adds the data to the database table. This is based on a tutorial here. require 'csv' def csv_import @parsed_file=CSV::Reader.parse(params[:dump][:file]) n = 0 @parsed_file.each_with_index do |row, i| next if i == 0 #ignore the first row course = Course.new course.title = row[0] course.unit_code = row[1] course.course_type = row[2] course.value = row[3] course.pass_mark = row[4] if course.save n = n+1 GC.start if n%50==0 end flash.now[:message] = "CSV Import Successful, #{n} new courses added to the database." end redirect_to(courses_url) end This is all in the courses controller and works fine. There is a relationship that courses HABTM years and years HABTM courses. In the csv file (effectively in row[5] to row[8]) are the year_id s. Is there a way that I can add this within the method above. I am confused as to how to loop over the 4 items and add them to the courses_years table. Thank you Jack

    Read the article

  • Removing related elements using XSLT 1.0

    - by pmdarrow
    I'm attempting to remove Component elements from the XML below that have File children with the extension "config." I've managed to do this part, but I also need to remove the matching ComponentRef elements that have the same "Id" values as these Components. <Fragment> <DirectoryRef Id="MyWebsite"> <Component Id="Comp1"> <File Source="Web.config" /> </Component> <Component Id="Comp2"> <File Source="Default.aspx" /> </Component> </DirectoryRef> </Fragment> <Fragment> <ComponentGroup Id="MyWebsite"> <ComponentRef Id="Comp1" /> <ComponentRef Id="Comp2" /> </ComponentGroup> </Fragment> Based on other SO answers, I've come up with the following XSLT to remove these Component elements: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" /> <xsl:template match="Component[File[substring(@Source, string-length(@Source)- string-length('config') + 1) = 'config']]" /> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> Unfortunately, this doesn't remove the matching ComponentRef elements (i.e. those that have the same "Id" values). The XSLT will remove the component with the Id "Comp1" but not the ComponentRef with Id "Comp1". How do I achieve this using XSLT 1.0?

    Read the article

  • Using Markov models to convert all caps to mixed case and related problems

    - by hippietrail
    I've been thinking about using Markov techniques to restore missing information to natural language text. Restore mixed case to text in all caps Restore accents / diacritics to languages which should have them but have been converted to plain ASCII Convert rough phonetic transcriptions back into native alphabets That seems to be in order of least difficult to most difficult. Basically the problem is resolving ambiguities based on context. I can use Wiktionary as a dictionary and Wikipedia as a corpus using n-grams and Markov chains to resolve the ambiguities. Am I on the right track? Are there already some services, libraries, or tools for this sort of thing? Examples GEORGE LOST HIS SIM CARD IN THE BUSH - George lost his SIM card in the bush tantot il rit a gorge deployee - tantôt il rit à gorge déployée

    Read the article

  • How to create instances of related models in Django

    - by sevennineteen
    I'm working on a CMSy app for which I've implemented a set of models which allow for creation of custom Template instances, made up of a number of Fields and tied to a specific Customer. The end-goal is that one or more templates with a set of custom fields can be defined through the Admin interface and associated to a customer, so that customer can then create content objects in the format prescribed by the template. I seem to have gotten this hooked up such that I can create any number of Template objects, but I'm struggling with how to create instances - actual content objects - in those templates. For example, I can define a template "Basic Page" for customer "Acme" which has the fields "Title" and "Body", but I haven't figured out how to create Basic Page instances where these fields can be filled in. Here are my (somewhat elided) models... class Customer(models.Model): ... class Field(models.Model): ... class Template(models.Model): label = models.CharField(max_length=255) clients = models.ManyToManyField(Customer, blank=True) fields = models.ManyToManyField(Field, blank=True) class ContentObject(models.Model): label = models.CharField(max_length=255) template = models.ForeignKey(Template) author = models.ForeignKey(User) customer = models.ForeignKey(Customer) mod_date = models.DateTimeField('Modified Date', editable=False) def __unicode__(self): return '%s (%s)' % (self.label, self.template) def save(self): self.mod_date = datetime.datetime.now() super(ContentObject, self).save() Thanks in advance for any advice!

    Read the article

  • Visual Studio crashes consistently on web-related projects

    - by Traveling Tech Guy
    Hi, I have a brand new VS2010 installed on a Win2008R2 machine. I started getting this error when debugging a WCF service project: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." When I started developing a web site a week later, this became consistent - I can't debug it. The stack dump reads: at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn) at Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(Object acceptedSocket) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() I tried searching online, and some recommend turning off the "Suppress JIT Optimizations" in the Debugging options - this dos not seem to make a difference. Clearly the problem is with the built in web server. But am I doing something wrong? Is there something I can do? Or is this a known bug? Thanks for your time, Guy Update 12/31: Today I tried using CassiniDev as a replacement to the original VS2010 WebServer - exact same result. My suspicion is that there's some internal conflict between VS2010, Windows Server 2008R2 and maybe the fact that it's a 64 bit OS. I switched to using IIS as my debug server - and that seems to work, with some annoying side effects. My conclusion: do not use a 64 bit server system as your dev machine. Develop on 32bit - deploy to 64bit. Side conclusion: there are some scenarios Microsoft's QA doesn't test.

    Read the article

  • cakephp read and display from more than one related table

    - by z22
    I have 2 tables Users and Artists. User: id name password city_id state_id country_id Artist: id user_id description I wish to create add and edit form(single form acts as add and edit). But on click of edit link, I wish to fill in the form fields from user as well as artist table. How do i do that? Below is my controller code: public function artist_register() { $this->country_list(); if ($this->request->is('post')) { $this->request->data['User']['group_id'] = 2; if ($this->{$this->modelClass}->saveAll($this->request->data)) { $this->redirect(array('controller' => 'Users', 'action' => 'login')); } } $this->render('artist_update'); } public function artist_update($id) { $artist = $this->{$this->modelClass}->findByuser_id($id); $artist_id = $artist[$this->modelClass]['id']; if($this->request->is('get')) { $this->request->data = $this->{$this->modelClass}->read(null, $artist_id); $this->request->data = $this->{$this->modelClass}->User->read(null, $id); } else { if($this->{$this->modelClass}->save($this->request->data)) { $this->Session->setFlash('Your Profile has been updated'); $this->redirect(array('action' => 'index')); } } } The code doesnt work. how do i solve it?

    Read the article

  • Django filter with two constraints on related model

    - by BJ Homer
    I have a django app with models as follows: A Question model An Answer model, with a ForeignKey back to the Question. (A question can have multiple answers.) A Flag model, with a ForeignKey to the Answer. (An answer can be flagged as inappropriate.) All of the above also have a user field, defining the user that created that object. I'm trying to get a list of all Questions with answers from the current user which have been flagged. I tried this: Question.objects.filter(answer__user=user).\ filter(answer__flag__isnull=True).distinct() … but I believe that will return a list of Questions with answers from the current user and with answers which have been flagged, but will not necessarily guarantee that it is the user's answer that has been flagged. Is there an easy way to do this? Basically, I want to make the answer part of the filter refer to the same answer on both of them. Please let me know if something is unclear.

    Read the article

  • Positioning decorated series of div tags on screen using offset, DOM JQUERY RELATED

    - by Calibre2010
    Hi, I am using JQuery to position a series of div tags which basically use a class inside of the tag which decorates the divs as bars. So the div is a green box based on its css specifications to the glass. I have a list of STARTING postions, a list of left coordiantes- for the starting points I wish to position my DIV say 556, 560, 600 these automatically are generated as left positions in a list I have a list of ENDING postions, a list of left coordiantes- for the ending points I wish to position my DIV say 570, 590, 610 these automatically are generated as left positions in a list now for each start and end position, the bar(green box) i want to be drawn with its appropriate width as follows. so say f is the offset or position of the start and ff the offset or position of the end : Below draws the green box based on only one start and end position LEFT. if (f.left != 0) { $("#test").html($("<div>d</div>")).css({ position: 'absolute', left: (f.left) + "px", top: (f.top + 35) + "px", width: (ff.left - f.left) + 25 + "px" }).addClass("option1"); } I am looking to loop through the list of positons in the list and draw multiple green boxs based on the positions on the screen. The above code draws just one green box from the last offset position.

    Read the article

  • getting aspect related information reg

    - by GowthamanSS
    Suppose i have these structure as class ss { public void createfile() { StreamWriter sw= new StreamWriter("d:/test.txt"); } } i need to do aspect where ever i use StreamWriter? as for as consideration i already used the below code as [assembly: MyAspect(AttributeTargetAssembly="mscorlib", AttributeTargetTypes="System.IO.File", AttributeTargetMembers="Create"] for file.create method .. it works fine .. Is there any way to solve this problem ... waiting for your response

    Read the article

  • A very strange problem related to Flash and Java

    - by Nitesh Panchal
    Hello, I have created one simple program for showing webcam of the user. It works absolutely fine when i am running without integrating it in my java web application. But as soon as i copy paste the same files in Netbeans 6.8 and try to run it. My swf file is visible but the buttons in it are totally unclickable. I get the message of allow or deny showing webcam but the buttons are not clickable. It makes my application totally useless. I thought it's a minor issue but now it's getting on my nerves. I am trying it since 3 hours but didn't find any solution. I don't think anybody faced this issue till now that's why can't seem to find any thread in any forum on it in google. I am using Netbeans 6.8, Ubuntu, Glassfish V3 and JSF. Thanks in advance :). UPDATE:- It works fine on Windows XP. Then what can be the problem with Ubuntu? Any kind of permission rights that i need to give? 2nd UPDATE:- I think this is bug with Flash. I found that this code doesn't work :- <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="VideoConferenceAdmin" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="wmode" value="opaque"/> <param name="allowFullScreen" value="false" /> <param NAME="FlashVars" VALUE="rootIp=localhost&amp;userName=admin&amp;roomName=test" /> <param name="movie" value="Conference/VideoConference.swf" /><param name="quality" value="high" /> <embed src="Conference/VideoConference.swf" wmode="window" FlashVars="rootIp=localhost&amp;userName=test&amp;roomName=test" quality="high" width="600" height="500" name="VideoConference" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> And this one works :- <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="VideoConferenceAdmin" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="wmode" value="opaque"/> <param name="allowFullScreen" value="false" /> <param NAME="FlashVars" VALUE="rootIp=localhost&amp;userName=admin&amp;roomName=test" /> <param name="movie" value="Conference/VideoConference.swf" /><param name="quality" value="high" /> <embed src="Conference/VideoConference.swf" wmode="window" FlashVars="rootIp=localhost&amp;userName=test&amp;roomName=test" quality="high" name="VideoConference" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> As you can see, just by removing the height and width attribute the panels of Flash settings work fine. I know you will find me funny but i am not. You can check out on your own if you don't trust me. Now, my question would be, can anybody tell me how do i set height and width of swf? I want it to be 600px width and 500px height. Even the style attribute doesn't work. Can i set height and width from within Flash? because without explicitly setting height and width, it looks very small. I think this should be very easy for all now. Thanks in advance :)

    Read the article

  • Fluent NHibernate - Delete a related object when no explicit relationship exists in the model

    - by John Price
    I've got an application that keeps track of (for the sake of an example) what drinks are available at a given restaurant. My domain model looks like: class Restaurant { public IEnumerable<RestaurantDrink> GetRestaurantDrinks() { ... } //other various properties } class RestaurantDrink { public Restaurant Restaurant { get; set; } public Drink { get; set; } public string DrinkVariety { get; set; } //"fountain drink", "bottled", etc. //other various properties } class Drink { public string Name { get; set; } public string Manufacturer { get; set; } //other various properties } My db schema is (I hope) about what you'd expect; "RestaurantDrinks" is essentially a mapping table between Restaurants and Drinks with some extra properties (like "DrinkVariety" tacked on). Using Fluent NHibernate to set up mappings, I've set up a "HasMany" relationship from Restaurants to RestaurantDrinks that causes the latter to be deleted when its parent Restaurant is deleted. My question is, given that "Drink" does not have any property on it that explicitly references RestaurantDrinks (the relationship only exists in the underlying database), can I set up a mapping that will cause RestaurantDrinks to be deleted if their associated Drink is deleted?

    Read the article

  • Search SQL Question Between Related Two Tables

    - by mTuran
    Hi, I am writing some kind of search engine for my web application and i have a problem. I have 2 tables first of is projects table: PROJECTS TABLE id int(11) NO PRI NULL auto_increment employer_id int(11) NO MUL NULL project_title varchar(100) NO MUL NULL project_description text NO NULL project_budget int(11) NO NULL project_allowedtime int(11) NO NULL project_deadline datetime NO NULL total_bids int(11) NO NULL average_bid int(11) NO NULL created datetime NO MUL NULL active tinyint(1) NO MUL NULL PROJECTS_SKILLS TABLE project_id int(11) NO MUL NULL skill_id int(11) NO MUL NULL For example: I want ask this query to database: 1-) Skills are 5 and 7. 2-) Order results by created 3-) project title contains "php" word. 4-) Returned rows should contain projects.* columuns. 5-) Projects should be distinct(i don't want same projects in return of query). Please write sql query that ensure these conditions. Thank You.

    Read the article

  • Using entity framework to detect changes in related table and action appropriate inserts and deletes

    - by Kohan
    Lets say i have a Person table, a Role table with a trel table PersonRoles linking them as many to many. I create a new person and assign them to 2 roles (role 1, role 3). I then want to edit this person; so i retrieve their data and bind their roles to a checkboxes. I change the values (Deselect role 1 and select role 2 instead) I then post this data back through a viewmodel. Can i then get Entity Framework to update these roles for me, as in delete the entry in PersonRoles to role 1 and then add a new entry as role 2? Or do i have to do the logic for this myself? Cheers, Kohan

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >