Search Results

Search found 5671 results on 227 pages for 'sub tuts'.

Page 17/227 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Implementing sub fields in a PropertyGrid

    - by evolve
    Alright so my terminology when it comes to C# isn't great, so I'll attempt to explain this with a small example. If you create a class which you are using within a PropertyGrid and you have the following values: class Test { public Point example { get; set; } } This will produce a PropertyGrid which has an expandable object "example" which has fields X and Y in order to create a "Point". I'm attempting to create an object "name" which has fields "firstname" and "lastname", so I have: class Test { public Name example { get; set; } } public struct Name { public string firstname { get; set; } public string lastname { get; set; } } This however isn't working as intended. I think I need to override some method(s) in order to get this working, however since I don't really have the terminology down for PropertyGrids it is difficult for me to find a solution. Any help would be great.

    Read the article

  • GDI+ Rotated sub-image

    - by Andrew Robinson
    I have a rather large (30MB) image that I would like to take a small "slice" out of. The slice needs to represent a rotated portion of the original image. The following works but the corners are empty and it appears that I am taking a rectangular area of the original image, then rotating that and drawing it on an unrotated surface resulting in the missing corners. What I want is a rotated selection on the original image that is then drawn on an unrotated surface. I know I can first rotate the original image to accomplish this but this seems inefficient given its size. Any suggestions? Thanks, public Image SubImage(Image image, int x, int y, int width, int height, float angle) { var bitmap = new Bitmap(width, height); using (Graphics graphics = Graphics.FromImage(bitmap)) { graphics.TranslateTransform(bitmap.Width / 2.0f, bitmap.Height / 2.0f); graphics.RotateTransform(angle); graphics.TranslateTransform(-bitmap.Width / 2.0f, -bitmap.Height / 2.0f); graphics.DrawImage(image, new Rectangle(0, 0, width, height), x, y, width, height, GraphicsUnit.Pixel); } return bitmap; }

    Read the article

  • Using twig variable to dynamically call an imported macro sub-function

    - by Chausser
    I am attempting if use a variable to call a specific macro name. I have a macros file that is being imported {% import 'form-elements.html.twig' as forms %} Now in that file there are all the form element macros: text, textarea, select, radio etc. I have an array variable that gets passed in that has an elements in it: $elements = array( array( 'type'=>'text, 'value'=>'some value', 'atts'=>null, ), array( 'type'=>'text, 'value'=>'some other value', 'atts'=>null, ), ); {{ elements }} what im trying to do is generate those elements from the macros. they work just fine when called by name: {{ forms.text(element.0.name,element.0.value,element.0.atts) }} However what i want to do is something like this: {% for element in elements %} {{ forms[element.type](element.name,element.value,element.atts) }} {% endfor %} I have tried the following all resulting in the same error: {{ forms["'"..element.type.."'"](element.name,element.value,element.atts) }} {{ forms.(element.type)(element.name,element.value,element.atts) }} {{ forms.{element.type}(element.name,element.value,element.atts) }} This unfortunately throws the following error: Fatal error: Uncaught exception 'LogicException' with message 'Attribute "value" does not exist for Node "Twig_Node_Expression_GetAttr".' in Twig\Environment.php on line 541 Any help or advice on a solution or a better schema to use would be very helpful.

    Read the article

  • Confused about GNU `sort(1)` of a numerical sub field

    - by Chen Levy
    I wish to sort a space separated table, with the numerical value that found on the 2nd field. I can assume that the 2nd field is always fooN but the length of N is unknown: antiq. foo11 girls colleaguing foo2 Leinsdorf Cousy foo0 Montgomeryville bowlegged foo1 pollack Chevrier foo10 ill-conceived candlebomb foo3 seventieths autochthony foo101 re-enable beneficiate foo100 osteometric I read man sort(1) and played with all sort of options. On my system I found the line: sort -n -k2.5 table to work. My question is why? According to the man page: -k, --key=POS1[,POS2] start a key at POS1, end it at POS 2 (origin 1) ... POS is F[.C][OPTS], where F is the field number and C the characterposition in the field. OPTS is one or more single-letter ordering options, which override global ordering options for that key. If no key is given, use the entire line as the key. So why sort -n -k2.4 table don't work and sort -n -k.5 does?

    Read the article

  • Turning off ASP.Net WebForms authentication for one sub-directory

    - by Keith
    I have a large enterprise application containing both WebForms and MVC pages. It has existing authentication and authorisation settings that I don't want to change. The WebForms authentication is configured in the web.config: <authentication mode="Forms"> <forms blah... blah... blah /> </authentication> <authorization> <deny users="?" /> </authorization> Fairly standard so far. I have a REST service that is part of this big application and I want to use HTTP authentication instead for this one service. So, when a user attempts to get JSON data from the REST service it returns an HTTP 401 status and a WWW-Authenticate header. If they respond with a correctly formed HTTP Authorization response it lets them in. The problem is that WebForms overrides this at a low level - if you return 401 (Unauthorised) it overrides that with a 302 (redirection to login page). That's fine in the browser but useless for a REST service. I want to turn off the authentication setting in the web.config: <location path="rest"> <system.web> <authentication mode="None" /> <authorization><allow users="?" /></authorization> </system.web> </location> The authorisation bit works fine, but when I try to change the authentication I get an exception: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. I'm configuring this at application level though - it's in the root web.config How do I override the authentication so that all of the rest of the site uses WebForms authentication and this one directory uses none? This is similar to another question: 401 response code for json requests with ASP.NET MVC, but I'm not looking for the same solution - I don't want to just remove the WebForms authentication and add new custom code globally, there's far to much risk and work involved. I want to change just the one directory in configuration.

    Read the article

  • rename folder into sub-folder with PHP

    - by Workoholic
    Hi. I'm trying to move a folder by renaming it. Both the test1 and test2 folders already exist. rename( "test1", "test2/xxx1/xxx2" ); The error I get is: rename(...): No such file or directory I assume this is because the directory "xxx1" does not exist. How can I move the test1 directory anyway?

    Read the article

  • Using a nested group by statement or sub query to filter this result sets

    - by vivid-colours
    This question is a continuation of Changing this query to group rows and filter out all rows apart from the one with smallest value but with an extra bit at the end.... I have the following results set: 275 72.87368055555555555555555555555555555556 foo 70 275 72.87390046296296296296296296296296296296 foo 90 113 77.06431712962962962962962962962962962963 foo 80 113 77.07185185185185185185185185185185185185 foo 60 that I got from this query: SELECT id, (tbl2.date_modified - tbl1.date_submitted)/86400, some_value FROM tbl1, tbl2, tbl3 WHERE tbl1.id = tbl2.fid AND tbl1.id = tbl3.fid Notice there are 4 rows with 2 ids. I wanted to filter the rows to get only the minimum number in the second column. This fixed it: SELECT id, min((tbl2.date_modified - tbl1.date_submitted)/86400), max(some_value) FROM tbl1, tbl2, tbl3 WHERE tbl1.id = tbl2.fid AND tbl1.id = tbl3.fid GROUP BY tbl1.id so I got: 275 72.87368055555555555555555555555555555556 foo 70 113 77.06431712962962962962962962962962962963 foo 80 How can I change it to do the same but not include rows where the are other rows with some_value=90 ? I.e. 113 77.06431712962962962962962962962962962963 foo 80 I think I need some nested group or nested query ?! Many thanks :).

    Read the article

  • Assembly Load and loading the "sub-modules" dependencies - "cannot fild the file specified"

    - by Ted
    There are several questions out there that ask the same question. However the answers they received I cannot understand, so here goes: Similar questions: http://stackoverflow.com/questions/1874277/dynamically-load-assembly-and-manually-force-path-to-get-referenced-assemblies ; http://stackoverflow.com/questions/22012/loading-assemblies-and-its-dependencies-closed The question in short: I need to figure out how dependencies, ie References in my modules can be loaded dynamically. Right now I am getting "The system cannot find the file specified" on Assemblies referenced in my so called modules. I cannot really get how to use the AssemblyResolve event... The longer version I have one application, MODULECONTROLLER, that loads separate modules. These "separate modules" are located in well-known subdirectories, like appBinDir\Modules\Module1 appBinDir\Modules\Module2 Each directory contains all the DLLs that exists in the bin-directory of those projects after a build. So the MODULECONTROLLER loads all the DLLs contained in those folders using this code: byte[] bytes = File.ReadAllBytes(dllFileFullPath); Assembly assembly = null; assembly = Assembly.Load(bytes); I am, as you can see, loading the byte[]-array (so I dont lock the DLL-files). Now, in for example MODULE1, I have a static reference called MyGreatXmlProtocol. The MyGreatXmlProtocol.dll then also exists in the directory appBinDir\Modules\Module1 and is loaded using the above code When code in the MODULE1 tries to use this MyGreatXmlProtocol, I get: Could not load file or assembly 'MyGreatXmlProtocol, Version=1.0.3797.26527, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. So, in a post (like this one) they say that To my understanding reflection will load the main assembly and then search the GAC for the referenced assemblies, if it cannot find it there, you can then incorparate an assemblyResolve event: First; is it really needed to use the AssemblyResolve-event to make this work? Shouldnt my different MODULEs themself load their DLLs, as they are statically referenced? Second; if AssemblyResolve is the way to go - how do I use it? I have attached a handler to the Event but I never get anything on MyGreatXmlProctol... === EDIT === CODE regarding the AssemblyResolve-event handler: public GUI() { InitializeComponent(); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); ... } // Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { Console.WriteLine(args.Name); return null; } Hope I wasnt too fuzzy =) Thx

    Read the article

  • MySQL sub query

    - by Juddling
    UPDATE members SET money=money+100 WHERE username IN (SELECT username FROM forum); Lets say I wanted to give each of my members 100 money for each post in my forum. This query works but if one member has posted more than once, they only get 100. Could someone correct this query please?

    Read the article

  • Designing a recipe database that needs to include ingredients as well as sub-recipes

    - by VinceL
    I am designing a recipe database that needs to be very flexible as it is going to be communicating directly with our back-of-house inventory system. This is what I have so far in regards to the tables: Recipe: this table will contain the recipe date: the name, steps needed to cook, etc. Ingredients/Inventory: this is our back of house inventory, so this will have the information about each product that will be used in our recipes. Recipe Line Item: This is the tricky table, I want to be able link to the ingredients here as well as the quantity needed for the recipe, but I also need to be able to directly include recipes from the recipe table (such as marinara sauce that we make in-house), and that is why I am having trouble figuring out the best way to design this table. Basically, the recipe line item table needs to be able to link to either the ingredients table or the recipe table depending on which line item is needed and I want to know what would be the most effective way to handle that. Thank you so much in advance!

    Read the article

  • WordPress sub domain htacess problem

    - by user260165
    Well i did a wordpress installation with the newer version now avaialble at dere website.. i did my installation at a subdomain : foo.abc.com the problem came with the permalink which do not work dere bec of the htaccess file. Can any one suggest me how to do that, i need to have only the category/postname Till now i am able to do foo.abc.com/index.php/category/postname - i dont want index.php in it. I have used this htacess file : disable the rewrite engine RewriteEngine on BEGIN WordPress RewriteEngine On RewriteBase /blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] RewriteRule ^post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA] END WordPress Please correct me if possible. thanks

    Read the article

  • issue when outputting an http:// address in a sub-array with json and php

    - by Patrick
    Im trying to achieve an output like this {"status":"ok","0":{"id":"11","title":"digg","url":"http://www.digg.com"}} but instead i am getting this {"status":"ok","0":{"id":"11","title":"digg","url":"http:\/\/www.digg.com"}} this is the php code im using to generate the json $links = array('id'=>'11','title'=>'digg','url'=>"http://www.digg.com"); $msg = array('status'=>'ok',$links); echo json_encode($msg); any idea what is causing this?

    Read the article

  • Moving and renaming files, keeping extension but include sub directories in batch file

    - by Ser1esII
    Forgive me if this is nor the place to ask these questions, I am new to batch and scripts and a bit new to these kind of posts... I have a folder that will receive files and folders, I want to run a script that looks at the directory and renames all files in each subfolder numerically, and moves them if possible. For example I have something that looks like the following Recieved_File_Folder |_folder1 | |_file1.txt | |_file2.bmp |_folder2 | |_file4.exe | |_file5.bmp |__file9.txt |__file10.jpg I would like to be able to look in every directory and move it to something like this, keeping in mind the names of the files will be random and I want to keep the extension intact also. Renamed_Folder |_folder1 | |_1.txt | |_2.bmp |_folder2 | |_1.exe | |_2.bmp |__1.txt |__2.jpg I have spent alot of time on this and am not doing too well with it, any help would be very greatly appreciated!! Thank you in advance!

    Read the article

  • Select most recent record in sub child

    - by Omar
    I have the following tables/columns: Parent: ParentID Child: ChildID ParentID SubChild: SubChildID ChildID Date Parent has 1 to Many relationship with Child Child has 1 to Many relationship with SubChild For every Parent, I need to get the SubChild with the most recent Date value. How can I do this using SQL. I've tried using MAX(Date), but I can't seem to figure out how to join Parent and Child successfully. The ideal result set would contain all the Parents joined with all the SubChild columns of the latest record. Note: using MS SQL 2005+

    Read the article

  • How to reorder table rows (drag-and-drop) along with their sub rows

    - by Eirik Johansen
    I have a table which looks like this (simplified for the example): <table> <tr class="lvl_1"> <td> Level 1 </td> </tr> <tr class="lvl_2"> <td> Level 2 </td> </tr> <tr class="lvl_3"> <td> Level 3 </td> </tr> <tr class="lvl_1"> <td> Level 1 </td> </tr> <tr class="lvl_2"> <td> Level 2 </td> </tr> <tr class="lvl_3"> <td> Level 3 </td> </tr> The content in the rows with the lvl_3 class are children of the previous lvl_2 row, and the lvl_2 rows are children of the previous lvl_1. Had the data been a list, it would have looked something like this: Level 1 -- Level 2 ---- Level 3 Level 1 -- Level 2 ---- Level 3 I'm not looking to implement drag-and-drop sorting functionality, make it possible to rearrange the level 1 and two rows. The tricky part is that once I start moving a row, the corresponding children (and grand-children, if any) should move along with it. Is this even possible with the current markup, or do I have to rearrange the code? Thanks in advance !

    Read the article

  • I need to simplify a MySQL sub query for performance - please help

    - by Richard
    I have the following query which is takin 3 seconds on a table of 1500 rows, does someone know how to simplify it? SELECT dealers.name, dealers.companyName, dealer_accounts.balance FROM dealers INNER JOIN dealer_accounts ON dealers.id = dealer_accounts.dealer_id WHERE dealer_accounts.id = ( SELECT id FROM dealer_accounts WHERE dealer_accounts.dealer_id = dealers.id AND dealer_accounts.date < '2010-03-30' ORDER BY dealer_accounts.date DESC, dealer_accounts.id DESC LIMIT 1 ) ORDER BY dealers.name I need the latest dealer_accounts record for each dealer by a certain date with the join on the dealer_id field on the dealer_accounts table. This really should be simple, I don't know why I am struggling to find something.

    Read the article

  • Retrieving data from a JSON sub array in javascript, where identifier starts with an integer

    - by Archie Ec
    I must be missing something simple here, but I'm having trouble retrieving data from a JSON array response. I can access objects with identifiers that start with letters, but not ones that start with numbers. For example, I can access data.item[0].specs.overview.details But I can't access data.item[0].specs.9a99.details If anyone can point me in the right direction, I'd really appreciate it. Thanks.

    Read the article

  • Sub-viewController doesn't get autorotation notifications, bug?

    - by Shizam
    If I have a view (and its controller) and I override the willAnimateRotationToInterfaceOrientation method so I can respond to autorotation events everything works fine and dandy. Now if I create another viewController and add its view to the first viewController's view via: [firstViewController.view addSubview:secondViewController.view] The secondViewController's willAnimateRotationToInterfaceOrientation method isn't called. What gives? Thanks, Sam

    Read the article

  • Mysql on duplicate key update + sub query

    - by jwzk
    Using the answer from this question: http://stackoverflow.com/questions/662877/need-mysql-insert-select-query-for-tables-with-millions-of-records new_table * date * record_id (pk) * data_field INSERT INTO new_table (date,record_id,data_field) SELECT date, record_id, data_field FROM old_table ON DUPLICATE KEY UPDATE date=old_table.data, data_field=old_table.data_field; I need this to work with a group by and join.. so to edit: INSERT INTO new_table (date,record_id,data_field,value) SELECT date, record_id, data_field, SUM(other_table.value) as value FROM old_table JOIN other_table USING(record_id) ON DUPLICATE KEY UPDATE date=old_table.data, data_field=old_table.data_field, value = value; I can't seem to get the value updated. If I specify old_table.value I get a not defined in field list error.

    Read the article

  • OQL - Find certain (sub)-members of a given object

    - by Pentius
    I'm analyzing heap dumps in a Portal App. With the help of OQL I found the MemorySessionData Object with its address. Now I want to find all SerializableViewState Objects, that are hold by Objects hold by this MemorySessionData object. In other words: My MemorySessionData Object holds several objects, these hold objects again and so on... I want to find all SerializableViewState Objects in this tree. How would the OQL look like? :-/

    Read the article

  • Iphone remove sub view

    - by Sharanya
    I have a UINavigationController. On the right top i have a button on click of which i have to get a drop down table view. I created another UIViewController Class, with xib and added it as a subView to the current view. It should appear on 1st click and disappear on the 2nd click. This should happen for all click(open view and close view). I wrote this code but dont know where i'm going wrong. someone please help -(void)modalTableView { tableView1 = [[TableViewController alloc] initWithNibName:@"TableViewController" bundle:nil]; for (UIView *subView in self.view.subviews) { if ([subView isKindOfClass:[TableViewController class]]) { [subView removeFromSuperview]; } else { [self.view addSubview:tableView1.view]; } } } What am i missing here? EDIT : TableViewController is the name of my UIViewController Class

    Read the article

  • Match Anything Except a Sub-pattern

    - by Tim Lytle
    I'd like to accomplish what this (invalid I believe) regular expression tries to do: <p><a>([^(<\/a>)]+?)<\/a></p>uniquestring Essentially match anything except a closing anchor tag. Simple non-greedy doesn't help here because `uniquestring' may very well be after another distant closing anchor tag: <p><a>text I don't <tag>want</tag> to match</a></p>random data<p><a>text I do <tag>want to</tag> match</a></p>uniquestring more matches <p><a>of <tag>text I do</tag> want to match</a></p>uniquestring So I have more tag in between the anchor tags. And I'm using the presence of uniquestring to determine if I want to match the data. So a simple non-greedy ends up matching everything from the start of the data I don't want to the end of the data I do want. I know I'm edging close to the problems regular expressions (or at least my knowledge of them) aren't good at solving. I could just through the data at an HTML/XML parser, but it is just one simple(ish) search. Is there some easy way to do this that I'm just missing?

    Read the article

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