Search Results

Search found 4347 results on 174 pages for 'devils child'.

Page 130/174 | < Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >

  • 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

  • Can I attach a .NET TraceListener to an externally running process?

    - by BBlake
    I am developing an application scheduling program that will run other applications using System.Diagnostics.Process. The external applications are of various types (some .NET and some not). For those external apps that have trace logging enabled, is there a way that I can attach the tracelistener of the parent/calling application to listen to and record all the trace output from the child/called application to the parent application's trace output? This is not primarily for debugging purposes. This is more to track trace output from all the various scheduled applications by collecting it into one place as much as possible. The scheduler app is still in the early design stages, but will be .NET, and I'm trying to clear up potential design issues before I get into it too far.

    Read the article

  • How do I change my current directory from a python script?

    - by misterloogs
    I'm trying to implement my own version of the 'cd' command that presents the user with a list of hard-coded directories to choose from, and the user has to enter a number corresponding to an entry in the list. The program, named my_cd.py for now, should then effectively 'cd' the user to the chosen directory. Example of how this should work: /some/directory $ my_cd.py 1) ~ 2) /bin/ 3) /usr Enter menu selection, or q to quit: 2 /bin $ Currently, I'm trying to 'cd' using os.chdir('dir'). However, this doesn't work, probably because my_cd.py is kicked off in its own child process. I tried wrapping the call to my_cd.py in a sourced bash script named my_cd.sh: #! /bin/bash function my_cd() { /path/to/my_cd.py } /some/directory $ . my_cd.sh $ my_cd ... shows list of dirs, but doesn't 'cd' in the interactive shell Any ideas on how I can get this to work? Is it possible to change my interactive shell's current directory from a python script?

    Read the article

  • Can I set a style for the content of an iframe from the main page?

    - by Joel Coehoorn
    We have a page the embeds a Google Calendar in an iframe. Recently, a warning box div began appearing on the calendar that looks like this: <div id="warningBox" style="color:#aa0000;">Events from one or more calendars could not be shown here because you do not have the permission to view them.</div> Obviously the best solution here is to find the private events and remove them, but so far the search for those events has proved fruitless. This calendar is an aggregate of several calendars, including a few we don't control (ie weather). We're still looking, but in the meantime, I would like to try to hide that div. I know that iframes enforce the separation between the pages, such that the child page is pretty much a law unto itself. But surely there must be some way to set a style on an element inside the frame?

    Read the article

  • Is MDI Form focused?

    - by Vercas
    I've had so much luck developing my application... until now. My application's main form is a MDI parent, and I didn't think of adding any MDI children in my tests until tonight. To my surprise, the MDI parent seems to never "get focus" now. The Focus event and the OnFocus method are never called! I mean... it appears focused but none of the in-code focusing events/methods work. Instead a MDI child reports the focus. How do I fix this?

    Read the article

  • With XSLT, how can I use this if-test with an array, when search element is returned by a template call inside the for loop?

    - by codesforcoffee
    I think this simple example might ask the question a lot more clearly. I have an input file with multiple products. There are 10 types of product (2 product IDs is fine enough for this example), but the input will have 200 products, and I only want to output the info for the first product of each type. (Output info for the lowest priced one, so the first one will be the lowest price because I sort by Price first.) So I want to read in each product, but only output the product's info if I haven't already output a product with that same ID. I couldn't figure out how to get the processID template to return a value that I need to do my if-check on, that uses parameters from inside the for-each Product loop -then properly close the if tag in the right place so it won't output the open Product tag unless it passes the if test. I know the following code does not work, but it illustrates the idea and gives me a place to start: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" indent="yes" cdata-section-elements="prod_name adv_notes"/> <xsl:template match="/"> <List> <xsl:for-each select="ProductGroup"> <xsl:sort select="ActiveProducts/Product/Rate"/> <xsl:variable name="IDarray"> <xsl:for-each select="ActiveProducts/Product"> <xsl:variable name="CurrentID"> <xsl:call-template name="processID"> <xsl:with-param name="ProductCode" select="ProductCode" /> </xsl:call-template> </xsl:variable> <xsl:if test="not(contains($IDarray, $CurrentID))"> <child elem="{@elem}"> <xsl:select value-of="$CurrentID" /> </child> <Product> <xsl:attribute name="ID"> <xsl:select value-of="$CurrentID" /> </xsl:attribute> <prod_name> <xsl:value-of select="../ProductName"/> </prod_name> <rate> <xsl:value-of select="../Rate"/> </rate> </Product> </xsl:if> </xsl:for-each> </xsl:variable> </xsl:for-each> </List> </xsl:template> <xsl:template name="processID"> <xsl:param name="ProductCode"/> <xsl:choose> <xsl:when test="starts-with($ProductCode, '515')">5</xsl:when> <xsl:when test="starts-with($ProductCode, '205')">2</xsl:when> </xsl:choose> </xsl:template> Thanks so much in advance, I know some of the awesome programmers here can help! :) -Holly An input would look like this: <ProductGroup> <ActiveProducts> <Product> <ProductCode> 5155 </ProductCode> <ProductName> House </ProductName> <Rate> 3.99 </Rate> </Product> <Product> <ProductCode> 5158 </ProductCode> <ProductName> House </ProductName> <Rate> 4.99 </Rate> </Product> </ActiveProducts> </ProductGroup> <ProductGroup> <ActiveProducts> <Product> <ProductCode> 2058 </ProductCode> <ProductName> House </ProductName> <Rate> 2.99 </Rate> </Product> <Product> <ProductCode> 2055 </ProductCode> <ProductName> House </ProductName> <Rate> 7.99 </Rate> </Product> </ActiveProducts> </ProductGroup> 200 of those with different attributes. I have the translation working, just needed to add that array and if statement somehow. Output would be this for only that simple input file:

    Read the article

  • Explanation of output

    - by Anon
    My program class Building { Building() { System.out.print("b "); } Building(String name) { this(); System.out.print("bn " + name); } }; public class House extends Building { House() { System.out.print("h "); // this is line# 1 } House(String name) { this(); // This is line#2 System.out.print("hn " + name); } public static void main(String[] args) { new House("x "); } } We know that compiler will write a call to super() as the first line in the child class's constructor. Therefore should not the output be: b (call from compiler written call to super(), before line#2 b (again from compiler written call to super(),before line#1 ) h hn x But the output is b h hn x Why is that?

    Read the article

  • A general declaration for all inherited classes

    - by Soham
    Consider, there is a class called SuperClass from which, ClassA, ClassB, ClassC is derived. From each one of those derived Classes, there are further more two classes are derived each called ChildClassAA and ChildClassAB[AB stands for Bth Child class from the Ath Class.Lets not really pull our hair on this nomenclature]. Now, ideally, I want to declare a general type as a private member of another Class say IndependentClass which can be initialized during run time as either of the objects of type ClassAor ClassB or ClassC and even the derived classes like ClassAA or ClassAB. Is there a possible way to do it?

    Read the article

  • What can you do in the ant Task.init() method?

    - by skiphoppy
    I'm developing a few custom ant tasks that all need to initialize the same objects. I wanted to initialize those object's in a common superclass that extends from Task, in the init() method. But I see from the lifecycle of an ant task that init() gets called before the tasks child elements and attributes are set. So all of the data I need for initializing those objects is unavailable during init(), if I am reading right. So, why is init() called at this point? What do you even know that you could use in init()? What could it be used for? (And is there some other method that I can rely on to be called before execute(), but after my data is available?)

    Read the article

  • C++, create an instance from a static method

    - by Manux
    Hello, let's say I want my users to use only one class, say SpecialData. Now, this data class would have many methods, and depending on the type of data, the methods do different things, internally, but return externally similar results. Therefore my wanting to have one "public" class and other "private", child classes that would change the behavior of methods, etc... It would be amazingly more simple for some types of data that need to be built to do something like this: SpecialData& sm = SpecialData::new_supermatrix(); and new_supermatrix() would return a SuperMatrix instance, which inherits from most behaviors of SpecialData. my header: static SpecialData& new_supermatrix(); my cpp: SpecialData& SpecialData::new_supermatrix()(){ return SuperMatrix(MATRIX_DEFAULT_MAGNITUDE,1000,1239,FLOAT32,etc...); } The problem is, I get this error, which is probably logical due to the circumstances: invalid initialization of non-const reference of type ‘SpecialData&’ from a temporary of type ‘SpecialData’ So, any ideas?

    Read the article

  • jQuery script to move an attribute of matched element to their children

    - by UserControl
    I have a set of anchors like <a class="lb" href="#">text</a> <a class="lb" href="#" style="width:200px">text</a> <a class="lb" href="#" style="color: reen; width:200px">text</a> that needs to be transformed to the following: <a class="lb" href="#"><span>text</span></a> <a class="lb" href="#"><span style="width:200px">text</span></a> <a class="lb" href="#" style="color:green"><span style="width:200px">text</span></a> I have no problem creating child span but don't know how to move parent's width styling.

    Read the article

  • insert data into several tables

    - by csetzkorn
    Let us say I have a table (everything is very much simplified): create table OriginalData ( bla char(10) not null ) And I would like to insert its data (set based!) into two tables which model inheritance create table Statements ( Id int IDENTITY NOT NULL, ProposalDateTime DATETIME null ) create table Items ( StatementFk INT not null, ItemName NVARCHAR(255) null, primary key (StatementFk) ) Statements is the parent table and Items is the child table. I have no problem doing this with one row which involves the use of IDENT_CURRENT but I have no idea how to do this set based (i.e. enter several rows into both tables). Thanks. Best wishes, Christian

    Read the article

  • Class in TR without one TD

    - by Roy Grendester
    <table> <tr class="here"><td><input type="text" readonly=readonly></td></tr> <tr class="here"><td><input type="text" readonly=readonly></td></tr> <tr class="here"><td><input type="text" ></td></tr> </table> td { padding: 15px; margin: 10px; } .here { background-color: red; } http://jsfiddle.net/dZYEM/ How can i modify class .here that this working where child input has attribute readonly? I dont want modify html. EDIT: now i have: jsfiddle.net/dZYEM/2/ i would like receive: http://jsfiddle.net/dZYEM/3/ but without use style. I want receive this only with css.

    Read the article

  • wxPython - wx.ChildFrame

    - by Dunwitch
    I'm sure this is simple, but I can't seem to find the answer. While using wx.MDIParentFrame, I open a new window with wx.MDIChildFrame. There is static text on the ParentFrame, and once the ChildFrame opens the text gets erased from the ParentFrame? import wx class Frame(wx.MDIParentFrame): def __init__(self): wx.MDIParentFrame.__init__(self, None, -1, "Main Window", size=(800,600), style=wx.DEFAULT_FRAME_STYLE | wx.FRAME_NO_WINDOW_MENU) menu = wx.Menu() menu.Append(100, "&New Window") menu.Append(101, "E&xit") menubar = wx.MenuBar() menubar.Append(menu, "&File") self.SetMenuBar(menubar) self.Bind(wx.EVT_MENU, self.OnNewWindow, id=100) self.Bind(wx.EVT_MENU, self.OnExit, id=101) self.Center() background_text = wx.StaticText(self, id=-1, label="This is background text", pos = (20, 250)) def OnExit(self, evt): self.Close(True) self.Destroy() def OnNewWindow(self, evt): win = wx.MDIChildFrame(self, -1, "Child Window", size = (300, 300), style=wx.DEFAULT_FRAME_STYLE ^ (wx.MAXIMIZE_BOX | wx.RESIZE_BORDER)) win.SetBackgroundColour("#BB00e0") win.Show(True) if __name__ == '__main__': app = wx.PySimpleApp() frame = Frame() frame.Show() app.MainLoop()

    Read the article

  • iPhone , core data, whether NSManagedObject use lazy load mechanism when it was create ?

    - by Robin
    Hi, all, I have use core data in app, I have definite a class that most like as follows: @interface Master : NSManagedObject { } @property (nonatomic, retain) NSSet* Details; .... the entity Master contains a property 'Details' that is relate to another table, this is typical Master-Details relationship, I trace the app , but I find a issue that the property 'Details' value was construct even it never be invoked ..... but I consider that the core data 'should' use some lazy mechanism to improve performance, or maybe I miss some configure step ? because the Master entity contains at least five 'Child' table properties , I have to consider this problem before use the core data .... any help ? thanks for your time!

    Read the article

  • is there a way to add a variable/property to a DOM element (eg, an element returned by a jQuery sele

    - by bt
    Hi there, I am looking for an alternative to using an object/variable in global scope -- I would like to associate key/value pairs with specific DOM elements (eg, a DIV), so that I can use them as input for logic that processes other elements (eg, child elements of said DIV). I tried something naive like: $('[foo=bar]').key='value' , and $('[foo=bar]')[key]='value', but it puked. Doing something like: var foobar = $('[foo=bar]'); foobar.key = 'value' -- works, but the new property/value only affects the new object (ie, foobar, not $('[foo=bar]')) Most likely there's something terribly basic I am overlooking. Any help is appreciated, thanks!

    Read the article

  • Referencing other modules in atexit

    - by Dmitry Risenberg
    I have a function that is responsible for killing a child process when the program ends: class MySingleton: def __init__(self): import atexit atexit.register(self.stop) def stop(self): os.kill(self.sel_server_pid, signal.SIGTERM) However I get an error message when this function is called: Traceback (most recent call last): File "/usr/lib/python2.5/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/home/commando/Development/Diploma/streaminatr/stream/selenium_tests.py", line 66, in stop os.kill(self.sel_server_pid, signal.SIGTERM) AttributeError: 'NoneType' object has no attribute 'kill' Looks like the os and signal modules get unloaded before atexit is called. Re-importing them solves the problem, but this behaviour seems weird to me - these modules are imported before I register my handler, so why are they unloaded before my own exit handler runs?

    Read the article

  • jQuery script to move an attribute of matched elements to their children

    - by UserControl
    I have a set of anchors like <a class="lb" href="#">text</a> <a class="lb" href="#" style="width:200px">text</a> <a class="lb" href="#" style="color: reen; width:200px">text</a> that needs to be transformed to the following: <a class="lb" href="#"><span>text</span></a> <a class="lb" href="#"><span style="width:200px">text</span></a> <a class="lb" href="#" style="color:green"><span style="width:200px">text</span></a> I have no problem creating child span but don't know how to move parent's width styling.

    Read the article

  • Determining Cross Domain Active Directory Group Membership

    - by thecaptain0220
    I am currently working on a project where I need to query Active Directory to determine group membership of a user. I initially was locating the user and retrieving the memberOf attribute. The problem with this is that there is a domain and a child domain. The groups are universal groups so they can be used in both domains and they don't show up in the memberOf attribute. Unfortunately there doesn't seem to be much info around for Active Directory access with C++. Is there anyway to determine group membership in this case in C++?

    Read the article

  • javascript popup reloads parent page -

    - by harry_T
    I have a popup function in a program that works well, be re-loads the parent page as it loads the child. Is there a way to prevent this behaviour. // popup window function function newPop(url, myWin, width, height, left, top, scrollbars) { parms = 'toolbar=yes, scrollbars=no, location=no, menubar=no, resizable=no, width= ' + width + ' , height=' + height + ' , left= ' + left + ' , top= ' + top + ' , titlebar=no , scrollbars = ' + scrollbars ; var newwin = window.open(url,myWin, parms); newwin.resizeTo(width,height); newwin.moveTo(0,0); newwin.moveTo(left,top); newwin.focus(); return false; }

    Read the article

  • Can I access an iframe of the same domain in a separate window?

    - by jozecuervo
    How can I detect the presence of and then call a function on a frame that is already loaded in one tab (my iframed facebook app) from a page being loaded in a new tab (from an ad-served link). It seems most examples focus on parent/child iframe communication. In this case, a link will be served from Google Ad Manager, which only allows _top or _blank to be targeted. I want to pass an id through the ad click into the new page/tab on my domain and then JS call over to the frame my app is in to switch state. Both frames are on my domain but not in the same document or window. Is this possible?

    Read the article

  • mySQL INSERT INTO SELECT not working

    - by Industrial
    Hi everyone, I am trying to implement the "Closure Table" structure in a php/mySQL webapp from Bill Karwins "SQL Antipatterns" slideshare presentation: http://www.slideshare.net/billkarwin/sql-antipatterns-strike-back The first step is to insert some stuff into my tree (page 73 in slide): Easy to insert a new child of comment #5: INSERT INTO Comments ... (Generates comment #8) INSERT INTO TreePaths (ancestor, descendant) VALUES (8, 8); INSERT INTO TreePaths (ancestor, descendant) SELECT ancestor, 8 FROM TreePaths WHERE descendant = 5; I try to translate all this into Codeigniters active record db-style language, and that's about where I get stuck. I cant understand how the second insert gets it's values. Is there anyone out there who can help me out with this?

    Read the article

  • change the default window font in a win32 windows project

    - by Vineel Kumar Reddy
    I am creating a GUI application using C and Win32 api. I would like to know how we can change the default font of the Main window to thaoma. I am comming from .NET background. In .NET if we change the font of parent control then automatically the child controls inherits that font.... Is there away similar to it or do we need to manually set the font of each control..... Please help me here.......and let me know the general process followed while coding in win32 api.... THanks in advance..

    Read the article

  • In a process using lots of memory, how can I spawn a shell without a memory-hungry fork()?

    - by kdt
    On an embedded platform (with no swap partition), I have an application whose main process occupies most of the available physical memory. The problem is that I want to launch an external shell script from my application, but using fork() requires that there be enough memory for 2x my original process before the child process (which will ultimately execl itself to something much smaller) can be created. So is there any way to invoke a shell script from a C program without incurring the memory overhead of a fork()? I've considered workarounds such as having a secondary smaller process which is responsible for creating shells, or having a "watcher" script which I signal by touching a file or somesuch, but I'd much rather have something simpler.

    Read the article

  • window.parent is always undefined in an iframe

    - by Bill Yang
    Hi there, I have recently ran into this strange issue, I was trying to reference parent window in an iframe, but somehow window.parent or parent are always undefined. I got around the problem by using window.top, but this question still haunts me. Why is window.parent undefined? This is a .NET web app, if it helps. Update: I would like to add that both parent and child iframes are pointed to the same domain (localhost). As for code, I have tried the following code: if (parent != null) { // do something } where do something never happens, I also tried alert(parent) and alert(window.parent) they always come out as null.

    Read the article

< Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >