Search Results

Search found 7501 results on 301 pages for 'charms bar'.

Page 83/301 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • Select n+1 problem

    - by Arnis L.
    Foo has Title. Bar references Foo. I have a collection with Bars. I need a collection with Foo.Title. If i have 10 bars in collection, i'll call db 10 times. bars.Select(x=x.Foo.Title) At the moment this (using NHibernate Linq and i don't want to drop it) retrieves Bar collection. var q = from b in Session.Linq<Bar>() where ... select b; I read what Ayende says about this. Another related question. A bit of documentation. And another related blog post. Maybe this can help? What about this? Maybe MultiQuery is what i need? :/ But i still can't 'compile' this in proper solution. How to avoid select n+1?

    Read the article

  • Change list link to foreign key change page

    - by Adam
    When viewing the admin change list for a model, is it possible to make the columns that correspond to foreign keys links to their respective pages? A simple example is I have a Foo object which contains Bar as a foreign key. If I'm viewing the admin change list for Foo (and have it set to include Bar in the display_list columns), the main column would link to the Foo instance's edit page while the Bar column would link to the Boo instance's edit page. I understand I can override the template that's used, but I was curious if there was a solution that didn't require that.

    Read the article

  • add component in bottom of android screen.

    - by milind
    hello all. i m new in android developing. i want to create custom tab bar in android like Iphone tab bar. i have found so much example to done this. but i would like to use only one XML file for tab bar and after include these to screens. i think it is possible with the help of layout but i don't have much idea. if there are only one property of layout there implement component at the bottom. if anybody done this please provide some idea. Thanks

    Read the article

  • Perl array and hash manipulation using map

    - by somebody
    I have the following test code use Data::Dumper; my $hash = { foo => 'bar', os => 'linux' }; my @keys = qw (foo os); my $extra = 'test'; my @final_array = (map {$hash->{$_}} @keys,$extra); print Dumper \@final_array; The output is $VAR1 = [ 'bar', 'linux', undef ]; Shouldn't the elements be "bar, linux, test"? Why is the last element undefined and how do I insert an element into @final_array? I know I can use the push function but is there a way to insert it on the same line as using the map command? Basically the manipulated array is meant to be used in an SQL command in the actual script and I want to avoid using extra variables before that and instead do something like: $sql->execute(map {$hash->{$_}} @keys,$extra);

    Read the article

  • PHP: Accessing an object property with a variable.

    - by Peter
    Let's assume I have an array of object properties I'd like to access: $properties = array('foo', 'bar'); I'd like to loop through the object and access these properties dynamically (specifically, I'm trying to dynamically handle missing JSON elements based on an array of expected elements): foreach ($data as $item) { foreach ($properties as $property) { if (empty($item->{$property})) { // Do something } } } Each $item in $data should have the properties 'foo' and 'bar'. If empty(), I'll handle them. I'm trying to get the loop (in line 3) to access $item-{'foo'} and $item-{'bar'}, but it's not working. Any idea why? Thanks!

    Read the article

  • Suggest encoding which removes slashes which I can use as the format for REST-style URL-paramteters

    - by Binary255
    Given a path to a REST style URL: http://site.com/rest/customer/foo/robot/bar/1 When you GET it, it returns a PDF to the foo-customer containing page 1 of the bar-URL. While foo is the name of the customer bar is an URL. The URL usually contains slashes and might look something like this: http://anothersite.com/interestingarticle.html As REST URL's separate arguments by slashes I can't just put it into the REST URL above. Which encoding should I use? I can't use Base 64 as it utilizes the slash as well. As a technical note I will encode the URL in a .NET-application and decode it in PHP.

    Read the article

  • WPF Custom Navigation Buttons and calling one page from another

    - by Jeff
    I have a window which contains a Frame which references a 'home' page that has buttons on it. When a button is clicked I want another page to show depending on which button was pressed. I attempted to use NavigationService.Navigate('mynextpage.xaml') and that works however, I want to use a customized navigation panel. I call this.ShowsNavigationUI = false; on my 'home' page but the bar still shows. Is there a way to accomplish what I am trying to do? My page with the frame is a window so I do not know how to disable the Navigation bar there where I guess it is coming from. Further testing shows that the ShowsNavigationUI property is false yet the nav bar shows itself in the parent window once there is a second page to go to (showing the 'home' page in the history. TIA

    Read the article

  • Iphone UI Size / Layout Resource?

    - by blindJesse
    Is anyone aware of a website or download to reference for the size of UI elements or standard iphone interface stuff? What I mean is something that gives the height of elements like the status bar, tab bar, navigation bar, default tableviewcell height (and such things as width of accessory view, indentation, etc), default icon sizes, default font sizes for UI elements (if they need to be mimicked, for instance), etc etc etc. It's amazing how many times I have to go back to find a reference or estimate the size and position of a standard element. It seems like it would be an invaluable resource that could fit on a printed page or two.

    Read the article

  • Replace strings differently depending if is enclosed in braces or not.

    - by peroyomas
    I want to replace all instances of an specific words between braces with something else, unless it is written between double braces, while it should show as is it was written with single braces without the filter. I have tried a code but only works for the first match. The rest are shown depending of the first one: $foo = 'a {bar} b {{bar}} c {bar} d'; $baz = 'Chile'; preg_match_all( '/(\{?)\{(tin)\}(\}?)/i', $foo, $matches, PREG_SET_ORDER ); if ( !empty($matches) ) { foreach ( (array) $matches as $match ) { if( empty($match[1]) && empty($match[3])) { $tull = str_replace( $match[0], $baz, $foo ); } else { $tull = str_replace( $match[0], substr($match[0], 1, -1), $foo ) ; } } } echo $tull;

    Read the article

  • New to threading in C#, can you make thread methods generic and what are the dangers?

    - by ibarczewski
    Hey all, I'm just now starting to get into the idea of threading, and wanted to know if I could make this more abstract. Both foo and bar derive methods from a base class, so I'd like to pass in one or the other and be able to do work using a method that was derived. I'd also like to know how you properly name threads and the methods inside threads. if (ChkFoo.Checked) { Thread fooThread = new Thread(new ThreadStart(this.ThreadedFooMethod)); fooThread.Start(); } if (ChkBar.Checked) { Thread barThread = new Thread(new ThreadStart(this.ThreadedBarMethod)); barThread.Start(); } . . . public void ThreadedFooMethod() { Foo newFoo = new Foo(); //Do work on newFoo } public void ThreadedBarMethod() { Bar newBar = new Bar(); //Do similar work } Thanks all!

    Read the article

  • How to get tag parameter value with XQuery

    - by uni
    For example i have this xml. I need to get value of parameter val of tag foo with id="two" <top> <sub id="one"> <foo id="two" val="bar" /> sometext </sub> </top> Whis this query (using Qt QXmlQuery): doc('test.xml')/top/sub[@id='one']/foo[@id='two']/<p>{@val}</p> I receive <p val="bar"/>, but I need only text "bar" without any tags. I tried to remove <p> and </p> and receive syntax error, unexpected { How can i get parameter value without any tags?

    Read the article

  • In PHP how do i update values in an asssociative array and store the entire array?

    - by amnesia-55
    Here's a code example: $array = array(); $array['master']['slave'] = "foo"; foreach ($array as $key => $value) { foreach ($value as $key2 => $value2) { if (preg_match('/slave/',$key2)) { $value[$key2] = "bar"; print "$value[$key2] => $key2 => $value2\n"; } } } print_r($array); Output: bar => slave => foo Array ( [master] => Array ( [slave] => foo ) ) Rather i would like to have the following as the final array: Array ( [master] => Array ( [slave] => bar ) ) What wrong am i doing here? Thank you!

    Read the article

  • Dynamic reference to resource files in C#

    - by Joda
    I have an application on which I am implementing localization. I now need to dynamically reference a name in the resouce file. assume I have a resource file called Login.resx, an a number of strings: foo="hello", bar="cruel" and baz="world" normally, I will refer as: String result =Login.foo; and result=="hello"; my problem is, that at code time, I do not know if I want to refer to foo, bar or baz - I have a string that contains either "foo", "bar" or "baz". I need something like: Login["foo"]; Does anyone know if there is any way to dynamically reference a string in a resource file?

    Read the article

  • C++ Template Question

    - by user323422
    see following code and please clear doubts1. as ABC is template why it not showing error when we put defination of ABC class member function in test.cpp 2.if i put test.cpp code in test.h , then it working fine // test.h template <typename T> class ABC { public: void foo( T& ); void bar( T& ); }; // test.cpp template <typename T> void ABC<T>::foo( T& ) {} // definition template <typename T> void ABC<T>::bar( T& ) {} // definition template void ABC<char>::foo( char & ); // 1 // main.cpp #include "test.h" int main() { ABC<char> a; a.foo(); // working a.bar(); // link error }

    Read the article

  • Change value of textarea when hovering link

    - by hellfyr
    I would like to change the value of a textarea when hovering over a link. I am not very proficient at javascript and do not quite understand the intricacies of 'this.' and 'document.' etc.. Currently I have a textarea 'info' that on page load is unpopulated and two links that should change its value. I can not seem to get it to work.. <textarea name="info"></textarea> <a href="foo.com" onmouseover="document.info.value='foo.com is a great site'">Foo.com</a> <a href="bar.com" onmouseover="document.info.value='bar.com is a terrible site'">Bar.com</a> I'm sure there is a way to accomplish what I need to do but I can't find it. Thanks in advance.

    Read the article

  • Best way to access nested data structures?

    - by Blackshark
    I would like to know what the best way (performance wise) to access a large data structure is. There are about hundred ways to do it but what is the most accessible for the compiler to optimize? One can access a value by foo[someindex].bar[indexlist[i].subelement[j]].baz[0] or create some pointer aliases like sometype_t* tmpfoo = &foo[someindex]; tmpfoo->bar[indexlist[i].subelement[j]].baz[0] or create reference aliases like sometype_t &tmpfoo = foo[someindex]; tmpfoo.bar[indexlist[i].subelement[j]].baz[0] and so forth...

    Read the article

  • Determine an object's class returned by a factory method (Error: function does not take 1 arguments

    - by tzippy
    I have a factorymethod that either returns an object of baseclass or one that is of derivedclass (a derived class of baseclass). The derived class has a method virtual void foo(int x) that takes one argument. baseclass however has virtual void foo() without an argument. In my code, a factory method returns a pointer of type bar that definetly points to an object of class derivedclass. However since this is only known at runtime I get a compiler error saying that foo() does not take an argument. Can I cast this pointer to a pointer of type derivedclass? std::auto_ptr<baseclass> bar = classfactory::CreateBar(); //returns object of class derivedclass bar->foo(5); class baseclass { public: virtual void foo(); } class derivedclass : public baseclass { public: virtual void foo(int x); }

    Read the article

  • Why does Generic class signature requires specifying new() if type T needs instantiation ?

    - by this. __curious_geek
    I'm writing a Generic class as following. public class Foo<T> : where T : Bar, new() { public void MethodInFoo() { T _t = new T(); } } As you can see the object(_t) of type T is instantiated at run-time. To support instantiation of generic type T, language forces me to put new() in the class signature. I'd agree to this if Bar is an abstract class but why does it need to be so if Bar standard non-abstract class with public parameter-less constructor. compiler prompts following message if new() is not found. Cannot create an instance of the variable type 'T' because it does not have the new() constraint

    Read the article

  • @Path and regular expression (Jersey/REST)

    - by Castanho
    Hi there! I'm using Jersey in a REST project and I'm needing to use regular expression. Digging about it is simple like: @Path("/resources) public class MyResource { @GET @Path("{subResources:.*}/bar") public String get() {...} } But, I'm only capable of using regex if in my @Path contains a variable or text value, example: @Path("{SubResource1}/{subResources:.*}/bar") Or @Path("hardCodeString/{subResources:.*}/bar") Today I could run with this solution of a variable, but is not oK for my perspective. Question Does anyone have worked with something related? I'm doing something wrong? I think that this could be a bug, when working with more then one @Path, one in the Class and other in the Method. Any tips is appreciated! Regards

    Read the article

  • How do I return an object that is able to execute on the server?

    - by mafutrct
    Coming from a Java background, this is the way I'm thinking: The server provides an object to the client. This object should be able to execute on the server. Server: private string _S = "A"; public interface IFoo { void Bar(); } private class Foo : IFoo { void Bar() { _S = "B";} } public IFoo GetFoo() { return new Foo(); } Client: IFoo foo = serverChannel.GetFoo(); foo.Bar(); Remoting is legacy (everyone keeps pointing to WCF instead) and WCF does not support this at all basically ( http://stackoverflow.com/questions/2431510 ), so how should I implement this kind of behavior? Using 3rd party components is possible iff required. I searched on SO but found no similar question. If this has indeed been answered before, just let me know and I'll delete.

    Read the article

  • Charts don't show up when subreport is included in group header in pentaho reporting 3.9.1-GA

    - by user2909808
    There is an issue concerning in sub-reports. I created a bar chart in report header. The sub report(inline) is placed in the Details of main report. In the sub report, the bar chart is placed in the group header. I imported the required parameters to the sub reports from the main report and also i have a sub query for the sub report.The expected output is to show an updated bar chart within each (inner) group of main report. However, the chart is only displayed in the last group occurence, although the chart area itself is allotted in every expected case. Can any one say me, what mistake i did.

    Read the article

  • Is an index required for columns in ON clause?

    - by newbie
    Do I have to create an index on columns referenced in Joins? E.g. SELECT * FROM left_table INNER JOIN right_table ON left_table.foo = right_table.bar WHERE ... Should I create indexes on left_table(foo), right_table(bar), or both? I noticed different results when I used EXPLAIN (Postgresql) with and without indexes and switching around the order of the comparison (right_table.bar = left_table.foo) I know for sure that indexes are used for the left of the WHERE clause but I am wondering whether I need indexes for columns listed in ON clauses.

    Read the article

  • Accessing an Internal Function in setInterval

    - by Phonethics
    (function($) { $.fn.myPlugin = function(options) { var _this; var timer1; var foo = function(n) { if (timer1 != null) return; // in action timer1 = setInterval("bar("+n+")", 500); }; var bar = function(n) { ... if ( ... ) clearInterval(timer1); }; return this.each(function() { _this = $(this); _this.bind("click", function(){ foo(10); }); }); } })(jQuery); This doesn't work because "bar is not defined."

    Read the article

  • WCF: Is there a way to return an object that is able to execute on the server?

    - by mafutrct
    Coming from a Java background, this is the way I'm thinking: The server provides an object to the client. This object should be able to execute on the server. Server: private string _S = "A"; public interface IFoo { void Bar(); } private class Foo : IFoo { void Bar() { _S = "B";} } public IFoo GetFoo() { return new Foo(); } Client: IFoo foo = serverChannel.GetFoo(); foo.Bar(); Is this possible? Or is my understanding wrong and this is not how it works in WCF? What would be a better design?

    Read the article

  • How to Easily Put a Windows PC into Kiosk Mode With Assigned Access

    - by Chris Hoffman
    Windows 8.1′s Assigned Access feature allows you to easily lock a Windows PC to a single application, such as a web browser. This feature makes it easy for anyone to configure Windows 8.1 devices as point-of-sale or other kiosk systems. In the past, setting up a Windows PC in kiosk mode involved much more work, requiring the use of third-party software, group policy, or Linux distributions designed around kiosk mode. Assigned Access is available on Windows 8.1 RT, Windows 8.1 Professional, and Windows 8.1 Enterprise. The standard edition of Windows 8.1 doesn’t support Assigned Access. Create a User Account for Assigned Access Rather than turn your entire computer into a locked-down kiosk system, Assigned Access allows you to create a separate user account that can only launch a single app — such as a web browser. To set this up, you must be logged into Windows as a user with administrator permissions. First, open the PC settings app — swipe in from the right or press Windows Key + C to open the charms bar, tap Settings, and tap Change PC settings. In the PC settings app, select Accounts and select Other accounts. Use the Add an account button to create a new Windows account. Select  the “Sign in without a Microsoft account” option and select Local account to create a local user account. You could also create a Microsoft account, but you may not want to do this if you just want a locked-down account with only browser access. If you need to install apps from the Windows Store to use in Assigned Access mode, you’ll have to set up a Microsoft account instead of a local account. A local account will still allow you access to the preinstalled apps, such as Internet Explorer. You may want to create a user account with a blank password. This would make it simple for anyone to access kiosk mode, even if the system becomes locked or needs to be rebooted. The account will be created as a standard user account with limited permissions. Leave it as a standard user account — don’t make it an administrator account. Set Up Assigned Access Once you’ve created an account, you’ll first need to sign into it. If you don’t, you’ll see a “This account has no apps” message when trying to enable Assigned Access. Go back to the welcome screen, log in to the new account you created, and allow Windows to go through the first-time account setup process. If you want to use a non-default app in kiosk mode, install it while logged in as that user account. Once you’re done, log out of the other account, log back in as your administrator account, and go back to the Other accounts screen. Click the Set up an account for assigned access option to continue. Select the user account you created and select the app you want to limit the account to. For a web-based kiosk, this can be a web browser such as the Modern version of Internet Explorer. Businesses can also create their own Modern apps and set them to run in kiosk mode in this way. Note that Microsoft’s documentation says “web browsers are not good choices for assigned access” because they require more permissions than average Modern (or “Windows Store”) apps. However, if you want to provide a kiosk for web-browsing, using Assigned Access is a much better option than using Guest Mode and offering up a full Windows desktop. When you’re done, restart your PC and log in as the Assigned Access account. Windows will automatically open the app you chose and won’t allow a user to leave that app. Standard Windows 8 features like the charms bar, app switcher, and Start screen won’t appear. Pressing the Windows key once will do nothing. To sign out of Assigned Access mode, press the Windows key five times — quickly — while signed in. You’ll be sent back to the standard login screen. The account will actually still be logged in and the app will remain running — this method just “locks” the screen and allows another user to log in. Automatically Log Into Assigned Access Whenever your Windows device boots, you can log into the Assigned Access account and turn it into a kiosk system. While this isn’t ideal for all kiosk systems, you may want the device to automatically launch the specific app when it boots without requiring any login process. To do so, you’ll just need to have Windows automatically log into the Assigned Access account when it boots. This option is hidden and not available in the standard Control Panel. You’ll need to use the hidden netplwiz Control Panel tool to set up automatic login on boot. If you didn’t create a password for the user account, leave the Password field empty while configuring this. Security Considerations If you’re using this feature to turn a Windows 8.1 system into a kiosk and leaving it open to the public, remember to consider security. Anyone could come up to the system, press the Windows key five times, and try to log into your standard administrator user account. Ensure the administrator user account has a strong password so people won’t be able to get past the kiosk system’s limitations and tamper with the system. Even Windows 8′s detractors have to admit that it’s an ideal system for a touch-screen kiosk device, running either a browser or another specific application. Assigned Access finally makes this easy to set up on Windows systems in the real world — no IT experience, third-party software, or Linux distributions necessary.     

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >