Daily Archives

Articles indexed Sunday June 3 2012

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

  • Menus not visible in some apps in Xubuntu 12.04

    - by Carl Burkart
    I've been using Ubuntu 12.04 for a few weeks and recently added the xubuntu desktop as well. I have noticed that in some applications, there is no menu present. For example, in Thunar, their is no menu (File, View, etc.), so I can't figure out how to "show hidden files." Could this be some conflict between xubuntu and unity's global menu. I want to be able to log in under either on my netbook, so uninstalling one or the other is not an option. Any ideas?

    Read the article

  • Scale plugin keeps forgetting hot corner settings on restart

    - by Michael Butler
    I'm using Ubuntu 12.04 with Unity, which I suppose uses Compiz as well. I have Compiz Settings Manager, and make the top left and bottom left corners of my screen activate the "Scale" (like Exposé) function to scale and show all windows. The problem is that when I restart the computer, the hot corners no longer do anything. I have to go back into compiz settings manager, delete the hot corner option, and then set it again. Something seems to be overriding or deleting the compiz hot corner setting on restart. Update: Sometimes, the setting loses its footing even while the computer is running. I haven't figured out yet what triggers it.

    Read the article

  • cannot play VTC video file (.mov) using VLC player

    - by varunit
    I have a training course contains .mov files which have video codec as apple graphics smc. I have googled and found out to add these options to play them link from where I got help But they are playing fine only in SMplayer. I want to configure similarly and play those files in VLC player. This is the error which I'm facing Running vlc with the default interface. Use 'cvlc' to use vlc without interface. [0xb0d03d20] blend blend error: no matching alpha blending routine (chroma: RGBA - RGBP) [0xb0d03d20] main blend error: blending RGBA to RGBP failed It is repeating... Thanks for any help...

    Read the article

  • Open port in gufw is closed, no incoming connection on deluge

    - by user66987
    I have a problem configuring gufw. I open ports on it, but when i test in deluge it shows as closed. Any help on setting up the firewall would be greatly appreciated. This is the output I get on the firewall in terminal: Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1346/dnsmasq tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 970/cupsd tcp 0 0 0.0.0.0:55521 0.0.0.0:* LISTEN 17362/python tcp6 0 0 ::1:631 :::* LISTEN 970/cupsd tcp6 0 0 :::55521 :::* LISTEN 17362/python udp 0 0 10.0.0.125:1900 0.0.0.0:* 17362/python udp 0 0 127.0.0.1:1900 0.0.0.0:* 17362/python udp 0 0 0.0.0.0:1900 0.0.0.0:* 17362/python udp 0 0 127.0.0.1:53162 0.0.0.0:* 17362/python udp 0 0 127.0.0.1:53 0.0.0.0:* 1346/dnsmasq udp 0 0 0.0.0.0:68 0.0.0.0:* 1312/dhclient udp 0 0 10.0.0.125:36948 0.0.0.0:* 17362/python udp 0 0 0.0.0.0:37240 0.0.0.0:* 17362/python udp 0 0 10.0.0.125:6771 0.0.0.0:* 17362/python udp 0 0 127.0.0.1:6771 0.0.0.0:* 17362/python udp 0 0 0.0.0.0:6771 0.0.0.0:* 17362/python udp 0 0 10.0.0.125:50034 0.0.0.0:* 17362/python udp 0 0 0.0.0.0:58340 0.0.0.0:* 982/avahi-daemon: r udp 0 0 0.0.0.0:5353 0.0.0.0:* 982/avahi-daemon: r udp 0 0 0.0.0.0:56947 0.0.0.0:* 17362/python udp 0 0 127.0.0.1:57059 0.0.0.0:* 17362/python udp6 0 0 :::49793 :::* 982/avahi-daemon: r udp6 0 0 :::5353 :::* 982/avahi-daemon: r kenneth@kenneth-K53U:~$ sudo ufw status Status: aktive Til Handling Fra --- -------- --- 6881:6891/tcp ALLOW Anywhere 6881:6891/udp ALLOW Anywhere 55521/tcp ALLOW Anywhere 6881:6891/tcp ALLOW Anywhere (v6) 6881:6891/udp ALLOW Anywhere (v6) 55521/tcp ALLOW Anywhere (v6) I also want to be able to use the firewall with linuxdc, so I need other ports open as well. This is connected to the firewall. Because when I turn off the firewall, the port is open. So this is not a problem with my modem. Do I need the firewall? The broadband modem has a hardware firewall. Update: Forgot to add. When my firewall is inactive, it closes ports after a time. So when I use linuxdc, I have to flush iptabels and activating it again. Is this supposed to do this when the firewall is deactivated? Update again: All my ports are closed now, flushing the iptable does not work anymore. I have uninstalled gufw, but still all my ports are closed. And to say it again, this has nothing to do with my broadband modem since it worked when I used windows 7. I need help to open the ports.

    Read the article

  • Cliché monsters to populate a steampunk fantasy setting dwarven dungeon?

    - by Alexander Gladysh
    I'm looking for a list of cliché monsters for a steampunk computer game (assume one kind or another of casual rogue-like RPG), to populate lower levels of ancient dwarven-built dungeons. Dwarves are a technology/science race in the setting I am aiming for. The world is a low-magic one. I'm stuck after listing various mechanical golems, gigantic spiders (every dungeon must have some of them!), and maybe a mechanical barlog as a megaboss. What would player expect? What are the key cultural references for such setting? I know a couple of games with suitable steampunk dwarves, but none are detailed enough in the underworld monsters area. Please point me in the right direction. (If you have a single funny monster suggestion, please mention it in comments, not in answer. ;-) )

    Read the article

  • Quake 3 Bot Programming Example

    - by Manni
    I would like to implement an intelligent bot for Quake-3. I downloaded the and built the code successfully under Linux. My problem is that I couldn't find any complete tutorial telling me how to build an agent; telling which files to use( as there are many files in the source code). Can you give me a website or piece of source code telling me how to start? Or something like an example source code for a bot.

    Read the article

  • What are the possible options for AI path-finding etc when the world is "partitionned"?

    - by Sebastien Diot
    If you anticipate a large persistent game world, and you don't want to end up with some game server crashing due to overload, then you have to design from the ground up a game world that is partitioned in chunks. This is in particular true if you want to run your game servers in the cloud, where each individual VM is relatively week, and memory and CPU are at a premium. I think the biggest challenge here is that the player receives all the parts around the location of the avatar, but mobs/monsters are normally located in the server itself, and can only directly access the data about the part of the world that the server own. So how can we make the AI behave realistically in that context? It can send queries to the other servers that own the neighboring parts, but that sounds rather network intensive and latency prone. It would probably be more performant for each mob AI to be spread over the neighboring parts, and proactively send the relevant info to the part that contains the actual mob atm. That would also reduce the stress in a mob crossing a border between two parts, and therefore "switching server". Have you heard of any AI design that solves those issues? Some kind of distributed AI brain? Maybe some kind of "agent" community working together through message passing?

    Read the article

  • What has the most efficient intersection test against an AABB tree - OBB, Cylinder or Capsule?

    - by identitycrisisuk
    I'm currently trying to find collisions in 3D between a tighter volume than an AABB and a tree of AABB volumes. I just need to know whether they are intersecting, no closest distance or collision response. An OBB, Cylinder or Capsule would all roughly fit these purposes but Cylinder and Capsule were the first thing I thought of, which I have found little information about detecting intersections online. Am I right in thinking that they would always be more complex to perform Separating Axis Tests on even though they might seem like simpler shapes? I figure by the time I get my head around SAT for curved shapes I could have done the thing with OBBs but I wanted to find out for sure.

    Read the article

  • Type Object does not support slicing Unity3D

    - by Vish
    I am getting the following error in my code and I can't seem to understand why. Can anyone help me with it? This is my current code. The line causing the error is marked in a comment near the end. var rows : int = 4; var cols : int = 4; var totalCards : int = cols * rows; var matchesNeedToWin : int = totalCards * 0.5; var matchesMade : int = 0; var cardW : int = 100; var cardH : int = 100; var aCards : Array; var aGrid : Array; // This Array will store the two cards that the player flipped var aCardsFlipped : ArrayList; // To prevent player from clicking buttons when we don't want him to var playerCanClick : boolean; var playerHasWon : boolean = false; class Card extends System.Object { var isFaceUp : boolean = false; var isMatched : boolean = false; var img : String; function Card () { img = "robot"; } } function Start () { var i : int = 0; var j : int = 0; playerCanClick = true; aCards = new Array (); aGrid = new Array (); aCardsFlipped = new ArrayList (); for ( i = 0; i < rows; i++) { aGrid [i] = new Array (); for (j = 0; j < cols; cols++ ) { aGrid [i] [j] = new Card (); // <------ Error over here } } } function Update () { Debug.Log("Game Screen has loaded"); } The error states as follows: Error BCE0048: Type 'Object' does not support slicing. (BCE0048) (Assembly-UnityScript)

    Read the article

  • How many textures can usually I bind at once?

    - by Avi
    I'm developing a game engine, and it's only going to work on modern (Shader model 4+) hardware. I figure that, by the time I'm done with it, that won't be such an unreasonable requirement. My question is: how many textures can I bind at once on a modern graphics card? 16 would be sufficient. Can I expect most modern graphics cards to support that amount? My GTX 460 appears to support 32, but I have no idea if that's representative of most modern video cards.

    Read the article

  • window.open() in an iPad on load of a frame does not work

    - by user278859
    I am trying to modify a site that uses "Morten's JavaScript Tree Menu" to display PDFs in a frames set using the Adobe Reader plug-in. On the iPad the frame is useless, so I want to open the PDF in a new tab. Not wanting to mess with the tree menu I thought I could use JavaScript in the web page being opened in the viewer frame to open a new tab with the PDF. I am using window.open() in $(document).ready(function() to open the pdf in the new tab. The problem is that window.open() does not want to work in the iPad. The body of the HTML normally looks like this... <body> <object data="MypdfFileName.pdf#toolbar=1&amp;navpanes=1&amp;scrollbar=0&amp;page=1&amp;view=FitH" type="application/pdf" width="100%" height="100%"> </object> </body> I changed it to only have a div like this... <body> <div class="myviewer" ></div> </body> Then used the following script... $(document).ready(function() { var isMobile = { Android : function() { return navigator.userAgent.match(/Android/i) ? true : false; }, BlackBerry : function() { return navigator.userAgent.match(/BlackBerry/i) ? true : false; }, iOS : function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false; }, Windows : function() { return navigator.userAgent.match(/IEMobile/i) ? true : false; }, any : function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows()); } }; if(isMobile.any()) { var file = "MypdfFileName.pdf"; window.open(file); }else { var markup = "<object data='MypdfFileName.pdf#toolbar=1&amp;navpanes=1&amp;scrollbar=0&amp;page=1&amp;view=FitH' type='application/pdf' width='100%' height='100%'></object>"; $('.myviewer').append(markup); }; }); Everthing works except for window.open() on the iPad. If I switch things around widow.open() works fine on a computer. In another project I am using window.open() successfully on the iPad from an onclick function. I tried using a timer function. I also tried adding an onclick function to the div and posting a click event. In both cases they worked on a computer but not an iPad. I am stumped. I know it would make more sense to handle the ipad in the tree menu frame, but that code is so complex I can't figure out where to put/modify the onclick event. Is there a way to change the object so that it opens in a new tab? Is anyone familiar enough with Mortens Tree Menu code that can tell me how to channge the on click event so that it opens the pdf in a new tab instead of opening a page in the frame? Thanks

    Read the article

  • Recursive Iterators

    - by soandos
    I am having some trouble making an iterator that can traverse the following type of data structure. I have a class called Expression, which has one data member, a List<object>. This list can have any number of children, and some of those children might be other Expression objects. I want to traverse this structure, and print out every non-list object (but I do want to print out the elements of the list of course), but before entering a list, I want to return "begin nest" and after I just exited a list, I want to return "end nest". I was able to do this if I ignored the class wherever possible, and just had List<object> objects with List<object> items if I wanted a subExpression, but I would rather do away with this, and instead have an Expressions as the sublists (it would make it easier to do operations on the object. I am aware that I could use extension methods on the List<object> but it would not be appropriate (who wants an Evaluate method on their list that takes no arguments?). The code that I used to generate the origonal iterator (that works) is: public IEnumerator GetEnumerator(){ return theIterator(expr).GetEnumerator(); } private IEnumerable theIterator(object root) { if ((root is List<object>)){ yield return " begin nest "; foreach (var item in (List<object>)root){ foreach (var item2 in theIterator(item)){ yield return item2; } } yield return " end nest "; } else yield return root; } A type swap of List<object> for expression did not work, and lead to a stackOverflow error. How should the iterator be implemented? Update: Here is the swapped code: public IEnumerator GetEnumerator() { return this.GetEnumerator(); } private IEnumerable theIterator(object root) { if ((root is Expression)) { yield return " begin nest "; foreach (var item in (Expression)root) { foreach (var item2 in theIterator(item)) yield return item2; } yield return " end nest "; } else yield return root; }

    Read the article

  • Ampersand in JSON/PHP in POST

    - by svenkapudija
    I'm having a text field which is send via JSON and jQuery (wrapped with .toJSON function) to my server via AJAX and POST request. On PHP side I'm doing json_decode . Everything works but if I put ampersand (&) inside it splits up the POST parameter so its incomplete on PHP side (at least what var_dump($_POST) is writing out). Shouldn't the toJSON and json_decode do all the job (escaping)? I tried encodeURIComponent, & to &amp;, & to \u0026 and it's not working. What I'm doing wrong? AJAX call function execute() { this.setupUrl(); return $.ajax({ type: this.requestMethod, data: this.getDataParams(), url: this.url }); } function getDataParams() { if(this.data != undefined) { if(this.requestMethod == 'POST' || this.requestMethod == 'PUT') { return "data=" + $.toJSON(this.data); } else if (this.requestMethod == 'GET') { return this.data; } } else { return null; } }

    Read the article

  • a value that shows in select mode disappears in edit mode from a gridview column

    - by Jbob Johan
    i have a gridview(GridView1) with a few Bound Fields first one is Date (ActivityDate) from a table named "tblTime" i have managed to add one extra colum (manually), that is not bound that shows dayInWeek value according to the "ActivityDate" field programtically in CodeBehind but when i enter into Edit Mode , all Bound fields are showing their values correctly but the one column i have added manually will not show the value as it did in "select mode"(first mode b4 trying to edit) while im not a great dibbagger i have manged to view the cell's value (GridView1.Rows[e.NewEditIndex].Cells[1].Text) which does hold on to the day in week value but it does not appear in gridview edit mode only this is some of the code protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[0].Text = "?????"; //Activity Date (in hebrew) e.Row.Cells[1].Text = "??? ?????"; //DayinWeek e.Row.Cells[2].Text = "??????"; //ActivityType (work seek vacation) named Reason e.Row.Cells[3].Text = "??? ?????"; //time finish (to Work) e.Row.Cells[4].Text = "??? ?????"; //Time out (of work) } if (e.Row.RowType == DataControlRowType.DataRow) { if (Convert.ToBoolean(ViewState["theSubIsclckd"]) == true) //if submit button clicked { try { string twekday1 = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActiveDate")); twekday1 = twekday1.Remove(9, 11); //geting date only without the time- portion string[] arymd = twekday1.Split('/'); // spliting [d m y] in order to make int day = Convert.ToInt32(arymd[1]); // it into [m d y] ...also requierd int month = Convert.ToInt32(arymd[0]); // when i update the table int year = Convert.ToInt32(arymd[2]); DateTime ILDateInit = new DateTime(year, month, day); //finally extracting Day CultureInfo ILci = CultureInfo.CreateSpecificCulture("he-IL"); // in week //from the converted activity date string MyIL_DayInWeek = ILDateInit.ToString("dddd", ILci); ViewState["MyIL_DayInWeek"] = MyIL_DayInWeek; e.Row.Cells[1].Text = MyIL_DayInWeek; string displayReason = DataBinder.Eval(e.Row.DataItem, "Reason").ToString(); e.Row.Cells[2].Text = displayReason; } catch (System.Exception excep) { Js.functions.but bb = new Js.functions.but(); bb.buttonName = "rex"; bb.documentwrite = true; bb.testCsVar = excep.ToString(); bb.f1(bb); // this was supposed to throw exep in javaScript injected from code behid - alert } // just in case.. } } so that works for the non edit period of time then when i hit the edit ... no day in week shows THE aspX - after selcting date... name etc' , click on button to display gridview: <asp:Button ID="TheSubB" runat="server" Text="???" onclick="TheSubB_Click" /> <asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound" onrowediting="GridView1_RowEditing" onrowcancelingedit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" AutoGenerateColumns="False" DataKeyNames="tId" DataSourceID="SqlDataSource1" style="z-index: 1; left: 0%; top: 0%; position: relative; width: 812px; height: 59px; font-family:Arial; text-align: center;" AllowSorting="True" > <AlternatingRowStyle BackColor="PaleGoldenrod" /> <Columns> <asp:BoundField DataField="ActiveDate" HeaderText="ActiveDate" SortExpression="ActiveDate" ControlStyle-Width="70" DataFormatString="{0:dd/MM/yyyy}" > <ControlStyle Width="70px" /> </asp:BoundField> <asp:TemplateField HeaderText="???.???.??"> <EditItemTemplate> <asp:TextBox ID="dayinW_EditTB" runat="server"></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="dayInW_editLabel" runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Reason" HeaderText="???? ?????" SortExpression="Reason" ControlStyle-Width="50"> <ControlStyle Width="50px" /> </asp:BoundField> <asp:BoundField DataField="TimeOut" HeaderText="TimeOut" SortExpression="TimeOut" ControlStyle-Width="50" DataFormatString="{0:HH:mm}" > <ControlStyle Width="50px"></ControlStyle> </asp:BoundField> <asp:BoundField DataField="TimeIn" HeaderText="TimeIn" SortExpression="TimeIn" ControlStyle-Width="50" DataFormatString="{0:HH:mm}" > <ControlStyle Width="50px"></ControlStyle> </asp:BoundField> <asp:TemplateField HeaderText="????" > <EditItemTemplate> <asp:ImageButton width="15" Height="15" ImageUrl="~/images/edit.png" runat="server" CausesValidation="True" CommandName="Update" Text="Update"> </asp:ImageButton> <asp:ImageButton Width="15" Height="15" ImageUrl="images/cancel.png" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"> </asp:ImageButton> </EditItemTemplate> <ItemTemplate> <asp:ImageButton width="25" Height="15" ImageUrl="images/edit.png" ID="EditIB" runat="server" CausesValidation="False" CommandName="Edit" AlternateText="????"></asp:ImageButton> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="???"> <ItemTemplate> <asp:ImageButton width="15" Height="15" ImageUrl="images/Delete.png" ID="DeleteIB" runat="server" CommandName="Delete" AlternateText="???" /> </ItemTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="Tan" /> <HeaderStyle BackColor="Tan" Font-Bold="True" /> <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" /> <SortedAscendingCellStyle BackColor="#FAFAE7" /> <SortedAscendingHeaderStyle BackColor="#DAC09E" /> <SortedDescendingCellStyle BackColor="#E1DB9C" /> <SortedDescendingHeaderStyle BackColor="#C2A47B" /> </asp:GridView>

    Read the article

  • Python code, extracting extensions

    - by user1434001
    import os path = '/Users/Marjan/Documents/Nothing/Costco' print path names = os.listdir(path) print len(names) for name in names: print name Here is the code I've been using, it lists all the names in this category in terminal. There are a few filenames in this file (Costco) that don't have .html and _files. I need to pick them out, the only issue is that it has over 2,500 filenames. Need help on a code that will search through this path and pick out all the filenames that don't end with .html or _files. Thanks guys

    Read the article

  • scala 2.8 CanBuildFrom

    - by oxbow_lakes
    Following on from another question I asked, I wanted to understand a bit more about the Scala method TraversableLike[A].map whose signature is as follows: def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That Notice a few things about this method: it takes a function turning each A in the traversable into a B it returns That and takes an implicit argument of type CanBuildFrom[Repr, B, That] I can call this as follows: > val s: Set[Int] = List("Paris", "London").map(_.length) s: Set[Int] Set(5,6) What I cannot quite grasp is how the fact that That is bound to B (i.e. it is some collection of B's) is being enforced by the compiler. The type parameters look to be independent in both the signature above and in the signature of the trait CanBuildFrom itself: trait CanBuildFrom[-From, -Elem, +To] How is the scala compiler ensuring that That cannot be forced into something which does not make sense? > val s: Set[String] = List("Paris", "London").map(_.length) //will not compile EDIT - this question of course boils down to: How does the compiler decide what implicit CanBuildFrom objects are in scope for the call?

    Read the article

  • How do I recycle code in Visual Studio with XNA?

    - by Marty Wallace
    I'm relatively new to both C# and Visual Studio, using XNA Game Studio. All I want to do is take some folders from a current project which contain .cs files and utilise those files in a new project, but it's proving to be a little trickier than I am used to with Flash/ActionScript. At the moment it seems like I need to use this process over and over until all the files I want are part of the current project:

    Read the article

  • How does UITableViewController knows its dataSource and delegate

    - by denniss
    I am following the BigNerdRanch iOS Programming book and I am on this one chapter that deals with UITableViewController. I have been wondering however where UITableViewController finds out about its delegate and dataSource. Currently I have it as @interface ItemsViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate> But there is nothing that looks like: [self.tableView setDelegate:self] I am just wondering how the UITableViewController finds out about its delegate and dataSource

    Read the article

  • What is the space character for the browser?

    - by Hiro Protagonist
    echo "\n\s\s\s\s\s\s" . "<div id='data-load' data-load='" . $load . "'></div>"; \n works for adding a return in...I tried \s logically for space but this does not work. Keep mind, I don't want this rendered in the browser view...but in the source view ( when you click view-source )...I'm trying to put my html in to a readable form. echo "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\n" . "<div id='data-path' data-path='" . $path . "'></div>"; This does not work either. I am composing HTML from PHP... echo " \n" . "<div id='data-load' data-load='" . $load . "'></div>"; This does not work either. Actual Code: public static function setUniversals() { $shared_object = new Shared(); if ( $shared_object->getLoadOn() == 1 ) { $load = 'server'; } else { $load = 'client'; } if( getcwd() === '/home/foo/public_html/develop' ) { $path = 'development'; } else { $path = 'production'; } $shared_object = new Shared(); echo "\n"; echo "\n " . "<div id='data-path' data-path='" . $path . "'></div>"; echo "\n " . "<div id='data-load' data-load='" . $load . "'></div>"; }

    Read the article

  • Please explain class methods

    - by user1209902
    I'm finding it difficult to understand when it is necessary to create class methods. From what I've read, they are important for creating new objects, but I do not see how. The following class create a simple shape black rectangle. Can anyone show me how to incorporate a class method to do something that I could not do with an instance method? Shape.h #import <UIKit/UIKit.h> @interface Shape : UIView; - (id) initWithX: (int)xVal andY: (int)yVal; @end Shape.m #import "Shape.h" @implementation Shape - (id) initWithX:(int )xVal andY:(int)yVal { self = [super init]; UIView *shape = [[UIView alloc] initWithFrame:CGRectMake(xVal, yVal, 10, 10)]; shape.backgroundColor = [UIColor blackColor]; [self addSubview:shape]; return self; } @end

    Read the article

  • Possible to change function name in definition?

    - by Bird Jaguar IV
    I tried several ways to change the function name in the definition, but they failed. >>> def f(): pass >>> f.__name__ 'f' >>> def f(): f.__name__ = 'new name' >>> f.__name__ 'f' >>> def f(): self.__name__ = 'new name' >>> f.__name__ 'f' But I can change the name attribute after defining it. >>> def f(): pass >>> f.__name__ = 'new name' >>> f.__name__ 'new name' Any way to change/set it in the definition (other than using a decorator)?

    Read the article

  • My Android XML files can't find ActionBarSherlock themes

    - by MalcolmMcC
    I'm trying to develop an app with ActionBarSherlock and everything works except the theming. Specifically, I can import com.actionbarsherlock.app.*, extend SherlockActivity, but I always have this error in my manifest: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Sherlock'). I know there have been plenty of questions asked about this, but they have not worked for me. I have tried refreshing the workspace cleaning all of my projects putting the line in both the <activity> and the <application> setting my targetSdkVersion and minSdkVersion to various values, in both my manifest and ABS's and I've tried the following variations, and probably others: android:theme="@style/Theme.Sherlock" android:theme="@android:style/Theme.Sherlock" theme="@style/Theme.Sherlock" theme="@android:style/Theme.Sherlock" theme="@theme/Theme.Sherlock" theme="@android:theme/Theme.Sherlock" It's worth noting that the autocomplete after I typed "@style/" was showing nothing, so I tried making my own style in styles.xml and then that showed up but still nothing from ActionBarSherlock. Also, in styles.xml, I tried to make my own theme to extend Theme.Sherlock, and @style/Theme.Sherlock was not found there either when I tried to add it as a parent. I tried loading the samples but got a JAR Mismatch. My conclusion is that somehow my xml files are unable to access the ABS library, but I'm at a loss as to how to fix it. Any help hugely appreciated.

    Read the article

  • Integrating WebSockets with Rails using Rack and Event Machine

    - by Toby Hede
    I have created an Asynchronous version of Rails 3 that I would like to integrate with a WebSocket implementation. I am using EventMachine, Ruby 1.9, Fibers and various em-flavoured libraries as documented by the wickedly good Ilya Grigorik. I have been looking at em-websocket as the handler for WebSocket connections but unsure of the best approach for hooking this into a Rails app. Ideally, this would work in a similar fashion to node.js with Express and Socket.io - incoming connections should be detected and dispatched to the WebSocket handler or the regular rails stack as indicated by the HTTP headers & etc. TL;DR WebSocket handler that plugs into an existing Rails application Transparently dispatch incoming WebSocket requests to endpoints in the app

    Read the article

  • Static member object of a class in the same class

    - by Luv
    Suppose we have a class as class Egg { static Egg e; int i; Egg(int ii):i(ii) {} Egg(const Egg &); //Prevents copy-constructor to be called public: static Egg* instance() {return &e} }; Egg Egg::e(47); This code guarantees that we cannot create any object, but could use only the static object. But how could we declare static object of the same class in the class. And also one thing more since e is a static object, and static objects can call only static member functions, so how could the constructor been called here for static object e, also its constructors are private.

    Read the article

  • why does backbone not send the delete?

    - by Nippysaurus
    I have a very basic backbone (sample) application which just creates and destroys model items. When the model is created the object is persisted with a POST to the web server, but when the model is destroyed there is no DELETE sent to the server? Any idea why this might be? very basic model: window.User = Backbone.Model.extend({ urlRoot: 'users' }); my test code just to create and delete the model: var model = null; $(".add").click(function(){ if (model == null) { model = new window.User; model.set({name: 'meeee'}); model.save(); } }); $(".remove").click(function(){ if (model != null) { model.destroy(); } }); The JSON response when creating the model seems good too:

    Read the article

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