Search Results

Search found 575 results on 23 pages for 'aaa'.

Page 23/23 | < Previous Page | 19 20 21 22 23 

  • array and array_view from amp.h

    - by Daniel Moth
    This is a very long post, but it also covers what are probably the classes (well, array_view at least) that you will use the most with C++ AMP, so I hope you enjoy it! Overview The concurrency::array and concurrency::array_view template classes represent multi-dimensional data of type T, of N dimensions, specified at compile time (and you can later access the number of dimensions via the rank property). If N is not specified, it is assumed that it is 1 (i.e. single-dimensional case). They are rectangular (not jagged). The difference between them is that array is a container of data, whereas array_view is a wrapper of a container of data. So in that respect, array behaves like an STL container, whereas the closest thing an array_view behaves like is an STL iterator (albeit with random access and allowing you to view more than one element at a time!). The data in the array (whether provided at creation time or added later) resides on an accelerator (which is specified at creation time either explicitly by the developer, or set to the default accelerator at creation time by the runtime) and is laid out contiguously in memory. The data provided to the array_view is not stored by/in the array_view, because the array_view is simply a view over the real source (which can reside on the CPU or other accelerator). The underlying data is copied on demand to wherever the array_view is accessed. Elements which differ by one in the least significant dimension of the array_view are adjacent in memory. array objects must be captured by reference into the lambda you pass to the parallel_for_each call, whereas array_view objects must be captured by value (into the lambda you pass to the parallel_for_each call). Creating array and array_view objects and relevant properties You can create array_view objects from other array_view objects of the same rank and element type (shallow copy, also possible via assignment operator) so they point to the same underlying data, and you can also create array_view objects over array objects of the same rank and element type e.g.   array_view<int,3> a(b); // b can be another array or array_view of ints with rank=3 Note: Unlike the constructors above which can be called anywhere, the ones in the rest of this section can only be called from CPU code. You can create array objects from other array objects of the same rank and element type (copy and move constructors) and from other array_view objects, e.g.   array<float,2> a(b); // b can be another array or array_view of floats with rank=2 To create an array from scratch, you need to at least specify an extent object, e.g. array<int,3> a(myExtent);. Note that instead of an explicit extent object, there are convenience overloads when N<=3 so you can specify 1-, 2-, 3- integers (dependent on the array's rank) and thus have the extent created for you under the covers. At any point, you can access the array's extent thought the extent property. The exact same thing applies to array_view (extent as constructor parameters, incl. convenience overloads, and property). While passing only an extent object to create an array is enough (it means that the array will be written to later), it is not enough for the array_view case which must always wrap over some other container (on which it relies for storage space and actual content). So in addition to the extent object (that describes the shape you'd like to be viewing/accessing that data through), to create an array_view from another container (e.g. std::vector) you must pass in the container itself (which must expose .data() and a .size() methods, e.g. like std::array does), e.g.   array_view<int,2> aaa(myExtent, myContainerOfInts); Similarly, you can create an array_view from a raw pointer of data plus an extent object. Back to the array case, to optionally initialize the array with data, you can pass an iterator pointing to the start (and optionally one pointing to the end of the source container) e.g.   array<double,1> a(5, myVector.begin(), myVector.end()); We saw that arrays are bound to an accelerator at creation time, so in case you don’t want the C++ AMP runtime to assign the array to the default accelerator, all array constructors have overloads that let you pass an accelerator_view object, which you can later access via the accelerator_view property. Note that at the point of initializing an array with data, a synchronous copy of the data takes place to the accelerator, and then to copy any data back we'll see that an explicit copy call is required. This does not happen with the array_view where copying is on demand... refresh and synchronize on array_view Note that in the previous section on constructors, unlike the array case, there was no overload that accepted an accelerator_view for array_view. That is because the array_view is simply a wrapper, so the allocation of the data has already taken place before you created the array_view. When you capture an array_view variable in your call to parallel_for_each, the copy of data between the non-CPU accelerator and the CPU takes place on demand (i.e. it is implicit, versus the explicit copy that has to happen with the array). There are some subtleties to the on-demand-copying that we cover next. The assumption when using an array_view is that you will continue to access the data through the array_view, and not through the original underlying source, e.g. the pointer to the data that you passed to the array_view's constructor. So if you modify the data through the array_view on the GPU, the original pointer on the CPU will not "know" that, unless one of two things happen: you access the data through the array_view on the CPU side, i.e. using indexing that we cover below you explicitly call the array_view's synchronize method on the CPU (this also gets called in the array_view's destructor for you) Conversely, if you make a change to the underlying data through the original source (e.g. the pointer), the array_view will not "know" about those changes, unless you call its refresh method. Finally, note that if you create an array_view of const T, then the data is copied to the accelerator on demand, but it does not get copied back, e.g.   array_view<const double, 5> myArrView(…); // myArrView will not get copied back from GPU There is also a similar mechanism to achieve the reverse, i.e. not to copy the data of an array_view to the GPU. copy_to, data, and global copy/copy_async functions Both array and array_view expose two copy_to overloads that allow copying them to another array, or to another array_view, and these operations can also be achieved with assignment (via the = operator overloads). Also both array and array_view expose a data method, to get a raw pointer to the underlying data of the array or array_view, e.g. float* f = myArr.data();. Note that for array_view, this only works when the rank is equal to 1, due to the data only being contiguous in one dimension as covered in the overview section. Finally, there are a bunch of global concurrency::copy functions returning void (and corresponding concurrency::copy_async functions returning a future) that allow copying between arrays and array_views and iterators etc. Just browse intellisense or amp.h directly for the full set. Note that for array, all copying described throughout this post is deep copying, as per other STL container expectations. You can never have two arrays point to the same data. indexing into array and array_view plus projection Reading or writing data elements of an array is only legal when the code executes on the same accelerator as where the array was bound to. In the array_view case, you can read/write on any accelerator, not just the one where the original data resides, and the data gets copied for you on demand. In both cases, the way you read and write individual elements is via indexing as described next. To access (or set the value of) an element, you can index into it by passing it an index object via the subscript operator. Furthermore, if the rank is 3 or less, you can use the function ( ) operator to pass integer values instead of having to use an index object. e.g. array<float,2> arr(someExtent, someIterator); //or array_view<float,2> arr(someExtent, someContainer); index<2> idx(5,4); float f1 = arr[idx]; float f2 = arr(5,4); //f2 ==f1 //and the reverse for assigning, e.g. arr(idx[0], 7) = 6.9; Note that for both array and array_view, regardless of rank, you can also pass a single integer to the subscript operator which results in a projection of the data, and (for both array and array_view) you get back an array_view of rank N-1 (or if the rank was 1, you get back just the element at that location). Not Covered In this already very long post, I am not going to cover three very cool methods (and related overloads) that both array and array_view expose: view_as, section, reinterpret_as. We'll revisit those at some point in the future, probably on the team blog. Comments about this post by Daniel Moth welcome at the original blog.

    Read the article

  • CISCO 2911 Router configuration

    - by bala
    Device cisco 2911 router configuration support is required please. I have exchange server 2010 configured and working without any errors the problem is in cisco router configuration when exchange server sends emails out the receives WAN IP not the public ip. I have configured RDNS lookups with our MX record IP addesses that match the FQDN but all our emails are rejected because it does not match with the public ip. Receiving mails problem is not an problem all mails are coming through. i am sure i am missing something on the router configuration that does not sends the public ip, can any one help me to solve this issue. Note; I've got 1 WAN IP & 8 Public IP from ISP . Find below the running configuration. Building configuration... Current configuration : 2734 bytes ! ! Last configuration change at 06:32:13 UTC Tue Apr 3 2012 ! NVRAM config last updated at 06:32:14 UTC Tue Apr 3 2012 ! NVRAM config last updated at 06:32:14 UTC Tue Apr 3 2012 version 15.1 service timestamps debug datetime msec service timestamps log datetime msec service password-encryption ! hostname BSBG-LL ! boot-start-marker boot-end-marker ! ! enable secret 5 $x$xHrxxxxx5ox0 enable password 7 xx23xx5FxxE1xx044 ! no aaa new-model ! no ipv6 cef ip source-route ip cef ! ! ! ! ! ip flow-cache timeout active 1 ip domain name yourdomain.com ip name-server 213.42.20.20 ip name-server 195.229.241.222 multilink bundle-name authenticated ! ! crypto pki token default removal timeout 0 ! ! license udi pid CISCO2911/K9 ! ! username bsbg ! ! ! ! ! ! interface Embedded-Service-Engine0/0 no ip address shutdown ! interface GigabitEthernet0/0 ip address 192.168.0.9 255.255.255.0 ip flow ingress ip nat inside ip virtual-reassembly in duplex auto speed 100 no cdp enable ! interface GigabitEthernet0/1 ip address 213.42.xx.x2 255.255.255.252 ip nat outside ip virtual-reassembly in duplex auto speed auto no cdp enable ! interface GigabitEthernet0/2 no ip address shutdown duplex auto speed auto ! ip forward-protocol nd ! no ip http server no ip http secure-server ! ip nat inside source list 120 interface GigabitEthernet0/1 overload ip nat inside source static tcp 192.168.0.4 25 94.56.89.100 25 extendable ip nat inside source static tcp 192.168.0.4 53 94.56.89.100 53 extendable ip nat inside source static udp 192.168.0.4 53 94.56.89.100 53 extendable ip nat inside source static tcp 192.168.0.4 110 94.56.89.100 110 extendable ip nat inside source static tcp 192.168.0.4 443 94.56.89.100 443 extendable ip nat inside source static tcp 192.168.0.4 587 94.56.89.100 587 extendable ip nat inside source static tcp 192.168.0.4 995 94.56.89.100 995 extendable ip nat inside source static tcp 192.168.0.4 3389 94.56.89.100 3389 extendable ip nat inside source static tcp 192.168.0.4 443 94.56.89.101 443 extendable ip nat inside source static tcp 192.168.0.12 80 94.56.89.102 80 extendable ip nat inside source static tcp 192.168.0.12 443 94.56.89.102 443 extendable ip nat inside source static tcp 192.168.0.12 3389 94.56.89.102 3389 extendable ip route 0.0.0.0 0.0.0.0 213.42.69.41 ! access-list 120 permit ip 192.168.0.0 0.0.0.255 any ! ! ! control-plane ! ! ! line con 0 exec-timeout 5 0 line aux 0 line 2 no activation-character no exec transport preferred none transport input all transport output pad telnet rlogin lapb-ta mop udptn v120 ssh stopbits 1 line vty 0 4 password 7 xx64xxD530D26086Dxx login transport input all ! scheduler allocate 20000 1000 end

    Read the article

  • Cisco: unable to negotiate IP using IPCP with Windows server

    - by lnk
    I am connecting to Windows server using PPP (for vpn), I establish connection but server does not respond me for my address requests: *Mar 23 00:40:06.055: Vi1 MS-CHAP-V2: I CHALLENGE id 0 len 25 from "MSDC" *Mar 23 00:40:06.063: Vi1 MS CHAP V2: Using hostname from interface CHAP *Mar 23 00:40:06.063: Vi1 MS CHAP V2: Using password from interface CHAP *Mar 23 00:40:06.067: Vi1 MS-CHAP-V2: O RESPONSE id 0 len 69 from "XXX" *Mar 23 00:40:06.087: Vi1 PPP: I pkt type 0xC223, datagramsize 50 link[ppp] *Mar 23 00:40:06.087: Vi1 MS-CHAP-V2: I SUCCESS id 0 len 46 msg is "S=XXX" *Mar 23 00:40:06.087: Vi1 MS CHAP V2 No Password found for : XXX *Mar 23 00:40:06.091: Vi1 MS CHAP V2 Check AuthenticatorResponse Success for : XXX *Mar 23 00:40:06.091: Vi1 IPCP: O CONFREQ [Closed] id 1 len 20 *Mar 23 00:40:06.091: Vi1 IPCP: VSO OUI 0x00000C kind 1 (0x000A00000C0100000000) *Mar 23 00:40:06.091: Vi1 IPCP: Address 0.0.0.0 (0x030600000000) *Mar 23 00:40:07.091: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access1, changed state to up *Mar 23 00:40:07.091: Vi1 LCP: O ECHOREQ [Open] id 1 len 12 magic 0x194CAFCF *Mar 23 00:40:07.103: Vi1 LCP-FS: I ECHOREP [Open] id 1 len 12 magic 0x361B62E5 *Mar 23 00:40:07.103: Vi1 LCP-FS: Received id 1, sent id 1, line up *Mar 23 00:40:08.083: Vi1 IPCP: TIMEout: State REQsent *Mar 23 00:40:08.083: Vi1 IPCP: O CONFREQ [REQsent] id 2 len 20 *Mar 23 00:40:08.083: Vi1 IPCP: VSO OUI 0x00000C kind 1 (0x000A00000C0100000000) *Mar 23 00:40:08.083: Vi1 IPCP: Address 0.0.0.0 (0x030600000000) *Mar 23 00:40:10.099: Vi1 IPCP: TIMEout: State REQsent *Mar 23 00:40:10.099: Vi1 IPCP: O CONFREQ [REQsent] id 3 len 20 *Mar 23 00:40:10.099: Vi1 IPCP: VSO OUI 0x00000C kind 1 (0x000A00000C0100000000) *Mar 23 00:40:10.099: Vi1 IPCP: Address 0.0.0.0 (0x030600000000) *Mar 23 00:40:12.115: Vi1 IPCP: TIMEout: State REQsent *Mar 23 00:40:12.115: Vi1 IPCP: O CONFREQ [REQsent] id 4 len 20 *Mar 23 00:40:12.115: Vi1 IPCP: VSO OUI 0x00000C kind 1 (0x000A00000C0100000000) *Mar 23 00:40:12.115: Vi1 IPCP: Address 0.0.0.0 (0x030600000000) *Mar 23 00:40:12.211: Vi1 LCP: O ECHOREQ [Open] id 2 len 12 magic 0x194CAFCF *Mar 23 00:40:12.219: Vi1 LCP-FS: I ECHOREP [Open] id 2 len 12 magic 0x361B62E5 *Mar 23 00:40:12.219: Vi1 LCP-FS: Received id 2, sent id 2, line up *Mar 23 00:40:14.131: Vi1 IPCP: TIMEout: State REQsent *Mar 23 00:40:14.131: Vi1 IPCP: O CONFREQ [REQsent] id 5 len 20 *Mar 23 00:40:14.131: Vi1 IPCP: VSO OUI 0x00000C kind 1 (0x000A00000C0100000000) *Mar 23 00:40:14.131: Vi1 IPCP: Address 0.0.0.0 (0x030600000000) *Mar 23 00:40:16.147: Vi1 IPCP: TIMEout: State REQsent *Mar 23 00:40:16.147: Vi1 IPCP: O CONFREQ [REQsent] id 6 len 20 *Mar 23 00:40:16.147: Vi1 IPCP: VSO OUI 0x00000C kind 1 (0x000A00000C0100000000) *Mar 23 00:40:16.147: Vi1 IPCP: Address 0.0.0.0 (0x030600000000) *Mar 23 00:40:17.331: Vi1 LCP: O ECHOREQ [Open] id 3 len 12 magic 0x194CAFCF *Mar 23 00:40:17.343: Vi1 LCP-FS: I ECHOREP [Open] id 3 len 12 magic 0x361B62E5 *Mar 23 00:40:17.343: Vi1 LCP-FS: Received id 3, sent id 3, line up You see: My router asks for address, but only keepalives are on line. But the same server works with windows client!! ! version 12.4 no service pad service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption service internal ! hostname Router ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! ip subnet-zero ! ! ip cef vpdn enable ! vpdn-group pptp request-dialin protocol pptp pool-member 1 initiate-to ip XXXX ! ! ! ! ! ! ! bridge irb ! ! interface ATM0 no ip address shutdown no atm ilmi-keepalive dsl operating-mode auto ! interface FastEthernet0 ! interface FastEthernet1 ! interface FastEthernet2 ! interface FastEthernet3 ! interface Dot11Radio0 no ip address shutdown speed basic-1.0 basic-2.0 basic-5.5 6.0 9.0 basic-11.0 12.0 18.0 24.0 36.0 48.0 54.0 station-role root ! interface Vlan1 no ip address bridge-group 1 ! interface Dialer0 ip address negotiated encapsulation ppp dialer pool 1 dialer idle-timeout 0 dialer string XXX dialer persistent dialer vpdn dialer-group 1 keepalive 5 3 no cdp enable ppp authentication ms-chap-v2 optional ppp eap refuse ppp chap hostname XXX ppp chap password 0 XXX ppp ipcp mask request ppp ipcp ignore-map ppp ipcp address accept ! interface BVI1 mac-address XXX.XXX.XXX ip address dhcp ! ip classless ip route 172.0.0.0 255.0.0.0 Dialer0 ! no ip http server no ip http secure-server ! dialer-list 1 protocol ip permit ! control-plane ! bridge 1 protocol vlan-bridge bridge 1 route ip ! line con 0 no modem enable line aux 0 line vty 0 4 login ! scheduler max-task-time 5000 end

    Read the article

  • ???????,???????????

    - by ??-Oracle
    Normal 0 7.8 ? 0 2 false false false EN-US ZH-CN X-NONE ??: 1.???????; 2.??????????????????; 3.????????????????,??????????,????????; ??: ?????????: SQL> create table test_b (id number(10)) tablespace bbb; Table created. SQL> insert into test_b values (1); 1 row created. SQL> commit; NAME --------------------------------------------------------------------------------     FILE# ---------- /opt/oracle/oradata/R11203/aaa.dbf        10 /opt/oracle/oradata/R11203/bbb.dbf        11 11 rows selected. SQL> host ??????,?????? bash-4.2$ ls -al /opt/oracle/oradata/R11203/bbb.dbf -rw-rw----   1 oracle     dba        10493952 Apr  4 09:53 /opt/oracle/oradata/R11203/bbb.dbf bash-4.2$ mv /opt/oracle/oradata/R11203/bbb.dbf /opt/oracle/oradata/R11203/bbb.dbf.bak bash-4.2$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 4 09:55:03 2014 Copyright (c) 1982, 2011, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter tablespace bbb read only; alter tablespace bbb read only * ERROR at line 1: ORA-01116: error in opening database file 11 ORA-01110: data file 11: '/opt/oracle/oradata/R11203/bbb.dbf' ORA-27041: unable to open file HPUX-ia64 Error: 2: No such file or directory Additional information: 3 SQL> shutdown immediate; ORA-01116: error in opening database file 11 ORA-01110: data file 11: '/opt/oracle/oradata/R11203/bbb.dbf' ORA-27041: unable to open file HPUX-ia64 Error: 2: No such file or directory Additional information: 3 SQL> select status from v$instance; STATUS ------------ OPEN SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> / System altered. SQL>/ System altered. SQL> / System altered. SQL> / System altered. SQL> ?? SQL> shutdown immediate; ORA-01116: error in opening database file 11 ORA-01110: data file 11: '/opt/oracle/oradata/R11203/bbb.dbf' ORA-27041: unable to open file HPUX-ia64 Error: 2: No such file or directory Additional information: 3 SQL> shutdown abort; ORACLE instance shut down. ???????mount?? SQL> startup mount; ORACLE instance started. Total System Global Area  329859072 bytes Fixed Size                  2182336 bytes Variable Size             285213504 bytes Database Buffers           37748736 bytes Redo Buffers                4714496 bytes Database mounted. ??alter database create datafile <> as ....???,???????????: SQL> alter database create datafile 11; Database altered. ???????redo log????????? SQL> recover datafile 11; Media recovery complete. SQL> alter database open; Database altered. SQL> select * from test_b;        ID ----------         1 DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267" UnhideWhenUsed="false" QFormat="true" Name="Normal"/ UnhideWhenUsed="false" QFormat="true" Name="heading 1"/ UnhideWhenUsed="false" QFormat="true" Name="Title"/ UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/ UnhideWhenUsed="false" QFormat="true" Name="Strong"/ UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/ UnhideWhenUsed="false" Name="Table Grid"/ UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/ UnhideWhenUsed="false" Name="Light Shading"/ UnhideWhenUsed="false" Name="Light List"/ UnhideWhenUsed="false" Name="Light Grid"/ UnhideWhenUsed="false" Name="Medium Shading 1"/ UnhideWhenUsed="false" Name="Medium Shading 2"/ UnhideWhenUsed="false" Name="Medium List 1"/ UnhideWhenUsed="false" Name="Medium List 2"/ UnhideWhenUsed="false" Name="Medium Grid 1"/ UnhideWhenUsed="false" Name="Medium Grid 2"/ UnhideWhenUsed="false" Name="Medium Grid 3"/ UnhideWhenUsed="false" Name="Dark List"/ UnhideWhenUsed="false" Name="Colorful Shading"/ UnhideWhenUsed="false" Name="Colorful List"/ UnhideWhenUsed="false" Name="Colorful Grid"/ UnhideWhenUsed="false" Name="Light Shading Accent 1"/ UnhideWhenUsed="false" Name="Light List Accent 1"/ UnhideWhenUsed="false" Name="Light Grid Accent 1"/ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/ UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/ UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/ UnhideWhenUsed="false" QFormat="true" Name="Quote"/ UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/ UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/ UnhideWhenUsed="false" Name="Dark List Accent 1"/ UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/ UnhideWhenUsed="false" Name="Colorful List Accent 1"/ UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/ UnhideWhenUsed="false" Name="Light Shading Accent 2"/ UnhideWhenUsed="false" Name="Light List Accent 2"/ UnhideWhenUsed="false" Name="Light Grid Accent 2"/ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/ UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/ UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/ UnhideWhenUsed="false" Name="Dark List Accent 2"/ UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/ UnhideWhenUsed="false" Name="Colorful List Accent 2"/ UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/ UnhideWhenUsed="false" Name="Light Shading Accent 3"/ UnhideWhenUsed="false" Name="Light List Accent 3"/ UnhideWhenUsed="false" Name="Light Grid Accent 3"/ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/ UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/ UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/ UnhideWhenUsed="false" Name="Dark List Accent 3"/ UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/ UnhideWhenUsed="false" Name="Colorful List Accent 3"/ UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/ UnhideWhenUsed="false" Name="Light Shading Accent 4"/ UnhideWhenUsed="false" Name="Light List Accent 4"/ UnhideWhenUsed="false" Name="Light Grid Accent 4"/ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/ UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/ UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/ UnhideWhenUsed="false" Name="Dark List Accent 4"/ UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/ UnhideWhenUsed="false" Name="Colorful List Accent 4"/ UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/ UnhideWhenUsed="false" Name="Light Shading Accent 5"/ UnhideWhenUsed="false" Name="Light List Accent 5"/ UnhideWhenUsed="false" Name="Light Grid Accent 5"/ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/ UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/ UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/ UnhideWhenUsed="false" Name="Dark List Accent 5"/ UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/ UnhideWhenUsed="false" Name="Colorful List Accent 5"/ UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/ UnhideWhenUsed="false" Name="Light Shading Accent 6"/ UnhideWhenUsed="false" Name="Light List Accent 6"/ UnhideWhenUsed="false" Name="Light Grid Accent 6"/ UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/ UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/ UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/ UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/ UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/ UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/ UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/ UnhideWhenUsed="false" Name="Dark List Accent 6"/ UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/ UnhideWhenUsed="false" Name="Colorful List Accent 6"/ UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/ UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/ UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/ UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/ UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/ UnhideWhenUsed="false" QFormat="true" Name="Book Title"/ /* Style Definitions */ table.MsoNormalTable {mso-style-name:????; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;}

    Read the article

  • BasicAuthProvider in ServiceStack

    - by Per
    I've got an issue with the BasicAuthProvider in ServiceStack. POST-ing to the CredentialsAuthProvider (/auth/credentials) is working fine. The problem is that when GET-ing (in Chrome): http://foo:pwd@localhost:81/tag/string/list the following is the result Handler for Request not found: Request.HttpMethod: GET Request.HttpMethod: GET Request.PathInfo: /login Request.QueryString: System.Collections.Specialized.NameValueCollection Request.RawUrl: /login?redirect=http%3a%2f%2flocalhost%3a81%2ftag%2fstring%2flist which tells me that it redirected me to /login instead of serving the /tag/... request. Here's the entire code for my AppHost: public class AppHost : AppHostHttpListenerBase, IMessageSubscriber { private ITagProvider myTagProvider; private IMessageSender mySender; private const string UserName = "foo"; private const string Password = "pwd"; public AppHost( TagConfig config, IMessageSender sender ) : base( "BM App Host", typeof( AppHost ).Assembly ) { myTagProvider = new TagProvider( config ); mySender = sender; } public class CustomUserSession : AuthUserSession { public override void OnAuthenticated( IServiceBase authService, IAuthSession session, IOAuthTokens tokens, System.Collections.Generic.Dictionary<string, string> authInfo ) { authService.RequestContext.Get<IHttpRequest>().SaveSession( session ); } } public override void Configure( Funq.Container container ) { Plugins.Add( new MetadataFeature() ); container.Register<BeyondMeasure.WebAPI.Services.Tags.ITagProvider>( myTagProvider ); container.Register<IMessageSender>( mySender ); Plugins.Add( new AuthFeature( () => new CustomUserSession(), new AuthProvider[] { new CredentialsAuthProvider(), //HTML Form post of UserName/Password credentials new BasicAuthProvider(), //Sign-in with Basic Auth } ) ); container.Register<ICacheClient>( new MemoryCacheClient() ); var userRep = new InMemoryAuthRepository(); container.Register<IUserAuthRepository>( userRep ); string hash; string salt; new SaltedHash().GetHashAndSaltString( Password, out hash, out salt ); // Create test user userRep.CreateUserAuth( new UserAuth { Id = 1, DisplayName = "DisplayName", Email = "[email protected]", UserName = UserName, FirstName = "FirstName", LastName = "LastName", PasswordHash = hash, Salt = salt, }, Password ); } } Could someone please tell me what I'm doing wrong with either the SS configuration or how I am calling the service, i.e. why does it not accept the supplied user/pwd? Update1: Request/Response captured in Fiddler2when only BasicAuthProvider is used. No Auth header sent in the request, but also no Auth header in the response. GET /tag/string/AAA HTTP/1.1 Host: localhost:81 Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,sv;q=0.6 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ss-pid=Hu2zuD/T8USgvC8FinMC9Q==; X-UAId=1; ss-id=1HTqSQI9IUqRAGxM8vKlPA== HTTP/1.1 302 Found Location: /login?redirect=http%3a%2f%2flocalhost%3a81%2ftag%2fstring%2fAAA Server: Microsoft-HTTPAPI/2.0 X-Powered-By: ServiceStack/3,926 Win32NT/.NET Date: Sat, 10 Nov 2012 22:41:51 GMT Content-Length: 0 Update2 Request/Response with HtmlRedirect = null . SS now answers with the Auth header, which Chrome then issues a second request for and authentication succeeds GET http://localhost:81/tag/string/Abc HTTP/1.1 Host: localhost:81 Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,sv;q=0.6 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ss-pid=Hu2zuD/T8USgvC8FinMC9Q==; X-UAId=1; ss-id=1HTqSQI9IUqRAGxM8vKlPA== HTTP/1.1 401 Unauthorized Transfer-Encoding: chunked Server: Microsoft-HTTPAPI/2.0 X-Powered-By: ServiceStack/3,926 Win32NT/.NET WWW-Authenticate: basic realm="/auth/basic" Date: Sat, 10 Nov 2012 22:49:19 GMT 0 GET http://localhost:81/tag/string/Abc HTTP/1.1 Host: localhost:81 Connection: keep-alive Authorization: Basic Zm9vOnB3ZA== User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,sv;q=0.6 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ss-pid=Hu2zuD/T8USgvC8FinMC9Q==; X-UAId=1; ss-id=1HTqSQI9IUqRAGxM8vKlPA==

    Read the article

  • MouseMotionListener inside JTable

    - by Harish
    I am trying to add MouseMotion event to the label and move it based on the dragging of the mouse and make it move along with my mouse.However the mousemotion is very difficult to control making this action not usable. Here is the code import java.awt.Color; import java.awt.Component; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; public class TableTest { public TableTest() { String[] columnNames = { "FileName", "Integer" }; Object[][] data = { { new FileName("AAA.jpg", Color.YELLOW), new Integer(2) }, { new FileName("BBB.png", Color.GREEN), new FileName("BBB.png", Color.GREEN) }, { new FileName("CCC.jpg", Color.RED), new Integer(-1) }, }; DefaultTableModel model = new DefaultTableModel(data, columnNames) { public Class getColumnClass(int column) { System.out.println("column is" + column); return getValueAt(0, column).getClass(); } }; JTable table = new JTable(model); //JTable table = new JTable(data, columnNames); table.setDefaultRenderer(FileName.class, new FileNameCellRenderer()); final JLabel label = new JLabel("TESTING", SwingConstants.CENTER); label.setBackground(java.awt.Color.RED); label.setBounds(450, 100, 90, 20); label.setOpaque(true); label.setVisible(true); label.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent arg0) { label.setBounds(arg0.getX(), arg0.getY(), 90, 20); } public void mouseMoved(MouseEvent arg0) { // TODO Auto-generated method stub } }); table.add(label); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(table); frame.setSize(800, 600); frame.setLocationRelativeTo(null); frame.setVisible(true); } static class FileNameCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object v, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, v, isSelected, hasFocus, row, column); FileName fn = (FileName) v; setBorder(BorderFactory.createMatteBorder(0, 60, 0, 0, new java.awt.Color(143, 188, 143))); return this; } } static class FileName { public final Color color; public final String label; FileName(String l, Color c) { this.label = l; this.color = c; } public String toString() { return label; } } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new TableTest(); } }); } } I just want to make the label follow the label follow my mouse and the label should be attached to the table.Is there an easy way than this.

    Read the article

  • [Flex 4 and .Net] Retrieving tables from SQL database

    - by mG
    Hi everyone, As the title says, I want to retrieve tables of data from a SQL database, using Flex 4 and .Net WebService. I'm new to both Flex and DotNet. Please tell me a proper way to do it. This is what I've done so far: Retrieving an array of string: (this works) .Net: [WebMethod] public String[] getTestArray() { String[] arStr = { "AAA", "BBB", "CCC", "DDD" }; return arStr; } Flex 4: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.ResultEvent; [Bindable] private var ac:ArrayCollection = new ArrayCollection(); protected function btn_clickHandler(event:MouseEvent):void { ws.getTestArray(); } protected function ws_resultHandler(event:ResultEvent):void { ac = event.result as ArrayCollection; Alert.show(ac.toString()); } ]]> </fx:Script> <fx:Declarations> <s:WebService id="ws" wsdl="http://localhost:50582/Service1.asmx?WSDL" result="ws_resultHandler(event)"/> </fx:Declarations> <s:Button x="10" y="30" label="Button" id="btn" click="btn_clickHandler(event)"/> </s:Application> Retrieving a DataTable: (this does not work) DotNet: [WebMethod] public DataTable getUsers() { DataTable dt = new DataTable("Users"); SqlConnection conn = new SqlConnection("server = 192.168.1.50; database = MyDatabase; user id = sa; password = 1234; integrated security = false"); SqlDataAdapter da = new SqlDataAdapter("select vFName, vLName, vEmail from Users", conn); da.Fill(dt); return dt; } Flex 4: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.ResultEvent; [Bindable] private var ac:ArrayCollection = new ArrayCollection(); protected function btn_clickHandler(event:MouseEvent):void { ws.getUsers(); } protected function ws_resultHandler(event:ResultEvent):void { ac = event.result as ArrayCollection; Alert.show(ac.toString()); } ]]> </fx:Script> <fx:Declarations> <s:WebService id="ws" wsdl="http://localhost:50582/Service1.asmx?WSDL" result="ws_resultHandler(event)"/> </fx:Declarations> <s:Button x="10" y="30" label="Button" id="btn" click="btn_clickHandler(event)"/> </s:Application>

    Read the article

  • JavaMail SMTP credentials verification, without actually sending an email.

    - by DarK
    Hi, Is there a way to check user SMTP server credentials without sending email, or connecting to POP/IMAP. Some code I tried to write, fails at it. Can you find what is missing there. Don't worry about Email / password. I know it's there. NOTE : If you are trying out the code. The case 1 should pass when supplying the correct credentials. If it fails, then someone changed the password. You should use some other email address. import java.util.Properties; import javax.mail.Authenticator; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; public class EmailTest { public static void main(String[] args) { EmailHelper eh = new EmailHelper(); /* GMail Setting for SMTP using STARTTLS */ String name = "AAA"; String email = "[email protected]"; String smtpHost = "smtp.gmail.com"; String serverPort = "587"; String requireAuth = "true"; String dontuseAuth = "false"; String userName = email; // same as username for GMAIL String password = "zaq12wsx"; String incorrectPassword = "someRandomPassword"; String enableSTARTTLS = "true"; String dontenableSTARTTLS = "false"; try { /* only valid case */ eh.sendMail(name, email, smtpHost, serverPort, requireAuth, userName, password, enableSTARTTLS); System.out.println("Case 1 Passed"); /* should fail since starttls is required for GMAIL. */ eh.sendMail(name, email, smtpHost, serverPort, requireAuth, userName, password, dontenableSTARTTLS); System.out.println("Case 2 Passed"); /* should fail since GMAIL requires authentication */ eh.sendMail(name, email, smtpHost, serverPort, dontuseAuth, "", "", dontenableSTARTTLS); System.out.println("Case 3 Passed"); /* should fail. password is incorrect and starttls is not enabled */ eh.sendMail(name, email, smtpHost, serverPort, requireAuth, userName, incorrectPassword, dontenableSTARTTLS); System.out.println("Case 4 Passed"); } catch (MessagingException e) { e.printStackTrace(); } } } class EmailHelper { private Properties properties = null; private Authenticator authenticator = null; private Session session = null; public void sendMail(String name, String email, String smtpHost, String serverPort, String requireAuth, String userName, String password, String enableSTARTTLS) throws MessagingException { properties = System.getProperties(); properties.put("mail.smtp.host", smtpHost); properties.put("mail.smtp.port", serverPort); properties.put("mail.smtp.starttls.enable", enableSTARTTLS); properties.put("mail.smtp.auth", requireAuth); properties.put("mail.smtp.timeout", 20000); authenticator = new SMTPAuthenticator(userName, password); session = Session.getInstance(properties, authenticator); // session.setDebug(true); Transport tr = session.getTransport("smtp"); tr.connect(); /* * do I need more than just connect? Since when i try to send email with * incorrect credentials it fails to do so. But I want to check * credentials without sending an email. Assume that POP3/IMAP username * is not same as the SMTP username, since that might be one of the * cases */ } } class SMTPAuthenticator extends Authenticator { private String userName = null; private String password = null; public SMTPAuthenticator(String userName, String password) { this.userName = userName; this.password = password; } @Override public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(userName, password); } }

    Read the article

  • Java client listening to WebSphere MQ Server?

    - by user595234
    I need to write a Java client listening to WebSphere MQ Server. Message is put into a queue in the server. I developed this code, but am not sure it is correct or not. If correct, then how can I test it? This is a standalone Java project, no application server support. Which jars I should put into classpath? I have the MQ settings, where I should put into my codes? Standard JMS can skip these settings? confusing .... import javax.jms.Destination; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageListener; import javax.jms.Queue; import javax.jms.QueueConnection; import javax.jms.QueueConnectionFactory; import javax.jms.QueueReceiver; import javax.jms.QueueSession; import javax.jms.Session; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; public class Main { Context jndiContext = null; QueueConnectionFactory queueConnectionFactory = null; QueueConnection queueConnection = null; QueueSession queueSession = null; Queue controlQueue = null; QueueReceiver queueReceiver = null; private String queueSubject = ""; private void start() { try { queueConnection.start(); queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Destination destination = queueSession.createQueue(queueSubject); MessageConsumer consumer = queueSession.createConsumer(destination); consumer.setMessageListener(new MyListener()); } catch (Exception e) { e.printStackTrace(); } } private void close() { try { queueSession.close(); queueConnection.close(); } catch (Exception e) { e.printStackTrace(); } } private void init() { try { jndiContext = new InitialContext(); queueConnectionFactory = (QueueConnectionFactory) this.jndiLookup("QueueConnectionFactory"); queueConnection = queueConnectionFactory.createQueueConnection(); queueConnection.start(); } catch (Exception e) { System.err.println("Could not create JNDI API " + "context: " + e.toString()); System.exit(1); } } private class MyListener implements MessageListener { @Override public void onMessage(Message message) { System.out.println("get message:" + message); } } private Object jndiLookup(String name) throws NamingException { Object obj = null; if (jndiContext == null) { try { jndiContext = new InitialContext(); } catch (NamingException e) { System.err.println("Could not create JNDI API " + "context: " + e.toString()); throw e; } } try { obj = jndiContext.lookup(name); } catch (NamingException e) { System.err.println("JNDI API lookup failed: " + e.toString()); throw e; } return obj; } public Main() { } public static void main(String[] args) { new Main(); } } MQ Queue setting <queue-manager> <name>AAA</name> <port>1423</port> <hostname>ddd</hostname> <clientChannel>EEE.CLIENTS.00</clientChannel> <securityClass>PKIJCExit</securityClass> <transportType>1</transportType> <targetClientMatching>1</targetClientMatching> </queue-manager> <queues> <queue-details id="queue-1"> <name>GGGG.NY.00</name> <transacted>false</transacted> <acknowledgeMode>1</acknowledgeMode> <targetClient>1</targetClient> </queue-details> </queues>

    Read the article

  • Algorithm to select groups of similar items in 2d array

    - by mafutrct
    There is a 2d array of items (in my case they are called Intersections). A certain item is given as a start. The task is to find all items directly or indirectly connected to this item that satisfy a certain function. So the basic algorithm is like this: Add the start to the result list. Repeat until no modification: Add each item in the array that satisfies the function and touches any item in the result list to the result list. My current implementation looks like this: private IList<Intersection> SelectGroup ( Intersection start, Func<Intersection, Intersection, bool> select) { List<Intersection> result = new List<Intersection> (); Queue<Intersection> source = new Queue<Intersection> (); source.Enqueue (start); while (source.Any ()) { var s = source.Dequeue (); result.Add (s); foreach (var neighbour in Neighbours (s)) { if (select (start, neighbour) && !result.Contains (neighbour) && !source.Contains (neighbour)) { source.Enqueue (neighbour); } } } Debug.Assert (result.Distinct ().Count () == result.Count ()); Debug.Assert (result.All (x => select (x, result.First ()))); return result; } private List<Intersection> Neighbours (IIntersection intersection) { int x = intersection.X; int y = intersection.Y; List<Intersection> list = new List<Intersection> (); if (x > 1) { list.Add (GetIntersection (x - 1, y)); } if (y > 1) { list.Add (GetIntersection (x, y - 1)); } if (x < Size) { list.Add (GetIntersection (x + 1, y)); } if (y < Size) { list.Add (GetIntersection (x, y + 1)); } return list; } (The select function takes a start item and returns true iff the second item satisfies.) This does its job and turned out to be reasonable fast for the usual array sizes (about 20*20). However, I'm interested in further improvements. Any ideas? Example (X satisfies in relation to other Xs, . does never satisfy): .... XX.. .XX. X... In this case, there are 2 groups: a central group of 4 items and a group of a single item in the lower left. Selecting the group (for instance by starting item [2, 2]) returns the former, while the latter can be selected using the starting item and sole return value [0, 3]. Example 2: .A.. ..BB A.AA This time there are 4 groups. The 3 A groups are not connected, so they are returned as separate groups. The bigger A and B groups are connected, but A does not related to B so they are returned as separate groups.

    Read the article

  • python socket related question.

    - by paul
    Hello,All im totally new to socket programming in python. i was read some tutorial and manual, but i didn't found what i want to make python related socket script in manual or tutorial. i want to make socket script which can send some info to server and also receive some info from server. For example, i want to send my login information to server, and want to receive result reply from server. but i have no idea..how to send my login information(id and password) to server. i was captured with wireshark, some process to send login info to server. and i was found port number is 5300 and server ip is 58.225.56.152 and i was send id is 'aaaaaaa' and password 'bbbbbbb' and i was received 'USER NOT FOUND' result from server. how can i make this kind of process with python socket ? if anyone help me some reference or some example or anything help much appreciate! 0000 00 50 56 f2 c8 cc 00 0c 29 a8 f8 c0 08 00 45 00 .PV.....).....E. 0010 00 e2 2a 19 40 00 80 06 d0 55 c0 a8 cb 85 3a e1 ..*[email protected]....:. 0020 38 98 05 f3 15 9a b9 86 62 7b 0d ab 0f ba 50 18 8.......b{....P. 0030 fa f0 26 14 00 00 50 54 3f 09 a2 91 7f 13 00 00 ..&...PT?....... 0040 00 1f 14 00 02 00 00 00 00 00 00 00 07 00 00 00 ................ 0050 61 61 61 61 61 61 61 50 54 3f 09 a2 91 7f 8b 00 aaaaaaaPT?...... 0060 00 00 1f 15 00 08 00 00 00 07 00 00 00 61 61 61 .............aaa 0070 61 61 61 61 07 00 00 00 62 62 62 62 62 62 62 01 aaaa....bbbbbbb. 0080 00 00 00 31 02 00 00 00 4b 52 0f 00 00 00 31 39 ...1....KR....19 0090 32 2e 31 36 38 2e 32 30 33 2e 31 33 33 30 00 00 2.168.203.1330.. 00a0 00 4d 69 63 72 6f 73 6f 66 74 20 57 69 6e 64 6f .Microsoft Windo 00b0 77 73 20 58 50 20 50 72 6f 66 65 73 73 69 6f 6e ws XP Profession 00c0 61 6c 20 53 65 72 76 69 63 65 20 50 61 63 6b 20 al Service Pack 00d0 32 14 00 00 00 31 30 30 31 33 30 30 35 33 31 35 2....10013005315 00e0 37 38 33 37 32 30 31 32 33 03 00 00 00 34 37 30 783720123....470 0000 00 0c 29 a8 f8 c0 00 50 56 f2 c8 cc 08 00 45 00 ..)....PV.....E. 0010 00 28 ae 37 00 00 80 06 8c f1 3a e1 38 98 c0 a8 .(.7......:.8... 0020 cb 85 15 9a 05 f3 0d ab 0f ba b9 86 63 35 50 10 ............c5P. 0030 fa f0 5f 8e 00 00 00 00 00 00 00 00 .._......... 0000 00 0c 29 a8 f8 c0 00 50 56 f2 c8 cc 08 00 45 00 ..)....PV.....E. 0010 00 4c ae 38 00 00 80 06 8c cc 3a e1 38 98 c0 a8 .L.8......:.8... 0020 cb 85 15 9a 05 f3 0d ab 0f ba b9 86 63 35 50 18 ............c5P. 0030 fa f0 3e 75 00 00 50 54 3f 09 a2 91 7f 16 00 00 ..>u..PT?....... 0040 00 1f 18 00 01 00 00 00 0e 00 00 00 55 73 65 72 ............User 0050 20 4e 6f 74 20 46 6f 75 6e 64 Not Found

    Read the article

  • Linq To Xml problems using XElement's method Elements(XName)

    - by Dorian McHensie
    Hello everyone. I have a problem using Linq To Xml. A simple code. I have this XML: <?xml version="1.0" encoding="utf-8" ?> <data xmlns="http://www.xxx.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xxx.com/directory file.xsd"> <contact> <name>aaa</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> <contact> <name>sss</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> <contact> <name>bbb</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> <contact> <name>ccc</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> I want to get every contact mapping it on an object Contact. To do this I use this fragment of code: XDocument XDoc = XDocument.Load(System.Web.HttpRuntime.AppDomainAppPath + this.filesource); XElement XRoot = XDoc.Root; //XElement XEl = XElement.Load(this.filesource); var results = from e in XRoot.Elements("contact") select new Contact((string)e.Element("name"), (string)e.Element("email"), "1-1-1", null, null); List<Contact> cntcts = new List<Contact>(); foreach (Contact cntct in results) { cntcts.Add(cntct); } Contact[] c = cntcts.ToArray(); // Encapsulating element Elements<Contact> final = new Elements<Contact>(c); Ok just don't mind that all: focus on this: When I get the root node, it is all right, I get it correctly. When I use the select directive I try to get every node saying: from e in XRoot.Elements("contact") OK here's the problem: if I use: from e in XRoot.Elements() I get all contact nodes, but if I use: from e in XRoot.Elements("contact") I GET NOTHING: Empty SET. OK you tell me: Use the other one: OK I DO SO, let's use: from e in XRoot.Elements(), I get all nodes anyway, THAT's RIGHT BUT HERE COMES THE OTHER PROBLEM: When Saying: select new Contact((string)e.Element("name"), (string)e.Element("email"), "1-1-1", null, null); I Try to access <name>, <email>... I HAVE TO USE .Element("name") AND IT DOES NOT WORK TOO!!!!!!!!WHAT THE HELL IS THIS????????????? IT SEEMS THAT I DOES NOT MATCH THE NAME I PASS But how is it possible. I know that Elements() function takes, overloaded, one argument that is an XName which is mapped onto a string. Please consider that the code I wrote come from an example, It should work. Please somebody help me. THANKS IN ADVANCE

    Read the article

  • how to make a javascript number keypad popup

    - by user2434653
    i have a website with 3 pages. each page has a form with two input fields. i am trying to make a popup number-keypad that will populate what ever input field called it. below is that base code i keep coming back to. <html> <head><title>test</title></head> <body> <script> function num(id) { return document.getElementById(id); } </script> <form action="/unitPage" method="POST" style=" text-align:center;"> Prefix: <input id="num" name"prefix" type="text" onfocus="num('keypad').style.display='inline-block';"/> Number: <input id="num" name"number" type="text" pattern="[0-9]{6}" onfocus="num('keypad').style.display='inline-block';"/> </form> <div id="keypad" style="display:none; background:#AAA; vertical-align:top;"> <input type="button" value="7" onclick="num('num').value+=7;"/> <input type="button" value="8" onclick="num('num').value+=8;"/> <input type="button" value="9" onclick="num('num').value+=9;"/><br/> <input type="button" value="4" onclick="num('num').value+=4;"/> <input type="button" value="5" onclick="num('num').value+=5;"/> <input type="button" value="6" onclick="num('num').value+=6;"/><br/> <input type="button" value="1" onclick="num('num').value+=1;"/> <input type="button" value="2" onclick="num('num').value+=2;"/> <input type="button" value="3" onclick="num('num').value+=3;"/><br/> <input type="button" value="X" onclick="num('keypad').style.display='none'"/> <input type="button" value="0" onclick="num('num').value+=0;"/> <input type="button" value="&larr;" onclick="num('num').value=num('num').value.substr(0,num('num').value.length-1);"/> </div> </body> </html> is there a way of making one number key pad that i call from any page or do i need to make the above for each input? thanks

    Read the article

  • Android never receives UDP packet

    - by Quandary
    The below code results in a timeout. It works fine on non-Android Java. What's the matter? //@Override public static void run() { //System.out.println ( "Local Machine IP : "+addrStr.toString ( ) ) ; HelloWorldActivity.tv.setText("Trace 1"); try { // Retrieve the ServerName InetAddress serverAddr; //= InetAddress.getByName(Server.SERVERIP); InetAddress ias[] = InetAddress.getAllByName(Server.SERVERNAME); serverAddr = ias[0]; Log.d("UDP", "C: Connecting..."); /* Create new UDP-Socket */ DatagramSocket socket = new DatagramSocket(); /* Prepare some data to be sent. */ String strQuery="ÿÿÿÿgetservers"+" "+Server.iProtocol+" "+"'all'"; Log.d("UDP", strQuery); //byte[] buf = ("ÿÿÿÿgetservers 68 'all'").getBytes(); byte[] buf = strQuery.getBytes(); /* Create UDP-packet with * data & destination(url+port) */ DatagramPacket packet = new DatagramPacket(buf, buf.length, serverAddr, Server.SERVERPORT); Log.d("UDP", "C: Sending: '" + new String(buf) + "'"); /* Send out the packet */ socket.setSoTimeout(5000); socket.send(packet); Log.d("UDP", "C: Sent."); Log.d("UDP", "C: Done."); // http://code.google.com/p/android/issues/detail?id=2917 byte[] buffer= new byte[1024*100]; DatagramPacket receivePacket = new DatagramPacket(buffer, buffer.length); //, serverAddr, Server.SERVERPORT); socket.receive(receivePacket); HelloWorldActivity.tv.setText("TTT"); String x = new String(receivePacket.getData()); Log.d("UDP", "C: Received: '" + x + "'"); HelloWorldActivity.tv.setText(x); } catch (Exception e) { HelloWorldActivity.tv.setText(e.getMessage()); Log.e("UDP", "C: Error", e); } } public class Server { /* //public static java.lang.string SERVERIP; public static String SERVERNAME = "monster.idsoftware.com"; public static String SERVERIP = "192.246.40.56"; public static int SERVERPORT = 27950; public static int PROTOCOL = 68; */ //public static String SERVERNAME="monster.idsoftware.com"; public static String SERVERNAME="dpmaster.deathmask.net"; public static String SERVERIP="192.246.40.56"; public static int SERVERPORT=27950; //public static int iProtocol= 68; // Quake3 public static int iProtocol=71; // OpenArena } Android manifest: <?xml version="1.0" encoding="utf-8"?> <use-permission id="android.permission.READ_CONTACTS" /> <use-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_GPS" /> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" /> <uses-permission android:name="android.permission.ACCESS_CELL_ID" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <application android:icon="@drawable/icon" android:label="AAA New Application" > <activity android:name="HelloWorldActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>

    Read the article

  • RapidXML - does not compile ?

    - by milan
    Hi, I am novice to rapidXML but first impresion was not positive, I made simple Visual Studio 6 C++ Hello World Application and added RapidXML hpp files to project and in main.cpp I put: #include "stdafx.h" #include < iostream > #include < string > #include "rapidxml.hpp" using namespace std; using namespace rapidxml; int main ( ) { char x[] = "<Something>Text</Something>\0" ; //<<<< funktioniert, aber mit '*' nicht xml_document<> doc ; doc.parse<0>(x) ; cout << "Name of my first node is: " << doc.first_node()->name() << endl ; xml_node<>* node = doc.first_node("Something") ; cout << "Node 'Something' has value: " << node->value() << endl ; } And it does not compile, any help ? Is RapidXML possible to run with Visual Studio 6 ? Error I am getting are: --------------------Configuration: aaa - Win32 Debug-------------------- Compiling... rapidxml.cpp c:\Parser\rapidxml.cpp(310) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(320) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(320) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(385) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(417) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(417) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(448) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(448) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(476) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(579) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(599) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(639) : see reference to class template instantiation 'rapidxml::memory_pool<Ch>' being compiled c:\Parser\rapidxml.cpp(681) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(790) : see reference to class template instantiation 'rapidxml::xml_base<Ch>' being compiled c:\Parser\rapidxml.cpp(700) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(790) : see reference to class template instantiation 'rapidxml::xml_base<Ch>' being compiled c:\Parser\rapidxml.cpp(721) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(790) : see reference to class template instantiation 'rapidxml::xml_base<Ch>' being compiled c:\Parser\rapidxml.cpp(751) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(790) : see reference to class template instantiation 'rapidxml::xml_base<Ch>' being compiled c:\Parser\rapidxml.cpp(786) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(790) : see reference to class template instantiation 'rapidxml::xml_base<Ch>' being compiled c:\Parser\rapidxml.cpp(787) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(790) : see reference to class template instantiation 'rapidxml::xml_base<Ch>' being compiled c:\Parser\rapidxml.cpp(836) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(876) : see reference to class template instantiation 'rapidxml::xml_attribute<Ch>' being compiled c:\Parser\rapidxml.cpp(856) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(876) : see reference to class template instantiation 'rapidxml::xml_attribute<Ch>' being compiled c:\Parser\rapidxml.cpp(936) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(1345) : see reference to class template instantiation 'rapidxml::xml_node<Ch>' being compiled c:\Parser\rapidxml.cpp(958) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(1345) : see reference to class template instantiation 'rapidxml::xml_node<Ch>' being compiled c:\Parser\rapidxml.cpp(981) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(1345) : see reference to class template instantiation 'rapidxml::xml_node<Ch>' being compiled c:\Parser\rapidxml.cpp(1004) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(1345) : see reference to class template instantiation 'rapidxml::xml_node<Ch>' being compiled c:\Parser\rapidxml.cpp(1025) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(1345) : see reference to class template instantiation 'rapidxml::xml_node<Ch>' being compiled c:\Parser\rapidxml.cpp(1045) : error C2039: 'size_t' : is not a member of 'std' c:\Parser\rapidxml.cpp(1345) : see reference to class template instantiation 'rapidxml::xml_node<Ch>' being compiled Error executing cl.exe. rapidxml.obj - 25 error(s), 0 warning(s)

    Read the article

  • jQuery ajax doesn't seem to be reading HTML data in Chromium

    - by Mahesh
    I have an HTML (App) file that reads another HTML (data) file via jQuery.ajax(). It then finds specific tags in the data HTML file and uses text within the tags to display sort-of tool tips. Here's the App HTML file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>Test</title> <style type="text/css"> <!--/* <![CDATA[ */ body { font-family : sans-serif; font-size : medium; margin-bottom : 5em; } a, a:hover, a:visited { text-decoration : none; color : #2222aa; } a:hover { background-color : #eeeeee; } #stat_preview { position : absolute; background : #ccc; border : thin solid #aaa; padding : 3px; font-family : monospace; height : 2.5em; } /* ]]> */--> </style> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { $("#stat_preview").hide(); $(".cfg_lnk").mouseover(function () { lnk = $(this); $.ajax({ url: lnk.attr("href"), success: function (data) { console.log (data); $("#stat_preview").html("A heading<br>") .append($(".tool_tip_text", $(data)).slice(0,3).text()) .css('left', (lnk.offset().left + lnk.width() + 30)) .css('top', (lnk.offset().top + (lnk.height()/2))) .show(); } }); }).mouseout (function () { $("#stat_preview").hide(); }); }); //]]> </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <h1>Test</h1> <ul> <li><a class="cfg_lnk" href="data.html">Sample data</a></li> </ul> <div id="stat_preview"></div> </body> </html> And here is the data HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <h1>Test</h1> <table> <tr> <td class="tool_tip_text"> Some random value 1</td> <td class="tool_tip_text"> Some random value 2</td> <td class="tool_tip_text"> Some random value 3</td> <td class="tool_tip_text"> Some random value 4</td> <td class="tool_tip_text"> Some random value 5</td> </tr> <tr> <td class="tool_top_text"> Some random value 11</td> <td class="tool_top_text"> Some random value 21</td> <td class="tool_top_text"> Some random value 31</td> <td class="tool_top_text"> Some random value 41</td> <td class="tool_top_text"> Some random value 51</td> </tr> </table> </body> </html> This is working as intended in Firefox, but not in Chrome (Chromium 5.0.356.0). The console.log (data) displays empty string in Chromium's JavaScript console. Firebug in Firefox, however, displays the entire data HTML. Am I missing something? Any pointers?

    Read the article

  • CodePlex Daily Summary for Friday, June 10, 2011

    CodePlex Daily Summary for Friday, June 10, 2011Popular ReleasesZen4Sync, Orchestration and Test Load platform for SQL Server Merge Replication: Zen4Sync Report 1.0 - Excel Add-In: Zen4Sync Report is an Excel Add-In allowing you to generate reports based on the data generated by your Test Sessions. Choose a Zen4Sync Report release according to your version of Excel. The downloaded .zip archive contains all the resources needed to install the Zen4Sync Report Add-In for your version of Excel. For instrunctions on how to install, use and customize Zen4Sync Report, please see the Zen4Sync Report Guide.Candescent NUI: Candescent NUI Start Menu: This is the first version of the Candescent NUI Start Menu. There is currently only one item in the start menu by default (Windows Explorer). There is no user interface for configuration yet, but you can add programs yourself by adding lines to the file menu_config.csv. Please don't change the first line. Lines for programs have the following format: Name;Path Default Explorer;c:\windows\explorer.exe MyApp;c:\...\myapp.exe To show the menu, present your open hand to the kinect at a distan...Media Companion: MC 3.406b weekly: An minor issue was found with 3.406b, the fixed version is now posted.... Extract the entire archive to a folder which has user access rights, eg desktop, documents etc. Refer to the documentation on this site for the Installation & Setup Guide Important! If you find MC not displaying movie data properly, please try a 'movie rebuild' to reload the data from the nfo's into MC's cache. Fixes Movies Readded movie preference to rename invalid or scene nfo's to info extension Fix crash during ...SCCM Client Actions Tool: SCCM Client Actions Tool v0.5.1: SCCM Client Actions Tool v0.5.1 is currently the most stable version and includes all of the functionality requested so far. It comes with following changes since last version: Fixed an incorrect path to x64 client setup folder. It comes as a ZIP file that contains three files: ClientActionsTool.hta – The tool itself. Cmdkey.exe – command line tool for managing cached credentials. This is needed for alternate credentials feature when running the HTA on Windows XP. Cmdkey.exe is natively a...Windows Azure VM Assistant: AzureVMAssist V1.0.0.5: AzureVMAssist V1.0.0.5 (Debug) - Test Release VersionSizeOnDisk: 1.8.0.3: Fix (issue 317): Main window icon loading error on windows server 2003 32bit runing on x86 cpu. Bypass of the Microsoft windows comexception.SketchFlow Template for Windows Phone: SketchFlow Template for Windows Phone 7: Initial release. Please make sure you are using a version of Blend with SketchFlow enabled and have also installed the the Mango developer tools for Windows Phone. fastJSON: v1.8: - Silverlight 4.0+ support merged - RegisterCustomType() for user defined serialization/deserialization without changing the source code open closed principalNetOffice - The easiest way to use Office in .NET: NetOffice Release 0.9: Changes: - fix examples (include issue 16026) - add new examples - 32Bit/64Bit Walkthrough is now available in technical Documentation. Includes: - Runtime Binaries and Source Code for .NET Framework:......v2.0, v3.0, v3.5, v4.0 - Tutorials in C# and VB.Net:..............................................................COM Proxy Management, Events, etc. - Examples in C# and VB.Net:............................................................Excel, Word, Outlook, PowerPoint, Access - COMAddi...Reusable Library: V1.1.3: A collection of reusable abstractions for enterprise application developerClosedXML - The easy way to OpenXML: ClosedXML 0.54.0: New on this release: 1) Mayor performance improvements. 2) AdjustToContents now take into account the text rotation. 3) Fixed issues 6782, 6784, 6788HTML-IDEx: HTML-IDEx .15 ALPHA: This release fixes line counting a little bit and adds the masshighlight() sub, which highlights pasted and inserted code.AutoLoL: AutoLoL v2.0.3: - Improved summoner spells are now displayed - Fixed some of the startup errors people got - Double clicking an item selects it - Some usability changes that make using AutoLoL just a little easier - Bug fixes AutoLoL v2 is not an update, but an entirely new version! Please install to a different directory than AutoLoL v1Host Profiles: Host Profiles 1.0: Host Profiles 1.0 Release Quickly modify host file Automatically flush dnsVidCoder: 0.9.2: Updated to HandBrake 4024svn. This fixes problems with mpeg2 sources: corrupted previews, incorrect progress indicators and encodes that incorrectly report as failed. Fixed a problem that prevented target sizes above 2048 MB.SharePoint Search XSL Samples: SharePoint 2010 Samples: I have updated some of the samples from the 2007 release. These all work in SharePoint 2010. I removed the Pivot on File Extension because SharePoint 2010 search has refiners that perform the same function.AcDown????? - Anime&Comic Downloader: AcDown????? v3.0 Beta5: ??AcDown?????????????,??????????????,????、????。?????Acfun????? ????32??64? Windows XP/Vista/7 ????????????? ??:????????Windows XP???,?????????.NET Framework 2.0???(x86)?.NET Framework 2.0???(x64),?????"?????????"??? ??v3.0 Beta5 ?????????? ???? ?? ???????? ???"????????"?? ????????????? ????????/???? ?? ???"????"??? ?? ??????????? ?? ?? ??????????? ?? ?????????????????? ??????????????????? ???????????????? ????????????Discussions???????? ????AcDown??????????????VFPX: GoFish 4 Beta 1: Current beta is Build 144 (released 2011-06-07 ) See the GoFish4 info page for details and video link: http://vfpx.codeplex.com/wikipage?title=GoFishSterling NoSQL OODB for .NET 4.0, Silverlight 4 and 5, and Windows Phone 7: Sterling OODB v1.5: Welcome to the Sterling 1.5 RTM. This version is backwards compatible without modification to the 1.4 beta. For the 1.0, you will need to upgrade your database. Please see this discussion for details. You must modify your 1.0 code for persistence. The 1.5 version defaults to an in-memory driver. To save to isolated storage or use one of the new mechanisms, see the available drivers and pass an instance of the appropriate one to your database (different databases may use different drivers). ...patterns & practices: Project Silk: Project Silk Community Drop 10 - June 3, 2011: Changes from previous drop: Many code changes: please see the readme.mht for details. New "Application Notifications" chapter. Updated "Server-Side Implementation" chapter. Guidance Chapters Ready for Review The Word documents for the chapters are included with the source code in addition to the CHM to help you provide feedback. The PDF is provided as a separate download for your convenience. Installation Overview To install and run the reference implementation, you must perform the fol...New ProjectsAngry Apps: A game platform written on top of XNA Game Studio. The purpose of this project is to project a vanilla type Game project which can be used in many types of games.BLooD_ICQ: bloodicqCloud Fox: Cloud Fox is a Windows Phone application that allows you to view your Firefox Sync data on your mobile phone. It is similar to Firefox Home for iPhone. The current version will target phones running NoDo, but future versions will eventually require Mango. The application is developed in C# using Silverlight, Json.Net, Mvvm Light and Ninject.Configuration files Merger: This program is to help to merge different config files(environmental difference) and common config file into a single web.config/app.config. CRM 2011 Plugin Utilities: This project contains utilities from CRM 2011 plugins. Genera/calculate full name of a custom entity given the first, last and middle name.CUDA driver API: Making the CUDA driver API as simple to use as the runtime API. Almost.DBXMLTransfer: Command line application that: 1) extracts xml returned by a stored procedure to a file and 2) passes xml contained in a file to a stored procedure (which can use it for inserts & updates for example)Dot Generator: This is a project I did to generate numbers using the number of the dots in the number it self to get a visual representation of how big larg numbers areDRYlib.Net: DRY (Don't Repeat Yourself) -- or, in other words, code-reuse -- makes me create this Class Library so I don't have to keep creating the same code here and there. Feel free to use these snippets. I'm releasing them under a permissive license (Apache Public License 2.0). The DRYlib is created using Visual BASIC 2010 Express. What you can find in this DRYlib include, but not limited to: * CRC Hash algorithms * Simple, high-performance Integer extensions * Simple, oft-used Stri...DW.Configurations: DW.Configurations - Enables an easy handling of application settings Please see www.my.libraries.de for more information and documentation.DW.Game.MauMau: Its a MauMau game with the possibility to define all rules DW.Game.Sudoku: It's just a Sudoku gameDW.Interactivity: DW.Interactivity - Brings additional functionalities to WPF controls Please see www.my.libraries.de for more information and documentation.DW.Logging: DW.Logging - Supports an easy working with log files Please see www.my.libraries.de for more information and documentation.DW.Services: DW.Services - Brings standard services Please see www.my.libraries.de for more information and documentation.DW.SharpTools: DW.SharpTools - Brings additional possibilities to C# Please see www.my.libraries.de for more information and documentation.DW.UnitTests: DW.UnitTests - Gives some objects for easy UnitTests Please see www.my.libraries.de for more information and documentation.DW.WPFDev: DW.WPFDev - Some useful objects for developing custom controls and behaviors Please see www.my.libraries.de for more information and documentation.DW.WPFToolkit: DW.WPFToolkit - A custom controls library Please see www.my.libraries.de for more information and documentation.Elucidate: A GUI to drive the SnapRAID command line (All supported platforms): Definition: explain in detail Synonyms: annotate, clarify, clear, clear up, decode, demonstrate, enlighten, exemplify, explicate, expound, get across, illuminate, illustrate, interpret, make perfectly clear This will take on the task of creating a SnapRAID GUI to drive it's command line options, but give a little help and clarification (And logging) to guide the novice user.FixWordProperties for Office 2003, 2007 and 2010: Ken Getz originally wrote the FixWordProperties I believe in 2006. I had a a few extra requirements like the ability to unlock locked files, without passwords, using the office interop model, instead of word and a few more things that I needed in the winter of 2007.Information System Alumni Community: Here is our Internet Programming project. This site help alumni to always keep interact with their friends through this site.They can track his friend name, city, occupation and then interact with them to (whoa..like Social Network right!!).Go check this out int main code samples: Repository for all demos/samples posted at http://blog.r2d2rigo.es/english/LarX - XNA Game Engine: LarX is an XNA Game Engine, 2D and 3D, that uses SunBurn for Rendering, sgMotion for animations, and BEPU for Physics. It enables developers to write quicly AAA games.Membership, Role and Profile Providers for develop, debug, test: These ASP.NET providers for Membership, Roles and Profiles are valuable during development, debugging and testing due to the ease of creating, removing and changing users, user roles, etc. Music search engine: Ilovethismusic.com lets you listen & download music based on your mood, weather, or any type of expression you can think of. Just press Play.NicolasLight: This is for business projectOlympic.Magazine: sport supplements e-shop projectProject Obscura: Project Obscura is a game about to be in development by a group of friends, more data soon...RegularExpressionTest: .SalesManagementSystem: SalesManagementSystemShoozla: Very simple and powerful tool to search for missing covers. It finds album covers automatically and periodically. It uses LASTFM web service (website registration needed). WPF Application developed in C# following a MVVM design pattern.Silverlight Mind Map demo: A Mind Map control library and sample application created in Silveright. Although the library can be useful by itself, the main goal of this project is to server as a demo and reference application for Wiki that shows different Silverlight testing techniques. SketchFlow Template for Windows Phone: The SketchFlow Template for Windows Phone adds a new SketchFlow template for Expression Blend users, making it fast and easy to prototype Windows Phone applications.Smart Blog: Smart Blog ????,??ASP.NET??,?????Entity Framework、MVC 3.0(razor)、WCF???。???????SqlCE?????,????????,????、??。 SQLiteManager (sys_27): SQLiteManager makes for manage SQLite Database. It's developed in C#. (WPF and use MVVM-patern)testing access to TFS: This is a just a trivial set of test files to learn about TFS. I am testing each step of this process and will try to document it for others. Maybe this is obvious to others, but I am still learning TFS.TFS NuGetter: NuGetter is a TFS 2010 Build Activity designed to provide packaging and deployment management to projects destined for a NuGet Gallery.

    Read the article

  • CodePlex Daily Summary for Thursday, December 06, 2012

    CodePlex Daily Summary for Thursday, December 06, 2012Popular ReleasesPeriodic.Net: 0.8: Whats new for Periodic.Net 0.8: New Element Info Dialog New Website MenuItem Minor Bug Fix's, improvements and speed upsXLS File Deployment: XLS File Deployment V1.0: Initial releasemp3player-xslt-plugin: mp3player module 1.0: This is a mp3 player module that you can install on your umbraco project. It can display the list of the media and you can click the button to play or stop.Yahoo! UI Library: YUI Compressor for .Net: Version 2.2.0.0 - Epee: New : Web Optimization package! Cleaned up the nuget packages BugFix: minifying lots of files will now be faster because of a recent regression in some code. (We were instantiating something far too many times).DtPad - .NET Framework text editor: DtPad 2.9.0.40: http://dtpad.diariotraduttore.com/files/images/flag-eng.png English + A new built-in editor for the management of CSV files, including the edit of cells, deleting and adding new rows, replacement of delimiter character and much more (issue #1137) + The limit of rows allowed before the decommissioning of their side panel has been raised (new default: 1.000) (issue #1155, only partially solved) + Pressing CTRL+TAB now DtPad opens a screen that shows the list of opened tabs (issue #1143) + Note...AvalonDock: AvalonDock 2.0.1746: Welcome to the new release of AvalonDock 2.0 This release contains a lot (lot) of bug fixes and some great improvements: Views Caching: Content of Documents and Anchorables is no more recreated everytime user move it. Autohide pane opens really fast now. Two new themes Expression (Dark and Light) and Metro (both of them still in experimental stage). If you already use AD 2.0 or plan to integrate it in your future projects, I'm interested in your ideas for new features: http://avalondock...AcDown?????: AcDown????? v4.3.2: ??●AcDown??????????、??、??、???????。????,????,?????????????????????????。???????????Acfun、????(Bilibili)、??、??、YouTube、??、???、??????、SF????、????????????。 ●??????AcPlay?????,??????、????????????????。 ● AcDown??????????????????,????????????????????????????。 ● AcDown???????C#??,????.NET Framework 2.0??。?????"Acfun?????"。 ?? v4.3.2?? ?????????????????? ??Acfun??????? ??Bilibili?????? ??Bilibili???????????? ??Bilibili????????? ??????????????? ???? ??Bilibili??????? ????32??64? Windows XP/...ExtJS based ASP.NET 2.0 Controls: FineUI v3.2.2: ??FineUI ?? ExtJS ??? ASP.NET 2.0 ???。 FineUI??? ?? No JavaScript,No CSS,No UpdatePanel,No ViewState,No WebServices ???????。 ?????? IE 7.0、Firefox 3.6、Chrome 3.0、Opera 10.5、Safari 3.0+ ???? Apache License 2.0 (Apache) ???? ??:http://fineui.com/bbs/ ??:http://fineui.com/demo/ ??:http://fineui.com/doc/ ??:http://fineui.codeplex.com/ ???? +2012-12-03 v3.2.2 -?????????????,?????button/button_menu.aspx(????)。 +?Window????Plain??;?ToolbarPosition??Footer??;?????FooterBarAlign??。 -????win...Player Framework by Microsoft: Player Framework for Windows Phone 8: This is a brand new version of the Player Framework for Windows Phone, available exclusively for Windows Phone 8, and now based upon the Player Framework for Windows 8. While this new version is not backward compatible with Windows Phone 7 (get that http://smf.codeplex.com/releases/view/88970), it does offer the same great feature set plus dozens of new features such as advertising, localization support, and improved skinning. Click here for more information about what's new in the Windows P...SSH.NET Library: 2012.12.3: New feature(s): + SynchronizeDirectoriesQuest: Quest 5.3 Beta: New features in Quest 5.3 include: Grid-based map (sponsored by Phillip Zolla) Changable POV (sponsored by Phillip Zolla) Game log (sponsored by Phillip Zolla) Customisable object link colour (sponsored by Phillip Zolla) More room description options (by James Gregory) More mathematical functions now available to expressions Desktop Player uses the same UI as WebPlayer - this will make it much easier to implement customisation options New sorting functions: ObjectListSort(list,...Chinook Database: Chinook Database 1.4: Chinook Database 1.4 This is a sample database available in multiple formats: SQL scripts for multiple database vendors, embeded database files, and XML format. The Chinook data model is available here. ChinookDatabase1.4_CompleteVersion.zip is a complete package for all supported databases/data sources. There are also packages for each specific data source. Supported Database ServersDB2 EffiProz MySQL Oracle PostgreSQL SQL Server SQL Server Compact SQLite Issues Resolved293...RiP-Ripper & PG-Ripper: RiP-Ripper 2.9.34: changes FIXED: Thanks Function when "Download each post in it's own folder" is disabled FIXED: "PixHub.eu" linksD3 Loot Tracker: 1.5.6: Updated to work with D3 version 1.0.6.13300?????????? Microsoft Office 2013 ? 1? – ????? ???????????: ???????? ???? ???????? ?? ???????: ???? ????????? ???????? ???? ???????????????? ????????Jobboard Light Edition: Version 4.1: Updates Migration to Oracle 11g Express Changed CSS Improved entity framework connectivity Works with ODAC 11.2 Release 5 (11.2.0.3.20) with Oracle Developer Tools for Visual Studio Changed Data Layer Changed Business Layer Cleaned Oracle dbgen scriptsDirectoryEnumeratorAsync: Initial Release: Visual Studio 2012 SolutionBundler.NET: Bundler.NET 1.3.0: Added speed enhancements. It's faster than System.Web.Optimization! Added a bundle option that will include a file extension when alias names are used.AutoFixture: 2.15.4: This is an automatically published release created from the latest successful build. Versioning is based on Semantic Versioning. Read more here: http://blog.ploeh.dk/2011/09/06/AutoFixtureGoesContinuousDeliveryWithSemanticVersioning.aspx????????API for .Net SDK: SDK for .Net ??? Release 5: 2012?11?30??? ?OAuth?????????????????????SDK OAuth oauth = new OAuth("<AppKey>", "<AppSecret>", "<????>"); WebProxy proxy = new WebProxy(); proxy.Address = new Uri("http://proxy.domain.com:3128");//??????????? proxy.Credentials = new NetworkCredential("<??>", "<??>");//???????,??? oauth.Proxy = proxy; //??????,?~ New Projects.Net Source Code Syntax Highligher: High efficiency, detailed syntax highlighter for .Net source code.(a developer resource)12061327: d13261206: df1edex: 1edex40Fingers Simple Title Skin Object for DotNetNuke: Templatable DotNetNuke Title Skin Object. Renders cleaner HTML then default SKO. Will show the "page name" if used in a Skin, "module title" in a Container.aaa: fewfewAjaxShowOff: Ajax MVC ASP.NETBusStationTest: sdasdsadsadsadadsaCaseModelDataStore: use case data and model accumulateCiberSegurosWpf: ciberseguros wpfCodeSmith v3.x provider for VistaDB 3+: A CodeSmith v3.x provider for the excellent VistaDB .Net database engine.Cropper.TimeCapture: Captures at regular intervals of time the desktop/active window, along with his text See also CropperPlugins - http://www.codeplex.com/cropperplugins Cropper - http://www.codeplex.com/cropper It's developed in C#Distinct CAPTCHA Web Service: Distinct CAPTCHA used to add CAPTCHA to asp.net, InfoPath and SharePoint. The web service supports two methods one for generate and one to validate File Upload App: This is a silverlight 4 app, it used for upload files with progress bar. You can download it and run it directly. ???silverlight 4.0 ??, ???????,??????,???????FluentScriptWeb: Application for hosting FluentScript interpreter in a website for testing purposes.Fwql.Net: Fwql.Net is a General Class Libraries Collection.GaoPMS: NoneGuestbook Source Control: the codes in the bookHello world katal cloud: test katal cloud.net projectHREntry: TBDLyricFinder: Component for searching lyric by song title, artist, album, lyric part and topic/tagsPERSONAL PICTURE VIEWER 1.0: This is a picture viewer application that is programmed in C#.NET based on .NET 4.0 or higher.php pagination with shorter show page number: pagination in php pkrss: c++ version:pkrss.sf.net csharp version:is here. pkrss.sf.net is c++ version desktop productor written by qt 4.7.3. pkrss.codeplex is csharp version web productor.Plataforma: Plataforma MVC EntityProductivity Toolkit: This project is currently in its initial stage. prototype Assignement: prototype assignment Rational Team Concert Chrome Extensions: Google Chrome Extensions for Rational Team Concert. - Scrum Card PrintResource Monitor: Det er her vi er samlet om opgaven.rloreto@gmail.com: Caching for Windows Store Applications (Windows 8 WinRT)SignalRefresh: SignalRefresh is a open source project that as target has all .net developers that write pages and are board refreshing page after changes are done in source .SimpleTrack: SimpleTrack is a simplified alternative to the multitude of issue, bug and request trackers. This project is in response to painful experiences of trying to find a tracking solution which is not narrow in focus, yet not brutally complex. Singer: task 2 projectSitecore PowerShell Console for Sitecore Rocks: Sitecore PowerShell Console companion project that allows for it to be exposed in Sitecore Rocks.System Tools: Powerful tools for Windows in Batch File Delete Windows temporary Files Check if Port open Virus Scan Disable Default Sharing Format C: Drive Safely ShutdownTask Tracker: Task Tracker is a user customizable winform project to log details of tasks.TeslaFlux: Trytestddhg12052012hg01: xzcctesttom12052012git01: gfdgfdgtesttom12052012git02: gfdtesttom12052012hg01: fdstesttom12052012tfs01: fdstesttom12052012tfs02: fdsTyingsoftPortal: Tyingsoft Portal Websitewiki2doc: A tool to download a surtain namespace of a wiki and transform it into a documention format, like a windows help file (.chm) or a e-reader document (.epub).Windows (8) Update Notifier: Windows Update Notifier informs about Windows Updates via a desktop notification popup.The application only appears as an icon in the system tray.Windows 8 Isolated Storage: Useful tool to save data in Isolated Storage.WLW Insert Links Plugin: A plugin for Windows Live Writer: it combines an RSS/Atom-based link insert tool and a category heading insert tool (with linked Table of Contents).

    Read the article

  • MSDN "pseudoframe"

    - by bobobobo
    So, I'm trying to replicate MSDN "pseudoframes" here. Their pages are laid out like they're using an old-school frameset, but inspecting their elements with firebug reveals they've done this with purely div's. Here's my attempt at it. Its not perfect though, it only works in Chrome and Firefox, it has this weird highlight select behavior that I don't like, any takers? <!doctype html> <html> <head> <title>msdn "pseudoframe"</title> <style> body { background-color: #aaa; margin: 0; padding: 0; } div#pseudoframe, div#main { border: solid 1px black; background-color: #fff; } div#pseudoframe { position: absolute; left: 0; width: 180px; height: 100%; overflow-x: auto; overflow-y: none; } div#sizeMod { background-color: #a0a; position: absolute; left: 220px; height: 100%; cursor: e-resize; } div#main { font-weight: bold; font-size: 2em; padding: 24px; margin-left: 224px; } </style> <script type="text/javascript"> function initialize() { // get the pseudoframe and attach an event to the mouse flyover. var pf = document.getElementById('pseudoframe'); var main = document.getElementById('main'); var resize = document.getElementById( 'sizeMod' ); pf['onmouseover'] = function( event ) { event = event || window.event; var el = event.srcElement || event.target ; // are we within 5 px of the border? if we are, // change the mouse cursor to resize. }; pf['onscroll'] = function( event ) { event = event || window.event; var el = event.srcElement || event.target ; var sizeMod = document.getElementById( 'sizeMod' ); //alert( el.scrollLeft ); sizeMod.style.right = '-' + (el.scrollLeft) + 'px'; //alert( sizeMod.style.right ); // are we within 5 px of the border? if we are, // change the mouse cursor to resize. }; resize['onmousedown'] = function( event ) { event = event || window.event; var el = event.srcElement || event.target ; window.lockResize = true; }; window['onmouseup'] = function( event ) { event = event || window.event; var el = event.srcElement || event.target ; window.lockResize = false; //release on any mouse up event //alert('unlocked'); }; window['onmousemove'] = function( event ) { event = event || window.event; var el = event.srcElement || event.target ; if( window.lockResize == true ) { // resize. get client x and y. var x = event.clientX; var y = event.clientY; pf.style.width = x + 'px'; resize.style.left = x + 'px'; main.style.marginLeft = x + 'px'; //alert( pf.style.width ); event.stopPropagation(); event.preventDefault(); return false; } }; } </script> </head> <body onload=" initialize(); "> <div id="pseudoframe"> <ul> <li>Code</li> <li>MICROSOFT CODE <ul> <li>WINDOWS XP SOURCE</li> <li>WINDOWS VISTA SOURCE</li> <li>WINDOWS 7 SOURCE</li> <li>WINDOWS 8 SOURCE</li> </ul> </li> <li>DOWNLOAD ALL MICROSOFT CODE EVER WRITTEN</li> <li>DOWNLOAD ALL MAC OS CODE EVER WRITTEN</li> <li>DOWNLOAD ALL AMIGA GAME CONSOLE CODE</li> <li>DOWNLOAD ALL CODE EVER WRITTEN PERIOD</li> </ul> </div> <div id="sizeMod">&nbsp;&nbsp;</div> <div id="main"> lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe lorem ipsum microsoft pseudoframe </div> </body> </html>

    Read the article

  • LevelToVisibilityConverter in silverligt 4

    - by prince23
    <UserControl x:Class="SLGridImage.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"> <UserControl.Resources> <local:LevelToVisibilityConverter x:Key="LevelToVisibility" /> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White"> <sdk:DataGrid x:Name="dgMarks" CanUserResizeColumns="False" SelectionMode="Single" AutoGenerateColumns="False" VerticalAlignment="Top" ItemsSource="{Binding MarkCollection}" IsReadOnly="True" Margin="13,44,0,0" RowDetailsVisibilityMode="Collapsed" Height="391" HorizontalAlignment="Left" Width="965" VerticalScrollBarVisibility="Visible" > <sdk:DataGrid.Columns> <sdk:DataGridTemplateColumn> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button x:Name="myButton" Click="myButton_Click"> <StackPanel Orientation="Horizontal"> <Image Margin="2, 2, 2, 2" x:Name="imgMarks" Stretch="Fill" Width="12" Height="12" Source="Images/test.png" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding Level, Converter={StaticResource LevelToVisibility}}" /> <TextBlock Text="{Binding Level}" TextWrapping="NoWrap" ></TextBlock> </StackPanel> </Button> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> <sdk:DataGridTemplateColumn Header="Name" > <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate > <Border> <TextBlock Text="{Binding Name}" /> </Border> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> <sdk:DataGridTemplateColumn Header="Marks" Width="80"> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Border> <TextBlock Text="{Binding Marks}" /> </Border> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> </sdk:DataGrid.Columns> </sdk:DataGrid> </Grid> </UserControl> in .cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Collections.ObjectModel; using System.ComponentModel; namespace SLGridImage { public partial class MainPage : UserControl { private MarksViewModel model = new MarksViewModel(); public MainPage() { InitializeComponent(); this.DataContext = model; } private void myButton_Click(object sender, RoutedEventArgs e) { } } public class MarksViewModel : INotifyPropertyChanged { public MarksViewModel() { markCollection.Add(new Mark() { Name = "ABC", Marks = 23, Level = 0 }); markCollection.Add(new Mark() { Name = "XYZ", Marks = 67, Level = 1 }); markCollection.Add(new Mark() { Name = "YU", Marks = 56, Level = 0 }); markCollection.Add(new Mark() { Name = "AAA", Marks = 89, Level = 1 }); } private ObservableCollection<Mark> markCollection = new ObservableCollection<Mark>(); public ObservableCollection<Mark> MarkCollection { get { return this.markCollection; } set { this.markCollection = value; OnPropertyChanged("MarkCollection"); } } public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged(string propName) { if (PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(propName)); } } public class Mark { public string Name { get; set; } public int Marks { get; set; } public int Level { get; set; } } public class LevelToVisibilityConverter : System.Windows.Data.IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Visibility isVisible = Visibility.Collapsed; if ((value == null)) return isVisible; int condition = (int)value; isVisible = condition == 1 ? Visibility.Visible : Visibility.Collapsed; return isVisible; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion } } when i run getting error The type 'local:LevelToVisibilityConverter' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. what i am i missing here looking forward for an solution thank you

    Read the article

  • Adding data (not only text) to a multi column ListView (WPF)

    - by user811804
    I am working on a WPF application in C# (.NET 4.0) where I have a ListView with a GridView that has two columns. I dynamically want to add rows (in code). My dilemma is that only the first column will have regular text added to it. The second column will have an object that includes a multi column Grid with TextBlocks. (see link http://imageshack.us/photo/my-images/803/listview.png/) If I do what you would normally do when you want to enter text in all columns (ie. DisplayMemberBinding) all I get in the second column is the text "System.Windows.Grid", which obviously isn't what I want. For reference if I just try to add the Grid object (with the TextBlocks) with the code listView1.Items.Add(grid1) (not using DisplayMemberBinding) the object gets added to the second column only (with the first column being blank) and not how it normally works with text where the same text ends up in all columns. I hope my question is detailed enough and any help with this would be much appreciated. EDIT: I have tried the following code, howeever every time I click the button to add a new row every single row gets updated with the same datatemplate. (ie. the second column always shows the same data on every row.) xaml: <Window x:Class="TEST.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="AAA" Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded"> <Grid Name="grid1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="374*" /> <ColumnDefinition Width="129*" /> </Grid.ColumnDefinitions> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="21,12,0,0" Name="button1" VerticalAlignment="Top" Width="75" Grid.Column="1" Click="button1_Click" /> </Grid> code: public partial class MainWindow : Window { ListView listView1 = new ListView(); GridViewColumn viewCol2 = new GridViewColumn(); public MainWindow() { InitializeComponent(); Style style = new Style(typeof(ListViewItem)); style.Setters.Add(new Setter(ListViewItem.HorizontalContentAlignmentProperty, HorizontalAlignment.Stretch)); listView1.ItemContainerStyle = style; GridView gridView1 = new GridView(); listView1.View = gridView1; GridViewColumn viewCol1 = new GridViewColumn(); viewCol1.Header = "Option"; gridView1.Columns.Add(viewCol1); viewCol2.Header = "Value"; gridView1.Columns.Add(viewCol2); grid1.Children.Add(listView1); viewCol1.DisplayMemberBinding = new Binding("Option"); } private void Window_Loaded(object sender, RoutedEventArgs e) { } private void button1_Click(object sender, RoutedEventArgs e) { DataTemplate dataTemplate = new DataTemplate(); FrameworkElementFactory spFactory = new FrameworkElementFactory(typeof(Grid)); Random random = new Random(); int cols = random.Next(1, 6); int full = 100; for (int i = 0; i < cols; i++) { FrameworkElementFactory col1 = new FrameworkElementFactory(typeof(ColumnDefinition)); int partWidth = random.Next(0, full); full -= partWidth; col1.SetValue(ColumnDefinition.WidthProperty, new GridLength(partWidth, GridUnitType.Star)); spFactory.AppendChild(col1); } if (full > 0) { FrameworkElementFactory col1 = new FrameworkElementFactory(typeof(ColumnDefinition)); col1.SetValue(ColumnDefinition.WidthProperty, new GridLength(full, GridUnitType.Star)); spFactory.AppendChild(col1); } for (int i = 0; i < cols; i++) { FrameworkElementFactory text1 = new FrameworkElementFactory(typeof(TextBlock)); SolidColorBrush sb1 = new SolidColorBrush(); switch (i) { case 0: sb1.Color = Colors.Blue; break; case 1: sb1.Color = Colors.Red; break; case 2: sb1.Color = Colors.Yellow; break; case 3: sb1.Color = Colors.Green; break; case 4: sb1.Color = Colors.Purple; break; case 5: sb1.Color = Colors.Pink; break; case 6: sb1.Color = Colors.Brown; break; } text1.SetValue(TextBlock.BackgroundProperty, sb1); text1.SetValue(Grid.ColumnProperty, i); spFactory.AppendChild(text1); } if (full > 0) { FrameworkElementFactory text1 = new FrameworkElementFactory(typeof(TextBlock)); SolidColorBrush sb1 = new SolidColorBrush(Colors.Black); text1.SetValue(TextBlock.BackgroundProperty, sb1); text1.SetValue(Grid.ColumnProperty, cols); spFactory.AppendChild(text1); } dataTemplate.VisualTree = spFactory; viewCol2.CellTemplate = dataTemplate; int rows = listView1.Items.Count + 1; listView1.Items.Add(new { Option = "Row " + rows }); } }

    Read the article

  • form not showing for empty records

    - by Chris Hodges
    I have a relatively simple PHP page called editcustomers with 3 columns. The problem I'm having is that the form will show when there is a record in the database and the fields will be populated with that info. When no such records exists, the form is not even shown, eliminating the possibility to insert a record. My page layout is as follows: Column 1 shows a form containing customer information, allowing it to be edited. Column 2 allows ordering of products and showing how many products were ordered Column 3 shows the total paid so far, and the total owing. The code for the page I have at present: <html> <?php $id = $_GET['id']; require_once('connect.php'); $sth = $dbh->query("SELECT * FROM users where id = '$id';"); $sth->setFetchMode(PDO::FETCH_ASSOC); $eth = $dbh->query("SELECT * FROM purchases where id = '$id';"); $eth->setFetchMode(PDO::FETCH_ASSOC); ?> <div id="main"> <div id="left"> <form name="custInfo" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custInfo"/> <?php while($row = $sth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="firstName" size ="30" value=" <?php echo $row["firstName"]?>"/> <p><input type = "text" name ="lastName" size ="30" value="<?php echo $row["lastName"]?>"/> <p><input type = "text" name ="country" size ="30" value="<?php echo $row["country"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="mid"> <form name="custCosts" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custCosts"/> <?php while($row = $eth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="amountOwed" size ="30" value=" <?php echo $row["amountOwed"]?>"/> <p><input type = "text" name ="numAaa" size ="30" value="<?php echo $row["numAaa"]?>"/> <p><input type = "text" name ="numBbb" size ="30" value="<?php echo $row["numBbb"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="right"> <b>Total Balance</b> <p> Money owed: </p> <p> aaa total: </p> <p> bbb total: </p> <p> Total: </p> <input type = "text" name ="pay" size ="20" /></p> <input type="submit" value="Make Payment" /> </div> <?php $dbh =null; ?> </body> </html> And the code for all the database trickery: <?php require_once 'connect.php'; $formType = $_POST['formType']; $id = $_POST['id']; $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $country = $_POST['country']; $amountOwed = $_POST['amountOwed ']; $numAaa = $_POST['numAaa']; $numBbb = $_POST['numBbb']; if(empty($_POST['id'])) { $sth = $dbh->prepare("INSERT INTO customers (firstName, lastName, country) VALUES ('$firstName', '$lastName', '$country')"); $sth->execute(); } elseif(!empty($_POST['id']) && !isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("UPDATE customers SET firstName = '$firstName', lastName = '$lastName', country = '$country' WHERE id = '$id'"); $sth->execute(); }elseif(!empty($_POST['id']) && isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("INSERT INTO purchases (id, amountOwed, numAaa, numBbb) VALUES ('$id', '$amountOwed', '$numAaa', '$numBbb'"); $sth->execute(); }elseif(!empty($_POST['id']) && $_POST['formType'] == 'guestCosts'){ $sth = $dbh->prepare("UPDATE purchases SET amountOwed= '$amountOwed', numAaa = '$numAaa', numBbb= '$numBbb' WHERE id = '$id'"); $sth->execute(); } $dbh =null; ?> Why does the form not even display if there is no record? An error or something I might understand....but the form is still in the HTML and should still be being output, from what I can see. Why is this not the case?

    Read the article

  • In Flex, how to drag a component into a column of DataGrid (not the whole DataGrid)?

    - by Yousui
    Hi guys, I have a custom component: <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Declarations> </fx:Declarations> <fx:Script> <![CDATA[ [Bindable] public var label:String = "don't know"; [Bindable] public var imageName:String = "x.gif"; ]]> </fx:Script> <s:HGroup paddingLeft="8" paddingTop="8" paddingRight="8" paddingBottom="8"> <mx:Image id="img" source="assets/{imageName}" /> <s:Label text="{label}"/> </s:HGroup> </s:Group> and a custom render, which will be used in my DataGrid: <?xml version="1.0" encoding="utf-8"?> <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusEnabled="true" xmlns:components="components.*"> <s:VGroup> <components:Person label="{dataGridListData.label}"> </components:Person> </s:VGroup> </s:MXDataGridItemRenderer> This is my application: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:services="services.*"> <s:layout> <s:VerticalLayout/> </s:layout> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.controls.Image; import mx.rpc.events.ResultEvent; import mx.utils.ArrayUtil; ]]> </fx:Script> <fx:Declarations> <fx:XMLList id="employees"> <employee> <name>Christina Coenraets</name> <phone>555-219-2270</phone> <email>[email protected]</email> <active>true</active> <image>assets/001.png</image> </employee> <employee> <name>Joanne Wall</name> <phone>555-219-2012</phone> <email>[email protected]</email> <active>true</active> <image>assets/002.png</image> </employee> <employee> <name>Maurice Smith</name> <phone>555-219-2012</phone> <email>[email protected]</email> <active>false</active> <image>assets/003.png</image> </employee> <employee> <name>Mary Jones</name> <phone>555-219-2000</phone> <email>[email protected]</email> <active>true</active> <image>assets/004.png</image> </employee> </fx:XMLList> </fx:Declarations> <s:HGroup> <mx:DataGrid dataProvider="{employees}" width="100%" dropEnabled="true"> <mx:columns> <mx:DataGridColumn headerText="Employee Name" dataField="name"/> <mx:DataGridColumn headerText="Email" dataField="email"/> <mx:DataGridColumn headerText="Image" dataField="image" itemRenderer="renderers.render1"/> </mx:columns> </mx:DataGrid> <s:List dragEnabled="true" dragMoveEnabled="false"> <s:dataProvider> <s:ArrayCollection> <fx:String>aaa</fx:String> <fx:String>bbb</fx:String> <fx:String>ccc</fx:String> <fx:String>ddd</fx:String> </s:ArrayCollection> </s:dataProvider> </s:List> </s:HGroup> </s:Application> Now what I want to do is let the user drag an one or more item from the left List component and drop at the third column of the DataGrid, then using the dragged data to create another <components:Person /> object. So in the final result, maybe the first line contains just one <components:Person /> object at the third column, the second line contains two <components:Person /> object at the third column and so on. Can this be implemented in Flex? How? Great thanks.

    Read the article

  • JasperReport Issue using with struts2 - getting null in final PDF file

    - by Nirmal
    Hello, i am writing my jasper report problem with struts2. Following is the code that i am trying to execute : struts.xml contains : <action name="myJasperTest1" class="temp.JasperAction1"> <result name="success" type="jasper"> <param name="location">/jasper/our_compiled_template.jasper</param> <param name="dataSource">myList</param> <param name="format">PDF</param> </result> </action> My JasperAction1 contains : import java.util.ArrayList; import java.util.List; import com.sufalam.business.model.util.LegacyJasperInputStream; import net.sf.jasperreports.engine.JasperCompileManager; import com.opensymphony.xwork2.ActionSupport; import com.sufalam.business.finance.model.bean.Account; import java.io.FileInputStream; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.xml.JRXmlLoader; public class JasperAction1 extends ActionSupport { /** List to use as our JasperReports dataSource. */ private List<Account> myList; public String execute() throws Exception { // Create some imaginary persons. Account a1 = new Account(); Account a2 = new Account(); a1.setId(77); a1.setName("aaa"); a2.setId(88); a2.setName("bbb"); // Store people in our dataSource list (normally would come from database). myList = new ArrayList<Account>(); myList.add(a1); myList.add(a2); // Normally we would provide a pre-compiled .jrxml file // or check to make sure we don't compile on every request. try { JasperDesign design = JRXmlLoader.load( new LegacyJasperInputStream(new FileInputStream("F://backup//backup 26-5(final acegi)//SufalamERP//build//web//jasper//report2.jrxml"))); JasperCompileManager.compileReportToFile(design,"F://backup//backup 26-5(final acegi)//SufalamERP//build//web//jasper//our_compiled_template1.jasper"); } catch (Exception e) { e.printStackTrace(); return ERROR; } return SUCCESS; } public List<Account> getMyList() { return myList; } } I am using ireport plugin of Netbeans for generation .jrxml file. After Designing my page using IReport wizard my our_jasper_template.jrxml file contains following code : <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <queryString language="SQL"> <![CDATA[SELECT account_master."name" AS account_master_name, account_master."id" AS account_master_id FROM "public"."account_master" account_master]]> </queryString> <field name="account_master_name" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="account_master_id" class="java.lang.Integer"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <background> <band/> </background> <title> <band height="58"> <line> <reportElement x="0" y="8" width="555" height="1"/> </line> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/> </line> <staticText> <reportElement x="65" y="13" width="424" height="35"/> <textElement textAlignment="Center"> <font size="26" isBold="true"/> </textElement> <text><![CDATA[Classic template]]></text> </staticText> </band> </title> <pageHeader> <band/> </pageHeader> <columnHeader> <band/> </columnHeader> <detail> <band height="40"> <staticText> <reportElement x="0" y="0" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[account_master_name]]></text> </staticText> <textField> <reportElement x="139" y="0" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{account_master_name}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="20" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[account_master_id]]></text> </staticText> <textField> <reportElement x="139" y="20" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{account_master_id}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band/> </columnFooter> <pageFooter> <band height="26"> <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Right"> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band/> </summary> </jasperReport> Now the problem i am facing is when i execute this action class it gives me following output as pdf format :

    Read the article

  • repaint problem

    - by user357816
    I have a problem with my repaint in the method move. I dont know what to doo, the code is below import java.awt.*; import java.io.*; import java.text.*; import java.util.*; import javax.sound.sampled.*; import javax.swing.*; import javax.swing.Timer; import java.awt.event.*; import java.lang.*; public class bbb extends JPanel { public Stack<Integer> stacks[]; public JButton auto,jugar,nojugar; public JButton ok,ok2; public JLabel info=new JLabel("Numero de Discos: "); public JLabel instruc=new JLabel("Presiona la base de las torres para mover las fichas"); public JLabel instruc2=new JLabel("No puedes poner una pieza grande sobre una pequenia!"); public JComboBox numeros=new JComboBox(); public JComboBox velocidad=new JComboBox(); public boolean seguir=false,parar=false,primera=true; public int n1,n2,n3; public int click1=0; public int opcion=1,tiempo=50; public int op=1,continuar=0,cont=0; public int piezas=0; public int posx,posy; public int no; public bbb() throws IOException { stacks = new Stack[3]; stacks[0]=new Stack<Integer>(); stacks[1]=new Stack<Integer>(); stacks[2]=new Stack<Integer>(); setPreferredSize(new Dimension(1366,768)); ok=new JButton("OK"); ok.setBounds(new Rectangle(270,50,70,25)); ok.addActionListener(new okiz()); ok2=new JButton("OK"); ok2.setBounds(new Rectangle(270,50,70,25)); ok2.addActionListener(new vel()); add(ok2);ok2.setVisible(false); auto=new JButton("Automatico"); auto.setBounds(new Rectangle(50,80,100,25)); auto.addActionListener(new a()); jugar=new JButton("PLAY"); jugar.setBounds(new Rectangle(100,100,70,25)); jugar.addActionListener(new play()); nojugar=new JButton("PAUSE"); nojugar.setBounds(new Rectangle(100,150,70,25)); nojugar.addActionListener(new stop()); setLayout(null); info.setBounds(new Rectangle(50,50,170,25)); info.setForeground(Color.white); instruc.setBounds(new Rectangle(970,50,570,25)); instruc.setForeground(Color.white); instruc2.setBounds(new Rectangle(970,70,570,25)); instruc2.setForeground(Color.white); add(instruc);add(instruc2); add(jugar);add(nojugar);jugar.setVisible(false);nojugar.setVisible(false); add(info); info.setVisible(false); add(ok); ok.setVisible(false); add(auto); numeros.setBounds(new Rectangle(210,50,50,25)); numeros.addItem(1);numeros.addItem(2);numeros.addItem(3);numeros.addItem(4);numeros.addItem(5); numeros.addItem(6);numeros.addItem(7);numeros.addItem(8);numeros.addItem(9);numeros.addItem(10); add(numeros); numeros.setVisible(false); velocidad.setBounds(new Rectangle(150,50,100,25)); velocidad.addItem("Lenta"); velocidad.addItem("Intermedia"); velocidad.addItem("Rapida"); add(velocidad); velocidad.setVisible(false); } public void Mover(int origen, int destino) { for (int i=0;i<3;i++) { System.out.print("stack "+i+": "); for(int n : stacks[i]) System.out.print(n+";"); System.out.println(""); } System.out.println("de <"+origen+"> a <"+destino+">"); stacks[destino].push(stacks[origen].pop()); System.out.println(""); this.validate(); this.repaint( ); } public void hanoi(int origen, int destino, int cuantas) { while (parar) {} if (cuantas <= 1) Mover(origen,destino); else { hanoi(origen,3 - (origen+destino),cuantas-1); Mover(origen,destino); hanoi(3 - (origen+destino),destino,cuantas-1); } } public void paintComponent(Graphics g) { ImageIcon fondo= new ImageIcon("fondo.jpg"); g.drawImage(fondo.getImage(),0, 0,1366,768,null); g.setColor(new Color((int)(Math.random() * 254), (int)(Math.random() *255), (int)(Math.random() * 255))); g.fillRect(0,0,100,100); g.setColor(Color.white); g.fillRect(150,600,250,25); g.fillRect(550,600,250,25); g.fillRect(950,600,250,25); g.setColor(Color.red); g.fillRect(270,325,10,275); g.fillRect(270+400,325,10,275); g.fillRect(270+800,325,10,275); int x, y,top=0; g.setColor(Color.yellow); x=150;y=580; for(int ii:stacks[0]) { g.fillRect(x+((ii*125)/10),y-(((ii)*250)/10),((10-ii)*250)/10,20);} x=550;y=580; for(int ii:stacks[1]) {g.fillRect(x+((ii*125)/10),y-(((ii)*250)/10),((10-ii)*250)/10,20);} x=950;y=580; for(int ii:stacks[2]) {g.fillRect(x+((ii*125)/10),y-(((ii)*250)/10),((10-ii)*250)/10,20);} System.out.println("ENTRO"); setOpaque(false); } private class play implements ActionListener //manual { public void actionPerformed(ActionEvent algo) { parar=false; if(primera=true) { hanoi(0,2,no); primera=false; } } } private class stop implements ActionListener //manual { public void actionPerformed(ActionEvent algo) { parar=true; } } private class vel implements ActionListener //manual { public void actionPerformed(ActionEvent algo) { if (velocidad.getSelectedItem()=="Lenta") {tiempo=150;} else if (velocidad.getSelectedItem()=="Intermedia") {tiempo=75;} else tiempo=50; ok2.setVisible(false); jugar.setVisible(true); nojugar.setVisible(true); } } private class a implements ActionListener //auto { public void actionPerformed(ActionEvent algo) { auto.setVisible(false); info.setVisible(true); numeros.setVisible(true); ok.setVisible(true); op=3; } } private class okiz implements ActionListener //ok { public void actionPerformed(ActionEvent algo) { no=Integer.parseInt(numeros.getSelectedItem().toString()); piezas=no; if (no>0 && no<11) { info.setVisible(false); numeros.setVisible(false); ok.setVisible(false); for (int i=no;i>0;i--) stacks[0].push(i); opcion=2; if (op==3) { info.setText("Velocidad: ");info.setVisible(true); velocidad.setVisible(true); ok2.setVisible(true); } } else { } repaint(); } } } the code of the other class that calls the one up is below: import java.awt.*; import java.io.*; import java.net.URL; import javax.imageio.*; import javax.swing.*; import javax.swing.border.*; import java.lang.*; import java.awt.event.*; public class aaa extends JPanel { private ImageIcon Background; private JLabel fondo; public static void main(String[] args) throws IOException { JFrame.setDefaultLookAndFeelDecorated(true); final JPanel cp = new JPanel(new BorderLayout()); JFrame frame = new JFrame ("Torres de Hanoi"); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); frame.setSize(550,550); frame.setVisible(true); bbb panel = new bbb(); frame.getContentPane().add(panel); frame.pack(); frame.setVisible(true); } }

    Read the article

< Previous Page | 19 20 21 22 23