Search Results

Search found 478 results on 20 pages for 'md abdul munim'.

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

  • Need AngularJS grid resizing directive to resize "thumbnail" that contains no image

    - by thebravedave
    UPDATE Plunker to project: http://plnkr.co/edit/oKB96szQhqwpKQbOGUDw?p=preview I have an AngularJS project that uses AngularJS Bootstrap grids. I need all of the grid elements to have the same size so they stack properly. I created an angularJs directive that auto resizes the grid element when placed in said grid element. I have 2 directives that do this for me Directive 1: onload Directive 2: imageonload Directive 2 works. If the grid element uses an image, after the image loads then the directive triggers an event that sends the grid elements height to all other grid elements. If that height sent out via the event is greater than that of the grid element which is listening to the event then that listening grid element changes it's height to be the greater height. This way the largest height becomes the height for all the grid elements. Directive 1 does not work. This one is placed on the outer most grid elements html element, and is triggered when the element loads. The problem is that when the element loads and the onload directive is called AngularJS has not yet filled out the data in said grid element. The outcome is that the real height after AngularJS data binds is not broadcast as an event. My only solution I have thought of (but haven't tried) is to add an image url to an image that exists but doesn't have any data in it, and place that in the grid element (the one that didn't have any images before placing the blank one in). I could then call imageonload instead of onload and I pretty sure the angularjs data binding will have taken place by then. the problem is that that is pretty hacky. I would rather be able to have not an image in the grid element, and be able to call my custom onload directive and have the onload directive calculate the height AFTER angularJS data binds to all of the data binding variables in the grid element. Here is my imageonload directive .directive('imageonload', function($rootScope) { return { restrict: 'A', link: function(scope, element, attrs) { scope.heightArray = []; scope.largestHeight = 50; element.bind('load', function() { broadcastThumbnailHeight(); }); scope.$on('imageOnLoadEvent', function(caller, value){ var el = angular.element(element); var id = el.prop('id'); var pageName = el.prop('title'); if(pageName == value[0]){ if(scope.largestHeight < value[1]){ scope.largestHeight = value[1]; var nestedString = el.prop('alt'); if(nestedString == "") nestedString = "1"; var nested = parseInt(nestedString); nested = nested - 1; var inte = 0; var thumbnail = el["0"]; var finalThumbnailContainer = thumbnail.parentElement; while(inte != nested){ finalThumbnailContainer = finalThumbnailContainer.parentElement; inte++; } var innerEl = angular.element(finalThumbnailContainer); var height = value[1]; innerEl.height(height); } } }); scope.$on('findHeightAndBroadcast', function(){ broadcastThumbnailHeight(); }); scope.$on('resetThumbnailHeight', function(){ scope.largestHeight = 50; }); function broadcastThumbnailHeight(){ var el = angular.element(element); var id = el.prop('id'); var alt = el.prop('alt'); if(alt == "") alt = "1"; var nested = parseInt(alt); nested = nested - 1; var pageName = el.prop('title'); var inte = 1; var thumbnail = el["0"]; var finalThumbnail = thumbnail.parentElement; while(inte != nested){ finalThumbnail = finalThumbnail.parentElement; inte++; } var elZero = el["0"]; var clientHeight = finalThumbnail.clientHeight; var arr = []; arr[0] = pageName; arr[1] = clientHeight; $rootScope.$broadcast('imageOnLoadEvent', arr); } } }; }) And here is my onload directive .directive('onload', function($rootScope) { return { restrict: 'A', link: function(scope, element, attrs) { scope.largestHeight=100; getHeightAndBroadcast(); scope.$on('onLoadEvent', function(caller, value){ var el = angular.element(element); var id = el.prop('id'); var pageName = el.prop('title'); if(pageName == value[0]){ if(scope.largestHeight < value[1]){ scope.largestHeight = value[1]; var height = value[1]; el.height(height); } } }); function getHeightAndBroadcast(){ var el = angular.element(element); var h = el["0"].children; var thumbnailHeightElement = angular.element(h); var pageName = el.prop("title"); var clientHeight = thumbnailHeightElement["0"].clientHeight; var arr = []; arr[0] = pageName; arr[1] = clientHeight; if(clientHeight != undefined) $rootScope.$broadcast('onLoadEvent', arr); } } }; }) Here is an example of one of my grid elements that uses imageonload. Note the imageonload directive in the image html element. This works. There is also an onload directive on the outer most html of the grid element. That does not work. I have stepped through this carefully in Firebug and saw that the onload was calculating the height before AngularJS data binding was complete. <div class="thumbnail col-md-3" id="{{product.id}}" title="thumbnailAdminProductsGrid" onload> <div class="row"> <div class="containerz"> <div class="row-fluid"> <div class="col-md-2"></div> <div class="col-md-7"> <div class="textcenterinline"> <!--tag--><img class="img-responsive" id="{{product.id}}" title="imageAdminProductsGrid" alt=6 ng-src="{{product.baseImage}}" imageonload/><!--end tag--> </div> </div> </div> <div class="caption"> <div class="testing"> <div class="row-fluid"> <div class="col-md-12"> <h3 class=""> <!--tag--><a href="javascript:void(0);" ng-click="loadProductView('{{product.id}}')">{{product.name}}</a><!--end tag--> </h3> </div> </div> <div class="row-fluid"> <div class="col-md-12"> <p class="lead"><!--tag--> {{product.price}}</p><!--end tag--> </div> </div> <div class="row-fluid"> <div class="col-md-12"> <p><!--tag-->{{product.inStock}} units available<!--end tag--></p> </div> </div> <div class="row-fluid"> <div class="col-md-12"> <p class=""><!--tag-->{{product.generalDescription}}<!--end tag--></p> </div> </div> <!--tag--> <div data-ng-if="product.specialized=='true'"> <div class="row-fluid"> <div class="col-md-12" ng-repeat="varCat in product.varietyCategoriesAndOptions"> <b><h4>{{varCat.varietyCategoryName}}</h4></b> <select ng-model="varCat.varietyCategoryOption" ng-options="value.varietyCategoryOptionId as value.varietyCategoryOptionValue for (key,value) in varCat.varietyCategoryOptions"> </select> </div> </div> </div> <!--end tag--> <div class="row-fluid"> <div class="col-md-12"> <!--tag--><div ng-if="product.weight==0"><b>Free Shipping</b></div><!--end tag--> </div> </div> </div> </div> </div> </div> Here is an example of one of the html for one of my grid elements that only uses the "onload" directive and not "imageonload" <div class="thumbnail col-md-3" title="thumbnailCouponGrid" onload> <div class="innnerContainer"> <div class="text-center"> {{coupon.name}} <br /> <br /> <b>Description</b> <br /> {{coupon.description}} <br /> <br /> <button class="btn btn-large btn-primary" ng-click="goToCoupon()">View Coupon Details</button> </div> </div> The imageonload function might look a little confusing because I use the img html attribute "alt" to signal to the directive how many levels the imageonload is placed below the outermost html for the grid element. We have to have this so the directive knows which html element to set the new height on. also I use the "title" attribute to set which grid this grid resizing is for (that way you can use the directive multiple times on the same page for different grids and not have the events for the wrong grid triggered). Does anyone know how I can get the "onload" directive to get called AFTER angularJS binds to the grid element? Just for completeness here are 2 images (almost looks like just 1), the second is a grid that contains grid elements that have images and use the "imageonload" directive and the first is a grid that contains grid elements that do not use images and only uses the "onload" directive.

    Read the article

  • How to create a custom ADO Multi Dimensional Catalog with no database

    - by Alan Clark
    Does anyone know of an example of how to dynamically define and build ADO MD (ActiveX Data Objects Multidimensional) catalogs and cube definitions with a set of data other than a database? Background: we have a huge amount of data in our application that we export to a database and then query using the usual SQL joins, groups, sums etc to produce reports. The data in the application is originally in objects and arrays. The problem is the amount of data is so large the export can take 2 hours. So I am trying to figure out a good way of querying the objects in memory, either by a custom OLAP algorithm or library, or ADO MD. But I haven't been able to find an example of using ADO MD without a database behind it. We are using Delphi 2010 so would use ADO ActiveX but I imagine the ADO.NET MD is similar. I realize that if the application data was already stored in a database the problem would solve itself. Also if Delphi had LINQ capability I could query the objects and arrays that way.

    Read the article

  • How to create a custom ADO Multi Demensional Catalog with no database

    - by Alan Clark
    Does anyone know of an example of how to dynamically define and build ADO MD (ActiveX Data Objects Multidimensional) catalogs and cube definitions with a set of data other than a database? Background: we have a huge amount of data in our application that we export to a database and then query using the usual SQL joins, groups, sums etc to produce reports. The data in the application is originally in objects and arrays. The problem is the amount of data is so large the export can take 2 hours. So I am trying to figure out a good way of querying the objects in memory, either by a custom OLAP algorithm or library, or ADO MD. But I haven't been able to find an example of using ADO MD without a database behind it. We are using Delphi 2010 so would use ADO ActiveX but I imagine the ADO.NET MD is similar. I realize that if the application data was already stored in a database the problem would solve itself. Also if Delphi had LINQ capability I could query the objects and arrays that way.

    Read the article

  • asp.net mvc user control problem foreach loop

    - by mazhar
    Previous post <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" % <% MvcApplication1.Models.FeaturesRepository _model = new MvcApplication1.Models.FeaturesRepository(); % <% foreach (var md in _model.GetAllFeatures()) { % <%--<% if (md.int_ParentId == 0) { %--% <%= md.vcr_FeaturesName % <%--<% } %--% <% } % It is with reference to the previous post above.Is there something wrong with the foreach loop(The result is correct but it is displaying the series of Add,Add,Add,Add,Add,Add...,which is the last record of the getallfeatures.

    Read the article

  • Redirect/rewrite dynamic URL to sub-domain and create DNS for subdomain

    - by Abdul Majeed
    I have created an application in PHP, I would like to re-direct the following URL to corresponding sub-domain. Dynamic URL pattern: http://mydomain.com/mypage.php?user_name=testuser I wish to re-direct this to the corresponding sub domain: http://testuser.mydomain.com/ How do I create a rewrite rule for this purpose? How do I register DNS for sub-domain without using CPANEL? (I want to activate sub-domain when the user registers to the system.)

    Read the article

  • Store a formula in a table and use the formula in a javascript/PHP function

    - by Muhaimin Abdul
    I have a MySql database where part of it handles instrument's depth of water. Each instrument has its own formula of calculation how depth the water when the operator collect the reading I stored the formula for each instrument in database/MySql. Example formula: [55-57] this is the simple minus operation, where the number is actually represent the id of a row. How do I represent those number with id of a row and later convert it to javascript readable code. I simply want to do keyup event where everytime user key in something into text field then the other part of HTML would reflect changes based on formula that I fetched from database FYI, I'm using BackboneJS together with RequireJS

    Read the article

  • Dell xps l502 optimus ... stuck at black screen after installing bumblebee

    - by Abdul Azzawi
    I am facing a problem after installing bumblebee when I try to start ubuntu normally the device get stuck on a black screen Can any one help me with the right configuration for the graphic card ... All i need is to run with full desktop effects currently even compizconfig effects arent working Also what should I have in the blacklist or is it correct the way bumblebee does it Running ubuntu Natty 11.04 32 bit Thanks

    Read the article

  • How to setup a Wireless Access-Point using my laptop's WiFi card?

    - by Abdul Karim Memon
    want to share my Laptops (running Ubuntu 10.10) Broadband with my Android (Galaxy Mini) running 2.2.1. Since Androids currently do not support ad-hoc networks so the "Create new wireless network.." won't help. Q1) How do i setup a Wireless Access Point using my Laptops WiFi card? Q2) What is the difference between an "ad-hoc" network and an "access point"? **abdulkarim@aK-laptop**:~$ lspci | grep ireless 03:00.0 Network controller: Atheros Communications Inc. AR9287 Wireless Network Adapter (PCI-Express) (rev 01) iw list Wiphy phy0 Band 1: Capabilities: 0x11ce HT20/HT40 SM Power Save disabled RX HT40 SGI TX STBC RX STBC 1-stream Max AMSDU length: 7935 bytes DSSS/CCK HT40 Maximum RX AMPDU length 65535 bytes (exponent: 0x003) Minimum RX AMPDU time spacing: 8 usec (0x06) HT TX/RX MCS rate indexes supported: 0-15 Frequencies: * 2412 MHz [1] (20.0 dBm) * 2417 MHz [2] (20.0 dBm) * 2422 MHz [3] (20.0 dBm) * 2427 MHz [4] (20.0 dBm) * 2432 MHz [5] (20.0 dBm) * 2437 MHz [6] (20.0 dBm) * 2442 MHz [7] (20.0 dBm) * 2447 MHz [8] (20.0 dBm) * 2452 MHz [9] (20.0 dBm) * 2457 MHz [10] (20.0 dBm) * 2462 MHz [11] (20.0 dBm) * 2467 MHz [12] (20.0 dBm) (passive scanning) * 2472 MHz [13] (20.0 dBm) (passive scanning) * 2484 MHz [14] (disabled) Bitrates (non-HT): * 1.0 Mbps * 2.0 Mbps (short preamble supported) * 5.5 Mbps (short preamble supported) * 11.0 Mbps (short preamble supported) * 6.0 Mbps * 9.0 Mbps * 12.0 Mbps * 18.0 Mbps * 24.0 Mbps * 36.0 Mbps * 48.0 Mbps * 54.0 Mbps max # scan SSIDs: 4 Supported interface modes: * IBSS * managed * ** AP * AP/VLAN** * monitor * mesh point Supported commands: * new_interface * set_interface * new_key * new_beacon * new_station * new_mpath * set_mesh_params * set_bss * authenticate * associate * deauthenticate * disassociate * join_ibss * Unknown command (55) * Unknown command (57) * Unknown command (59) * set_wiphy_netns * Unknown command (65) * connect * disconnect

    Read the article

  • Cannot open root device xvda1 or unknown-block(0,0)

    - by svoop
    I'm putting together a Dom0 and three DomU (all Gentoo) with kernel 3.5.7 and Xen 4.1.1. Each Dom has it's own md (md0 for Dom0, md1 for Dom1 etc). Dom0 works fine so far, however, I'm stuck trying to create DomUs. It appears the xvda1 device on DomU is not created or accessible: Parsing config file dom1 domainbuilder: detail: xc_dom_allocate: cmdline="root=/dev/xvda1 console=hvc0 root=/dev/xvda1 ro 3", features="(null)" domainbuilder: detail: xc_dom_kernel_mem: called domainbuilder: detail: xc_dom_boot_xen_init: ver 4.1, caps xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 domainbuilder: detail: xc_dom_parse_image: called domainbuilder: detail: xc_dom_find_loader: trying multiboot-binary loader ... domainbuilder: detail: loader probe failed domainbuilder: detail: xc_dom_find_loader: trying Linux bzImage loader ... domainbuilder: detail: xc_dom_malloc : 10530 kB domainbuilder: detail: xc_dom_do_gunzip: unzip ok, 0x2f7a4f -> 0xa48888 domainbuilder: detail: loader probe OK xc: detail: elf_parse_binary: phdr: paddr=0x1000000 memsz=0x558000 xc: detail: elf_parse_binary: phdr: paddr=0x1558000 memsz=0x690e8 xc: detail: elf_parse_binary: phdr: paddr=0x15c2000 memsz=0x127c0 xc: detail: elf_parse_binary: phdr: paddr=0x15d5000 memsz=0x533000 xc: detail: elf_parse_binary: memory: 0x1000000 -> 0x1b08000 xc: detail: elf_xen_parse_note: GUEST_OS = "linux" xc: detail: elf_xen_parse_note: GUEST_VERSION = "2.6" xc: detail: elf_xen_parse_note: XEN_VERSION = "xen-3.0" xc: detail: elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000 xc: detail: elf_xen_parse_note: ENTRY = 0xffffffff815d5210 xc: detail: elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff81001000 xc: detail: elf_xen_parse_note: FEATURES = "!writable_page_tables|pae_pgdir_above_4gb" xc: detail: elf_xen_parse_note: PAE_MODE = "yes" xc: detail: elf_xen_parse_note: LOADER = "generic" xc: detail: elf_xen_parse_note: unknown xen elf note (0xd) xc: detail: elf_xen_parse_note: SUSPEND_CANCEL = 0x1 xc: detail: elf_xen_parse_note: HV_START_LOW = 0xffff800000000000 xc: detail: elf_xen_parse_note: PADDR_OFFSET = 0x0 xc: detail: elf_xen_addr_calc_check: addresses: xc: detail: virt_base = 0xffffffff80000000 xc: detail: elf_paddr_offset = 0x0 xc: detail: virt_offset = 0xffffffff80000000 xc: detail: virt_kstart = 0xffffffff81000000 xc: detail: virt_kend = 0xffffffff81b08000 xc: detail: virt_entry = 0xffffffff815d5210 xc: detail: p2m_base = 0xffffffffffffffff domainbuilder: detail: xc_dom_parse_elf_kernel: xen-3.0-x86_64: 0xffffffff81000000 -> 0xffffffff81b08000 domainbuilder: detail: xc_dom_mem_init: mem 5000 MB, pages 0x138800 pages, 4k each domainbuilder: detail: xc_dom_mem_init: 0x138800 pages domainbuilder: detail: xc_dom_boot_mem_init: called domainbuilder: detail: x86_compat: guest xen-3.0-x86_64, address size 64 domainbuilder: detail: xc_dom_malloc : 10000 kB domainbuilder: detail: xc_dom_build_image: called domainbuilder: detail: xc_dom_alloc_segment: kernel : 0xffffffff81000000 -> 0xffffffff81b08000 (pfn 0x1000 + 0xb08 pages) domainbuilder: detail: xc_dom_pfn_to_ptr: domU mapping: pfn 0x1000+0xb08 at 0x7fdec9b85000 xc: detail: elf_load_binary: phdr 0 at 0x0x7fdec9b85000 -> 0x0x7fdeca0dd000 xc: detail: elf_load_binary: phdr 1 at 0x0x7fdeca0dd000 -> 0x0x7fdeca1460e8 xc: detail: elf_load_binary: phdr 2 at 0x0x7fdeca147000 -> 0x0x7fdeca1597c0 xc: detail: elf_load_binary: phdr 3 at 0x0x7fdeca15a000 -> 0x0x7fdeca1cd000 domainbuilder: detail: xc_dom_alloc_segment: phys2mach : 0xffffffff81b08000 -> 0xffffffff824cc000 (pfn 0x1b08 + 0x9c4 pages) domainbuilder: detail: xc_dom_pfn_to_ptr: domU mapping: pfn 0x1b08+0x9c4 at 0x7fdec91c1000 domainbuilder: detail: xc_dom_alloc_page : start info : 0xffffffff824cc000 (pfn 0x24cc) domainbuilder: detail: xc_dom_alloc_page : xenstore : 0xffffffff824cd000 (pfn 0x24cd) domainbuilder: detail: xc_dom_alloc_page : console : 0xffffffff824ce000 (pfn 0x24ce) domainbuilder: detail: nr_page_tables: 0x0000ffffffffffff/48: 0xffff000000000000 -> 0xffffffffffffffff, 1 table(s) domainbuilder: detail: nr_page_tables: 0x0000007fffffffff/39: 0xffffff8000000000 -> 0xffffffffffffffff, 1 table(s) domainbuilder: detail: nr_page_tables: 0x000000003fffffff/30: 0xffffffff80000000 -> 0xffffffffbfffffff, 1 table(s) domainbuilder: detail: nr_page_tables: 0x00000000001fffff/21: 0xffffffff80000000 -> 0xffffffff827fffff, 20 table(s) domainbuilder: detail: xc_dom_alloc_segment: page tables : 0xffffffff824cf000 -> 0xffffffff824e6000 (pfn 0x24cf + 0x17 pages) domainbuilder: detail: xc_dom_pfn_to_ptr: domU mapping: pfn 0x24cf+0x17 at 0x7fdece676000 domainbuilder: detail: xc_dom_alloc_page : boot stack : 0xffffffff824e6000 (pfn 0x24e6) domainbuilder: detail: xc_dom_build_image : virt_alloc_end : 0xffffffff824e7000 domainbuilder: detail: xc_dom_build_image : virt_pgtab_end : 0xffffffff82800000 domainbuilder: detail: xc_dom_boot_image: called domainbuilder: detail: arch_setup_bootearly: doing nothing domainbuilder: detail: xc_dom_compat_check: supported guest type: xen-3.0-x86_64 <= matches domainbuilder: detail: xc_dom_compat_check: supported guest type: xen-3.0-x86_32p domainbuilder: detail: xc_dom_compat_check: supported guest type: hvm-3.0-x86_32 domainbuilder: detail: xc_dom_compat_check: supported guest type: hvm-3.0-x86_32p domainbuilder: detail: xc_dom_compat_check: supported guest type: hvm-3.0-x86_64 domainbuilder: detail: xc_dom_update_guest_p2m: dst 64bit, pages 0x138800 domainbuilder: detail: clear_page: pfn 0x24ce, mfn 0x37ddee domainbuilder: detail: clear_page: pfn 0x24cd, mfn 0x37ddef domainbuilder: detail: xc_dom_pfn_to_ptr: domU mapping: pfn 0x24cc+0x1 at 0x7fdece675000 domainbuilder: detail: start_info_x86_64: called domainbuilder: detail: setup_hypercall_page: vaddr=0xffffffff81001000 pfn=0x1001 domainbuilder: detail: domain builder memory footprint domainbuilder: detail: allocated domainbuilder: detail: malloc : 20658 kB domainbuilder: detail: anon mmap : 0 bytes domainbuilder: detail: mapped domainbuilder: detail: file mmap : 0 bytes domainbuilder: detail: domU mmap : 21392 kB domainbuilder: detail: arch_setup_bootlate: shared_info: pfn 0x0, mfn 0xbaa6f domainbuilder: detail: shared_info_x86_64: called domainbuilder: detail: vcpu_x86_64: called domainbuilder: detail: vcpu_x86_64: cr3: pfn 0x24cf mfn 0x37dded domainbuilder: detail: launch_vm: called, ctxt=0x7fff224e4ea0 domainbuilder: detail: xc_dom_release: called Daemon running with PID 4639 [ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 3.5.7-gentoo (root@majordomo) (gcc version 4.5.4 (Gentoo 4.5.4 p1.0, pie-0.4.7) ) #1 SMP Tue Nov 20 10:49:51 CET 2012 [ 0.000000] Command line: root=/dev/xvda1 console=hvc0 root=/dev/xvda1 ro 3 [ 0.000000] ACPI in unprivileged domain disabled [ 0.000000] e820: BIOS-provided physical RAM map: [ 0.000000] Xen: [mem 0x0000000000000000-0x000000000009ffff] usable [ 0.000000] Xen: [mem 0x00000000000a0000-0x00000000000fffff] reserved [ 0.000000] Xen: [mem 0x0000000000100000-0x0000000138ffffff] usable [ 0.000000] NX (Execute Disable) protection: active [ 0.000000] MPS support code is not built-in. [ 0.000000] Using acpi=off or acpi=noirq or pci=noacpi may have problem [ 0.000000] DMI not present or invalid. [ 0.000000] No AGP bridge found [ 0.000000] e820: last_pfn = 0x139000 max_arch_pfn = 0x400000000 [ 0.000000] e820: last_pfn = 0x100000 max_arch_pfn = 0x400000000 [ 0.000000] init_memory_mapping: [mem 0x00000000-0xffffffff] [ 0.000000] init_memory_mapping: [mem 0x100000000-0x138ffffff] [ 0.000000] NUMA turned off [ 0.000000] Faking a node at [mem 0x0000000000000000-0x0000000138ffffff] [ 0.000000] Initmem setup node 0 [mem 0x00000000-0x138ffffff] [ 0.000000] NODE_DATA [mem 0x1387fc000-0x1387fffff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x00010000-0x00ffffff] [ 0.000000] DMA32 [mem 0x01000000-0xffffffff] [ 0.000000] Normal [mem 0x100000000-0x138ffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x00010000-0x0009ffff] [ 0.000000] node 0: [mem 0x00100000-0x138ffffff] [ 0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs [ 0.000000] No local APIC present [ 0.000000] APIC: disable apic facility [ 0.000000] APIC: switched to apic NOOP [ 0.000000] e820: cannot find a gap in the 32bit address range [ 0.000000] e820: PCI devices with unassigned 32bit BARs may break! [ 0.000000] e820: [mem 0x139100000-0x1394fffff] available for PCI devices [ 0.000000] Booting paravirtualized kernel on Xen [ 0.000000] Xen version: 4.1.1 (preserve-AD) [ 0.000000] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:1 nr_node_ids:1 [ 0.000000] PERCPU: Embedded 26 pages/cpu @ffff880138400000 s75712 r8192 d22592 u2097152 [ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 1259871 [ 0.000000] Policy zone: Normal [ 0.000000] Kernel command line: root=/dev/xvda1 console=hvc0 root=/dev/xvda1 ro 3 [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes) [ 0.000000] __ex_table already sorted, skipping sort [ 0.000000] Checking aperture... [ 0.000000] No AGP bridge found [ 0.000000] Memory: 4943980k/5128192k available (3937k kernel code, 448k absent, 183764k reserved, 1951k data, 524k init) [ 0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] Hierarchical RCU implementation. [ 0.000000] NR_IRQS:4352 nr_irqs:256 16 [ 0.000000] Console: colour dummy device 80x25 [ 0.000000] console [tty0] enabled [ 0.000000] console [hvc0] enabled [ 0.000000] installing Xen timer for CPU 0 [ 0.000000] Detected 3411.602 MHz processor. [ 0.000999] Calibrating delay loop (skipped), value calculated using timer frequency.. 6823.20 BogoMIPS (lpj=3411602) [ 0.000999] pid_max: default: 32768 minimum: 301 [ 0.000999] Security Framework initialized [ 0.001355] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes) [ 0.002974] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes) [ 0.003441] Mount-cache hash table entries: 256 [ 0.003595] Initializing cgroup subsys cpuacct [ 0.003599] Initializing cgroup subsys freezer [ 0.003637] ENERGY_PERF_BIAS: Set to 'normal', was 'performance' [ 0.003637] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8) [ 0.003643] CPU: Physical Processor ID: 0 [ 0.003645] CPU: Processor Core ID: 0 [ 0.003702] SMP alternatives: switching to UP code [ 0.011791] Freeing SMP alternatives: 12k freed [ 0.011835] Performance Events: unsupported p6 CPU model 42 no PMU driver, software events only. [ 0.011886] Brought up 1 CPUs [ 0.011998] Grant tables using version 2 layout. [ 0.012009] Grant table initialized [ 0.012034] NET: Registered protocol family 16 [ 0.012328] PCI: setting up Xen PCI frontend stub [ 0.015089] bio: create slab <bio-0> at 0 [ 0.015158] ACPI: Interpreter disabled. [ 0.015180] xen/balloon: Initialising balloon driver. [ 0.015180] xen-balloon: Initialising balloon driver. [ 0.015180] vgaarb: loaded [ 0.016126] SCSI subsystem initialized [ 0.016314] PCI: System does not support PCI [ 0.016320] PCI: System does not support PCI [ 0.016435] NetLabel: Initializing [ 0.016438] NetLabel: domain hash size = 128 [ 0.016440] NetLabel: protocols = UNLABELED CIPSOv4 [ 0.016447] NetLabel: unlabeled traffic allowed by default [ 0.016475] Switching to clocksource xen [ 0.017434] pnp: PnP ACPI: disabled [ 0.017501] NET: Registered protocol family 2 [ 0.017864] IP route cache hash table entries: 262144 (order: 9, 2097152 bytes) [ 0.019322] TCP established hash table entries: 524288 (order: 11, 8388608 bytes) [ 0.020376] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes) [ 0.020497] TCP: Hash tables configured (established 524288 bind 65536) [ 0.020500] TCP: reno registered [ 0.020525] UDP hash table entries: 4096 (order: 5, 131072 bytes) [ 0.020564] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes) [ 0.020624] NET: Registered protocol family 1 [ 0.020658] PCI-DMA: Using software bounce buffering for IO (SWIOTLB) [ 0.020662] software IO TLB [mem 0xfb632000-0xff631fff] (64MB) mapped at [ffff8800fb632000-ffff8800ff631fff] [ 0.020750] platform rtc_cmos: registered platform RTC device (no PNP device found) [ 0.021378] HugeTLB registered 2 MB page size, pre-allocated 0 pages [ 0.023378] msgmni has been set to 9656 [ 0.023544] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253) [ 0.023549] io scheduler noop registered [ 0.023551] io scheduler deadline registered [ 0.023580] io scheduler cfq registered (default) [ 0.023650] pci_hotplug: PCI Hot Plug PCI Core version: 0.5 [ 0.023845] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.024082] Non-volatile memory driver v1.3 [ 0.024085] Linux agpgart interface v0.103 [ 0.024207] Event-channel device installed. [ 0.024265] [drm] Initialized drm 1.1.0 20060810 [ 0.024268] [drm:i915_init] *ERROR* drm/i915 can't work without intel_agp module! [ 0.025145] brd: module loaded [ 0.025565] loop: module loaded [ 0.045646] Initialising Xen virtual ethernet driver. [ 0.198264] i8042: PNP: No PS/2 controller found. Probing ports directly. [ 0.199096] i8042: No controller found [ 0.199139] mousedev: PS/2 mouse device common for all mice [ 0.259303] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0 [ 0.259353] rtc_cmos: probe of rtc_cmos failed with error -38 [ 0.259440] md: raid1 personality registered for level 1 [ 0.259542] nf_conntrack version 0.5.0 (16384 buckets, 65536 max) [ 0.259732] ip_tables: (C) 2000-2006 Netfilter Core Team [ 0.259747] TCP: cubic registered [ 0.259886] NET: Registered protocol family 10 [ 0.260031] ip6_tables: (C) 2000-2006 Netfilter Core Team [ 0.260070] sit: IPv6 over IPv4 tunneling driver [ 0.260194] NET: Registered protocol family 17 [ 0.260213] Bridge firewalling registered [ 5.360075] XENBUS: Waiting for devices to initialise: 25s...20s...15s...10s...5s...0s...235s...230s...225s...220s...215s...210s...205s...200s...195s...190s...185s...180s...175s...170s...165s...160s...155s...150s...145s...140s...135s...130s...125s...120s...115s...110s...105s...100s...95s...90s...85s...80s...75s...70s...65s...60s...55s...50s...45s...40s...35s...30s...25s...20s...15s...10s...5s...0s... [ 270.360180] XENBUS: Timeout connecting to device: device/vbd/51713 (local state 3, remote state 1) [ 270.360273] md: Waiting for all devices to be available before autodetect [ 270.360277] md: If you don't use raid, use raid=noautodetect [ 270.360388] md: Autodetecting RAID arrays. [ 270.360392] md: Scanned 0 and added 0 devices. [ 270.360394] md: autorun ... [ 270.360395] md: ... autorun DONE. [ 270.360431] VFS: Cannot open root device "xvda1" or unknown-block(0,0): error -6 [ 270.360435] Please append a correct "root=" boot option; here are the available partitions: [ 270.360440] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 270.360444] Pid: 1, comm: swapper/0 Not tainted 3.5.7-gentoo #1 [ 270.360446] Call Trace: [ 270.360454] [<ffffffff813d2205>] ? panic+0xbe/0x1c5 [ 270.360459] [<ffffffff813d2358>] ? printk+0x4c/0x51 [ 270.360464] [<ffffffff815d5fb7>] ? mount_block_root+0x24f/0x26d [ 270.360469] [<ffffffff815d62b6>] ? prepare_namespace+0x168/0x192 [ 270.360474] [<ffffffff815d5ca7>] ? kernel_init+0x1b0/0x1c2 [ 270.360477] [<ffffffff815d5500>] ? loglevel+0x34/0x34 [ 270.360482] [<ffffffff813d5a64>] ? kernel_thread_helper+0x4/0x10 [ 270.360486] [<ffffffff813d4038>] ? retint_restore_args+0x5/0x6 [ 270.360490] [<ffffffff813d5a60>] ? gs_change+0x13/0x13 The config: name = "dom1" bootloader = "/usr/bin/pygrub" root = "/dev/xvda1 ro" extra = "3" # runlevel memory = 5000 disk = [ 'phy:/dev/md1,xvda1,w' ] # vif = [ 'ip=..., vifname=veth1' ] # none for now Here are some details on the Dom0 kernel (grepping for "xen"): CONFIG_XEN=y CONFIG_XEN_DOM0=y CONFIG_XEN_PRIVILEGED_GUEST=y CONFIG_XEN_PVHVM=y CONFIG_XEN_MAX_DOMAIN_MEMORY=500 CONFIG_XEN_SAVE_RESTORE=y CONFIG_PCI_XEN=y CONFIG_XEN_PCIDEV_FRONTEND=y # CONFIG_XEN_BLKDEV_FRONTEND is not set CONFIG_XEN_BLKDEV_BACKEND=y # CONFIG_XEN_NETDEV_FRONTEND is not set CONFIG_XEN_NETDEV_BACKEND=y CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y # CONFIG_XEN_WDT is not set # CONFIG_XEN_FBDEV_FRONTEND is not set # Xen driver support CONFIG_XEN_BALLOON=y # CONFIG_XEN_SELFBALLOONING is not set CONFIG_XEN_SCRUB_PAGES=y CONFIG_XEN_DEV_EVTCHN=y CONFIG_XEN_BACKEND=y CONFIG_XENFS=y CONFIG_XEN_COMPAT_XENFS=y CONFIG_XEN_SYS_HYPERVISOR=y CONFIG_XEN_XENBUS_FRONTEND=y CONFIG_XEN_GNTDEV=m CONFIG_XEN_GRANT_DEV_ALLOC=m CONFIG_SWIOTLB_XEN=y CONFIG_XEN_TMEM=y CONFIG_XEN_PCIDEV_BACKEND=m CONFIG_XEN_PRIVCMD=y CONFIG_XEN_ACPI_PROCESSOR=m And the DomU kernel (grepping for "xen"): CONFIG_XEN=y CONFIG_XEN_DOM0=y CONFIG_XEN_PRIVILEGED_GUEST=y CONFIG_XEN_PVHVM=y CONFIG_XEN_MAX_DOMAIN_MEMORY=500 CONFIG_XEN_SAVE_RESTORE=y CONFIG_PCI_XEN=y CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y # CONFIG_XEN_WDT is not set # CONFIG_XEN_FBDEV_FRONTEND is not set # Xen driver support CONFIG_XEN_BALLOON=y # CONFIG_XEN_SELFBALLOONING is not set CONFIG_XEN_SCRUB_PAGES=y CONFIG_XEN_DEV_EVTCHN=y # CONFIG_XEN_BACKEND is not set CONFIG_XENFS=y CONFIG_XEN_COMPAT_XENFS=y CONFIG_XEN_SYS_HYPERVISOR=y CONFIG_XEN_XENBUS_FRONTEND=y CONFIG_XEN_GNTDEV=m CONFIG_XEN_GRANT_DEV_ALLOC=m CONFIG_SWIOTLB_XEN=y CONFIG_XEN_TMEM=y CONFIG_XEN_PRIVCMD=y CONFIG_XEN_ACPI_PROCESSOR=m Any ideas what I'm doing wrong here? Thanks a lot!

    Read the article

  • Using linq to parse file [closed]

    - by Emaan Abdul majeed
    i am working parsing textfile using LINQ but got struc on it,its going outof range exception string[] lines = File.ReadAllLines(input); var t1 = lines .Where(l => !l.StartsWith("#")) .Select(l => l.Split(' ')) .Select(items => String.Format("{0}{1}{2}", items[1].PadRight(32), //items[1].PadRight(16) items[2].PadRight(32), items[3].PadRight(32))); var t2 = t1 .Select(l => l.ToUpper()); foreach (var t in t2) Console.WriteLine(t); and file is about 200 to 500 lines and i want to extract specific information so i need to split that information to different structure so how to do it this..

    Read the article

  • Suggestion for a Non-CSE developer

    - by Md.lbrahim
    Due to financial problems, I couldn't go for CSE in my country and had to settle for a BCIS honors degree. Now, after quite some time, when I want to go for a higher position in software development then I get asked about algorithms and basics that I have missed back in uni. This is affecting my chances of getting selected and I cannot afford that any longer. My question would be that what you would suggest smn like me to do in order to cover the 'basics' without any university or educational institute e.g. books,learn C++,etc? Any suggestion (including -ve) is welcomed and appreciated.

    Read the article

  • How to solve programming problems using logic? [closed]

    - by md nth
    I know these principles: Define the constrains and operations,eg constrains are the rules that you cant pass and what you want determined by the end goal, operations are actions you can do, "choices" . Buy some time by solving easy and solvable piece. Halving the difficulty by dividing the project into small goals and blocks. The more blocks you create the more hinges you have. Analogies which means : using other code blocks, yours or from other programmers . which has problem similar to the current problem. Experiments not guessing by writing "predicted end" code, in other word creating a hypothesis, about what will happen if you do this or that. Use your tools first, don't begin with a unknown code first. By making small goals you ll not get frustrated. Start from smallest problem. Are there other principles?

    Read the article

  • Programming habits, patterns, and standards that have developed out of appeal to tradition/by mistake? [closed]

    - by user828584
    Being self-taught, the vast majority of what I know about programming has come from reading other peoples' code on websites like this. I'm starting to wonder if I've developed bad or otherwise pointless habits from other people, or even just made invalid assumptions. For example, in javascript, void 0 is used in a lot of places, and until I saw this, I just assumed it was necessary and that 0 had some significance. Also, the http header, referer is misspelled but hasn't been changed because it would break a lot of applications. Also mentioned in Code Complete 2: The architecture should describe the motivations for all major decisions. Be wary of “we’ve always done it that way” justifications. One story goes that Beth wanted to cook a pot roast according to an award-winning pot roast recipe handed down in her husband’s family. Her husband, Abdul, said that his mother had taught him to sprinkle it with salt and pepper, cut both ends off, put it in the pan, cover it, and cook it. Beth asked, “Why do you cut both ends off?” Abdul said, “I don’t know. I’ve always done it that way. Let me ask my mother.” He called her, and she said, “I don’t know. I’ve always done it that way. Let me ask your grandmother.” She called his grandmother, who said, “I don’t know why you do it that way. I did it that way because it was too big to fit in my pan.” What are some other examples of this?

    Read the article

  • Possible to get SSD TRIM (discard) working on ext4 + LVM + software RAID in Linux?

    - by Don MacAskill
    We use RAID1+0 with md on Linux (currently 2.6.37) to create an md device, then use LVM to provide volume management on top of the device, and then use ext4 as our filesystem on the LVM volume groups. With SSDs as the drives, we'd like to see the TRIM commands propagate through the layers (ext4 - LVM - md - SSD) to the devices. It looks like recent 2.6.3x kernels have had a lot of new SSD-related TRIM support added, including lots more coverage of Device Mapper scenarios, but we still can't seem to get it to cascade down properly. Is this possible yet? If so, how? If not, is any progress being made?

    Read the article

  • Possible to get SSD TRIM (discard) working on ext4 + LVM + software RAID in Linux?

    - by Don MacAskill
    We use RAID1+0 with md on Linux (currently 2.6.37) to create an md device, then use LVM to provide volume management on top of the device, and then use ext4 as our filesystem on the LVM volume groups. With SSDs as the drives, we'd like to see the TRIM commands propagate through the layers (ext4 - LVM - md - SSD) to the devices. It looks like recent 2.6.3x kernels have had a lot of new SSD-related TRIM support added, including lots more coverage of Device Mapper scenarios, but we still can't seem to get it to cascade down properly. Is this possible yet? If so, how? If not, is any progress being made?

    Read the article

  • Copying single files into a folder that changes name every time the batch file is executed

    - by Daniel Jochem
    Can you please help, I am using this to put the text files made by the batch file into the folder created by the batch file as well. but my problem is that the name is changed of the new folder every time because it is named by the date and time it was created. This is the code: @echo off for /F " tokens=1,2,3* delims=/, " %%i IN ('date /T') DO ( set CUR_DAY_OF_WEEK=%%i set CUR_MONTH=%%j set CUR_DAY=%%k set CUR_YEAR=%%l) for /F " tokens=1,2,3* delims=:, " %%i IN ('time /T') DO ( set CUR_HOUR=%%i set CUR_MIN=%%j set AM_PM=%%k) if not exist E:\Private goto :F cd E:\Private md "E:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%" goto :start :F if not exist F:\Private goto :G cd F:\Private md "F:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%" goto :start :G cd G:\Private md "G:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%" goto :start :start start /min A /stext A.txt start /min B /stext B.txt start /min C /stext C.txt start /min D /stext D.txt (As the directory (E:-G:) changes, how can I check all without an error? And once that is found, then put all these text files into the date folder.

    Read the article

  • URGENT: help recovering lost data

    - by Niels Kristian
    I have made a directory: sudo mkdir /ssd, the directory was supposed to be mounted to a raid array called md3. This was done by adding /dev/md3 /ssd auto defaults 0 0 to fstab. Then after a while where I had used the directory, I realized that I had forgotten to run sudo mount -a - and then I did, and now the data is gone. I tried to uncomment the line in fstab and run sudo mount -a but that didn't get back my data. What can I do!? CONTENT OF FSTAB: proc /proc proc defaults 0 0 none /dev/pts devpts gid=5,mode=620 0 0 /dev/md/0 none swap sw 0 0 /dev/md/1 /boot ext3 defaults 0 0 /dev/md/2 / ext4 defaults 0 0 /dev/md3 /ssd auto defaults 0 0

    Read the article

  • mdadm: breaks boot due to "is not ready yet or not present" error

    - by BarsMonster
    This is so damn frustrating :-| I've spent like 20 hours on this nice error, and seems like dozens of people over Internet too, and no clear solution yet. I have non-system RAID-5 of 5 disks, and it's fine. But during boot up it says that "/dev/md0 is not ready yet or not present" and asks to press 'S'. Very nice for Ubuntu Server - I have to bring monitor and keyboard to go next. After this system boots and it's all fine. md0 device works, /proc/mdstat is fine. When I do mount -a - it mounts this array without errors and works fine. As a dumb and shameful workaround I added noauto in /etc/fstab, and did mounting in /etc/rc.local - it works fine then. Any hints how to make it work properly? fstab: UUID=3588dfed-47ae-4c32-9855-2d69df713b86 /var/bigfatdisk ext4 noauto,noatime,data=writeback,barrier=0,nobh,commit=5 0 0 mdadm config: It is autogenerated: # mdadm.conf # # Please refer to mdadm.conf(5) for information about this file. # # by default, scan all partitions (/proc/partitions) for MD superblocks. # alternatively, specify devices to scan, using wildcards if desired. DEVICE partitions # auto-create devices with Debian standard permissions CREATE owner=root group=disk mode=0660 auto=yes # automatically tag new arrays as belonging to the local system HOMEHOST <system> # instruct the monitoring daemon where to send mail alerts MAILADDR CENSORED # definitions of existing MD arrays ARRAY /dev/md/0 metadata=1.2 bitmap=/var/md0_intent UUID=efccbeb6:a0a65cd6:470dcdf3:62781188 name=LBox2:0 # This file was auto-generated on Mon, 10 Jan 2011 04:06:55 +0200 # by mkconf 3.1.2-2

    Read the article

  • mdadm: brakes boot due to "is not ready yet or not present" error

    - by BarsMonster
    This is so damn frustrating :-| I've spent like 20 hours on this nice error, and seems like dozens of people over Internet too, and no clear solution yet. I have non-system RAID-5 of 5 disks, and it's fine. But during boot up it says that "/dev/md0 is not ready yet or not present" and asks to press 'S'. Very nice for Ubuntu Server - I have to bring monitor and keyboard to go next. After this system boots and it's all fine. md0 device works, /proc/mdstat is fine. When I do mount -a - it mounts this array without errors and works fine. As a dumb and shameful workaround I added noauto in /etc/fstab, and did mounting in /etc/rc.local - it works fine then. Any hints how to make it work properly? fstab: UUID=3588dfed-47ae-4c32-9855-2d69df713b86 /var/bigfatdisk ext4 noauto,noatime,data=writeback,barrier=0,nobh,commit=5 0 0 mdadm config: It is autogenerated: # mdadm.conf # # Please refer to mdadm.conf(5) for information about this file. # # by default, scan all partitions (/proc/partitions) for MD superblocks. # alternatively, specify devices to scan, using wildcards if desired. DEVICE partitions # auto-create devices with Debian standard permissions CREATE owner=root group=disk mode=0660 auto=yes # automatically tag new arrays as belonging to the local system HOMEHOST <system> # instruct the monitoring daemon where to send mail alerts MAILADDR CENSORED # definitions of existing MD arrays ARRAY /dev/md/0 metadata=1.2 bitmap=/var/md0_intent UUID=efccbeb6:a0a65cd6:470dcdf3:62781188 name=LBox2:0 # This file was auto-generated on Mon, 10 Jan 2011 04:06:55 +0200 # by mkconf 3.1.2-2

    Read the article

  • How to use JSON response in the form of JSTL?

    - by HariKrishna
    I am getting JSON response,now i need to construct a table using this response.The table may be contain more than one record and i know one way of doing this is using Jstl tags but not JSON response.Here is my jsp code <div id="divHideAllergies" class="clone"> <div class="copy"> <div class="col-md-12"> <div class="portlet box carrot "> <div class="portlet-title"> <div class="caption"> <i class="fa fa-medkit"></i> Allergies </div> </div> <div class="portlet-body form"> <div class="form-body"> <div class="form-group"> <label class="control-label col-md-3">Allergy Type:</label> <div class="col-md-9"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-medkit"></i></span> <select class="form-control" id="allergy_type"> <option selected value="">--Select One--</option> <option value="Drug">Drug</option> <option value="Environmental">Environmental</option <option value="Food">Food</option> </select> </div> </div> </div> <div class="form-group"> <label class="control-label col-md-3">Allergic to:</label> <div class="col-md-9"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-medkit"></i></span> <input type="text" class="form-control" name="first name" id="allergy_to"/> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div>

    Read the article

  • zk selecting combobox item programatically

    - by Abdul Khaliq
    Hi, I cannot set the value of combobox programatically can some one tell me what missing in the code public class Profile extends Window implements AfterCompose { @Override public void afterCompose() { Session session = Sessions.getCurrent(false); ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext( (ServletContext) getDesktop().getWebApp().getNativeContext()); UsersDao usersDao = (UsersDao) ctx.getBean("daoUsers"); User user = (User) session.getAttribute("user"); user = usersDao.getUser(user.getUsername(),user.getPassword()); Textbox username_t = (Textbox) this.getFellow("username"); Textbox password_t = (Textbox) this.getFellow("password"); Textbox conpassword_t = (Textbox) this.getFellow("con_password"); Textbox firstname_t = (Textbox) this.getFellow("firstName"); Textbox lastname_t = (Textbox) this.getFellow("lastName"); Textbox email_t = (Textbox) this.getFellow("email"); Combobox hintQuestion_t = (Combobox) this.getFellow("hintQuestion"); Textbox hintAnswer_t = (Textbox) this.getFellow("hintAnswer"); Combobox locale_t = (Combobox) this.getFellow("locale"); Combobox authority_t = (Combobox) this.getFellow("authority"); username_t.setText(user.getUsername()); firstname_t.setText(user.getUserDetails().getFirstName()); lastname_t.setText(user.getUserDetails().getLastName()); email_t.setText(user.getUserDetails().getEmail()); Comboitem selectedItem = getSelectedIndexComboboxItem(hintQuestion_t, user.getHintQuestion()); hintQuestion_t.setSelectedItem(selectedItem); hintAnswer_t.setText(user.getHintAnswer()); selectedItem = getSelectedIndexComboboxItem(locale_t, user.getUserDetails().getLocale()); locale_t.setSelectedItem(selectedItem); selectedItem = getSelectedIndexComboboxItem(authority_t, ((Authority)user.getAuthorities().toArray()[0]).getRole()); authority_t.setSelectedItem(selectedItem); } private Comboitem getSelectedIndexComboboxItem(Combobox combobox, String value) { List<Comboitem> items = combobox.getItems(); Comboitem item = items.get(0); for (int i = 0; i < items.size(); i++) { Comboitem comboitem = items.get(i); String label = (String)comboitem.getLabel(); String cval = (String)comboitem.getValue(); if ((label!=null && label.equalsIgnoreCase(value)) || (cval != null && cval.equalsIgnoreCase(value))) { item = comboitem; break; } } return item; } } // zk file <window id="profile" use="com.jf.web.zk.ui.Profile"> <tabbox id="tabbox" width="40%" > <tabs> <tab label="Account Information"/> <tab label="Personal Information"/> <tab label="Contact Details"/> </tabs> <tabpanels> <tabpanel> <grid> <rows> <row> <label value="${i18nUtils.message('user.username')}"/> <hbox> <textbox id="username" />*,a-zA-Z,0-9 </hbox> </row> <row> <label value="${i18nUtils.message('user.password')}"/> <hbox> <textbox id="password" type="password"/>* </hbox> </row> <row> <label value="${i18nUtils.message('registration.user.password.confirm')}"/> <hbox> <textbox id="con_password" type="password"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.first.name')}"/> <hbox> <textbox id="firstName" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.last.name')}"/> <hbox> <textbox id="lastName" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.email')}"/> <hbox> <textbox id="email" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.hint.question')}"/> <hbox> <combobox id="hintQuestion" onCreate='self.setSelectedIndex(1);'> <comboitem label="${i18nUtils.message('user.hint.question.possible.value1')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value2')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value3')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value4')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value5')}" /> </combobox>* </hbox> </row> <row> <label value="${i18nUtils.message('user.hint.answer')}"/> <hbox> <textbox id="hintAnswer" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.locale')}"/> <hbox> <combobox id="locale" onCreate='self.setSelectedIndex(1);self.setReadonly(true);'> <comboitem label="${i18nUtils.message('user.details.locale.en')}" value="en_US"/> <comboitem label="${i18nUtils.message('user.details.locale.bg')}" value="bg_BG"/> </combobox>* </hbox> </row> <row> <label value="${i18nUtils.message('authority.account.type')}"/> <hbox> <combobox id="authority" onCreate='self.setSelectedIndex(0);self.setReadonly(true);'> <comboitem label="${i18nUtils.message('authority.job.seeker')}" value="Job Seeker"/> <comboitem label="${i18nUtils.message('authority.employer')}" value="Employer"/> <comboitem label="${i18nUtils.message('authority.hra')}" value="Human Resource Agency"/> <comboitem label="${i18nUtils.message('authority.advertiser')}" value="Advertiser"/> </combobox>* </hbox> </row> </rows> </grid> </tabpanel> </tabpanels> </tabbox> <grid width="40%"> <rows> <row> <button label="${i18nUtils.message('bttn.save')}" onClick="save()"/> <button label="${i18nUtils.message('bttn.cancel')}" onClick="cancel()"/> </row> </rows> </grid> </window> </zk> The "getSelectedIndexComboboxItem()" does return the correct selected item but there seems no effect on the UI. Like for example the locale is set to default Bulgarian language and I need to set it to English. Abdul Khaliq

    Read the article

  • zk selecting combobox item programatically

    - by Abdul Khaliq
    I cannot set the value of combobox programatically can some one tell me what missing in the code public class Profile extends Window implements AfterCompose { @Override public void afterCompose() { Session session = Sessions.getCurrent(false); ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext( (ServletContext) getDesktop().getWebApp().getNativeContext()); UsersDao usersDao = (UsersDao) ctx.getBean("daoUsers"); User user = (User) session.getAttribute("user"); user = usersDao.getUser(user.getUsername(),user.getPassword()); Textbox username_t = (Textbox) this.getFellow("username"); Textbox password_t = (Textbox) this.getFellow("password"); Textbox conpassword_t = (Textbox) this.getFellow("con_password"); Textbox firstname_t = (Textbox) this.getFellow("firstName"); Textbox lastname_t = (Textbox) this.getFellow("lastName"); Textbox email_t = (Textbox) this.getFellow("email"); Combobox hintQuestion_t = (Combobox) this.getFellow("hintQuestion"); Textbox hintAnswer_t = (Textbox) this.getFellow("hintAnswer"); Combobox locale_t = (Combobox) this.getFellow("locale"); Combobox authority_t = (Combobox) this.getFellow("authority"); username_t.setText(user.getUsername()); firstname_t.setText(user.getUserDetails().getFirstName()); lastname_t.setText(user.getUserDetails().getLastName()); email_t.setText(user.getUserDetails().getEmail()); Comboitem selectedItem = getSelectedIndexComboboxItem(hintQuestion_t, user.getHintQuestion()); hintQuestion_t.setSelectedItem(selectedItem); hintAnswer_t.setText(user.getHintAnswer()); selectedItem = getSelectedIndexComboboxItem(locale_t, user.getUserDetails().getLocale()); locale_t.setSelectedItem(selectedItem); selectedItem = getSelectedIndexComboboxItem(authority_t, ((Authority)user.getAuthorities().toArray()[0]).getRole()); authority_t.setSelectedItem(selectedItem); } private Comboitem getSelectedIndexComboboxItem(Combobox combobox, String value) { List<Comboitem> items = combobox.getItems(); Comboitem item = items.get(0); for (int i = 0; i < items.size(); i++) { Comboitem comboitem = items.get(i); String label = (String)comboitem.getLabel(); String cval = (String)comboitem.getValue(); if ((label!=null && label.equalsIgnoreCase(value)) || (cval != null && cval.equalsIgnoreCase(value))) { item = comboitem; break; } } return item; } } // zk file <window id="profile" use="com.jf.web.zk.ui.Profile"> <tabbox id="tabbox" width="40%" > <tabs> <tab label="Account Information"/> <tab label="Personal Information"/> <tab label="Contact Details"/> </tabs> <tabpanels> <tabpanel> <grid> <rows> <row> <label value="${i18nUtils.message('user.username')}"/> <hbox> <textbox id="username" />*,a-zA-Z,0-9 </hbox> </row> <row> <label value="${i18nUtils.message('user.password')}"/> <hbox> <textbox id="password" type="password"/>* </hbox> </row> <row> <label value="${i18nUtils.message('registration.user.password.confirm')}"/> <hbox> <textbox id="con_password" type="password"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.first.name')}"/> <hbox> <textbox id="firstName" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.last.name')}"/> <hbox> <textbox id="lastName" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.email')}"/> <hbox> <textbox id="email" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.hint.question')}"/> <hbox> <combobox id="hintQuestion" onCreate='self.setSelectedIndex(1);'> <comboitem label="${i18nUtils.message('user.hint.question.possible.value1')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value2')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value3')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value4')}" /> <comboitem label="${i18nUtils.message('user.hint.question.possible.value5')}" /> </combobox>* </hbox> </row> <row> <label value="${i18nUtils.message('user.hint.answer')}"/> <hbox> <textbox id="hintAnswer" type="text"/>* </hbox> </row> <row> <label value="${i18nUtils.message('user.details.locale')}"/> <hbox> <combobox id="locale" onCreate='self.setSelectedIndex(1);self.setReadonly(true);'> <comboitem label="${i18nUtils.message('user.details.locale.en')}" value="en_US"/> <comboitem label="${i18nUtils.message('user.details.locale.bg')}" value="bg_BG"/> </combobox>* </hbox> </row> <row> <label value="${i18nUtils.message('authority.account.type')}"/> <hbox> <combobox id="authority" onCreate='self.setSelectedIndex(0);self.setReadonly(true);'> <comboitem label="${i18nUtils.message('authority.job.seeker')}" value="Job Seeker"/> <comboitem label="${i18nUtils.message('authority.employer')}" value="Employer"/> <comboitem label="${i18nUtils.message('authority.hra')}" value="Human Resource Agency"/> <comboitem label="${i18nUtils.message('authority.advertiser')}" value="Advertiser"/> </combobox>* </hbox> </row> </rows> </grid> </tabpanel> </tabpanels> </tabbox> <grid width="40%"> <rows> <row> <button label="${i18nUtils.message('bttn.save')}" onClick="save()"/> <button label="${i18nUtils.message('bttn.cancel')}" onClick="cancel()"/> </row> </rows> </grid> </window> </zk> The "getSelectedIndexComboboxItem()" does return the correct selected item but there seems no effect on the UI. Like for example the locale is set to default Bulgarian language and I need to set it to English. Abdul Khaliq

    Read the article

  • Getting all new messages from a Maildir in python

    - by Jesper
    I have a mail dir: foo@foo:~/Maildir$ ls -l total 288 drwx------ 2 foo foo 155648 2010-04-19 15:19 cur -rw------- 1 foo foo 440 2010-03-20 08:50 dovecot.index.log -rw------- 1 foo foo 112 2010-03-20 08:49 dovecot-uidlist -rw------- 1 foo foo 8 2010-03-20 08:49 dovecot-uidvalidity -rw------- 1 foo foo 0 2010-03-20 08:49 dovecot-uidvalidity.4ba48c0e drwx------ 2 foo foo 114688 2010-04-19 16:07 new drwx------ 2 foo foo 4096 2010-04-19 16:07 tmp And in python I'm trying to get all new messages (Python 2.6.5rc2). First, getting "Maildir" works: >>> import mailbox >>> md = mailbox.Maildir('/home/foo/Maildir') >>> md.iterkeys().next() '1269924477.Vfc01I4249fM708004.foo' But how do I access "Maildir/new"? This does not work: >>> md = mailbox.Maildir('/home/foo/Maildir/new') >>> md.iterkeys().next() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/mailbox.py", line 346, in iterkeys self._refresh() File "/usr/lib/python2.6/mailbox.py", line 467, in _refresh for entry in os.listdir(subdir_path): OSError: [Errno 2] No such file or directory: '/home/foo/Maildir/new/new' >>> Any ideas?

    Read the article

  • Problem with JavaScript arithmetic

    - by Lynn
    I have a form for my customers to add budget projections. A prominent user wants to be able to show dollar values in either dollars, Kila-dollars or Mega-dollars. I'm trying to achieve this with a group of radio buttons that call the following JavaScript function, but am having problems with rounding that make the results look pretty crummy. Any advice would be much appreciated! Lynn function setDollars(new_mode) { var factor; var myfield; var myval; var cur_mode = document.proj_form.cur_dollars.value; if(cur_mode == new_mode) { return; } else if((cur_mode == 'd')&&(new_mode == 'kd')) { factor = "0.001"; } else if((cur_mode == 'd')&&(new_mode == 'md')) { factor = "0.000001"; } else if((cur_mode == 'kd')&&(new_mode == 'd')) { factor = "1000"; } else if((cur_mode == 'kd')&&(new_mode == 'md')) { factor = "0.001"; } else if((cur_mode == 'md')&&(new_mode == 'kd')) { factor = "1000"; } else if((cur_mode == 'md')&&(new_mode == 'd')) { factor = "1000000"; } document.proj_form.cur_dollars.value = new_mode; var cur_idx = document.proj_form.cur_idx.value; var available_slots = 13 - cur_idx; var td_name; var cell; var new_value; //Adjust dollar values for projections for(i=1;i<13;i++) { var myfield = eval('document.proj_form.proj_'+i); if(myfield.value == '') { myfield.value = 0; } var myval = parseFloat(myfield.value) * parseFloat(factor); myfield.value = myval; if(i < cur_idx) { document.getElementById("actual_"+i).innerHTML = myval; } }

    Read the article

  • ambient values in mvc2.net routing

    - by Muhammad Adeel Zahid
    Hello Everyone, i have following two routes registered in my global.asax file routes.MapRoute( "strict", "{controller}.mvc/{docid}/{action}/{id}", new { action = "Index", id = "", docid = "" }, new { docid = @"\d+"} ); routes.MapRoute( "default", "{controller}.mvc/{action}/{id}", new { action = "Index", id = "" }, new { docConstraint = new DocumentConstraint() } ); and i have a static "dashboard" link in my tabstrip and some other links that are constructed from values in db here is the code <ul id="globalnav" class = "t-reset t-tabstrip-items"> <li class="bar" id = "dashboard"> <%=Html.ActionLink("dash.board", "Index", pck.Controller, new{docid =string.Empty,id = pck.PkgID }, new { @class = "here" })%> </li> <% foreach (var md in pck.sysModules) { %> <li class="<%=liClass%>"> <%=Html.ActionLink(md.ModuleName, md.ActionName, pck.Controller, new { docid = md.DocumentID}, new { @class = cls })%> </li> <% } %> </ul> Now my launching address is localhost/oa.mvc/index/11 clearly matching the 2nd route. but when i visit any page that has mapped to first route and then come back to dash.board link it shows me localhost/oa.mvc/7/index/11 where 7 is docid and picked from previous Url. now i understand that my action method is after docid and changing it would not clear the docid. my question here is that can i remove docid in this scenario without changing the route. regards adeel

    Read the article

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