Examples of Article


Examples of org.pentaho.reporting.engine.classic.demo.ancient.demo.invoice.model.Article

  private AdvertisingTableModel initAdData(final Customer customer)
  {
    final GregorianCalendar gc = new GregorianCalendar(2000, 10, 23);
    final Advertising ad = new Advertising(customer, gc.getTime(), "A-000-0123");

    final Article mainboard = new Article("MB.A02", "ZUSE Z0001 Mainboard", 1299.50f);
    final Article hardDisk = new Article
        ("HD.201", "Sillicium Core HDD", 99.50f,
            "Even the babylonians used stone for long term document archiving, so why shouldn't you?");
    final Article memory = new Article("MEM.30", "ferrit core memory", 119.99f);
    final Article operatingSystem = new Article
        ("OS.36", "Windows XP", 259.99f, "Experience the world of tomorrow by spreading trojans today.");
    ad.addArticle(mainboard, 999.99d);
    ad.addArticle(hardDisk, 79.50);
    ad.addArticle(memory, 99.99f);
    ad.addArticle(operatingSystem, 199.99);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.demo.ancient.demo.invoice.model.Article

  public Object getValueAt(final int rowIndex, final int columnIndex)
  {
    // just make sure we can access the invoices by the array
    fillCache();
    final Invoice inv = invoicePerRow[rowIndex];
    final Article art = articlesPerRow[rowIndex];

    switch (columnIndex)
    {
      case 0:
        return inv;
      case 1:
        return inv.getCustomer().getFirstName();
      case 2:
        return inv.getCustomer().getLastName();
      case 3:
        return inv.getCustomer().getStreet();
      case 4:
        return inv.getCustomer().getTown();
      case 5:
        return inv.getCustomer().getPostalCode();
      case 6:
        return inv.getCustomer().getCountry();
      case 7:
        return inv.getCustomer().getSalutation();
      case 8:
        return inv.getDate();
      case 9:
        return inv.getInvoiceNumber();
      case 10:
        return art.getName();
      case 11:
        return art.getArticleNumber();
      case 12:
        return art.getArticleDetails();
      case 13:
        return new Float(art.getPrice());
      case 14:
        return new Integer(articleCountPerRow[rowIndex]);
    }
    throw new IndexOutOfBoundsException("ColumnIndex is invalid: " + columnIndex);
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.demo.ancient.demo.invoice.model.Article

    final Customer customer =
        new Customer("Will", "Snowman", "Mr.", "12 Federal Plaza",
            "12346", "AnOtherTown", "Lilliput");
    final Advertising ad = new Advertising(customer, new Date(), "A-000-0123");

    final Article mainboard = new Article("MB.A02", "ZUSE Z0001 Mainboard", 1299.50f);
    final Article hardDisk = new Article
        ("HD.201", "Sillicium Core HDD", 99.50f,
            "Even the babylonians used stone for long term document archiving, so why shouldn't you?");
    final Article memory = new Article("MEM.30", "ferrit core memory", 119.99f);
    final Article operatingSystem = new Article
        ("OS.36", "Windows XP", 259.99f, "Experience the world of tomorrow by spreading trojans today.");
    ad.addArticle(mainboard, 999.99d);
    ad.addArticle(hardDisk, 79.50);
    ad.addArticle(memory, 99.99f);
    ad.addArticle(operatingSystem, 199.99);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.demo.ancient.demo.invoice.model.Article

  public Object getValueAt(final int rowIndex, final int columnIndex)
  {
    // just make sure we can access the advertisings by the array
    fillCache();
    final Advertising inv = adPerRow[rowIndex];
    final Article art = articlesPerRow[rowIndex];

    switch (columnIndex)
    {
      case 0:
        return inv;
      case 1:
        return inv.getCustomer().getFirstName();
      case 2:
        return inv.getCustomer().getLastName();
      case 3:
        return inv.getCustomer().getStreet();
      case 4:
        return inv.getCustomer().getTown();
      case 5:
        return inv.getCustomer().getPostalCode();
      case 6:
        return inv.getCustomer().getCountry();
      case 7:
        return inv.getCustomer().getSalutation();
      case 8:
        return inv.getDate();
      case 9:
        return inv.getAdNumber();
      case 10:
        return art.getName();
      case 11:
        return art.getArticleNumber();
      case 12:
        return art.getArticleDetails();
      case 13:
        return new Float(art.getPrice());
      case 14:
        return new Double(reducedPricePerRow[rowIndex]);
    }
    throw new IndexOutOfBoundsException("ColumnIndex");
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.demo.ancient.demo.invoice.model.Article

        new Customer("Will", "Snowman", "Mr.", "12 Federal Plaza",
            "12346", "AnOtherTown", "Lilliput");
    final GregorianCalendar gc = new GregorianCalendar(2000, 10, 23);
    final Invoice invoice = new Invoice(customer, gc.getTime(), "A-000-0123");

    final Article mainboard = new Article("MB.001", "Ancient Mainboard", 199.50f);
    final Article hardDisk = new Article
        ("HD.201", "Very Slow Harddisk", 99.50f, "No warranty");
    final Article memory = new Article("MEM.36", "Dusty RAM modules", 59.99f);
    final Article operatingSystem = new Article
        ("OS.36", "QDOS with C/PM compatibility module", 259.99f, "Serial #44638-444-123");
    invoice.addArticle(mainboard);
    invoice.addArticle(hardDisk);
    invoice.addArticle(memory);
    invoice.addArticle(memory);
View Full Code Here

Examples of org.uned.agonzalo16.bitacora.domain.Article

    return blogDao.merge(blog);
  }

  private Article createArticle(Blog blog) {
    Article article = new Article();
    article.setTitle("title 1");
    article.setCreationDate(new Date());
    article.setText("text 1");
    article.setOpenComments(true);
    article.setBlog(blog);
    article.setUser(createUser());

    return articleDao.merge(article);
  }
View Full Code Here

Examples of org.wikipedia.miner.model.Article

   */
  private double[] computeFeatureValues(Candidate candidate,
      boolean training, HashMap<String, Counter> hashKeyphrases,
      HashMap<String, Candidate> candidates) {

    Article candidateArticle = candidate.getArticle();

    // Compute feature values
    double[] newInst = new double[numFeatures + 1];

    String name = candidate.getName();
    String original = candidate.getBestFullForm();
    String title = candidate.getTitle();

    // Compute TFxIDF
    Counter counterGlobal = (Counter) globalDictionary.get(name);
    double globalVal = 0;
    if (counterGlobal != null) {
      globalVal = counterGlobal.value();
      if (training) {
        globalVal = globalVal - 1;
      }
    }
    double tf = candidate.getTermFrequency();
    double idf = -Math.log((globalVal + 1) / ((double) numDocs + 1));
    // System.out.println(candidate + " count: " + candidate.getFrequency() + "
    // tf: " + tf + " glob val: " + globalVal + " numDocs: " + numDocs + " idf:
    // " + idf);

    if (useBasicFeatures) {
      newInst[tfidfIndex] = tf * idf;
      newInst[firstOccurIndex] = candidate.getFirstOccurrence();
    }

    if (useFrequencyFeatures) {
      newInst[tfIndex] = tf;
      newInst[idfIndex] = idf;
    }

    if (usePositionsFeatures) {
      newInst[lastOccurIndex] = candidate.getLastOccurrence();
      newInst[spreadOccurIndex] = candidate.getSpread();
    }

    if (useKeyphrasenessFeature) {
      if (vocabularyName.equals("wikipedia")) {
        name = title;
      }
      Counter domainKeyphr = keyphraseDictionary.get(name);
      if ((training) && (hashKeyphrases != null)
          && (hashKeyphrases.containsKey(name))) {
        newInst[domainKeyphIndex] = domainKeyphr.value() - 1;
      } else {
        if (domainKeyphr != null) {
          newInst[domainKeyphIndex] = domainKeyphr.value();
        } else {
          newInst[domainKeyphIndex] = 0;
        }
      }
    }

    if (useLengthFeature) {

      if (original == null) {
        System.err.println("Warning! Problem with candidate " + name);
        newInst[lengthIndex] = 1.0;
      } else {
        String[] words = original.split(" ");
        newInst[lengthIndex] = (double) words.length;
      }
    }

    if (useNodeDegreeFeature) {
      int nodeDegree = 0;
      if (vocabularyName.equals("wikipedia")) {
        try {
          for (int relatedID : candidateArticle.getLinksInIds()) {
            if (candidates.containsKey(relatedID + "")) {
              nodeDegree++;
            }
          }
          for (int relatedID : candidateArticle.getLinksOutIds()) {
            if (candidates.containsKey(relatedID + "")) {
              nodeDegree++;
            }
          }
        } catch (SQLException e) {
          System.err.println("Error retrieving ids for candidate "+ candidate);
        }
      } else if (vocabulary != null) {

        Vector<String> relatedTerms = vocabulary.getRelated(name);

        if (relatedTerms != null) {
          for (String relatedTerm : relatedTerms) {
            if (candidates.get(relatedTerm) != null)
              nodeDegree++;
          }
        }

      }
    //  if (nodeDegree != 0) {
    //    System.out.println(candidate + " has node degree " + nodeDegree);
    //  }
      newInst[nodeDegreeIndex] = (double) nodeDegree;
    }

    if (useBasicWikipediaFeatures && wikipedia != null) {


      double wikipKeyphraseness = 0;
      if (vocabularyName.equals("wikipedia")) {
        wikipKeyphraseness = candidate.getWikipKeyphraseness()
      } else {
        Anchor anchor = null;
        try {
          anchor = new Anchor(wikipedia.getDatabase()
              .addEscapes(original), null, wikipedia.getDatabase());
          if (anchor != null) {
            if (anchor.getLinkProbability() != 0) {
              wikipKeyphraseness = anchor.getLinkProbability();
            }
          }
        } catch (SQLException e) {
          System.err.println("Error retrieving the anchor for " + candidate);
        //  e.printStackTrace();
        }
      }
      newInst[wikipKeyphrIndex] = wikipKeyphraseness; 
      newInst[totalWikipKeyphrIndex] = candidate.getTotalWikipKeyphraseness();

    //  System.out.println(candidate + "\t wikip Keyphr " + newInst[wikipKeyphrIndex] + "\t total wikip Keyphr " + newInst[totalWikipKeyphrIndex]);

    }

    if (useAllWikipediaFeatures) {

      if (candidateArticle == null) {
        try {
            candidateArticle = wikipedia.getMostLikelyArticle(original,
                new CaseFolder());
         
        } catch (SQLException e) {
          e.printStackTrace();
        }
      }
     
        double wikipFrequency = 0;
        double generality = 0;
        double semRelatedness = 0;

        if (candidateArticle != null) {
          try {
            double pageCount = candidateArticle.getLinksInCount();
            wikipFrequency = -Math.log(pageCount / 2000000);
            generality = candidateArticle.getGenerality();
          } catch (SQLException e) {
            e.printStackTrace();
          }
        }

        if (vocabularyName.equals("wikipedia") && candidateArticle != null) {
          for (Candidate c : candidates.values()) {
            if (!c.equals(candidate)) {
                double relatedness = 0;
                Article article = c.getArticle();
                try {
                  relatedness = candidateArticle.getRelatednessTo(article);
                 
                } catch (SQLException e) {
                  e.printStackTrace();
View Full Code Here

Examples of org.xrace.model.Article

    //Ajout de plusieurs courses et articles pour une personne.
    /*cart.add(new CartItemInscription(tarificationXC4Xss, personneJDoe,
        getInscriptionService()), getRabaisEvenementService());*/
    cart.add(cartItemInscription, getRabaisEvenementService());
    cart.add(new CartItemArticle(personneJDoe, new Article(choixAmeneAmi)),
        getRabaisEvenementService());
    cart.add(new CartItemArticle(personneJDoe, new Article(choixBBQInvite)
        .setQuantite(2)), getRabaisEvenementService());

    //Ajout d'une course plus loin dans la saison.
    ComposantInscription composantInscription2 = new ComposantInscription(
        personneJDoe, tarificationXC9Xjs);
View Full Code Here

Examples of pygmy.nntp.Article

    }

    public void testAddArticle() throws Exception {
        String name = "comp.lang.java.programmer";
        NewsGroup group = forum.createNewsgroup(name);
        Article article = NntpTestUtil.createArticle("test.eml");
        forum.addArticle( article, "foo");
        File repository = forum.getArticleRepository();

        File[] list = repository.listFiles();
        assertEquals( NntpUtil.base64Encode( article.getMessageId() ), list[0].getName() );
        assertEquals( 1, group.size() );
    }
View Full Code Here

Examples of pygmy.nntp.Article

            }
        }
    }

    protected byte[] getArticleBytes( String filename ) throws IOException {
        Article article = NntpTestUtil.createArticle( filename );
        ByteArrayOutputStream articleBaos = new ByteArrayOutputStream();
        article.save( new InternetOutputStream( articleBaos ) );
        return articleBaos.toByteArray();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.