jquery - Adding an additional variable to an if statement
I'm trying to add in an additional variable to an if statement but I'm
having trouble. #status refers to the id of a select, and 'student' is one
of the options. The code works fine without the additional && statement.
What am I doing wrong?
var status
$("#status").change(function() {
status = $(this).val();
});
$(function() {
$('#fb').flexbox(jobroles, {
onSelect: function() {
if(this.value==="Multi therapist" &&
$('#status').val()==="Student"){
$("#gdc").show();
}
else{
$("#gdc").hide();
}
Thursday, 3 October 2013
Wednesday, 2 October 2013
Search multine issue
Search multine issue
Hello i'm doing a search by multi lines
Here is my table
PEOPLE
|id| |name| |lastname1|
integer varchar(255) varchar(255)
|1| |Michael New Rails| |Morote|
|2| |Charles Chris Angels| |Flowers|
|3| |Gabriel Francis James| |Owen|
Here is my controller
@people = Person.find(:all,:conditions => ["( name LIKE ? OR
lastname1 LIKE ? OR
(concat(name, \" \", lastname1) LIKE ? )
)" ,
"%#{params[:query]}%",
"%#{params[:query]}%",
"%#{params[:query]}%" ])
But is not working properly
Someone can help me to search by whatever order in the name like me example?
I will really appreciate help
Hello i'm doing a search by multi lines
Here is my table
PEOPLE
|id| |name| |lastname1|
integer varchar(255) varchar(255)
|1| |Michael New Rails| |Morote|
|2| |Charles Chris Angels| |Flowers|
|3| |Gabriel Francis James| |Owen|
Here is my controller
@people = Person.find(:all,:conditions => ["( name LIKE ? OR
lastname1 LIKE ? OR
(concat(name, \" \", lastname1) LIKE ? )
)" ,
"%#{params[:query]}%",
"%#{params[:query]}%",
"%#{params[:query]}%" ])
But is not working properly
Someone can help me to search by whatever order in the name like me example?
I will really appreciate help
3dsmax to Unity export animation
3dsmax to Unity export animation
I'm having some difficulty exporting animated meshes from 3dsmax to Unity3d.
I've succeeded in getting transform animations to export ok, for instance
if something is moving. But animated parameters on something dont seem to
export, for instance the height of box. Here are my fxb export settings
I'm guessing they are losing this information when they are turned from
boxes to meshes and i must back the animations on manually somehow but I
have no idea how.
I'm having some difficulty exporting animated meshes from 3dsmax to Unity3d.
I've succeeded in getting transform animations to export ok, for instance
if something is moving. But animated parameters on something dont seem to
export, for instance the height of box. Here are my fxb export settings
I'm guessing they are losing this information when they are turned from
boxes to meshes and i must back the animations on manually somehow but I
have no idea how.
Why I can't get complete data from using Google Map api?
Why I can't get complete data from using Google Map api?
I created a Python project to test google map api. I occured problem when
I test the first API:Nearby Search Requests.
I tried this url official doc provided:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AddYourOwnKeyHere
if I put this url on my browser,I'll get perfect data on browser. Then I
did nothing but created a python module , here is the code :
if __name__ == '__main__':
import socket
import ssl
sock = ssl.wrap_socket(socket.socket())
sock.connect(('maps.googleapis.com', 443))
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('maps.googleapis.com', 443))
sslSocket = socket.ssl(s)
uri = 'GET
/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&sensor=false&key=MyKey
HTTP/1.1\r\nHost:maps.googleapis.com\r\nContent-Type: application/json;
charset=UTF-8\r\naccept-encoding:gzip,deflate,sdch\r\n\r\n'
sslSocket.write(uri)
data = sock.read()
print 'going to connect...'
print data
s.close()
UnfortunatelyCthe result on the console I got is like this F
going to connect...
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Wed, 02 Oct 2013 08:05:59 GMT
Expires: Wed, 02 Oct 2013 08:10:59 GMT
Cache-Control: public, max-age=300
Vary: Accept-Language
Server: mafe
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 443:quic
Transfer-Encoding: chunked
560b
{
"debug_info" : [],
"html_attributions" : [
"Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow
Pages\u003c/a\u003e"],
"next_page_token" :
"ClRHAAAA4lOaMlZcUjyndIqhBsHzyyU0nD5PHarmjgmnguj3morn7Em-
ipqhSR33V__d0kjrL4PzAqY7y4TAK7Uj3XzWjhoUchLBcBs-
TNFxWIvGst8SEArmj_T7_eDZWyr8UDGy5OEaFPFaK2yHDg7Kv2U3Obsy7opkQfEw",
"results" : [
{
"geometry" : {
"location" : {
"lat" : -33.8599827,
"lng" : 151.2021282
},
"viewport" : {
"northeast" : {
"lat" : -33.8552584,
"lng" : 151.2031401
},
this result is incomplete and I tried many times, the results are same.
So, how to solve this problem?
I created a Python project to test google map api. I occured problem when
I test the first API:Nearby Search Requests.
I tried this url official doc provided:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AddYourOwnKeyHere
if I put this url on my browser,I'll get perfect data on browser. Then I
did nothing but created a python module , here is the code :
if __name__ == '__main__':
import socket
import ssl
sock = ssl.wrap_socket(socket.socket())
sock.connect(('maps.googleapis.com', 443))
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('maps.googleapis.com', 443))
sslSocket = socket.ssl(s)
uri = 'GET
/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&sensor=false&key=MyKey
HTTP/1.1\r\nHost:maps.googleapis.com\r\nContent-Type: application/json;
charset=UTF-8\r\naccept-encoding:gzip,deflate,sdch\r\n\r\n'
sslSocket.write(uri)
data = sock.read()
print 'going to connect...'
print data
s.close()
UnfortunatelyCthe result on the console I got is like this F
going to connect...
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Wed, 02 Oct 2013 08:05:59 GMT
Expires: Wed, 02 Oct 2013 08:10:59 GMT
Cache-Control: public, max-age=300
Vary: Accept-Language
Server: mafe
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 443:quic
Transfer-Encoding: chunked
560b
{
"debug_info" : [],
"html_attributions" : [
"Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow
Pages\u003c/a\u003e"],
"next_page_token" :
"ClRHAAAA4lOaMlZcUjyndIqhBsHzyyU0nD5PHarmjgmnguj3morn7Em-
ipqhSR33V__d0kjrL4PzAqY7y4TAK7Uj3XzWjhoUchLBcBs-
TNFxWIvGst8SEArmj_T7_eDZWyr8UDGy5OEaFPFaK2yHDg7Kv2U3Obsy7opkQfEw",
"results" : [
{
"geometry" : {
"location" : {
"lat" : -33.8599827,
"lng" : 151.2021282
},
"viewport" : {
"northeast" : {
"lat" : -33.8552584,
"lng" : 151.2031401
},
this result is incomplete and I tried many times, the results are same.
So, how to solve this problem?
Tuesday, 1 October 2013
PostgreSQL crashes upon startup
PostgreSQL crashes upon startup
Every time I restart my Mac OS X Version 10.8.3. and open PSQL Version
9.2.4.3 (14), the PSQL terminal appears for a second and then shuts down.
Below is the info from the docs http://postgresapp.com/documentation
Uninstalling
What I do to remedy the problem is type these 3 lines of code in bash:
open ~/Library/Application\ Support/Postgres --> I delete the Var folder
sudo sysctl -w kern.sysv.shmall=65536 sudo sysctl -w
kern.sysv.shmmax=16777216
When I restart PSQL, it works. The problem I have an empty database. All
my work is gone. How can I get PSQL running permantely so that I do not
have to restart with an empty database?
Every time I restart my Mac OS X Version 10.8.3. and open PSQL Version
9.2.4.3 (14), the PSQL terminal appears for a second and then shuts down.
Below is the info from the docs http://postgresapp.com/documentation
Uninstalling
What I do to remedy the problem is type these 3 lines of code in bash:
open ~/Library/Application\ Support/Postgres --> I delete the Var folder
sudo sysctl -w kern.sysv.shmall=65536 sudo sysctl -w
kern.sysv.shmmax=16777216
When I restart PSQL, it works. The problem I have an empty database. All
my work is gone. How can I get PSQL running permantely so that I do not
have to restart with an empty database?
Logic in an overloaded constructor in scala
Logic in an overloaded constructor in scala
I am trying to add some processing logic in an overloaded constructor, but
cannot seem to get it working.
Here is a simplified example of what I want to do:
class FooBar(val x: String, val y: String) {
this(z: String) = {
// DO SOME ARBITRARY CODE
val x = // SOME ARBITRARY PROCESSING USING z
val y = // SOME ARBITRARY PROCESSING USING z
this(x, y)
}
}
However, I am getting a compilation error:
: 'this' expected but 'val' found
This is a very simple task in Java, I would simply set the x, y instance
variables from 2 separate constructors.
Here is my Java equivalent of what I would like to accomplish:
class FooBar {
public String x;
public String y;
public FooBar(String x, String y) {
this.x = x;
this.y = y;
}
public FooBar(String z) {
// DO SOME ARBITRARY CODE
this.x = // SOME ARBITRARY PROCESSING USING z
this.y = // SOME ARBITRARY PROCESSING USING z
}
}
I am trying to add some processing logic in an overloaded constructor, but
cannot seem to get it working.
Here is a simplified example of what I want to do:
class FooBar(val x: String, val y: String) {
this(z: String) = {
// DO SOME ARBITRARY CODE
val x = // SOME ARBITRARY PROCESSING USING z
val y = // SOME ARBITRARY PROCESSING USING z
this(x, y)
}
}
However, I am getting a compilation error:
: 'this' expected but 'val' found
This is a very simple task in Java, I would simply set the x, y instance
variables from 2 separate constructors.
Here is my Java equivalent of what I would like to accomplish:
class FooBar {
public String x;
public String y;
public FooBar(String x, String y) {
this.x = x;
this.y = y;
}
public FooBar(String z) {
// DO SOME ARBITRARY CODE
this.x = // SOME ARBITRARY PROCESSING USING z
this.y = // SOME ARBITRARY PROCESSING USING z
}
}
Square root of a natural number to square root of another natural number math.stackexchange.com
Square root of a natural number to square root of another natural number –
math.stackexchange.com
Is there such integers $x,y$ which they're not perfect squares and they're
not equal, such that: $\sqrt{x}^\sqrt{y}$ is actually an integer? Or
rational number?
math.stackexchange.com
Is there such integers $x,y$ which they're not perfect squares and they're
not equal, such that: $\sqrt{x}^\sqrt{y}$ is actually an integer? Or
rational number?
IPv6, cant ping Google from linux server
IPv6, cant ping Google from linux server
i assigned an IPv6 to my VPS (myipv6::5) from my host dedicated server
which has myipv6::/64 assigned to it by datacenter.
from VPS i did: ping6 -I myipv6::5 myipv6::1
So Im able to ping gateway, but I cannot ping past the gateway like this...
ping6 -I myvpsipv6::5 ipv6.google.com
PING ipv6.google.com(wg-in-x6a.1e100.net) from myipv6::5 : 56 data bytes
From myipv6::1 icmp_seq=2 Destination unreachable: Address unreachable
From myipv6::1 icmp_seq=3 Destination unreachable: Address unreachable
From myipv6::1 icmp_seq=4 Destination unreachable: Address unreachable
When i do same command (ping6 -I myipv6::5ipv6.google.com) at host machine
(node server) where this VPS resides, the result is SAME "Address
unreachable".
Here are commands i did on host dedicated server
ifconfig
eth0 Link encap:Ethernet HWaddr 4C:72:B9:D2:BD:D4
inet addr:myipv4addresshere Bcast:*.*.*.255 Mask:255.255.255.0
inet6 addr: myipv6here::1/64 Scope:Global
inet6 addr: fe80::4e27:c8ff:fec2:bdd4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1767143835 errors:0 dropped:0 overruns:0 frame:0
TX packets:2246662202 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:878001097058 (817.7 GiB) TX bytes:2303874402348 (2.0 TiB)
Interrupt:225 Memory:fe500000-fe520000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8467408 errors:0 dropped:0 overruns:0 frame:0
TX packets:8467408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1050265852 (1001.6 MiB) TX bytes:1050265852 (1001.6 MiB)
venet0 Link encap:UNSPEC HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet6 addr: fe80::1/128 Scope:Link
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:2223530855 errors:0 dropped:0 overruns:0 frame:0
TX packets:1740960126 errors:0 dropped:1948050 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2262666403904 (2.0 TiB) TX bytes:831015511414 (773.9 GiB)
route -n -A inet6
Kernel IPv6 routing table
Destination Next Hop
Flags Metric Ref Use Iface
myipv6here::5/128 ::
U 1024 0 0 venet0
myipv6here::6/128 ::
U 1024 0 0 venet0
myipv6here::/64 ::
U 256 1 0 eth0
myipv6herefff:ff:ff:ff:ff/128 ::
U 1024 1 0 eth0
fe80::/64 ::
U 256 0 0 eth0
fe80::/64 ::
U 256 0 0 venet0
::/0 myipv6here::
UG 1 34866 0 eth0
::/0 myipv6herefff:ff:ff:ff:ff
UG 1024 0 0 eth0
::1/128 ::
U 0 18787 1 lo
myipv6here::/128 ::
U 0 0 1 lo
myipv6here::1/128 ::
U 0 131933 1 lo
fe80::/128 ::
U 0 0 1 lo
fe80::1/128 ::
U 0 0 1 lo
fe80::4e27:c8ff:fec2:bdd4/128 ::
U 0 2 1 lo
ff00::/8 ::
U 256 0 0 eth0
ff00::/8 ::
file /etc/sysconfig/network:
NETWORKING_IPV6=yes
IPV6FORWARDING=yes
IPV6_DEFAULTDEV=eth0
IPV6_DEFAULTGW=myipv6here:0000:0000:0000:0000 ([openvz][1] shows that it
should end by ::1)
IPV6_AUTOCONF=no
file etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=myipv6here::1/64 (openvz shows that this ip should be without /64)
file /etc/sysctl.conf
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.proxy_ndp = 1
net.ipv6.bindv6only = 1
net.ipv4.conf.default.proxy_arp=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.conf.default.send_redirects=1
net.ipv4.conf.all.send_redirects=0
Please anyone have ideas how to make this IPv6 working on the host server?
Isnt there any issue with route? I read this post, which might give an
idea about route, but i cant understand how that apply on my case, anyone
please can help?
i assigned an IPv6 to my VPS (myipv6::5) from my host dedicated server
which has myipv6::/64 assigned to it by datacenter.
from VPS i did: ping6 -I myipv6::5 myipv6::1
So Im able to ping gateway, but I cannot ping past the gateway like this...
ping6 -I myvpsipv6::5 ipv6.google.com
PING ipv6.google.com(wg-in-x6a.1e100.net) from myipv6::5 : 56 data bytes
From myipv6::1 icmp_seq=2 Destination unreachable: Address unreachable
From myipv6::1 icmp_seq=3 Destination unreachable: Address unreachable
From myipv6::1 icmp_seq=4 Destination unreachable: Address unreachable
When i do same command (ping6 -I myipv6::5ipv6.google.com) at host machine
(node server) where this VPS resides, the result is SAME "Address
unreachable".
Here are commands i did on host dedicated server
ifconfig
eth0 Link encap:Ethernet HWaddr 4C:72:B9:D2:BD:D4
inet addr:myipv4addresshere Bcast:*.*.*.255 Mask:255.255.255.0
inet6 addr: myipv6here::1/64 Scope:Global
inet6 addr: fe80::4e27:c8ff:fec2:bdd4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1767143835 errors:0 dropped:0 overruns:0 frame:0
TX packets:2246662202 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:878001097058 (817.7 GiB) TX bytes:2303874402348 (2.0 TiB)
Interrupt:225 Memory:fe500000-fe520000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8467408 errors:0 dropped:0 overruns:0 frame:0
TX packets:8467408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1050265852 (1001.6 MiB) TX bytes:1050265852 (1001.6 MiB)
venet0 Link encap:UNSPEC HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet6 addr: fe80::1/128 Scope:Link
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:2223530855 errors:0 dropped:0 overruns:0 frame:0
TX packets:1740960126 errors:0 dropped:1948050 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2262666403904 (2.0 TiB) TX bytes:831015511414 (773.9 GiB)
route -n -A inet6
Kernel IPv6 routing table
Destination Next Hop
Flags Metric Ref Use Iface
myipv6here::5/128 ::
U 1024 0 0 venet0
myipv6here::6/128 ::
U 1024 0 0 venet0
myipv6here::/64 ::
U 256 1 0 eth0
myipv6herefff:ff:ff:ff:ff/128 ::
U 1024 1 0 eth0
fe80::/64 ::
U 256 0 0 eth0
fe80::/64 ::
U 256 0 0 venet0
::/0 myipv6here::
UG 1 34866 0 eth0
::/0 myipv6herefff:ff:ff:ff:ff
UG 1024 0 0 eth0
::1/128 ::
U 0 18787 1 lo
myipv6here::/128 ::
U 0 0 1 lo
myipv6here::1/128 ::
U 0 131933 1 lo
fe80::/128 ::
U 0 0 1 lo
fe80::1/128 ::
U 0 0 1 lo
fe80::4e27:c8ff:fec2:bdd4/128 ::
U 0 2 1 lo
ff00::/8 ::
U 256 0 0 eth0
ff00::/8 ::
file /etc/sysconfig/network:
NETWORKING_IPV6=yes
IPV6FORWARDING=yes
IPV6_DEFAULTDEV=eth0
IPV6_DEFAULTGW=myipv6here:0000:0000:0000:0000 ([openvz][1] shows that it
should end by ::1)
IPV6_AUTOCONF=no
file etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=myipv6here::1/64 (openvz shows that this ip should be without /64)
file /etc/sysctl.conf
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.proxy_ndp = 1
net.ipv6.bindv6only = 1
net.ipv4.conf.default.proxy_arp=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.conf.default.send_redirects=1
net.ipv4.conf.all.send_redirects=0
Please anyone have ideas how to make this IPv6 working on the host server?
Isnt there any issue with route? I read this post, which might give an
idea about route, but i cant understand how that apply on my case, anyone
please can help?
Monday, 30 September 2013
Is the union of finitely many open sets in an omega-cover contained within some member of the cover?
Is the union of finitely many open sets in an omega-cover contained within
some member of the cover?
Let $\mathcal{U}$ be an open cover of $\mathbb{R}$ (Standard Topology)
such that $\mathbb{R} \not \in \mathcal{U}$ and for any finite set $A$
there is a $U \in \mathcal{U}$ such that $A \subseteq U$. We call such an
open cover an $\omega$-cover. Can we show that for any finite set $B
\subset \mathcal{U}$, there is a $V \in \mathcal{U}$ such that $\cup B
\subseteq V$?
Ultimately I'm working on showing the following. Let $\langle
\mathcal{U}_n: n \in \mathbb{N} \rangle$ be a sequence of $\omega$-covers.
Can we find a sequence $\langle F_n: n \in \mathbb{N} \rangle$ with each
$F_n \in \mathcal{U}_n$ such that $\cup F_n$ is an open cover of
$\mathbb{R}$?
My approach here was to use each $\mathcal{U}_n$ to cover $[-n,n]$, thus
eventually covering all of $\mathbb{R}$. Since $[-n,n]$ is compact and
$\mathcal{U}_n$ is a cover, $\mathcal{U}_n$ has a finite subcover. But
that's as far as I can get unless what I conjectured above is true.
some member of the cover?
Let $\mathcal{U}$ be an open cover of $\mathbb{R}$ (Standard Topology)
such that $\mathbb{R} \not \in \mathcal{U}$ and for any finite set $A$
there is a $U \in \mathcal{U}$ such that $A \subseteq U$. We call such an
open cover an $\omega$-cover. Can we show that for any finite set $B
\subset \mathcal{U}$, there is a $V \in \mathcal{U}$ such that $\cup B
\subseteq V$?
Ultimately I'm working on showing the following. Let $\langle
\mathcal{U}_n: n \in \mathbb{N} \rangle$ be a sequence of $\omega$-covers.
Can we find a sequence $\langle F_n: n \in \mathbb{N} \rangle$ with each
$F_n \in \mathcal{U}_n$ such that $\cup F_n$ is an open cover of
$\mathbb{R}$?
My approach here was to use each $\mathcal{U}_n$ to cover $[-n,n]$, thus
eventually covering all of $\mathbb{R}$. Since $[-n,n]$ is compact and
$\mathcal{U}_n$ is a cover, $\mathcal{U}_n$ has a finite subcover. But
that's as far as I can get unless what I conjectured above is true.
Can literals in Python be overridden=?iso-8859-1?Q?=3F_=96_stackoverflow.com?=
Can literals in Python be overridden? – stackoverflow.com
Couldn't find a way to phrase the title better, feel free to correct. I'm
pretty new to Python, currently experimenting with the language.. I've
noticed that all built-ins types cannot be extended …
Couldn't find a way to phrase the title better, feel free to correct. I'm
pretty new to Python, currently experimenting with the language.. I've
noticed that all built-ins types cannot be extended …
textbox in continuous form populated from different table
textbox in continuous form populated from different table
I have a continuous form in an access 2010 database that outputs a
separate row of data for each customer from a customers_table. The
continuous form is for data display only, and no data entry or editing is
allowed. One of the textboxes on the continuous form is populated with
data that was entered using a combobox in a different form used for data
entry. In the textbox on the continuous form, enabled is set to no, and
locked is set to yes, so that the textbox is not editable in the
continuous form. However, in the separate data entry form, the combobox
entered the id for the selection the user chose, instead of entering the
text. Therefore, in the continuous form, only an id number is shown, when
the user needs to see the text of the specific option which is encoded in
that id number.
I think I want to keep the id in the customers data table, in order to
retain freedom to make subtle changes in the combobox options later.
So how do I modify the textbox in the continuous form to populate with the
textual value associated with the id number? This would seem to involve
some sort of SQL like:
"Select textValue FROM comboboxsource_table WHERE
comboboxsource_table.ID=textbox.Text"
However, I have no idea where to put this in the Access GUI. The Control
Source field in the Data tab of the property sheet for the textbox does
not seem to allow this sort of syntax.
I have a continuous form in an access 2010 database that outputs a
separate row of data for each customer from a customers_table. The
continuous form is for data display only, and no data entry or editing is
allowed. One of the textboxes on the continuous form is populated with
data that was entered using a combobox in a different form used for data
entry. In the textbox on the continuous form, enabled is set to no, and
locked is set to yes, so that the textbox is not editable in the
continuous form. However, in the separate data entry form, the combobox
entered the id for the selection the user chose, instead of entering the
text. Therefore, in the continuous form, only an id number is shown, when
the user needs to see the text of the specific option which is encoded in
that id number.
I think I want to keep the id in the customers data table, in order to
retain freedom to make subtle changes in the combobox options later.
So how do I modify the textbox in the continuous form to populate with the
textual value associated with the id number? This would seem to involve
some sort of SQL like:
"Select textValue FROM comboboxsource_table WHERE
comboboxsource_table.ID=textbox.Text"
However, I have no idea where to put this in the Access GUI. The Control
Source field in the Data tab of the property sheet for the textbox does
not seem to allow this sort of syntax.
Deserialize Xml with RestSharp
Deserialize Xml with RestSharp
I'm having problems getting RestSharp to deserialize some XML
this is a sample of the xml
<data xmlns:xlink="http://www.w3.org/1999/xlink">
<parameters xmlns="">
<query-strings>
<query-string value="testValue"></query-string>
</query-strings>
<sources>
<source id="database"></source>
</sources>
</parameters>
<objects>
<object xmlns="" type="testType">
<source id="database"></source>
</object>
<object xmlns="" type="testType">
<source id="database2"></source>
</object>
<object xmlns="" type="testType">
<source id="database3"></source>
</object>
</objects>
</data>
Below is the Class that I'm trying to deserialize to
public class Data
{
public Parameter Parameters { get; set; }
}
public class Parameter
{
public string InverseLookup { get; set; }
public string TypeFilters { get; set; }
public List<QueryString> QueryStrings { get; set; }
public List<Source> Sources { get; set; }
public List<Item> objects { get; set; }
}
public class QueryString
{
public string value { get; set; }
}
public class Source
{
public string Id { get; set; }
}
public class Item
{
public string Type { get; set; }
public Source Source { get; set; }
}
The problem that I have is the objects element, I just can't seem to get
this to deserialize. Does anyone have any idea what's going on?
I'm having problems getting RestSharp to deserialize some XML
this is a sample of the xml
<data xmlns:xlink="http://www.w3.org/1999/xlink">
<parameters xmlns="">
<query-strings>
<query-string value="testValue"></query-string>
</query-strings>
<sources>
<source id="database"></source>
</sources>
</parameters>
<objects>
<object xmlns="" type="testType">
<source id="database"></source>
</object>
<object xmlns="" type="testType">
<source id="database2"></source>
</object>
<object xmlns="" type="testType">
<source id="database3"></source>
</object>
</objects>
</data>
Below is the Class that I'm trying to deserialize to
public class Data
{
public Parameter Parameters { get; set; }
}
public class Parameter
{
public string InverseLookup { get; set; }
public string TypeFilters { get; set; }
public List<QueryString> QueryStrings { get; set; }
public List<Source> Sources { get; set; }
public List<Item> objects { get; set; }
}
public class QueryString
{
public string value { get; set; }
}
public class Source
{
public string Id { get; set; }
}
public class Item
{
public string Type { get; set; }
public Source Source { get; set; }
}
The problem that I have is the objects element, I just can't seem to get
this to deserialize. Does anyone have any idea what's going on?
Sunday, 29 September 2013
How do I choose random objects of the same type from a vector array of differing types?
How do I choose random objects of the same type from a vector array of
differing types?
Let's say for example a vector is composed of some objects, one of type
rectangle, some of type triangle, and then circles.
v = [rectangle, triangle, triangle, circle, circle]
The vector's size can change. I can add another circle as so:
v.addElement(circle);
and..
v = [rectangle, triangle, triangle, circle, circle, circle]
but each object type is clustered together like above. It can't be like:
v = [rectangle, circle, circle, triangle, circle, triangle] //<-- can't be.
I know I explained it pretty horrible but hopefully, it's enough to
understand my scenario. Now, I want to randomly choose, for example, an
object of type circle.
My thought process is to make a separate method that 1, finds the
beginning index and 2, find the ending index and then use random functions
off of that. Is there a more elegant way to solve this problem of only
choosing randomly off of circles?
differing types?
Let's say for example a vector is composed of some objects, one of type
rectangle, some of type triangle, and then circles.
v = [rectangle, triangle, triangle, circle, circle]
The vector's size can change. I can add another circle as so:
v.addElement(circle);
and..
v = [rectangle, triangle, triangle, circle, circle, circle]
but each object type is clustered together like above. It can't be like:
v = [rectangle, circle, circle, triangle, circle, triangle] //<-- can't be.
I know I explained it pretty horrible but hopefully, it's enough to
understand my scenario. Now, I want to randomly choose, for example, an
object of type circle.
My thought process is to make a separate method that 1, finds the
beginning index and 2, find the ending index and then use random functions
off of that. Is there a more elegant way to solve this problem of only
choosing randomly off of circles?
Trying to ignore files that begin with a "." but script not working
Trying to ignore files that begin with a "." but script not working
Got a question that hopefully is just me doing a stupid mistake.
I have a script where I'm searching for specified mxf files. At the same
time I'm try ignore files beginning with a period (.) because those are
the hidden files that I don't need to search. I'm not sure what I'm doing
wrong with the script. I keep getting an error when my script searches the
drive and runs into a file or folder that I do not have permission for and
was trying to ignore. Can anyone help? The script is below.
echo Searching for digitized INTV footage...
find /Volumes/TestingTranscode* \
-type f \( \
-iname "*V01.*.mxf" ! \
-iname "Avid_Mob*" ! \
-iname ".*" ! \
-ipath "*Creating*" \
\) \
-exec
/Users/admin/TestingTranscode/01_BashScripts/postfind_gw_digitize.sh
{} \;
Got a question that hopefully is just me doing a stupid mistake.
I have a script where I'm searching for specified mxf files. At the same
time I'm try ignore files beginning with a period (.) because those are
the hidden files that I don't need to search. I'm not sure what I'm doing
wrong with the script. I keep getting an error when my script searches the
drive and runs into a file or folder that I do not have permission for and
was trying to ignore. Can anyone help? The script is below.
echo Searching for digitized INTV footage...
find /Volumes/TestingTranscode* \
-type f \( \
-iname "*V01.*.mxf" ! \
-iname "Avid_Mob*" ! \
-iname ".*" ! \
-ipath "*Creating*" \
\) \
-exec
/Users/admin/TestingTranscode/01_BashScripts/postfind_gw_digitize.sh
{} \;
How to get pip to work behind a proxy server
How to get pip to work behind a proxy server
I am trying to use python package manager pip to install a package and
it's dependencies from the internet. However I am behind a proxy in my
college and have already set the http_proxy environment variable. But when
I try to install a package like this:
pip install TwitterApi
I get this error in the log file:
Getting page http://pypi.python.org/simple/TwitterApi
Could not fetch URL http://pypi.python.org/simple/TwitterApi: <urlopen
error [Errno 111] Connection refused>
Will skip URL http://pypi.python.org/simple/TwitterApi when looking for
download links for TwitterApi
Getting page http://pypi.python.org/simple/
Could not fetch URL http://pypi.python.org/simple/: <urlopen error [Errno
111] Connection refused>
I even tried setting my proxy variable explicitly like this:
pip install --proxy http://user:password@proxyserver:port TwitterApi
But I still get the same error. How do I get pip to work behind a proxy
server.
I am trying to use python package manager pip to install a package and
it's dependencies from the internet. However I am behind a proxy in my
college and have already set the http_proxy environment variable. But when
I try to install a package like this:
pip install TwitterApi
I get this error in the log file:
Getting page http://pypi.python.org/simple/TwitterApi
Could not fetch URL http://pypi.python.org/simple/TwitterApi: <urlopen
error [Errno 111] Connection refused>
Will skip URL http://pypi.python.org/simple/TwitterApi when looking for
download links for TwitterApi
Getting page http://pypi.python.org/simple/
Could not fetch URL http://pypi.python.org/simple/: <urlopen error [Errno
111] Connection refused>
I even tried setting my proxy variable explicitly like this:
pip install --proxy http://user:password@proxyserver:port TwitterApi
But I still get the same error. How do I get pip to work behind a proxy
server.
Saturday, 28 September 2013
Adobe AIR for Android - Open native facebook app
Adobe AIR for Android - Open native facebook app
So I've been trying to figure out a way to open the native android
facebook app from my Adobe AIR game but couldn't find a solution yet.
Basically I am interesting in letting my users open my game's facebook
page and be able to click the like button.
My current solution is to open a webview but that is not good enough
because users will have to enter their facebook login details.
So I just need them to open my game's page directly in their facebook app
without needing to enter login details in a webview.
Is there a solution for this?
So I've been trying to figure out a way to open the native android
facebook app from my Adobe AIR game but couldn't find a solution yet.
Basically I am interesting in letting my users open my game's facebook
page and be able to click the like button.
My current solution is to open a webview but that is not good enough
because users will have to enter their facebook login details.
So I just need them to open my game's page directly in their facebook app
without needing to enter login details in a webview.
Is there a solution for this?
SQLite returned cutted strings
SQLite returned cutted strings
I have a database(SQLite) in application and every time when I use
cursor.getString(position), the return is cutted automatically.
Sample: in database the string of field has a 30 chars used, but when run
the query, the return is 20 chars for the app.
I use cursor.query... instruction... with rawQuery is the same results.
See:
Cursor cursor = db.query(true, "mmvv", new String[]{"Version"},
"factory=?", new String[]{"AUDI"}, null, null, "Version", null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
all.add(cursor.getString(0).toString());
cursor.moveToNext();
}
The version of cars has a many chars... in database the chars be ok. Why
the sqlite return cutted strings?
Sorry my trash english...
Thanks!
I have a database(SQLite) in application and every time when I use
cursor.getString(position), the return is cutted automatically.
Sample: in database the string of field has a 30 chars used, but when run
the query, the return is 20 chars for the app.
I use cursor.query... instruction... with rawQuery is the same results.
See:
Cursor cursor = db.query(true, "mmvv", new String[]{"Version"},
"factory=?", new String[]{"AUDI"}, null, null, "Version", null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
all.add(cursor.getString(0).toString());
cursor.moveToNext();
}
The version of cars has a many chars... in database the chars be ok. Why
the sqlite return cutted strings?
Sorry my trash english...
Thanks!
Why can't I use required font in JComboBox
Why can't I use required font in JComboBox
I am unable to change the font in JComboBox despite the fact that font is
ttf and properly installed. My OS is WinXP sp2 with Java 1.7.0 installed.
The same problem arises when using that font in drawString method while
painting with the required font. I can change font to Times New Roman,
Arial etc. My intention is to use Urdu text i.e. Unicode strings in Swing.
Thanks.
Amer Rehman
I am unable to change the font in JComboBox despite the fact that font is
ttf and properly installed. My OS is WinXP sp2 with Java 1.7.0 installed.
The same problem arises when using that font in drawString method while
painting with the required font. I can change font to Times New Roman,
Arial etc. My intention is to use Urdu text i.e. Unicode strings in Swing.
Thanks.
Amer Rehman
Friday, 27 September 2013
Specifying Susbsytem ID in DB2 .Net Provider
Specifying Susbsytem ID in DB2 .Net Provider
I'm using DB2Connect V 9.7. My application is .Net and we use the DB2 .Net
provider(IBM.Data.DB2.dll). My DB2 server is z/OS. Is there anyway to
specify the subsystem ID using this provider? For ODBC, I can see that
there's a configuration setting mvsdefaultssid but I don't see any for the
.Net provider
Thanks Mahesh
I'm using DB2Connect V 9.7. My application is .Net and we use the DB2 .Net
provider(IBM.Data.DB2.dll). My DB2 server is z/OS. Is there anyway to
specify the subsystem ID using this provider? For ODBC, I can see that
there's a configuration setting mvsdefaultssid but I don't see any for the
.Net provider
Thanks Mahesh
CakePHP: Scaffolding after having written edit/view/add
CakePHP: Scaffolding after having written edit/view/add
I have an application in which we give a very friendly interface for
managing data. This is done through many controllers' add/edit/view
functions. But now the requirement has come that we should have "super
admins" able to edit anything, and scaffolding will give them a quick and
dirty manner of changing data. Since scaffolding uses add/edit/view by
default, I've unintentionally overwritten the ability to scaffold.
I can't just go and change all my calls to edit/add for our "user
friendly" data managing. So I want to essentially ignore the add/edit/view
when, for example, a user has a flag of "yes, please let me scaffold". I
imagined it would be something like:
public function edit($id) {
if (admin_user) {
$scaffold;
} else {
[user-friendly version code]
}
}
But no dice. How can I achieve what I want?
I have an application in which we give a very friendly interface for
managing data. This is done through many controllers' add/edit/view
functions. But now the requirement has come that we should have "super
admins" able to edit anything, and scaffolding will give them a quick and
dirty manner of changing data. Since scaffolding uses add/edit/view by
default, I've unintentionally overwritten the ability to scaffold.
I can't just go and change all my calls to edit/add for our "user
friendly" data managing. So I want to essentially ignore the add/edit/view
when, for example, a user has a flag of "yes, please let me scaffold". I
imagined it would be something like:
public function edit($id) {
if (admin_user) {
$scaffold;
} else {
[user-friendly version code]
}
}
But no dice. How can I achieve what I want?
Subscribe to:
Posts (Atom)