Search Results

Search found 1214 results on 49 pages for 'jack sparrow'.

Page 30/49 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • How to update a single table using trigger in MS SQL 2008

    - by Yakob-Jack
    I have a table PeroidicDeduction and the fields are ID(auto-increment),TotalDeduction(e.g.it can be loan),Paid(on which the deduction for each month),RemainingAmount, What I want is when every time I insert or update the table---RemainingAmount will get the value of TotalDeduction-SUM(Paid)....and writ the following trigger...but dosen't work for me CREATE TRIGGER dbo.UpdatePD ON PeroidicDedcution AFTER INSERT,UPDATE AS BEGIN UPDATE PeroidicDedcution SET REmaininAmoubnt=(SELECT TotalDeduction-(SELECT SUM(Paid) FROM PeroidicDeduction) FROM PeroidicDeduction) END NOTE: it is on a Single table

    Read the article

  • Help needed with simple mysql group by query

    - by Jack
    This query fails when I add the line shown... :BEGIN FAIL: I have this so far Select Companyid, count(*) as cnt from mytable where State is not null and cnt = 1 <------------------------- FAIL group by CompanyID :END FAIL: Any way to do this? Here's a long winded background if it'll help.... I have a single table query. here's a sample of the table: CompanyID, State 1,OH 1,IL 1,NY 2,IL 3,NY 3,OH 4,NY 5,CA 5,WA I want a query that'll return something like this: 2,IL 4,NY I have this so far Select Companyid, count(*) as cnt from mytable where State is not null group by CompanyID This gives me a count of the number of records for each company. IE: 1,3 2,1 3,2 4,1 5,2 Now I want to filter the above list to just the two records with one result. I tried adding another where clause, but it failed: BEGIN FAIL: I have this so far Select Companyid, count(*) as cnt from mytable where State is not null and cnt = 1 <-------------------- FAIL group by CompanyID END FAIL:

    Read the article

  • PHP Get random paragraph

    - by Jack
    Anyone know how to get a random set of lines from a text file? I want to get a set of 3 lines with <br> on the front of each and display them through html. example: set 1 <br>Hi <br>what's your name <br>goodbye set 2 <br>stack <br>overflow <br>hi there set 3,4,5.... Choose one random set and display it. The sets of lines would be stored in a text file. Thanks a lot!

    Read the article

  • Linq 2 SQL Grouping Question

    - by Jack Marchetti
    var groups = from p in dc.Pool join pm in dc.PoolMembers on p.ID equals pm.PoolID group p by p.Group into grp select new { grp.ID }; This isn't working. Basically I want to do the grouping, and then select certain columns, but when I do select new { grp. } I get no intellisense, so I'm obviously doing something wrong. Any ideas?

    Read the article

  • What segments does C compiled program use?

    - by b-gen-jack-o-neill
    Hi, I read on OSDev wiki, that protected mode of x86 architecture allow you to create separate segments for code and data, while you cannot write into code section. That Windows (yes, this is the platform) loads new code into code segment, and data are created on data segment. But, if this is the case, how does program know it must switch segments to the data segment? Becouse if I understand it right, all adress instructions point to the segment you run the code from, unless you switch the descriptor. But I also read, that so colled flat memory model allows you to run code and data within one segment. But I read this only in connection to assembler. So, please, what is the case with C compiled code on Windows? Thanks.

    Read the article

  • C/C++ usage of special CPU fetures

    - by b-gen-jack-o-neill
    Hi, I am curious, do new compilers use some extra features built into new CPUs such as MMX SSE,3DNow! and so? I mean, in original 8086 there was even no FPU, so compiler that old cannot even use it, but new compilers can, since FPU is part of every new CPU. So, does new compilers use new features of CPU? Or, it should be more right to ask, does new C/C++ standart library functions use new features? Thanks for answer.

    Read the article

  • Using JavaScript to render HTML; nothing appearing but values will alert

    - by Jack Roscoe
    Hi, I'm taking some information from some variables I have already defined outside this function to create a html svg text box. Here is the function which is causing me trouble: RenderTextBox:function() { alert('this.x: ' + this.x); alert('this.y: ' + this.y); this.textBox = paper.text(this.x, this.y, this.htmlTextBox); } The alerts works prefectly, and prompt me with the values expected. However, the final line which is supposed to create the text box puts them nowhere to be seen. Does anybody know why? If I replace 'this.x, this.y..' with numerical values in the final line of the function, the text box is placed correctly. It's only when I use the 'this.x' and 'this.y' that I have issues.

    Read the article

  • Sorted sets and comparators

    - by Jack
    Hello, I'm working with a TreeSetthat is meant to store pathfind locations used during the execution of a A* algorithm. Basically until there are "open" elements (still to be exhaustively visited) the neighbours of every open element are taken into consideration and added to a SortedSetthat keeps them ordered by their cost and heuristic cost. This means that I have a class like: public class PathTileInfo implements Comparable<PathTileInfo> { int cost; int hCost; final int x, y; @Override public int compareTo(PathTileInfo t2) { int c = cost + hCost; int c2 = t2.cost + t2.hCost; int costComp = c < c2 ? -1 : (c > c2 ? 1: 0); return costComp != 0 ? costComp : (x < t2.x || y < t2.y ? -1 : (x > t2.x || y > t2.y ? 1 : 0)); } @Override public boolean equals(Object o2) { if (o2 instanceof PathTileInfo) { PathTileInfo i = (PathTileInfo)o2; return i.cost + i.hCost == cost + hCost && x == i.x && y == i.y; } return false; } } In this way first the total cost is considered, then, since a total ordering is needed (consistency with equals) a ordering according to the x,y coordinate is taken into account. This should work but simply it doesn't, if I iterate over the TreeSet during the algorithm execution like in for (PathTileInfo t : openSet) System.out.print("("+t.x+","+t.y+","+(t.cost+t.hCost)+") "); I get results in which the right ordering is not kept, eg: (7,7,6) (7,6,7) (6,8,6) (6,6,7) (5,8,7) (5,7,7) (6,7,6) (6,6,7) (6,5,7) (5,7,7) (5,5,8) (4,7,7) (4,6,8) (4,5,8) is there something subtle I am missing? Thanks!

    Read the article

  • Matlab Question - Principal Component Analysis

    - by Jack
    I have a set of 100 observations where each observation has 45 characteristics. And each one of those observations have a label attached which I want to predict based on those 45 characteristics. So it's an input matrix with the dimension 45 x 100 and a target matrix with the dimension 1 x 100. The thing is that I want to know how many of those 45 characteristics are relevant in my set of data, basically the principal component analysis, and I understand that I can do this with Matlab function processpca. Could you please tell me how can I do this? Suppose that the input matrix is x with 45 rows and 100 columns and y is a vector with 100 elements.

    Read the article

  • GUID.TryParse() ?

    - by Jack Marchetti
    Obviously there is no public GUID.TryParse() in .NET CLR 2.0. So, I was looking into regular expressions [aka googling around to find one] and each time I found one there was a heated argument in the comments section about RegEx A doesn't work, use RegEx B. Then someone would write Regex C yadda yadda So anyway, What I decided to do was this, but I feel bad about it. public static bool IsGuid (string possibleGuid) { try { Guid gid = new Guid(possibleGuid); return true; } catch (Exception ex) { return false; } } Obviously I don't really like this since it's been drilled into me since day one to avoid throwing exceptions if you can defensibly code around it. Does anyonek now why there is no public Guid.TryParse() in the .NET Framework? Does anyone have a real Regular Expression that will work for all GUIDs?

    Read the article

  • How do you put a UIWebView somewhere other than MainView.xib?

    - by Jack
    Hello, I've been trying to put a UIWebView into my app, which is tableview based. When the user selects a row, I want the new xib to load, but this one with a UIWebView on it. From all of the tutorials I've seen, you can only put a UIWebView on the MainView.xib. Can someone please tell me how to put a FUNCTIONING UIWebView somewhere other than the main view? Thanks in advance!!

    Read the article

  • faster strlen ?

    - by Jack
    Typical strlen() traverse from first character till it finds \0. This requires you to traverse each and every character. In algorithm sense, its O(N). Is there any faster way to do this where input is vaguely defined. Like: length would be less than 50, or length would be around 200 characters. I thought of lookup blocks and all but didn't get any optimization.

    Read the article

  • Incompatible Types in Initialization

    - by jack
    I have the following code in a subroutine that produces an incompatible types in initialization error on the varVal library in the subroutine evaluateExpression: NSDictionary *varVal; for (int i=0; i<varCount; i++) { [varVal setObject:[(i+1)*2 stringValue] forKey:[i stringValue]]; } double result =[[self brain] evaluateExpression:[[self brain] expression] usingVariableValues:varVal]; My subroutine declaration in the brain.h file is: +(double)evaluateExpression:(id)anExpression usingVariableValues:(NSDictionary *)variables; I'd appreciate any help.

    Read the article

  • Using microsoft report viewer with objects

    - by Jack
    Ive got some nested objects that I am trying to generate reports for. A BackupClient contains BackupVersions and BackupVersions contain BackupFiles. I passed in the list of BackupClients - and the report displays the client name, etc.... but to display the versions - It says I have to have a Binding Source for BackupVersions. If I pull all of the versions out of the clients and put them in a different BindingSource, then my data is no longer together - how is the report viewer going to list the versions for client X - if I just have a binding source with ALL clients versions in it?

    Read the article

  • Trouble adding event listeners via JavaScript

    - by Jack Roscoe
    Currently I have a function which loops to create multiple HTML objects. Each time an object is created, I want to add an onClick function listener to that object so that I can trigger a function when each one is clicked. What's the best way to do this? Here's the code which creates my objects: RenderMultipleChoice:function() { this.c = paper.rect(this.x, this.y, this.shapeWidth, this.shapeHeight); }

    Read the article

  • JavaScript, jQuery, XML - if statement not executing for unknown reason

    - by Jack Roscoe
    Hi, I have a 'for' loop which extracts data from an XML document and adds it into some JavaScript objects, each time the loop executes I want it to run a certain function depending on the value of the attribute 'typ' which is being retrieved from the xml. Currently, the data from the XML is successfully being parsed, which is proven by the first 'alert' you can see which produces the correct value. However, neither of the 'alert' lines in the 'if' statement lower down are being executed and as a result I cannot test the 'ctyp3' function which is supposed to be called. Where have I gone wrong? for (j=0; j<arrayIds.length; j++) { $(xml).find("C[ID='" + arrayIds[j] + "']").each(function(){ // pass values questions[j] = { typ: $(this).attr('typ'), width: $(this).find("I").attr('wid'), height: $(this).find("I").attr('hei'), x: $(this).find("I").attr('x'), y: $(this).find("I").attr('x'), baC: $(this).find("I").attr('baC'), boC: $(this).find("I").attr('boC'), boW: $(this).find("I").attr('boW') } alert($(this).attr('typ')); if ($(this).attr('typ') == '3') { ctyp3(x,y,width,height,baC); alert('pass'); } else { // Add here alert('fail'); } }); }

    Read the article

  • cakephp isAuthorized() not being called

    - by Jack B Nimble
    I am trying to use the isAuthorized() method to do a check for an admin flag, but the function never seems to be called. Even when I set the function to always return false, it allows any user. It just seems like it isn't being called. Do I need to do something more than setting $this-Auth-authorize = 'controller' ? from /app/app_controller.php class AppController extends Controller { var $components = array('Auth'); function beforeFilter() { $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->loginRedirect = array('controller' => 'pages', 'display' => 'home'); $this->Auth->logoutRedirect = '/'; $this->Auth->authorize = 'controller'; $this->Auth->userScope = array('User.active' => 1); } function isAuthorized() { if (strpos($this->action, "admin_") != false) { if ($this->Auth->user('isAdmin') == '0') { return false; } } return true; } }

    Read the article

  • Excel plugin: Finding a Chart's Source Data Number Format String

    - by Jack
    I'm currently working on a plugin for excel (using VB.net--not VBA) that will attempt (among other things) to recognize the format of the source data of a chart and configure the chart's series' number format strings appropriately. That is, yearly data should always be two numbers, monthly data should always be a 3-letter month followed by a 2-digit year, etc. The goal is to have a uniform representation across all charts for monthly data, annual data, daily data, etc. My question is this: how do I find the number format string for the cells (or any cell that is part of that series, as I will be assuming all cells that make up a particular series have the same format) that represent the source data for the chart? Note: I can assume that the chart will always point to a range of cells (not, for example, an array of data).

    Read the article

  • DataGridView: can you add an unbound column to a Data Bound grid?

    - by Jack Johnstone
    I´m using Visual Studio 2008, C# DataGridView: can you add an unbound column to a Data Bound grid? It seems pretty simple, just select the properties ("DataGridView Tasks box") for the data bound DataGridView, and select Add unbound column. However, when in runtime there will be a System.FormatException - which I can understand, as I don´t know how to "initialize" the cells in the new unbound columns. I was planning initializing it programmatically via CellFormatting event - but so far I´m failing. Any tips? Just want to get it up and running in SOME way...

    Read the article

  • PHP/Codeigniter FTP Timout

    - by Jack Hayter
    I'm trying to access an FTP server from my PHP script using Codeigniter's FTP Library. These functions work great, but when testing the script I discovered that if I attempt to connect to a server that does not exist, the script does not terminate with an error message of any kind. The page continues to execute, until the web server gives up, returning an empty document. So I am wondering, is there a way to limit the amount of time that Codeigniter can try to connect to an FTP server, then display a message if that times out? I tried using the php function set_time_limit(), but it does not behave how I expected it to. Thanks for your help.

    Read the article

  • Database Schema Versioning Strategies

    - by Jack Ryan
    I work on a project that uses a reasonably large database, the live version weighing in at somewhere around 60-80GB. The live database is the only real definitive source of our schema, and because of its size duplicating this database is too slow to be done often. This means we have ended up developing our database schema in a pretty ad hoc way, using sql compare to migrate changes from dev dbs to the live system, and only wiping our dev dbs every month or two. I am hoping to get some pointers on how to improve our database development work flow so that we have a little more control. Some things to think about: Currently nobody is really in charge of the database schema, all developers can change it if they need to, though generally these decisions are talked about before they are done. There are stored procedures, functions, and views in the database. These should probably be dumped to files so they can be reloaded on every build. Schema changes should probably be checked in as scripts. We have started to do this recently. However all our scripts must then be numbered (because there may be dependencies between them), and must be re runnable (because our build script currently runs them all in order). This makes them hard to read because they are full of conditionals that check whether tables or columns already exist. This is a step that is often forgotten by developers. Getting a new database should be quick and easy. This is currently a big problem, it takes several hours to get a copy of last nights backup and restore it onto a dev machine. Some mechanism needs to be in place to allow developers to update static data. We have tables that contain data that is never updated through the application, but does potentially need to be changed when we do a new release (often this drives dropdowns). The whole thing needs to be runnable as part of a build script. Are there any tools that can be used to help to do this? Eventually I would like to be at a point where a new DB can be built from scratch without copying any data from the live system. I don't mind writing some scripts to glue all the steps together but each part should be easily editable so that we continue to use it rather than make changes directly on DBs.

    Read the article

  • take only one record of select

    - by jack.cap.rooney
    I need to fetch only first record (because I need last date) of resultset, at the moment I have this resultset from this sql tring: SELECT BCACC,FLDAT FROM ANAGEFLF ORDER BY FLDAT DESC and I see this record: A.M.T. AUTOTRASPORTI SRL 20080220 A.M.T. AUTOTRASPORTI SRL 20080123 A.M.T. AUTOTRASPORTI SRL 20070731 APOFRUIT ITALIA 20080414 APOFRUIT ITALIA 20080205 APOFRUIT ITALIA 20071210 APOFRUIT ITALIA 20070917 APOFRUIT ITALIA 20070907 now I need to take only one record (first) for every BCACC, I would take this resultset: A.M.T. AUTOTRASPORTI SRL 20080220 APOFRUIT ITALIA 20080414 I've just try group it for BCACC but I receive an sql error, I'm workin on DB2 ibmI

    Read the article

  • Django's USE_L10N does not work

    - by jack
    I already set USE_L10N = True in settings.py But in following view: from django.contrib.humanize.templatetags.humanize import intcomma dev view_name(request): output = intcomma(123456) Output is always "123,456" for all locales.

    Read the article

  • Override as_json or to_json model class name

    - by Jack
    I'd like to modify the classname when calling to_json on an AR model. i.e. Book.first.to_json #=> "{\"book\":{\"created_at\":\"2010-03-23 Book.first.to_json(:root => 'libro') #=> "{\"libro\":{\"created_at\":\"2010-03-23 Is there an option to do this?

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >