Feature a Tag for a Period of Time – meta.stackoverflow.com
I've seen in encouraged amount many sites to encourage people to ask for a
period of time about a specific topic, in a way to encourage more site
activity. Space Exploration has recently started doing …
Monday, September 30, 2013
installing Percona XtraDB Cluster on Ubuntu 13.04
installing Percona XtraDB Cluster on Ubuntu 13.04
So, a bit of explanation of the big picture: I am trying to get multiple
PXC instances running on a single machine, replicating via Galera to each
other. I am running Ubuntu Server 13.04 amd64 in a VirtualBox OSE virtual
machine. I installed the Percona debian/ubuntu repository and installed
percona-xtradb-cluster-server-5.5, percona-xtrabackup,
percona-xtradb-cluster-client-5.5, percona-xtradb-cluster-common-5.5, and
percona-xtradb-cluster-galera-2.x from there. mysqld --version shows
"mysqld Ver 5.5.33-55 for Linux on x86_64 (Percona XtraDB Cluster (GPL),
wsrep_23.7.6.r3915)".
Once I had PXC installed, I set up a /data/mysql directory and several
/etc/mysql/my.*.cnffiles, one for each node I intended to
create.my.galera1.cnf` looks like so:
[mysqld]
port = 5533
socket=/tmp/mysql.galera1.sock
datadir=/data/mysql/galera1
#basedir=/usr/bin
user=root
log_error=error.log
innodb_file_per_table
### galera-required settings ###
query_cache_size=0
binlog_format=ROW
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
#innodb_locks_unsafe_for_binlog=1
### wsrep basic settings ###
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_name=boringname
wsrep_cluster_address=gcomm://localhost:5533,localhost:5534,localhost:5535
wsrep_sst_method=rsync
#wsrep_sst_auth=repluser:replpass
wsrep_node_name=node1
wsrep_node_address=localhost:5533
[mysql]
user=root
I then called mysql_install_db --defaults-file=/etc/mysql/my.galera1.cnf
to initialize the data directory, followed by mysqld_safe
--defaults-file=/etc/mysql/my.galera1.cnf --wsrep-new-cluster. mysqld_safe
prints the following to the screen:
130927 23:53:22 mysqld_safe Logging to '/data/mysql/galera1/error.log'.
130927 23:53:22 mysqld_safe Starting mysqld daemon with databases from
/data/mysql/galera1
130927 23:53:22 mysqld_safe Skipping wsrep-recover for empty datadir:
/data/mysql/galera1
130927 23:53:22 mysqld_safe Assigning
00000000-0000-0000-0000-000000000000:-1 to wsrep_start_position
130927 23:53:32 mysqld_safe mysqld from pid file
/data/mysql/galera1/ubusrv1304-0.pid ended
and the following to /data/mysql/galera1/error.log:
130927 23:53:22 mysqld_safe Starting mysqld daemon with databases from
/data/mysql/galera1
130927 23:53:22 mysqld_safe Skipping wsrep-recover for empty datadir:
/data/mysql/galera1
130927 23:53:22 mysqld_safe Assigning
00000000-0000-0000-0000-000000000000:-1 to wsrep_start_position
130927 23:53:22 [Note] WSREP: wsrep_start_position var submitted:
'00000000-0000-0000-0000-000000000000:-1'
130927 23:53:22 [Note] WSREP: Read nil XID from storage engines, skipping
position init
130927 23:53:22 [Note] WSREP: wsrep_load(): loading provider library
'/usr/lib/libgalera_smm.so'
130927 23:53:22 [Note] WSREP: wsrep_load(): Galera 2.7(r157) by Codership
Oy loaded succesfully.
130927 23:53:22 [Warning] WSREP: Could not open saved state file for
reading: /data/mysql/galera1//grastate.dat
130927 23:53:22 [Note] WSREP: Found saved state:
00000000-0000-0000-0000-000000000000:-1
130927 23:53:22 [Note] WSREP: Preallocating 134219048/134219048 bytes in
'/data/mysql/galera1//galera.cache'...
130927 23:53:22 [Note] WSREP: Passing config to GCS: base_host =
localhost; base_port = 5533; cert.log_conflicts = no; gcache.dir =
/data/mysql/galera1/; gcache.keep_pages_size = 0; gcache.mem_size = 0;
gcache.name = /data/mysql/galera1//galera.cache; gcache.page_size = 128M;
gcache.size = 128M; gcs.fc_debug = 0; gcs.fc_factor = 1; gcs.fc_limit =
16; gcs.fc_master_slave = NO; gcs.max_packet_size = 64500;
gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807;
gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = NO;
replicator.causal_read_timeout = PT30S; replicator.commit_order = 3
130927 23:53:22 [Note] WSREP: Assign initial position for certification:
-1, protocol version: -1
130927 23:53:22 [Note] WSREP: wsrep_sst_grab()
130927 23:53:22 [Note] WSREP: Start replication
130927 23:53:22 [Note] WSREP: Setting initial position to
00000000-0000-0000-0000-000000000000:-1
130927 23:53:22 [Note] WSREP: protonet asio version 0
130927 23:53:22 [Note] WSREP: backend: asio
130927 23:53:22 [Note] WSREP: GMCast version 0
130927 23:53:22 [Note] WSREP: (e6e10868-27f9-11e3-85c4-2672bd9349a7,
'tcp://0.0.0.0:5533') listening at tcp://0.0.0.0:5533
130927 23:53:22 [Note] WSREP: (e6e10868-27f9-11e3-85c4-2672bd9349a7,
'tcp://0.0.0.0:5533') multicast: , ttl: 1
130927 23:53:22 [Note] WSREP: EVS version 0
130927 23:53:22 [Note] WSREP: PC version 0
130927 23:53:22 [Note] WSREP: gcomm: connecting to group 'boringname',
peer ''
130927 23:53:22 [Note] WSREP: Node e6e10868-27f9-11e3-85c4-2672bd9349a7
state prim
130927 23:53:22 [Note] WSREP:
view(view_id(PRIM,e6e10868-27f9-11e3-85c4-2672bd9349a7,1) memb {
e6e10868-27f9-11e3-85c4-2672bd9349a7,
} joined {
} left {
} partitioned {
})
130927 23:53:22 [Note] WSREP: gcomm: connected
130927 23:53:22 [Note] WSREP: Changing maximum packet size to 64500,
resulting msg size: 32636
130927 23:53:22 [Note] WSREP: Shifting CLOSED -> OPEN (TO: 0)
130927 23:53:22 [Note] WSREP: Opened channel 'boringname'
130927 23:53:22 [Note] WSREP: Waiting for SST to complete.
130927 23:53:22 [Note] WSREP: New COMPONENT: primary = yes, bootstrap =
no, my_idx = 0, memb_num = 1
130927 23:53:22 [Note] WSREP: Starting new group from scratch:
e6e177a0-27f9-11e3-92e7-4b4286f53f4a
130927 23:53:22 [Note] WSREP: STATE_EXCHANGE: sent state UUID:
e6e17ffd-27f9-11e3-8c08-8b5bd34ddb16
130927 23:53:22 [Note] WSREP: STATE EXCHANGE: sent state msg:
e6e17ffd-27f9-11e3-8c08-8b5bd34ddb16
130927 23:53:22 [Note] WSREP: STATE EXCHANGE: got state msg:
e6e17ffd-27f9-11e3-8c08-8b5bd34ddb16 from 0 (node1)
130927 23:53:22 [Note] WSREP: Quorum results:
version = 2,
component = PRIMARY,
conf_id = 0,
members = 1/1 (joined/total),
act_id = 0,
last_appl. = -1,
protocols = 0/4/2 (gcs/repl/appl),
group UUID = e6e177a0-27f9-11e3-92e7-4b4286f53f4a
130927 23:53:22 [Note] WSREP: Flow-control interval: [16, 16]
130927 23:53:22 [Note] WSREP: Restored state OPEN -> JOINED (0)
130927 23:53:22 [Note] WSREP: New cluster view: global state:
e6e177a0-27f9-11e3-92e7-4b4286f53f4a:0, view# 1: Primary, number of nodes:
1, my index: 0, protocol version 2
130927 23:53:22 [Note] WSREP: SST complete, seqno: 0
130927 23:53:22 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
130927 23:53:22 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.
130927 23:53:22 InnoDB: The InnoDB memory heap is disabled
130927 23:53:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130927 23:53:22 InnoDB: Compressed tables use zlib 1.2.3
130927 23:53:22 InnoDB: Using Linux native AIO
130927 23:53:22 [Note] WSREP: Member 0 (node1) synced with group.
130927 23:53:22 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 0)
130927 23:53:22 InnoDB: Initializing buffer pool, size = 128.0M
130927 23:53:22 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
130927 23:53:22 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
130927 23:53:22 InnoDB: Log file ./ib_logfile0 did not exist: new to be
created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
130927 23:53:22 InnoDB: Log file ./ib_logfile1 did not exist: new to be
created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
130927 23:53:22 InnoDB: Waiting for the background threads to start
130927 23:53:23 Percona XtraDB (http://www.percona.com) 5.5.33-rel31.0
started; log sequence number 0
130927 23:53:23 [ERROR] Can't start server: Bind on TCP/IP port. Got
error: 98: Address already in use
130927 23:53:23 [ERROR] Do you already have another mysqld server running
on port: 5533 ?
130927 23:53:23 [ERROR] Aborting
130927 23:53:25 [Note] WSREP: Closing send monitor...
130927 23:53:25 [Note] WSREP: Closed send monitor.
130927 23:53:25 [Note] WSREP: gcomm: terminating thread
130927 23:53:25 [Note] WSREP: gcomm: joining thread
130927 23:53:25 [Note] WSREP: gcomm: closing backend
130927 23:53:25 [Note] WSREP: view((empty))
130927 23:53:25 [Note] WSREP: gcomm: closed
130927 23:53:25 [Note] WSREP: Received self-leave message.
130927 23:53:25 [Note] WSREP: Flow-control interval: [0, 0]
130927 23:53:25 [Note] WSREP: Received SELF-LEAVE. Closing connection.
130927 23:53:25 [Note] WSREP: Shifting SYNCED -> CLOSED (TO: 0)
130927 23:53:25 [Note] WSREP: RECV thread exiting 0: Success
130927 23:53:25 [Note] WSREP: recv_thread() joined.
130927 23:53:25 [Note] WSREP: Closing replication queue.
130927 23:53:25 [Note] WSREP: Closing slave action queue.
130927 23:53:25 [Note] WSREP: Service disconnected.
130927 23:53:25 [Note] WSREP: rollbacker thread exiting
130927 23:53:26 [Note] WSREP: Some threads may fail to exit.
130927 23:53:26 InnoDB: Starting shutdown...
130927 23:53:27 InnoDB: Shutdown completed; log sequence number 1597945
130927 23:53:27 [Note] /usr/sbin/mysqld: Shutdown complete
Error in my_thread_global_end(): 1 threads didn't exit
130927 23:53:32 mysqld_safe mysqld from pid file
/data/mysql/galera1/ubusrv1304-0.pid ended
Seeing the error about binding to port 5533, I ran netstat -anp | grep
5533, but got no results, indicating (I think) that port 5533 has no
process bound to it, in fact.
At some point previously, I somehow managed to get the server to at least
stay up, and while I could connect to it from the mysql command line
client, there was no command that didn't complain that there was no such
command.
I am thoroughly baffled at what I'm doing wrong, so any help at all would
be very welcome. Thank you, everyone, in advance!
So, a bit of explanation of the big picture: I am trying to get multiple
PXC instances running on a single machine, replicating via Galera to each
other. I am running Ubuntu Server 13.04 amd64 in a VirtualBox OSE virtual
machine. I installed the Percona debian/ubuntu repository and installed
percona-xtradb-cluster-server-5.5, percona-xtrabackup,
percona-xtradb-cluster-client-5.5, percona-xtradb-cluster-common-5.5, and
percona-xtradb-cluster-galera-2.x from there. mysqld --version shows
"mysqld Ver 5.5.33-55 for Linux on x86_64 (Percona XtraDB Cluster (GPL),
wsrep_23.7.6.r3915)".
Once I had PXC installed, I set up a /data/mysql directory and several
/etc/mysql/my.*.cnffiles, one for each node I intended to
create.my.galera1.cnf` looks like so:
[mysqld]
port = 5533
socket=/tmp/mysql.galera1.sock
datadir=/data/mysql/galera1
#basedir=/usr/bin
user=root
log_error=error.log
innodb_file_per_table
### galera-required settings ###
query_cache_size=0
binlog_format=ROW
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
#innodb_locks_unsafe_for_binlog=1
### wsrep basic settings ###
wsrep_provider=/usr/lib/libgalera_smm.so
wsrep_cluster_name=boringname
wsrep_cluster_address=gcomm://localhost:5533,localhost:5534,localhost:5535
wsrep_sst_method=rsync
#wsrep_sst_auth=repluser:replpass
wsrep_node_name=node1
wsrep_node_address=localhost:5533
[mysql]
user=root
I then called mysql_install_db --defaults-file=/etc/mysql/my.galera1.cnf
to initialize the data directory, followed by mysqld_safe
--defaults-file=/etc/mysql/my.galera1.cnf --wsrep-new-cluster. mysqld_safe
prints the following to the screen:
130927 23:53:22 mysqld_safe Logging to '/data/mysql/galera1/error.log'.
130927 23:53:22 mysqld_safe Starting mysqld daemon with databases from
/data/mysql/galera1
130927 23:53:22 mysqld_safe Skipping wsrep-recover for empty datadir:
/data/mysql/galera1
130927 23:53:22 mysqld_safe Assigning
00000000-0000-0000-0000-000000000000:-1 to wsrep_start_position
130927 23:53:32 mysqld_safe mysqld from pid file
/data/mysql/galera1/ubusrv1304-0.pid ended
and the following to /data/mysql/galera1/error.log:
130927 23:53:22 mysqld_safe Starting mysqld daemon with databases from
/data/mysql/galera1
130927 23:53:22 mysqld_safe Skipping wsrep-recover for empty datadir:
/data/mysql/galera1
130927 23:53:22 mysqld_safe Assigning
00000000-0000-0000-0000-000000000000:-1 to wsrep_start_position
130927 23:53:22 [Note] WSREP: wsrep_start_position var submitted:
'00000000-0000-0000-0000-000000000000:-1'
130927 23:53:22 [Note] WSREP: Read nil XID from storage engines, skipping
position init
130927 23:53:22 [Note] WSREP: wsrep_load(): loading provider library
'/usr/lib/libgalera_smm.so'
130927 23:53:22 [Note] WSREP: wsrep_load(): Galera 2.7(r157) by Codership
Oy loaded succesfully.
130927 23:53:22 [Warning] WSREP: Could not open saved state file for
reading: /data/mysql/galera1//grastate.dat
130927 23:53:22 [Note] WSREP: Found saved state:
00000000-0000-0000-0000-000000000000:-1
130927 23:53:22 [Note] WSREP: Preallocating 134219048/134219048 bytes in
'/data/mysql/galera1//galera.cache'...
130927 23:53:22 [Note] WSREP: Passing config to GCS: base_host =
localhost; base_port = 5533; cert.log_conflicts = no; gcache.dir =
/data/mysql/galera1/; gcache.keep_pages_size = 0; gcache.mem_size = 0;
gcache.name = /data/mysql/galera1//galera.cache; gcache.page_size = 128M;
gcache.size = 128M; gcs.fc_debug = 0; gcs.fc_factor = 1; gcs.fc_limit =
16; gcs.fc_master_slave = NO; gcs.max_packet_size = 64500;
gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807;
gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = NO;
replicator.causal_read_timeout = PT30S; replicator.commit_order = 3
130927 23:53:22 [Note] WSREP: Assign initial position for certification:
-1, protocol version: -1
130927 23:53:22 [Note] WSREP: wsrep_sst_grab()
130927 23:53:22 [Note] WSREP: Start replication
130927 23:53:22 [Note] WSREP: Setting initial position to
00000000-0000-0000-0000-000000000000:-1
130927 23:53:22 [Note] WSREP: protonet asio version 0
130927 23:53:22 [Note] WSREP: backend: asio
130927 23:53:22 [Note] WSREP: GMCast version 0
130927 23:53:22 [Note] WSREP: (e6e10868-27f9-11e3-85c4-2672bd9349a7,
'tcp://0.0.0.0:5533') listening at tcp://0.0.0.0:5533
130927 23:53:22 [Note] WSREP: (e6e10868-27f9-11e3-85c4-2672bd9349a7,
'tcp://0.0.0.0:5533') multicast: , ttl: 1
130927 23:53:22 [Note] WSREP: EVS version 0
130927 23:53:22 [Note] WSREP: PC version 0
130927 23:53:22 [Note] WSREP: gcomm: connecting to group 'boringname',
peer ''
130927 23:53:22 [Note] WSREP: Node e6e10868-27f9-11e3-85c4-2672bd9349a7
state prim
130927 23:53:22 [Note] WSREP:
view(view_id(PRIM,e6e10868-27f9-11e3-85c4-2672bd9349a7,1) memb {
e6e10868-27f9-11e3-85c4-2672bd9349a7,
} joined {
} left {
} partitioned {
})
130927 23:53:22 [Note] WSREP: gcomm: connected
130927 23:53:22 [Note] WSREP: Changing maximum packet size to 64500,
resulting msg size: 32636
130927 23:53:22 [Note] WSREP: Shifting CLOSED -> OPEN (TO: 0)
130927 23:53:22 [Note] WSREP: Opened channel 'boringname'
130927 23:53:22 [Note] WSREP: Waiting for SST to complete.
130927 23:53:22 [Note] WSREP: New COMPONENT: primary = yes, bootstrap =
no, my_idx = 0, memb_num = 1
130927 23:53:22 [Note] WSREP: Starting new group from scratch:
e6e177a0-27f9-11e3-92e7-4b4286f53f4a
130927 23:53:22 [Note] WSREP: STATE_EXCHANGE: sent state UUID:
e6e17ffd-27f9-11e3-8c08-8b5bd34ddb16
130927 23:53:22 [Note] WSREP: STATE EXCHANGE: sent state msg:
e6e17ffd-27f9-11e3-8c08-8b5bd34ddb16
130927 23:53:22 [Note] WSREP: STATE EXCHANGE: got state msg:
e6e17ffd-27f9-11e3-8c08-8b5bd34ddb16 from 0 (node1)
130927 23:53:22 [Note] WSREP: Quorum results:
version = 2,
component = PRIMARY,
conf_id = 0,
members = 1/1 (joined/total),
act_id = 0,
last_appl. = -1,
protocols = 0/4/2 (gcs/repl/appl),
group UUID = e6e177a0-27f9-11e3-92e7-4b4286f53f4a
130927 23:53:22 [Note] WSREP: Flow-control interval: [16, 16]
130927 23:53:22 [Note] WSREP: Restored state OPEN -> JOINED (0)
130927 23:53:22 [Note] WSREP: New cluster view: global state:
e6e177a0-27f9-11e3-92e7-4b4286f53f4a:0, view# 1: Primary, number of nodes:
1, my index: 0, protocol version 2
130927 23:53:22 [Note] WSREP: SST complete, seqno: 0
130927 23:53:22 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
130927 23:53:22 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.
130927 23:53:22 InnoDB: The InnoDB memory heap is disabled
130927 23:53:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130927 23:53:22 InnoDB: Compressed tables use zlib 1.2.3
130927 23:53:22 InnoDB: Using Linux native AIO
130927 23:53:22 [Note] WSREP: Member 0 (node1) synced with group.
130927 23:53:22 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 0)
130927 23:53:22 InnoDB: Initializing buffer pool, size = 128.0M
130927 23:53:22 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
130927 23:53:22 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
130927 23:53:22 InnoDB: Log file ./ib_logfile0 did not exist: new to be
created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
130927 23:53:22 InnoDB: Log file ./ib_logfile1 did not exist: new to be
created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
130927 23:53:22 InnoDB: Waiting for the background threads to start
130927 23:53:23 Percona XtraDB (http://www.percona.com) 5.5.33-rel31.0
started; log sequence number 0
130927 23:53:23 [ERROR] Can't start server: Bind on TCP/IP port. Got
error: 98: Address already in use
130927 23:53:23 [ERROR] Do you already have another mysqld server running
on port: 5533 ?
130927 23:53:23 [ERROR] Aborting
130927 23:53:25 [Note] WSREP: Closing send monitor...
130927 23:53:25 [Note] WSREP: Closed send monitor.
130927 23:53:25 [Note] WSREP: gcomm: terminating thread
130927 23:53:25 [Note] WSREP: gcomm: joining thread
130927 23:53:25 [Note] WSREP: gcomm: closing backend
130927 23:53:25 [Note] WSREP: view((empty))
130927 23:53:25 [Note] WSREP: gcomm: closed
130927 23:53:25 [Note] WSREP: Received self-leave message.
130927 23:53:25 [Note] WSREP: Flow-control interval: [0, 0]
130927 23:53:25 [Note] WSREP: Received SELF-LEAVE. Closing connection.
130927 23:53:25 [Note] WSREP: Shifting SYNCED -> CLOSED (TO: 0)
130927 23:53:25 [Note] WSREP: RECV thread exiting 0: Success
130927 23:53:25 [Note] WSREP: recv_thread() joined.
130927 23:53:25 [Note] WSREP: Closing replication queue.
130927 23:53:25 [Note] WSREP: Closing slave action queue.
130927 23:53:25 [Note] WSREP: Service disconnected.
130927 23:53:25 [Note] WSREP: rollbacker thread exiting
130927 23:53:26 [Note] WSREP: Some threads may fail to exit.
130927 23:53:26 InnoDB: Starting shutdown...
130927 23:53:27 InnoDB: Shutdown completed; log sequence number 1597945
130927 23:53:27 [Note] /usr/sbin/mysqld: Shutdown complete
Error in my_thread_global_end(): 1 threads didn't exit
130927 23:53:32 mysqld_safe mysqld from pid file
/data/mysql/galera1/ubusrv1304-0.pid ended
Seeing the error about binding to port 5533, I ran netstat -anp | grep
5533, but got no results, indicating (I think) that port 5533 has no
process bound to it, in fact.
At some point previously, I somehow managed to get the server to at least
stay up, and while I could connect to it from the mysql command line
client, there was no command that didn't complain that there was no such
command.
I am thoroughly baffled at what I'm doing wrong, so any help at all would
be very welcome. Thank you, everyone, in advance!
Kendo UI Mobile viewlist issue
Kendo UI Mobile viewlist issue
I'm new to Kendo UI Mobile and I'm trying to display a list of wines from
a JSON object for a mobile app I'm trying to create.
When the app is launched nothing happends, so I guess something is not
linked up properly.
Can anyone take a look and see what is wrong?
JSON
{
"wine": [
{
"id": "9",
"name": "BLOCK NINE",
"year": "2009",
"grapes": "Pinot Noir",
"country": "USA",
"region": "California",
"description": "With hints of ginger and spice, this wine makes an
excellent complement to light appetizer and dessert fare for a
holiday gathering.",
"picture": "block_nine.jpg"
},
{
"id": "11",
"name": "BODEGA LURTON",
"year": "2011",
"grapes": "Pinot Gris",
"country": "Argentina",
"region": "Mendoza",
"description": "Solid notes of black currant blended with a light
citrus make this wine an easy pour for varied palates.",
"picture": "bodega_lurton.jpg"
}
]
}
HTML
<div id="tabstrip-winelist"
data-role="view"
data-layout="tabstrip-layout"
data-title="Wine List"
data-transition=""
data-model="app.winelistService.viewModel">
<div class="winelist">
<ul class="winelist"
data-role="listview"
data-bind="source: winelistDataSource">
<li>${name}</li>
</ul>
</div>
</div>
<div data-role="layout" data-id="tabstrip-layout" ></div>
wine.js
(function(global) {
var WinelistViewModel,
app = global.app = global.app || {};
WinelistViewModel = kendo.data.ObservableObject.extend({
winelistDataSource: null,
init: function () {
var that = this,
dataSource;
kendo.data.ObservableObject.fn.init.apply(that, []);
var wine_model = kendo.data.Model.define({
id: "id",
name: "name",
year: "year",
grapes: "grapes",
country: "country",
region: "region",
description: "description",
picture: "picture"
});
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://www.mydomain.co.uk/api/wines",
dataType: "json"
}
},
schema: {
model: "wine_model"
}
});
that.set("winelistDataSource", dataSource.wine);
}
});
app.inelistService = {
viewModel: new WinelistViewModel()
};
})(window);
I'm new to Kendo UI Mobile and I'm trying to display a list of wines from
a JSON object for a mobile app I'm trying to create.
When the app is launched nothing happends, so I guess something is not
linked up properly.
Can anyone take a look and see what is wrong?
JSON
{
"wine": [
{
"id": "9",
"name": "BLOCK NINE",
"year": "2009",
"grapes": "Pinot Noir",
"country": "USA",
"region": "California",
"description": "With hints of ginger and spice, this wine makes an
excellent complement to light appetizer and dessert fare for a
holiday gathering.",
"picture": "block_nine.jpg"
},
{
"id": "11",
"name": "BODEGA LURTON",
"year": "2011",
"grapes": "Pinot Gris",
"country": "Argentina",
"region": "Mendoza",
"description": "Solid notes of black currant blended with a light
citrus make this wine an easy pour for varied palates.",
"picture": "bodega_lurton.jpg"
}
]
}
HTML
<div id="tabstrip-winelist"
data-role="view"
data-layout="tabstrip-layout"
data-title="Wine List"
data-transition=""
data-model="app.winelistService.viewModel">
<div class="winelist">
<ul class="winelist"
data-role="listview"
data-bind="source: winelistDataSource">
<li>${name}</li>
</ul>
</div>
</div>
<div data-role="layout" data-id="tabstrip-layout" ></div>
wine.js
(function(global) {
var WinelistViewModel,
app = global.app = global.app || {};
WinelistViewModel = kendo.data.ObservableObject.extend({
winelistDataSource: null,
init: function () {
var that = this,
dataSource;
kendo.data.ObservableObject.fn.init.apply(that, []);
var wine_model = kendo.data.Model.define({
id: "id",
name: "name",
year: "year",
grapes: "grapes",
country: "country",
region: "region",
description: "description",
picture: "picture"
});
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://www.mydomain.co.uk/api/wines",
dataType: "json"
}
},
schema: {
model: "wine_model"
}
});
that.set("winelistDataSource", dataSource.wine);
}
});
app.inelistService = {
viewModel: new WinelistViewModel()
};
})(window);
Failed to submit app to iTunes Store
Failed to submit app to iTunes Store
I am having some problems when trying to submit my iPhone app to store
using XCode5 that my app is always failed validation with below errors:
Apple's web service operation was not successful
Unable to authenticate the package: [My app id, ex: 123456789].itmsp
ERROR ITEMS-9000: "The bundle [Bundle ID, ex: com.myapp.mobile] at bundle
path 'Payload/[My App Name].app' is not signed using an Apple submission
certificate." at SoftwareAssets/SoftwareAsset
(MZItmspSoftwareAssetPackage)
I am quite sure about settings (bundle id, certificate, profile,
entitlement) because this is not first time I submit app to store, jut
don't know why these issues come up, I have tried to search and found some
related article but they don't help.
Anyone know the root cause, pls help!
I am having some problems when trying to submit my iPhone app to store
using XCode5 that my app is always failed validation with below errors:
Apple's web service operation was not successful
Unable to authenticate the package: [My app id, ex: 123456789].itmsp
ERROR ITEMS-9000: "The bundle [Bundle ID, ex: com.myapp.mobile] at bundle
path 'Payload/[My App Name].app' is not signed using an Apple submission
certificate." at SoftwareAssets/SoftwareAsset
(MZItmspSoftwareAssetPackage)
I am quite sure about settings (bundle id, certificate, profile,
entitlement) because this is not first time I submit app to store, jut
don't know why these issues come up, I have tried to search and found some
related article but they don't help.
Anyone know the root cause, pls help!
Sunday, September 29, 2013
randomly make directories with random names - vbs
randomly make directories with random names - vbs
I have a folder with massive number of files, i need to make some folders
and put them in to that folders (below 50 of each), Folder names can be
any thing. I thought folder name to be numbers( 1,2,3.. etc ) here what i
done, i stuck with folder name. how can i do this
Set fso=CreateObject("Scripting.FileSystemObject")
inputFldr =".\myFolder"
Set fldr=fso.getFolder(inputFldr)
dim i
i=0
fName = 0
for each file in fldr.files
i = i+1
If Not fso.FolderExists(".\"&fName) Then fso.CreateFolder(".\"&fName)
End If
fso.movefile file, ".\"&fName&"\"&file
if i>50 then
fName = fName + 1
i = 0
end if
next
I have a folder with massive number of files, i need to make some folders
and put them in to that folders (below 50 of each), Folder names can be
any thing. I thought folder name to be numbers( 1,2,3.. etc ) here what i
done, i stuck with folder name. how can i do this
Set fso=CreateObject("Scripting.FileSystemObject")
inputFldr =".\myFolder"
Set fldr=fso.getFolder(inputFldr)
dim i
i=0
fName = 0
for each file in fldr.files
i = i+1
If Not fso.FolderExists(".\"&fName) Then fso.CreateFolder(".\"&fName)
End If
fso.movefile file, ".\"&fName&"\"&file
if i>50 then
fName = fName + 1
i = 0
end if
next
Java image string to image file
Java image string to image file
So I have a small HTTP POST server written in java. I am using Objective-C
to send data to the server.
In this case, I am trying to send an image file as NSData. Does anyone
know how to save the received NSData properly to a file?
So I have a small HTTP POST server written in java. I am using Objective-C
to send data to the server.
In this case, I am trying to send an image file as NSData. Does anyone
know how to save the received NSData properly to a file?
@media min-height doesn't work
@media min-height doesn't work
I try to use @media to check height of browser if it less than 600px
I want to set a new max-width and height so what did I do wrong?
or any missing syntax ?? Please advice and help , Thank!
I also have other @media which is work but for height not.
@media only screen and (min-height: 600px){
#book-container{
max-width: 748px;
max-height: 469px;
}
}
@media only screen and (max-width: 500px){
#txt-search{
visibility: hidden;
}
}
#book-container{
position: absolute;
left: 0;
right: 0;
top: 0px;
bottom: 0;
margin-left: auto;
margin-right: auto;
margin-top: auto;
margin-bottom: auto;
width: 80%;
max-width: 830px;
max-height: 520px;
/*max-width: 748px;*/
/*max-height: 469px;*/
}
I try to use @media to check height of browser if it less than 600px
I want to set a new max-width and height so what did I do wrong?
or any missing syntax ?? Please advice and help , Thank!
I also have other @media which is work but for height not.
@media only screen and (min-height: 600px){
#book-container{
max-width: 748px;
max-height: 469px;
}
}
@media only screen and (max-width: 500px){
#txt-search{
visibility: hidden;
}
}
#book-container{
position: absolute;
left: 0;
right: 0;
top: 0px;
bottom: 0;
margin-left: auto;
margin-right: auto;
margin-top: auto;
margin-bottom: auto;
width: 80%;
max-width: 830px;
max-height: 520px;
/*max-width: 748px;*/
/*max-height: 469px;*/
}
Not able toget a result on clicking the items of a list that include radio buttons
Not able toget a result on clicking the items of a list that include radio
buttons
I have a list that has a text view and 2 radio buttons in each row.I am
using a custom array adapter to populate the list view.I have implemented
the on item click listener on the list but it is not returning anything.In
fact it not executing the on click method at all.Here is the code:
Adapter class:
public class MyAdapter extends ArrayAdapter<String> {
Context context;
public static ArrayList<String> values=new ArrayList<String>();
public static ArrayList<String> attendance=new ArrayList<String>();
RadioGroup radioGroup;
RadioButton present,absent;
public MyAdapter(Context context,ArrayList values) {
super(context,org.example.attendance.R.layout.list_radio,values);
// TODO Auto-generated constructor stub
this.context=context;
this.values=values;
}
public View getView(int pos,View convertview,ViewGroup parent)
{
LayoutInflater
inflator=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View
rowView=inflator.inflate(org.example.attendance.R.layout.list_radio,parent,false);
radioGroup=(RadioGroup)rowView.findViewById(R.id.radioGroup1);
present=(RadioButton)rowView.findViewById(org.example.attendance.R.id.radio0);
absent=(RadioButton)rowView.findViewById(org.example.attendance.R.id.radio1);
TextView
textview=(TextView)rowView.findViewById(org.example.attendance.R.id.textView1);
// textview.setText(values[pos]);
//String s=values[pos];
textview.setText(values.get(pos));
//int selectedId = radioGroup.getCheckedRadioButtonId();
//if(selectedId==R.id.radio0)
return rowView;
}
public boolean areAllItemsEnabled()
{
return true;
}
@Override
public boolean isEnabled(int arg0)
{
return true;
}
}
main class:
public class Students_List extends Activity {
Intent i1;
String tablename;
RadioGroup radioGroup;
RadioButton present,absent;
ArrayList<String> student_name = new ArrayList<String>() ;
public static ArrayList<String> attendance=new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_students__list);
final ListView listview = (ListView) findViewById(R.id.listview);
i1=getIntent();
radioGroup=(RadioGroup)findViewById(R.id.radioGroup1);
present=(RadioButton)findViewById(org.example.attendance.R.id.radio0);
absent=(RadioButton)findViewById(org.example.attendance.R.id.radio1);
tablename=i1.getStringExtra("class")+"_student";
//Log.d("student","table"+tablename);
String temp=getServerData(KEY_12);
listview.setAdapter(new MyAdapter(this,student_name));
listview.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int
position,
long arg3) {
// TODO Auto-generated method stub
Log.d("view","clicked");
if(present.isChecked())
{
attendance.add("present");
}
if(absent.isChecked())
{
attendance.add("absent");
}
}
});
}
list_radio.xml:file that contains the views to populate each row
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView2"
android:layout_marginTop="24dp" />
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/textView1"
android:layout_marginRight="35dp"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="45dp"
android:checked="true" />
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
</RelativeLayout>
and finally the list view xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:descendantFocusability="blocksDescendants">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="150dp"
android:textSize="20sp"
android:textStyle="bold"
android:text="@string/present"
android:paddingRight="25dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textStyle="bold"
android:text="@string/absent" />
</LinearLayout>
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:cacheColorHint="#f8f8ff"
android:divider="#000000"
android:fadeScrollbars="true"
android:choiceMode="singleChoice"
android:fastScrollEnabled="true"
android:footerDividersEnabled="true"
android:textFilterEnabled="true"
android:textStyle="normal" />
<Button
android:id="@+id/Button01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/submit"
android:onClick="submit"/>
</LinearLayout>
What should i do so that i can get the state of the radio buttons??
buttons
I have a list that has a text view and 2 radio buttons in each row.I am
using a custom array adapter to populate the list view.I have implemented
the on item click listener on the list but it is not returning anything.In
fact it not executing the on click method at all.Here is the code:
Adapter class:
public class MyAdapter extends ArrayAdapter<String> {
Context context;
public static ArrayList<String> values=new ArrayList<String>();
public static ArrayList<String> attendance=new ArrayList<String>();
RadioGroup radioGroup;
RadioButton present,absent;
public MyAdapter(Context context,ArrayList values) {
super(context,org.example.attendance.R.layout.list_radio,values);
// TODO Auto-generated constructor stub
this.context=context;
this.values=values;
}
public View getView(int pos,View convertview,ViewGroup parent)
{
LayoutInflater
inflator=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View
rowView=inflator.inflate(org.example.attendance.R.layout.list_radio,parent,false);
radioGroup=(RadioGroup)rowView.findViewById(R.id.radioGroup1);
present=(RadioButton)rowView.findViewById(org.example.attendance.R.id.radio0);
absent=(RadioButton)rowView.findViewById(org.example.attendance.R.id.radio1);
TextView
textview=(TextView)rowView.findViewById(org.example.attendance.R.id.textView1);
// textview.setText(values[pos]);
//String s=values[pos];
textview.setText(values.get(pos));
//int selectedId = radioGroup.getCheckedRadioButtonId();
//if(selectedId==R.id.radio0)
return rowView;
}
public boolean areAllItemsEnabled()
{
return true;
}
@Override
public boolean isEnabled(int arg0)
{
return true;
}
}
main class:
public class Students_List extends Activity {
Intent i1;
String tablename;
RadioGroup radioGroup;
RadioButton present,absent;
ArrayList<String> student_name = new ArrayList<String>() ;
public static ArrayList<String> attendance=new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_students__list);
final ListView listview = (ListView) findViewById(R.id.listview);
i1=getIntent();
radioGroup=(RadioGroup)findViewById(R.id.radioGroup1);
present=(RadioButton)findViewById(org.example.attendance.R.id.radio0);
absent=(RadioButton)findViewById(org.example.attendance.R.id.radio1);
tablename=i1.getStringExtra("class")+"_student";
//Log.d("student","table"+tablename);
String temp=getServerData(KEY_12);
listview.setAdapter(new MyAdapter(this,student_name));
listview.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int
position,
long arg3) {
// TODO Auto-generated method stub
Log.d("view","clicked");
if(present.isChecked())
{
attendance.add("present");
}
if(absent.isChecked())
{
attendance.add("absent");
}
}
});
}
list_radio.xml:file that contains the views to populate each row
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView2"
android:layout_marginTop="24dp" />
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/textView1"
android:layout_marginRight="35dp"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="45dp"
android:checked="true" />
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
</RelativeLayout>
and finally the list view xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:descendantFocusability="blocksDescendants">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="150dp"
android:textSize="20sp"
android:textStyle="bold"
android:text="@string/present"
android:paddingRight="25dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textStyle="bold"
android:text="@string/absent" />
</LinearLayout>
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:cacheColorHint="#f8f8ff"
android:divider="#000000"
android:fadeScrollbars="true"
android:choiceMode="singleChoice"
android:fastScrollEnabled="true"
android:footerDividersEnabled="true"
android:textFilterEnabled="true"
android:textStyle="normal" />
<Button
android:id="@+id/Button01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/submit"
android:onClick="submit"/>
</LinearLayout>
What should i do so that i can get the state of the radio buttons??
Saturday, September 28, 2013
How set ViewPager inside a Fragment
How set ViewPager inside a Fragment
I need a viewPager inside of the fragment , but i have two fragments , The
fragment 1 is my MENU , and the fragment two i want to use a
ViewPagerIndicator ...
but a fragment can't have another fragment ... what i need to do for that?
I need a viewPager inside of the fragment , but i have two fragments , The
fragment 1 is my MENU , and the fragment two i want to use a
ViewPagerIndicator ...
but a fragment can't have another fragment ... what i need to do for that?
Cannot capture image of Azure VM
Cannot capture image of Azure VM
I think the official Azure instructions on how to capture a VM image must
be either incorrect or incomplete. I've run a variety of tests myself
(detailed below) and more than two dozen people have complained on the
page that the instructions don't work and/or damage their VM's. Surely
something is missing from the instructions because people must be able to
capture images from Azure VM's.
http://www.windowsazure.com/en-us/manage/windows/how-to-guides/capture-an-image/
The instructions on the page are pretty simple:
Remote Desktop into your Azure VM
Open an administrator command window
Run sysprep with the indicated settings (Out-Of-Box-Experience,
Generalize, Shutdown)
Hit OK
Wait for the system to shut the VM down
Click capture in the portal.
It sounds simple but the VM never actually shuts down so you can't
actually click the capure button. If you manually shutdown the instance,
even after waiting many hours, the resulting image fails to work and the
original vhd is destroyed in the process.
Can anyone confirm you are able to capture a running Azure instance using
either this workflow or some other workflow? If so, can you tell me what
you're doing differently from what I'm doing?
Details - The tests I've run are as follows:
TEST 1 - Win2k8 R2 on Small instance
Launch a small instance of Win2k8 R2 in the US West region
Remote desktop into the image
Run sysprep with OOBE,generalize,shutdown
Azure dashboard shows all CPU activity completed after 15min of sysprep,
device is idle, steady state is 0.41% cpu
Wait several hours (>2.5 hours as of this writing on this instance, >12
hours on other tests)
Azure VM is still running, capture button for the instance is unavailable
in portal
TEST 2 - Win2k8 R2 on Large instance
same steps as Test 1 but on Large instance
same results except steady state CPU utilization is 0.08% after 15 minutes
TEST 3 - Win2k12 Data Center Edition on small instance
same steps as Test 1 but run Win2k12 Data Center
same result as Test 1 except steady state CPU utilization is 4.2%
TEST 4 - Win2k8 R2 on Small instance with Windows update
same steps as Test 1 but run Windows Update repeatedly until no more
updates available before running sysprep
same results as Test 1
TEST 5 - Win2k8 R2 on Small instance with Visual Studio 2012 Update 3
same steps as Test 1 but install VS2012 Ultimate and VS2012 Update 3
before running sysprep
same results as Test 1
TEST 6 - Win2k8 R2 on Large instance with fully configured IIS server
provision our standard server configuation (IIS, .NET 4.5) on a large
instance
run our standard web service tests
run sysprep with OOBE,generalize,shutdown
wait 4 hours, allowing sysprep to run
use portal to shutdown instance
use portal to capture instance
generated image doesn't work (provisioning machines with it times out
after a couple hours)
original VHD doesn't work (can't remote desktop into instance created with
the VHD)
TEST 7 - Win2k8 R2 on Large instance with fully configured IIS server
same as test 6 except wait 12 hours allowing sysprep to run
as of this writing (12+ hours) the VM still hasn't shut down
I think the official Azure instructions on how to capture a VM image must
be either incorrect or incomplete. I've run a variety of tests myself
(detailed below) and more than two dozen people have complained on the
page that the instructions don't work and/or damage their VM's. Surely
something is missing from the instructions because people must be able to
capture images from Azure VM's.
http://www.windowsazure.com/en-us/manage/windows/how-to-guides/capture-an-image/
The instructions on the page are pretty simple:
Remote Desktop into your Azure VM
Open an administrator command window
Run sysprep with the indicated settings (Out-Of-Box-Experience,
Generalize, Shutdown)
Hit OK
Wait for the system to shut the VM down
Click capture in the portal.
It sounds simple but the VM never actually shuts down so you can't
actually click the capure button. If you manually shutdown the instance,
even after waiting many hours, the resulting image fails to work and the
original vhd is destroyed in the process.
Can anyone confirm you are able to capture a running Azure instance using
either this workflow or some other workflow? If so, can you tell me what
you're doing differently from what I'm doing?
Details - The tests I've run are as follows:
TEST 1 - Win2k8 R2 on Small instance
Launch a small instance of Win2k8 R2 in the US West region
Remote desktop into the image
Run sysprep with OOBE,generalize,shutdown
Azure dashboard shows all CPU activity completed after 15min of sysprep,
device is idle, steady state is 0.41% cpu
Wait several hours (>2.5 hours as of this writing on this instance, >12
hours on other tests)
Azure VM is still running, capture button for the instance is unavailable
in portal
TEST 2 - Win2k8 R2 on Large instance
same steps as Test 1 but on Large instance
same results except steady state CPU utilization is 0.08% after 15 minutes
TEST 3 - Win2k12 Data Center Edition on small instance
same steps as Test 1 but run Win2k12 Data Center
same result as Test 1 except steady state CPU utilization is 4.2%
TEST 4 - Win2k8 R2 on Small instance with Windows update
same steps as Test 1 but run Windows Update repeatedly until no more
updates available before running sysprep
same results as Test 1
TEST 5 - Win2k8 R2 on Small instance with Visual Studio 2012 Update 3
same steps as Test 1 but install VS2012 Ultimate and VS2012 Update 3
before running sysprep
same results as Test 1
TEST 6 - Win2k8 R2 on Large instance with fully configured IIS server
provision our standard server configuation (IIS, .NET 4.5) on a large
instance
run our standard web service tests
run sysprep with OOBE,generalize,shutdown
wait 4 hours, allowing sysprep to run
use portal to shutdown instance
use portal to capture instance
generated image doesn't work (provisioning machines with it times out
after a couple hours)
original VHD doesn't work (can't remote desktop into instance created with
the VHD)
TEST 7 - Win2k8 R2 on Large instance with fully configured IIS server
same as test 6 except wait 12 hours allowing sysprep to run
as of this writing (12+ hours) the VM still hasn't shut down
Generate random characters against specific loop condition
Generate random characters against specific loop condition
I want to continue generating a single character at random as long as the
loop condition is not met. I was hoping my code below will work but it
doesn't:
import string
import random
def random_characters(number):
i = 0
new_string = ''
while (i < number) :
new_string = random.choice(string.ascii_lowercase)
i = i + 1
return new_string
random_characters(3)
When i run this code nothing happens and I don't get any feedback about
any error. I may be using return new_string in a wrong way but I am unable
to figure it out even if that is what I'm missing.
I want to continue generating a single character at random as long as the
loop condition is not met. I was hoping my code below will work but it
doesn't:
import string
import random
def random_characters(number):
i = 0
new_string = ''
while (i < number) :
new_string = random.choice(string.ascii_lowercase)
i = i + 1
return new_string
random_characters(3)
When i run this code nothing happens and I don't get any feedback about
any error. I may be using return new_string in a wrong way but I am unable
to figure it out even if that is what I'm missing.
how to change JTable's row background color and sum
how to change JTable's row background color and sum
I want to create a JTable that has JCkeckbox in ever row.When user click,
row background color must change.Moreover, Sum of clicked rows must show
in other JTable. Which way should I follw? Which classes should I use.
Thanks for help.
I want to create a JTable that has JCkeckbox in ever row.When user click,
row background color must change.Moreover, Sum of clicked rows must show
in other JTable. Which way should I follw? Which classes should I use.
Thanks for help.
Friday, September 27, 2013
change state in checked of a checkbox in another thread
change state in checked of a checkbox in another thread
hi there i search but i don't find any answer. I have a thread which has a
form whith some checkbox whith default state unchecked and disable. i need
to change state at some of that checkbox if i terminate some action in the
main thread . for example when in the main thread i finish a method i need
check the checkbox in the secondary thread. thx
i start my thread from the main thread whith:
Thread t = new Thread(new ThreadStart(waitformstart));
t.Start();
The second thread is only a windows form whith a gif and 4 checkbox thx so
much
hi there i search but i don't find any answer. I have a thread which has a
form whith some checkbox whith default state unchecked and disable. i need
to change state at some of that checkbox if i terminate some action in the
main thread . for example when in the main thread i finish a method i need
check the checkbox in the secondary thread. thx
i start my thread from the main thread whith:
Thread t = new Thread(new ThreadStart(waitformstart));
t.Start();
The second thread is only a windows form whith a gif and 4 checkbox thx so
much
SVN update overwrites my working copy
SVN update overwrites my working copy
I am trying to use SVN from WebStorm on a software project. The issue I'm
having is that there is a file in the repo that is missing many functions
I have added on my working directory, and if I update my project from SVN
then my working copy loses these changes. If I commit my changes from my
working copy to SVN I overwrite the file that is already there.
How can I commit my changes to the repo while adding to what's already
there without overwriting?
I am trying to use SVN from WebStorm on a software project. The issue I'm
having is that there is a file in the repo that is missing many functions
I have added on my working directory, and if I update my project from SVN
then my working copy loses these changes. If I commit my changes from my
working copy to SVN I overwrite the file that is already there.
How can I commit my changes to the repo while adding to what's already
there without overwriting?
mobile device not detecting media stylesheet
mobile device not detecting media stylesheet
I am rather new to responsive websites and though I have built a few
responsive sites previously that worked fine, for some reason I am having
trouble with a current site. When viewed on a laptop or desktop the break
points work well when adjusting the browser size, however when viewed on a
mobile device it just loads the full size and fits it to the screen width
ignoring the media specific stylesheets. As I said I have used this method
in the past and haven't had any issues so am hoping someone can point me
in the right direction. I have seen similar issues in forums but haven't
had any luck with the solutions provided.
The URL i am working off is www.evolvecollaboration.com/test/index.html
and the code from my is below.
<meta name="viewport" content="width=device-width, maximum-scale=1.0,
minimum-scale=1.0, initial-scale=1.0" />
<link rel="stylesheet" href="_css/myer_reset.css">
<link rel="stylesheet" type="text/css" href="_css/structure.css" />
<link rel="stylesheet" type="text/css" media="only screen and
(min-width:501px) and (max-width:800px)" href="_css/structure_tablet.css"
/>
<link rel="stylesheet" type="text/css" media="only screen and
(min-width:50px) and (max-width:500px)" href="_css/structure_mobile.css"
/>
I am rather new to responsive websites and though I have built a few
responsive sites previously that worked fine, for some reason I am having
trouble with a current site. When viewed on a laptop or desktop the break
points work well when adjusting the browser size, however when viewed on a
mobile device it just loads the full size and fits it to the screen width
ignoring the media specific stylesheets. As I said I have used this method
in the past and haven't had any issues so am hoping someone can point me
in the right direction. I have seen similar issues in forums but haven't
had any luck with the solutions provided.
The URL i am working off is www.evolvecollaboration.com/test/index.html
and the code from my is below.
<meta name="viewport" content="width=device-width, maximum-scale=1.0,
minimum-scale=1.0, initial-scale=1.0" />
<link rel="stylesheet" href="_css/myer_reset.css">
<link rel="stylesheet" type="text/css" href="_css/structure.css" />
<link rel="stylesheet" type="text/css" media="only screen and
(min-width:501px) and (max-width:800px)" href="_css/structure_tablet.css"
/>
<link rel="stylesheet" type="text/css" media="only screen and
(min-width:50px) and (max-width:500px)" href="_css/structure_mobile.css"
/>
How do I modify Windos Phone XAML elements using C#?
How do I modify Windos Phone XAML elements using C#?
My app is a panorama app with web browser elements and headers above
those. Those elements are going to be controlled by several settings on
the application bar below the app. How do I change the header text in the
XAML page as well as the web browser URL's using the C# events from the
App Bar?
My app is a panorama app with web browser elements and headers above
those. Those elements are going to be controlled by several settings on
the application bar below the app. How do I change the header text in the
XAML page as well as the web browser URL's using the C# events from the
App Bar?
how upload capture image with android device to mysql server
how upload capture image with android device to mysql server
I am trying to capture image store in mysql database and display in grid
view but i am unable to upload image in mysql database.image store in
internal sqlite database but i want to move into mysql database
I am trying to capture image store in mysql database and display in grid
view but i am unable to upload image in mysql database.image store in
internal sqlite database but i want to move into mysql database
Thursday, September 26, 2013
SQL server select A.*, count(b) group by
SQL server select A.*, count(b) group by
I want to run a query on sql server to select all the elements in a table
(tableA) with an aggregate from another table
select a.*, count(b.number) from tableA a
inner join tableB b on a.id = b.a_id
group by a.id;
This gives the following error :
Error: Column 'a.id' is invalid in the select list because it is not
contained in either an aggregate function or the GROUP BY clause.
SQLState: S1000
ErrorCode: 8120
What is the right query to get what i want?
I want to run a query on sql server to select all the elements in a table
(tableA) with an aggregate from another table
select a.*, count(b.number) from tableA a
inner join tableB b on a.id = b.a_id
group by a.id;
This gives the following error :
Error: Column 'a.id' is invalid in the select list because it is not
contained in either an aggregate function or the GROUP BY clause.
SQLState: S1000
ErrorCode: 8120
What is the right query to get what i want?
Wednesday, September 25, 2013
How to fix my application appcrash?
How to fix my application appcrash?
I have deployment setup.exe, when install other computer is done. Open my
application contracted problem appcrash. I'm using Visual studio 2010 and
.NET 4.0 build setup file. Setup and install on two computer remains the
same.(windows 7 - 64bit) Please help !
Image Here Thanks
I have deployment setup.exe, when install other computer is done. Open my
application contracted problem appcrash. I'm using Visual studio 2010 and
.NET 4.0 build setup file. Setup and install on two computer remains the
same.(windows 7 - 64bit) Please help !
Image Here Thanks
Thursday, September 19, 2013
What is the quickest way to write out a large data frame as json in R?
What is the quickest way to write out a large data frame as json in R?
I need to write a large data frame to a file as JSON in R. I am using the
rjson package. The approach below is quite slow...
for (i in 1:nrow(df)) {
write.table(toJSON(df[i,]),"[FILENAME]",
row.names=FALSE,col.names=FALSE,quote=FALSE,append=TRUE)
}
So I tried this:
write.table(toJSON(df),"FILENAME]",
row.names=FALSE,col.names=FALSE,quote=FALSE,append=TRUE)
Which chokes because toJSON() cannot handle a string that is of very long
length. So I would like to perhaps write out chunks of my data table at a
time. What is the recommended approach for this? If it involves split()
could you provide some psuedocode?
I need to write a large data frame to a file as JSON in R. I am using the
rjson package. The approach below is quite slow...
for (i in 1:nrow(df)) {
write.table(toJSON(df[i,]),"[FILENAME]",
row.names=FALSE,col.names=FALSE,quote=FALSE,append=TRUE)
}
So I tried this:
write.table(toJSON(df),"FILENAME]",
row.names=FALSE,col.names=FALSE,quote=FALSE,append=TRUE)
Which chokes because toJSON() cannot handle a string that is of very long
length. So I would like to perhaps write out chunks of my data table at a
time. What is the recommended approach for this? If it involves split()
could you provide some psuedocode?
How can I prevent iPhone (including iOS 7) from going to sleep in HTML or JS?
How can I prevent iPhone (including iOS 7) from going to sleep in HTML or JS?
I'm attempting to write some code to keep a phone alive and not go to
sleep on a webpage.
In my search, I found this post: Prevent iOS mobile safari from going idle
/ auto-locking / sleeping?
But looping an audio file seems to no longer keep MobileSafari alive and
prevent the phone from locking. While forcing the page to refresh every 30
seconds works, I need the original page to stay open.
Google's latest interactive music video, Just A Reflektor, seems to be
preventing lock from mobile, and their JS here references a
preventSleepIos function.
What could I simply do to prevent iOS from falling asleep?
Thanks!
I'm attempting to write some code to keep a phone alive and not go to
sleep on a webpage.
In my search, I found this post: Prevent iOS mobile safari from going idle
/ auto-locking / sleeping?
But looping an audio file seems to no longer keep MobileSafari alive and
prevent the phone from locking. While forcing the page to refresh every 30
seconds works, I need the original page to stay open.
Google's latest interactive music video, Just A Reflektor, seems to be
preventing lock from mobile, and their JS here references a
preventSleepIos function.
What could I simply do to prevent iOS from falling asleep?
Thanks!
Cannot Deploy using SDK 6 in IOS 7
Cannot Deploy using SDK 6 in IOS 7
I have a proyect in sdk 6.1 that were running in IOS 6. Later i updated to
xcode 5 and download the sdk 6.1 and copied to the folder:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
in order to use this sdk in the xcode but when i set the proyect to deploy
using sdk 6.1 in IOS 7 it seems like its using the sdk 7.0. I can tell
becouse the new trasitions and efects.
I have a proyect in sdk 6.1 that were running in IOS 6. Later i updated to
xcode 5 and download the sdk 6.1 and copied to the folder:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
in order to use this sdk in the xcode but when i set the proyect to deploy
using sdk 6.1 in IOS 7 it seems like its using the sdk 7.0. I can tell
becouse the new trasitions and efects.
Ldap authentication in php is not working with out zend frame work
Ldap authentication in php is not working with out zend frame work
Like normal, $ds= ldap_connect($host,$port) is connecting to my server,
but I cannot bind the username and password to my ldap server. I tried
binding with ldap_bind($ds,$user,$pwd).
I also tried with ldap_bind($ds,$user.$domainName,$pwd).
Then, my client told me that their Ldap server had a server.username
='INHY_PSB' and server.password = 'some_password'.
This kind of ldap connections are only possible with zend_php class. Now I
cannot move my whole project to zend frame work. Is there any way to
connect to ldap using zend classes? Please help me to figure out this..
This code was taken from Zend frame work website3
Like normal, $ds= ldap_connect($host,$port) is connecting to my server,
but I cannot bind the username and password to my ldap server. I tried
binding with ldap_bind($ds,$user,$pwd).
I also tried with ldap_bind($ds,$user.$domainName,$pwd).
Then, my client told me that their Ldap server had a server.username
='INHY_PSB' and server.password = 'some_password'.
This kind of ldap connections are only possible with zend_php class. Now I
cannot move my whole project to zend frame work. Is there any way to
connect to ldap using zend classes? Please help me to figure out this..
This code was taken from Zend frame work website3
using multiple #define statements to create urls
using multiple #define statements to create urls
I want to define a base URL in my app:
#define kBaseURL @"http://mydomain.com/"
And the also be able to create other URL's using this as a base
#define kProductsURL @"/products"
I know I could do something like this:
NSString *urlString = [NSString stringWithFormat:@"%@%@",
kBaseURL,kProductsURL];
How do I alter the kProductsURL I can just use kProductsURL with having to
do the string formatting?
I know there is a ton you can do with the #define statements but I have
not been able to find a good tutorial or documentation.
Can someone point me in the right direction?
I want to define a base URL in my app:
#define kBaseURL @"http://mydomain.com/"
And the also be able to create other URL's using this as a base
#define kProductsURL @"/products"
I know I could do something like this:
NSString *urlString = [NSString stringWithFormat:@"%@%@",
kBaseURL,kProductsURL];
How do I alter the kProductsURL I can just use kProductsURL with having to
do the string formatting?
I know there is a ton you can do with the #define statements but I have
not been able to find a good tutorial or documentation.
Can someone point me in the right direction?
SQL IN operator for multiple columns from different tables
SQL IN operator for multiple columns from different tables
I have an oracle 11.2 database and need the following query:
SELECT * FROM table1 a, table2 b
WHERE a.id = b.a_id AND (a.a_col1, b.b_col1) in ((?, ?), (?, ?), (?, ?))
Please note, that the values don't matter, I am interested in the
structure of such a query. I am going to execute the query from java,
passing parameters.
I have an oracle 11.2 database and need the following query:
SELECT * FROM table1 a, table2 b
WHERE a.id = b.a_id AND (a.a_col1, b.b_col1) in ((?, ?), (?, ?), (?, ?))
Please note, that the values don't matter, I am interested in the
structure of such a query. I am going to execute the query from java,
passing parameters.
How to check whether java is installed on the computer
How to check whether java is installed on the computer
I am trying to install java windows application on client machine.I want
to check whether requried JRE is installed on the machine or not. I want
to check it by java program
I am trying to install java windows application on client machine.I want
to check whether requried JRE is installed on the machine or not. I want
to check it by java program
Wednesday, September 18, 2013
Permanent Webpage Background in CSS
Permanent Webpage Background in CSS
I currently am working on a basic website for a friend who wants a simple
blog/website, and have a quick CSS question.
http://nashread.com/template1 Is the current domain, and if the background
on there is fine and covers the whole screen. That's because the content
box isn't long enough to extend the page. If you click on the 'blogs' tab,
you'll see that if the content box extends the background, it just goes
into white space. Basically what I'm asking, is how would I make it so
when you scroll it only scrolls the content box, rather than the whole
webpage? It might not even be possible in HTML or CSS, so if so please
tell me.
Thanks (=
I currently am working on a basic website for a friend who wants a simple
blog/website, and have a quick CSS question.
http://nashread.com/template1 Is the current domain, and if the background
on there is fine and covers the whole screen. That's because the content
box isn't long enough to extend the page. If you click on the 'blogs' tab,
you'll see that if the content box extends the background, it just goes
into white space. Basically what I'm asking, is how would I make it so
when you scroll it only scrolls the content box, rather than the whole
webpage? It might not even be possible in HTML or CSS, so if so please
tell me.
Thanks (=
Adding bullet points to Text Field in LiveCycle Designer ES4
Adding bullet points to Text Field in LiveCycle Designer ES4
I am trying to add bullet point functionality to a text field in Adobe
LiveCycle Designer ES4. Basically the form is to be used as a meeting
minutes template and I have expanding text fields that should convert each
line/paragraph of text to a bullet point once the user hits enter.
Adobe LiveCycle Designer ES4 allows for javascript and FormCalc.
Any help will be really appreciated.
I am trying to add bullet point functionality to a text field in Adobe
LiveCycle Designer ES4. Basically the form is to be used as a meeting
minutes template and I have expanding text fields that should convert each
line/paragraph of text to a bullet point once the user hits enter.
Adobe LiveCycle Designer ES4 allows for javascript and FormCalc.
Any help will be really appreciated.
Does Javascript closure always retain scope variables?
Does Javascript closure always retain scope variables?
I understand that code in closure can access variables & methods &
arguments up the scope chain, but what happens if it doesn't use any of
them ? do those variables still retained ?
Consider this case :
function f(){
var a=[];
for(var i=0;i<1000000;i++) a.push({});
return function(){
alert('Hi');
};
}
var x = f();
Does variable a retained in memory even though the closure does not use it ?
Thanks
I understand that code in closure can access variables & methods &
arguments up the scope chain, but what happens if it doesn't use any of
them ? do those variables still retained ?
Consider this case :
function f(){
var a=[];
for(var i=0;i<1000000;i++) a.push({});
return function(){
alert('Hi');
};
}
var x = f();
Does variable a retained in memory even though the closure does not use it ?
Thanks
I cant run it now and I dont know if I should revise my code
I cant run it now and I dont know if I should revise my code
My original was to have a flat land that generated ores below the grass by
using a number generator to identify which block was drawn. Now as I have
made loops to create that, it won't even start.It puzzles me why and if I
should not use do loops than tell me a more efficient way to do this. I
have been learning C# for around 2 months and I am trying to get the hang
of it.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace WindowsGame3
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D EarthGrass;
Texture2D EarthDirt;
Texture2D PooperMachoOre;
Vector2 BlockPos = new Vector2(0, 300);
System.Random IDB = new System.Random();
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
/// <summary>
/// Allows the game to perform any initialization it needs to
before starting to run.
/// This is where it can query for any required services and load
any non-graphic
/// related content. Calling base.Initialize will enumerate
through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here
EarthGrass = Content.Load<Texture2D>("Sprites/EarthGrass");
EarthDirt = Content.Load<Texture2D>("Sprites/EarthDirt");
PooperMachoOre =
Content.Load<Texture2D>("Sprites/Ores/PooperMachoOre");
}
/// <summary>
/// UnloadContent will be called once per game and is the place to
unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing
values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back ==
ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing
values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
int IDBint = IDB.Next(11);
spriteBatch.Begin();
do
{
if (BlockPos.X == 300)
do
{
spriteBatch.Draw(EarthGrass,BlockPos,Color.White);
BlockPos.X +=20;
} while (BlockPos.X < 800) ;
if (BlockPos.X <= 800)
BlockPos.Y += 20;
do
{
if (IDBint == 10)
{
spriteBatch.Draw(PooperMachoOre, BlockPos,
Color.White);
BlockPos.X += 20;
}
else
{
spriteBatch.Draw(EarthDirt, BlockPos, Color.White);
BlockPos.X += 20;
}
}while (BlockPos.X < 800);
BlockPos.Y += 20;
} while (BlockPos.Y > 800);
BlockPos.X = 0;
BlockPos.Y = 300;
spriteBatch.End();
base.Draw(gameTime);
}
}
}
My original was to have a flat land that generated ores below the grass by
using a number generator to identify which block was drawn. Now as I have
made loops to create that, it won't even start.It puzzles me why and if I
should not use do loops than tell me a more efficient way to do this. I
have been learning C# for around 2 months and I am trying to get the hang
of it.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace WindowsGame3
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D EarthGrass;
Texture2D EarthDirt;
Texture2D PooperMachoOre;
Vector2 BlockPos = new Vector2(0, 300);
System.Random IDB = new System.Random();
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
/// <summary>
/// Allows the game to perform any initialization it needs to
before starting to run.
/// This is where it can query for any required services and load
any non-graphic
/// related content. Calling base.Initialize will enumerate
through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here
EarthGrass = Content.Load<Texture2D>("Sprites/EarthGrass");
EarthDirt = Content.Load<Texture2D>("Sprites/EarthDirt");
PooperMachoOre =
Content.Load<Texture2D>("Sprites/Ores/PooperMachoOre");
}
/// <summary>
/// UnloadContent will be called once per game and is the place to
unload
/// all content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing
values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back ==
ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing
values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
int IDBint = IDB.Next(11);
spriteBatch.Begin();
do
{
if (BlockPos.X == 300)
do
{
spriteBatch.Draw(EarthGrass,BlockPos,Color.White);
BlockPos.X +=20;
} while (BlockPos.X < 800) ;
if (BlockPos.X <= 800)
BlockPos.Y += 20;
do
{
if (IDBint == 10)
{
spriteBatch.Draw(PooperMachoOre, BlockPos,
Color.White);
BlockPos.X += 20;
}
else
{
spriteBatch.Draw(EarthDirt, BlockPos, Color.White);
BlockPos.X += 20;
}
}while (BlockPos.X < 800);
BlockPos.Y += 20;
} while (BlockPos.Y > 800);
BlockPos.X = 0;
BlockPos.Y = 300;
spriteBatch.End();
base.Draw(gameTime);
}
}
}
trimming \n \t from xmlChar not working
trimming \n \t from xmlChar not working
#include "boost/algorithm/string/trim.hpp"
..
..
xmlChar *v = NULL;
cur = xmlDocGetRootElement(doc);
for (cur = cur->xmlChildrenNode; cur != NULL; cur = cur->next) {
v = xmlGetProp(cur, (const xmlChar *)"value");
trim((char*)v);
printf("%s",v);
}
This code doesn't compile, says trim is not defined, I tried boost::trim
and it did not help. thanks.
#include "boost/algorithm/string/trim.hpp"
..
..
xmlChar *v = NULL;
cur = xmlDocGetRootElement(doc);
for (cur = cur->xmlChildrenNode; cur != NULL; cur = cur->next) {
v = xmlGetProp(cur, (const xmlChar *)"value");
trim((char*)v);
printf("%s",v);
}
This code doesn't compile, says trim is not defined, I tried boost::trim
and it did not help. thanks.
How can i find user age using date of birth?
How can i find user age using date of birth?
How can i find user's age using date of birth?
E.G $dob = '1990-02-10';
How can i calculate his age ? Like in Years , months and days ? Or Just
Years will be fine too
How can i find user's age using date of birth?
E.G $dob = '1990-02-10';
How can i calculate his age ? Like in Years , months and days ? Or Just
Years will be fine too
Get the first (sorted) match of second table in SQL Server?
Get the first (sorted) match of second table in SQL Server?
I'm sure this is easier than I'm making it, but I have two tables :
Item Descriptions
itemID (PK) index (PK)
itemID
Description
Now, there are multiple descriptions per itemID ... but I want to get the
description with the lowest index number (the first one) PER item
I found some implementations of similar problems using Limit, but SQL
SERVER doesn't have it. If someone could throw me a solution with
explanation I'd be grateful. I tried using Top(1) but that gives me 1
result total... i need 1 result per Item :-/
I'm sure this is easier than I'm making it, but I have two tables :
Item Descriptions
itemID (PK) index (PK)
itemID
Description
Now, there are multiple descriptions per itemID ... but I want to get the
description with the lowest index number (the first one) PER item
I found some implementations of similar problems using Limit, but SQL
SERVER doesn't have it. If someone could throw me a solution with
explanation I'd be grateful. I tried using Top(1) but that gives me 1
result total... i need 1 result per Item :-/
Microsoft Dynamics online: change field's data type
Microsoft Dynamics online: change field's data type
What are the steps for changing Field's (not custom) data type? I go to
Customizations -> Customize the System -> Entities -> Activity -> Fields
-> Subject. I need to change Type from "Single Line of Text" to "Option
set". How do I do that? I have Visual Studio 2012 and Microsoft Dynamics
CRM SDK but I'm not experienced at it.
What are the steps for changing Field's (not custom) data type? I go to
Customizations -> Customize the System -> Entities -> Activity -> Fields
-> Subject. I need to change Type from "Single Line of Text" to "Option
set". How do I do that? I have Visual Studio 2012 and Microsoft Dynamics
CRM SDK but I'm not experienced at it.
Restore default trace mode adb
Restore default trace mode adb
In order to fix my adb setup I`ve set ADB trace mode to all using the
following command:
set ADB_TRACE=all
Now that I've resolved my issue, I would like to reset the ADB trace mode
to the default (out of the box) value, so my cmd output doesn`t get
cluttered with unnecessary traces.
In order to fix my adb setup I`ve set ADB trace mode to all using the
following command:
set ADB_TRACE=all
Now that I've resolved my issue, I would like to reset the ADB trace mode
to the default (out of the box) value, so my cmd output doesn`t get
cluttered with unnecessary traces.
Tuesday, September 17, 2013
How to make a linq statement if a record exist
How to make a linq statement if a record exist
I am trying this but it doesn't work how can i correct this.
Actually i faced two conditions in both the case first i need to check if
record exist, in first case if it exist i want assign some value not from
edmx, in second case if record exist i want to assign value from the edmx
file.
IsPriceApplied = cn.OrderDressings.Any(x => x.OrderID == OrderID &&
x.OrderItemID == ProductID) ?(from yy in cn.OrderDressings where
yy.OrderID==OrderID && yy.OrderItemID==ProductID select
yy.IsPriceApplied):Do Nothing
I am trying this but it doesn't work how can i correct this.
Actually i faced two conditions in both the case first i need to check if
record exist, in first case if it exist i want assign some value not from
edmx, in second case if record exist i want to assign value from the edmx
file.
IsPriceApplied = cn.OrderDressings.Any(x => x.OrderID == OrderID &&
x.OrderItemID == ProductID) ?(from yy in cn.OrderDressings where
yy.OrderID==OrderID && yy.OrderItemID==ProductID select
yy.IsPriceApplied):Do Nothing
How to use a custom manager method from model relationship
How to use a custom manager method from model relationship
Lets say I have 2 model class. Category has a name and multiple tags and
Tag has a name, can be visible or not. I would like to do something like
this :
visible_tags_for_my_category = c.tags.get_visible_tags()
where "c" represents a category instance with some tags and
get_visible_tags() would return all the tags where visible=True that the
category has.
Should I use a custom manager to do this ? If yes, how can I use the
custom manager from tag with category?
class Category(models.Model):
name = models.CharField(max_length=255, unique=True)
tags = models.ManyToManyField(Tag)
class Tag(models.Model):
name = models.CharField(max_length=255, unique=True)
visible = models.BooleanField(default=False)
Lets say I have 2 model class. Category has a name and multiple tags and
Tag has a name, can be visible or not. I would like to do something like
this :
visible_tags_for_my_category = c.tags.get_visible_tags()
where "c" represents a category instance with some tags and
get_visible_tags() would return all the tags where visible=True that the
category has.
Should I use a custom manager to do this ? If yes, how can I use the
custom manager from tag with category?
class Category(models.Model):
name = models.CharField(max_length=255, unique=True)
tags = models.ManyToManyField(Tag)
class Tag(models.Model):
name = models.CharField(max_length=255, unique=True)
visible = models.BooleanField(default=False)
how to customize positions using html in DW?
how to customize positions using html in DW?
i'm making an application using DreamWaver by HTML, i'm making a new div
and positioned it using the DreamWaver design capabilities, but when
running it in the browser i found that the position had changed, it's in
the following figures:
*IN DW:
http://postimg.org/image/cvshkio0v/
*in browser(firefox & chrome):
http://postimg.org/image/85ve2097f/
and that's the code parts:
CSS
.buttonClass {
width: 320px;
height: auto;
text-align: center;
line-height: normal;
border-radius: 7px;
z-index: 3;
background-image: -webkit-linear-gradient(top,#FFF 0%,#91BDD6 100%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #91BDD6 100%);
background-image: -ms-linear-gradient(top,#FFF,#91BDD6);
background-image: -o-linear-gradient(top,#FFF,#91BDD6);
background-image: linear-gradient(top,#FFF,#91BDD6);
border: solid #91BDD6 5px;
box-shadow: 0px 0px 0px 5px #fff, 5px 3px 12px #000000;
position: absolute;
left: 1014px;
top: 591px;
}
HTML
<div id="confirm" class="buttonClass">
<div align="center">Confirm</div>
</div>
i'm making an application using DreamWaver by HTML, i'm making a new div
and positioned it using the DreamWaver design capabilities, but when
running it in the browser i found that the position had changed, it's in
the following figures:
*IN DW:
http://postimg.org/image/cvshkio0v/
*in browser(firefox & chrome):
http://postimg.org/image/85ve2097f/
and that's the code parts:
CSS
.buttonClass {
width: 320px;
height: auto;
text-align: center;
line-height: normal;
border-radius: 7px;
z-index: 3;
background-image: -webkit-linear-gradient(top,#FFF 0%,#91BDD6 100%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #91BDD6 100%);
background-image: -ms-linear-gradient(top,#FFF,#91BDD6);
background-image: -o-linear-gradient(top,#FFF,#91BDD6);
background-image: linear-gradient(top,#FFF,#91BDD6);
border: solid #91BDD6 5px;
box-shadow: 0px 0px 0px 5px #fff, 5px 3px 12px #000000;
position: absolute;
left: 1014px;
top: 591px;
}
HTML
<div id="confirm" class="buttonClass">
<div align="center">Confirm</div>
</div>
Jquery.min.map File 404 in MVC4 Application
Jquery.min.map File 404 in MVC4 Application
I have IIS 6.2 running a C# MVC4 application and I keep getting a
jquery.min.map 404 error in Google Chrome. I do not get the same error in
IE9. I have the uncompressed jquery file along with the minified one and
the map all in my scripts directory controlled by a NuGet package. Is
there something specific with Chrome that could be causing this or is
there something else I can look into? It looks like all my references are
correct (I'm including it in the Bundler, etc.)
Thanks!
I have IIS 6.2 running a C# MVC4 application and I keep getting a
jquery.min.map 404 error in Google Chrome. I do not get the same error in
IE9. I have the uncompressed jquery file along with the minified one and
the map all in my scripts directory controlled by a NuGet package. Is
there something specific with Chrome that could be causing this or is
there something else I can look into? It looks like all my references are
correct (I'm including it in the Bundler, etc.)
Thanks!
Commercial use of Bootstrap?
Commercial use of Bootstrap?
This is my question:
Can I use Twitter's bootstrap framework for free in a commercial project?
I couldn't find any reliable information with Google... Thanks a lot!
This is my question:
Can I use Twitter's bootstrap framework for free in a commercial project?
I couldn't find any reliable information with Google... Thanks a lot!
What is the best way to wrap dbContext for DI?
What is the best way to wrap dbContext for DI?
I am thinking something like the following may work ok for injecting
dbcontext via constructor to my service layer.... Does anyone out there
have a better way?
public interface IContextFactory:IDisposable
{
DbContext Create();
}
public class ContextFactory<TContext> : IContextFactory where TContext :
DbContext, new()
{
private DbContext _context;
public DbContext Create()
{
_context = new TContext();
_context.Configuration.LazyLoadingEnabled = true;
return _context;
}
public void Dispose()
{
_context.Dispose();
}
}
I am thinking something like the following may work ok for injecting
dbcontext via constructor to my service layer.... Does anyone out there
have a better way?
public interface IContextFactory:IDisposable
{
DbContext Create();
}
public class ContextFactory<TContext> : IContextFactory where TContext :
DbContext, new()
{
private DbContext _context;
public DbContext Create()
{
_context = new TContext();
_context.Configuration.LazyLoadingEnabled = true;
return _context;
}
public void Dispose()
{
_context.Dispose();
}
}
Sunday, September 15, 2013
Steganography on audio/image with perl script
Steganography on audio/image with perl script
Could any give me some links where I could find scripts on perl for
steganagraphy process? when I surfed through web, i got only softwares for
it.
S/w like stegano
Could any give me some links where I could find scripts on perl for
steganagraphy process? when I surfed through web, i got only softwares for
it.
S/w like stegano
How insert bits into block in java cryptography?
How insert bits into block in java cryptography?
I try make simple program cryptography using java program. my problem when
read block 32 bytes from file clearmsg.txt after convert this block to
intrger number after that use this number for encrypt process the result
size of cipher text not static sometimes 30 bytes sometimes 26 bytes
independet on result of add process like it showing I thinking about how
become cipher block 32 bytes. How add bits to this block because when I
try decrypt this block I need read 32 bytes to decrypt block as the
following my try
private void ENC_add()
{
File clearmsg = new File("F:/java_projects/clearmsg.txt");
File ciphermsg = new File("F:/java_projects/ciphermsg.txt");
byte[] block = new byte[32];
try {
FileInputStream fis = new FileInputStream(clearmsg);
FileOutputStream fcs = new FileOutputStream(ciphermsg);
int i;
while ((i = fis.read(block)) != -1) {
//Is this process true
//here M2 (Plain text) shuld be 32 byte
M2 = new BigInteger(block);
// here encrypt M2 by add k1 where k1 any number less than P
CM2=M2.add(K1).mod(P);
//here my problem some time Cipher CM2 length 31 , some time CM2
length 32 ,some time CM2 length 30
System.out.println("THE CM2=" +CM2.toByteArray().Length);
fcs.write(CM2.toByteArray(), 0, i);
}
fcs.close();
}
catch (IOException e) {
e.printStackTrace();
} }
//Here problem for decrypt
private void DEC_ADD()
{
//DECREPT METHOD
File ciphermsg = new File("F:/java_projects/ciphermsg.txt");
File clearmsg = new File("F:/java_projects/rciphermsg.txt");
byte[] block = new byte[32];
try {
FileInputStream fis = new FileInputStream(ciphermsg);
FileOutputStream fos = new FileOutputStream(clearmsg);
int i;
while ((i = fis.read(block)) != -1) {
//CM2 NOT STATIC BITS NUMBER BECAUSE INDEPENDET ON RESULT ADDITIONAL AND
PRIME NUMBER P through ENCRYPT Process
CM2 = new BigInteger(block);
// here RM2 is decrypt cipher (CM2) NOTE When encrypt above M2 WAS 32
bytes and Cipher CM2 was 30 bytes and When I read from file 32 bytes then
this is my problem
RM2=CM2.subtract(K1).mod(P);
}
fos.write(RM2.toByteArray(), 0, i);
}
fos.close();
System.out.println("THE RM2=" +CM2.bitLength());
}
catch (IOException e) {
e.printStackTrace();
}
}
I try make simple program cryptography using java program. my problem when
read block 32 bytes from file clearmsg.txt after convert this block to
intrger number after that use this number for encrypt process the result
size of cipher text not static sometimes 30 bytes sometimes 26 bytes
independet on result of add process like it showing I thinking about how
become cipher block 32 bytes. How add bits to this block because when I
try decrypt this block I need read 32 bytes to decrypt block as the
following my try
private void ENC_add()
{
File clearmsg = new File("F:/java_projects/clearmsg.txt");
File ciphermsg = new File("F:/java_projects/ciphermsg.txt");
byte[] block = new byte[32];
try {
FileInputStream fis = new FileInputStream(clearmsg);
FileOutputStream fcs = new FileOutputStream(ciphermsg);
int i;
while ((i = fis.read(block)) != -1) {
//Is this process true
//here M2 (Plain text) shuld be 32 byte
M2 = new BigInteger(block);
// here encrypt M2 by add k1 where k1 any number less than P
CM2=M2.add(K1).mod(P);
//here my problem some time Cipher CM2 length 31 , some time CM2
length 32 ,some time CM2 length 30
System.out.println("THE CM2=" +CM2.toByteArray().Length);
fcs.write(CM2.toByteArray(), 0, i);
}
fcs.close();
}
catch (IOException e) {
e.printStackTrace();
} }
//Here problem for decrypt
private void DEC_ADD()
{
//DECREPT METHOD
File ciphermsg = new File("F:/java_projects/ciphermsg.txt");
File clearmsg = new File("F:/java_projects/rciphermsg.txt");
byte[] block = new byte[32];
try {
FileInputStream fis = new FileInputStream(ciphermsg);
FileOutputStream fos = new FileOutputStream(clearmsg);
int i;
while ((i = fis.read(block)) != -1) {
//CM2 NOT STATIC BITS NUMBER BECAUSE INDEPENDET ON RESULT ADDITIONAL AND
PRIME NUMBER P through ENCRYPT Process
CM2 = new BigInteger(block);
// here RM2 is decrypt cipher (CM2) NOTE When encrypt above M2 WAS 32
bytes and Cipher CM2 was 30 bytes and When I read from file 32 bytes then
this is my problem
RM2=CM2.subtract(K1).mod(P);
}
fos.write(RM2.toByteArray(), 0, i);
}
fos.close();
System.out.println("THE RM2=" +CM2.bitLength());
}
catch (IOException e) {
e.printStackTrace();
}
}
What framework does forecast io use to "download" an app when you visit their website on iPhone
What framework does forecast io use to "download" an app when you visit
their website on iPhone
If you visit forecast.io from an iPhone, they ask you to download their
app (really you just add to homescreen, and it looks like an actual app).
I think it's some js framework. Anyone know what it is called?
their website on iPhone
If you visit forecast.io from an iPhone, they ask you to download their
app (really you just add to homescreen, and it looks like an actual app).
I think it's some js framework. Anyone know what it is called?
Mac OS X environment variable $PATH
Mac OS X environment variable $PATH
It seems all about this was already discussed, but I can't resolve my
problem. I have all necessary strings in /etc/paths
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
in ~/.bash_profile
export PATH=$PATH:/usr/local/mysql/bin
export PATH=$PATH:$HOME/.rvm/bin
export PATH="$(brew --prefix php54)/bin:$PATH"
export PATH="$(brew --prefix)/bin:$PATH"
But every time I execute
echo $PATH
in terminal, I get only
/usr/local/bin
if I put .bash_profile strings to .profile or .bashrc I have no effect.
It seems all about this was already discussed, but I can't resolve my
problem. I have all necessary strings in /etc/paths
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
in ~/.bash_profile
export PATH=$PATH:/usr/local/mysql/bin
export PATH=$PATH:$HOME/.rvm/bin
export PATH="$(brew --prefix php54)/bin:$PATH"
export PATH="$(brew --prefix)/bin:$PATH"
But every time I execute
echo $PATH
in terminal, I get only
/usr/local/bin
if I put .bash_profile strings to .profile or .bashrc I have no effect.
Python: unexpected behaviour when using dictionary inside class
Python: unexpected behaviour when using dictionary inside class
I'll put the code first:
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Item(object):
... def __init__(self, name, value={}):
... self.name = name
... self.value = value
... def __str__(self):
... return self.name + " - " + str(self.value)
... def addValues(self, value):
... for key,price in value.iteritems():
... self.value[key] = price
...
>>>
>>> item1 = Item('car')
>>> print item1
car - {}
>>> item2 = Item('truck')
>>> print item2
truck - {}
>>> item1.addValues({'blue':6000})
>>> print item1
car - {'blue': 6000}
>>> print item2
truck - {'blue': 6000}
>>>
I created two instances of class Item, item1 and item2. Then, I changed
the value of dictionary attribute on object item1 with addValues method.
The problem is that, adding dictionary attribute of item1, also added the
same value to the item2. Can someone explain what is happening here? How
did changing value on item1 changed the value on item2? Did I overlooked
something?
I'll put the code first:
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Item(object):
... def __init__(self, name, value={}):
... self.name = name
... self.value = value
... def __str__(self):
... return self.name + " - " + str(self.value)
... def addValues(self, value):
... for key,price in value.iteritems():
... self.value[key] = price
...
>>>
>>> item1 = Item('car')
>>> print item1
car - {}
>>> item2 = Item('truck')
>>> print item2
truck - {}
>>> item1.addValues({'blue':6000})
>>> print item1
car - {'blue': 6000}
>>> print item2
truck - {'blue': 6000}
>>>
I created two instances of class Item, item1 and item2. Then, I changed
the value of dictionary attribute on object item1 with addValues method.
The problem is that, adding dictionary attribute of item1, also added the
same value to the item2. Can someone explain what is happening here? How
did changing value on item1 changed the value on item2? Did I overlooked
something?
Dynamically create 5 RadioGroups with 5 RadioButtons to relativelayout in Android?
Dynamically create 5 RadioGroups with 5 RadioButtons to relativelayout in
Android?
I created dynamic 5 radiogroups with 5 radiobuttons. How to get selected
RadioButton text for each group?
Android?
I created dynamic 5 radiogroups with 5 radiobuttons. How to get selected
RadioButton text for each group?
how to use $_POST to relocate few headers in a simpler way?
how to use $_POST to relocate few headers in a simpler way?
Really sorry if I didn't make the title more clear because I am not sure
how to express it in just few words.
Here is the thing, I have a dropdown list and let's say the list has the
values of
bbyc, dtc, atc, and so on maybe like 10 of them. And once if I choose the
bbyc in the dropdown list then the page will go to bbyc.php
this is what I did. But I'm wondering if I have 10 of them do I have it do
it ten times or there's an easier way?
if($_POST["location"] == "bbyc")
{
header('Location: bbyc.php');
}
if($_POST["location"] == "dtc")
{
header('Location: dtc.php');
}
if($_POST["location"] == "atc")
{
header('Location: atc.php');
}
P.S. I tried to search something related but I guess I'm not sure how to
use an exact word to express what I want so my searches don't work.
Anyways whoever replied thank~
Really sorry if I didn't make the title more clear because I am not sure
how to express it in just few words.
Here is the thing, I have a dropdown list and let's say the list has the
values of
bbyc, dtc, atc, and so on maybe like 10 of them. And once if I choose the
bbyc in the dropdown list then the page will go to bbyc.php
this is what I did. But I'm wondering if I have 10 of them do I have it do
it ten times or there's an easier way?
if($_POST["location"] == "bbyc")
{
header('Location: bbyc.php');
}
if($_POST["location"] == "dtc")
{
header('Location: dtc.php');
}
if($_POST["location"] == "atc")
{
header('Location: atc.php');
}
P.S. I tried to search something related but I guess I'm not sure how to
use an exact word to express what I want so my searches don't work.
Anyways whoever replied thank~
Saturday, September 14, 2013
Exit fullscreen breaks in Mountain Lion after changing window's delegate
Exit fullscreen breaks in Mountain Lion after changing window's delegate
I created my project from the Xcode template for non-document based Cocoa
Application.
I have a custom NSWindowController that, after being instantiated on
startup, takes possession of the default window (defined in MainMenu.xib).
If I leave the app delegate's window as it is, I can toggle fullscreen
mode with command-F (set to -toggleFullscreen: in a menu item), or I can
exit from fullscreen by pressing ESC.
Once I set my window controller as the window's delegate (I need this to
do some OpenGL adjustments on enter/exit fullscreen, etc.), I can still
enter fullscreen by pressing command+F, but I can no longer exit
fullscreen (save for command+tab to another app, or command+Q).
Also, the Apple docs mention setting the menu action to -toggleFullscreen:
and the target to nil. How is this last part done in Interface Builder? (I
connected the action to First Responder's -toggleFullscreen:)
What should I do?
I created my project from the Xcode template for non-document based Cocoa
Application.
I have a custom NSWindowController that, after being instantiated on
startup, takes possession of the default window (defined in MainMenu.xib).
If I leave the app delegate's window as it is, I can toggle fullscreen
mode with command-F (set to -toggleFullscreen: in a menu item), or I can
exit from fullscreen by pressing ESC.
Once I set my window controller as the window's delegate (I need this to
do some OpenGL adjustments on enter/exit fullscreen, etc.), I can still
enter fullscreen by pressing command+F, but I can no longer exit
fullscreen (save for command+tab to another app, or command+Q).
Also, the Apple docs mention setting the menu action to -toggleFullscreen:
and the target to nil. How is this last part done in Interface Builder? (I
connected the action to First Responder's -toggleFullscreen:)
What should I do?
Understanding recurrence for running time
Understanding recurrence for running time
I'm doing the exercises in Introduction to Algorithm by CLRS. This is not
graded homework or anything, I'm just trying to understand the problem.
The problem is as follows:
We can express insertion sort as a recursive procedure as follows. In
order to sort A[1..n], we recursively sort A[1..n-1] and then insert A[n]
into the sorted array A[1..n-1]. Write a recurrence for the running time
of this recursive version of insertion sort.
The solution to the problem:
Since it takes O(n) time in the worst case to insert A[n] into the sorted
array A[1. .n −1], we get the recurrence T(n) = O(1) if n = 1 ,
T(n−1)+ O(n) if n > 1 . The solution to this recurrence is T(n) =
O(n^2).
So I get that if n=1, then it is already sorted, therefore it takes O(1)
time. But I don't understand the second part of the recurrence: The O(n)
part is the step where we insert the element being sorted into the array
which takes in the worst case O(n) time - the case where we have to go
through the entire array and insert at the end of it.
I'm having trouble understanding the recursive part of it (T(n-1)). Does
T(n-1) mean that each recursive call we are sorting one less element of
the array? That doesn't seem right.
Thanks, I'm just trying to wrap my brain around this.
I'm doing the exercises in Introduction to Algorithm by CLRS. This is not
graded homework or anything, I'm just trying to understand the problem.
The problem is as follows:
We can express insertion sort as a recursive procedure as follows. In
order to sort A[1..n], we recursively sort A[1..n-1] and then insert A[n]
into the sorted array A[1..n-1]. Write a recurrence for the running time
of this recursive version of insertion sort.
The solution to the problem:
Since it takes O(n) time in the worst case to insert A[n] into the sorted
array A[1. .n −1], we get the recurrence T(n) = O(1) if n = 1 ,
T(n−1)+ O(n) if n > 1 . The solution to this recurrence is T(n) =
O(n^2).
So I get that if n=1, then it is already sorted, therefore it takes O(1)
time. But I don't understand the second part of the recurrence: The O(n)
part is the step where we insert the element being sorted into the array
which takes in the worst case O(n) time - the case where we have to go
through the entire array and insert at the end of it.
I'm having trouble understanding the recursive part of it (T(n-1)). Does
T(n-1) mean that each recursive call we are sorting one less element of
the array? That doesn't seem right.
Thanks, I'm just trying to wrap my brain around this.
Tool to generate JavaScript documentation?
Tool to generate JavaScript documentation?
I tried JSDoc and all it did was copy and paste the whole source code to
an HTML file and called it documentation. Looking at the command line
switches supported, I didn't see anywhere to indicate I only want the
documentation.
Is there any other tool that does what I want without installing third
party software (like Node.js)?
I tried JSDoc and all it did was copy and paste the whole source code to
an HTML file and called it documentation. Looking at the command line
switches supported, I didn't see anywhere to indicate I only want the
documentation.
Is there any other tool that does what I want without installing third
party software (like Node.js)?
OpenGL - Fixed pipeline shader defaults (Mimic fixed pipeline with shaders)
OpenGL - Fixed pipeline shader defaults (Mimic fixed pipeline with shaders)
Can anyone provide me the shader defaults of the Fixed function Pipeline?
I need the Fragment shader default the most.
I want to use fixed pipeline, but have the flexability of shaders, so I
need the default shaders so I'll be able to mimic the functionality of the
fixed pipeline.
Thank you very much!
I'm new here so if you need more information, or its impossible to get the
defaults just tell me :D
Can anyone provide me the shader defaults of the Fixed function Pipeline?
I need the Fragment shader default the most.
I want to use fixed pipeline, but have the flexability of shaders, so I
need the default shaders so I'll be able to mimic the functionality of the
fixed pipeline.
Thank you very much!
I'm new here so if you need more information, or its impossible to get the
defaults just tell me :D
why float is not working in C programming?
why float is not working in C programming?
in my code, the output is 2.000000 whereas it's supposed to be 2.11111
#include<stdio.h>main(){
int i,j;
float r;
i = 19;
j = 9;
r = i / j;
printf(" %f ",r);}
why it's not working?
in my code, the output is 2.000000 whereas it's supposed to be 2.11111
#include<stdio.h>main(){
int i,j;
float r;
i = 19;
j = 9;
r = i / j;
printf(" %f ",r);}
why it's not working?
Move Already Added Annotation To NewLocation
Move Already Added Annotation To NewLocation
I want to move added annotation to newlocation, below is the code and in
else part i want to do that :
In previous code, new annotation is added and previous annotation is
removed, but its get affected in degree of direction. So, i want to move
annotation with out adding new annotation.
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation
*)oldLocation
{
if (newLocation.horizontalAccuracy < 0)
return;
if (!newLocation)
return;
static BOOL annotationAdded = NO;
self.currentLocation = newLocation;
self.previousLocation = oldLocation;
if(self.currentLocation != nil)
{
CLLocationCoordinate2D location =
CLLocationCoordinate2DMake(self.currentLocation.coordinate.latitude,
self.currentLocation.coordinate.longitude);
myAnnotation = [[MyAnnotation alloc] initWithCoordinates:location
title:@"Current Location" subTitle:nil];
if (!annotationAdded)
{
annotationAdded = YES;
[self.myMapView addAnnotation:myAnnotation];
}
else
{
// Here i want to move added annotation to newlocation
coordinates
}
}
}
I want to move added annotation to newlocation, below is the code and in
else part i want to do that :
In previous code, new annotation is added and previous annotation is
removed, but its get affected in degree of direction. So, i want to move
annotation with out adding new annotation.
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation
*)oldLocation
{
if (newLocation.horizontalAccuracy < 0)
return;
if (!newLocation)
return;
static BOOL annotationAdded = NO;
self.currentLocation = newLocation;
self.previousLocation = oldLocation;
if(self.currentLocation != nil)
{
CLLocationCoordinate2D location =
CLLocationCoordinate2DMake(self.currentLocation.coordinate.latitude,
self.currentLocation.coordinate.longitude);
myAnnotation = [[MyAnnotation alloc] initWithCoordinates:location
title:@"Current Location" subTitle:nil];
if (!annotationAdded)
{
annotationAdded = YES;
[self.myMapView addAnnotation:myAnnotation];
}
else
{
// Here i want to move added annotation to newlocation
coordinates
}
}
}
Google Cloud Messaging and server
Google Cloud Messaging and server
I'm developing an app which sends co-ordinates of the user's location to
be displayed on the app being used by a 2nd user.
I read that GCM would be better to use it to push the data to the device.
Now my question is would I need a separate server besides GCM to hold the
data? If so then is GCM approach better or is there another way to pull
the data and update the app/map accordingly?
I'm developing an app which sends co-ordinates of the user's location to
be displayed on the app being used by a 2nd user.
I read that GCM would be better to use it to push the data to the device.
Now my question is would I need a separate server besides GCM to hold the
data? If so then is GCM approach better or is there another way to pull
the data and update the app/map accordingly?
how do I print in python if a list contains only 0s?
how do I print in python if a list contains only 0s?
how do i print in python if a list contains only 0s??
list1=[0,0,0,0,0,0]
if list1 has all 0s
print("something")
I want the output to be "something"
how do i print in python if a list contains only 0s??
list1=[0,0,0,0,0,0]
if list1 has all 0s
print("something")
I want the output to be "something"
Friday, September 13, 2013
Unexpected output in a simple C program
Unexpected output in a simple C program
So, I tried to write a simple C program which would calculate
multiplication of two numbers without using * operator. But the result is
not coming as expected. I can't understand why. This is the code:
#include<stdio.h>
int main()
{
int a=1,b=1,c=1,i;
printf("\n 1st element=");
scanf("%d",&a);
printf("\n 2nd element=");
scanf("%d",&b);
for(i=0;i<b;i++)
{
a=a+a;
}
printf("\n result=%d",a);
return 0;
}
So, I tried to write a simple C program which would calculate
multiplication of two numbers without using * operator. But the result is
not coming as expected. I can't understand why. This is the code:
#include<stdio.h>
int main()
{
int a=1,b=1,c=1,i;
printf("\n 1st element=");
scanf("%d",&a);
printf("\n 2nd element=");
scanf("%d",&b);
for(i=0;i<b;i++)
{
a=a+a;
}
printf("\n result=%d",a);
return 0;
}
Clojure: Meaning of ::tag
Clojure: Meaning of ::tag
Recently I met construction like {::tag 10} in Clojure. What does it mean?
My experiments showed up that it's a keyword to:
=> (type :tag)
clojure.lang.Keyword
=> (type ::tag)
clojure.lang.Keyword
The difference is value itself:
=> :tag
:tag
=> ::tag
:/user/tag
Seems like ::tag is namespace qualified. Is it right guess? If yes, what
the difference between namespace qualified keyword and non-qualified? When
it can be useful?
Recently I met construction like {::tag 10} in Clojure. What does it mean?
My experiments showed up that it's a keyword to:
=> (type :tag)
clojure.lang.Keyword
=> (type ::tag)
clojure.lang.Keyword
The difference is value itself:
=> :tag
:tag
=> ::tag
:/user/tag
Seems like ::tag is namespace qualified. Is it right guess? If yes, what
the difference between namespace qualified keyword and non-qualified? When
it can be useful?
Get facebook video ID from url
Get facebook video ID from url
How to get facebook video [ID] from url such as:
https://www.facebook.com/photo.php?v=[ID]
OR
https://www.facebook.com/photo.php?v=[ID]&type=2&theater
Thanks.
How to get facebook video [ID] from url such as:
https://www.facebook.com/photo.php?v=[ID]
OR
https://www.facebook.com/photo.php?v=[ID]&type=2&theater
Thanks.
unable to print write supplier name in a single gremlin query
unable to print write supplier name in a single gremlin query
unable to solve. I know the problem is behind first inV() while creating
vertex. while executing the first row in the result is ok. but when
iterating to next outE().inV..it again fetch node CP which should be ANZ
this time. buyer side is working fine.
gremlin>
g.v(0).outE().inV.as('supplier').bothE('Sell','Buy').as('tx_amount').inV.as('buyer').select{it.name}{it.amount}{it.name}.sort{it[2]}
==> [supplier:CP, tx_amount:100, buyer:ANZ]
==> [supplier:CP, tx_amount:200, buyer:CP]
unable to solve. I know the problem is behind first inV() while creating
vertex. while executing the first row in the result is ok. but when
iterating to next outE().inV..it again fetch node CP which should be ANZ
this time. buyer side is working fine.
gremlin>
g.v(0).outE().inV.as('supplier').bothE('Sell','Buy').as('tx_amount').inV.as('buyer').select{it.name}{it.amount}{it.name}.sort{it[2]}
==> [supplier:CP, tx_amount:100, buyer:ANZ]
==> [supplier:CP, tx_amount:200, buyer:CP]
Is there any difference between fadeIn() and show() based on their performance?
Is there any difference between fadeIn() and show() based on their
performance?
I would like to know is there any difference in performance between fadeIn
and show.
People keep suggesting me to use show rather than fadeIn.
performance?
I would like to know is there any difference in performance between fadeIn
and show.
People keep suggesting me to use show rather than fadeIn.
should I use synchronized to control threads to have access to database?
should I use synchronized to control threads to have access to database?
i know i can lock the table in databse when thread A is writing data into
that table, so i can protect the table from be modified by other threads.
But in this condition,other threads can only be stopped when they try to
write data into the table.And what i want to do is to prevent them at the
beginning! If other threads must spend much time to work out the data that
will be stored into the table,stop them when they try to work out the data
isn't better? And i want to use synchronized to deal with it: class XX(){
public synchronized writeDataToTable(.....){
.........//some code to work the data that will be stored into the
table.And assum this process(work out the data) will cost much
time
DBhelper.save(data)// store the data into the table
} Am i thinking right?
i know i can lock the table in databse when thread A is writing data into
that table, so i can protect the table from be modified by other threads.
But in this condition,other threads can only be stopped when they try to
write data into the table.And what i want to do is to prevent them at the
beginning! If other threads must spend much time to work out the data that
will be stored into the table,stop them when they try to work out the data
isn't better? And i want to use synchronized to deal with it: class XX(){
public synchronized writeDataToTable(.....){
.........//some code to work the data that will be stored into the
table.And assum this process(work out the data) will cost much
time
DBhelper.save(data)// store the data into the table
} Am i thinking right?
Thursday, September 12, 2013
How to open the same jQuery Dialog from dynamically and non-dynamically created controls
How to open the same jQuery Dialog from dynamically and non-dynamically
created controls
I need to open the same jQuery dialog from different input text controls
(including those that have been created dynamically) This is what my page
displays when it loads for the first time. When the user presses the "Add"
button a new row is added to the table
So far so good. The problem comes when I have to open the dialog that will
let users enter text into the inputs ( the dialog will display upon
clicking on them) At first , I thought it would only be necessary to add a
class to all the controls and then using the class selector just call the
dialog. Unfortunately then I learned that with dynamic controls you have
to use ".on" to attach them events. Once overcome these difficulties , I
run into one more that I haven't been able to solve yet. This is that if
you don't want the dialog to be automatically open upon initialization,
you have to set "autoOpen" to false. I did so but the only result I got
was that none on the inputs worked. I have also tried putting all the code
,regarding the dialog, into a function and then calling that function when
an input is clicked I did also try declaring a variable and setting that
variable to the dialog , something like this:
var dialog= $( "#dialog" )
But it didn't work either I have tried some possibles solutions , but no
luck as of yet. Here is the html code for the aspx page (Default.aspx):
<form id="form1" runat="server">
<div>
<fieldset>
<legend>Expression Builder</legend>
<table id="myTable" class="order-list">
<thead>
<tr>
<td colspan="2">
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right;">
IF(<input type="text" name="condition1"
class="showDialog" />
:
</td>
<td>
<input type="text" name="trueValue"
class="showDialog" />
)
</td>
<td>
<a class="deleteRow"></a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="5" style="text-align: left;">
<input type="button" id="addrow" value="+ Add" />
</td>
</tr>
<tr>
<td colspan="">
ELSE (
<input type="text" name="else" id="else"
class="showDialog" />)
</td>
</tr>
</tfoot>
</table>
</fieldset>
<br />
<input type="button" id="btnEnviar" value="Send" />
</div>
<div id="dialog-form" title="Add New Detail">
<p>
All the fields are required.</p>
<table>
<tr>
<td>
<label for="condition" id="lblcondition">
Condition</label>
</td>
<td>
<input type="text" name="condition" id="condition"
class="text ui-widget-content ui-corner-all" />
</td>
</tr>
<tr>
<td>
<label for="returnValue" id="lblreturnValue">
Return Value</label>
</td>
<td>
<input type="text" name="returnValue" id="returnValue"
class="text ui-widget-content ui-corner-all" />
</td>
</tr>
</table>
</div>
</form>
and here is the javascript code:
<script type="text/javascript">
$(document).ready(function () {
var counter = 0;
$("button, input:submit, input:button").button();
$('input:text').addClass("ui-widget ui-state-default ui-corner-all");
var NewDialog = $("#dialog-form");
NewDialog.dialog({ autoOpen: false });
var Ventana = $("#dialog-form");
$("#addrow").on("click", function () {
var counter = $('#myTable tr').length - 2;
$("#ibtnDel").on("click", function () {
counter = -1
});
var newRow = $("<tr>");
var cols = "";
cols += '<td>ELSE IF(<input type="text" name="condition' +
counter + '" class="showDialog1" /> </td>';
cols += '<td>: <input type="text" name="TrueValue' + counter +
'" class="showDialog1" />)</td>';
cols += '<td><input type="button" id="ibtnDel"
value="-Remove"></td>';
newRow.append(cols);
var txtCondi = newRow.find('input[name^="condition"]');
var txtVarlorV = newRow.find('input[name^="TrueValue"]');
newRow.find('input[class ="showDialog1"]').on("click",
function () {
//Seleccionar la fila
$(this).closest("tr").siblings().removeClass("selectedRow");
$(this).parents("tr").toggleClass("selectedRow",
this.clicked);
Ventana.dialog({
autoOpen: true,
modal: true,
height: 400,
width: 400,
title: "Builder",
buttons: {
"Add": function () {
txtCondi.val($("#condition").val());
txtVarlorV.val($("#returnValue").val());
$("#condition").val("");
$("#returnValue").val("");
$(this).dialog("destroy");
},
Cancel: function () {
//dialogFormValidator.resetForm();
$(this).dialog("destroy")
}
},
close: function () {
$("#condition").val("");
$("#returnValue").val("");
$(this).dialog("destroy")
}
});
return false;
});
$("table.order-list").append(newRow);
counter++;
$("button, input:submit, input:button").button();
$('input:text').addClass("ui-widget ui-state-default
ui-corner-all");
});
$("table.order-list").on("click", "#ibtnDel", function (event) {
$(this).closest("tr").remove();
});
$("#btnEnviar").click(function () {
//Armo el objeto que servira de parametro, para ello utilizo
una libreria JSON
//Este parametro mapeara con el definido en el WebService
var params = new Object();
params.Expresiones = armaObjeto();
$.ajax({
type: "POST",
url: "Default.aspx/Mostrar",
data: JSON.stringify(params),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data, textStatus) {
if (textStatus == "success") {
loadMenuVar(data);
}
},
error: function (request, status, error) {
alert(jQuery.parseJSON(request.responseText).Message);
}
});
});
$(".showDialog").click(function () {
Ventana.dialog({
autoOpen: true,
modal: true,
height: 400,
width: 400,
title: "Constructor",
buttons: [
{ text: "Submit", click: function () { doSomething() } },
{ text: "Cancel", click: function () {
$(this).dialog("destroy") } }
],
close: function () {
$(this).dialog("option", "autoOpen", false);
$(this).dialog("destroy")
}
});
return false;
});
});
This is the closest I've been able to get to the solution, but still can't
get the dialog to remain hidden until a input is clicked
Any advise or guidance would be greatly appreciated. P.S. Sorry for my bad
english
created controls
I need to open the same jQuery dialog from different input text controls
(including those that have been created dynamically) This is what my page
displays when it loads for the first time. When the user presses the "Add"
button a new row is added to the table
So far so good. The problem comes when I have to open the dialog that will
let users enter text into the inputs ( the dialog will display upon
clicking on them) At first , I thought it would only be necessary to add a
class to all the controls and then using the class selector just call the
dialog. Unfortunately then I learned that with dynamic controls you have
to use ".on" to attach them events. Once overcome these difficulties , I
run into one more that I haven't been able to solve yet. This is that if
you don't want the dialog to be automatically open upon initialization,
you have to set "autoOpen" to false. I did so but the only result I got
was that none on the inputs worked. I have also tried putting all the code
,regarding the dialog, into a function and then calling that function when
an input is clicked I did also try declaring a variable and setting that
variable to the dialog , something like this:
var dialog= $( "#dialog" )
But it didn't work either I have tried some possibles solutions , but no
luck as of yet. Here is the html code for the aspx page (Default.aspx):
<form id="form1" runat="server">
<div>
<fieldset>
<legend>Expression Builder</legend>
<table id="myTable" class="order-list">
<thead>
<tr>
<td colspan="2">
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right;">
IF(<input type="text" name="condition1"
class="showDialog" />
:
</td>
<td>
<input type="text" name="trueValue"
class="showDialog" />
)
</td>
<td>
<a class="deleteRow"></a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="5" style="text-align: left;">
<input type="button" id="addrow" value="+ Add" />
</td>
</tr>
<tr>
<td colspan="">
ELSE (
<input type="text" name="else" id="else"
class="showDialog" />)
</td>
</tr>
</tfoot>
</table>
</fieldset>
<br />
<input type="button" id="btnEnviar" value="Send" />
</div>
<div id="dialog-form" title="Add New Detail">
<p>
All the fields are required.</p>
<table>
<tr>
<td>
<label for="condition" id="lblcondition">
Condition</label>
</td>
<td>
<input type="text" name="condition" id="condition"
class="text ui-widget-content ui-corner-all" />
</td>
</tr>
<tr>
<td>
<label for="returnValue" id="lblreturnValue">
Return Value</label>
</td>
<td>
<input type="text" name="returnValue" id="returnValue"
class="text ui-widget-content ui-corner-all" />
</td>
</tr>
</table>
</div>
</form>
and here is the javascript code:
<script type="text/javascript">
$(document).ready(function () {
var counter = 0;
$("button, input:submit, input:button").button();
$('input:text').addClass("ui-widget ui-state-default ui-corner-all");
var NewDialog = $("#dialog-form");
NewDialog.dialog({ autoOpen: false });
var Ventana = $("#dialog-form");
$("#addrow").on("click", function () {
var counter = $('#myTable tr').length - 2;
$("#ibtnDel").on("click", function () {
counter = -1
});
var newRow = $("<tr>");
var cols = "";
cols += '<td>ELSE IF(<input type="text" name="condition' +
counter + '" class="showDialog1" /> </td>';
cols += '<td>: <input type="text" name="TrueValue' + counter +
'" class="showDialog1" />)</td>';
cols += '<td><input type="button" id="ibtnDel"
value="-Remove"></td>';
newRow.append(cols);
var txtCondi = newRow.find('input[name^="condition"]');
var txtVarlorV = newRow.find('input[name^="TrueValue"]');
newRow.find('input[class ="showDialog1"]').on("click",
function () {
//Seleccionar la fila
$(this).closest("tr").siblings().removeClass("selectedRow");
$(this).parents("tr").toggleClass("selectedRow",
this.clicked);
Ventana.dialog({
autoOpen: true,
modal: true,
height: 400,
width: 400,
title: "Builder",
buttons: {
"Add": function () {
txtCondi.val($("#condition").val());
txtVarlorV.val($("#returnValue").val());
$("#condition").val("");
$("#returnValue").val("");
$(this).dialog("destroy");
},
Cancel: function () {
//dialogFormValidator.resetForm();
$(this).dialog("destroy")
}
},
close: function () {
$("#condition").val("");
$("#returnValue").val("");
$(this).dialog("destroy")
}
});
return false;
});
$("table.order-list").append(newRow);
counter++;
$("button, input:submit, input:button").button();
$('input:text').addClass("ui-widget ui-state-default
ui-corner-all");
});
$("table.order-list").on("click", "#ibtnDel", function (event) {
$(this).closest("tr").remove();
});
$("#btnEnviar").click(function () {
//Armo el objeto que servira de parametro, para ello utilizo
una libreria JSON
//Este parametro mapeara con el definido en el WebService
var params = new Object();
params.Expresiones = armaObjeto();
$.ajax({
type: "POST",
url: "Default.aspx/Mostrar",
data: JSON.stringify(params),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data, textStatus) {
if (textStatus == "success") {
loadMenuVar(data);
}
},
error: function (request, status, error) {
alert(jQuery.parseJSON(request.responseText).Message);
}
});
});
$(".showDialog").click(function () {
Ventana.dialog({
autoOpen: true,
modal: true,
height: 400,
width: 400,
title: "Constructor",
buttons: [
{ text: "Submit", click: function () { doSomething() } },
{ text: "Cancel", click: function () {
$(this).dialog("destroy") } }
],
close: function () {
$(this).dialog("option", "autoOpen", false);
$(this).dialog("destroy")
}
});
return false;
});
});
This is the closest I've been able to get to the solution, but still can't
get the dialog to remain hidden until a input is clicked
Any advise or guidance would be greatly appreciated. P.S. Sorry for my bad
english
Figuring out R error-handler stack
Figuring out R error-handler stack
Having spent more time chasing my tail on this than is healthy, I'm just
going to have to ask:
In R, [how] can one figure out what error handlers are in force at a given
point in the code? Somebody somewhere is gracefully intercepting my
errors, and I want them to stop!
Thank you -
Aran
Having spent more time chasing my tail on this than is healthy, I'm just
going to have to ask:
In R, [how] can one figure out what error handlers are in force at a given
point in the code? Somebody somewhere is gracefully intercepting my
errors, and I want them to stop!
Thank you -
Aran
Android: How to touch a scrollview and show its scroll bar for 2 seconds?
Android: How to touch a scrollview and show its scroll bar for 2 seconds?
I'm working on a requirement that involve scrollview and textview. Clients
require that normally the scroll bar is hidden but when user click (touch)
the scrollview, which contain a textview, the scrollbar will appear for a
short time, say 2 secs, to let user know that the this view is scrollable.
It seems very simple. But I have tried some ways but none of it could
achieve this effect. I have tried:
-Assign the scrollview a id, then add onclicklistener function in
activity, use setScrollbarFadingEnabled() function combined with a timer.
Not work. I even tried to set it to both scrollview and textview.
-use ScrollView.scrollBy(0,1) with OnClickListener. Not work.
Here is my xml part for this section:
<ScrollView
android:id="@+id/iScrollView"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_gravity="left"
android:layout_weight="1.5"
android:background="@drawable/border"
android:clickable="true" >
<TextView
android:id="@+id/iTextview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:maxLines="15"
android:minLines="3"
android:padding="5dp"
android:text="Connecting..."
android:textColor="#777777"
android:textSize="15sp" >
</TextView>
</ScrollView>
Is anyone have a simple way to achieve this effect? (I mean, just default
android functions, no third party libraries.
Thank you!
I'm working on a requirement that involve scrollview and textview. Clients
require that normally the scroll bar is hidden but when user click (touch)
the scrollview, which contain a textview, the scrollbar will appear for a
short time, say 2 secs, to let user know that the this view is scrollable.
It seems very simple. But I have tried some ways but none of it could
achieve this effect. I have tried:
-Assign the scrollview a id, then add onclicklistener function in
activity, use setScrollbarFadingEnabled() function combined with a timer.
Not work. I even tried to set it to both scrollview and textview.
-use ScrollView.scrollBy(0,1) with OnClickListener. Not work.
Here is my xml part for this section:
<ScrollView
android:id="@+id/iScrollView"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_gravity="left"
android:layout_weight="1.5"
android:background="@drawable/border"
android:clickable="true" >
<TextView
android:id="@+id/iTextview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:maxLines="15"
android:minLines="3"
android:padding="5dp"
android:text="Connecting..."
android:textColor="#777777"
android:textSize="15sp" >
</TextView>
</ScrollView>
Is anyone have a simple way to achieve this effect? (I mean, just default
android functions, no third party libraries.
Thank you!
Migrating web service from ColdFusion 8 to 10 issues
Migrating web service from ColdFusion 8 to 10 issues
I have a web service that has been running on CF 8 for awhile now without
issues. We've recently moved to CF10, and this web service no longer
works. I've already tried switching the Axis setting to 1, it's still
tossing errors. Has anyone else encountered this, or have an ideas on what
else to look for here?
Process:
CF Server sends a web service request to App Server.
App Server processes request, generates another web service back to CF
Server with SOAP data pushes, then replies back to the step 1 originating
request with a boolean response on how its own web service request went.
CF Server Errors:
The web service operation caused an invocation exception.The root cause
was that: ClientAbortException: java.net.SocketException: Connection reset
by peer: socket write error.
Cannot perform web service invocation [Method Name]. The fault returned
when invoking the web service operation is:
java.lang.NoClassDefFoundError: org/apache/james/mime4j/MimeException
App Server Error Logs:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
SEVERE: SAAJ0009: Message send failed
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
Caused by: java.io.IOException: Error writing to server
I've gone as far as modifying the App Server configuration to have it's
web service request push out to the CF 8 server for processing, while
still replying back to the originating request from the CF 10 server. This
worked fine. It's definitely something with the requests or my CF 10 web
service config.
I can't post any of the code examples unfortunately.
I have a web service that has been running on CF 8 for awhile now without
issues. We've recently moved to CF10, and this web service no longer
works. I've already tried switching the Axis setting to 1, it's still
tossing errors. Has anyone else encountered this, or have an ideas on what
else to look for here?
Process:
CF Server sends a web service request to App Server.
App Server processes request, generates another web service back to CF
Server with SOAP data pushes, then replies back to the step 1 originating
request with a boolean response on how its own web service request went.
CF Server Errors:
The web service operation caused an invocation exception.The root cause
was that: ClientAbortException: java.net.SocketException: Connection reset
by peer: socket write error.
Cannot perform web service invocation [Method Name]. The fault returned
when invoking the web service operation is:
java.lang.NoClassDefFoundError: org/apache/james/mime4j/MimeException
App Server Error Logs:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
SEVERE: SAAJ0009: Message send failed
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
Caused by: java.io.IOException: Error writing to server
I've gone as far as modifying the App Server configuration to have it's
web service request push out to the CF 8 server for processing, while
still replying back to the originating request from the CF 10 server. This
worked fine. It's definitely something with the requests or my CF 10 web
service config.
I can't post any of the code examples unfortunately.
Can not extract href value from anchor tag
Can not extract href value from anchor tag
Trying getting the href value for this HTML
<a class="list-item clearfix"
href="/en/rolex/submariner-date--id2334149.htm" id="watch-2334149"
style="background-color: rgb(255, 255, 255);">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-image-click']);_gaq.push(['second._trackEvent','Click','search','watch-image-click']);"
class="pic ">
<span style="position:absolute">
<img width="100" height="100" alt="Rolex Submariner Date" src=""
class="photo">
</span>
</span>
<span class="disc">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-headline-click']);_gaq.push(['second._trackEvent','Click','search','watch-headline-click']);"
class="watch-headline"><span class="underline">Rolex Submariner
Date</span></span>
<span class="spec">
<span
onmouseover="$('#infobox-title').text('Germany');$('#infobox-text').text('This
dealer is from Augsburg, Germany.')" style="width: 21px;"
class="flag">
<img width="16" height="16" alt=""
src="http://cdn.chrono24.com/images/flags-icons/DE.png">
</span>
<span class="icon i-hasnostore"></span>
<span onmouseover="$('#infobox-title').text('Trusted
Seller since 2004');$('#infobox-text').text('We have
no knowledge about pending/unsolved disputes or
complaints about this seller.')" class="icon
i-trusted"></span>
<span
onmouseover="$('#infobox-title').text('Retailer
recommendations');$('#infobox-text').text('This
watch retailer is recommended on Chrono24 by 1
other watch retailers.')" class="i-buddies">
<span class="icon buddie-count">1</span>
<span class="icon i-star-blue"></span>
</span>
<span onmouseover="$('#infobox-title').text('Trusted Seller
since 2004');$('#infobox-text').text('We have no knowledge
about pending/unsolved disputes or complaints about this
seller.')" class="trustedseller">
<script type="text/javascript">
// <![CDATA[
document.write('Trusted Seller since 2004');
// ]]>
</script>Trusted Seller since 2004
</span>
<span style="width: 2px;" class="icon"></span>
<span onmouseover="$('#infobox-title').text('Premium
Seller');$('#infobox-text').text('The Chrono24 Premium
Seller Package is only available for Trusted Sellers who
frequently use Chrono24.')" class="icon
i-premium"></span>
<span onmouseover="$('#infobox-title').text('Premium
Seller');$('#infobox-text').text('The Chrono24 Premium
Seller Package is only available for Trusted Sellers who
frequently use Chrono24.')"
class="premiumseller">Premium</span>
</span>
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-desc-click']);_gaq.push(['second._trackEvent','Click','search','watch-desc-click']);"
class="description">
Ref. No. 116610 LN; Steel; Automatic; Condition 0 (unworn);
Year 2013; With Box; With Papers; Location: Germany,
Augsburg; The current, the manufacturer's recommended retail
price is 6800 Euro
</span>
<span class="availability">Availability: Available
immediately</span>
</span>
<span class="pricebox">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-price-click']);_gaq.push(['second._trackEvent','Click','search','watch-price-click']);"
class="amount price"><span class="large">$ 7,961</span>
</span>
<span class="buttonbox">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-button-click']);_gaq.push(['second._trackEvent','Click','search','watch-button-click']);"
class="button-blue">
<span>
Watch details
</span>
</span>
</span>
</span>
</a>
preg_match_all('#<a href="(.+)">#',$html,$urlarr);
This is not giving the href value at all , Don't know what going wrong
with this.
Trying getting the href value for this HTML
<a class="list-item clearfix"
href="/en/rolex/submariner-date--id2334149.htm" id="watch-2334149"
style="background-color: rgb(255, 255, 255);">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-image-click']);_gaq.push(['second._trackEvent','Click','search','watch-image-click']);"
class="pic ">
<span style="position:absolute">
<img width="100" height="100" alt="Rolex Submariner Date" src=""
class="photo">
</span>
</span>
<span class="disc">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-headline-click']);_gaq.push(['second._trackEvent','Click','search','watch-headline-click']);"
class="watch-headline"><span class="underline">Rolex Submariner
Date</span></span>
<span class="spec">
<span
onmouseover="$('#infobox-title').text('Germany');$('#infobox-text').text('This
dealer is from Augsburg, Germany.')" style="width: 21px;"
class="flag">
<img width="16" height="16" alt=""
src="http://cdn.chrono24.com/images/flags-icons/DE.png">
</span>
<span class="icon i-hasnostore"></span>
<span onmouseover="$('#infobox-title').text('Trusted
Seller since 2004');$('#infobox-text').text('We have
no knowledge about pending/unsolved disputes or
complaints about this seller.')" class="icon
i-trusted"></span>
<span
onmouseover="$('#infobox-title').text('Retailer
recommendations');$('#infobox-text').text('This
watch retailer is recommended on Chrono24 by 1
other watch retailers.')" class="i-buddies">
<span class="icon buddie-count">1</span>
<span class="icon i-star-blue"></span>
</span>
<span onmouseover="$('#infobox-title').text('Trusted Seller
since 2004');$('#infobox-text').text('We have no knowledge
about pending/unsolved disputes or complaints about this
seller.')" class="trustedseller">
<script type="text/javascript">
// <![CDATA[
document.write('Trusted Seller since 2004');
// ]]>
</script>Trusted Seller since 2004
</span>
<span style="width: 2px;" class="icon"></span>
<span onmouseover="$('#infobox-title').text('Premium
Seller');$('#infobox-text').text('The Chrono24 Premium
Seller Package is only available for Trusted Sellers who
frequently use Chrono24.')" class="icon
i-premium"></span>
<span onmouseover="$('#infobox-title').text('Premium
Seller');$('#infobox-text').text('The Chrono24 Premium
Seller Package is only available for Trusted Sellers who
frequently use Chrono24.')"
class="premiumseller">Premium</span>
</span>
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-desc-click']);_gaq.push(['second._trackEvent','Click','search','watch-desc-click']);"
class="description">
Ref. No. 116610 LN; Steel; Automatic; Condition 0 (unworn);
Year 2013; With Box; With Papers; Location: Germany,
Augsburg; The current, the manufacturer's recommended retail
price is 6800 Euro
</span>
<span class="availability">Availability: Available
immediately</span>
</span>
<span class="pricebox">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-price-click']);_gaq.push(['second._trackEvent','Click','search','watch-price-click']);"
class="amount price"><span class="large">$ 7,961</span>
</span>
<span class="buttonbox">
<span
onclick="_gaq.push(['first._trackEvent','Click','search','watch-button-click']);_gaq.push(['second._trackEvent','Click','search','watch-button-click']);"
class="button-blue">
<span>
Watch details
</span>
</span>
</span>
</span>
</a>
preg_match_all('#<a href="(.+)">#',$html,$urlarr);
This is not giving the href value at all , Don't know what going wrong
with this.
How to get a web page's source (modal window) after JavaScript call
How to get a web page's source (modal window) after JavaScript call
On web site e.g.
http://steamcommunity.com/market/listings/730/CS%3AGO%20Weapon%20Case when
i click "Buy know" modal window will be open. I try to click this button
and then "Buy" button on modal window by using WebClient in Java but i
have always the same page source result. Is there any other way to do this
in java?
Thanks for help and I'm sorry for my english.
On web site e.g.
http://steamcommunity.com/market/listings/730/CS%3AGO%20Weapon%20Case when
i click "Buy know" modal window will be open. I try to click this button
and then "Buy" button on modal window by using WebClient in Java but i
have always the same page source result. Is there any other way to do this
in java?
Thanks for help and I'm sorry for my english.
How to get jQuery UI tabs element panels and set visibility on some of them?
How to get jQuery UI tabs element panels and set visibility on some of them?
How to get jQuery UI tabs tab elements panel numbers and set CSS style
visibility on some of them?
I want to get elements' panel numbers for tabs and set visibility on some
of the tabs.
<div id="tabs">
<ul>
<li><a href="#">1</a>
:
<li><a href="#">10</>
</ul>
<div id="tab-contents">
<div id="tab1">some content</div>
:
<div id="tab1">some content</div>
</div>
Get elements panel number by eq() or something, then set style visibility
= hidden; or visible; for some tab(s). I tried the following but it does
not work for jQuery 1.10.2 and jQuery UI 1.10.3.
$(function() {
var panelNumber = $("#tabs").eq();
document.getElementById("div#tabs ul li").visibility = 'hidden';
alert(panelNumber);
)};
I want to set specified tabs visible and rest of them hidden for the page
navigation. Also, I do not want DOM to create or destroy tab on tabs for
navigtion using css visibility is needed for the minimized process time
because it gets slower.
Please answer the question for the jQuery 1.10.2 and jQuery UI 1.10.3
because they deprecated length and many others for jQuery UI 1.9.* update.
How to get jQuery UI tabs tab elements panel numbers and set CSS style
visibility on some of them?
I want to get elements' panel numbers for tabs and set visibility on some
of the tabs.
<div id="tabs">
<ul>
<li><a href="#">1</a>
:
<li><a href="#">10</>
</ul>
<div id="tab-contents">
<div id="tab1">some content</div>
:
<div id="tab1">some content</div>
</div>
Get elements panel number by eq() or something, then set style visibility
= hidden; or visible; for some tab(s). I tried the following but it does
not work for jQuery 1.10.2 and jQuery UI 1.10.3.
$(function() {
var panelNumber = $("#tabs").eq();
document.getElementById("div#tabs ul li").visibility = 'hidden';
alert(panelNumber);
)};
I want to set specified tabs visible and rest of them hidden for the page
navigation. Also, I do not want DOM to create or destroy tab on tabs for
navigtion using css visibility is needed for the minimized process time
because it gets slower.
Please answer the question for the jQuery 1.10.2 and jQuery UI 1.10.3
because they deprecated length and many others for jQuery UI 1.9.* update.
python script to read the emails from custom folder from Microsoft Outlook mailbox which occurs repeatedly
python script to read the emails from custom folder from Microsoft Outlook
mailbox which occurs repeatedly
I am completely new to Python and have been given the task to write a
program that connects to my Microsoft Outlook mailbox, goes through all
the emails and if the subject has a certain word,goes through the message
body.and thsese typa of msges are recevied for every second and two mails
may cme same time,have to go through all the mails.to make it easier we
have made new folder and set a rule that all these kind of mails are
received to custom folder. The script need to connect to outlook all the
time even if the sytem is log off.and read each and every mail and search
for a perticular value in the body. I had googled abt this and have the
code to read a last mail in inbox.i am nt able to get into the custom
folder.
can any one please share some knowledge about this.
Here is the code import win32com.client
outlook =
win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
message = messages.GetLast()
body_content = message.Body
print body_content
Thanks in advance.
Regards, Smitha. iGate Global Solution.
mailbox which occurs repeatedly
I am completely new to Python and have been given the task to write a
program that connects to my Microsoft Outlook mailbox, goes through all
the emails and if the subject has a certain word,goes through the message
body.and thsese typa of msges are recevied for every second and two mails
may cme same time,have to go through all the mails.to make it easier we
have made new folder and set a rule that all these kind of mails are
received to custom folder. The script need to connect to outlook all the
time even if the sytem is log off.and read each and every mail and search
for a perticular value in the body. I had googled abt this and have the
code to read a last mail in inbox.i am nt able to get into the custom
folder.
can any one please share some knowledge about this.
Here is the code import win32com.client
outlook =
win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
message = messages.GetLast()
body_content = message.Body
print body_content
Thanks in advance.
Regards, Smitha. iGate Global Solution.
Select TOP 2 results in variables without loop
Select TOP 2 results in variables without loop
I want to store the top 2 results in 2 variables.
create table t(id int);
insert into t (id) values (1),(2),(3),(4);
declare @id1 int
declare @id2 int
select top 2 @id1 = first id, @id2 = next id
from t
SQLFiddle
Can I do it in one query without using a loop?
I want to store the top 2 results in 2 variables.
create table t(id int);
insert into t (id) values (1),(2),(3),(4);
declare @id1 int
declare @id2 int
select top 2 @id1 = first id, @id2 = next id
from t
SQLFiddle
Can I do it in one query without using a loop?
Wednesday, September 11, 2013
how do I get the output answer 4 decimal places
how do I get the output answer 4 decimal places
I need to round the outputs to 4 decimal places but I am not quite sure on
how to do that my thing runs exactly how I want it too just need to round
off the last decimals off too 4 places
import java.util.Scanner; //Needed for the Scanner class
public class SphereCalculations
{
public static void main(String[] args) //all the action happens here!
{ Scanner input = new Scanner (System.in);
double radius;
double volume;
double surfaceArea;
System.out.println("Welcome to the Sphere Calculator. ");
System.out.print( "Enter radius of sphere: " );
radius = input.nextDouble();
volume = ((4.0 / 3.0) * (Math.PI * Math.pow(radius, 3)));
surfaceArea = 4 * (Math.PI * Math.pow(radius, 2));
System.out.println("The Results are: ");
System.out.println("Radius: " + radius);
System.out.println("Sphere volume is: " + volume);
System.out.println("Sphere Surface Area is: " + surfaceArea);
}
}
Output:
Radius: 7.5
Volume: 1767.1459
Surface Area: 706.8583
I need to round the outputs to 4 decimal places but I am not quite sure on
how to do that my thing runs exactly how I want it too just need to round
off the last decimals off too 4 places
import java.util.Scanner; //Needed for the Scanner class
public class SphereCalculations
{
public static void main(String[] args) //all the action happens here!
{ Scanner input = new Scanner (System.in);
double radius;
double volume;
double surfaceArea;
System.out.println("Welcome to the Sphere Calculator. ");
System.out.print( "Enter radius of sphere: " );
radius = input.nextDouble();
volume = ((4.0 / 3.0) * (Math.PI * Math.pow(radius, 3)));
surfaceArea = 4 * (Math.PI * Math.pow(radius, 2));
System.out.println("The Results are: ");
System.out.println("Radius: " + radius);
System.out.println("Sphere volume is: " + volume);
System.out.println("Sphere Surface Area is: " + surfaceArea);
}
}
Output:
Radius: 7.5
Volume: 1767.1459
Surface Area: 706.8583
How to locate the source of a crash in Android?
How to locate the source of a crash in Android?
I fix a lot of problems by using the LogCat in Android. Then also on
certain crashes I have the Logcat and/or Console to tell me the source of
the crash.
However I get a LOT of crashes that don't show anything on the LogCat. In
the "Debug" window it simply shows me the stack trace which doesn't give
me any helpful information (see screenshot).
How can I solve the crashes during the times when I only get the stack trace?
I fix a lot of problems by using the LogCat in Android. Then also on
certain crashes I have the Logcat and/or Console to tell me the source of
the crash.
However I get a LOT of crashes that don't show anything on the LogCat. In
the "Debug" window it simply shows me the stack trace which doesn't give
me any helpful information (see screenshot).
How can I solve the crashes during the times when I only get the stack trace?
ASP.net mvc 4 how to use a dropdown menu?
ASP.net mvc 4 how to use a dropdown menu?
I'm new to ASP.net MVC 4 (coming from webforms) and so I am a bit confused
on how to do a certain type of functionality.
I created a dropdown box by using
<select>
@for(var item in ViewBag.Items)
{
<option value="@item.ID">@item.name</option>
}
</select>
and let's say I create an "add" button.
<input type="submit" value="Add" />
and I have a table, let's call the table "cars," with a column called
"CarID."
What I want to happen is to hit the add button, a new row gets added to
the cars table with the car ID the user selected in the dropdown box.
How can I make this happen?
I'm new to ASP.net MVC 4 (coming from webforms) and so I am a bit confused
on how to do a certain type of functionality.
I created a dropdown box by using
<select>
@for(var item in ViewBag.Items)
{
<option value="@item.ID">@item.name</option>
}
</select>
and let's say I create an "add" button.
<input type="submit" value="Add" />
and I have a table, let's call the table "cars," with a column called
"CarID."
What I want to happen is to hit the add button, a new row gets added to
the cars table with the car ID the user selected in the dropdown box.
How can I make this happen?
bind is depreceated on symfony 2.3 => bug with upload file
bind is depreceated on symfony 2.3 => bug with upload file
In symfony 2.3 submit with bind is depreaceted:
$form->bind($this->getRequest());
so i try to use the new solution:
$form->submit($request->request->get($form->getName()));
(like : http://symfony.com/doc/current/cookbook/form/direct_submit.html )
But it isn't work, the value $this->filename of my object is empty
In symfony 2.3 submit with bind is depreaceted:
$form->bind($this->getRequest());
so i try to use the new solution:
$form->submit($request->request->get($form->getName()));
(like : http://symfony.com/doc/current/cookbook/form/direct_submit.html )
But it isn't work, the value $this->filename of my object is empty
VB6 Dealing with large amounts of "IF"s
VB6 Dealing with large amounts of "IF"s
I have a large block of ifs in my code that I do not want to put into an
array as I need them to have unique names.
How would I go about making a much smaller peice of code for this block of
IFs?
Many Thanks.
If chkPO.Value = True Then
ReportTaskCount = ReportTaskCount + 1
End If
If chkGRN.Value = True Then
ReportTaskCount = ReportTaskCount + 1
End If
If chkSO.Value = True Then
ReportTaskCount = ReportTaskCount + 1
End If
ect
ect
ect
I have a large block of ifs in my code that I do not want to put into an
array as I need them to have unique names.
How would I go about making a much smaller peice of code for this block of
IFs?
Many Thanks.
If chkPO.Value = True Then
ReportTaskCount = ReportTaskCount + 1
End If
If chkGRN.Value = True Then
ReportTaskCount = ReportTaskCount + 1
End If
If chkSO.Value = True Then
ReportTaskCount = ReportTaskCount + 1
End If
ect
ect
ect
Tuesday, September 10, 2013
WPF Program - program is not valid win32
WPF Program - program is not valid win32
I have create a Small WPF C# Program with VS2012. it is run successful in
Win 7 and Win 8 , 32Bit and 64bit but it have trouble with windows XP and
after runnig exe file This message is displayed: program is not valid
win32 What is the solution?
I have create a Small WPF C# Program with VS2012. it is run successful in
Win 7 and Win 8 , 32Bit and 64bit but it have trouble with windows XP and
after runnig exe file This message is displayed: program is not valid
win32 What is the solution?
Cannot Archive iPhone Project
Cannot Archive iPhone Project
I got this error while i try to archive iphone project
"Command /bin/sh failed with exit code 127"
But I can run on Simulator and iPhone as well. Only I cannot archive.
What should I do? Thanks for your help.
I got this error while i try to archive iphone project
"Command /bin/sh failed with exit code 127"
But I can run on Simulator and iPhone as well. Only I cannot archive.
What should I do? Thanks for your help.
How to pass data from a FileMaker field to an Applescript
How to pass data from a FileMaker field to an Applescript
I need to delete a file off of my Cincinnati Laser from FileMaker. It gets
it there via a FMScript that export field contents of a container to this
location. So I know the file name and the path its all built in a
calculation field on that record. But I don't know how to get that info
into an Applescript using the FM12 "Perform AppleScript" script step When
I hard code the path and file name (Shown Below) it works.
"set set xpath to "Titanium
Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc"¶ tell application
\"Finder\"¶ delete file xpath¶ end tell"
When I try to pass the field contents (Shown Below) it doesn't work.
"set xpath to Laser::gCNCPath¶ tell application \"Finder\"¶ delete file
xpath¶ end tell"
What am I missing?
I need to delete a file off of my Cincinnati Laser from FileMaker. It gets
it there via a FMScript that export field contents of a container to this
location. So I know the file name and the path its all built in a
calculation field on that record. But I don't know how to get that info
into an Applescript using the FM12 "Perform AppleScript" script step When
I hard code the path and file name (Shown Below) it works.
"set set xpath to "Titanium
Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc"¶ tell application
\"Finder\"¶ delete file xpath¶ end tell"
When I try to pass the field contents (Shown Below) it doesn't work.
"set xpath to Laser::gCNCPath¶ tell application \"Finder\"¶ delete file
xpath¶ end tell"
What am I missing?
Load content with no page refresh while chaning the URL
Load content with no page refresh while chaning the URL
I would like so help with a problem that I am having. I have a website
that I built and below the text on the menu I would like to have a slider.
Like this: DEMO (I didn't write this code and I don't remember where I
found it.)
The Javascript code.
$('li').click( function() {
$('.active').removeClass('active');
$(this).addClass('active');
var top = $(this).offset().top + $(this).height() + 10;
var left = $(this).offset().left;
$('#marker').stop().animate( { top: top, left: left }, 400 );
});
$('li:first').trigger('mouseover');
$('#marker').fadeIn();
That is just a rough idea of what I the navigation menu would look like.
The problem I am having is that I want to have the slider on my website
(but I'll make it so it looks better) and the problem is that when you
click one of the links (e.g. the home button) it will load the new HTML
file and that will couse the slider to not slider smoothly. You won't see
the sliding animation just that the slider change place when you are on
the different pages.
I tried to solve this problem with frameset (frameset) and it worked but
the problem is that frameset couses the URL to not update, and I hate that
so that's not the way I'll solve this problem.
The help I need from you guys is how I could solve this problem. I have
been looking around for a solution but I haven't found any, but I think
that I need to use either JQuery or Javascript.
If you don't have the time to read:
I want a solution on how to make a website that loads content when you
click the menu buttons and not re-loading the whole page, only re-loading
the section where you load in new content. All that and it updates the URL
(e.g. if you're on the home page it would say /home.php and if you're on
the about page it says /about.php and so on and so forth).
Thanks in advance. // DeeLaY
I would like so help with a problem that I am having. I have a website
that I built and below the text on the menu I would like to have a slider.
Like this: DEMO (I didn't write this code and I don't remember where I
found it.)
The Javascript code.
$('li').click( function() {
$('.active').removeClass('active');
$(this).addClass('active');
var top = $(this).offset().top + $(this).height() + 10;
var left = $(this).offset().left;
$('#marker').stop().animate( { top: top, left: left }, 400 );
});
$('li:first').trigger('mouseover');
$('#marker').fadeIn();
That is just a rough idea of what I the navigation menu would look like.
The problem I am having is that I want to have the slider on my website
(but I'll make it so it looks better) and the problem is that when you
click one of the links (e.g. the home button) it will load the new HTML
file and that will couse the slider to not slider smoothly. You won't see
the sliding animation just that the slider change place when you are on
the different pages.
I tried to solve this problem with frameset (frameset) and it worked but
the problem is that frameset couses the URL to not update, and I hate that
so that's not the way I'll solve this problem.
The help I need from you guys is how I could solve this problem. I have
been looking around for a solution but I haven't found any, but I think
that I need to use either JQuery or Javascript.
If you don't have the time to read:
I want a solution on how to make a website that loads content when you
click the menu buttons and not re-loading the whole page, only re-loading
the section where you load in new content. All that and it updates the URL
(e.g. if you're on the home page it would say /home.php and if you're on
the about page it says /about.php and so on and so forth).
Thanks in advance. // DeeLaY
Subscribe to:
Posts (Atom)