Search Results

Search found 7375 results on 295 pages for 'parameter'.

Page 15/295 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • WCF object parameter loses values

    - by Josh
    I'm passing an object to a WCF service and wasn't getting anything back. I checked the variable as it gets passed to the method that actually does the work and noticed that none of the values are set on the object at that point. Here's the object: [DataContract] public class Section { [DataMember] public long SectionID { get; set; } [DataMember] public string Title { get; set; } [DataMember] public string Text { get; set; } [DataMember] public int Order { get; set; } } Here's the service code for the method: [OperationContract] public List<Section> LoadAllSections(Section s) { return SectionRepository.Instance().LoadAll(s); } The code that actually calls this method is this and is located in a Silverlight XAML file: SectionServiceClient proxy = new SectionServiceClient(); proxy.LoadAllSectionsCompleted += new EventHandler<LoadAllSectionsCompletedEventArgs>(proxy_LoadAllSectionsCompleted); Section s = new Section(); s.SectionID = 4; proxy.LoadAllSectionsAsync(s); When the code finally gets into the method LoadAllSections(Section s), the parameter's SectionID is not set. I stepped through the code and when it goes into the generated code that returns an IAsyncResult object, the object's properties are set. But when it actually calls the method, LoadAllSections, the parameter received is completely blank. Is there something I have to set to make the proeprty stick between method calls?

    Read the article

  • i want to search in sql server with must have parameter in one colunm

    - by sherif4csharp
    hello i am usning c# and ms SQL server 2008 i have table like this id | propertyTypeId | FinishingQualityId | title | Description | features 1 1 2 prop1 propDEsc1 1,3,5,7 2 2 3 prop2 propDEsc2 1,3 3 6 5 prop3 propDEsc3 1 4 5 4 prop4 propDEsc4 3,5 5 4 6 prop5 propDEsc5 5,7 6 4 6 prop6 propDEsc6 and here is my stored code (search in the same table) create stored procdures propertySearch as @Id int = null, @pageSize float , @pageIndex int, @totalpageCount int output, @title nvarchar(150) =null , @propertyTypeid int = null , @finishingqualityid int = null , @features nvarchar(max) = null , -- this parameter send like 1,3 ( for example) begin select row_number () as TempId over( order by id) , id,title,description,propertyTypeId,propertyType.name,finishingQualityId,finishingQuality.Name,freatures into #TempTable from property join propertyType on propertyType.id= property.propertyTypeId join finishingQuality on finishingQuality.id = property.finishingQualityId where property.id = isnull(@id,property.id ) and proprty.PropertyTypeId= isnull(@propertyTypeid,property.propertyTypeId) select totalpageconunt = ((select count(*) from #TempTable )/@pageSize ) select * from #TempTable where tempid between (@pageindex-1)*@pagesize +1 and (@pageindex*@pageSize) end go i can't here filter the table by feature i sent. this table has to many rows i want to add to this stored code to filter data for example when i send 1,3 in features parameter i want to return row number one and two in the example table i write in this post (want to get the data from table must have the feature I send) many thanks for every one helped me and will help

    Read the article

  • Crystal Report: Missing Parameter Values

    - by Chintan
    Hi! I am new to Crystal report, application is on ASP.net 3.5 and MySQL 5.1 with, going to develop report with between dates from date and to date, first page of report is shown good but when i tried to navigate on another page i got error like Missing Parameter Values Thanks in advance public partial class BookingStatement : System.Web.UI.Page { //DAL is my Data Access Layer Class //Book is ReportClass DAL obj = new DAL(); Book bkStmt = new Book(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //crvBooking is Crystal Report Viewer //reportFill method is to fill Report reportFill(); crvBooking.EnableViewState = true; crvBooking.EnableParameterPrompt = false; } /* Also try reportFill() out side !IsPostBack but didn't work */ //Check if the parmeters have been shown. /* if ((ViewState["ParametersShown"] != null) && (ViewState["ParametersShown"].ToString() == "True")) { bkStmt.SetParameterValue(0, "20/04/2010"); bkStmt.SetParameterValue(1, "20/04/2010"); }*/ } protected void crvBooking_navigate(object sender, CrystalDecisions.Web.NavigateEventArgs e) { // reportFill(); } protected void reportFill() { //bkStmt.rpt is Report file //bookingstatment is View //bkStmt is ReportClass object of Book string rptPath = "bkStmt.rpt"; string query = "select * from bookingstatment"; crvBooking.RefreshReport(); crvBooking.Height = 600; crvBooking.Width = 900; bkStmt.ResourceName = rptPath; String dtFrm = bkStmt.ParameterFields[0].CurrentValues.ToString(); obj.SetCommandType(CommandType.Text); obj.CommText = query; DataTable dtst = obj.GetDataTable(); crvBooking.ParameterFieldInfo.Clear(); ParameterDiscreteValue discretevalue = new ParameterDiscreteValue(); discretevalue.Value = "20/04/2010"; // Assign parameter ParameterValues values = new ParameterValues(); values.Add(discretevalue); bkStmt.SetDataSource(dtst); ViewState["ParametersShown"] = "True"; crvBooking.EnableViewState = true; bkStmt.DataDefinition.ParameterFields[0].ApplyCurrentValues(values); bkStmt.DataDefinition.ParameterFields[1].ApplyCurrentValues(values); crvBooking.ReportSource = bkStmt; } }

    Read the article

  • jQuery - Callback failing if there is no options parameter

    - by user249950
    Hi, I'm attempting to build a simple plugin like this (function($) { $.fn.gpSlideOut = function(options, callback) { // default options - these are used when no others are specified $.fn.gpSlideOut.defaults = { fadeToColour: "#ffffb3", fadeToColourSpeed: 500, slideUpSpeed: 400 }; // build main options before element iteration var o = $.extend({}, $.fn.gpSlideOut.defaults, options); this.each(function() { $(this) .animate({backgroundColor: o.fadeToColour},o.fadeToColourSpeed) .slideUp(o.SlideUpSpeed, function(){ if (typeof callback == 'function') { // make sure the callback is a function callback.call(this); // brings the scope to the callback } }); }); return this; }; // invoke the function we just created passing it the jQuery object })(jQuery); The confusion I'm having is that normally on jQuery plugins you can call something like this: $(this_moveable_item).gpSlideOut(function() { // Do stuff }); Without the options parameter, but it misses the callback if I do it like that so I have to always have var options = {} $(this_moveable_item).gpSlideOut(options, function() { // Do stuff }); Even if I only want to use the defaults. Is there anyway to make sure the callback function is called whether or not the options parameter is there? Cheers.

    Read the article

  • java script - Cant send parameter to function from info window in google map marker info window

    - by drdigital
    I'm showing up some markers on a map. when clicked, an info window appear. this window contains 2 button each send ajax request. the problem is that when I send any thing (Except a marker parameter below) to the button onClick event it does not work. and I get the error "adminmap.html:1 Uncaught SyntaxError: Unexpected token ILLEGAL" on the first line of the HTML page not the script file at all. function handleButtonApprove(id) { //error happens here when I send any parameter except marker8(defined below) //console.log(id); $(document).ready(function () { $.ajax({ type: "POST", url: VERIFY_OBSTACLES_URL, //data: { markerID:sentID , approved:0 }, success: function (data) { alert(data); } }); }); } function handleButtonReject() { $(document).ready(function () { $.ajax({ type: "POST", url: VERIFY_OBSTACLES_URL, //data: { markerID:marker.id , approved:0 }, success: function (data) { alert(data); } }); }); } function attachInfo(marker8, num) { //var markerID = marker.get("id"); //console.log(markerID); var infowindow = new google.maps.InfoWindow({ //Here is the error , if I sent num.toString, num or any string , it does not work. If send marker8.getPosition() for example it works. May I know the reason ? content: '<div id="info_content">Matab Info</div> <button onclick="handleButtonApprove(' + num.toString() + ')">Verify</button> </br> <button onclick="handleButtonReject()">Remove</button>' }); google.maps.event.addListener(marker8, 'click', function () { infowindow.open(marker8.get('map'), marker8); }); }

    Read the article

  • Partial template specialization: matching on properties of specialized template parameter

    - by Kenzo
    template <typename X, typename Y> class A {}; enum Property {P1,P2}; template <Property P> class B {}; class C {}; Is there any way to define a partial specialization of A such that A<C, B<P1> > would be A's normal template, but A<C, B<P2> > would be the specialization? Replacing the Y template parameter by a template template parameter would be nice, but is there a way to partially specialize it based on P then? template <typename X, template <Property P> typename Y> class A {}; // template <typename X> class A<X,template<> Y<P2> > {}; <-- not valid Is there a way by adding traits to a specialization template<> B<P2> and then using SFINAE in A?

    Read the article

  • Setting a parameter as a list for an IN expression

    - by perilandmishap
    Whenever I try to set a list as a parameter for use in an IN expression I get an Illegal argument exception. Various posts on the internet seem to indicate that this is possible, but it's certainly not working for me. I'm using Glassfish V2.1 with Toplink. Has anyone else been able to get this to work, if so how? here's some example code: List<String> logins = em.createQuery("SELECT a.accountManager.loginName " + "FROM Account a " + "WHERE a.id IN (:ids)") .setParameter("ids",Arrays.asList(new Long(1000100), new Long(1000110))) .getResultList(); and the relevant part of the stack trace: java.lang.IllegalArgumentException: You have attempted to set a value of type class java.util.Arrays$ArrayList for parameter accountIds with expected type of class java.lang.Long from query string SELECT a.accountManager.loginName FROM Account a WHERE a.id IN (:accountIds). at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.setParameterInternal(EJBQueryImpl.java:663) at oracle.toplink.essentials.internal.ejb.cmp3.EJBQueryImpl.setParameter(EJBQueryImpl.java:202) at com.corenap.newtDAO.ContactDaoBean.getNotificationAddresses(ContactDaoBean.java:437) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011) at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175) at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920) at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4011) at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:203) ... 67 more

    Read the article

  • Update parameter not working on bound DropDownList

    - by ProfK
    I have a DropDownList declared like this: <asp:DropDownList ID="campaignTypeList" runat="server" Width="150px" DataTextField="Name" DataValueField="CampaignTypeId" DataSourceID="campaignTypesDataSource" SelectedValue='<%# Bind("CampaignTypeID") %>'> </asp:DropDownList> Using the designer, my SqlDataSource is configured as follows1: <asp:SqlDataSource ID="campaignDataSource" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:ProVantageMediaManagement %>" SelectCommand="ActivationCampaignGetById" SelectCommandType="StoredProcedure" UpdateCommand="ActivationCampaignUpdate" UpdateCommandType="StoredProcedure"> <SelectParameters> <asp:QueryStringParameter DefaultValue="98" Name="campaignId" Direction="Input" QueryStringField="id" Type="Int32" /> </SelectParameters> <UpdateParameters> <asp:QueryStringParameter DefaultValue="98" Name="campaignId" Direction="Input" QueryStringField="id" Type="Int32" /> <asp:Parameter Name="campaignName" Type="String" /> <asp:Parameter Name="campaignTypeId" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource> Yet when the update command is sent to the DB, the campaignTypeId value is always 1, no matter which item is selected in the DropDownList. What am I doing wrong? 1 Bonus points for telling us what a ControlParameter is meant for, if not for handling values of controls in a scenario like this.

    Read the article

  • XSLT-Looping and recursion based on parameter passed

    - by contactkx
    I have an XML organized like below- <section name="Parent 1 Text here" ID="1" > <section name="Child 1 Text here" ID="11"> </section> <section name="Child 2 Text here" ID="12"> <section name="GrandChild Text here" ID="121" > </section> </section> </section> <section name="Parent 2 Text here" ID="2" > <section name="Child 1 Text here" ID="22"> </section> <section name="Child 2 Text here" ID="23"> <section name="GrandChild Text here" ID="232" > </section> </section> </section> I have to produce the below output XML - <section name="Parent 1 Text here" ID="1" > <section name="Child 2 Text here" ID="12"> <section name="GrandChild Text here" ID="121" > </section> </section> </section> <section name="Parent 2 Text here" ID="2" > <section name="Child 2 Text here" ID="23"> </section> </section> I have to achive above using XSLT 1.0 transformation. I was planning to pass a comma separated string as a parameter with value= "1,12,121,2,23" My question- How to loop the comma separated parameter in XSLT 1.0 ? Is there a simpler way to achieve the above. Please remember I have to do this in XSLT 1.0 Your help is appreciated.

    Read the article

  • Java map with values limited by key's type parameter

    - by Ashley Mercer
    Is there a way in Java to have a map where the type parameter of a value is tied to the type parameter of a key? What I want to write is something like the following: public class Foo { // This declaration won't compile - what should it be? private static Map<Class<T>, T> defaultValues; // These two methods are just fine public static <T> void setDefaultValue(Class<T> clazz, T value) { defaultValues.put(clazz, value); } public static <T> T getDefaultValue(Class<T> clazz) { return defaultValues.get(clazz); } } That is, I can store any default value against a Class object, provided the value's type matches that of the Class object. I don't see why this shouldn't be allowed since I can ensure when setting/getting values that the types are correct. EDIT: Thanks to cletus for his answer. I don't actually need the type parameters on the map itself since I can ensure consistency in the methods which get/set values, even if it means using some slightly ugly casts.

    Read the article

  • Delphi Pascal / Windows API - Small problem with SetFilePointerEx and parameter FILE_END

    - by SuicideClutchX2
    I know I am about to be slapped by at least one person who was helping me with this API. Alright I have been able to use SetFilePointerEx just fine, when setting the position only. SetFilePointerEx(PD,512,@PositionVar,FILE_BEGIN); SetFilePointerEx(PD,0,@PositionVar,FILE_CURRENT); Both work, I can set positions and even check my current one. But when I set FILE_END as per the documentation no matter what the second parameter is and whether or not i provide a pointer for the third parameter it fails even on a valid handle that many other operations are able to use without fail. For Example: SetFailed := SetFilePointerEx(PD,0,@PositionVar,FILE_END); SetFailed := SetFilePointerEx(PD,0,nil,FILE_END); Whatever I put it fails. I am working with a handle to a physical disk and it most definitely has an end. SetFilePointer works just fine its just a little more trouble than I would like. Its not the end of the world, but whats happening.

    Read the article

  • Looping and recursion based on parameter passed

    - by contactkx
    I have an XML organized like below- <section name="Parent 1 Text here" ID="1" > <section name="Child 1 Text here" ID="11"> </section> <section name="Child 2 Text here" ID="12"> <section name="GrandChild Text here" ID="121" > </section> </section> </section> <section name="Parent 2 Text here" ID="2" > <section name="Child 1 Text here" ID="22"> </section> <section name="Child 2 Text here" ID="23"> <section name="GrandChild Text here" ID="232" > </section> </section> </section> I have to produce the below output XML - <section name="Parent 1 Text here" ID="1" > <section name="Child 2 Text here" ID="12"> <section name="GrandChild Text here" ID="121" > </section> </section> </section> <section name="Parent 2 Text here" ID="2" > <section name="Child 2 Text here" ID="23"> </section> </section> I have to achive above using XSLT 1.0 transformation. I was planning to pass a comma separated string as a parameter with value= "1,12,121,2,23" My question- How to loop the comma separated parameter in XSLT 1.0 ? Is there a simpler way to achieve the above. Please remember I have to do this in XSLT 1.0 Your help is appreciated.

    Read the article

  • Java Generics Class Parameter Type Inference

    - by Pindatjuh
    Given the interface: public interface BasedOnOther<T, U extends BasedList<T>> { public T getOther(); public void staticStatisfied(final U list); } The BasedOnOther<T, U extends BasedList<T>> looks very ugly in my use-cases. It is because the T type parameter is already defined in the BasedList<T> part, so the "uglyness" comes from that T needs to be typed twice. Problem: is it possible to let the Java compiler infer the generic T type from BasedList<T> in a generic class/interface definition? Ultimately, I'd like to use the interface like: class X implements BasedOnOther<BasedList<SomeType>> { public SomeType getOther() { ... } public void staticStatisfied(final BasedList<SomeType> list) { ... } } // Does not compile, due to invalid parameter count. Instead: class X implements BasedOnOther<SomeType, BasedList<SomeType>> { public SomeType getOther() { ... } public void staticStatisfied(final BasedList<SomeType> list) { ... } }

    Read the article

  • Python and the self parameter

    - by Svend
    I'm having some issues with the self parameter, and some seemingly inconsistent behavior in Python is annoying me, so I figure I better ask some people in the know. I have a class, Foo. This class will have a bunch of methods, m1, through mN. For some of these, I will use a standard definition, like in the case of m1 below. But for others, it's more convinient to just assign the method name directly, like I've done with m2 and m3. import os def myfun(x, y): return x + y class Foo(): def m1(self, y, z): return y + z + 42 m2 = os.access m3 = myfun f = Foo() print f.m1(1, 2) print f.m2("/", os.R_OK) print f.m3(3, 4) Now, I know that os.access does not take a self parameter (seemingly). And it still has no issues with this type of assignment. However, I cannot do the same for my own modules (imagine myfun defined off in mymodule.myfun). Running the above code yields the following output: 3 True Traceback (most recent call last): File "foo.py", line 16, in <module> print f.m3(3, 4) TypeError: myfun() takes exactly 2 arguments (3 given) The problem is that, due to the framework I work in, I cannot avoid having a class Foo at least. But I'd like to avoid having my mymodule stuff in a dummy class. In order to do this, I need to do something ala def m3(self,a1, a2): return mymodule.myfun(a1,a2) Which is hugely redundant when you have like 20 of them. So, the question is, either how do I do this in a totally different and obviously much smarter way, or how can I make my own modules behave like the built-in ones, so it does not complain about receiving 1 argument too many.

    Read the article

  • String Parameter in url

    - by Ivan90
    Hy Guys, I have to pass in a method action a string parameter, because I want to implement a tags' search in my site with asp.net MVC but everytime in action it is passed a null value. I post some code! I try to create a personal route. routes.MapRoute( "TagsRoute", "Tags/PostList/{tag}", new {tag = "" } ); My RouteLink in a viewpage for each tag is: <% foreach (var itemtags in item.tblTagArt) {%> <%= Html.RouteLink(itemtags.Tags.TagName,"TagsRoute", new {tag=itemtags.Tags.TagName})%>, <% } %> My method action is: public ActionResult PostList(string tag) { if (tag == "") { return RedirectToAction("Index", "Home"); } else { var articoli = artdb.GetArticoliByTag(tag); if (articoli == null) { return RedirectToAction("Index", "Home"); } return View(articoli); } } Problem is value tag that's always null, and so var articoli is always empty! Probably my problem is tag I have to make a route contrainst to my tag parameter. Anybody can help me? N.B I am using ASP.NET MVC 1.0 and not 2.0!

    Read the article

  • Problem: writing parameter values to data driven MSTEST output

    - by Shubh
    Hi, I am trying to extract some information about the parameter variants used in an MSTEST data driven test case from trx file. Currently, For data driven tests, I get the output of same testcase with different inputs as a sequence of tags , but there is no info about the value of the variants. Example: Suppose we have a [data driven]TestMethod1() and the data rows contain variations a and b. There are two variations a=1,b=2 for which the test passes and a=3,b=4 for which the test fails. If we can output the info that it was a=1,b=2 which passed and a=3 b=4 which failed in the trx file; the output will be meaningful. Better information about test case runs from the output file alone(without any dependencies). Investigating the test failure without rerunning the whole set If the data rows change in data source(now a=1,b=2 pass and a=5,b=6 fail) , easy to decipher that the errors are different; although the fail sequence is still the same(row 0 pass row 1 fail but now row1 is different) Has any of you gone through a similar problem? What did you follow? I tried to put the parameter value information in the Description attribute of TestMethod, it didnt work. Any other methods you think can work too? thanks, Shubhankar

    Read the article

  • Passing optional parameter by reference in c++

    - by Moomin
    I'm having a problem with optional function parameter in C++ What I'm trying to do is to write function with optional parameter which is passed by reference, so that I can use it in two ways (1) and (2), but on (2) I don't really care what is the value of mFoobar. I've tried such a code: void foo(double &bar, double &foobar = NULL) { bar = 100; foobar = 150; } int main() { double mBar(0),mFoobar(0); foo(mBar,mFoobar); // (1) cout << mBar << mFoobar; mBar = 0; mFoobar = 0; foo(mBar); // (2) cout << mBar << mFoobar; return 0; } but it crashes at void foo(double &bar, double &foobar = NULL) with message : error: default argument for 'double& foobar' has type 'int' Is it possible to solve it without function overloading? Thanks in advance for any suggestions. Pawel

    Read the article

  • Checking instance of non-class constrained type parameter for null in generic method

    - by casperOne
    I currently have a generic method where I want to do some validation on the parameters before working on them. Specifically, if the instance of the type parameter T is a reference type, I want to check to see if it's null and throw an ArgumentNullException if it's null. Something along the lines of: // This can be a method on a generic class, it does not matter. public void DoSomething<T>(T instance) { if (instance == null) throw new ArgumentNullException("instance"); Note, I do not wish to constrain my type parameter using the class constraint. I thought I could use Marc Gravell's answer on "How do I compare a generic type to its default value?", and use the EqualityComparer<T> class like so: static void DoSomething<T>(T instance) { if (EqualityComparer<T>.Default.Equals(instance, null)) throw new ArgumentNullException("instance"); But it gives a very ambiguous error on the call to Equals: Member 'object.Equals(object, object)' cannot be accessed with an instance reference; qualify it with a type name instead How can I check an instance of T against null when T is not constrained on being a value or reference type?

    Read the article

  • Passing a WHERE clause for a Linq-to-Sql query as a parameter

    - by Mantorok
    Hi all This is probably pushing the boundaries of Linq-to-Sql a bit but given how versatile it has been so far I thought I'd ask. I have 3 queries that are selecting identical information and only differ in the where clause, now I know I can pass a delegate in but this only allows me to filter the results already returned, but I want to build up the query via parameter to ensure efficiency. Here is the query: from row in DataContext.PublishedEvents join link in DataContext.PublishedEvent_EventDateTimes on row.guid equals link.container join time in DataContext.EventDateTimes on link.item equals time.guid where row.ApprovalStatus == "Approved" && row.EventType == "Event" && time.StartDate <= DateTime.Now.Date.AddDays(1) && (!time.EndDate.HasValue || time.EndDate.Value >= DateTime.Now.Date.AddDays(1)) orderby time.StartDate select new EventDetails { Title = row.EventName, Description = TrimDescription(row.Description) }; The code I want to apply via a parameter would be: time.StartDate <= DateTime.Now.Date.AddDays(1) && (!time.EndDate.HasValue || time.EndDate.Value >= DateTime.Now.Date.AddDays(1)) Is this possible? I don't think it is but thought I'd check out first. Thanks

    Read the article

  • Reading from an write-only(OUT) parameter in pl/sql

    - by sqlgrasshopper5
    When I tried writing to an read-only parameter(IN) of a function, Oracle complains with an error. But that is not the case when reading from an write-only(OUT) parameter of a function. Oracle silently allows this without any error. What is the reason for this behaviour?. The following code executes without any assignment happening to "so" variable: create or replace function foo(a OUT number) return number is so number; begin so := a; --no assignment happens here a := 42; dbms_output.put_line('HiYA there'); dbms_output.put_line('VAlue:' || so); return 5; end; / declare somevar number; a number := 6; begin dbms_output.put_line('Before a:'|| a); somevar := foo(a); dbms_output.put_line('After a:' || a); end; / Here's the output I got: Before a:6 HiYA there VAlue: After a:42

    Read the article

  • Total Average Week using a Parameter

    - by Jose
    I have a crystal report that shows sales volumes called week to date volume. It shows current week, previous week, and average week. The report prompts for a date parameter and I extract the week number to get current week and previous week volumes. Did it this way because Mngmt wants to be able to run report whenever. My problem is for Average Week I cant figure out how to get the number of weeks to divide by for my average. Report originates from June 1st, 2010. Right now I have: DATEPART("ww", {?date}) - DATEPART("ww", DATE(2010, 6, 1)) This returns 2 right now which is perfect, so i divide my total by 2. This code will work until the end of the year then I'm hooped. Any idea how I can make this a little more dynamic. I was thinking a counter somehow, just can't get the logic down because the date parameter will keep changing, meaning I cant increase my counter by 1 after each week??? Cheers.

    Read the article

  • Parameter meaning of CBasePin::GetMediaType(int iPosition, ...) method

    - by user325320
    Thanks to everyone who views my question. http://msdn.microsoft.com/en-us/library/windows/desktop/dd368709(v=vs.85).aspx It is not very clear from the documentation regarding the iPosition parameter for virtual HRESULT GetMediaType( int iPosition, CMediaType *pMediaType ); It is said "Zero-based index value.", but what kind of index it is? the index of the samples? I have a source filter sending the H.264 NALU flows (MEDIASUBTYPE_AVC1) and it works very well except that the SPS/PPS may be changed after the video is played for a while. The SPS and PPS are appended to the MPEG2VIDEOINFO structure, which is passed in CMediaType::SetFormat method when GetMediaType method is called. and there is another version of GetMediaType which accepts the iPosition parameter. It seems I can use this method to update the SPS / PPS. My question is: What does the iPosition param mean, and how does Decoder Filter know which SPS/PPS are assigned for each NALU sample. HRESULT GetMediaType(int iPosition, CMediaType *pMediaType) { ATLTRACE( "\nGetMediaType( iPosition = %d ) ", iPosition); CheckPointer(pMediaType,E_POINTER); CAutoLock lock(m_pFilter->pStateLock()); if (iPosition < 0) { return E_INVALIDARG; } if (iPosition == 0) { pMediaType->InitMediaType(); pMediaType->SetType(&MEDIATYPE_Video); pMediaType->SetFormatType(&FORMAT_MPEG2Video); pMediaType->SetSubtype(&MEDIASUBTYPE_AVC1); pMediaType->SetVariableSize(); } int nCurrentSampleID; DWORD dwSize = m_pFlvFile->GetVideoFormatBufferSize(nCurrentSampleID); LPBYTE pBuffer = pMediaType->ReallocFormatBuffer(dwSize); memcpy( pBuffer, m_pFlvFile->GetVideoFormatBuffer(nCurrentSampleID), dwSize); pMediaType->SetFormat(pBuffer, dwSize); return S_OK; }

    Read the article

  • Django url rewrites and passing a parameter from Javascript

    - by William T Wild
    As a bit of a followup question to my previous , I need to pass a parameter to a view. This parameter is not known until the JS executes. In my URLConf: url(r'^person/device/program/oneday/(?P<meter_id>\d+)/(?P<day_of_the_week>\w+)/$', therm_control.Get_One_Day_Of_Current_Thermostat_Schedule.as_view(), name="one-day-url"), I can pass it this URL and it works great! ( thanks to you guys). http://127.0.0.1:8000/personview/person/device/program/oneday/149778/Monday/ In My template I have this: var one_day_url = "{% url personview:one-day-url meter_id=meter_id day_of_the_week='Monday' %}"; In my javascript: $.ajax({ type: 'GET', url: one_day_url , dataType: "json", timeout: 30000, beforeSend: beforeSendCallback, success: successCallback, error: errorCallback, complete: completeCallback }); When this triggers it works fine except I dont necessarily want Monday all the time. If I change the javascript to this: var one_day_url = "{% url personview:one-day-url meter_id=meter_id %}"; and then $.ajax({ type: 'GET', url: one_day_url + '/Monday/', dataType: "json", timeout: 30000, beforeSend: beforeSendCallback, success: successCallback, error: errorCallback, complete: completeCallback }); I get the Caught NoReverseMatch while rendering error. I assume because the URLconf still wants to rewrite to include the ?P\w+) . I seems like if I change the URL conf that breaks the abailty to find the view , and if I do what I do above it gives me the NoREverseMatch error. Any guidance would be appreciated.

    Read the article

  • Parameter error with Mysqli

    - by Morgan Green
    When I run this Query I recieve Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/morgan58/public_html/wow/includes/index/index_admin.php on line 188 SELECT * FROM characters WHERE id=5 Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /home/morgan58/public_html/wow/includes/index/index_admin.php on line 194 The Query is running and it is strying to select the correct information, but for on the actual output it's giving me a fetch_array error; if anyone can see where the error lies it'd be much appreciated. Thank you. <?php $adminid= $admin->get_id(); $characterdb= 'characters'; $link = mysqli_connect("$server", "$user", "$pass", "$characterdb"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT * FROM characters WHERE id=$adminid"; $result = mysqli_query($link, $query); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo $query; echo $row['name']; } mysqli_free_result($result); mysqli_close($link); ?>

    Read the article

  • How to append query parameter at runtime using jQuery

    - by Wondering
    Through JavaScript I am appending one query parameter to the page url and I am facing one strange behaiviour. <div> <a href="Default3.aspx?id=2">Click me</a> </div> $(function () { window.location.href = window.location.href + "&q=" + "aa"; }); Now I am appending &q=aa in default3.aspx and in this page the &q=aa is getting added continuously, causing the URL to become: http://localhost:1112/WebSite2/Default3.aspx?id=2&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa&q=aa One would say just pass it like <a href="Default3.aspx?id=2&q=aa">Click me</a>, but I cant do that. The value of this query parameter is actually the value of an HTML element which is in default3.aspx. I have to add it in runtime. What are the ways to achieve this?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >