Daily Archives

Articles indexed Tuesday January 4 2011

Page 9/36 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Setting up a simple proxy

    - by waiwai933
    I'm going to China for a week, and I'd prefer to be able to watch YouTube while I'm there. Since it's blocked, I presume I'm going to need a proxy. I have a Mac and a Linux box at home that I can use, but I'm not sure how complicated setting up a proxy is. From what I understand, I should be able to do it with a browser that supports HTTP 1.1 CONNECT if I connect to my machine at home. Can I do this, and if so, what browser can I use, or if I have misunderstood something, do I have any other simple solutions?

    Read the article

  • fedora13 mouse change -I Beam

    - by tom smith
    hi. sorry to have to ask such a basic question!! i've got fedora 13, trying to figure out how to change the "I Beam" pointer. earlier, i had a "thin" "I Beam" pointer in my gedit/term windows. now, I have a "thicker/shadow" kind of "I Beam" pointer when i move the mouse over the gedit/term windows. obviously, i've made some change, but i can't figure out what I changed, or where this attribute is set. i've checked google/irc, as well as looked through the "system-preferences-appearance" with no luck.. i saw the customize part of the gui, and could resize the "arrow" but nothing for the "I-Beam". this isn't critical, but it is anoying!! any thoughts/pointers would be helpful. thanks

    Read the article

  • Laptop connects to other network but not to my home wireless

    - by Nilesh
    My home network's wireless SSID is say "XYZ" I also have an ethernet wire from the same router. I have two laptops A and B Earlier both A and B were able to connect to my home internet through the ethernet and wireless. Suddenly, the laptop B can no longer connect to XYZ or through ethernet. When I do plug the wire, i get the connection icon all green but when I try to access any web page it errors out (page not found) But strangely laptop B connects to my neighbours wireless SSID "ABC". I have also tested laptop B with other networks and it connects fine. Laptop A and many other devices still connect fine with my home wireless "XYZ" Strange thing is when my laptop B connects wireless through XYz, it gets the IP address but then none of the browsers (chrome,firefox, IE) can show any web pages. What settings should I be checking on laptop B that is preventing it to connect to my home internet. Thank you

    Read the article

  • big lie about programmer [closed]

    - by gcc
    About computer engineering/ computer science, Can you give me big lie ? ex : - There is no need to attend school ( study computer engineering ). Because every one can code ( write program ) - Programmer cannot do web design , they can only write code - there are no difference between software engineer and coder EDIT: A lie is a type of deception in the form of an untruthful statement, especially with the intention to deceive others. Why someone try to deceive other people especially customer ? I think they try to prove they are real computer engineer without having diploma in computer science. If you look in that manner to my answer you can easily understand what I want

    Read the article

  • How to use XDMCP+GDM and Xnest?

    - by João Pinto
    I have been trying to enable XDMCP on GDM without much success. Following some instructions I have edited /etc/gdm/custom.conf and added: [daemon] RemoteGreeter=/usr/lib/gdm/gdm-xdmcp-chooser-slave [xdmcp] Enable=true Then restarted gdm and tried to connect both locally and from a remote system with: Xnest :1 -query localhost Xnest :1 -query remote_system_hostname I just get a black screen instead of the GDM window as expected. I am missing something ?

    Read the article

  • How can I change the "timeout" duration for Nautilus "find the filename as you type" feature?

    - by fred.bear
    I often get stalled by the long timeout while typeing the first few letters of a file name in Nautilus... The current timeout seems to be 5 seconds. I'd prefer 1 second ...(as per item 2 on this page about Response Times) I don't use the mouse much, which means I either wait, or press Escape, when I don't find the file... I realize that this is a feature to some, but I'd rather not wait. Is there any way to change this timeout behaviour?

    Read the article

  • JQuery: how to store records id for data from ajax query in dynamicly created html elements

    - by grapkulec
    Probably question title is rather cryptic but I will try to explain myself here so please bare with me :) Let's assume this configuration: server-side is PHP application responding for requests with data (list of items, single item details, etc.) in json format client-side is JQuery application sending ajax request to that PHP app and creating html content corresponding with received data So, for example: client requests "list of all animals with names staring with 'A'", gets the json response from server, and for every "animal" creates some html gizmo like div with animal description or something like that. It doesn't really matter what html element it will be but it has to point exactly to specific record by "containing" id of that record. And here is my dilemma: is it good solution to use "id" property for that? So it would be like: <div id="10" class="animal"> <p> This is animal of very mysterious kind... </p> </div> <div id="11" class="animal"> <p> And this one is very common to our country... </p> </div> where id="10" is of course indication that this is representation of record with id = 10. Or maybe I should store this record id in some custom made tag like <record_id>10</record_id> and leave an "id" strictly for what it was meant to be (css selector)? I need that record id for further stuff like updating database with some user input or deleting some of "animals" or creating new ones or anything that will be needed. All manipulations will be done with JQuery and ajax requests and responses will be visualized also with dynamic creation of html interface. I'm sure that somebody had to deal with that kind of stuff before so I would be grateful for some tips on that topic.

    Read the article

  • How to use a scope in combination with a Model method?

    - by Bjorn
    Hi all, I'm currently working on some scope filters, and I'd like to have it filter on a method (don't know how to name it otherwise). My code: class Product < ActiveRecord::Base def price_with_discount price-discount.to_f end scope :by_price, lambda {|min,max|{ :conditions => { :price_with_discount => min.to_f..max.to_f }}} end This doesn't work: "No attribute named price_with_discount exists for table products". How can I trick my scope into using the method I defined instead of searching for a column named price_with_discount? Bjorn

    Read the article

  • Monorail - Form submission using GET instead of POST

    - by Septih
    Hello, I'm writing some additions to a Castle MonoRail based site involving an Add and an Edit form. The add form works fine and uses POST but the edit form uses GET. The only major difference I can see is that the edit method is called with the Id of the object being edited in the query string. When the submit button is pressed on the edit form, the only argument passed is this object Id again. Here is the code for the edit form: <form action="edit.ashx" method="post"> <h3>Coupon Description</h3> <textarea name="comments" width="200">$comments</textarea> <br/><br/> <h3>Coupon Actions</h3> <br/> <div>Give Stories</div> <ul class="checklist" style="overflow:auto;height:144px;width:100%"> #foreach ($story in $stories.Values) <li> <label> #set ($associated = "") #foreach($storyId in $storyIds) #if($story.Id == $storyId) #set($associated = " checked='true'") #end #end <input type="checkbox" name="chk_${story.Id}" id="chk_${story.Id}" value="true" class="checkbox" $associated/> $story.Name </label> </li> #end </ul> <br/><br/> <div>Give Credit Amount</div> <input type="text" name="credit" value="$credit" /> <br/><br/> <h3>Coupon Uses</h3> <input type="checkbox" name="multi" #if($multi) checked="true" #end /> Multi-Use Coupon?<br/><br/> <b>OR</b> <br/> <br/> Number of Uses per Coupon: <input type="text" name="uses" value="$uses" /> <br/> <input type="submit" name="Save" /> </form> The differences between this and the add form is the velocity stuff to do with association and the values of the inputs being from the PropertyBag. The Method dealing with this on the controller starts like this: public void Edit(int id) { Coupon coupon = Coupon.GetRepository(User.Site.Id).FindById(id).Value; if(coupon == null) { RedirectToReferrer(); return; } IFutureQueryOfList<Story> stories = Story.GetRepository(User.Site.Id).OnlyReturnEnabled().FindAll("Name", true); if (Params["Save"] == null) { ... } } It reliably gets called but a breakpoint on the Params["Save"] lets me see that the HttpMethod is "GET" and the only arguments passed (In the Form and the Request) are the object Id and additional HTTP headers. At the end of the day I'm not that familiar with MonoRail and this may be a stupid mistake on my behalf, but I would very much appreciate being made a fool out of if it fixes the problem! :) Thanks

    Read the article

  • java GC periodically enters into several full GC cycles

    - by Peter
    Environment: sun JDK 1.6.0_16 vm settings: -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -Xms1024 -Xmx1024M -XX:MaxNewSize=448m -XX:NewSize=448m -XX:SurvivorRatio=4(6 also checked) -XX:MaxPermSize=128M OS: windows server 2003 processor: 4 cores of INTEL XEON 5130, 2000 Hz my application description: high intensity of concurrent(java 5 concurrency used) operations completed each time by commit to oracle. it's about 20-30 threads run non stop, doing tasks. application runs in JBOSS web container. My GC starts work normally, I see a lot of small GCs and all that time CPU shows good load, like all 4 cores loaded to 40-50%, CPU graph is stable. Then , after 1 min of good work, CPU starts drop to 0% on 2 cores from 4, it's graph becomes unstable, goes up and down("teeth"). I see, that my threads work slower(I have monitoring), I see that GC starts produce a lot of FULL GC during that time and next 4-5 minutes this situation remains as is, then for short period of time, like 1 minute, it gets back to normal situation, but shortly after that all bad thing repeats. Question: Why I have so frequent full GC??? How to prevent that? I played with SurvivorRatio - does not help. I noticed, that application behaves normally until first FULL GC occurs, while I have enough memory. Then it runs badly. my GC LOG: starts good then long period of FULL GCs(many of them) 1027.861: [GC 942200K-623526K(991232K), 0.0887588 secs] 1029.333: [GC 803279K(991232K), 0.0927470 secs] 1030.551: [GC 967485K-625549K(991232K), 0.0823024 secs] 1030.634: [GC 625957K(991232K), 0.0763656 secs] 1033.126: [GC 969613K-632963K(991232K), 0.0850611 secs] 1033.281: [GC 649899K(991232K), 0.0378358 secs] 1035.910: [GC 813948K(991232K), 0.3540375 secs] 1037.994: [GC 967729K-637198K(991232K), 0.0826042 secs] 1038.435: [GC 710309K(991232K), 0.1370703 secs] 1039.665: [GC 980494K-972462K(991232K), 0.6398589 secs] 1040.306: [Full GC 972462K-619643K(991232K), 3.7780597 secs] 1044.093: [GC 620103K(991232K), 0.0695221 secs] 1047.870: [Full GC 991231K-626514K(991232K), 3.8732457 secs] 1053.739: [GC 942140K(991232K), 0.5410483 secs] 1056.343: [Full GC 991232K-634157K(991232K), 3.9071443 secs] 1061.257: [GC 786274K(991232K), 0.3106603 secs] 1065.229: [Full GC 991232K-641617K(991232K), 3.9565638 secs] 1071.192: [GC 945999K(991232K), 0.5401515 secs] 1073.793: [Full GC 991231K-648045K(991232K), 3.9627814 secs] 1079.754: [GC 936641K(991232K), 0.5321197 secs]

    Read the article

  • Ruby DEPRECATION WARNING: You are using the old router DSL which will be removed in Rails 3.1.

    - by user297221
    Hi guys. I am using rails 3 and at the moment i am writing tests for my application. I get this weird deprecation warning: DEPRECATION WARNING: You are using the old router DSL which will be removed in Rails 3.1. Please check how to update your routes file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/. (called from at /Users/jeljer/Dropbox/webCMS/config/environment.rb:6) Of course my routes file is this: WebCMS::Application.routes.draw do #... end but no luck. If I look at the place what it is pointing to in my enviroment.rb: WebCMS::Application.initialize! I did a gem cleanup without any luck. Does anybody have an idea? ps. i am using rvm with ruby 1.9.2

    Read the article

  • catching a deadlock in a simple odd-even sending

    - by user562264
    I'm trying to solve a simple problem with MPI, my implementation is MPICH2 and my code is in fortran. I have used the blocking send and receive, the idea is so simple but when I run it it crashes!!! I have absolutely no idea what is wrong? can anyone make quote on this issue please? there is a piece of the code: integer,parameter::IM=100,JM=100 REAL,ALLOCATABLE ::T(:,:),TF(:,:) CALL MPI_COMM_RANK(MPI_COMM_WORLD,RNK,IERR) CALL MPI_COMM_SIZE(MPI_COMM_WORLD,SIZ,IERR) prv = rnk-1 nxt = rnk+1 LIM = INT(IM/SIZ) IF (rnk==0) THEN ALLOCATE(TF(IM,JM)) prv = MPI_PROC_NULL ELSEIF(rnk==siz-1) THEN NXT = MPI_PROC_NULL LIM = LIM+MOD(IM,SIZ) END IF IF (MOD(RNK,2)==0) THEN CALL MPI_SEND(T(2,:),JM+2,MPI_REAL,PRV,10,MPI_COMM_WORLD,IERR) CALL MPI_RECV(T(1,:),JM+2,MPI_REAL,PRV,20,MPI_COMM_WORLD,STAT,IERR) ELSE CALL MPI_RECV(T(LIM+2,:),JM+2,MPI_REAL,NXT,10,MPI_COMM_WORLD,STAT,IERR) CALL MPI_SEND(T(LIM+1,:),JM+2,MPI_REAL,NXT,20,MPI_COMM_WORLD,IERR) END IF as I understood even processes are not receiving anything while the odd ones finish sending successfully, in some cases when I added some print to observe what is going on I saw that the variable NXT is changing during the sending procedure!!! for example all the odd process was sending message to process 0 not their next one!

    Read the article

  • How to implement openId java web based application?

    - by satya
    In my web application i want to implement the OpenId just like stackoverflow.com have to login to its web-site. In details you find while login to stackoverflow.com So when if one choose google then it allow the uses to log in through google account. Please tell me how to implement it in java web application in details. Is there any single api for login through different website like(yahoo,google,facebook,etc) Thanks

    Read the article

  • Function to even out multiple arrays

    - by Moak
    Assume I have a function evenOut($array, $limit){ //returns exactly $limit items } and this data $animals = array(); $animals['barn'] = array_fill(0,20, 'b'); $animals['forest'] = array_fill(0,20, 'f'); $animals['house'] = array_fill(0,20, 'h'); $animals['mountain'] = array_fill(0,20, 'm'); I want to return a maximum of 10 animals, however they should be spread out evenly among the locations they come from. so if i did evenOut($animals,8); i'd get 2 of each('b','b','f','f','h','h','m','m',) evenOut($animals,2); should return ('b','f') if I have this data $animals = array(); $animals['barn'] = array_fill(0,1, 'b'); $animals['forest'] = array_fill(0,3, 'f'); $animals['house'] = array_fill(0,8, 'h'); $animals['mountain'] = array_fill(0,1, 'm'); evenOut($animals,8); expected result would be ('b','f','f','f','h','h','h','m',) evenOut($animals,10); expected result would be ('b','f','f','f','h','h','h','h','h','m',) $animals = array(); $animals['barn'] = array_fill(0,0, 'b'); $animals['forest'] = array_fill(0,3, 'f'); evenOut($animals,10); expected result would be ('f','f','f') I'm not sure how I should approach this, I am hoping there is a simple way

    Read the article

  • input default value Jquery

    - by venom
    $(".box_yazi2").each(function() { var default_value = this.value; $(this).css('color', '#555'); // this could be in the style sheet instead $(this).focus(function() { if(this.value == default_value) { this.value = ''; $(this).css('color', '#000'); } }); $(this).blur(function() { if(this.value == '') { $(this).css('color', '#555'); this.value = default_value; } }); }); }); This function of default value of input doesnt work in FF, but perfectly works in IE and ofcourse the input itself looks like this: <input type="text" class="box_yazi2" id="konu" name="konu" value="Bos" />

    Read the article

  • Monitor Screen Independent Forms size & Control Size?

    - by Thomas
    in various case i have seen that when we run apps in various pc with different monitor size then win form behave differently. sometime the form get bigger and as a result few control on that form will not visible.so please tell me how to design win apps in such a way that what ever the monitor size would be the form size and control position will behave same way in all the pc monitor size.please guide me.thanks.

    Read the article

  • Find next and previous link in a hierarchy

    - by rebellion
    I have a hierarchy with links nested in list element like this: <ul> <li><a href="#">Page 1</a> <ul> <li><a href="#">Page 1.1</a></li> <li><a href="#">Page 1.2</a> <ul> <li><a href="#">Page 1.2.1</a></li> <li><a href="#">Page 1.2.2</a></li> </ul> </li> <li><a href="#">Page 1.3</a></li> </ul> </li> <li><a href="#">Page 2</a> <ul> <li><a href="#">Page 2.1</a></li> <li><a href="#">Page 2.2</a></li> </ul> </li> <li><a href="#">Page 3</a> <ul> <li><a href="#">Page 3.1</a> <ul> <li><a href="#">Page 3.1.1</a></li> <li><a href="#">Page 3.1.2</a></li> </ul> <li><a href="#">Page 3.2</a></li> <li><a href="#">Page 3.3</a></li> <ul> <li><a href="#">Page 3.1.1</a></li> <li><a href="#">Page 3.1.2</a></li> </ul> </li> </ul> </li> </ul> Basically just a sitemap. But I want to make next and previous links with jQuery, which finds the active page you're on (probably by checking for a class), and finding the previous and next anchor element (taking no regards of the hierarchy). I've tried with next(), previous() and find() but can't seem to get it to work. What is the easiest way to get the anchor elements before and after the current one?

    Read the article

  • Django updating a single model

    - by Hellnar
    Hello How can I use the update() method on a single model which I retrieved via Queryset.get() ? It seems like model. Model doesn't have an update() method yet I cannot invoke .save() as I have a pre-save signals which messes things up. EDIT: An idea would be passing some parameter to the save method and catching it at the pre_save signal, so that I can understand the purpose, how can this be done ? Thanks

    Read the article

  • gwt maven war plugin configuration problem

    - by Din
    I am developing a gwt application in maven. In this I am using maven war plugin. Everything works fine. When I give mvn install command it builds abc.war file in target folder. But it is not copying compiled javascript files ("module1" and "module2" directories present in target) to war directory. I want to get newly compiled javascript files in war directory. How to achieve this? pom.xml file <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>example</groupId> <artifactId>example</artifactId> <packaging>war</packaging> <version>12</version> <name>gwt-maven-archetype-project</name> <properties> <!-- convenience to define GWT version in one place --> <gwt.version>2.1.0</gwt.version> <noServer>false</noServer> <skipTest>true</skipTest> <gwt.localWorkers>1</gwt.localWorkers> <JAVA_HOME>C:\Program Files\Java\jdk1.6.0_22</JAVA_HOME> <!-- convenience to define Spring version in one place --> </properties> <dependencies> <!-- Required dependencies--> </dependencies> <build> <finalName>abc</finalName> <outputDirectory>war/WEB-INF/classes</outputDirectory> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <verbose>true</verbose> <executable>${JAVA_HOME}\bin\java.exe</executable> <compilerVersion>1.6</compilerVersion> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.1.0</version> <executions> <execution> <goals> <goal>compile</goal> <goal>generateAsync</goal> <goal>mergewebxml</goal> <goal>test</goal> </goals> </execution> </executions> <configuration> <servicePattern>**/client/**/*Service.java</servicePattern> <noServer>${noServer}</noServer> <noserver>${noServer}</noserver> <modules> <module>com.abc.example.Module1</module> <module>com.abc.example.Module2</module> </modules> <runTarget>com.abc.example.Module1/module1.jsp</runTarget> <port>8080</port> <extraJvmArgs>-Xmx1024m -Xms1024m -Xss1024k -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs> <hostedWebapp>war</hostedWebapp> <warSourceDirectory>${basedir}/war</warSourceDirectory> <webXml>${basedir}/war/WEB-INF/web.xml</webXml> </configuration> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>process-classes</phase> <configuration> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1-beta-1</version> <configuration> <warSourceDirectory>${basedir}/war</warSourceDirectory> <webXml>${basedir}/war/WEB-INF/web.xml</webXml> <!--<webXml>src/main/webapp/WEB-INF/web.xml</webXml>--> <containerConfigXML>war/WEB-INF/classes/context/context.xml</containerConfigXML> <warSourceExcludes>.gwt-tmp/**</warSourceExcludes> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <executions> <execution> <goals> <goal>clean</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.4.2</version> <configuration> <argLine>-Xmx1024m</argLine> <skipTests>${skipTest}</skipTests> </configuration> </plugin> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.2</version> <configuration> <filesets> <fileset> <directory>war/module1</directory> </fileset> <fileset> <directory>war/module2</directory> </fileset> <fileset> <directory>war/WEB-INF/lib</directory> </fileset> </filesets> </configuration> </plugin> </plugins> <resources> <resource> <directory>src/main/resources</directory> <excludes> <exclude>**/public/resources/**</exclude> <exclude>**/public/images/**</exclude> </excludes> <filtering>true</filtering> </resource> </resources> <filters> <filter>src/main/resources/build/build-${env}.properties</filter> </filters> </build> <profiles> <profile> <activation> <activeByDefault>true</activeByDefault> </activation> <id>dev</id> <properties> <env>dev</env> </properties> </profile> </profiles> <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> </plugin> </plugins> </reporting>

    Read the article

  • implementing runat in HtmlTextWriterAttribute

    - by user525116
    Hi dear friends, I have a custom asp.net control. public class Window : WebControl { protected override void RenderContents(HtmlTextWriter wr) { wr.AddAttribute("runat", "server",true); wr.AddAttribute("id", this.UniqueID, false); wr.RenderBeginTag(HtmlTextWriterTag.Div); wr.RenderEndTag(); wr.WriteLine(); base.RenderContents(wr); } } And this is my result after compile and use the control: <cc1:Window ID="Window1" runat="server" /> Use standard definition DIV with standard format: <div runat="server" id="aaaa"></div> After compile my web page to use this web custom control, this is render browser source of my web page: <span id="Window1"><div runat="server" id="Window1"></div></span> <div id="aaaa"></div>

    Read the article

  • Mixing Matplotlib patches with polar plot?

    - by Roger
    I'm trying to plot some data in polar coordinates, but I don't want the standard ticks, labels, axes, etc. that you get with the Matplotlib polar() function. All I want is the raw plot and nothing else, as I'm handling everything with manually drawn patches and lines. Here are the options I've considered: 1) Drawing the data with polar(), hiding the superfluous stuff (with ax.axes.get_xaxis().set_visible(False), etc.) and then drawing my own axes (with Line2D, Circle, etc.). The problem is when I call polar() and subsequently add a Circle patch, it's drawn in polar coordinates and ends up looking like an infinity symbol. Also zooming doesn't seem to work with the polar() function. 2) Skip the polar() function and somehow make my own polar plot manually using Line2D. The problem is I don't know how to make Line2D draw in polar coordinates and haven't figured out how to use a transform to do that. Any idea how I should proceed?

    Read the article

  • Default class for SQLAlchemy single table inheritance

    - by eclaird
    I've set up a single table inheritance, but I need a "default" class to use when an unknown polymorphic identity is encountered. The database is not in my control and so the data can be pretty much anything. A working example setup: import sqlalchemy as sa from sqlalchemy import orm engine = sa.create_engine('sqlite://') metadata = sa.MetaData(bind=engine) table = sa.Table('example_types', metadata, sa.Column('id', sa.Integer, primary_key=True), sa.Column('type', sa.Integer), ) metadata.create_all() class BaseType(object): pass class TypeA(BaseType): pass class TypeB(BaseType): pass base_mapper = orm.mapper(BaseType, table, polymorphic_on=table.c.type, polymorphic_identity=None, ) orm.mapper(TypeA, inherits=base_mapper, polymorphic_identity='A', ) orm.mapper(TypeB, inherits=base_mapper, polymorphic_identity='B', ) Session = orm.sessionmaker(autocommit=False, autoflush=False) session = Session() Now, if I insert a new unmapped identity... engine.execute('INSERT INTO EXAMPLE_TYPES (TYPE) VALUES (\'C\')') session.query(BaseType).first() ...things break. Traceback (most recent call last): File "<stdin>", line 1, in <module> File ".../SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/orm/query.py", line 1619, in first ret = list(self[0:1]) File ".../SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/orm/query.py", line 1528, in __getitem__ return list(res) File ".../SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/orm/query.py", line 1797, in instances rows = [process[0](row, None) for row in fetch] File ".../SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/orm/mapper.py", line 2179, in _instance _instance = polymorphic_instances[discriminator] File ".../SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/util.py", line 83, in __missing__ self[key] = val = self.creator(key) File ".../SQLAlchemy-0.6.5-py2.6.egg/sqlalchemy/orm/mapper.py", line 2341, in configure_subclass_mapper discriminator) AssertionError: No such polymorphic_identity u'C' is defined What I expected: >>> result = session.query(BaseType).first() >>> result <BaseType object at 0x1c8db70> >>> result.type u'C' I think this used to work with some older version of SQLAlchemy, but I haven't been keeping up with the development lately. Any pointers on how to accomplish this?

    Read the article

  • Link doesnt work in FF

    - by venom
    Here is the link: <a href="javascript://" onClick="print_gonder();"><img src="/images/print.gif" title="Gönder" border="0"></a> and its function print_gonder: function print_gonder() { var satirsayisi=document.list_basketww.row_count.value; var amnt=new Array(satirsayisi); var prc=new Array(satirsayisi); var kdv=new Array(satirsayisi); var kon=new Array(satirsayisi); var yap=new Array(satirsayisi); var ona=new Array(satirsayisi); var ode=new Array(satirsayisi); var tes=new Array(satirsayisi); for (i=0; i<satirsayisi; i++) { amnt[i]=eval("document.getElementById('amount" + (i+1) + "')").value; prc[i]=filterNum(eval("document.getElementById('price" + (i+1) + "')").value); kdv[i]=eval("document.getElementById('tax_dif" + (i+1) + "')").value; kon=eval("document.getElementById('konu')").value; yap=eval("document.getElementById('yapan')").value; ona=eval("document.getElementById('onay')").value; ode=eval("document.getElementById('odeme')").value; tes=eval("document.getElementById('teslim')").value; } windowopen('<cfoutput>#request.self#?fuseaction=objects2.popup_sale_propose&print=true#page_code#&amnt='+amnt+'&prc='+prc+'&kdv='+kdv+'&konu='+kon+'&yapan='+yap+'&onay='+ona+'&odeme='+ode+'&teslim='+tes+'</cfoutput>','page'); } The problem is that this link doesnt work in FF but work in IE, but if i change the function into something like this: <a href="javascript://" onClick="<cfoutput>windowopen('#request.self#?fuseaction=objects2.popup_sale_propose&print=true#page_code#','page')</cfoutput"><img src="/images/print.gif" title="Gönder" border="0"></a> it perfectly works in all the browsers.. i think that the problem is in defining the values of the functions, the FF just doesnt understand them... btw, the system is Workcube and it uses the Cold Fusion.

    Read the article

  • Updating progress dialog in Activity from AsyncTask

    - by Laimoncijus
    In my app I am doing some intense work in AsyncTask as suggested by Android tutorials and showing a ProgressDialog in my main my activity: dialog = ProgressDialog.show(MyActivity.this, "title", "text"); new MyTask().execute(request); where then later in MyTask I post results back to activity: class MyTask extends AsyncTask<Request, Void, Result> { @Override protected Result doInBackground(Request... params) { // do some intense work here and return result } @Override protected void onPostExecute(Result res) { postResult(res); } } and on result posting, in main activity I hide the dialog: protected void postResult( Result res ) { dialog.dismiss(); // do something more here with result... } So everything is working fine here, but I would like to somehow to update the progress dialog to able to show the user some real progress instead just of dummy "Please wait..." message. Can I somehow access the progress dialog from MyTask.doInBackground, where all work is done? As I understand it is running as separate Thread, so I cannot "talk" to main activity from there and that is why I use onPostExecute to push the result back to it. But the problem is that onPostExecute is called only when all work is already done and I would like to update progress the dialog in the middle of doing something. Any tips how to do this?

    Read the article

  • Is there a way to access Joomla 1.5 user variables (like user id) from a Flex 4 application using a PHP Data Service?

    - by Zachary G. Schroeder
    I have written a script (in two files) that correctly displays a Joomla user id, like this: //this is testy.php define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(FILE)); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); $mainframe =& JFactory::getApplication('site'); $id = JFactory::getUser()-id; The above file is located in the Joomla root folder. The other file is in a different directory and is as follows: //this is testid.php include '../../joomla/testy.php'; echo $id; However, and here is the rub, when I change the "echo" to a "return" and put the second code snippet inside my Flex 4 Data Service script file, like this... function getUserId() { include '../../joomla/testy.php'; return $id; } ...I get a Flex error that says this: Fatal error: Class 'JRequest' not found in /var/www/html/joomla/libraries/joomla/import.php on line 33 I am extremely confused by this error and would appreciate any suggestions that the stackoverflow community may have. Thanks so much! Zach

    Read the article

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