Daily Archives

Articles indexed Wednesday May 12 2010

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

  • help with multi dimentional arrays

    - by sarmenhb11
    hi, i am building a shopping cart and cant figure out how to store something like this into a session. [product_id1] = quantity; [product_id1] = size [product_id1] = color; [product_id2] = quantity; [product_id2] = size; [product_id2] = color; ... etc so when a user select the quantity of a product then selects its color then selects to add to a cart i want the items selected to be added into a session and each item added to the cart , its attributes selected to be added into a session. how would i do this? many many thanks.

    Read the article

  • WPF 4, ListView and ListCollectionView custom sorting

    - by JustABill
    I'm trying to use a custom sort with a ListView, as described in this blog entry. I'm doing ListCollectionView view = (ListCollectionView)CollectionViewSource.GetDefaultView(TheList.ItemsSource); as recommended there and in several other places, but for some reason I'm getting "Unable to cast object of type 'MS.Internal.Data.EnumerableCollectionView' to type 'System.Windows.Data.ListCollectionView'." (TheList is of type ListView). What could be causing this?

    Read the article

  • SEO for Computer Software Engineering Topics

    - by Michael Aaron Safyan
    I'm currently trying to SEO my development and coding search custom search engine as well my website that has a variety of coding and development resources. I would like to increase the number of links to my website, but I don't want to simply generate spam. What are some places that I should submit my website, where the content would be considered relevant rather than just spam? Thanks.

    Read the article

  • Monolog conversations in SQL Service Broker 2008

    - by hemil
    Hi, I have a scenario in which I need to process(in SQL Server) messages being delivered as .xml files in a folder in real time. I started investigating SQL Service Broker for my queuing needs. Basically, I want the Service Broker to pick up my .xml files and place them in a queue as they arrive in the folder. But, SQL Service Broker does not support "Monolog" conversations, at least not in the current version. It supports only a dialog between an initiator and a target service. I can use MSMQ but then I will have two things to maintain - the .Net Code for file processing in MSMQ and the SQL Server T-SQL stored procs. What options do I have left? Thanks.

    Read the article

  • What "exotic" language feature do you use every day?

    - by fmark
    For most programmers using procedural or object-oriented languages there is a language-feature lowest common denominator: variables, procedures, standard control structures, and classes. However, almost all languages add features on top of this. Recent C# versions have LINQ and delegates. C++ has template metaprogramming. Java has annotations. What features such as these do you use every day?

    Read the article

  • Am I doing getters/setters the right way in Java?

    - by Sergio Tapia
    public class Persona { int Codigo; String Nombre; public Persona(int Codigo, String Nombre){ this.Codigo = Codigo; this.Nombre = Nombre; } public void setCodigo(int Codigo){ this.Codigo = Codigo; } public int getCodigo(){ return this.Codigo; } public void setNombre(String Nombre){ this.Nombre = Nombre; } public String getNombre(){ return this.Nombre; } } Or is there a much shorter (realiable) way to do it?

    Read the article

  • CFGRID - replace data store or filter on more than one column

    - by Casuzen
    ColdFusion 8 I have a cfgrid that that is based on a query. It is not bound to a cfc function because I want a scrolling grid, not a paged grid (you must supply the page number and page size if you use BIND).. I can figure out how to make it filter on one column by using the following code, but I really need to filter on three columns... grid.getDataSource().filter("OT_MILESTONE",t1); Adding more to the filter string does not do the trick...it ignores anything more than the first pair of values.. so..I thought if I called a function that passes the three values and returned the query results to me, I could replace the Data Store for the grid..but I cannot figure out the syntax to get it to replace. The returned variable for the query has the following format: {"COLUMNS":["SEQ_KEY","ID","OT_MILESTONE"],"DATA":[[63677,"x","y"]]} Any ideas?

    Read the article

  • Reading Windows ACLs from Java

    - by Matt Sheppard
    From within a Java program, I want to be able to list out the Windows users and groups who have permission to read a given file. Obviously Java has no built-in ability to read the Windows ACL information out, so I'm looking for other solutions. Are there any third party libraries available which can provide direct access to the ACL information for a Windows file? Failing that, maybe running cacls and capturing and then processing the output would be a reasonable temporary solution - Is the output format of cacls thoroughly documented anywhere, and is it likely to change between versions of Windows?

    Read the article

  • Visual Studio bug ~ 1 verified repro, 1 verified non-repro, any others?

    - by drachenstern
    In Visual Studio 2010 Pro (Version 10.0.30319.1 RTMRel), I noticed tonight that for some reason I kept getting a wider window for quick find, but thought I was losing my mind. So I exited, restarted, etc to verify. Here's my repro steps Open existing project (I don't think it matters which one) Press ctrlf and give it something to search for (?) in "current document" Press enter Press ctrlf Press enter goto 4 Can you reproduce a slowly expanding quick find window? Do I have some sort of wacky bugged out system? I'ld obviously like to submit a bug report to MS if this is indeed a viable repro.

    Read the article

  • Objective-C global array of ints not working as expected

    - by Fran
    In my MyConstants.h file... I have: int abc[3]; In my matching MyConstants.m file... I have: extern int abc[3] = {11, 22, 33}; In each of my other *.m files... I have #import "MyConstants.h" Inside 1 of my viewDidLoad{} methods, I have: extern int abc[]; NSLog(@"abc = (%d) (%d)", abc[1], sizeof(abc)/sizeof(int)); Why does it display "abc = (0) (3)" instead of "abc = (22) (3)"? How do I make this work as expected?

    Read the article

  • Base-camp Style Subdomains and IDs of Models

    - by Newy
    I have an app that has Basecamp-style subdomains, that is, I have Projects, Users, Apples and Oranges. The Users, Apples and Oranges are all keyed to a Project and only exist in the http://project.myapp.com. I added a project_id to Users, Apples and Oranges and everything works, except of course that the ids of those three objects increment globally, and throughout my app I lookup objects by that id. This doesn't seem like best practice. Should I instead do lookups by a secondary key? How does that affect efficiency? If there's a good blog post that covers this, would be wesome.

    Read the article

  • NullPointerException and the best way to deal with it

    - by lupin
    Note: This is homework/assignment feel not to answer if you don't want to. Ok after some search and reading these: http://stackoverflow.com/questions/425439/how-to-check-if-array-element-is-null-to-avoid-nullpointerexception-in-java http://stackoverflow.com/questions/963936/gracefully-avoiding-nullpointerexception-in-java http://c2.com/cgi/wiki?NullPointerException Am still not making any progress on how to deal with NullPointerException error on my code, snippet for questionable code: int findElement(String element) { int retval = 0; for ( int i = 0; i < setElements.length; i++) { if ( setElements[i].equals(element) ) { // This line 31 here return retval = i; } else { return retval = -1; } } return retval; } void add(String newValue) { int elem = findElement(newValue); if( numberOfElements < maxNumberOfElements && elem != -1 ) { setElements[numberOfElements] = newValue; numberOfElements++; } else { System.out.println("Element " + newValue + "already exist"); } } It compile but adding new element to a set throws a NullPointerException error. D:\javaprojects>java SetDemo Enter string element to be added A You entered A Exception in thread "main" java.lang.NullPointerException at Set.findElement(Set.java:31) at Set.add(Set.java:44) at SetDemo.main(Set.java:145) I added another check, though honestly don't have clue if this right to line 31. if ( setElements != null && setElements[i].equals(element) ) but still no joy. A documentation/tips or explanation is greatly appreciated. learning, lupin

    Read the article

  • Is there any way to achieve multiple inheritance in php?

    - by Starx
    Lets say I have a parent class class parent { } ..... This parent has three sub class class child1 { } class child2 { } class child3 { } and these child classes have further smaller parts like class child1subpar1 { } class child1subpar2 { public function foo() { echo "hi"; } } class child2subpar1 { } class child2subpar2 { } Now, how to sum this whole up like class child1 extends child1subpar1, child1subpar2 { } class child2 extends child2subpar1, childsubpar1 { } class parent extends child1,child2,child3 { } I need to execute the methods in its inherited classes and do something like this $objparent = new parent; $objparent - foo();

    Read the article

  • when text changed inputbox automatically updates next 6 text boxes

    - by James123
    I have 7 textboxes. If Top 1 textbox(Volume All Years) text changed, text need to be updated in next 6 inputboxes(Latest 2009 Volume to Latest 2014 Volume). I need javascript or Jquery for this. I will write Js textchanged() or focuschange() for top 1 textbox. So what should I write in focuschage() or textchanged methods() <tr id="row12_136" class="RegText"> <td style="width:420px;Padding-right:20px;">Volume All Years</td> <td style="width:420px;Padding-left:0px;"> <input name="12_136" type="text" maxlength="255" id="12_136" tabindex="61" title="Volume All Years" class="textbox" OnKeyPress="javascript:FocusChange();" style="width:300px;" /> </td> </tr><tr id="row12_60" class="RegText"> <td style="width:420px;Padding-right:20px;">Latest 2009 Volume*</td> <td style="width:420px;Padding-left:0px;"> <input name="12_60" type="text" maxlength="255" id="12_60" tabindex="62" title="Latest 2009 Volume" class="textbox" OnKeyPress="javascript:FocusChange();" style="width:300px;" /> <span controltovalidate="12_60" errormessage="* Required!" display="Dynamic" validationGroup="ValidateInsert" id="_ctl47" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;">* Required!</span> </td> </tr><tr id="row12_61" class="RegText"> <td style="width:420px;Padding-right:20px;">Latest 2010 Volume*</td> <td style="width:420px;Padding-left:0px;"> <input name="12_61" type="text" maxlength="255" id="12_61" tabindex="63" title="Latest 2010 Volume" class="textbox" OnKeyPress="javascript:FocusChange();" style="width:300px;" /> <span controltovalidate="12_61" errormessage="* Required!" display="Dynamic" validationGroup="ValidateInsert" id="_ctl48" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;">* Required!</span> </td> </tr><tr id="row12_62" class="RegText"> <td style="width:420px;Padding-right:20px;">Latest 2011 Volume*</td> <td style="width:420px;Padding-left:0px;"> <input name="12_62" type="text" maxlength="255" id="12_62" tabindex="64" title="Latest 2011 Volume" class="textbox" OnKeyPress="javascript:FocusChange();" style="width:300px;" /> <span controltovalidate="12_62" errormessage="* Required!" display="Dynamic" validationGroup="ValidateInsert" id="_ctl49" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;">* Required!</span> </td> </tr><tr id="row12_63" class="RegText"> <td style="width:420px;Padding-right:20px;">Latest 2012 Volume*</td> <td style="width:420px;Padding-left:0px;"> <input name="12_63" type="text" maxlength="255" id="12_63" tabindex="65" title="Latest 2012 Volume" class="textbox" OnKeyPress="javascript:FocusChange();" style="width:300px;" /> <span controltovalidate="12_63" errormessage="* Required!" display="Dynamic" validationGroup="ValidateInsert" id="_ctl50" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;">* Required!</span> </td> </tr><tr id="row12_64" class="RegText"> <td style="width:420px;Padding-right:20px;">Latest 2013 Volume*</td> <td style="width:420px;Padding-left:0px;"> <input name="12_64" type="text" maxlength="255" id="12_64" tabindex="66" title="Latest 2013 Volume" class="textbox" OnKeyPress="javascript:FocusChange();" style="width:300px;" /> <span controltovalidate="12_64" errormessage="* Required!" display="Dynamic" validationGroup="ValidateInsert" id="_ctl51" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;">* Required!</span> </td> </tr><tr id="row12_65" class="RegText"> <td style="width:420px;Padding-right:20px;">Latest 2014 Volume*</td> <td style="width:420px;Padding-left:0px;"> <input name="12_65" type="text" maxlength="255" id="12_65" tabindex="67" title="Latest 2014 Volume" class="textbox" OnKeyPress="javascript:FocusChange();" style="width:300px;" /> <span controltovalidate="12_65" errormessage="* Required!" display="Dynamic" validationGroup="ValidateInsert" id="_ctl52" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;display:none;">* Required!</span> </td>

    Read the article

  • Trilateration using 3 latitude and longitude points, and 3 distances

    - by nohat
    There exists an unknown target location (latitude and longitude co-ordinates). I have 3 latitude and longitude co-ordinate pairs and for each pair a distance in kilometers to the target location. How can I calculate the co-ordinates of the target location? For example, say I have the following data points 37.418436,-121.963477 0.265710701754km 37.417243,-121.961889 0.234592423446km 37.418692,-121.960194 0.0548954278262km What I'd like is what would the guts of the function that takes that as input and returns 37.417959,-121.961954 as output look like? I understand how to calculate the distance between two points, from http://www.movable-type.co.uk/scripts/latlong.html I understand the general principle that with three circles you get exactly one point of overlap. What I'm hazy on is the math needed to calculate that point with this input.

    Read the article

  • Create and define Vector

    - by zdmytriv
    I'm looking for method to create Vector and push some values without defining variable Vector. For example: I have function: public function bla(data:Vector.<Object>):void { ... } this function expects Vector as parameter. I can pass parameters this way var newVector:Vector.<Object> = new Vector.<Object>(); newVector.push("bla1"); newVector.push("bla2"); bla(newVector); Can I do it in one line in Flex? I'm looking for something like: bla(new Vector.<Object>().push("bla1").push("bla2")); I've also tried this: bla(function():Vector.<Object> { var result:Vector.<Object> = new Vector.<Object>(2, true); result.push("bla1"); result.push("bla2"); return result; }); But it complains: 1067: Implicit coercion of a value of type Function to an unrelated type __AS3__.vec:Vector.<Object>... Thanks

    Read the article

  • Progressive enhancement of anchor tags to avoid onclick="return false;"

    - by Chris Beck
    Unobtrusive JS suggests that we don't have any onclick attributes in our HTML templates. <a href="/controller/foo/1">View Foo 1</a> A most basic progressive enhancement is to convert an that anchor tag to use XHR to retrieve a DOM fragment. So, I write JS to add an event listener for a."click" then make an XHR to a.href. Alas, the browser still wants to navigate to "/controller/foo". So, I write JS to dynamically inject a.onclick = "return false;". Still unobtrusive (I guess), but now I'm paying the the cost of an extra event handler. To avoid the cost of 2 event listeners, I could shove my function call into the onclick attribute <a href="/controller/foo/1" onclick="myXHRFcn(); return false;"> But that's grodo for all sorts of reasons. To make it more interesting, I might have 100 anchor tags that I want to enhance. A better pattern is a single listener on a parent node that relies on event bubbling. That's cool, but how do I short circuit the browser from navigating to the URL without this on every anchor node? onclick="return false;" Manipulating the href is not an option. It must stay intact so the context menu options to copy or open in new page work as expected.

    Read the article

  • Write to pipe deadlocking program

    - by avs3323
    Hi, I am having a problem in my program that uses pipes. What I am doing is using pipes along with fork/exec to send data to another process What I have is something like this: //pipes are created up here if(fork() == 0) //child process { ... execlp(...); } else { ... fprintf(stderr, "Writing to pipe now\n"); write(pipe, buffer, BUFFER_SIZE); fprintf(stderr, "Wrote to pipe!"); ... } This works fine for most messages, but when the message is very large, the write into the pipe deadlocks. I think the pipe might be full, but I do not know how to clear it. I tried using fsync but that didn't work. Can anyone help me?

    Read the article

  • TFS 2010 - TF14040 The Folder may not be checked out.

    - by Patricker
    I have a .NET 4 website in VS2010 stored in a TFS 2010 team project. I need to add a reference to System.Data.Linq.dll to the website. I am referencing a LINQ DataContext that is defined in another project and I get build errors saying that I need the reference to System.Data.Linq. I go up to the "Add Reference" menu option and add it like I would any normal reference, and it even shows up in the Web.config and in the Properties pages for the website... BUT if I build I still get the same error. So I found a place in my code where I was referencing the LINQ count function and it told me it was invalid because I was missing a reference and it offered to add the reference automatically. I told it to add the reference automatically and it is at this point that I get the error mentioned in the subject: TF14040: The folder $/Folder/Subfolder may not be checked out. No items were checked out I've done some research online but I haven't been able to find much. I saw on a blog that making the folder not readonly fixed the issue for him, but it didn't seem to work for me unless I misunderstood something. I tried loading up the project from source control onto a fresh computer where that project had never been loaded before and I can reproduce the issue the same way. Help would be greatly appreciated.

    Read the article

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