Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 155/286 | < Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >

  • Downsampling and applying a lowpass filter to digital audio

    - by twk
    I've got a 44Khz audio stream from a CD, represented as an array of 16 bit PCM samples. I'd like to cut it down to an 11KHz stream. How do I do that? From my days of engineering class many years ago, I know that the stream won't be able to describe anything over 5500Hz accurately anymore, so I assume I want to cut everything above that out too. Any ideas? Thanks. Update: There is some code on this page that converts from 48KHz to 8KHz using a simple algorithm and a coefficient array that looks like { 1, 4, 12, 12, 4, 1 }. I think that is what I need, but I need it for a factor of 4x rather than 6x. Any idea how those constants are calculated? Also, I end up converting the 16 byte samples to floats anyway, so I can do the downsampling with floats rather than shorts, if that helps the quality at all.

    Read the article

  • Dependency between multiple classes

    - by CliffC
    I am confuse between the best way to organize dependency between multiple classes assume i have the following classes Employee, Salary, DataAccess Should i go for: Option1 Employee emp = new Employee(); Salary sal = new Salary(); DataAccess data = new DataAccess(); sal.Calculate(emp); data.Save(emp); or Option2 Employee emp = new Employee(); Salary sal = new Salary(); sal.Calculate(emp); //once salary has been calculated salary object will initialize data access class to do the actual saving. or Option 3 Employee emp = new Employee(); emp.Calculate(); // employee object will encapsulate both the salary and data access object

    Read the article

  • create a simple pdf report from html

    - by opensas
    I'm looking for a way to generate pdf files from html In order to make simple tabular reports I would need the following features table rendering variable page size repeating headers / footers on every page calculated page number / total page css support would be nice I know there have been many similar questions in stackoverflow, but I don't know if there's a product that supports the aforementioned features... Ideally, the source would be a plain and simple well built html with css, (I'm building the html files, so I can adapt to the products needs, that is, it won't have to render every piece of html crap you can throw at a browser) and with some custom tags to configure headings, footer, page size, etc... then I would run a command line to convert it from html to pdf. I think http://www.allcolor.org/YaHPConverter/ does something like that

    Read the article

  • Javascript String Length Differs From PHP mb_strlen

    - by TheOnly92
    I use document.getElementById("text").value.length to get the string length through javascript, and mb_strlen($_POST['text']) to get the string length by PHP and both differs very much. Carriage returns are converted in javascript before getting the string length, but I guess some characters are not being counted. For example, [b]15. Umieszczanie obrazka z logo na stronie zespolu[/b] This block of text is calculated 57 in javascript and 58 in PHP. When the text gets long, the difference increases. Is there any way to overcome this?

    Read the article

  • how to calculate a bill from several tables on mysql?

    - by Audel
    I'm using mysql to create an hotel booking system, but i am struggling a little bit to calculate the final bill. I need a SELECT command to get data from several tables and make some calculations. Basically I just need to get the 'night cost' from a table called 'room_types'. Then, use DATEDIFF function to get the difference of days between the 'checkin' and 'checkout' columns in the table 'room_booking' and multiply the difference with the night cost and display the total. These are the tables I would be using: are room_booking, room_types, booking, and room. One booking may have several room bookings, so Im looking for a table that looks something like this: +------------+------------+---------------+------------------+ | bookingid | Room price | nights stayed | total room price | +------------+------------+---------------+------------------+ | B001 | 30.00 | 4 | 120.00 | +------------+------------+---------------+------------------+ | B001 | 40.00 | 3 | 120.00 | +------------+------------+---------------+------------------+ booking id comes from table 'booking' room price from 'room_types', 'nights stayed' is calculated from the table room_booking, using the datediff command between checkin and checkout . I hope i was clear

    Read the article

  • how do I get the height of a rich text content after word wrap?

    - by Led
    Question A. Given 1. A string in rich text format that may have paragraph, tabs, space, line break, indentation, (or even image?) 2. A width for the word wrapping rich text control/editor How do I know the height of the content after it have performed all the word wrapping? Is there something like int MeasureRichTextHeightAfterWordWrap(string aRichTextContent, int aWidth)? Otherwise how does those rich text control know how much to autosize? Do I have to actually place the content on a dummy rich text control and get its height afterwards? Question B. Similar to question A but in plain text onto a plain text memo/control/editor. And manually draw string with manually calculated indentations, breaks, word wrappings. Is it easier or harder?

    Read the article

  • C# Binary File Compare

    - by Simon Farrow
    I'm in a situation where I want to compare two binary files. One of them is already stored on the server with a pre-calculated Crc32 in the database from when I stored it originally. I know that if the Crc is different then the files are definitely different. However, if the Crc is the same I don't know that the files are. So what I'm looking for is a nice efficient way of comparing the two streams on from the posted file and one from the file system. I'm not an expert on streams but I'm well aware that I could easily shoot myself in the foot here as far as memory usage is concerned. Any help is greatly appreciated.

    Read the article

  • WCF - Network Cost

    - by Mubashar Ahmad
    Dear Devs I have a wcf service deployed on IIS with basicHttpBinding and aspNetCompatibilityEnabled=true I have a test client as well which invokes multiple service functions simultaneously. To check the performance of service call on client and server I calculated the Avg time it takes to complete a service request on client(in proxy code) and on server as well. after a test of 8 hrs (server and client were on the same machine) i came to know that average response time on client is around 34ms where as the Avg execution time on server is around 3ms so the difference is 31ms. I would like to know why every call is taking 31ms is it justified? and how can i reduce this?

    Read the article

  • Converting a Doc object into a string in python

    - by Sam
    I'm using minidom to parse through an xml document. I took the data with yum tags and stored them in a list and calculated the frequency of the words. However, its not storing or reading them as strings in the list. Is there another way to do it? Right now this is what I have: yumNodes = [node for node in doc.getElementsByTagName("yum")] for node in yumNodes: yumlist.append(t.data for t in node.childNodes if t.nodeType == t.TEXT_NODE) for ob in yumlist: for o in ob: if word not in freqDict: freqDict[word] = 1 else: freqDict[word] += 1

    Read the article

  • Sqlite View : Add a column based on some other column

    - by NightCoder
    Hi, I have two tables Employee ID | Name | Department ---------------------- 121 |Name1 | dep1 223 |Name2 | dep2 Assignment ID | EID| --------- 1 |121 2 |223 3 |121 [other columns omitted for brevity] The table assignment indicates which is work is assigned to whom.EID is a foriegn key to the table Employee.Also it is possible to have two work assigned to the same employee. Now i want to create a view like this EID | Assigned -------------- 121 |true 333 |false Assigned column should be calculated based on the entries in the Assignment table. So far i am only successful in creating a view like this EID | Assigned -------------- 121 |2 333 |0 using the command CREATE VIEW "AssignmentView" AS SELECT distinct ID ,(select Count(*) from Assignment where Assignment.EID = Employee.ID) as Assigned FROM Employee; Thanks

    Read the article

  • Why is there a limit of max 20 parameters to a clojure function

    - by GuyC
    Hi, there seems to be a limit to the number of parameters a clojure function can take. When defining a function with more than 20 parameters I receive the following: Obviously this can be avoided, but I was hitting this limit porting the execution model of an existing DSL to clojure, and I have constructs in my DSL like the following, which by macro expansion can be mapped to functions quite easily except for this limit: (defAlias nn1 ((element ?e1) (element ?e2)) number "@doc features of the elements are calculated for entry into the first neural network, the result is the score computed by the latter" (nn1-recall (nn1-feature00 ?e1 ?e2) (nn1-feature01 ?e1 ?e2) ... (nn1-feature89 ?e1 ?e2))) which is a DSL statement to call a neural network with 90 input nodes. Can work around it of course, but was wondering where the limit comes from. Thanks.

    Read the article

  • Multiple forms in delphi

    - by Hendriksen123
    In my Delphi Project i want to have a 'Settings' button that when clicked, opens a second form (i think this is the correct term, i essentially want a new window to open) for settings. When the user has finished changing the settings on this new form, i want the form to close on a button click. The settings the user types in will also need to be accessible to the first, 'main' form. So, for example, if my programme consisted of a main form, that calculated 'A' + 'B' (A and B being integer variables), with the settings form allowing the user to set values for A and B, how would i do this?

    Read the article

  • Calculation with RESTful web service with MySQL database

    - by Dobby
    I am now making some RESTful web services with MySQL database. I used NetBeans to create the resources of RESTful service with MySQL, and now I can now use GET and POST/PUT to list and add/modify data entities in the MySQL server. Currently, I wish to make some calculations right after a client makes the POST activities, then the posted data with calculated results will be inserted into the MySQL database. I am very new to this, I guess I need to add some functions and call them to calculate but I don't know where and how to do that : ( Could any one help me on this issue? Thanks a lot in advance! : )

    Read the article

  • Finding coordinates of a point between two points?

    - by Nicros
    Doing some 3D stuff in wpf- want to use a simpler test to see if everything is working (before moving to curves). The basic question is given two points x1,y1,z1 and x2,y2,z2 I have calculated the distance between the points. But how to find the coordinates of another point (x3,y3,z3) that lies on that line at some distance? I.e. if my line is 100 long between -50,0,0 and 50,0,0 what are the coordinates of the point at 100 * 0.1 along the line? I think this is a simple formula but I haven't found it yet....

    Read the article

  • Integration of Photoshop and MySQL

    - by NewToProgrammingWorld
    I’m working to integrate Photoshop (CS4, local) with MySQL (Linux, remote), such that: a) image file information, data and meta data can be exported from PS into MySQL where same can be manipulated both manually and calculated, and then b) the MySQL fields can be referenced in Photoshop scripting for further automated image file manipulation, and c) the MySQL fields can be referenced for other purposes such as dynamic propagation of files and associated file data to a website, for example. I’ve spent many hours running searches for these concepts on StackOverflow, Google, and Adobe Support. I’m coming up empty, which leads me to believe that it’s not natively possible, and that I’ll need some middle language like PHP. Does anyone know if it’s possible for Photoshop and MySQL to bi-directionally share data? If so, how? If that’s not possible, what solution(s) might you recommend, in terms of specific tools/technologies that I can research further. Thank you.

    Read the article

  • Does any one know of a packet generator?

    - by Benoit
    We have a networked device, and we would like to perform some tests on how it handles malformed packets. Is there a product out there that can generate arbitrary packets and packet sequences? I would like to be able to specify a set of TCP/IP payloads and it would open a connection and send the data. Obviouly, the TCP/IP checksum should be calculated correctly, etc... Kind of like a wireshark in reverse. Note that I am not interested in network loading and blasting millions of packet.

    Read the article

  • What is the most efficient way to solve system of equations containing the digamma function?

    - by Neil G
    What is the most efficient way to solve system of equations involving the digamma function? I have a vector v and I want to solve for a vector w such that for all i: digamma(sum(w)) - digamma(w_i) = v_i and w_i 0 I found the gsl function gsl_sf_psi, which is the digamma function (calculated using some kind of series.) Is there an identity I can use to reduce the equations? Is my best bet to use a solver? I am using C++0x; which solver is easiest to use and fast?

    Read the article

  • Multiple NSURLDownloads with Progress

    - by David Schiefer
    Hello, I'm trying to build a small app which allows downloading of multiple files at the same time while displaying them in a custom NSTableView. This works, i've done this by using an NSEnumerator, but I struggle at getting the progress right. It's calculated correctly, but it's not done individually for every download, instead they're added up. The way I've tried to set the subtitles containing the progress is by loading them into a separate array and then inserting/replacing objects containing the progress, but here I run into another problem - I don't know how to get the index of the object that's being downloaded, so I can't differentiate between the progresses. I hope you understand what I mean :P I've uploaded the source code to my server, I'd be really grateful if someone could have a look and help me out: http://web.me.com/david.schiefer/MyController.m

    Read the article

  • CSS - Force overflowing elements to disappear if partially hidden

    - by Kelso.b
    Let's say we have a box with some short paragraphs: <div style="overflow:hidden"> <p>Some text</p> <p>Some text</p> <p>Some text</p> <p>Some text</p> </div> The height of the box is variable, so sometimes one of the paragraphs' text is partially hidden. Is there a CSS property that would force the paragraph to either display fully or not at all, or would this need to be calculated using javascript?

    Read the article

  • C# SHA-1 vs. PHP SHA-1...Different Results?

    - by Arcdigital
    Hey, I am trying to calculate a SHA-1 Hash from a string, but when I calculate the string using php's sha1 function I get something different than when I try it in C#. I need C# to calculate the same string as PHP (since the string from php is calculated by a 3rd party that I cannot modify). How can I get C# to generate the same hash as PHP? Thanks!!! String = [email protected] C# Code (Generates d32954053ee93985f5c3ca2583145668bb7ade86) string encode = secretkey + email; UnicodeEncoding UE = new UnicodeEncoding(); byte[] HashValue, MessageBytes = UE.GetBytes(encode); SHA1Managed SHhash = new SHA1Managed(); string strHex = ""; HashValue = SHhash.ComputeHash(MessageBytes); foreach(byte b in HashValue) { strHex += String.Format("{0:x2}", b); } PHP Code (Generates a9410edeaf75222d7b576c1b23ca0a9af0dffa98) sha1();

    Read the article

  • Where to execute extra logic for linq to entities query?

    - by Inez
    Let say that I want to populate a list of CustomerViewModel which are built based on Customer Entity Framework model with some fields (like Balance) calculated separately. Below I have code which works for lists - it is implemented in my service layer, but also I want to execute this code when I just get one item from the database and execute is as well in different services where I'm accessing Customers data as well. How should I do this to ensure performance but to to not duplicate code - the one for calculating Balance? public List<CustomerViewModel> GetCustomerViewModelList() { IQueryable<CustomerViewModel> list = from k in _customerRepository.List() select new CustomerViewModel { Id = k.Id, Name = k.Name, Balance = k.Event.Where(z => z.EventType == (int) EventTypes.Income).Sum(z => z.Amount) }; return list.ToList(); }

    Read the article

  • How can I call model methods or properties from Django Admin?

    - by kg
    Is there a natural way to display model methods or properties in the Django admin site? In my case I have base statistics for a character that are part of the model, but other things such as status effects which affect the total calculation for that statistic: class Character(models.Model): base_dexterity = models.IntegerField(default=0) @property def dexterity(stat_name): total = self.base_dexterity total += sum(s.dexterity for s in self.status.all()]) return total It would be nice if I could display the total calculated statistic alongside the field to change the base statistic in the Change Character admin page, but it is not clear to me how to incorporate that information into the page.

    Read the article

  • Using DateDiff in Entity Framwork on a SQL CE database

    - by deverop
    I have a method which should return a list of anonymous objects with a calculated column like this: var tomorrow = DateTime.Today.AddDays(1); return from t in this.Events where (t.StartTime >= DateTime.Today && t.StartTime < tomorrow && t.EndTime.HasValue) select new { Client = t.Activity.Project.Customer.Name, Project = t.Activity.Project.Name, Task = t.Activity.Task.Name, Rate = t.Activity.Rate.Name, StartTime = t.StartTime, EndTime = t.EndTime.Value, Hours = (System.Data.Objects.SqlClient.SqlFunctions.DateDiff("m", t.StartTime, t.EndTime.Value) / 60), Description = t.Activity.Description }; Unfortunately I get the following error from the DateDiff function: The specified method 'System.Nullable1[System.Int32] DateDiff(System.String, System.Nullable1[System.DateTime], System.Nullable`1[System.DateTime])' on the type 'System.Data.Objects.SqlClient.SqlFunctions' cannot be translated into a LINQ to Entities store expression. Any ideas what I could have done wrong here? EDIT: I also tried the EntityFunctions class mentioned here, but that did not work as well. Minutes = EntityFunctions.DiffMinutes(t.EndTime, t.StartTime),

    Read the article

  • Disable keyboard on EditText

    - by Ferox
    I'm doing a calculator. So I made my own Buttons with numbers and functions. The expression that has to be calculated, is in an EditText, because I want users can add numbers or functions also in the middle of the expression, so with the EditText I have the cursor. But I want to disable the Keyboard when users click on the EditText. I found this example that it's ok for Android 2.3, but with ICS disable the Keyboard and also the cursor. public class NoImeEditText extends EditText { public NoImeEditText(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onCheckIsTextEditor() { return false; } } And then I use this NoImeEditText in my XML file <com.my.package.NoImeEditText android:id="@+id/etMy" .... /> How I can make compatible this EditText with ICS??? Thanks.

    Read the article

  • Is using decimal ranges in a switch impossible in C#?

    - by phobia
    I'm justing starting out learning C# and I've become stuck at something very basic. For my first "app" I thought I'd go for something simple, so I decided for a BMI calculator. The BMI is calculated into a decimal type which I'm now trying to use in a switch statement, but aparently decimal can't be used in a switch? What would be the C# solution for this: decimal bmi = calculate_bmi(h, w); switch (bmi) { case < 18.5: bmi_description = "underweight."; break; case > 25: bmi_description = "overweight"; case > 30: bmi_description = "very overweight"; case > 40: bmi_description = "extreme overweight"; break; }

    Read the article

< Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >