Daily Archives

Articles indexed Saturday June 29 2013

Page 3/16 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • App for finding icons easily?

    - by artfulrobot
    Occasionally I need to use a custom icon for something - a launcher created with alacarte, a custom .desktop file, or just a particular folder viewed in Nautilus. I know there are LOADS of cool icons installed on my system at /usr/share/icons but browsing them is really awkward. Everything is scattered around, duplicated in different sizes (or symlinked to .svg) etc. So, say I'm looking for a text file icon, or a purple folder or such, searching is a faff, and then when you do find results you need to work out what the best quality one is. Made me think that someone might have written an app for this?

    Read the article

  • Ubuntu Touch porting: bad file tree

    - by fcole90
    I'm trying to port ubuntu touch to Samsung Galaxy S Plus but I'm finding it really difficult. The problems at first were to find a good CM rom as base, because this device is not officially supported by CM. Currently I'm using EhndroixIII but now I'm founding a lot of problems with the porting guide. In particular my file tree seems totally different from the one of the guide. For example, there is no device folder. What can I do to solve? Should I create those files? My repository is https://github.com/fcole90/utouch-sgsp.git

    Read the article

  • Add an entry for Ubuntu on Windows 8 boot loader

    - by John
    I have installed Ubuntu 12.10 by creating free space in Windows 8 and then using that space to create 3 partitions, one for SWAP, one for GRUB (mounting point is /boot) and one for the actual OS. I did this so the Windows 8 boot loader wouldn't be overwritten in case I ever wanted to remove Ubuntu. I can still boot into Ubuntu if I select the boot loader from the BIOS. I want to add Ubuntu to the Windows 8 boot loader and I've been told to use EasyBCD. The issue with that is it doesn't actually direct Windows to the GRUB file, but rather to something like autogrub0.mri. I have found another programme called Visual BCD which will allow me to actually set the bootloader paths and drives. From here, I don't quite know what to do. I believe I have it set to the correct drive but I don't know if I'm directing to the right file. I think it's /boot/grub/x86_64-efi/grub.efi. I don't know if that's the right file, if I need to remove /boot or if the / need to be \ as that's what Windows uses. Sorry for such a lengthy post, please help!

    Read the article

  • RewriteRule for URLs with spaces

    - by Robert Cailliau
    My site's pages are in multiple languages whereby each language version shares its media (images) with the other language versions. I place all versions and the media in a single directory with the same name. E.g. pages mypage-en.html, mypage-fr.html etc. will sit in directory mypage. The directory path suffices to reference a page: h t t p : //....../mypage/ is good enough, there is no need for h t t p : //....../mypage/mypage-en/html A rewrite with RewriteRule ^(.*)/([a-zA-Z0-9]+)/?$ /$1/$2/$2-en.html lets me use the shorter form. But what if the name mypage contains spaces (which some do) ? I want h t t p : //....../my page/ to lead to h t t p : //....../my page/my page.html Using RewriteRule ^(.*)/([a-zA-Z0-9|\s]+)/?$ /$1/$2/$2-en.html did not work. Any hints welcome. (please do not ask me why I want to do this, nor tell me I should not use spaces in file names)

    Read the article

  • What is more preferable, Creating dedicated domains for mobile apps that shares different content or associate them with folders in one domain?

    - by Abdullah Al-Khalidi
    I want to consult you in an SEO matter which i am completely lost with, I've built a social mobile application that allows users to share text content and made all the content that appears on the application available via the web through dedicated links, however, those links cannot be navigated through the website but they are generated when users shares content through the app to social media networks. I've implemented this method on three applications with totally different content, and I've directed all generated URLs to be from the main company website which is http://frootapps.com so when users shares something, the url will change to http://frootapps.com/qareeb/share.aspx?data=127311. My question, which one is more preferable, a dedicated website for each app that uses such method? or it is ok to keep doing it the same way I am doing it?

    Read the article

  • Cocos2d iOS A* Star Path finding help

    - by user32581
    Hello I need help implementing this class https://github.com/sqlboy/tiled-games/tree/master/src into my iOS game. Im using the suggested code of: AStarPathFinder pathFinder = [[AStarPathFinder alloc] initWithTileMap:tileMap collideLayer:@"collide"]; // Optionally, you can set the name of the collide property key and the value it expects. [pathFinder setCollideKey:@"collidable"] // defaults to COLLIDE [pathFinder setCollideValue:@"True"] // defaults to 1 // highlight a path (src and dst are tile coorindates) [pathFinder highlightPathFrom:srcTile to:dstTile]; // move a sprite [pathFinder moveSprite:player from:srcTile to:dstTile atSpeed:0.1f]; I get the following error: Instance method '-initWithTileMap:collideLayer:' not found (return defaults to 'id') This is the official post for the class: http://www.cocos2d-iphone.org/forums/topic/just-pushed-a-cctmxtiledmap-a-pathfinding-class-to-github/ The only other code I added was: #import "AStarPathFinder.h" I think I am perhaps missing something! I am grateful for any help!

    Read the article

  • Why is my collision detection not accurate?

    - by optimisez
    After trying and trying, I still cannot understand why the leg of character exceeds the wall but no clipping issue when I hit the wall from below. How should I fix it to make him stand still on the wall? From collideWithBox() function below, it shows that playerDest.Y = boxDest.Y - boxDest.height; will get the position the character should standstill on the wall. Theoretically, the clipping effect won't be happen as the character hit the box from below works with the equation playerDest.Y = boxDest.Y + boxDest.height;. void collideWithBox() { if ( spriteCollide(playerDest, boxDest) && keyArr[VK_UP]) //playerDest.Y += 50; playerDest.Y = boxDest.Y + boxDest.height; else if ( spriteCollide(playerDest, boxDest) && !keyArr[VK_UP]) playerDest.Y = boxDest.Y - boxDest.height; } void initPlayer() { // Create texture. hr = D3DXCreateTextureFromFileEx(d3dDevice, "player.png", 169, 44, D3DX_DEFAULT, NULL, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, D3DCOLOR_XRGB(255, 255, 255), NULL, NULL, &player); playerRect.left = playerRect.top = 0; playerRect.right = 29; playerRect.bottom = 36; playerDest.X = 0; playerDest.Y = 564; playerDest.length = playerRect.right - playerRect.left; playerDest.height = playerRect.bottom - playerRect.top; } void initBox() { hr = D3DXCreateTextureFromFileEx(d3dDevice, "brock.png", 330, 132, D3DX_DEFAULT, NULL, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, D3DCOLOR_XRGB(255, 255, 255), NULL, NULL, &box); boxRect.left = 33; boxRect.top = 0; boxRect.right = 63; boxRect.bottom = 30; boxDest.X = boxDest.Y = 300; boxDest.length = boxRect.right - boxRect.left; boxDest.height = boxRect.bottom - boxRect.top; } bool spriteCollide(Entity player, Entity target) { float left1, left2; float right1, right2; float top1, top2; float bottom1, bottom2; left1 = player.X; left2 = target.X; right1 = player.X + player.length; right2 = target.X + target.length; top1 = player.Y; top2 = target.Y; bottom1 = player.Y + player.height; bottom2 = target.Y + target.height; if (bottom1 < top2) return false; if (top1 > bottom2) return false; if (right1 < left2) return false; if (left1 > right2) return false; return true; }

    Read the article

  • Map building - Tower Defense

    - by Dan K
    Before diving too deep into my question, let it be known that I am learning as far as java script goes and figured a simple Tower Defense game would be an excellent way to learn things. So I have found a simple background image with a path drawn on it and my question is how would I go about building a path so that I can animate my objects. Would I have to take the image and overlay a grid system, or can I store the path in some sort of array and have my objects move across it? Here is the background image:

    Read the article

  • Grails - ElasticSearch - QueryParsingException[[index] No query registered for [query]]; with elasticSearchHelper; JSON via curl works fine though

    - by v1p
    I have been working on a Grails project, clubbed with ElasticSearch ( v 20.6 ), with a custom build of elasticsearch-grails-plugin(to support geo_point indexing : v.20.6) have been trying to do a filtered Search, while using script_fields (to calculate distance). Following is Closure & the generated JSON from the GXContentBuilder : Closure records = Domain.search(searchType:'dfs_query_and_fetch'){ query { filtered = { query = { if(queryTxt){ query_string(query: queryTxt) }else{ match_all {} } } filter = { geo_distance = { distance = "${userDistance}km" "location"{ lat = latlon[0]?:0.00 lon = latlon[1]?:0.00 } } } } } script_fields = { distance = { script = "doc['location'].arcDistanceInKm($latlon)" } } fields = ["_source"] } GXContentBuilder generated query JSON : { "query": { "filtered": { "query": { "match_all": {} }, "filter": { "geo_distance": { "distance": "5km", "location": { "lat": "37.752258", "lon": "-121.949886" } } } } }, "script_fields": { "distance": { "script": "doc['location'].arcDistanceInKm(37.752258, -121.949886)" } }, "fields": ["_source"] } The JSON query, using curl-way, works perfectly fine. But when I try to execute it from Groovy Code, I mean with this : elasticSearchHelper.withElasticSearch { Client client -> def response = client.search(request).actionGet() } It throws following error : Failed to execute phase [dfs], total failure; shardFailures {[1][index][3]: SearchParseException[[index][3]: from[0],size[60]: Parse Failure [Failed to parse source [{"from":0,"size":60,"query_binary":"eyJxdWVyeSI6eyJmaWx0ZXJlZCI6eyJxdWVyeSI6eyJtYXRjaF9hbGwiOnt9fSwiZmlsdGVyIjp7Imdlb19kaXN0YW5jZSI6eyJkaXN0YW5jZSI6IjVrbSIsImNvbXBhbnkuYWRkcmVzcy5sb2NhdGlvbiI6eyJsYXQiOiIzNy43NTIyNTgiLCJsb24iOiItMTIxLjk0OTg4NiJ9fX19fSwic2NyaXB0X2ZpZWxkcyI6eyJkaXN0YW5jZSI6eyJzY3JpcHQiOiJkb2NbJ2NvbXBhbnkuYWRkcmVzcy5sb2NhdGlvbiddLmFyY0Rpc3RhbmNlSW5LbSgzNy43NTIyNTgsIC0xMjEuOTQ5ODg2KSJ9fSwiZmllbGRzIjpbIl9zb3VyY2UiXX0=","explain":true}]]]; nested: QueryParsingException[[index] No query registered for [query]]; } The above Closure works if I only use filtered = { ... } script_fields = { ... } but it doesn't return the calculated distance. Anyone had any similar problem ? Thanks in advance :) It's possible that I might have been dim to point out the obvious here :P

    Read the article

  • Multiple screen support in android?

    - by Yugesh
    In my application have six buttons,the screen size is 4.65" 720p(720X1280 : xhdpi),device take this resolution from normal layout folder.when i run it in device.it display like the image am shown below.how to set this six buttons fit to the screen according to layout width and height.I don't know how to do.Can any one know please help me to solve this problem. My XML coding <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/home_xml" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" > <Button android:id="@+id/btn_login" android:layout_width="101dp" android:layout_height="193dp" android:layout_alignParentLeft="true" android:layout_below="@+id/imageView1" android:layout_marginLeft="4dp" android:layout_marginTop="78dp" android:background="@drawable/login_button" /> <Button android:id="@+id/btn_order" android:layout_width="101dp" android:layout_height="wrap_content" android:layout_alignBottom="@+id/btn_login" android:layout_alignTop="@+id/btn_login" android:layout_marginLeft="3dp" android:layout_toRightOf="@+id/btn_login" android:background="@drawable/order_button" /> <Button android:id="@+id/btn_abtus" android:layout_width="101dp" android:layout_height="wrap_content" android:layout_alignBottom="@+id/btn_order" android:layout_alignTop="@+id/btn_order" android:layout_marginLeft="3dp" android:layout_toRightOf="@+id/btn_order" android:background="@drawable/aboutus_button" /> <Button android:id="@+id/btn_outlet" android:layout_width="100dp" android:layout_height="198dp" android:layout_alignLeft="@+id/btn_login" android:layout_alignRight="@+id/btn_login" android:layout_below="@+id/btn_login" android:background="@drawable/outlets_button" /> <Button android:id="@+id/btn_feedback" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/btn_outlet" android:layout_alignLeft="@+id/btn_order" android:layout_alignRight="@+id/btn_order" android:layout_alignTop="@+id/btn_outlet" android:background="@drawable/feedback_button" /> <Button android:id="@+id/btn_games" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/btn_feedback" android:layout_alignLeft="@+id/btn_abtus" android:layout_alignRight="@+id/btn_abtus" android:layout_alignTop="@+id/btn_feedback" android:background="@drawable/games_button" /> <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="match_parent" android:layout_height="44dp" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:background="#98110e" > </RelativeLayout>

    Read the article

  • How to fix "unexpected T_CONSTANT_ENCAPSED_STRING" syntax error?

    - by user2534376
    I have the following code: function wp_logout_url($redirect = '') { $args = array( 'action' => 'logout' ); if ( !empty($redirect) ) { $args['redirect_to'] = urlencode( $redirect ); } $logout_url = add_query_arg($args, site_url(wp-login.php', 'login')); $logout_url = wp_nonce_url( $logout_url, 'log-out' ); return apply_filters('logout_url', $logout_url, $redirect); } But I get the following error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING How can I fix this?

    Read the article

  • Internet Explorer and Google Chrome different showup of content

    - by NDLombardi
    I'm setting up an online form where to choose boxes and stuff. I almost finished the whole thing when I said to my self "Let's try it in IE". This is the result I want and what comes up in Google Chrome: And this is what happens in IE: And this is the CSS and HTML for that part: <!--- HTML ---> <div id="choosen"><img src="img.jpg" class="center-img" /></div> /* --- CSS --- */ img.center-img{ margin-top:15px; position:relative; width: <?php echo $width; ?>px; left:50%; margin-left:-<?php echo $width/2; ?>px; } Basically the image is centered into the div as this page I'm writing will be included into another one which I never saw and someone else will do it.

    Read the article

  • Create JTable in a JPanel and add row

    - by DK64
    On my program I've dinamically created a JFrame that contains a JPanel called jp. jp also contains a JTable that I would like to fill with some rows. case KeyEvent.VK_R: JFrame frame = new JFrame("Snake v2.0 - Rankings"); JPanel jp = new JPanel(); jp.setPreferredSize(new Dimension(300,300)); JTable table = new JTable(); JScrollPane tableContainer = new JScrollPane(table); jp.add(tableContainer, BorderLayout.CENTER); DefaultTableModel tm = (DefaultTableModel) table.getModel(); tm.addRow(new Object[] {"#","Player","Score","Date"}); frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setResizable(false); frame.getContentPane().add(jp); frame.pack(); frame.setVisible(true); break; This is my code. When I press R on the keyboard, the JFrame with that JPanel inside appears but the table doesnt (picture). What could I do?

    Read the article

  • WebClient and Gzip compression is faster?

    - by Yozer
    I writting an application which is using WebClient class. Adding something like that: ExC.Headers.Add("Accept-Encoding: gzip, deflate"); where ExC is: class ExWebClient1 : WebClient { protected override WebRequest GetWebRequest(Uri address) { HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address); request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; return request; } } It will be a diffrence in speed when i will be using encoded response?

    Read the article

  • How to run <script src= > tag from javascript

    - by Gleeb
    I am having some difficulties implementing Paypal buttons with backbone.js The problem is that the button is implemented in a script tag: <script src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID" data-button="buynow" data-name="My product" data-amount="1.00"></script> which i cant run from Handlebars.js because the </script> tag is closing the handlebars <script> I cant use eval(), or i don't understand how i am supposed to do that with the . So there you have it. i am kind of stuck. I am out of ideas on how to implement this button with backbone.js the last resort is to ask the server to produce html pages with the script in them and then load them to the page. i am just refusing to believe that JavaScript has no way to take care of this. Please help. This question relates to another question i asked in this subject. Is it possible to use JavaScript inside handlebars.js template Thank you.

    Read the article

  • How to find the largest power of 2 less than the given number

    - by nazar_art
    I need to find the largest power of 2 less than the given number. And I stuck and can't find any solution. Code: public class MathPow { public int largestPowerOf2 (int n) { int res = 2; while (res < n) { res =(int)Math.pow(res, 2); } return res; } } This doesn't work correctly. Testing output: Arguments Actual Expected ------------------------- 9 16 8 100 256 64 1000 65536 512 64 256 32 How to solve this issue?

    Read the article

  • Will releasing an iPhone app makes it available for iPad by default?

    - by agro1986
    In my XCode's Targets summary screen, the "Devices" drop down is set to "iPhone" (other possible values are iPad and Universal) because I haven't fine tuned the app's UI for iPad. However, will people be able to download and run my app from the iPad in non-fullscreen? (e.g., with black border surrounding most of the screen) I want people to be able to search for it in app store, install it, and run it even though it is not full screen. Thanks a lot

    Read the article

  • Core-Data + AFNetworking + UI Updating (Responsiveness)

    - by Mustafa
    Here's the scenario: I'm writing a DownloadManager, that allows the user to download, pause, cancel, download all, and pause all. The DownloadManager is a singleton, and uses AFNetworking to download files. It has it's own private managed object context, so that user can freely use other parts of the application (by adding, editing, deleting) core-data objects. I have a core-data entity DownloadInfo that stores the download information i.e. fileURL, fileSize, bytesRead, etc. The DownloadManager updates the download progress in DownloadInfo (one for each file). I have a DownloadManagerViewController which uses NSFetchedResultsController to show the download status to the user. This download view controller is using the main managed object context. Now let's say that I have 20 files in the download queue. And let's say that only 3 concurrent downloads are allowed. The download manager should download the file, and show the download progress. Problem: The DownloadInfo objects are being updated by the DownloadManager at a very high rate. The DownloadManagerViewController (responsible for showing the download progress) is updating the list using NSFetchedResultsControllerDelegate methods. The result is that a lot is happening in the main queue and application has very poor responsiveness. How can I fix this? How can I make the application responsive, while showing the download progress? I don't know how else to communicate that the download status between DownloadManager and DownloadManagerViewController. Is there another/ a better way to do this? I don't want to use main managed object context in my DownloadManager, for reasons mentioned above. Note, that the DownloadManager is using AFNetworking which is handling the requests asynchronously, but eventually the DownloadInfo objects are updated in the main thread (as a result of the callback methods). Maybe there's a way to handle the downloads and status update operations in a background thread? but how? How will I communicate between the main thread and the background thread i.e. how will I tell the background thread to queue another file for download? Thanks.

    Read the article

  • Select a record with highest amount by joining two tables

    - by user2516394
    I've 2 tables Sales & Purchase, Sales table with fields SaleId, Rate, Quantity, Date, CompanyId, UserID. Purchase table with fields PurchaseId, Rate, Quantity, Date, CompanyId, UserID. I want to select a record from either table that have highest Rate*Quantity. SELECT SalesId Or PurchaseId FROM Sales,Purchase where Sales.UserId=Purchase.UserId and Sales.CompanyId=Purchase.CompanyId AND Sales.Date=Current date AND Purchase.Date=Current date AND Sales.UserId=1 AND Purchase.UserId=1 AND Sales.CompanyId=1 AND Purchase.ComoanyId=1

    Read the article

  • What is the simplest way to generate domain specific url from application path..?

    - by harsh
    I have application specific url like below ~/Default.aspx ~/Manage/Page.aspx ~/Manage/Account/Default.aspx I really don't know what are these kind of paths actually called. Now I need them to convert to domain specific complete URL. No ../ or ../../ like thing in the URL. I want URLs like http://www.example.com/Default.aspx http://www.example.com/Manage/Page.aspx http://www.example.com/Manage/Account/Default.aspx Currently I am doing this following way (assuming I have HttpRequest object) Request.Url.Host + path.Substring(1); Is there a more simplest way to achieve this..?

    Read the article

  • MATLAB Easter Egg Spy vs Spy

    - by Aqui1aZ3r0
    I heard that MATLAB 2009b or earlier had a fun function. When you typed spy in the console, you would get something like this: http://t2.gstatic.com/images?q=tbn:ANd9GcSHAgKz-y1HyPHcfKvBpYmZ02PWpe3ONMDat8psEr89K0VsP_ft However, now you have an image like this:http://undocumentedmatlab.com/images/spy2.png I'd like it if I could get the code of the original spy vs spy image FYI, there's a code, but has certain errors in it: c = [';@3EA4:aei7]ced.CFHE;4\T*Y,dL0,HOQQMJLJE9PX[[Q.ZF.\JTCA1dd' '-IorRPNMPIE-Y\R8[I8]SUDW2e+' '=4BGC;7imiag2IFOQLID8''XI.]K0"PD@l32UZhP//P988_WC,U+Z^Y\<2' '&lt;82BF>?8jnjbhLJGPRMJE9/YJ/L1#QMC$;;V[iv09QE99,XD.YB,[_]=3a' '9;CG?@9kokc2MKHQSOKF:0ZL0aM2$RNG%AAW\jw9E.FEE-_G8aG.d]_W5+' '?:CDH@A:lpld3NLIRTPLG=1[M1bN3%SOH4BBX]kx:J9LLL8H9bJ/+d_dX6,' '@;DEIAB;mqmePOMJSUQMJ2\N2cO4&TPP@HCY^lyDKEMMN9+I@+S8,+deY7^' '8@EFJBC<4rnfQPNPTVRNKB3]O3dP5''UQQCIDZ_mzEPFNNOE,RA,T9/,++\8_' '9A2G3CD=544gRQPQUWUOLE4^P4"Q6(VRRIJE[n{KQKOOPK-SE.W:F/,,]Z+' ':BDH4DE>655hSRQRVXVPMF5_Q5#R>)eSSJKF\ao0L.L-WUL.VF8XCH001_[,' ';3EI<eo ?766iTSRSWYWQNG6$R6''S?*fTTlLQ]bp1M/P.XVP8[H9]DIDA=]' '?4D3=FP@877jUTSTXZXROK7%S7(TF+gUUmMR^cq:N9Q8YZQ9_IcIJEBd_^' '@5E@GQA98b3VUTUY*YSPL8&T)UI,hVhnNS_dr;PE.9Z[RCaR?+JTFC?e+' '79FA?HRB:9c4WVUVZ+ZWQM=,WG*VJ-"gi4OTes-XH+bK.#hj@PUvftDRMEF,]UH,UB.TYVWX,e\' '9;ECAKTY< ;eWYXWX\:)YSOE.YI,cL/$ikCqV1guE/PFL-^XI-YG/WZWXY1+]' ':AFDBLUZ=jgY[ZYZ-<7[XQG0[K.eN1&"$K2u:iyO9.PN9-_K8aJ9_]]82[' '?CEFDNW\?khZ[Z[==8\YRH1\M/!O2''#%m31Bw0PE/QXE8+R9bS;da^]93\' '@2FGEOX]ali[][9(ZSL2]N0"P3($&n;2Cx1QN9--L9,SA+T< +d_:4,' 'A3GHFPY^bmj\^]\]??:)[TM3^O1%Q4)%''oA:D0:0OE.8ME-TE,XB,+da;5[' '643IGQZ_cnk]_^]^@@;5\UN4_P2&R6*&(3B;E1<1PN99NL8WF.^C/,a+bY6,' '7:F3HR[dol^_^AA<6]VO5Q3''S>+'');CBF:=:QOEEOO9_G8aH6/d,cZ[Y' '8;G4IS\aep4_a-BD=7''XP6aR4(T?,(5@DCHCC;RPFLPPDH9bJ70+0d\\Z' '9BH>JT^bf45ba.CE@8(YQ7#S5)UD-)?AEDIDDD/QKMVQJ+S?cSDF,1e]a,' ':C3?K4_cg5[acbaADFA92ZR8$T6*VE.*@JFEJEEE0.NNWTK,U@+TEG0?+_bX' ';2D@L9dh6\bdcbBEGD:3[S=)U7+cK/+CKGFLIKI9/OWZUL-VA,WIHB@,`cY']; i = double(c(:)-32); j = cumsum(diff([0; i])< =0) + 1; S = sparse(i,j,1)'; spy(S)

    Read the article

  • Adding UIView on top of all views dynamically during runtime?

    - by Easwaramoorthy Kanagaraj
    Team, I am trying to bring a menu in top of all visible views during runtime. This menu should be easily addable and removable dynamically in certain conditions. To do this, I have tried adding a button view to the UIWindow as a subview during runtime. UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:nil forControlEvents:UIControlEventTouchDown]; [button setTitle:@"Show View" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); [window addSubview:button]; [window makeKeyAndVisible]; [window bringSubviewToFront:button]; But it doesnt worked. Also I have tried to place this button in the root view controller, but no luck again. Edit - Note: This code is not from a UIViewController. I am trying to build a library this will be in that library code. Use case be like you could post NSNotification to enable and disable this menu dynamically during runtime. Please suggest. Thanks !

    Read the article

  • SQL Server 2008: CASE vs IF-ELSE-IF vs GOTO

    - by Saharsh Shah
    I have some rules in my application and I have written the business logic of that rules in my procedure. At the time of creation of procedure I came to know that CASE statement won't work in my scenario. So I have tried two ways to perform same operations (using IF-ELSE-IF or GOTO) shown as below. Method 1 Using IF-ELSE-IF conditions: DECLARE @V_RuleId SMALLINT; IF (@V_RuleId = 1) BEGIN /*My business logic*/ END ELSE IF (@V_RuleId = 2) BEGIN /*My business logic*/ END ELSE IF (@V_RuleId = 3) BEGIN /*My business logic*/ END /* ... ... ... ...*/ ELSE IF (@V_RuleId = 19) BEGIN /*My business logic*/ END ELSE IF (@V_RuleId = 20) BEGIN /*My business logic*/ END Method 2 Using GOTO statement: DECLARE @V_RuleId SMALLINT, @V_Temp VARCHAR(100); SET @V_Temp = 'GOTO RULE' + CONVERT(VARCHAR, @V_RuleId); EXECUTE sp_executesql @V_Temp; RULE1: BEGIN /*My business logic*/ END RULE2: BEGIN /*My business logic*/ END RULE3: BEGIN /*My business logic*/ END /* ... ... ... ...*/ RULE19: BEGIN /*My business logic*/ END RULE20: BEGIN /*My business logic*/ END Today I have 20 rules. It can be increase to any number in future. If I can able to use CASE statement then I have not any problem with performance, but I can't do that so I am worried about the performance of my procedure. Also one thing to be noticed that this procedure will execute very frequently by application. My questions are: Is there any way to use CASE statement in my procedure? If not, which method is best to use in my procedure to improve the performance of my code? Thanks in advance...

    Read the article

  • onclose and onerror not getting called on DataChannel disconnect

    - by Will
    I have a wall application using WebRTC DataChannels. In the code I've managed to work out the connection, but I'm not getting notified when a peer disconnects. On the channels I have the following listeners: channels[uid].onerror = function( event ) { console.log( 'channels[uid].onerror', uid, arguments ) removePeer( uid ) } channels[uid].onclose = function() { console.log( 'channels[uid].onclose', uid, arguments ) removePeer( uid ) } When I reload tabs disconnecting peers, I don't get close messages. When I send to them, I don't get an error.

    Read the article

  • Redirect to login page automatically after some time

    - by ASD
    How can we redirect to login page automatically after some time? I have a requirement to redirect to login page if the current page is idle for 10 minutes in Java/JSP. I tried to use <meta http-equiv="refresh" content="120;url=./login.html"> tag. This works only when I click on any link but not automatically after 2 mins(120secs). Can anyone tell me how to redirect to login page automatically?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >