Daily Archives

Articles indexed Thursday May 6 2010

Page 2/118 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Harmonized sales tax headaches

    - by JonYork
    Alright Im using the BambooInvoice software, and where I am, we have two sales taxes. This is how they work price of item * tax1 = Sum1Tax1 Sum1tax1 *tax2 = Final sales price Currently, Bamboo invoice does this Price of Item * tax1 = pricetax1 price of item * tax2 = pricetax2 Price of item + pricetax1 + pricetax2 and this is its code $this->db->select('(SELECT SUM('.$this->db->dbprefix('invoice_items').'.amount * '.$this->db->dbprefix('invoice_items').'.quantity * ('.$this->db->dbprefix('invoices').'.tax1_rate/100 * '.$this->db->dbprefix('invoice_items').'.taxable)) FROM '.$this->db->dbprefix('invoice_items').' WHERE '.$this->db->dbprefix('invoice_items').'.invoice_id=' . $invoice_id . ') AS total_tax1', FALSE); $this->db->select('(SELECT SUM('.$this->db->dbprefix('invoice_items').'.amount * '.$this->db->dbprefix('invoice_items').'.quantity * ('.$this->db->dbprefix('invoices').'.tax2_rate/100 * '.$this->db->dbprefix('invoice_items').'.taxable)) FROM '.$this->db->dbprefix('invoice_items').' WHERE '.$this->db->dbprefix('invoice_items').'.invoice_id=' . $invoice_id . ') AS total_tax2', FALSE); $this->db->select('(SELECT SUM('.$this->db->dbprefix('invoice_items').'.amount * '.$this->db->dbprefix('invoice_items').'.quantity + ROUND(('.$this->db->dbprefix('invoice_items').'.amount * '.$this->db->dbprefix('invoice_items').'.quantity * ('.$this->db->dbprefix('invoices').'.tax1_rate/100 + '.$this->db->dbprefix('invoices').'.tax2_rate/100) * '.$this->db->dbprefix('invoice_items').'.taxable), 2)) FROM '.$this->db->dbprefix('invoice_items').' WHERE '.$this->db->dbprefix('invoice_items').'.invoice_id=' . $invoice_id . ') AS total_with_tax', FALSE); How would we modify this code to reflect the actual taxation scheme for my area? Thanks

    Read the article

  • How do I know an array of structures was allocated in the Large Object Heap (LOH) in .NET?

    - by AMissico
    After some experimenation using CLR Profiler, I found that: Node[,] n = new Node[100,23]; //'84,028 bytes, is not placed in LOH Node[,] n = new Node[100,24]; //'86,428 bytes, is public struct Node { public int Value; public Point Point; public Color Color; public bool Handled; public Object Tag; } During run-time, how do I know an array of structures (or any array) was allocated in the Large Object Heap (LOH)?

    Read the article

  • GWT: uiBinder-based widget cant be instanced second time

    - by Konoplianko
    Hi. I created a widget using GWT uiBinder. It works fine, till the moment when I want to instance it second time. After i call constructor second time it returns only raw description from XML and statements in constructor (rootElement.add( new HTML( "panel1" ), leftId );) are just don't work. It throws no error or warning. Please help Java class: public class DashboardLayout extends Composite { final String leftId = "boxLeft"; final String rightId = "boxRight"; interface DashboardLayoutUiBinder extends UiBinder<HTMLPanel, DashboardLayout> { } private static DashboardLayoutUiBinder ourUiBinder = GWT.create( DashboardLayoutUiBinder.class ); @UiField HTMLPanel htmlPanel; public DashboardLayout() { HTMLPanel rootElement = ourUiBinder.createAndBindUi( this ); this.initWidget( rootElement ); rootElement.add( new HTML( "panel1" ), leftId ); rootElement.add( new HTML( "panel2" ), rightId ); } } XML descriprion: <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui' > <g:HTMLPanel ui:field="htmlPanel"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="40%" id="boxLeft" class="boxContextLeft"> </td> <td width="60%" id="boxRight" class="boxContextRight"> </td> </tr> </table> </g:HTMLPanel> </ui:UiBinder>

    Read the article

  • SMS/Text message sending via PHP

    - by Onion
    I'm interested in knowing if it would be at all feasible to be able to send text messages via PHP. The main purpose of which would be to send a single message to a group of people - 10+ - with updates regarding news and such. Preferably the solution should be free, though it is not a necessity in any way. Thanks to all in advance.

    Read the article

  • MS Access form_current() firing multiple times

    - by Eric G
    I have a form with two subforms (on separate tab pages). It's an MDB project in Access 2003. When it initially opens, Form_Current on the active subform fires once, as it should. But when you move to another record (ie. from the main form), it fires Form_Current on the active subform 4 times. Then subsequent record-moves result in Form_Current firing 2 times. This is a pain, because the subforms have a lot of fields that get moved and/or hidden and so it jumps around for every Form_Current, not to mention being slow. I am opening the form with a filter via DoCmd.OpenForm (actually it sends the filter in via OpenArgs). FilterOn is only set once, in Form_Open on the main form, never in the subforms. Form_Current is not called explicitly anywhere else in the code. When I look at the call stack when Form_Current fires moving the first time, it looks like: my_subform.Form_Current [<Debug Window>] my_subform.Form_Current So it seems like something in Form_Current is triggering another Form_Current event. But only on the first record move. The code in Form_Current is somewhat complex, involving custom classes and event callbacks, but generally does not touch the table data. The only thing I can think might be triggering a Form_Current is that it checks OldValue on form controls - could this be causing it? Or anything else come to mind? Thanks. Eric

    Read the article

  • Django Admin drop down combobox and assigned values

    - by Daniel Garcia
    I have several question for the Django Admin feature. Im kind of new in Django so im not sure how to do it. Basically what Im looking to do is when Im adding information on the model. Some of the fields i want them to be drop-downs and maybe combo-boxes with AutoCompleteMode. Also looking for some fields to have the same information, for example if i have a datatime field I want that information to feed the fields day, month and year from hoti.hotiapp.models import Occurrence from django.contrib import admin class MyModelAdmin(admin.ModelAdmin): exclude = ['reference',] admin.site.register(Occurrence, MyModelAdmin) Anything helps Thanks in advance

    Read the article

  • Locked out by changing file permissions

    - by Valeriy
    I just locked my root account (and all other accounts if it matters) completely out of the RHEL 5.4 by changing permissions on every file to 400. Now I have "Permission denied" on any command that I try to run, including chmod itself. Any idea on how to recover? The only access I have to the server is via terminal or SSH. (If anyone cares how it happened, I was running a hardening script and one of the lines was supposed to change permission on some config files in /etc directory. It has couple of variables that had not been set, so the command essentially evaluated to chmod -R 0400 /* Ouch! This is sure a great lesson on checking the scripts even more carefully in the future but what can I do now?

    Read the article

  • Java - how to tell class of an object?

    - by lkm
    Given a method that accepts as a parameter a certain supertype. Is there any way, within that method, to determine the actual class of the object that was passed to it? I.e. if a subtype of the allowable parameter was actually passed, is there a way to find out which type it is? If this isn't possible can someone explain why not (from a language design perspective)? Thanks Update: just to make sure I was clear void doSomething(MyType myType) { //determine if myType is MyType OR one of its subclasses } Since the method signature specifies the parameter as being MyType, then how can one tell if the object is actually a subtype of MyType (and which one).

    Read the article

  • dojox.widget.dialog: disable close button opacity animation

    - by James Maroney
    I am nearly happy with my dialog widget now, only that there is a built-in behavior of the close button fading in and out with mouseover/out interaction. I have found no way to disable this feature such that the close button remains at full opacity anytime the dialog is open. Here's roughly the code I'm working from: var d = new dojox.widget.Dialog({modal:true,sizeMethod:"chain",closable:true}); d.startup(); d.attr('content', /*html content*/); d.attr('dimensions',[/*width*/, /*height*/ ]).show(); There's much logic that I'm omitting here for brevity, but this should be all that is specifically pertinent to the way I am constructing the dialog. Many Thanks.

    Read the article

  • Using SWFObject, the flash moves 1 pixel to the right on Firefox

    - by jeffkee
    Please check this page: http://islandhideaway.weebly.com/ For whatever reason, the flash slideshow moves over 1 pixel when opened in Firefox on my Mac. All other browsers render it fine, but only on Firefox it leaves a 1 pixel white gap on the left! I am using the most recent version of SWFObject. This unfortunately is a garbage Weebly site and I cannot use jQuery in the system so I can't do a real gallery... so let's save the whole "don't use Flash for that" pep talk. It's a favour for a friend and I am already aware of better ways to do it. :)

    Read the article

  • Can we create a class from a xml file ?

    - by panzerschreck
    Hello, Is it possible to create a class dynamically by reading an xml file ( in java preferably) ? if yes, please provide pointers on how to do it. In the process of development, we have come up with a class that has 5 attributes, all these attributes correspond to an entry in the xml file, now if the user adds/modifies the xml entry the object corresponding to it must change automatically, one approach would be generate the source code, before compile time.Is there any other way ? Is there any common pattern to model such changes in the system ? Thanks,

    Read the article

  • Using an NSButtonCell with template image in a NSTableView

    - by alloy
    In Interface Builder, I have set the dataCell of one of the columns of my NSTableView instance to be NSButtonCell. This works as expected, however, trying to use a ‘template’ image doesn't yield the expected visual result when clicking the button. How I configure the NSButtonCell: Image: NSRevealFreestandingTemplate Scaling: None Bezel: Bevel Type: Momentary Push In Bordered: false Expected result when clicking the button: Since the image is a ‘template’, the button should render its ‘on’ state. The background, ie the space surrounding the image, should not change. Actual result when clicking the button: No difference in the ‘state’ of the rendered image. The background color changes to white. Even-though I’ve tried my best to make the explanation of the problem as concise as possible, I’ve also made a simple screencast to visually illustrate the problem. And uploaded the demo app.

    Read the article

  • Target .NET 3.5 C++/CLI in Visual Studio 2010 Beta 2

    - by jeffora
    Has anyone had any success converting a VS 2008 C++/CLI (vcproj) project to a VS 2010 project (vcxproj), whilst maintaining .NET 3.5 as the target framework? I haven't been able to do this and get the project to build successfully. The project compiles fine in VS2008 as .NET 3.5, and fine in VS2010 as .NET 4.0, but I am unable to target .NET 3.5 in 2010. The IDE doesn't seem to provide an option for it, and modifying the vcxproj file by adding <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> causes compilation to fail with the folling error: Error 1 error C1001: An internal error has occurred in the compiler. According to this link, there is apparently some differences in compilers used between VS2008 and 2010, but manually editing the project file was still suggested as a solution. Does anyone have any idea on this?

    Read the article

  • Security for ASP.NET Diagnostics page

    - by Moe Sisko
    I'm thinking of creating a diagnostics page for an ASP.NET app, which would be mostly intended for admin use to get more information about the application for diagnosing problems. Examples of the info the page might have : System.Environment.MachineName (might be useful in web farm scenarios) System.Environment.Version Environment.UserName database name current user's session ID Some of the info on this page might be sensitive from a security perspective. If you've done this sort of page before, what sort of security did you put on access to this page ? .

    Read the article

  • How do I pass an array of structs (containing std:string or BSTR) from ATL to C#. SafeArray? Varian

    - by Andrew
    Hi, I have an ATL COM object that I am using from C#. The interface currently looks like: interface ICHASCom : IDispatch{ [id(1), helpstring("method Start")] HRESULT Start([in] BSTR name, [out,retval] VARIANT_BOOL* result); ... [id(4), helpstring("method GetCount")] HRESULT GetCount([out,retval] LONG* numPorts); ... [id(7), helpstring("method EnableLogging")] HRESULT EnableLogging([in] VARIANT_BOOL enableLogging); }; That is, it's a very simple interface. I also have some events that I send back too. Now, I would like to add something to the interface. In the ATL I have some results, which are currently structs and look like struct REPORT_LINE { string creationDate; string Id; string summary; }; All the members of the struct are std::string. I have an array of these that I need to get back to the C#. What's the best way to do this? I suspect someone is going to say, "hey, you can't just send std::string over COM like that. If so, fine, but what's the best way to modidfy the struct? Change the std::string to BSTR? And then how do I, 1) Set up the IDL to pass an array of structs (structs with BSTR or std::string) 2) If I must use SAFEARRAYS, how do I fill the SAFEARRAYS with the structs. I'm not familiar with COM except for use with simple types. Thanks, Dave

    Read the article

  • When I add a database table to a DBML file via LINQ to SQL, I get a slew of compiler errors.

    - by Zian Choy
    Whenever I add a certain table to a DBML file via LINQ to SQL, I get 102 errors in my VB NET project. Some of the errors: Error 1 Attribute 'TableAttribute' cannot be applied multiple times. C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 74 2 EMS Reality Check Error 2 'emptyChangingEventArgs' is already declared as 'Private Shared emptyChangingEventArgs As System.ComponentModel.PropertyChangingEventArgs' in this class. C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 78 17 EMS Reality Check Error 3 '_GroupID' is already declared as 'Private _GroupID As Integer' in this class. C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 80 10 EMS Reality Check Error 4 '_ID' is already declared as 'Private _ID As Integer' in this class. C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 82 10 EMS Reality Check Any suggestions for getting the table to work with LINQ to SQL will be welcomed. The table's properties: Group ID ID (Primary Key) Contact Title UseGroupAddress InternationalFormat Address1 Address2 City State ZipCode Country Phone Fax EMailAddress Notes DateAdded AddedBy DateChanged ChangedBy Active ExternalReference ChangeCounter PhoneLabel FaxLabel

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >