Daily Archives

Articles indexed Saturday September 8 2012

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

  • ViewPager resize height to Content

    - by user1324936
    ViewPager does not wrap its height to its content. For my layout I need to set the hight then dynamically because it is nested in other layouts. Therefore I created a ScrollView as content of the ViewPager and check its height in onCreate method of the Fragment, but the ScrollView has always the same size. How can I resize the ViewPager to fit to its content? final ScrollView sv = (ScrollView) v.findViewById(R.id.sv); ViewTreeObserver vto = scrollViewMenuFragen.getViewTreeObserver(); vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { int height = sv.getMeasuredHeight(); //always same height independent of content height //need to resize ViewPager ViewGroup.LayoutParams params = (ViewGroup.LayoutParams) mPager.getLayoutParams(); params.height = height; mPager.setLayoutParams(params); } });

    Read the article

  • Confusing alias mySQL

    - by Taylor
    I keep getting the same number outputted for the Total Sales, Minimum Sale, Largest Sale and Average Sale. The Total Invoices is working perfectly, but I cant seem to figure out how to fix the other ones. Here's the query: SELECT SUM( b.`Number of Invoices`) AS `Total Invoices`, SUM( b.`Total Customer Purchases`) AS `Total Sales`, MIN( b.`Total Customer Purchases`) AS `Minimum Sale`, MAX( b.`Total Customer Purchases`) AS `Largest Sale`, AVG( b.`Total Customer Purchases`) AS `Average Sale` FROM (SELECT a.CUS_CODE, COUNT(a.`Number of Invoices`) AS `Number of Invoices`, SUM(a.`Invoice Total`) AS `Total Customer Purchases` FROM ( SELECT CUS_CODE, LINE.INV_NUMBER AS `Number of Invoices`, SUM(LINE.LINE_UNITS * LINE.LINE_PRICE) AS `Invoice Total` FROM `ttriggs`.`INVOICE`, `ttriggs`.`LINE` WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER GROUP BY CUS_CODE, LINE.INV_NUMBER ) a ) b GROUP BY b.CUS_CODE; Heres the database diagram https://www.dropbox.com/s/b8cy5l29jwh8lyv/1_edit.jpg Subquery generates: CUS_CODE 10011 Number of Invoices 8 Total Customer Purchases 1119.03 Any help is greatly appreciated, Thanks!

    Read the article

  • ASP.Net WebSite Membership AND C# Windows Form Membership

    - by user1638362
    This is not real, it's just a project i'm working on I've created a Hotel Management system in C# WindowsForm, it allows staff members to Add/Edit/Update Rooms,Reservation and Customers etc. Along side this Windows-form i'm creating an ASP.net WebSite where customers should be able to register and reserve rooms online. I've come to the point where i need to create some-type of membership method for this website which should correspond to the membership of the windows form. However i'm not sure what method of membership would be best suited for this, i have looked into the asp.net membership, it's what i want however it creates it's own schema and i don't know how i can relate the information to my customers table and c#windows form. I would ideally like it to resemble a real-life situation as much as possible anyway, am i going about this the wrong way? in terms of the c# windows-form what other technology would a business use to manage a system like this where they can add/edit/update there system and have a website which relates. What are my options here?

    Read the article

  • printf not passing correct Hex Address to stack

    - by kriss
    I have a hickup in using printf . I am on ubuntu 10.04. Basically i have a C program asking for some input and then prints it back. It is OK for printing something after inputing. I tried to insert some Hex Address to Stack by following format:- printf "hello world!\x12\x23\x34" | ./input1 But i don't know what is the problem. If i give only string beyond 12 bytes it overwrites BUT If I give hex address(through printf), it doesn't overwrite on return address. Instead it stores some other thing. Could anyone help??? I can't proceed further becoz of this. Thanks in advance

    Read the article

  • read line by line the text file for make map in xna

    - by Mohammadali Najjar khodabakhsh
    i want to read a text file for build map; for example I have this map 0@0000000 0@0000000 0@0000000 000000000 000000000 000000000 000000000 I know I should use this : StreamReader reader = new StreamReader(Application.StartupPath+@"/TestMap.MMAP"); string line = reader.ReadToEnd(); reader.Close(); now for example I want read line 2 char "@". how can i do this? please help me. solve : Thank you (L.B AND user861114) at last my problem solve like this : string[,] item = new string[9, 7]; string[] line = File.ReadAllLines(Application.StartupPath + @"/TestMap.MMAP"); for (int j = 0; j < 7; j++) { for (int i = 0; i < 9; i++) { item[i, j] = line[j].Substring(i, 1); Console.WriteLine(i + " " + j + "=" + item[i, j]); } } thanks alot.

    Read the article

  • Set the path for the location of media files in program

    - by Zaheer Boovaji
    I have made a Java Swing Desktop application in Netbeans which can play media files I have put the videos in my workspace resources location and in my java program I am calling those media files using an URL which is something like this: C:/users/Dell/My Documents /NetBeansProjects/Media/src/resources/ MediaFiles/ddd.mpg This works well when I run in my IDE and also i have made Jar for this it works well on my computer but the problem is when i copy this jar file on my friends system the interface is coming but when I click a button to play a media file it says: C:/users/Dell/MyDocuments/NetBeansProjects/Media/src/resources/ MediaFiles/ddd.mpg does not exist So, please provide me a solution of how to set the default path so that when I run a jar file on other systems it should play the media file location I am passing as in my program. How to set the path for the location of media files in program? Update The videos are in the jar file.

    Read the article

  • Filter---after setting attribute--->Servlet---after getting and setting the attribute---->Jsp How do I do this?

    - by Y.E.P
    This is what I want to do : A servlet is called.Before a servlet is called , the request is intercepted by a filter. Filter gets some details out from the request,sets them as an attribute and the forwards it to a servlet via chain.doFilter(request,response). Request finally reaches the servlet. Servlet gets the attribute set by the filter before and sets a new attribute by another name. Then it forwards it to some jsp page where the page gets the attribute and processes it. How do I do this ? I know how to write a filter and a servlet but how do I forward it to a jsp page from the servlet or is there any other way to achieve this ?

    Read the article

  • How to run an equation along whole column in excel vba

    - by Elad Sommer
    I want to run an excel vba which will go down column E and upon finding the value = "capa" will go two cell below, calculate the hex2dec value of that cell, present it by the cell with the value "capa" in column F and continue to search down column E. So far I've came with the below but it doesn't work: For Each cell In Range("E:E") If cell.Value = "Capa" Then ActiveCell.Offset.FormulaR1C1 = "=HEX2DEC(R[2]C[-1])" End If Next cell Thanks!

    Read the article

  • A balanced binary search tree which is also a heap

    - by saeedn
    I'm looking for a data structure where each element in it has two keys. With one of them the structure is a BST and looking at the other one, data structure is a heap. With a little search, I found a structure called Treap. It uses the heap property with a random distribution on heap keys to make the BST balanced! What I want is a Balanced BST, which can be also a heap. The BST in Treap could be unbalanced if I insert elements with heap Key in the order of my choice. Is there such a data structure?

    Read the article

  • Sorting by key > 10 integer sequences. with thrust

    - by smilingbuddha
    I want to perform a sort_by_key where I have a single key-sequence and multiple value sequences. One usually performs this with sort_by_key( key, key + N, make_zip_iterator( make_tuple(x1 , x2 , ...) ) ) However I want to perform a sort with 10 sequences each of length N. Thrust does not support tuples of size = 10. So is there a way around this ? Of course one can keep a separate copy of the key vector and perform sorts on bunches of 10 sequences. But I would like to do everything in a single call.

    Read the article

  • CodeMirror Dynamic Syntax Validation

    - by rawr
    Been trying to decide between using CodeMirror or Ace editor. I've been leaning towards CodeMirror, however there's one feature of Ace that I really like and that is how it does syntax validation. So as I'm typing there can appear a warning or error icon in the left gutter area beside the line number, and when I hover over it it gives me a little description. Is there any way to get this functionality in CodeMirror? Specifically, I'm using the css mode for CodeMirror. It'd also be nice to be able to add in my own custom validation. Thanks.

    Read the article

  • The same C# code produces different output in Visio Professional and Premium

    - by user615993
    I have built a simple conversion Add In, but its behavior is unfortunately different with the different Visio Editions (Visio 2010 Professional and Visio 2010 Premium). The Add In takes a Process-Diagram created with Shapes from Stencil_1.vss and creates a new slightly different Process-Diagram with Shapes from Stencil_2.vsd. It loops through a Visio page and for each shape founded creates a new shapes from new master shape (from Stencil_2.vsd) and drop it into the new page. Geometry, captions etc. are the same, only the shape-appearance is changed. Below is the source diagram: When I run the code into Visio 2010 Professional the swimlane shapes are drawn correctly. When I run the same code from Visio Premium the swimlane appearance and layout are mismatched: Both times i drop the SAME Shape("Swimlane" from the same stencil) into the Page with the SAME Code fragment: Visio.Master vm = swimlane_stencil.Masters.get_ItemU(@"Swimlane"); Visio.Shape TargetShape = targetPage.Drop(vm, shape_x, shape_y); How could I ensure, that the code produces any time the same (correct) output? Must I disable any (premium)features in the swimlane-shapesheet?

    Read the article

  • Need Help on JavaScript to Trim

    - by MacpaLtd
    I am facing some problems with my server space. The images are using all the space from the server, making it slow. As it is an eCommerce website, it cannot be slow or we lose customers. If I have the following: SKU's : ABC123-001 > catName > Phone ABC753-851 > catName > MAC AT1233-098 > catName > PC How can I use trim to make it the following: SKU's : 123 > catName > Phone 753 > catName > MAC 1233 > catName > PC Which I would use in the following script: <script type="text/javascript"> $(function(){ var sku = $("#ProductBreadcrumb ul li:last").text(); $(".ProductThumbImage img").attr('src','http://img.example.com/images/'+catName+'/'+sku+'.jpg'); }); </script> So, basically, the output for the picture link would be: http://img.example.com/images/phone/123.jpg http://img.example.com/images/mac/753.jpg http://img.example.com/images/pc/1233.jpg So yeah, first problem I have to face is.. How can I trim it? I am not familiar with JavaScript so any help would be really appreciated :D

    Read the article

  • Rollback SQL Server 2012 Sequence

    - by VAAA
    I have a SQL Server 2012 Sequence object: /****** Create Sequence Object ******/ CREATE SEQUENCE TestSeq START WITH 1 INCREMENT BY 1; I have a SP that runs some queries inside a transaction: BEGIN TRAN SELECT NEXT VALUE FOR dbo.TestSeq <here all the query update code......> ROLLBACK TRAN If the transaction fails all the updates are rolledback without problem but the Sequence is not rolled back I guess because Its out of the scope of the transaction. Any clue on way to handle that? Thanks

    Read the article

  • Can't find AVD or SDK manager in Eclipse

    - by zigzag
    Seems like I'm having some problems after updating my android sdk tools and platform-tools using the sdk manager. The problem is that, after updating, I found that the avd or sdk options in the windows dropdown menu in eclipse are gone! And, I can't find any option to create an android project from file-new projects any more. I tried removing the ADT from eclipse and the software site "https://dl-ssl.google.com/android/eclipse/" from "available software sites" and then reinstalled the ADT from "https://dl-ssl.google.com/android/eclipse/" using help-install new software. The installation was successful, but I still don't have any option for shortcuts to the SDK manager or the AVD in eclipse, and neither can I create a new android project. By the way, the android perspectives are not gone, they are still here. Also, I can manually open the avd and sdk manager from the directory where I have installed them. Can anyone please show me a workaround? Any help would be greatly appreciated.

    Read the article

  • Operation not permitted when starting Unicorn

    - by fiskeben
    I've created an nginx/unicorn/capistrato setup on Ubuntu (Amazon EC2) by following mostly this guide. I guess everything is set up like it should but when I start Unicorn I get (a LOT of) this error in the log: E, [2012-09-08T08:57:20.658092 #12356] ERROR -- : Operation not permitted (Errno::EPERM) /home/deployer/apps/bridgekalenderen.no/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/worker.rb:82:in `initgroups' I see it's related to the user's permissions but I just can't figure out what I've left out. The server starts up nicely if I start it with sudo (or, rvmsudo, really). The user has sudo capabilities, I have chmod'ed the app several times so the file permissions there should be ok. The unicorn socket in /tmp is owned by the deployer user, so that shouldn't be the problem either. Does anybody have a clue where to look?

    Read the article

  • Do I need to update some of my Debian Squeeze software?

    - by stan31337
    I have installed Debian 6, and LAMP stack from squeeze repository (default). After upgrading Apache 2.2.16 from unstable repository to 2.2.22, thanks to this post - how to upgrade already installed apache2 on debian (lenny) I'm thinking to upgrade all other software packages that I've previously installd from squeeze repository. Should I upgrade them to the ones from unstable repository? Should I upgrade all of them or just selected ones? Here's the list: * arno-iptables-firewall 1.9.2.k-4 >> 2.0.1.c-1 * bind9 1:9.7.3.dfsg-1~squeeze6 >> 1:9.8.1.dfsg.P1-4.2 * php-apc 3.1.3p1-2 >> 3.1.13-1 * fail2ban 0.8.4-3+squeeze1 >> 0.8.6-3 * exim4 4.72-6+squeeze2 >> 4.80-4 * altermime 0.3.10-4 >> 0.3.10-7 * rrdtool 1.4.3-1 >> 1.4.7-2 * vsftpd 2.3.2-3+squeeze2 >> 3.0.0-4 Also I would like to ask how to upgrade 5.3.3 5.3.16, unstable repository has 5.4.x versions only, I don't think I'm ready to move from 5.3 to 5.4 yet. Actually I'm a newbie in Linux, and after Windows experience I have a paranoidal idea to update software to the latest release. I'd be glad for any suggestions and recommendations! Thank you very much!

    Read the article

  • .NET not processing an XML file in IIS

    - by Stuart McIntosh
    We have 2 servers, 1 already configured with .net which works fine and a new one which appears to be configured the same but when I open an xml page in Internet Explorer it complains about the <% tag. We have IIS on win srvr 2003 SP2. The website is configured with .NET 1.1.4322. In ISAPI extensions have set the .XML extension to use c:\windows\microsoft.net\framework\v1.1.4322\aspnet_isapi.dll But the page: <property name="documentmaxage" value="0"/> <property name="documentmaxstale" value="0"/> <var name="m_Prompt_Path" /> <form id="InitVoiceXmlDoc"> <block> <assign name="m_Prompt_Path" expr="&quot;<% Response.Write(Request.QueryString["m_Prompt_Path"]); %>&quot;"/> </block> </form> gives the error: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. The character '<' cannot be used in an attribute value. Error processing resource 'http://localhost:11119/fails.xml'. Lin... &quo... We have the same config on another server which works fine. So are there other options apart from the ISAPI extensions that I need to look at. If I suffix the page .aspx, of course it works fine.

    Read the article

  • Apache/Varnish/PHP: Just to confirm, is it possible to automatically update $_SERVER['REMOTE_ADDR'] to have the real client's IP?

    - by user1284857
    I just cannot seem to get the real client IP to show in PHP's $_SERVER['REMOTE_ADDR']. It shows in $_SERVER['X_FORWARDED_FOR'], but the $_SERVER['REMOTE_ADDR'] always points to the Varnish service IP. I've played around with just about every Varnish vcl suggestion I could find. I've installed Apache module mod_rpaf. But I still cannot get $_SERVER['REMOTE_ADDR'] to reflect the client's real IP... So my question is, is this even possible? Does everyone who uses Varnish have to do something like this for all PHP applications?: $_SERVER['REMOTE_ADDR'] = $_SERVER['X_FORWARDED_FOR']; Or am I simply not configuring it correctly?

    Read the article

  • XAMPP Closes the connection

    - by Miro Markarian
    I want my XAMPP Apache server to host a file (The file is around 250mb) but the server closes the connection and won't let me download the file? Does xampp or apache have any download size limit or something? Tested with a smaller file , the problem is still present. It just doesn't let me download any file from the server.!!! All I get in the error log is this: Fri Sep 07 23:21:31.742625 2012] [authz_core:debug] [pid 3664:tid 396] mod_authz_core.c(808): [client x.x.x.x:23409] AH01628: authorization result: granted (no directives), referer: http://ammiprox.tk/greeneyes2910/

    Read the article

  • Force request to miss cache but still store the response

    - by Tom Marthenal
    I have a slow web app that I've placed Varnish in front of. All of the pages are static (they don't vary for a different user), but they need to be updated every 5 minutes so they contain recent data. I have a simple script (wget --mirror) that crawls the entire website every 15 minutes. Each crawl takes about 5 minutes. The point of the crawl is to update every page in the Varnish cache so that a user never has to wait for the page to generate (since all pages have been generated recently thanks to the spider). The timeline looks like this: 00:00:00: Cache flushed 00:00:00: Spider starts crawling to update cache with new pages 00:05:00: Spider finishes crawling, all pages are updated until 1:15 A request that comes in between 0:00:00 and 0:05:00 might hit a page that hasn't been updated yet, and will be forced to wait a few seconds for a response. This isn't acceptable. What I'd like to do is, perhaps using some VCL magic, always foward requests from the spider to the backend, but still store the response in the cache. This way, a user will never have to wait for a page to generate since there is no 5-minute window in which parts of the cache are empty (except perhaps at server startup). How can I do this?

    Read the article

  • DNS Round-robin, Load Balancing, Load sharing, and failover in 2012

    - by user1089770
    I have been reading many posts on serverfault as well as on other sites regarding all these. What I understand is, Multiple A records(round-robin dns) can be used for both : Load sharing (round-robin, but NOT load-balancing). Many people say that “Load Balancing” but I think there will be no load-balancing because “Balance” means (literally) “compare two(or more) and adjust” (and that is what Real s/w or h/w Load balancers do) but Browsers never do this, instead they randomly select and IP and connect to it. It doesn't have any knowledge about the current load of that server (probably, the IP it picked had the highest load!). Automatic failover (latest browsers only). Yes, I think DNS can be used as a simple failover system (at least in 2012, I dont know when it actually "came in effect"). please refer to : http://webmasters.stackexchange.com/questions/10927/using-multiple-a-records-for-my-domain-do-web-browsers-ever-try-more-than-one and Browser-based DNS failover using multiple A records and http://www.nber.org/sys-admin/dns-failover.html I would like to make sure my assumptions/findings are right. So let me know please.....

    Read the article

  • Active Directory - Using GPO To Update Multiple Versions Of .NET

    - by Joe Wilson
    OK, I have searched everywhere for this one. I have all the MSI's and packages I need to deploy .Net 3.5 SP1, and 2.0 and 3.0 (which are prerequisites for 3.5). I can't figure out how to install all of them at once via GPO. Basically, the computers on the network do NOT have any version of .Net installed, and I need them to be at 3.5 SP1. I know I can deploy each version via GPO, force reboot the client, then push the next one, force reboot, and so on. Is there a way to streamline install all 3 at once via GPO? Thanks

    Read the article

  • Replacing sick NTP server source and re-synching (with internal time currently 2 minutes late)

    - by l0c0b0x
    One of the external NTP servers (the primary one--currently) we're using as source seems to not be responding to NTP calls. Unfortunately, on our core router (Cisco 6509), the NTP functionality hasn't switched to the secondary NTP external server as it was expected. As a result, our core router which is pretty much our main internal NTP source is 2 minutes late. I'm planning to fix the external router issue by making the external NTP source be the one currently working. I'm wondering, how much will a 2 minute change affect my users and services? Specially since these days, we're heavily relying on certificate-based authentication. We're a Windows/Cisco shop. Internal NTP setup: [Core Router 1 / Cisco 6509]: looking out to two external NTP servers (in which the primary one is not responding to NTP calls) [Core Router 2]: Synching with Core router 1 (primary), working external router (secondary) [Other Cisco network devices]: Synching with Core router 1 (primary), core router 2 (secondary) [Domain controller(s)]: Synching with Core router 1 [All windows clients/servers]: Synching with domain controllers

    Read the article

  • iptables redirect single website traffic to port 8080

    - by Luke John Southard
    My goal is to be able to make a connection to one, and only one, website through a proxy. Everything else should be dropped. I have been able to do this successfully without a proxy with this code: ./iptables -I INPUT 1 -i lo -j ACCEPT ./iptabels -A OUTPUT -p udp --dport 53 -j ACCEPT ./iptables -A OUTPUT -p tcp -d www.website.com --dport 80 -j ACCEPT ./iptables -A INPUT -m conntrack --cstate ESTABLISHED,RELATED -j ACCEPT ./iptables -P INPUT DROP ./iptables -P OUTPUT DROP How could I do the same thing except redirect the traffic to port 8080 somewhere? I've been trying to redirect in the PREROUTING chain in the nat table. I'm unsure if this is the proper place to do that tho. Thanks for your help!

    Read the article

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