Search Results

Search found 1675 results on 67 pages for 'basis vasis'.

Page 35/67 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • java cosine similarity problem

    - by agazerboy
    Hi again :) I developed some java program to calculate cosine similarity on the basis of TF*IDF. It worked very well. But there is one problem.... :( for example: If I have following two matrix and I want to calculate cosine similarity it does not work as rows are not same in length doc 1 1 2 3 4 5 6 doc 2 1 2 3 4 5 6 7 8 5 2 4 9 if rows and colums are same in length then my program works very well but it does not if rows and columns are not in same length. Any tips ???

    Read the article

  • Are there gotchas using varargs with reference parameters

    - by Roddy
    I have this piece of code (summarized)... AnsiString working(AnsiString format,...) { va_list argptr; AnsiString buff; va_start(argptr, format); buff.vprintf(format.c_str(), argptr); va_end(argptr); return buff; } And, on the basis that pass by reference is preferred where possible, I changed it thusly. AnsiString broken(const AnsiString &format,...) { ... the rest, totally identical ... } My calling code is like this:- AnsiString s1, s2; s1 = working("Hello %s", "World"); s2 = broken("Hello %s", "World"); But, s1 contains "Hello World", while s2 has "Hello (null)". I think this is due to the way va_start works, but I'm not exactly sure what's going on.

    Read the article

  • Get stacktrace from stuck python process

    - by piquadrat
    I have to run a legacy Zope2 website and have some grievance with it. The biggest issue is that, occasionally, it just locks up, running at 100% CPU load and not answering to requests anymore. While the problem isn't reproducible on a regular basis, one page containing 3 dynamic graphs triggers it sometimes, so I suspect some kind of race condition that leads to an endless loop or a stuck busywait. The problem is, I have not yet found a way to debug this thing. There's nothing in the Zope logs and nothing in the system logs. I tried the suggestions from this question to get a stacktrace, but the only signal that has any effect is SIGKILL. Is there another possibility to find out where exactly the process is when it gets stuck?

    Read the article

  • Decision Tree code golf

    - by Chris Jester-Young
    In Google Code Jam 2009, Round 1B, there is a problem called Decision Tree that lent itself to rather creative solutions. Post your shortest solution; I'll update the Accepted Answer to the current shortest entry on a semi-frequent basis, assuming you didn't just create a new language just to solve this problem. :-P Current rankings: 107 Perl 121 PostScript (binary) 136 Ruby 154 Arc 160 PostScript (ASCII85) 170 PostScript 192 Python 199 Common Lisp 214 LilyPond 222 JavaScript 273 Scheme 280 R 312 Haskell 314 PHP 339 m4 346 C 406 Fortran 462 Java 476 Java (well, kind of) 718 OCaml 759 F# 1741 sed C++ not qualified for now

    Read the article

  • Linq to SQL DataContext Windsor IoC memory leak problem

    - by Mr. Flibble
    I have an ASP.NET MVC app that creates a Linq2SQL datacontext on a per-web-request basis using Castler Windsor IoC. For some reason that I do not fully understand, every time a new datacontext is created (on every web request) about 8k of memory is taken up and not released - which inevitably causes an OutOfMemory exception. If I force garbage collection the memory is released OK. My datacontext class is very simple: public class DataContextAccessor : IDataContextAccessor { private readonly DataContext dataContext; public DataContextAccessor(string connectionString) { dataContext = new DataContext(connectionString); } public DataContext DataContext { get { return dataContext; } } } The Windsor IoC webconfig to instantiate this looks like so: <component id="DataContextAccessor" service="DomainModel.Repositories.IDataContextAccessor, DomainModel" type="DomainModel.Repositories.DataContextAccessor, DomainModel" lifestyle="PerWebRequest"> <parameters> <connectionString> ... </connectionString> </parameters> </component> Does anyone know what the problem is, and how to fix it?

    Read the article

  • WPF Application Hang

    - by Karim
    Hi, I'm using Windows 7 Professional (x64) and having installed .NET 4.0 RTM on my machine. Since 2 days I'm noticing that every WPF application that I'm trying to run hangs and becomes non responsive (a not responding text is appended to it's title bar) and it's painted white. There is no info regarding any exception, no error message. Nothing. Even the Event Log shows that there was "application hang" event (code 1002) and nothing more. This problem is for everything that is written in WPF, even for products like NHibernate Profiler and other stuff that I was using on a regular basis without any issues. Tried to reinstall .NET 4.0 and nothing changed. Any ideas why this might be happening?

    Read the article

  • Knowledge base web app -- need a demo mode

    - by Smandoli
    I was contracted to build an on-line knowledge base that searches and cross-references many thousands of replacement parts for a niche industry. My client furnishes this app to his customers on a subscription basis. It uses MySQL and PHP and it works great. I want to deploy it in "demo mode" to sell my skills. I want the user to see the functions, but I have to guard the data for my client. My first idea was to obfuscate the results. That's at cross-purposes with showing how well it searches. I'm considering a limit on how many searches you can perform, but that's awkward too as someone could visit every day and get more answers than we would prefer. Other posts I've found are about letting people interact with an app, but without the challenge of protecting a big knowledge base. Can you suggest an approach? (Note, I put the tag obfuscation, but not sure it applies because java code obfuscation seems to be unrelated.)

    Read the article

  • Rails 2.3.5 model name translation problem in error messages

    - by Jason Nerer
    Hi Rails'ers, I encountered some problem while trying to translate my model's names and attributes in a Rails 2.3.5 app. I have the following model: class BillingPlan < ActiveRecord::Base validates_presence_of :billing_option_id belongs_to :order belongs_to :user belongs_to :billing_option end When validation fails, my models attributes are translated correctly, but the modelname itself is not. I use the following translation skeleton in de.yml de: activerecord: models: shipping_plan: "Versandart" billing_plan: "Rechnungsart" attributes: shipping_plan: shipping_option_id: "Versandoption" billing_plan: billing_option_id: "Rechnungsoption" Basis for my translation file is: http://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/de.yml Can anyone help? Thx in advance J.

    Read the article

  • Specific checkboxes checked in symfony 1.4

    - by Tom
    Hi, I'm able to do the following for all checkboxes in a set (in an action): $this->form->getWidget('some_form_field')->setAttribute('checked', 'checked'); ... but I'm unable to set specific checkboxes to ticked on the basis of data returned from the db. I'm after something like: $this->form->getWidget('some_form_field')->setAttributes(array(....)); ... where I can refer to the specific checkboxes to be ticked somehow, or pass an array to it. There's nothing in the symfony documentation on this specifically and I've had enough of trying a dozen combinations to get it work. Any help would be appreciated. Thanks.

    Read the article

  • Python questions from beginner

    - by ChrisC
    I'm thinking about rewriting an MS Access db I wrote years ago into a stand-alone Python app. Other than a college class called "Intro to C++" (console only, with OOP concepts) and the Access db itself, I have no experience, so I need to ask if the basis for my decision to go with Python is correct. Is it true that: 1) Python is relatively easy to pick up? 2) Python apps can run as "portable" (ie from one directory, no registry needs, nothing needs to be pre-installed on a Windows PC) as long as I use an embedded db?

    Read the article

  • Pair programming: How should the pairs be chosen?

    - by Jon Seigel
    This topic has been covered peripherally in bits and pieces in some of the other pair-programming questions, but I want to (a) consolidate this knowledge into a separate question, and, most importantly, (b) go into much more depth on the subject. From the perspective of being an effective manager, how should pairs be arranged for pair programming to maximize both the happiness and productivity of the overall team? Some ideas to get started: Should two people never be paired (because of personalities, for example)? How much overlap in skillsets is needed? How much disconnect in skillsets is too much to overcome? (No two people will overlap 100%, and a disconnect in skills can be very beneficial to both people.) Should everyone pair with everyone else on a fixed/rotating basis? Should certain pairs be arranged to accomplish specific tasks? How important a role does HR play when growing or reorganizing the team?

    Read the article

  • Correct permutation cycle for Verhoeff algorithm

    - by James
    Hello, I'm implementing the Verhoeff algorithm for a check digit scheme, but there seems to be some disagreement in web sources as to which permutation cycle should form the basis of the permutation table. Wikipedia uses: (36)(01589427) while apparently, Numerical Recipies uses a different cycle and this book uses: (0)(14)(23)(56789), quoted from a 1990 article by Winters. It also notes that Verhoeff used the one Wikipedia quotes. Now, my number theory is a little rusty, but the Wikipedia cycle clearly will repeat after the 8th power, while the book one will take 10, despite it saying that s^8=s. Table 2.14(b) has other errors in the 2-cycles, so this is dubious anyway. Unfortunately, I don't have copies of the original articles (and am too tight to pay/disgusted that 40-year old knowledge is still being held to ransom by publishers), nor a copy of Numerical Recipes to check (and am loath to install their paranoia-induced copy protection plug-in to view online). So does any one know which is correct? Are they both correct?

    Read the article

  • Postgresql - one database for everyone, or one-database per customer

    - by user337876
    I'm working on a web-based business application where each customer will need to have their own data (think basecamphq.com type model) For scalability and ease-of-upgrades, I'd prefer to have a single database where each customer gets a filtered version of the data. The problem is how to guarantee that they stay sandboxed to their own data. Trying to enforce it in code seems like a disaster waiting to happen. I know Oracle has a way to append a where clause to every query based on a login id, but does Postgresql have anything similar? If not, is there a different design pattern I could use (like creating a view of each table for each customer that filters)? Worse case scenario, what is the performance/memory overhead of having 1000 100M databases vs having a single 1Tb database? I will need to provide backup/restore functionality on a per-customer basis which is dead-simple on a single database but quite a bit trickier if they are sharing the database with other customers.

    Read the article

  • D3.js binding an object to data and appending for each key

    - by frshca
    I'm a D3.js newbie and I'm learning how to play around with data. Let's say I have an object with names as keys, and each key has an array of numbers like this: var userdata = { 'John' : [0, 1, 3, 9, 8, 7], 'Harry': [0, 10, 7, 1, 1, 11], 'Steve': [3, 1, 4, 4, 4, 17], 'Adam' : [4, 77, 2, 13, 11, 13] }; For each user, I would like to append an SVG object and then plot the line with the array of values for that user. So here is my assumption of how that would look based on tutorials, but I know it is incorrect. This is to show my limited knowledge and give better understanding of what I'm doing: First I should create the line var line = d3.svg.line().interpolate('basis'); Then I want to bind the data to my body and append an svg element for each key: d3.select('body') .selectAll('svg') .data(userdata) .enter() .append('svg') .append(line) .x(function(d, i) { return i; }) .y(function(d) { return d[i]; }); So am I close??

    Read the article

  • fastercsv parsing to int or other into ActiveRecord

    - by Schroedinger
    I'm currently importing a CSV into an activerecord element but can't choose to parse the elements as say ints or decimals on a case by case basis using fastercsv. I can either choose to parse everything as an int or the other, or all as strings. I need to parse some columns as ints, some as decimals and some as strings. Otherwise, is there a way after I've parsed everything as strings to convert and update individual elements in the activerecord to the new form? Say parse values in as strings then convert certain values to ints, others to decs, etc?

    Read the article

  • Does Extreme Programming Need Diagramming Tools?

    - by Ygam
    I have been experimenting with some concepts from XP, like the following: Pair Programming Test First Programming Incremental Deliveries Ruthless Refactoring So far so good until I had a major stump: How do I design my test cases when there aren't any code yet? From what basis do I have to design them? From simple assumptions? From the initial requirements? Or is this where UML diagrams and the "analysis phase" fits in? Just had to ask because in some XP books I've read, there was little to no discussion of any diagramming tool (there was one which suggested I come up with pseudocodes and some sort of a flowchart...but it did not help me in writing my tests)

    Read the article

  • advise how to implement a code generator for asp.NET mvc 2

    - by loviji
    Hello, I would like your advice about how best to solve my problem. In a Web server is running. NET Framework 4.0. Whatever the methods and technologies you would advise me. applications built on the basis Asp.NET MVC 2. I have a database table in MS SQL Server. For each database, I must implement the interface for viewing, editing, and deleting. So code generator must generate model, controller and views.. Generation should happen after clicking on the button. as model I use .NET Entity Framework. Now, I need to generate controllers and views. So if i have a table with name tableN1. and below its colums: [ID] [bigint] IDENTITY(1,1) NOT NULL, [name] [nvarchar 20] NOT NULL, [fullName] [nvarchar 50] NOT NULL, [age] [int] NOT NULL [active] [bit] NULL for this table, i want to generate views and controller. thanks.

    Read the article

  • Marking Changes to database...

    - by KoolKabin
    Hi guys... I am developing application to be run in central server and distributed computers. I am supposed to write application to backup the data from distributed machines and merge it in central server. I thought of compressing whole local database and sending it to server for merging. But as the database size grows the size of compress file also began to grow. So is there any way to merge data in central server without sending whole database. I need to do it on daily basis. Daily take backup and send to server

    Read the article

  • asp.net mvc viewdata

    - by mazhar kaunain baig
    <% foreach (var Lang in ((IEnumerable<Egovt.Models.Language>)ViewData["Languages"])) { %> <div id="tabs-<%=Html.Encode(Lang.int_LangId) %>"> <% foreach (var OrganizationMeta in ((IEnumerable<Egovt.Models.OrganizationMeta>)ViewData["OrganizationMeta"])) { %> <% if (OrganizationMeta.vcr_DateType == "text") { %> <%=Server.HtmlDecode(OrganizationMeta.vcr_MetaValue)%><br /> <a href="#"></a> <% } else if (OrganizationMeta.vcr_DateType == "file") { %> <img alt="Image" src="../../Content/Logo/dd.gif" /> <% } %> <% } %> </div> <% } %> I want to base my second loop on the basis of first loop on the langid field, there are many ways but what you guys will use

    Read the article

  • SVN Delete with wildcard?

    - by David Lively
    I'm migrating a VSS repository to SVN and inadvertently included all of the _vti_cnf, *.scc files in the first check-in. I'd like to remove these from SVN. (Not permanently, of course - just in the HEAD). The application in question is quite large, and finding and deleting these files on a folder-by-folder basis will take forever. Suggestions? There must be some obvious way to do this, but the proximity of the weekend is interfering with my higher brain functions.

    Read the article

  • Adding / Removing values for an Email based daily stock value reporter - made inPHP

    - by Dave
    Hi, i'm buidling a very simple email based website that users can, when registering list out all the stocktickers they're intersted in following. The program then on a daily basis goes and fetches that information and sends it out to every user. i have the portion which fetchs the information from the stock websites, but i'm looking for an "infrastructure" that allows: (a) a user to send an email to [email protected] with the subject "Subscribe" and with the body containing stockticker values, (b) user to send email to service@... with subject "unsubscribe" and body containing similar values. Looking for code in php please. Any insights?

    Read the article

  • Suppress/Override application.html.erb

    - by user310628
    Is there any way to suppress the default js and css loaded by application.html.erb on a view by view basis? I'm finding it incredibly difficult to manage a global css and js includes configuration when certain views need different js libraries that for some reason seem to be conflicting with one another. For example, I might want jquery 1.3 for one view and 1.4.2 for another. I don't necessarily want to have to have an include for every view (I do want to have a global site-wide default), but I would also like to be able to override those for any view I want. Thanks!

    Read the article

  • Good way to capture/replay sessions from Apache Log?

    - by Mark Harrison
    For performance testing, I would like to capture some traffic from a production server and use that as a basis to replay the request to a test server in order to simulate a realistic load in our development environment. These are all stateless queries, so no issues regarding cookies, sessions, etc. The Apache log timestamps everything down to a 1 second resolution, but that's not fine enough granularity for our peak times. What's the best way to capture more fine-grained timestamps for replay? And is there some ab-like load generating program that can use this data to replicate load?

    Read the article

  • Data sync solution?

    - by user321088
    For some security issues I'm in an envorinment where third party apps can't access my DB. For this reason I should have some service/tool/script (dunno what yet... i'm open to the best option, still reading to see what I'm gonna do...) which enables me to generate on a regular basis(daily, weekly, monthly) some csv file with all new/modified records for a certain application. I should be able to automate this process and also export at any time a new file. So it should keep track for each application which records he still needs. Each application will need some data in some other format (csv/xls/sql), also some fields will be needed for some application and some aren't... It should be fairly flexible... What is the best option for me? Creating some custom tables for each application? Based on that extracting modified data?

    Read the article

  • Describe the Damas-Milner type inference in a way that a CS101 student can understand

    - by user128807
    Hindley-Milner is a type system that is the basis of the type systems of many well known functional programming languages. Damas-Milner is an algorithm that infers (deduces?) types in a Hindley-Milner type system. Wikipedia gives a description of the algorithm which, as far as I can tell, amounts to a single word: "unification." Is that all there is to it? If so, that means that the interesting part is the type system itself not the type inference system. If Damas-Milner is more than unification, I would like a description of Damas-Milner that includes a simple example and, ideally, some code. Also, this algorithm is often said to do type inference. Is it really an inference system? I thought it was only deducing the types. Related questions: What is Hindley Miller? Type inference to unification problem

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >