Daily Archives

Articles indexed Friday April 9 2010

Page 10/128 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Converting "is null" into a linq to sql statement

    - by Darryl Braaten
    I am having trouble replicating the following sql as a LINQ statement select TableA.* from TableA left outer join TableAinTableB on TableA.Id = TableAId where TableBId is null The following returns no lines from TableA in db.TableA join AinB in db.TableAinTableB on TableA.Id equals TableAId where AinB.TableBId == null select TableA Also tried and a few other things that didn't work. from TableA in db.TableA join AinB in db.TableAinTableB on TableA.Id equals TableAId where AinB == null select TableA TableAinTableB is a many to many table. The query I want will pull all the records from TableA that have no records in the middle table. My sql does what I want but I have no idea how to convert it to LINQ to SQL. I ended up working around it by just doing a db.ExecuteQuery("working sql"); But I would like to know if the query is possible in LINQ and how to write it, or a pointer to a document that covers this scenario. My searching did not uncover anything I found useful.

    Read the article

  • Relative path from an ASP.NET user control NavigateUrl

    - by Daniel Ballinger
    I have a user control that contains a GridView. The GridView has both a HyperLinkField column and a template column that contains a HyperLink control. The ASP.NET project is structured as follows, with the Default.aspx page in each case using the user control. Application Root Controls UserControl with GridView SystemAdminFolder Default.aspx Edit.aspx OrganisationAdminFolder Default.aspx Edit.aspx StandardUserFolder Default.aspx Edit.aspx Note: The folders are being used to ensure the user has the correct role. I need to be able to set the DataNavigateUrlFormatString for the HyperLinkField and the NavigateUrl for the HyperLink to resolve to the Edit.aspx page in the corresponding folder. If I set the navigate URL to "Edit.aspx" the URL in the browser appears as 'http://Application Root/Controls/Edit.aspx' regardless of the originating directory. I can't use the Web application root operator (~/) as the path needs to be relative to the current page, not the application root. How can I use the same user control in multiple folders and resolve the URL to another page in the same folder? Note: The question is strongly based off a similar question by azhar2000s on the asp.net forums that matches my problem.

    Read the article

  • How to implement checkout/basket system

    - by ct2k7
    Hi, I'm making an app for fun and would like to know how to implement a checkout/basket system on the app. Basically, a list of products is pulled in from a web server in form of XML file, which is then displayed in a UITableView controller. A tap on the cell takes the user to a more detailed overview of the product. The app would need to be able to get the product into a basket type thing, and this is where I'm getting stuck. Are there any code samples that I could take a look at?

    Read the article

  • Java: Is clone() really ever used? What about defensive copying in getters/setters?

    - by GreenieMeanie
    Do people practically ever use defensive getters/setters? To me, 99% of the time you intend for the object you set in another object to be a copy of the same object reference, and you intend for changes you make to it to also be made in the object it was set in. If you setDate(Date dt) and modify dt later, who cares? Unless I want some basic immutable data bean that just has primitives and maybe something simple like a Date, I never use it. As far as clone, there are issues as to how deep or shallow the copy is, so it seems kind of "dangerous" to know what is going to come out when you clone an Object. I think I have only used clone() once or twice, and that was to copy the current state of the object because another thread (ie another HTTP request accessing the same object in Session) could be modifying it. Edit - A comment I made below is more the question: But then again, you DID change the Date, so it's kind of your own fault, hence whole discussion of term "defensive". If it is all application code under your own control among a small to medium group of developers, will just documenting your classes suffice as an alternative to making object copies? Or is this not necessary, since you should always assume something ISN'T copied when calling a setter/getter?

    Read the article

  • Wireless Networking 802.11n

    It';s been years in development but this September it looks like 802.11n Wi-Fi will finally become a standard... well, an official standard anyway. Presently the majority of the wireless hardware you... [Author: Chris Holgate - Computers and Internet - April 08, 2010]

    Read the article

  • Uses for Types of Data Recovery Services

    There are several different types of data recovery services, including hard drive, server raid, and smart media recovery. What makes things tricky is to know when to use which service, and how to kno... [Author: Richard Cuthbertson - Computers and Internet - April 08, 2010]

    Read the article

  • The Flexibility of of Internet Radio Stations

    The emergence of Internet radio stations is one of the most exciting developments in this generation of web 2.0. Everyone are now in to the social media networking and video streaming. Everyone in th... [Author: Tine Meyer - Computers and Internet - April 08, 2010]

    Read the article

  • Debugging on an iPhone device

    - by Mike Rychev
    I have a developer license and I've generated .mobileprovision and .cer files. I've put the provision file on my device, double-clicked the .cer file and added it to the login keychain. But when I'm trying to build the app in XCode, I get the error: CodeSign error: code signing is required for product type 'Application' in SDK 'Device - iPhone OS 3.1.3' What am I doing wrong? Thanks in advance!

    Read the article

  • Implementing commands in MMVM

    - by user312372
    I am trying to change the source property of the frame in Page1.xaml when the SampleCommand is excecuted. How do I acheive this in the View Model? Page1.xaml: <Page ...> <DockPanel> <r:ribbon> <r:RibbonTab Label="Keys"> <r:RibbonTab.Groups> <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}"> <r:RibbonGroup.Command> <r:RibbonCommand LabelTitle="RibbonButton"/> </r:RibbonGroup.Command> <r:RibbonButton x:Name="RibbonButton1" Command="{Binding Path=SampleCommand}"/> </r:RibbonGroup> </r:RibbonTab.Groups> </r:RibbonTab> </r:Ribbon> <Border Name="PageBorder" Grid.Row="0" Grid.Column="1"> <Frame Name="pageFrame" Source="FirstPage.xaml" /> </Border> </DockPanel> </Page> Page1ViewModel.cs: RelayCommand _sampleCommand; public ICommand SampleCommand { get { // create command ?? return _sampleCommand } } page1.xaml.cs: Page1ViewModel pageViewModel; //When page loads this.DataContext = pageViewModel;

    Read the article

  • Hash Join require Full Table Scan

    - by Pedro Magalhaes
    So, I want to know if to make a Hash Join between two tables is necessary to make a full table scan on the collumns? If i want to join COL1 wiht COL2, and COL1 is smaller, the It makes a full scan in COL1 creating a Hashmap then makes a full scan in COL2 using the sabe hash function. Is this correct?

    Read the article

  • Add functions in gdb at runtime

    - by Michael Anderson
    I'm trying to debug some STL based C++ code in gdb. The code has something like int myfunc() { std::map<int,int> m; ... } Now in gdb, inside myfunc using "print m" gives something very ugly. What I've seen recommended is compiling something like void printmap( std::map<int,int> m ) { for( std::map<int,int>::iterator it = ... ) { printf("%d : %d", it->first, it->second ); } } Then in gdb doing (gdb) call printmap( m ) This seems like a good way to handle the issue... but can I put printmap into a seperate object file (or even dynamic library) that I then load into gdb at runtime rather than compiling it into my binary - as recompiling the binary every time I want to look at another STL variable is not fun .. while compiling and loading a single .o file for the print routine may be acceptable.

    Read the article

  • javascript new Date(0) class shows 16 hours?

    - by Jonah
    interval = new Date(0); return interval.getHours(); The above returns 16. I expect it to return 0. Any pointers? getMinutes() and getSeconds() return zero as expected. Thanks! I am trying to make a timer: function Timer(onUpdate) { this.initialTime = 0; this.timeStart = null; this.onUpdate = onUpdate this.getTotalTime = function() { timeEnd = new Date(); diff = timeEnd.getTime() - this.timeStart.getTime(); return diff + this.initialTime; }; this.formatTime = function() { interval = new Date(this.getTotalTime()); return this.zeroPad(interval.getHours(), 2) + ":" + this.zeroPad(interval.getMinutes(),2) + ":" + this.zeroPad(interval.getSeconds(),2); }; this.start = function() { this.timeStart = new Date(); this.onUpdate(this.formatTime()); var timerInstance = this; setTimeout(function() { timerInstance.updateTime(); }, 1000); }; this.updateTime = function() { this.onUpdate(this.formatTime()); var timerInstance = this; setTimeout(function() { timerInstance.updateTime(); }, 1000); }; this.zeroPad = function(num,count) { var numZeropad = num + ''; while(numZeropad.length < count) { numZeropad = "0" + numZeropad; } return numZeropad; } } It all works fine except for the 16 hour difference. Any ideas?

    Read the article

  • How can I connect to Android with ADB over TCP?

    - by martinjd
    I am attempting to debug an application on a Motorola Droid but I am having some difficulty connecting to the device via USB. My development server is a Windows 7 64bit VM running in HyperV and so I cannot connect directly via USB in the guest or from the host. I installed a couple of different USB over TCP solutions but the connection appears to have issues since the adb monitor reports "devicemonitor failed to start monitoring" repeatedly. I was wondering if there is a way to connect directly from the client on the development machine to the daemon on the device using the network instead of the usb connection or possibly other viable options?

    Read the article

  • How to Access a descendant object's internal method in C#

    - by Giovanni Galbo
    I'm trying to access a method that is marked as internal in the parent class (in its own assembly) in an object that inherits from the same parent. Let me explain what I'm trying to do... I want to create Service classes that return IEnumberable with an underlying List to non-Service classes (e.g. the UI) and optionally return an IEnumerable with an underlying IQueryable to other services. I wrote some sample code to demonstrate what I'm trying to accomplish, shown below. The example is not real life, so please remember that when commenting. All services would inherit from something like this (only relevant code shown): public class ServiceBase<T> { protected readonly ObjectContext _context; protected string _setName = String.Empty; public ServiceBase(ObjectContext context) { _context = context; } public IEnumerable<T> GetAll() { return GetAll(false); } //These are not the correct access modifiers.. I want something //that is accessible to children classes AND between descendant classes internal protected IEnumerable<T> GetAll(bool returnQueryable) { var query = _context.CreateQuery<T>(GetSetName()); if(returnQueryable) { return query; } else { return query.ToList(); } } private string GetSetName() { //Some code... return _setName; } } Inherited services would look like this: public class EmployeeService : ServiceBase<Employees> { public EmployeeService(ObjectContext context) : base(context) { } } public class DepartmentService : ServiceBase<Departments> { private readonly EmployeeService _employeeService; public DepartmentService(ObjectContext context, EmployeeService employeeService) : base(context) { _employeeService = employeeService; } public IList<Departments> DoSomethingWithEmployees(string lastName) { //won't work because method with this signature is not visible to this class var emps = _employeeService.GetAll(true); //more code... } } Because the parent class lives is reusable, it would live in a different assembly than the child services. With GetAll(bool returnQueryable) being marked internal, the children would not be able to see each other's GetAll(bool) method, just the public GetAll() method. I know that I can add a new internal GetAll method to each service (or perhaps an intermediary parent class within the same assembly) so that each child service within the assembly can see each other's method; but it seems unnecessary since the functionality is already available in the parent class. For example: internal IEnumerable<Employees> GetAll(bool returnIQueryable) { return base.GetAll(returnIQueryable); } Essentially what I want is for services to be able to access other service methods as IQueryable so that they can further refine the uncommitted results, while everyone else gets plain old lists. Any ideas? EDIT You know what, I had some fun playing a little code golf with this... but ultimately I wouldn't be able to use this scheme anyway because I pass interfaces around, not classes. So in my example GetAll(bool returnIQueryable) would not be in the interface, meaning I'd have to do casting, which goes against what I'm trying to accomplish. I'm not sure if I had a brain fart or if I was just too excited trying to get something that I thought was neat to work. Either way, thanks for the responses.

    Read the article

  • Enhance Localization performances? (ComponentResourceManager.ApplyResources)

    - by Srodriguez
    Dear all, After experiencing some performances issues on my client side, we decided to give a try to some of the performance profilers to try to find the bottleneck or identify the guilty parts of the code. Of course, as many performance investigations, the problems comes from various things, but something I find out is that the ComponentResourceManager.ApplyResources of my user controls takes way too much time in the construction of my forms: more than 24% of the construction time is spent in the ApplyResources inside the InitializeComponent(). This seems rather a lot for only "finding a resource string and putting it in it's container". What is exactly done in the ComponentResourceManager.ApplyResources ? I guess more than searching the string, if not it wouldn't take that long. Is there a way to enhance the performances of the localization? Our software is localized in several languages, so we do need to keep this multi-lingual feature. Any recommendations regarding this issue? Thanks! PS: We are coding in C#, .NET 3.5 SP1.

    Read the article

  • What's faster to parse lots of data (5Mb): eval or json?

    - by AlfaTeK
    I want to get, via ajax, a collection of data objects and parse them into JS data. Currently I have 2 choices: - Server returns valid javascript code and then I eval it. - Server returns JSON object and then I eval the json object What is the fastest of these in Firefox? (I only care about the "parsing" performance, not server or data transfer)

    Read the article

  • Silverlight, dealing with Async calls

    - by Billy
    Hi there, I have some code as below: foreach (var position in mAllPositions) { DoAsyncCall(position); } //I want to execute code here after each Async call has finished So how can I do the above? I could do something like: while (count < mAllPositions.Count) { //Run my code here } and increment count after each Async call is made ... but this doesn't seem like a good way of doing it Any advice? Is there some design pattern for the above problem as i'm sure it's a common scenario?

    Read the article

  • How do you pass variables to class_eval in ruby?

    - by klochner
    I'm working on a metaprogramming task, where I'm trying to use a single method to define a polymorphic association in the calling class, while also defining the association in the target class. I need to pass in the name of the calling class to get the association right. Here's a snippet that should get the idea across: class SomeClass < ActiveRecord::Base has_many :join_models, :dependent=:destroy end class JoinModel < ActiveRecord::Base belongs_to :some_class belongs_to :entity, :polymorphic=true end module Foo module ClassMethods def acts_as_entity has_many :join_models, :as=:entity, :dependent=:destroy has_many :some_classes, :through=:join_models klass = self.name.tableize SomeClass.class_eval "has_many :#{klass}, :through=:join_models" end end end I'd like to eliminate the klass= line, but don't know how else to pass a reference to self from the calling class into class_eval. any suggestions?

    Read the article

  • How do I create a .NET Web Service that Posts items to a users Facebook Wall?

    - by Jourdan
    I'm currently toying around with the Clarity .NET Facebook API but am finding certain situations with authentication to be kind of limiting. I keep going through the tutorials but always end up hitting a brick wall with what I want to do. Perhaps I just cannot do it? I want to make a Web Service that takes in the require credentials (APIKey, SecretKey, UsersId (or Session Key?) and whatever else I would need), and then do various tasks: Post to users wall, add events etc. The problem I am having is this: The current documentation, examples and support provide a way to do this within the context of a Web site. Within this context, the required "connect" popup can be initiated and allow the user to authenticate and and connect the application. From that point on the Web can go on with its business to do what it needs to do. If I close the browser and come back to the page, I have to push the connect button again. Except this time, since I was already logged into facebook, I don't have to go through the whole connection process. But still ... How do applications like Tweetdeck get around this? They seemingly have you connect once, when you install their application, and you don't have to do it again. I would assume that this same idea would have to applied towards making a web service because: You don't know what context the user is in when making the Web service call. The web service methods being called could be coming from a Windows Form app, or code behind in a workflow.

    Read the article

  • Specify drive letters during installation

    - by Seva Alekseyev
    Hi all, The hard drive has two partitions. I'm installing Windows 7 on the second one. It automatically gets assigned the drive letter C (and the first partition becomes D). Is there any way to override this assignment during installation? It's a dual-boot system, and I want drive letters to be consistent. On the vanilla drive selection dialog, there's no letter assignment UI.

    Read the article

  • ?????????????Fusion Middleware??????????? ?3?

    - by rika.tokumichi
    ??????????OTN????????? ??OTN???????Fusion Middleware???????????????????????????????????????????????? ?OTN????????????????????????????? 2010?2????????????????? ????????????????????????????? ????????????? ???! ????? ??????????????????????????? ?????????????????Middleware???????????????????(;´?`A`` ????????????????????????? ?Weblogic Server???? ???????? ??????????????????????? Java?????????????????????WebLogic Server, JRockit??????????????????????????????????????????????????????????? ???????????????????????????????????!! ??????????8?Weblogic Server???@????????????????????????????????????????????????????? >??8?Weblogic Server???@??? ??????????????????????????! >WebLogic Server??? 2009?????2010???? ???? ??????????????????????????????????? ????????????????????????^^ >[2009?12??]- 2009???? - WebLogic Server???????????! ???????????????????????????????????????????! ???~????????????????????? ???1????????????????????????????????????! >WebLogic -OTN???? ???????????- ???????(??): ?????????????WebLogic Server????????????? ????????????????????~Oracle WebLogic Server 11g~ Oracle WebLogic Server???????Web??????? -??? ???!!????????·???????!?~Oracle Weblogic Server ???~ >Middleware -OTN???? ???????????- ???????(??): Web?????????/????????????? - ??????????????????? - Oracle SOA Suite 11g ???? Oracle Coherence ???? Oracle Tuxedo ???? ??????????????Middleware??????????Twitter????????????????????????? oraclemiddle_jp ??????????! ???? ??????????????? ????????? ??????????OTN-Japan???????Oracle University????????????? WebLogic????? ------------------------------------------ Oracle WebLogic Server 10g System Administrator Certified Expert ?????????????????Web??????????????????WebLogic Server??????????????????????????????????????? Oracle WebLogic Server 10g Developer Certified Expert Servlet/JSP?EJB???J2EE????????Web???????????(IDE)????????????????????????MVC??????????????????????????????????Web?????????????????????????????????? >???????? ------------------------------------------ Oracle Application Server????? ------------------------------------------ ORACLE MASTER Application Server???????????????????????????????Oracle Application Servers??????????????????? ORACLE MASTER Silver Oracle Application Server 10g(OCA) ORACLE MASTER Gold Oracle Application Server 10g(OCP) >???????? ------------------------------------------ ?????? >ORACLE MASTER Oracle Middleware???? ?????????????????????????????????? ??????????????????????? ?????????????????????????????????????????????????????????????????3????????·???·????????????????????! ????????????????????????^^ >[2010?3??]????·???·??????????&????2010????! ???????????????????????????????????????????????? ??????????!????????????????????????????????????? ???OTN-Japan??????????????????????Twitter????????????????????????????! OTN Japan Twitter????????? ?????????????????????Fusion Middleware??????????? ?3??????????? ??????????????????????! Fusion Middleware???????????! ?INFORMATION INDEPTH NEWSLETTERS Fusion Middleware Edition???????! ??1?OTN???????Fusion Middleware???????????????? ???????????????????????????????????????????????? ???????????????????????!! ?????????? Oracle/OTN????????????????????????????????????????????????? ????????????????????????????????????? INFORMATION INDEPTH NEWSLETTERS Fusion Middleware Edition??????????????????????? >???????????????????????? ??????????????????????Oracle's Dev2DBA Newsletter?????????????^^ >?Oracle's Dev2DBA Newsletter?????????????????????????????????

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >